/* ===== THEME TRANSITION ===== */
html.theme-transition, html.theme-transition *, html.theme-transition *::before, html.theme-transition *::after {
    transition: background-color .3s ease, color .3s ease, border-color .3s ease, box-shadow .3s ease !important;
}

/* ===== COMPACT THEME ===== */
.compact-page { font-size: 13px; }
.compact-page .page-title { font-size: 1.3rem; margin: 0; }
.compact-page .page-subtitle { font-size: 0.78rem; color: var(--gray-600); margin: 2px 0 0; }
.compact-page .dashboard-header { margin-bottom: 0.8rem; }
.compact-page .dashboard-card { border-radius: 10px; box-shadow: 0 1px 6px rgba(0,0,0,.06); }
.compact-page .card-header { padding: 0.6rem 0.8rem; }
.compact-page .card-title { font-size: 0.82rem; }
.compact-page .card-content { padding: 0.75rem; }
.compact-page .stats-grid { gap: 0.8rem; margin-bottom: 1rem; }
.compact-page .stat-card { padding: 0.8rem; }
.compact-page .stat-icon { width: 40px; height: 40px; font-size: 1rem; border-radius: 8px; }
.compact-page .stat-number { font-size: 1.3rem; }
.compact-page .stat-label, .compact-page .stat-label1 { font-size: 0.72rem; }
.compact-page .stat-trend { font-size: 0.65rem; }
.compact-page .dashboard-grid { gap: 1rem; margin-bottom: 1rem; }
.compact-page .form-control { padding: 0.4rem 0.6rem; font-size: 0.8rem; border-radius: 6px; }
.compact-page .form-group label { font-size: 0.75rem; font-weight: 500; }
.compact-page .btn, .compact-page .btn-primary { padding: 0.4rem 1rem; font-size: 0.78rem; border-radius: 6px; }
.compact-page .btn-outline { padding: 0.4rem 1rem; font-size: 0.78rem; }
.compact-page .status-badge { font-size: 0.65rem; padding: 2px 8px; }
.compact-page .table-header { padding: 0.5rem 0.8rem; font-size: 0.72rem; }
.compact-page .table-row { padding: 0.5rem 0.8rem; }
.compact-page .table-cell { font-size: 0.78rem; }
.compact-page .campaign-name { font-size: 0.8rem; }
.compact-page .campaign-preview { font-size: 0.7rem; }
.compact-page .table-pagination { padding: 0.5rem 0.8rem; }
.compact-page .contacts-actions { margin-bottom: 0.8rem; gap: 0.5rem; }
.compact-page .group-item { padding: 0.5rem 0.8rem; }
.compact-page .group-count { font-size: 0.7rem; }
.compact-page .contact-avatar { width: 28px; height: 28px; font-size: 0.7rem; }
.compact-page .sms-form .form-group { margin-bottom: 0.6rem; }
.compact-page .sms-preview { padding: 0.5rem; }
.compact-page .sms-stats .stat-item { font-size: 0.75rem; }
.compact-page .topup-banner { padding: 1rem; margin-bottom: 1rem; border-radius: 10px; }
.compact-page .topup-banner h3 { font-size: 1rem; }
.compact-page .topup-banner p { font-size: 0.75rem; }
.compact-page .quick-stats { gap: 0.6rem; margin-bottom: 1rem; }
.compact-page .quick-stat { padding: 0.6rem 0.8rem; border-radius: 8px; }
.compact-page .stat-badge { width: 32px; height: 32px; font-size: 0.8rem; }
.compact-page .activity-item { padding: 0.5rem 0; gap: 0.6rem; }
.compact-page .activity-icon { width: 30px; height: 30px; font-size: 0.75rem; }
.compact-page .activity-phone { font-size: 0.78rem; }
.compact-page .activity-time { font-size: 0.7rem; }
.compact-page .activity-status { font-size: 0.65rem; padding: 2px 8px; }
.compact-page .api-key-item { padding: 0.8rem; }
.compact-page .api-key-value code { font-size: 0.72rem; }
.compact-page .docs-section { padding: 1rem; margin-bottom: 1rem; }
.compact-page .docs-section h2 { font-size: 1rem; margin-bottom: 0.8rem; }
.compact-page .docs-nav a { font-size: 0.75rem; padding: 5px 10px; }
.compact-page .endpoint-card { padding: 0.8rem; margin: 0.8rem 0; }
.compact-page .params-table th, .compact-page .params-table td { padding: 0.4rem 0.6rem; font-size: 0.75rem; }
.compact-page .footer-content { padding: 0.6rem; font-size: 0.7rem; }

