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

/* ── Base ───────────────────────────────────────────────────── */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
hr { border: none; border-top: 1px solid #e5e7eb; margin: 28px 0; }
code { background: #f3f4f6; padding: 2px 7px; border-radius: 4px; font-size: 0.88rem; }

/* ── Layout ─────────────────────────────────────────────────── */
.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.main { flex: 1; padding: 32px 20px; }

/* ── Header ─────────────────────────────────────────────────── */
.header {
    background: #1a1a2e;
    color: #fff;
    padding: 0;
    box-shadow: 0 2px 12px rgba(0,0,0,.15);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
}
.logo {
    color: #fff;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -.3px;
}
.logo:hover { text-decoration: none; }
.logo span { color: #60a5fa; }

/* ── Nav ────────────────────────────────────────────────────── */
.nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
    color: #94a3b8;
    text-decoration: none;
    font-size: .88rem;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all .2s;
    white-space: nowrap;
}
.nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,.08);
    text-decoration: none;
}
.nav-link.nav-active {
    color: #fff;
    background: rgba(255,255,255,.12);
}
.nav-link svg { flex-shrink: 0; opacity: .7; }
.nav-link:hover svg { opacity: 1; }
.nav-logout { color: #f87171; }
.nav-logout:hover { color: #fca5a5; background: rgba(248,113,113,.1); }

/* ── Footer ─────────────────────────────────────────────────── */
.footer { text-align: center; padding: 18px; color: #9ca3af; font-size: .84rem; border-top: 1px solid #e5e7eb; margin-top: 40px; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    margin-bottom: 24px;
}
.card-narrow { max-width: 440px; margin-left: auto; margin-right: auto; }
.card h1 { font-size: 1.5rem; margin-bottom: 6px; color: #1a1a2e; }

/* ── Alerts ─────────────────────────────────────────────────── */
.alert { padding: 14px 18px; border-radius: 10px; margin-bottom: 20px; font-size: .93rem; line-height: 1.5; }
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ── Dashboard ─────────────────────────────────────────────── */
.dash-top { margin-bottom: 28px; }
.dash-title { font-size: 1.75rem; font-weight: 700; color: #1a1a2e; letter-spacing: -.5px; }
.dash-subtitle { color: #6b7280; font-size: .95rem; margin-top: 4px; }
.section-title { font-size: 1.1rem; font-weight: 600; color: #374151; margin-bottom: 16px; margin-top: 8px; }

/* ── Quick Action Cards ────────────────────────────────────── */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
.action-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    border: 1px solid #e5e7eb;
    text-decoration: none;
    color: inherit;
    transition: all .2s;
    position: relative;
}
.action-card:hover {
    text-decoration: none;
    border-color: #c7d2fe;
    box-shadow: 0 4px 12px rgba(37,99,235,.1);
    transform: translateY(-2px);
}
.action-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.action-renew .action-icon { background: #ede9fe; color: #7c3aed; }
.action-pending .action-icon { background: #fef3c7; color: #d97706; }
.action-backfill .action-icon { background: #e0f2fe; color: #0284c7; }
.action-info h3 { font-size: .95rem; font-weight: 600; color: #1a1a2e; margin-bottom: 2px; }
.action-info p { font-size: .82rem; color: #6b7280; margin: 0; }
.action-arrow { color: #d1d5db; margin-left: auto; flex-shrink: 0; transition: color .2s; }
.action-card:hover .action-arrow { color: #6366f1; }

/* ── Stats grid ─────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: #fff; border-radius: 12px; padding: 20px; text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,.06); border-left: 4px solid #e5e7eb;
}
.stat-pending    { border-left-color: #d97706; }
.stat-approved   { border-left-color: #059669; }
.stat-rejected   { border-left-color: #dc2626; }
.stat-needs-info { border-left-color: #2563eb; }
.stat-number { font-size: 2rem; font-weight: 700; color: #1a1a2e; }
.stat-label  { color: #6b7280; font-size: .82rem; margin-top: 2px; font-weight: 500; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 5px; font-size: .9rem; color: #374151; }
.req { color: #dc2626; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 200px; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: .95rem;
    transition: border-color .2s, box-shadow .2s;
    background: #fff;
    color: #1a1a2e;
    font-family: inherit;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
input[type="file"] {
    padding: 12px;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    cursor: pointer;
    width: 100%;
}
input[type="file"]:hover { border-color: #2563eb; }
textarea { resize: vertical; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 10px 22px;
    border: none;
    border-radius: 8px;
    font-size: .93rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s, transform .1s, box-shadow .2s;
    text-align: center;
    font-family: inherit;
    line-height: 1.4;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn-primary   { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; box-shadow: 0 2px 8px rgba(37,99,235,.25); }
.btn-secondary { background: #e5e7eb; color: #374151; }
.btn-secondary:hover { background: #d1d5db; }
.btn-success   { background: #059669; color: #fff; }
.btn-success:hover { background: #047857; box-shadow: 0 2px 8px rgba(5,150,105,.25); }
.btn-danger    { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-warning   { background: #d97706; color: #fff; }
.btn-warning:hover { background: #b45309; }
.btn-whatsapp { background: #25D366; color: #fff; font-size: 1rem; padding: 12px 28px; border-radius: 10px; }
.btn-whatsapp:hover { background: #1ebe57; box-shadow: 0 4px 12px rgba(37,211,102,.3); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 14px; font-size: .84rem; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 3px 11px; border-radius: 20px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-info    { background: #dbeafe; color: #1e40af; }
.badge-expired { background: #fee2e2; color: #991b1b; }
.badge-recurring { background: #dbeafe; color: #1e40af; }
.badge-secondary { background: #f3f4f6; color: #6b7280; }

/* ── Data table ─────────────────────────────────────────────── */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th {
    text-align: left; padding: 12px 10px; border-bottom: 2px solid #e5e7eb;
    color: #6b7280; font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .5px;
}
.data-table td { padding: 12px 10px; border-bottom: 1px solid #f3f4f6; }
.data-table tr:hover { background: #f9fafb; }
.nowrap { white-space: nowrap; }

/* ── Detail table (key-value) ───────────────────────────────── */
.detail-table { width: auto; margin-bottom: 0; }
.detail-table th {
    text-align: right; padding: 10px 16px 10px 0; color: #6b7280;
    font-weight: 500; width: 170px; vertical-align: top; border-bottom: 1px solid #f3f4f6;
}
.detail-table td { padding: 10px 0; border-bottom: 1px solid #f3f4f6; font-weight: 500; }

/* ── Success / tracking ─────────────────────────────────────── */
.text-center { text-align: center; }
.success-icon {
    font-size: 2.8rem; color: #059669; background: #ecfdf5;
    width: 80px; height: 80px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px;
}
.tracking-box { background: #f0f2f5; border-radius: 12px; padding: 24px; margin: 24px 0; }
.tracking-label { color: #6b7280; font-size: .88rem; margin-bottom: 6px; }
.tracking-code  { font-size: 2rem; font-weight: 700; color: #1a1a2e; letter-spacing: 3px; font-family: 'Courier New', monospace; }
.tracking-hint  { color: #9ca3af; font-size: .82rem; margin-top: 8px; }
.actions { margin-top: 24px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Status form ────────────────────────────────────────────── */
.input-group { display: flex; gap: 8px; }
.input-group input { flex: 1; }
.status-result { margin-top: 24px; }
.status-result h2 { font-size: 1.15rem; margin-bottom: 12px; }

/* ── Filter form ────────────────────────────────────────────── */
.filter-form { margin-bottom: 20px; }
.filter-row { align-items: flex-end; }

/* ── Pagination ─────────────────────────────────────────────── */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.total-count { text-align: center; color: #9ca3af; font-size: .84rem; margin-top: 14px; }
.empty-state { text-align: center; color: #9ca3af; padding: 40px 0; font-size: .95rem; }

/* ── Admin view page ────────────────────────────────────────── */
.view-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.view-header h1 { margin-bottom: 0; }
.proof-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.proof-grid h2 { font-size: 1.1rem; color: #374151; margin-bottom: 14px; }
.proof-image { max-width: 100%; border-radius: 8px; border: 1px solid #e5e7eb; }

/* ── Admin actions ──────────────────────────────────────────── */
.admin-actions { margin-top: 24px; }
.admin-actions h2 { font-size: 1.1rem; margin-bottom: 16px; }
.action-form { background: #f9fafb; padding: 20px; border-radius: 8px; margin-bottom: 16px; }
.approve-form { border-left: 4px solid #059669; }
.reject-form  { border-left: 4px solid #dc2626; }

/* ── aMember section ────────────────────────────────────────── */
.amember-section { margin-top: 24px; }
.amember-section h2 { font-size: 1.1rem; color: #374151; margin-bottom: 14px; }
.amember-found { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: 20px; }
.amember-found .detail-table th { width: 140px; }
.amember-links { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.amember-not-found { }
.text-muted { color: #9ca3af; font-size: .88rem; }
button:disabled { opacity: .5; cursor: not-allowed; }

/* ── Search / Backfill ─────────────────────────────────────── */
.search-form { margin-top: 16px; }
.search-form .form-row { display: flex; gap: 10px; align-items: center; }
.search-input { flex: 1; min-width: 260px; }
.backfill-row { display: flex; gap: 8px; align-items: center; }
.amount-input { width: 90px; padding: 6px 8px; font-size: .88rem; }
.row-active { background: #f0fdf4; }
.row-expired { background: #fef2f2; }
.row-active:hover { background: #dcfce7; }
.row-expired:hover { background: #fee2e2; }
.subtitle { color: #6b7280; font-size: .92rem; margin-bottom: 16px; }

/* ── Process Renewal ──────────────────────────────────────── */
.renew-row { display: flex; gap: 8px; align-items: center; }

/* ── Bulk Backfill ─────────────────────────────────────────── */
.bulk-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid #e5e7eb; }
.select-all-label { display: flex; align-items: center; gap: 6px; font-weight: 500; cursor: pointer; }
.bulk-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; padding-top: 12px; border-top: 1px solid #e5e7eb; }

/* ── Admin performance cards ────────────────────────────────── */
.admin-perf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 12px; }
.perf-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 20px; }
.perf-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.perf-avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.1rem; flex-shrink: 0; }
.perf-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; text-align: center; }
.perf-stat { background: #f9fafb; border-radius: 8px; padding: 8px 4px; }
.perf-num { display: block; font-size: 1.2rem; font-weight: 700; }
.perf-label { display: block; font-size: .7rem; color: #6b7280; text-transform: uppercase; letter-spacing: 0.3px; margin-top: 2px; }
.perf-total { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; border-top: 1px solid #f3f4f6; }
.badge-primary { background: #3b82f6; color: #fff; }

/* ── Admin user nav extras ──────────────────────────────────── */
.nav-divider { width: 1px; height: 20px; background: #e5e7eb; margin: 0 4px; }
.nav-user { display: flex; align-items: center; font-size: .85rem; color: #6b7280; padding: 0 6px; font-weight: 500; white-space: nowrap; }
.input-disabled { background: #f3f4f6; color: #9ca3af; cursor: not-allowed; }
.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.checkbox-label input { width: 18px; height: 18px; cursor: pointer; }
.form-actions { margin-top: 20px; }
.badge-secondary { background: #9ca3af; color: #fff; }
.btn-danger { background: #ef4444; color: #fff; border: 1px solid #ef4444; }
.btn-danger:hover { background: #dc2626; border-color: #dc2626; }

/* ── Collections report ────────────────────────────────────── */
.collection-hero { text-align: center; background: linear-gradient(135deg, #1e293b 0%, #334155 100%); color: #fff; border-radius: 16px; padding: 32px 20px; }
.hero-amount { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.hero-currency { font-size: 1.2rem; font-weight: 500; opacity: .7; }
.hero-number { font-size: 2.8rem; font-weight: 800; letter-spacing: -1px; }
.hero-subtitle { margin-top: 8px; font-size: .9rem; opacity: .6; }

.collection-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.collection-card { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px; text-align: center; }
.collection-card-icon { margin-bottom: 8px; }
.collection-card-amount { font-size: 1.3rem; font-weight: 700; color: #1e293b; }
.collection-card-count { font-size: .8rem; color: #6b7280; margin-top: 2px; }
.collection-bar { height: 6px; background: #e5e7eb; border-radius: 3px; margin-top: 10px; overflow: hidden; }
.collection-bar-fill { height: 100%; background: linear-gradient(90deg, #3b82f6, #6366f1); border-radius: 3px; transition: width .3s; }
.collection-card-pct { font-size: .75rem; color: #6b7280; margin-top: 4px; }

.method-select { min-width: 110px; max-width: 140px; padding: 6px 8px !important; font-size: .85rem; }

.filter-form .filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filter-form .filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-form .filter-group label { font-size: .8rem; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: .3px; }

.date-presets { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.preset-link { font-size: .82rem; padding: 4px 12px; border-radius: 20px; background: #f3f4f6; color: #374151; text-decoration: none; transition: all .15s; }
.preset-link:hover { background: #e5e7eb; color: #1e293b; }

.text-right { text-align: right; }

.renew-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.create-invoice-form { display: grid; grid-template-columns: 2fr 1fr 1.2fr auto; gap: 12px; align-items: end; }
.create-invoice-form .form-group { display: flex; flex-direction: column; gap: 4px; }
.create-invoice-form .form-group label { font-size: .8rem; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: .3px; }
.create-invoice-form .btn { white-space: nowrap; padding: 10px 18px; }

/* ── Revenue Overview Grid ──────────────────────────────────── */
.revenue-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.revenue-card {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    border: 1px solid #e5e7eb;
    transition: box-shadow .2s, transform .2s;
}
.revenue-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    transform: translateY(-1px);
}
.rc-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.rc-today .rc-icon { background: #ecfdf5; color: #059669; }
.rc-week .rc-icon  { background: #eff6ff; color: #2563eb; }
.rc-month .rc-icon { background: #fef3c7; color: #d97706; }
.rc-all .rc-icon   { background: #ede9fe; color: #7c3aed; }
.rc-body { display: flex; flex-direction: column; min-width: 0; }
.rc-label { font-size: .78rem; color: #6b7280; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.rc-amount { font-size: 1.35rem; font-weight: 800; color: #1a1a2e; margin-top: 2px; letter-spacing: -.3px; }
.rc-count { font-size: .78rem; color: #9ca3af; margin-top: 2px; }

/* ── Insight Row ───────────────────────────────────────────── */
.insight-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.insight-card {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    border: 1px solid #e5e7eb;
}
.insight-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.insight-num { font-size: 1.8rem; font-weight: 800; color: #1a1a2e; line-height: 1; }
.insight-label { font-size: .82rem; color: #6b7280; margin-top: 2px; }
.insight-label small { color: #9ca3af; }
.insight-extra { margin-left: auto; text-align: right; }
.insight-revenue { font-size: 1.1rem; font-weight: 700; color: #059669; display: block; }

/* ── Chart Bars (daily) ────────────────────────────────────── */
.chart-bars {
    display: flex;
    gap: 4px;
    align-items: flex-end;
    height: 180px;
    padding-top: 20px;
}
.chart-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}
.chart-value {
    font-size: .65rem;
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    min-height: 14px;
}
.chart-bar-wrap {
    width: 100%;
    max-width: 36px;
    height: 120px;
    background: #f3f4f6;
    border-radius: 6px 6px 0 0;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}
.chart-bar-fill {
    width: 100%;
    background: linear-gradient(180deg, #3b82f6 0%, #6366f1 100%);
    border-radius: 6px 6px 0 0;
    transition: height .4s ease;
    min-height: 2px;
}
.chart-today .chart-bar-fill {
    background: linear-gradient(180deg, #059669 0%, #10b981 100%);
}
.chart-label { font-size: .72rem; font-weight: 600; color: #374151; margin-top: 6px; }
.chart-sublabel { font-size: .6rem; color: #9ca3af; text-transform: uppercase; }

/* ── Channel List ──────────────────────────────────────────── */
.channel-list { display: flex; flex-direction: column; gap: 12px; }
.channel-row {
    display: grid;
    grid-template-columns: 120px 1fr auto auto;
    gap: 12px;
    align-items: center;
}
.channel-name { font-weight: 500; }
.channel-bar-wrap {
    height: 10px;
    background: #f3f4f6;
    border-radius: 5px;
    overflow: hidden;
}
.channel-bar {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #6366f1);
    border-radius: 5px;
    transition: width .4s ease;
}
.channel-amount { font-weight: 700; color: #1a1a2e; font-size: .9rem; white-space: nowrap; }
.channel-count { font-size: .8rem; color: #9ca3af; white-space: nowrap; }

/* ── Two-column grid ───────────────────────────────────────── */
.two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 24px;
}

/* ── AI Badges ──────────────────────────────────────────────── */
.badge-ai { background: linear-gradient(135deg, #7c3aed, #a855f7); color: #fff; }
.badge-objection { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ── AI Success Icon ───────────────────────────────────────── */
.success-icon-ai {
    background: #ede9fe;
    color: #7c3aed;
}

/* ── Proof Guidelines (submit form) ────────────────────────── */
.proof-guide {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 24px;
}
.proof-guide-title {
    font-size: .95rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 14px;
}
.proof-guide-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.proof-guide-do, .proof-guide-dont {
    border-radius: 10px;
    padding: 16px;
}
.proof-guide-do {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}
.proof-guide-dont {
    background: #fef2f2;
    border: 1px solid #fecaca;
}
.proof-guide-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 700;
    margin-bottom: 10px;
}
.proof-guide-badge-ok { background: #dcfce7; color: #166534; }
.proof-guide-badge-no { background: #fee2e2; color: #991b1b; }
.proof-guide-do ul, .proof-guide-dont ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.proof-guide-do li, .proof-guide-dont li {
    font-size: .84rem;
    padding: 3px 0;
    padding-left: 18px;
    position: relative;
    color: #374151;
    line-height: 1.5;
}
.proof-guide-do li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #16a34a;
    font-weight: 700;
}
.proof-guide-dont li::before {
    content: '✕';
    position: absolute;
    left: 0;
    color: #dc2626;
    font-weight: 700;
}
.proof-guide-example {
    font-size: .78rem;
    color: #6b7280;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(0,0,0,.06);
}

/* ── Optional Fields (submit form) ─────────────────────────── */
.optional-fields { margin: 16px 0 20px; }
.optional-fields summary {
    cursor: pointer;
    font-weight: 600;
    font-size: .9rem;
    color: #6b7280;
    padding: 10px 0;
    user-select: none;
}
.optional-fields summary:hover { color: #374151; }
.optional-fields[open] summary { margin-bottom: 12px; }
.optional-fields-inner { padding: 0 4px; }
.form-hint { display: block; color: #9ca3af; font-size: .78rem; margin-top: 4px; }

/* ── Modal Overlay ─────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-content {
    max-width: 500px;
    width: 100%;
    animation: modalIn .2s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(-10px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Lightbox (proof image preview) ───────────────────────── */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.88);
    z-index: 300;
    display: flex;
    flex-direction: column;
    animation: modalIn .2s ease;
}
.lightbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: rgba(0,0,0,.5);
    flex-shrink: 0;
}
.lightbox-title {
    color: #fff;
    font-size: .9rem;
    font-weight: 600;
    opacity: .9;
}
.lightbox-actions {
    display: flex;
    gap: 8px;
}
.lightbox-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: auto;
    cursor: pointer;
}
.lightbox-img {
    max-width: 95%;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0,0,0,.5);
    cursor: default;
    object-fit: contain;
}

/* ── Responsive ─────────────────────────────────────────────── */

/* Tablet */
@media (max-width: 900px) {
    .container { padding: 0 12px; }
    .main { padding: 20px 12px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .quick-actions { grid-template-columns: 1fr 1fr; gap: 12px; }
    .admin-perf-grid { grid-template-columns: 1fr 1fr; }
    .collection-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
    .perf-stats { grid-template-columns: repeat(2, 1fr); }
    .create-invoice-form { grid-template-columns: 1fr 1fr; }
    .revenue-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .insight-row { grid-template-columns: 1fr 1fr; }
    .two-col-grid { grid-template-columns: 1fr; gap: 16px; }
    .channel-row { grid-template-columns: 100px 1fr auto auto; gap: 8px; }
}

/* Mobile */
@media (max-width: 640px) {
    /* Header & Nav */
    .header-inner { flex-direction: column; gap: 6px; height: auto; padding: 10px 0; }
    .logo { font-size: 1.05rem; }
    .nav { flex-wrap: wrap; gap: 2px; justify-content: center; }
    .nav-link { padding: 5px 8px; font-size: .75rem; gap: 3px; }
    .nav-link svg { width: 14px; height: 14px; }
    .nav-divider { height: 16px; margin: 0 2px; }
    .nav-user { font-size: .75rem; padding: 0 4px; }

    /* Layout */
    .container { padding: 0 10px; }
    .main { padding: 16px 10px; }

    /* Cards */
    .card { padding: 16px; margin-bottom: 16px; border-radius: 10px; }
    .card h1 { font-size: 1.2rem; }
    .card h2 { font-size: 1.1rem; }
    .card h3 { font-size: 1rem; }

    /* View header */
    .view-header { flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 16px; }
    .view-header h1 { font-size: 1.3rem; }

    /* Dashboard */
    .dash-title { font-size: 1.3rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .stat-card { padding: 14px 10px; }
    .stat-number { font-size: 1.5rem; }
    .quick-actions { grid-template-columns: 1fr; gap: 10px; }
    .action-card { padding: 14px; gap: 12px; }
    .action-icon { width: 42px; height: 42px; }

    /* Revenue cards */
    .revenue-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .revenue-card { padding: 14px; gap: 10px; }
    .rc-icon { width: 36px; height: 36px; }
    .rc-amount { font-size: 1.1rem; }

    /* Insight row */
    .insight-row { grid-template-columns: 1fr; gap: 10px; }
    .insight-card { padding: 14px; gap: 10px; }
    .insight-num { font-size: 1.4rem; }

    /* Chart */
    .chart-bars { height: 140px; }
    .chart-bar-wrap { height: 90px; }
    .chart-value { font-size: .6rem; }

    /* Channels */
    .channel-row { grid-template-columns: 1fr auto; gap: 8px; }
    .channel-bar-wrap { display: none; }
    .channel-count { display: none; }

    /* Two col grid */
    .two-col-grid { grid-template-columns: 1fr; gap: 12px; }

    /* Proof guide */
    .proof-guide { padding: 14px 16px; }
    .proof-guide-grid { grid-template-columns: 1fr; gap: 10px; }
    .proof-guide-do, .proof-guide-dont { padding: 12px; }

    /* Forms */
    .form-row { flex-direction: column; gap: 0; }
    .form-row .form-group { min-width: 0; }
    .search-form .form-row { flex-direction: column; gap: 8px; }
    .search-input { min-width: 0; width: 100%; }
    input[type="text"], input[type="email"], input[type="password"],
    input[type="number"], input[type="date"], select, textarea {
        padding: 10px 12px;
        font-size: .9rem;
    }
    .btn { padding: 10px 16px; font-size: .88rem; width: 100%; }
    .btn-sm { padding: 8px 12px; font-size: .82rem; width: auto; }

    /* Tables — stack on mobile */
    .data-table { font-size: .82rem; }
    .data-table th { padding: 8px 6px; font-size: .7rem; }
    .data-table td { padding: 8px 6px; }
    .detail-table th { width: auto; padding: 8px 10px 8px 0; font-size: .82rem; }
    .detail-table td { font-size: .88rem; }

    /* Payment form rows */
    .renew-row { flex-direction: column; gap: 6px; align-items: stretch; }
    .renew-row .form-control { width: 100%; }
    .renew-row .btn-sm { width: 100%; text-align: center; }
    .amount-input { width: 100% !important; }
    .method-select { min-width: 0; max-width: none; width: 100% !important; }

    /* Create invoice form */
    .create-invoice-form { grid-template-columns: 1fr; gap: 10px; }
    .create-invoice-form .btn { width: 100%; }

    /* Filter forms */
    .filter-form .filter-row { flex-direction: column; gap: 10px; }
    .filter-form .filter-group { width: 100%; }
    .filter-form .filter-group .form-control { width: 100%; }
    .date-presets { gap: 6px; }
    .preset-link { font-size: .76rem; padding: 4px 10px; }

    /* Collections */
    .collection-hero { padding: 20px 14px; }
    .hero-number { font-size: 2rem; }
    .hero-currency { font-size: 1rem; }
    .collection-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .collection-card { padding: 12px; }
    .collection-card-amount { font-size: 1.1rem; }

    /* Admin perf cards */
    .admin-perf-grid { grid-template-columns: 1fr; gap: 12px; }
    .perf-stats { grid-template-columns: repeat(2, 1fr); }

    /* Proof grid */
    .proof-grid { grid-template-columns: 1fr; gap: 16px; }

    /* Alerts */
    .alert { padding: 12px 14px; font-size: .88rem; }

    /* Badges */
    .badge { padding: 2px 8px; font-size: .72rem; }

    /* Footer */
    .footer { padding: 14px 10px; font-size: .78rem; }

    /* Bulk */
    .bulk-toolbar { flex-direction: column; gap: 8px; align-items: flex-start; }
    .bulk-footer { flex-direction: column; gap: 8px; align-items: flex-start; }

    /* Misc */
    .text-right { text-align: left; }
    .nowrap { white-space: normal; }
    .subtitle { font-size: .85rem; }

    /* Plans grid mobile */
    .plans-grid { grid-template-columns: 1fr !important; }
    .plan-card { padding: 12px 14px !important; }
}

/* ══════ Trial & Plans Page ══════ */
.trial-section {
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    border: 2px solid #86efac;
    border-radius: 12px;
    padding: 28px 24px;
    margin-bottom: 32px;
    text-align: center;
}
.trial-header h2 {
    margin: 8px 0 4px;
    font-size: 1.3rem;
    color: #15803d;
}
.trial-header p {
    color: #4b5563;
    margin: 0 0 20px;
}
.trial-badge {
    display: inline-block;
    background: #16a34a;
    color: #fff;
    font-weight: 700;
    font-size: .85rem;
    padding: 4px 14px;
    border-radius: 20px;
    letter-spacing: 1px;
}
.btn-trial {
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #fff;
    font-size: 1.05rem;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: transform .15s, box-shadow .15s;
}
.btn-trial:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(22,163,74,.3);
}

.plans-section {
    margin-top: 8px;
}
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.plan-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 18px;
    transition: border-color .2s, box-shadow .2s;
}
.plan-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59,130,246,.1);
}
.plan-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}
.plan-info {
    flex: 1;
    min-width: 0;
}
.plan-name {
    font-weight: 600;
    font-size: .95rem;
    color: #1e293b;
}
.plan-price {
    color: #16a34a;
    font-weight: 700;
    font-size: 1rem;
}
.plan-price small {
    font-weight: 400;
    color: #6b7280;
    font-size: .8rem;
}
.whatsapp-cta {
    text-align: center;
    padding: 20px;
    background: #f0fdf4;
    border-radius: 10px;
    margin-top: 8px;
}
.whatsapp-cta p {
    margin: 0 0 12px;
    color: #4b5563;
    font-weight: 500;
}
