/* ====================================================
   Admin Panel Styles
   Light Marketing – Painel Administrativo
   ==================================================== */

:root {
    --primary: #0C7E92;
    --primary-dark: #0a6a7c;
    --primary-glow: rgba(12, 126, 146, 0.25);
    --bg: #0a0a0a;
    --bg-surface: #111111;
    --bg-card: #161616;
    --bg-input: #1a1a1a;
    --border: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(12, 126, 146, 0.35);
    --text: #f0f0f0;
    --text-muted: #888;
    --text-dim: #555;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --sidebar-width: 240px;
    --header-height: 60px;
}

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

body.admin-body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Layout ────────────────────────────────────────── */

.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────── */

.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--header-height);
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar-brand img {
    height: 36px;
    width: auto;
    object-fit: contain;
}

.sidebar-brand-label {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

/* ── Sidebar logo area (above user info) ───────────── */
.sidebar-logo-area {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}

.sidebar-logo-area img {
    height: 64px;
    width: auto;
    object-fit: contain;
    opacity: 0.9;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-section-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    padding: 8px 8px 4px;
    margin-top: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    user-select: none;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.nav-item.active {
    background: var(--primary-glow);
    color: var(--primary);
    border: 1px solid var(--border-accent);
}

.nav-item .nav-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
}

.sidebar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-glow);
    border: 1px solid var(--border-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
}

.sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Main Content ──────────────────────────────────── */

.admin-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.admin-topbar {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
}

.topbar-back-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.admin-content {
    flex: 1;
    padding: 32px 28px;
}

/* ── Sections ──────────────────────────────────────── */

.admin-section {
    display: none;
    animation: fadeIn 0.2s ease;
}

.admin-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}

.section-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Stat Cards ────────────────────────────────────── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.stat-value.primary { color: var(--primary); }
.stat-value.success { color: var(--success); }
.stat-value.warning { color: var(--warning); }

.stat-filter-label {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    margin-top: 2px;
}

.stat-filter-label input[type="checkbox"] {
    accent-color: var(--warning);
    cursor: pointer;
}

/* ── Toolbar / Search ──────────────────────────────── */

.table-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 200px;
    max-width: 360px;
    padding: 9px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.2s;
    outline: none;
}

.search-input:focus {
    border-color: var(--primary);
}

.search-input::placeholder {
    color: var(--text-dim);
}

.filter-select {
    padding: 9px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.filter-select:focus {
    border-color: var(--primary);
}

/* ── Buttons ───────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover { opacity: 0.88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 12px var(--primary-glow);
}

.btn-primary:hover {
    box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-success {
    background: rgba(34, 197, 94, 0.12);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.btn-warning {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.btn-sm {
    padding: 5px 11px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-icon {
    padding: 6px;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, color 0.2s;
}

.btn-icon:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ── Data Table ────────────────────────────────────── */

.table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 13px 16px;
    font-size: 13px;
    color: var(--text);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.025);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar-sm {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary-glow);
    border: 1px solid var(--border-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
    text-transform: uppercase;
}

.user-name {
    font-weight: 600;
    color: var(--text);
    font-size: 13px;
}

.user-email {
    font-size: 11px;
    color: var(--text-muted);
}

/* ── Badges ────────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.badge-free     { background: rgba(136, 136, 136, 0.12); color: #888; border: 1px solid rgba(136,136,136,0.2); }
.badge-basic    { background: rgba(59, 130, 246, 0.12);  color: #60a5fa; border: 1px solid rgba(59,130,246,0.25); }
.badge-premium  { background: rgba(245, 158, 11, 0.12);  color: #fbbf24; border: 1px solid rgba(245,158,11,0.25); }
.badge-user     { background: rgba(136, 136, 136, 0.08); color: #777; border: 1px solid rgba(136,136,136,0.15); }
.badge-admin    { background: rgba(12, 126, 146, 0.15);  color: var(--primary); border: 1px solid var(--border-accent); }
.badge-superadmin { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.35); }
.badge-active   { background: rgba(34, 197, 94, 0.12);   color: var(--success); border: 1px solid rgba(34,197,94,0.25); }
.badge-canceled { background: rgba(239, 68, 68, 0.12);   color: var(--danger); border: 1px solid rgba(239,68,68,0.25); }
.badge-past_due { background: rgba(245, 158, 11, 0.12);  color: var(--warning); border: 1px solid rgba(245,158,11,0.25); }
.badge-gift     { background: rgba(168, 85, 247, 0.12);  color: #c084fc; border: 1px solid rgba(168,85,247,0.25); }

/* ── Actions column ────────────────────────────────── */

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