.compact-page .page-content { padding: 1rem; }
.compact-page .send-sms-grid { gap: 1rem; }
.compact-page .api-keys-grid { gap: 1rem; }
.compact-page .docs-container { padding: 0.8rem; }
.compact-page .docs-nav ul { gap: 0.4rem; }
.compact-page .docs-nav a { font-size: 0.75rem; padding: 5px 10px; }
.compact-page .docs-section { padding: 0.8rem; margin-bottom: 0.8rem; }
.compact-page .endpoint-card { padding: 0.6rem; margin: 0.6rem 0; }
.compact-page .endpoint-header { gap: 0.5rem; margin-bottom: 0.5rem; }
.compact-page .history-filters { padding: 0.6rem; margin-bottom: 0.8rem; border-radius: 8px; }
.compact-page .filter-group { gap: 0.4rem; }
.compact-page .filter-group label { font-size: 0.72rem; }
.compact-page .export-btn, .compact-page .filter-btn { padding: 0.4rem 0.8rem; font-size: 0.75rem; }
.compact-page .profile-card { margin-bottom: 0.8rem; }
.compact-page .sid-page .page-title { font-size: 1.3rem; }
.compact-page .sid-card { margin-bottom: 0.8rem; }
.compact-page .sid-card-hd { padding: 0.6rem 0.8rem; }
.compact-page .sid-tbl th, .compact-page .sid-tbl td { padding: 0.4rem 0.5rem; font-size: 0.75rem; }
.compact-page .status-card { margin-bottom: 0.8rem; }
.compact-page .status-card-hd { padding: 0.6rem 0.8rem; }
.compact-page .stat-grid { gap: 0.6rem; }
.compact-page .stat-item { padding: 0.6rem; }
.compact-page .help-card { margin-bottom: 0.8rem; }
.compact-page .help-card-hd { padding: 0.6rem 0.8rem; }
.compact-page .contact-grid { gap: 0.6rem; margin-bottom: 0.8rem; }
.compact-page .contact-item { padding: 0.75rem; }
.compact-page .sch-card { margin-bottom: 0.8rem; }
.compact-page .sch-card-hd { padding: 0.6rem 0.8rem; }
.compact-page .sch-form-grid { gap: 0.5rem; }
.compact-page .tpl-card { margin-bottom: 0.8rem; }
.compact-page .tpl-card-hd { padding: 0.6rem 0.8rem; }
.compact-page .tpl-grid { gap: 0.5rem; }
.compact-page .tpl-item { padding: 0.5rem; }
.compact-page .app-card { padding: 0.5rem; margin-bottom: 0.4rem; }
.compact-page .modal-box { border-radius: 10px; }
.compact-page .modal-hd { padding: 0.6rem 0.8rem; }
.compact-page .notice-box { padding: 0.6rem; margin-top: 0.6rem; }
.compact-page .price-card { padding: 0.75rem; }

/* ===== DARK THEME ===== */
html[data-theme="dark"] {
    --dark-color: #e2e8f0;
    --light-color: #0f172a;
    --gray-100: #1e293b;
    --gray-200: #334155;
    --gray-300: #475569;
    --gray-400: #64748b;
    --gray-500: #94a3b8;
    --gray-600: #cbd5e1;
    --gray-700: #e2e8f0;
    --gray-800: #f1f5f9;
    --gray-900: #f8fafc;
    --white: #1e293b;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] body {
    background-color: #0f172a;
    color: #e2e8f0;
}

