@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --cb-orange: #f56c01;
    --cb-orange-hover: #e06000;
    --cb-orange-light: #ff8522;
    --cb-orange-soft: #fff4ec;
    --cb-orange-glow: rgba(245, 108, 1, 0.22);
    
    --cb-black: #0d0906;
    --cb-dark: #171310;
    --cb-dark-surface: #221c17;
    --cb-dark-border: #332b24;
    
    --cb-cream: #fcfbf9;
    --cb-surface: #ffffff;
    --cb-surface-muted: #f7f4ef;
    
    --cb-text-main: #1f1b18;
    --cb-text-muted: #6e6761;
    --cb-text-light: #9c938c;
    
    --cb-border: #e8e2da;
    --cb-border-subtle: #f0ebe4;
    
    --cb-green: #10b981;
    --cb-green-soft: #ecfdf5;
    --cb-green-text: #065f46;
    --cb-green-border: #a7f3d0;
    
    --cb-red: #ef4444;
    --cb-red-soft: #fef2f2;
    --cb-red-text: #991b1b;
    --cb-red-border: #fecaca;
    
    --cb-amber: #f59e0b;
    --cb-amber-soft: #fffbeb;
    --cb-amber-text: #92400e;
    --cb-amber-border: #fde68a;
    
    --cb-tg-blue: #229ed9;
    --cb-tg-blue-soft: #e8f6fc;
    --cb-tg-blue-border: #bee3f8;
    
    --cb-yt-red: #ff0000;
    --cb-yt-red-soft: #fff1f0;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    
    --shadow-sm: 0 2px 8px rgba(13, 9, 6, 0.04);
    --shadow-md: 0 8px 24px rgba(13, 9, 6, 0.07);
    --shadow-lg: 0 16px 40px rgba(13, 9, 6, 0.1);
    --shadow-glow: 0 10px 30px var(--cb-orange-glow);
    
    --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    min-height: 100vh;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--cb-cream);
    color: var(--cb-text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

img, svg {
    display: block;
    max-width: 100%;
}

button, input, select {
    font-family: inherit;
}

/* Base Wrapper */
.wrap {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px 24px 60px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Header & Navigation */
.header {
    margin-bottom: 32px;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--cb-surface);
    border: 1px solid var(--cb-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    gap: 16px;
}

/* Castro Brothers Brand Lockup */
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

.brand-logo-img {
    height: 42px;
    width: auto;
    object-fit: contain;
    transition: var(--transition);
}

.brand:hover .brand-logo-img {
    transform: scale(1.03);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.brand-title {
    font-size: 17px;
    font-weight: 900;
    letter-spacing: -0.5px;
    color: var(--cb-black);
}

.brand-subtitle {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--cb-orange);
    margin-top: 4px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 48px;
    position: relative;
    z-index: 1;
}

.hero-logo-box {
    background: radial-gradient(circle, rgba(245, 108, 1, 0.12) 0%, rgba(13, 9, 6, 0.6) 80%);
    border: 1px solid rgba(245, 108, 1, 0.25);
    border-radius: var(--radius-xl);
    padding: 32px;
    display: grid;
    place-items: center;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
}

.hero-logo-img {
    width: 220px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 10px 25px rgba(245, 108, 1, 0.35));
    transition: var(--transition);
}

.hero-logo-box:hover .hero-logo-img {
    transform: scale(1.04) rotate(-1deg);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--cb-text-muted);
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
    color: var(--cb-black);
    background: var(--cb-surface-muted);
}

.nav-link.active {
    color: var(--cb-orange);
    font-weight: 700;
}

/* Flash Messages */
.flash {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    background: var(--cb-green-soft);
    color: var(--cb-green-text);
    border: 1px solid var(--cb-green-border);
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 600;
    animation: fadeIn 0.3s ease;
}

.flash.error {
    background: var(--cb-red-soft);
    color: var(--cb-red-text);
    border-color: var(--cb-red-border);
}

.flash-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

/* Hero Section */
.hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--cb-dark) 0%, var(--cb-black) 100%);
    color: #ffffff;
    border-radius: var(--radius-xl);
    padding: 64px 54px;
    margin-bottom: 36px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--cb-dark-border);
}

.hero-accent {
    position: absolute;
    right: -40px;
    top: -40px;
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, var(--cb-orange-glow) 0%, rgba(245, 108, 1, 0) 70%);
    pointer-events: none;
    z-index: 0;
}