/* ── Plan Cards ────────────────────────────────────── */

.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.plan-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: border-color 0.2s;
}

.plan-card:hover {
    border-color: var(--border-accent);
}

.plan-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.plan-name {
    font-size: 17px;
    font-weight: 700;
}

.plan-price {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.1;
}

.plan-price span {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
}

.plan-description {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.plan-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── Coupon Cards ──────────────────────────────────── */
.coupons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.coupon-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 0.2s;
}

.coupon-card:hover {
    border-color: var(--border-accent);
}

.coupon-code-display {
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.1em;
    background: var(--primary-glow);
    padding: 6px 12px;
    border-radius: 6px;
    display: inline-block;
}

.coupon-discount {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
}

.coupon-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.coupon-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 6px;
    border-top: 1px solid var(--border);
}

/* ── Notification cards ──────────────────────────── */

.notification-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
    transition: border-color 0.2s;
}

.notification-card:hover {
    border-color: var(--border-accent);
}

.notification-card--inactive {
    opacity: 0.6;
}

.notification-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.notification-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.notification-message {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    white-space: pre-wrap;
    padding: 10px 12px;
    background: var(--bg-input);
    border-radius: 8px;
    border: 1px solid var(--border);
}

/* ── Notification user-picker ────────────────────── */

.notif-user-list {
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-input);
    scrollbar-width: thin;
    scrollbar-color: var(--border) var(--bg-input);
}

.notif-user-list::-webkit-scrollbar {
    width: 6px;
}

.notif-user-list::-webkit-scrollbar-track {
    background: var(--bg-input);
    border-radius: 0 10px 10px 0;
}

.notif-user-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

/* ── Screens checkboxes (create / edit plan) ──────── */
.screens-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.screen-check-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    padding: 4px 0;
}

.screen-check-item input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    accent-color: var(--primary);
    cursor: pointer;
}

.screen-check-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.screen-check-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.screen-check-desc {
    font-size: 11px;
    color: var(--text-dim);
}

.notif-user-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}

.notif-user-item:last-child {
    border-bottom: none;
}

.notif-user-item:hover {
    background: var(--bg-hover);
}

.notif-user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.notif-user-name {
    font-size: 13px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-user-email {
    font-size: 11px;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Pagination ────────────────────────────────────── */

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.pagination-info {
    font-size: 13px;
    color: var(--text-muted);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Empty State ───────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 40px;
    margin-bottom: 12px;
    display: block;
}

.empty-state-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.empty-state-sub {
    font-size: 13px;
    color: var(--text-muted);
}

/* ── Loading Skeleton ──────────────────────────────── */

.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-input) 50%, var(--bg-card) 75%);
    background-size: 400% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 6px;
}