html[data-theme="dark"] body::-webkit-scrollbar-thumb { background: #27ae60; }
html[data-theme="dark"] body::-webkit-scrollbar-track { background: #0f172a; }

html[data-theme="dark"] .navbar {
    background: #1e293b;
    border-bottom-color: #334155;
}

html[data-theme="dark"] .brand-text { color: #f1f5f9; }
html[data-theme="dark"] .user-name { color: #e2e8f0; }
html[data-theme="dark"] .sidebar-toggle { color: #94a3b8; }
html[data-theme="dark"] .sidebar-toggle:hover { background: #334155; }

html[data-theme="dark"] .sidebar {
    background: #1e293b;
    border-right-color: #334155;
}

html[data-theme="dark"] .menu-link { color: #94a3b8; }
html[data-theme="dark"] .menu-link:hover { background: #334155; color: #2ecc71; }
html[data-theme="dark"] .menu-link.sub { color: #64748b; }
html[data-theme="dark"] .menu-link.sub:hover { color: #2ecc71; }
html[data-theme="dark"] .menu-item.active .menu-link {
    background: linear-gradient(135deg, rgba(39,174,96,.15), rgba(30,132,73,.12));
    color: #2ecc71;
}
html[data-theme="dark"] .menu-group-toggle:hover { background: #334155; }
html[data-theme="dark"] .group-label { color: #e2e8f0; }
html[data-theme="dark"] .group-label i { color: #64748b; }
html[data-theme="dark"] .group-arrow { color: #475569; }
html[data-theme="dark"] .menu-divider { background: #334155; }

html[data-theme="dark"] .main-content { background: #0f172a; }

html[data-theme="dark"] .page-title { color: #f1f5f9; }
html[data-theme="dark"] .page-subtitle { color: #94a3b8; }

html[data-theme="dark"] .dashboard-card,
html[data-theme="dark"] .card,
html[data-theme="dark"] .sid-card {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 1px 6px rgba(0,0,0,.2);
}

html[data-theme="dark"] .card-header {
    border-bottom-color: #334155;
    background: #1e293b;
}

html[data-theme="dark"] .card-title { color: #f1f5f9; }

html[data-theme="dark"] .stat-card {
    background: #1e293b;
    box-shadow: 0 1px 6px rgba(0,0,0,.2);
}
html[data-theme="dark"] .stat-card:hover { box-shadow: 0 5px 20px rgba(0,0,0,.3); }
html[data-theme="dark"] .stat-number { color: #f1f5f9; }

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-input {
    background: #0f172a;
    border-color: #475569;
    color: #e2e8f0;
}
html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-input:focus {
    border-color: #27ae60;
    box-shadow: 0 0 0 2px rgba(39,174,96,.2);
}

html[data-theme="dark"] .table-header { background: #334155; color: #e2e8f0; border-bottom-color: #475569; }
html[data-theme="dark"] .table-row { border-bottom-color: #334155; }
html[data-theme="dark"] .table-row:hover { background: #334155; }
html[data-theme="dark"] .table-cell { color: #e2e8f0; }

html[data-theme="dark"] .dropdown-menu {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 5px 20px rgba(0,0,0,.4);
}
html[data-theme="dark"] .dropdown-item { color: #e2e8f0; }
html[data-theme="dark"] .dropdown-item:hover { background: #334155; }
html[data-theme="dark"] .dropdown-divider { background: #334155; }

html[data-theme="dark"] .user-btn:hover { background: #334155; }

html[data-theme="dark"] .sidebar-overlay.active { background: rgba(0,0,0,.6); }

html[data-theme="dark"] .dashboard-footer {
    background: #1e293b;
    border-top-color: #334155;
    color: #94a3b8;
}
html[data-theme="dark"] .footer-links a { color: #94a3b8; }

html[data-theme="dark"] .btn-outline {
    border-color: #475569;
    color: #e2e8f0;
}
html[data-theme="dark"] .btn-outline:hover { background: #334155; }

html[data-theme="dark"] .alert-success { background: #064e3b; border-color: #065f46; color: #6ee7b7; }
html[data-theme="dark"] .alert-error { background: #7f1d1d; border-color: #991b1b; color: #fca5a5; }
html[data-theme="dark"] .alert-warning { background: #78350f; border-color: #92400e; color: #fde68a; }
html[data-theme="dark"] .alert-info { background: #0c4a6e; border-color: #0e7490; color: #7dd3fc; }

html[data-theme="dark"] .notification { box-shadow: 0 4px 12px rgba(0,0,0,.3); }
html[data-theme="dark"] .success-notification { background: #064e3b; color: #6ee7b7; border-color: #065f46; }
html[data-theme="dark"] .error-notification { background: #7f1d1d; color: #fca5a5; border-color: #991b1b; }
html[data-theme="dark"] .warning-notification { background: #78350f; color: #fde68a; border-color: #92400e; }
html[data-theme="dark"] .info-notification { background: #0c4a6e; color: #7dd3fc; border-color: #0e7490; }

html[data-theme="dark"] .modal-overlay { background: rgba(0,0,0,.7); }
html[data-theme="dark"] .modal-box,
html[data-theme="dark"] .modal-content { background: #1e293b; color: #e2e8f0; }
html[data-theme="dark"] .modal-hd { border-bottom-color: #334155; }
html[data-theme="dark"] .modal-close { color: #94a3b8; }

html[data-theme="dark"] .history-filters { background: #1e293b; box-shadow: 0 2px 10px rgba(0,0,0,.2); }
html[data-theme="dark"] .filter-group label { color: #e2e8f0; }

html[data-theme="dark"] .contact-info .contact-name { color: #e2e8f0; }
html[data-theme="dark"] .contact-info .contact-email { color: #94a3b8; }
html[data-theme="dark"] .group-item { border-bottom-color: #334155; }
html[data-theme="dark"] .group-item:hover { background: #334155; }
html[data-theme="dark"] .group-item.active { background: rgba(39,174,96,.1); }

html[data-theme="dark"] .btn-icon { background: #1e293b; border-color: #475569; color: #94a3b8; }
html[data-theme="dark"] .btn-icon:hover { background: #334155; color: #e2e8f0; }

html[data-theme="dark"] .api-key-value code { background: #0f172a; color: #2ecc71; }
html[data-theme="dark"] .api-key-item { border-bottom-color: #334155; }

html[data-theme="dark"] .docs-section { background: #1e293b; box-shadow: 0 2px 10px rgba(0,0,0,.2); }
html[data-theme="dark"] .docs-section h2 { color: #f1f5f9; }
html[data-theme="dark"] .docs-nav { background: #1e293b; box-shadow: 0 2px 10px rgba(0,0,0,.2); }
html[data-theme="dark"] .endpoint-card { background: #0f172a; border-color: #334155; }
html[data-theme="dark"] .params-table th { background: #334155; color: #e2e8f0; }
html[data-theme="dark"] .params-table td { border-color: #334155; color: #e2e8f0; }
html[data-theme="dark"] .api-key-display { background: #1a1c2c; border-color: #475569; }
html[data-theme="dark"] .response-example { background: #0f172a; }

html[data-theme="dark"] .topup-banner { background: linear-gradient(135deg, #064e3b, #065f46); }

html[data-theme="dark"] .welcome-card {
    background: linear-gradient(135deg, #064e3b, #065f46);
}
html[data-theme="dark"] .welcome-card .page-title { color: #f1f5f9; }
html[data-theme="dark"] .welcome-card .page-subtitle { color: rgba(226,232,240,.7); }

html[data-theme="dark"] .sid-card-hd { border-bottom-color: #334155; }
html[data-theme="dark"] .sid-card-hd h3 { color: #f1f5f9; }
html[data-theme="dark"] .sid-tbl th { background: #27ae60; }
html[data-theme="dark"] .sid-tbl td { border-bottom-color: #334155; color: #e2e8f0; }
html[data-theme="dark"] .sid-tbl tbody tr:hover { background: rgba(39,174,96,.08); }
html[data-theme="dark"] .sid-name { color: #f1f5f9; }
html[data-theme="dark"] .notice-box { background: #1a1c2c; border-color: #78350f; }
html[data-theme="dark"] .notice-box h4 { color: #fde68a; }
html[data-theme="dark"] .notice-box li { color: #fde68a; }
html[data-theme="dark"] .price-card { background: linear-gradient(135deg, #064e3b, #065f46); border-color: #065f46; }
html[data-theme="dark"] .price-card .provider { color: #e2e8f0; }
html[data-theme="dark"] .price-card .price { color: #6ee7b7; }
html[data-theme="dark"] .dl-card { border-color: #334155; color: #e2e8f0; }
html[data-theme="dark"] .dl-card:hover { border-color: #27ae60; background: rgba(39,174,96,.08); }
html[data-theme="dark"] .dl-card .dl-info h4 { color: #f1f5f9; }
html[data-theme="dark"] .dl-card .dl-info p { color: #94a3b8; }
html[data-theme="dark"] .corrections-box { background: #3b1010; border-color: #7f1d1d; color: #fca5a5; }
html[data-theme="dark"] .app-card { border-color: #334155; }
html[data-theme="dark"] .app-card-name { color: #f1f5f9; }
html[data-theme="dark"] .app-card-meta { color: #94a3b8; }
html[data-theme="dark"] .progress-step .step-label { color: #94a3b8; }

html[data-theme="dark"] .card-hd { border-bottom-color: #334155; }
html[data-theme="dark"] .card-hd h3 { color: #f1f5f9; }
html[data-theme="dark"] .card-bd { color: #e2e8f0; }
html[data-theme="dark"] .price-field { background: #0f172a; border-color: #334155; }
html[data-theme="dark"] .price-field .prov-name { color: #e2e8f0; }
html[data-theme="dark"] .price-field input { background: #1e293b; border-color: #475569; color: #6ee7b7; }
html[data-theme="dark"] .price-field .currency { color: #94a3b8; }
html[data-theme="dark"] .log-tbl th { background: #334155; color: #e2e8f0; border-bottom-color: #475569; }
html[data-theme="dark"] .log-tbl td { border-bottom-color: #334155; color: #e2e8f0; }
html[data-theme="dark"] .log-tbl tbody tr:hover { background: rgba(39,174,96,.05); }
html[data-theme="dark"] .log-action { background: #064e3b; color: #6ee7b7; }

/* Phone preview dark */
html[data-theme="dark"] .phone-screen { background: #0f172a; }
html[data-theme="dark"] .message-bubble { background: #334155; color: #e2e8f0; }

/* Details/summary FAQ dark */
html[data-theme="dark"] details summary { background: #0f172a; color: #e2e8f0; }
html[data-theme="dark"] details > div { color: #cbd5e1; }

/* Manual payment modal dark */
html[data-theme="dark"] .payment-note { background: #064e3b; border-color: #065f46; color: #6ee7b7; }

/* Scrollbar dark */
html[data-theme="dark"] .custom-scrollbar::-webkit-scrollbar-track { background: #1e293b; }
html[data-theme="dark"] .custom-scrollbar::-webkit-scrollbar-thumb { background: #475569; }

/* Select dropdown dark */
html[data-theme="dark"] select.form-control,
html[data-theme="dark"] select.form-input {
    background: #0f172a;
    color: #e2e8f0;
}

/* Input file dark */
html[data-theme="dark"] input[type="file"] { color: #e2e8f0; }

/* CSV preview dark */
html[data-theme="dark"] .csv-preview { background: #064e3b; border-color: #065f46; }
html[data-theme="dark"] .csv-debug { background: #0f172a; border-color: #334155; color: #e2e8f0; }

/* Balance badge in navbar */
html[data-theme="dark"] .balance-amount { color: #6ee7b7 !important; border-color: #27ae60 !important; }

/* Export modal dark */
html[data-theme="dark"] .export-modal-content { background: #1e293b; }
html[data-theme="dark"] .export-option { border-color: #334155; }
html[data-theme="dark"] .export-option:hover { background: #334155; }
html[data-theme="dark"] .export-option-title { color: #e2e8f0; }
html[data-theme="dark"] .export-option-desc { color: #94a3b8; }

/* Disabled input dark */
html[data-theme="dark"] input:disabled { background: #0f172a; color: #64748b; border-color: #334155; }

/* Help page dark */
html[data-theme="dark"] .help-card { background: #1e293b; box-shadow: 0 1px 6px rgba(0,0,0,.2); }
html[data-theme="dark"] .help-card-hd { border-bottom-color: #334155; }
html[data-theme="dark"] .contact-item { background: #0f172a; border-color: #334155; }
html[data-theme="dark"] .contact-item:hover { border-color: #27ae60; }
html[data-theme="dark"] .status-dot.operational { background: #27ae60; }

/* Status page dark */
html[data-theme="dark"] .status-card { background: #1e293b; box-shadow: 0 1px 6px rgba(0,0,0,.2); }
html[data-theme="dark"] .status-card-hd { border-bottom-color: #334155; }
html[data-theme="dark"] .status-card-hd h3 { color: #f1f5f9; }
html[data-theme="dark"] .stat-item { background: #0f172a !important; border-color: #334155 !important; }
html[data-theme="dark"] .stat-item .stat-val { color: #f1f5f9; }
html[data-theme="dark"] .stat-item .stat-label { color: #94a3b8; }
html[data-theme="dark"] .action-card { background: #0f172a; border-color: #334155; }
html[data-theme="dark"] .action-card:hover { border-color: #27ae60; background: rgba(39,174,96,.08); }
html[data-theme="dark"] .action-card h4 { color: #f1f5f9; }
html[data-theme="dark"] .action-card p { color: #94a3b8; }
html[data-theme="dark"] .sid-badge { background: #064e3b; color: #6ee7b7; }

/* Announcements page dark */
html[data-theme="dark"] .ann-card { background: #1e293b; }
html[data-theme="dark"] .ann-card-hd { border-bottom-color: #334155; }
html[data-theme="dark"] .ann-item { border-color: #334155; }
html[data-theme="dark"] .ann-item:hover { background: #334155; }
html[data-theme="dark"] .ann-title { color: #f1f5f9; }
html[data-theme="dark"] .ann-msg { color: #94a3b8; }

/* ===== NAV SMS BADGE ===== */
.nav-sms-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 500;
    border: 1.5px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
    transition: all .2s;
    white-space: nowrap;
}
.nav-sms-badge:hover { background: var(--primary-color); color: #fff; }
.nav-sms-badge i { font-size: 0.65rem; }
.nav-sms-count { font-weight: 600; }

html[data-theme="dark"] .nav-sms-badge {
    border-color: #27ae60;
    color: #6ee7b7;
}
html[data-theme="dark"] .nav-sms-badge:hover {
    background: #27ae60;
    color: #fff;
}

@media (max-width: 768px) {
    .nav-sms-badge { padding: 2px 6px; font-size: 0.6rem; gap: 2px; border-width: 1px; }
    .nav-sms-badge i { font-size: 0.55rem; }
    .nav-sms-label { display: none; }
}
@media (max-width: 480px) {
    .nav-sms-badge { padding: 2px 5px; font-size: 0.55rem; border-radius: 6px; }
}

/* ===== THEME TOGGLE BUTTON ===== */
.theme-toggle {
    background: none;
    border: 1px solid var(--gray-300);
    color: var(--gray-600);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all .2s ease;
}
.theme-toggle:hover {
    background: var(--gray-100);
    color: var(--primary-color);
    border-color: var(--primary-color);
}