.hero-skew-shape {
    position: absolute;
    right: 8%;
    bottom: -60px;
    width: 220px;
    height: 320px;
    background: linear-gradient(135deg, rgba(245, 108, 1, 0.15), rgba(245, 108, 1, 0.03));
    transform: skew(-18deg);
    border-left: 2px solid rgba(245, 108, 1, 0.3);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 720px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    font-size: 11px;
    font-weight: 800;
    color: var(--cb-orange);
    margin-bottom: 16px;
    background: rgba(245, 108, 1, 0.12);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(245, 108, 1, 0.25);
}

.hero h1 {
    font-size: clamp(32px, 5vw, 52px);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -1.5px;
    margin-bottom: 20px;
    color: #ffffff;
}

.hero h1 span {
    color: var(--cb-orange);
}

.lead {
    font-size: 17px;
    line-height: 1.65;
    color: #c7c0b8;
    margin-bottom: 32px;
    font-weight: 400;
}

.lead b {
    color: #ffffff;
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 26px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-2px);
    text-decoration: none;
}

.btn:active {
    transform: translateY(0);
}

.btn.primary, .btn.red {
    background: var(--cb-orange);
    color: #ffffff;
    box-shadow: var(--shadow-glow);
}

.btn.primary:hover, .btn.red:hover {
    background: var(--cb-orange-hover);
    box-shadow: 0 12px 30px rgba(245, 108, 1, 0.35);
}

.btn.telegram {
    background: var(--cb-tg-blue);
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(34, 158, 217, 0.25);
}

.btn.telegram:hover {
    background: #1d8bc0;
    box-shadow: 0 12px 28px rgba(34, 158, 217, 0.35);
}

.btn.light {
    background: var(--cb-surface);
    color: var(--cb-text-main);
    border-color: var(--cb-border);
    box-shadow: var(--shadow-sm);
}

.btn.light:hover {
    background: var(--cb-surface-muted);
    border-color: var(--cb-text-muted);
    color: var(--cb-black);
}

.btn.dark {
    background: var(--cb-dark);
    color: #ffffff;
    border-color: var(--cb-dark-border);
}

.btn.dark:hover {
    background: var(--cb-black);
}

.btn.danger {
    background: var(--cb-red);
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.2);
}

.btn.danger:hover {
    background: #dc2626;
}

.btn.success {
    background: var(--cb-green);
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.2);
}

.btn.success:hover {
    background: #059669;
}

.btn.sm {
    padding: 8px 16px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.btn.lg {
    padding: 16px 34px;
    font-size: 16px;
    border-radius: var(--radius-lg);
}

.btn-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

/* Feature/Highlights Row */
.highlights {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 40px;
}

.highlight-item {
    background: var(--cb-surface);
    border: 1px solid var(--cb-border-subtle);
    padding: 18px 22px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-sm);
}

.highlight-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--cb-orange-soft);
    color: var(--cb-orange);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.highlight-text h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--cb-black);
    margin-bottom: 2px;
}

.highlight-text p {
    font-size: 11px;
    color: var(--cb-text-muted);
}

/* Step Cards Section */
.section-header {
    margin-bottom: 24px;
}

.section-header .eyebrow {
    margin-bottom: 8px;
}

.section-header h2 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.8px;
    color: var(--cb-black);
}

.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.step-card {
    position: relative;
    background: var(--cb-surface);
    border: 1px solid var(--cb-border);
    border-radius: var(--radius-lg);
    padding: 32px 26px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.step-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--cb-orange);
}

.step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--cb-orange);
    background: var(--cb-orange-soft);
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 20px;
    width: fit-content;
}

.step-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--cb-surface-muted);
    border: 1px solid var(--cb-border);
    display: grid;
    place-items: center;
    color: var(--cb-black);
    margin-bottom: 20px;
}

.step-card h3 {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.4px;
    margin-bottom: 10px;
    color: var(--cb-black);
}

.step-card p {
    font-size: 13px;
    color: var(--cb-text-muted);
    line-height: 1.6;
}

/* Card & Grid Primitives */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.card {
    background: var(--cb-surface);
    border: 1px solid var(--cb-border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--cb-border-subtle);
}