@keyframes shimmer {
    0%   { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* ── Modal ─────────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    transform: translateY(16px) scale(0.97);
    transition: transform 0.25s;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

.modal.modal-lg {
    max-width: 600px;
}

.modal-overlay.open .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px 16px;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 17px;
    font-weight: 700;
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close-btn:hover { color: var(--text); }

.modal-body {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px 20px;
    border-top: 1px solid var(--border);
}

/* ── Form Fields ───────────────────────────────────── */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.form-control {
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
}

.form-control:focus {
    border-color: var(--primary);
}

.form-control::placeholder {
    color: var(--text-dim);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23888' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

.form-helper {
    font-size: 11px;
    color: var(--text-dim);
}

.form-error {
    font-size: 11px;
    color: var(--danger);
}

/* ── Alert / Toast ─────────────────────────────────── */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    pointer-events: all;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: toastIn 0.3s ease;
    max-width: 340px;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

.toast-success { background: #052e16; color: var(--success); border: 1px solid rgba(34,197,94,0.3); }
.toast-error   { background: #1c0a0a; color: var(--danger);  border: 1px solid rgba(239,68,68,0.3); }
.toast-info    { background: #0d1b35; color: #93c5fd;        border: 1px solid rgba(59,130,246,0.3); }

/* ── Stripe badge ──────────────────────────────────── */

.stripe-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #635bff;
    font-weight: 600;
    background: rgba(99, 91, 255, 0.1);
    border: 1px solid rgba(99, 91, 255, 0.2);
    border-radius: 4px;
    padding: 2px 6px;
}

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

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }

    /* Sidebar: hidden by default, slides in when .open */
    .admin-sidebar {
        transform: translateX(-100%);
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        width: 260px !important;
        z-index: 300;
        box-shadow: 4px 0 40px rgba(0,0,0,0.6);
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    /* Dark overlay behind sidebar on mobile */
    .sidebar-backdrop {
        display: block;
    }

    .admin-main {
        margin-left: 0;
        width: 100%;
    }

    .mobile-menu-btn {
        display: flex;
    }

    /* Topbar */
    .admin-topbar {
        padding: 0 12px;
        gap: 8px;
    }

    .topbar-title {
        font-size: 15px;
        flex: 1;
        text-align: center;
    }

    .topbar-back-btn {
        font-size: 11px;
        padding: 5px 8px;
        white-space: nowrap;
    }

    /* Content padding reduced */
    .admin-content {
        padding: 16px 12px 32px;
    }

    /* Stats grid: 2 columns */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 14px 12px;
    }

    .stat-value {
        font-size: 22px;
    }

    /* Toolbar: stacks vertically */
    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .search-input {
        max-width: 100%;
        width: 100%;
        min-width: unset;
    }

    .filter-select {
        width: 100%;
    }

    /* Table: show only 3 columns (User, Plan, Actions) */
    .data-table th:nth-child(n+4),
    .data-table td:nth-child(n+4) {
        display: none;
    }

    /* Plans/Coupons grids: 1 column */
    .plans-grid,
    .coupons-grid {
        grid-template-columns: 1fr;
    }

    /* Section header: stack title + buttons */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .section-header > div:last-child {
        width: 100%;
        display: flex;
        gap: 8px;
    }

    .section-header > div:last-child .btn,
    .section-header > .btn {
        flex: 1;
        justify-content: center;
    }

    /* Pagination: stacks vertically */
    .pagination {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .pagination-controls {
        display: flex;
        gap: 8px;
    }

    .pagination-controls .btn {
        flex: 1;
        justify-content: center;
    }

    /* Modals: full-width, scrollable */
    .modal-overlay {
        padding: 12px;
        align-items: flex-end;
    }

    .modal,
    .modal.modal-lg {
        max-width: 100%;
        width: 100%;
        max-height: 92vh;
        overflow-y: auto;
        border-radius: 20px 20px 12px 12px;
    }

    /* Collapse side-by-side grid columns inside modals */
    .modal-body [style*="grid-template-columns:1fr 1fr"],
    .modal-body [style*="grid-template-columns: 1fr 1fr"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
    }

    /* Annual price section inside modal */
    #annualPriceSection {
        padding-top: 12px;
    }

    /* Notification user list: slightly shorter on mobile */
    .notif-user-list {
        max-height: 200px;
    }

    /* Sidebar logo area: slightly smaller on mobile */
    .sidebar-logo-area img {
        height: 52px;
    }
}

/* ── Sidebar backdrop overlay ──────────────────────── */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 299;
    cursor: pointer;
}

/* ── User detail modal ─────────────────────────────── */
.user-detail-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 4px 0 8px;
}

.user-detail-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-glow);
    border: 2px solid var(--border-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
    text-transform: uppercase;
}

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

.user-detail-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-detail-email {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 4px;
}

.user-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.user-detail-item-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-dim);
}

.user-detail-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 4px;
    border-top: 1px solid var(--border);
    margin-top: 2px;
}

.data-table tr.user-row-clickable {
    cursor: pointer;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
}

/* ── Divider ───────────────────────────────────────── */
.divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

/* ── Inline info row ───────────────────────────────── */
.info-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.info-row.warning {
    background: rgba(245, 158, 11, 0.06);
    border-color: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}