.card-header h3 {
    font-size: 17px;
    font-weight: 800;
    color: var(--cb-black);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-stat {
    font-size: 42px;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 8px;
    letter-spacing: -1.5px;
    color: var(--cb-black);
}

.card-stat.orange { color: var(--cb-orange); }
.card-stat.green { color: var(--cb-green); }
.card-stat.blue { color: var(--cb-tg-blue); }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge.active {
    background: var(--cb-green-soft);
    color: var(--cb-green);
    border: 1px solid var(--cb-green-border);
}

.badge.inactive {
    background: var(--cb-red-soft);
    color: var(--cb-red);
    border: 1px solid var(--cb-red-border);
}

.badge.pending {
    background: var(--cb-amber-soft);
    color: var(--cb-amber);
    border: 1px solid var(--cb-amber-border);
}

.badge.error {
    background: var(--cb-red-soft);
    color: var(--cb-red);
    border: 1px solid var(--cb-red-border);
}

.badge.in_group {
    background: var(--cb-tg-blue-soft);
    color: var(--cb-tg-blue);
    border: 1px solid var(--cb-tg-blue-border);
}

.badge.orange {
    background: var(--cb-orange-soft);
    color: var(--cb-orange);
    border: 1px solid rgba(245, 108, 1, 0.3);
}

/* User & Channel Components */
.channel-pill {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--cb-surface-muted);
    border-radius: var(--radius-md);
    border: 1px solid var(--cb-border-subtle);
    margin: 16px 0;
}

.channel-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ffffff;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.channel-avatar-placeholder {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--cb-dark);
    color: #ffffff;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 20px;
    flex-shrink: 0;
}

.channel-info {
    min-width: 0;
    flex: 1;
}

.channel-name {
    font-size: 15px;
    font-weight: 800;
    color: var(--cb-black);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-id {
    font-size: 11px;
    font-family: monospace;
    color: var(--cb-text-muted);
    margin-top: 2px;
}

/* Status Meta List */
.meta-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 16px 0;
}

.meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--cb-border-subtle);
}

.meta-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.meta-label {
    color: var(--cb-text-muted);
    font-weight: 500;
}

.meta-value {
    font-weight: 700;
    color: var(--cb-black);
}

/* Tables */
.tablewrap {
    background: var(--cb-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--cb-border);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    margin: 20px 0 32px;
}

.table-toolbar {
    padding: 16px 20px;
    background: var(--cb-surface);
    border-bottom: 1px solid var(--cb-border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.table-search {
    position: relative;
    flex: 1;
    max-width: 360px;
}

.table-search input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--cb-border);
    background: var(--cb-surface-muted);
    font-size: 13px;
    outline: none;
    transition: var(--transition);
}

.table-search input:focus {
    border-color: var(--cb-orange);
    background: #ffffff;
    box-shadow: 0 0 0 3px var(--cb-orange-glow);
}

.table-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--cb-text-light);
    pointer-events: none;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--cb-border-subtle);
    font-size: 13px;
}

th {
    background: var(--cb-surface-muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--cb-text-muted);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(245, 108, 1, 0.015);
}

td b {
    font-weight: 700;
    color: var(--cb-black);
}

td small {
    font-size: 11px;
}

/* Forms */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--cb-black);
    margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
input[type="email"],
select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--cb-border);
    border-radius: var(--radius-md);
    background: var(--cb-surface);
    color: var(--cb-text-main);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

input:focus, select:focus {
    border-color: var(--cb-orange);
    box-shadow: 0 0 0 3px var(--cb-orange-glow);
}

/* Trust / Notice Banners */
.notice-box {
    background: var(--cb-surface-muted);
    border: 1px solid var(--cb-border);
    border-radius: var(--radius-md);
    padding: 18px 22px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin: 24px 0;
}

.notice-icon {
    width: 24px;
    height: 24px;
    color: var(--cb-orange);
    flex-shrink: 0;
    margin-top: 2px;
}

.notice-body h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--cb-black);
    margin-bottom: 4px;
}

.notice-body p {
    font-size: 12px;
    color: var(--cb-text-muted);
    line-height: 1.5;
}

/* Footer */
.footer {
    margin-top: auto;
    padding-top: 40px;
    border-top: 1px solid var(--cb-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--cb-text-muted);
    flex-wrap: wrap;
    gap: 14px;
}

.footer-brand {
    font-weight: 700;
    color: var(--cb-black);
}

.footer-links {
    display: flex;
    gap: 18px;
}

.footer-links a:hover {
    color: var(--cb-orange);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 900px) {
    .steps {
        grid-template-columns: 1fr;
    }
    .highlights {
        grid-template-columns: 1fr;
    }
    .hero {
        padding: 42px 28px;
    }
    .hero h1 {
        font-size: 32px;
    }
    .grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .wrap {
        padding: 16px 14px 40px;
    }
    .nav {
        flex-direction: column;
        align-items: flex-start;
    }
    .nav-links {
        width: 100%;
        justify-content: space-between;
    }
    .hero {
        padding: 32px 20px;
    }
    .hero h1 {
        font-size: 28px;
    }
    .actions {
        flex-direction: column;
        align-items: stretch;
    }
    .actions .btn {
        width: 100%;
    }
    .footer {
        flex-direction: column;
        align-items: flex-start;
    }
}
