:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #eef2ff;
    --accent: #06b6d4;
    --sidebar-width: 260px;
    --bg: #0f172a;
    --panel-bg: linear-gradient(160deg, #f8fafc 0%, #eef2ff 45%, #f0fdfa 100%);
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--panel-bg);
    background-attachment: fixed;
}

/* Sidebar - dark tech */
.sidebar {
    position: fixed; top: 0; left: 0; width: var(--sidebar-width); height: 100vh;
    background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 55%, #0f172a 100%);
    border-right: 1px solid rgba(99, 102, 241, 0.2);
    z-index: 1040;
    overflow-y: auto; transition: transform 0.3s;
    display: flex; flex-direction: column;
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.15);
}
.sidebar-brand {
    padding: 1.25rem 1.5rem; font-weight: 700; font-size: 1.1rem;
    color: #e0e7ff; border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex; align-items: center; gap: 0.5rem;
    flex-shrink: 0;
}
.sidebar-brand i { color: #818cf8; }
.sidebar-nav { padding: 1rem 0.75rem; flex: 1; }
.sidebar-footer {
    flex-shrink: 0;
    padding: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.15);
}
.sidebar-link {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.65rem 1rem; border-radius: 0.5rem; color: #94a3b8;
    text-decoration: none; margin-bottom: 0.15rem; font-size: 0.9rem;
    transition: all 0.2s;
}
.sidebar-link:hover { background: rgba(99, 102, 241, 0.15); color: #e0e7ff; }
.sidebar-link.active {
    background: linear-gradient(90deg, rgba(99,102,241,0.35), rgba(6,182,212,0.15));
    color: #fff; font-weight: 600;
    box-shadow: inset 3px 0 0 #818cf8;
}
.sidebar-link.text-danger { color: #f87171 !important; }
.subscription-widget {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 0.75rem;
    border-radius: 0.65rem;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}
.subscription-widget:hover {
    text-decoration: none;
    border-color: rgba(59, 130, 246, 0.15);
}
.subscription-widget__icon {
    width: 34px;
    height: 34px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}
.subscription-widget__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    line-height: 1.25;
}
.subscription-widget__label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.75;
}
.subscription-widget__value {
    font-size: 0.88rem;
    font-weight: 600;
}
.subscription-widget__chevron {
    font-size: 0.75rem;
    opacity: 0.45;
}
.subscription-widget--danger:hover {
    background: linear-gradient(135deg, rgba(220,38,38,0.28), rgba(127,29,29,0.32));
    border-color: rgba(248,113,113,0.5);
}

/* ── License banners & hero ── */
.license-banner {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    border: 1px solid rgba(99, 102, 241, 0.2);
    background: linear-gradient(135deg, rgba(15,23,42,0.97) 0%, rgba(30,27,75,0.94) 55%, rgba(15,23,42,0.97) 100%);
    color: #e2e8f0;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
}
.license-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(99,102,241,0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99,102,241,0.07) 1px, transparent 1px);
    background-size: 22px 22px;
    pointer-events: none;
    opacity: 0.6;
}
.license-banner__glow {
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
    opacity: 0.45;
}
.license-banner--danger .license-banner__glow { top: -80px; right: -40px; background: #ef4444; }
.license-banner--warning .license-banner__glow { top: -80px; left: -40px; background: #f59e0b; }
.license-banner--info .license-banner__glow { top: -60px; right: 20px; background: #6366f1; }
.license-banner--success { background: linear-gradient(135deg, rgba(6,78,59,0.95), rgba(15,23,42,0.95)); border-color: rgba(52,211,153,0.35); }
.license-banner--danger { border-color: rgba(248,113,113,0.35); }
.license-banner--warning { border-color: rgba(251,191,36,0.35); }
.license-banner--info { border-color: rgba(129,140,248,0.35); }
.license-banner__inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    gap: 1.1rem;
    padding: 1.35rem 1.5rem;
}
.license-banner--compact .license-banner__inner { align-items: center; padding: 1rem 1.25rem; }
.license-banner--flash { padding: 0; }
.license-banner__icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.08) inset;
}
.license-banner__icon-wrap--danger {
    background: linear-gradient(135deg, rgba(239,68,68,0.25), rgba(127,29,29,0.4));
    color: #fca5a5;
    box-shadow: 0 0 24px rgba(239,68,68,0.25);
}
.license-banner__icon-wrap--warning {
    background: linear-gradient(135deg, rgba(245,158,11,0.25), rgba(146,64,14,0.35));
    color: #fcd34d;
    box-shadow: 0 0 24px rgba(245,158,11,0.2);
}
.license-banner__icon-wrap--info {
    background: linear-gradient(135deg, rgba(99,102,241,0.3), rgba(6,182,212,0.2));
    color: #a5b4fc;
    box-shadow: 0 0 24px rgba(99,102,241,0.25);
}
.license-banner__icon-wrap--success {
    background: linear-gradient(135deg, rgba(16,185,129,0.25), rgba(6,78,59,0.4));
    color: #6ee7b7;
    width: 44px; height: 44px; font-size: 1.15rem;
}
.license-banner__body { flex: 1; min-width: 0; }
.license-banner__badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    margin-bottom: 0.45rem;
    background: rgba(255,255,255,0.08);
    color: #cbd5e1;
    border: 1px solid rgba(255,255,255,0.1);
}
.license-banner--danger .license-banner__badge { color: #fecaca; border-color: rgba(248,113,113,0.3); background: rgba(239,68,68,0.15); }
.license-banner--warning .license-banner__badge { color: #fde68a; border-color: rgba(251,191,36,0.3); background: rgba(245,158,11,0.12); }
.license-banner--info .license-banner__badge { color: #c7d2fe; border-color: rgba(129,140,248,0.35); background: rgba(99,102,241,0.15); }
.license-banner__title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
    background: linear-gradient(90deg, #f8fafc, #c7d2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.license-banner--danger .license-banner__title {
    background: linear-gradient(90deg, #fff1f2, #fca5a5);
    -webkit-background-clip: text;
    background-clip: text;
}
.license-banner__text {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 0.85rem;
    line-height: 1.5;
}
.license-banner__text strong { color: #e2e8f0; }
.license-banner__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1rem;
    border-radius: 0.55rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
}
.license-banner__btn:hover { transform: translateY(-1px); text-decoration: none; color: #fff; }
.license-banner__btn--danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    box-shadow: 0 4px 20px rgba(239,68,68,0.35);
}
.license-banner__btn--warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    box-shadow: 0 4px 20px rgba(245,158,11,0.3);
}
.license-banner__close {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: #94a3b8;
    width: 32px;
    height: 32px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    transition: background 0.15s;
}
.license-banner__close:hover { background: rgba(255,255,255,0.12); color: #e2e8f0; }

.license-hero {
    position: relative;
    overflow: hidden;
    border-radius: 1.15rem;
    padding: 2rem 2.25rem;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 45%, #0f172a 100%);
    border: 1px solid rgba(99,102,241,0.25);
    box-shadow: 0 20px 50px rgba(15,23,42,0.25), 0 0 0 1px rgba(99,102,241,0.1) inset;
}
.license-hero__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(99,102,241,0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99,102,241,0.08) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,0.8), transparent);
}
.license-hero__glow {
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    pointer-events: none;
}
.license-hero__glow--left { top: -100px; left: -60px; background: #6366f1; }
.license-hero__glow--right { bottom: -120px; right: -40px; background: #ef4444; }
.license-hero__content {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}
.license-hero__icon {
    width: 72px;
    height: 72px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(239,68,68,0.2), rgba(99,102,241,0.25));
    color: #fca5a5;
    border: 1px solid rgba(248,113,113,0.35);
    box-shadow: 0 0 40px rgba(239,68,68,0.2);
    animation: license-pulse 3s ease-in-out infinite;
}
@keyframes license-pulse {
    0%, 100% { box-shadow: 0 0 40px rgba(239,68,68,0.2); }
    50% { box-shadow: 0 0 55px rgba(239,68,68,0.35); }
}
.license-hero__badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    margin-bottom: 0.6rem;
    color: #fecaca;
    background: rgba(239,68,68,0.15);
    border: 1px solid rgba(248,113,113,0.35);
}
.license-hero__title {
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    font-weight: 800;
    margin: 0 0 0.5rem;
    background: linear-gradient(90deg, #f8fafc 0%, #fca5a5 50%, #c7d2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.license-hero__text {
    color: #94a3b8;
    font-size: 0.95rem;
    margin-bottom: 1.1rem;
    max-width: 520px;
    line-height: 1.55;
}
.license-hero__features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    font-size: 0.82rem;
    color: #64748b;
}
.license-hero__features span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.license-hero__features i { color: #34d399; }

.license-balance-icon {
    width: 56px;
    height: 56px;
    border-radius: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(6,182,212,0.12));
    color: var(--primary);
    border: 1px solid rgba(99,102,241,0.2);
}
.license-days-pill {
    background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(6,182,212,0.1));
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 0.85rem;
    padding: 0.65rem 1.1rem;
    min-width: 90px;
}
.license-days-pill__value {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(90deg, #4f46e5, #0891b2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.license-days-pill__label {
    font-size: 0.72rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.license-meta__label {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    margin-bottom: 0.2rem;
}
.license-meta__value { font-weight: 600; color: #1e293b; }
.license-package-card { transition: transform 0.2s, box-shadow 0.2s; }
.license-package-card:hover { transform: translateY(-3px); }
.license-package-card--ready {
    box-shadow: 0 0 0 2px rgba(16,185,129,0.35), 0 12px 32px rgba(15,23,42,0.08) !important;
}
.license-package-badge {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: rgba(99,102,241,0.1);
    color: var(--primary-dark);
    border: 1px solid rgba(99,102,241,0.2);
}
.license-package-price {
    background: linear-gradient(90deg, #4f46e5, #0891b2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

/* Sidebar subscription widget — dark glass */
.subscription-widget--calm {
    background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(6,182,212,0.08));
    border-color: rgba(129,140,248,0.25);
    color: #c7d2fe;
}
.subscription-widget--calm .subscription-widget__icon {
    background: rgba(99,102,241,0.2);
    color: #a5b4fc;
}
.subscription-widget--calm:hover {
    background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(6,182,212,0.12));
    border-color: rgba(129,140,248,0.4);
}
.subscription-widget--warning {
    background: linear-gradient(135deg, rgba(245,158,11,0.15), rgba(146,64,14,0.12));
    border-color: rgba(251,191,36,0.3);
    color: #fde68a;
}
.subscription-widget--warning .subscription-widget__icon {
    background: rgba(245,158,11,0.2);
    color: #fbbf24;
}
.subscription-widget--warning:hover {
    background: linear-gradient(135deg, rgba(245,158,11,0.22), rgba(146,64,14,0.18));
}
.subscription-widget--danger {
    background: linear-gradient(135deg, rgba(220,38,38,0.2), rgba(127,29,29,0.22));
    border-color: rgba(248,113,113,0.4);
    color: #fecaca;
    box-shadow: 0 0 24px rgba(239,68,68,0.12);
}
.subscription-widget--danger .subscription-widget__icon {
    background: rgba(239,68,68,0.25);
    color: #f87171;
    box-shadow: 0 0 16px rgba(239,68,68,0.2);
}
.subscription-widget__pulse {
    position: absolute;
    inset: -2px;
    border-radius: 0.7rem;
    border: 1px solid rgba(248,113,113,0.5);
    animation: widget-pulse 2.5s ease-out infinite;
    pointer-events: none;
}
@keyframes widget-pulse {
    0% { opacity: 0.8; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.04); }
}
.subscription-widget--danger .subscription-widget__value { color: #fff; }
.subscription-widget--calm .subscription-widget__value { color: #e0e7ff; }

.main-content { margin-left: var(--sidebar-width); min-height: 100vh; }
.top-navbar {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(99,102,241,0.12);
    padding: 0.75rem 1.5rem; display: flex; align-items: center;
    position: sticky; top: 0; z-index: 1030;
}

/* Glass cards */
.card-glass {
    background: rgba(255,255,255,0.82) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.6) !important;
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.06) !important;
}
.fx-strip {
    display: flex; flex-wrap: wrap; gap: 1rem;
    padding: 0.65rem 1rem; border-radius: 0.65rem;
    background: linear-gradient(90deg, rgba(99,102,241,0.08), rgba(6,182,212,0.08));
    border: 1px solid rgba(99,102,241,0.15);
    font-size: 0.85rem; color: #475569;
}
.page-header h4 { background: linear-gradient(90deg, #4f46e5, #0891b2);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Stat cards */
.stat-card {
    border-radius: 0.85rem !important;
    transition: transform 0.2s, box-shadow 0.2s;
    background: rgba(255,255,255,0.9) !important;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(15,23,42,0.08) !important; }
.stat-icon {
    width: 48px; height: 48px; border-radius: 0.75rem;
    display: flex; align-items: center; justify-content: center; font-size: 1.25rem;
}
.stat-value { font-size: 1.25rem; font-weight: 700; color: #1e293b; }
.stat-label { font-size: 0.8rem; color: #94a3b8; }

/* Guest / Login */
.guest-page {
    background: linear-gradient(135deg, #eff6ff 0%, #f0f4f8 50%, #e0e7ff 100%);
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
}
.guest-container { width: 100%; max-width: 440px; padding: 1rem; }
.login-card { border-radius: 1rem !important; }

/* Cards */
.card { border-radius: 0.75rem !important; }
.table th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; color: #64748b; font-weight: 600; }

/* Mobile */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
}
@media (max-width: 575.98px) {
    .license-hero { padding: 1.5rem 1.25rem; }
    .license-hero__content { flex-direction: column; align-items: center; text-align: center; }
    .license-hero__text { margin-left: auto; margin-right: auto; }
    .license-hero__features { justify-content: center; }
    .license-banner__inner { flex-wrap: wrap; }
}

.bg-primary-subtle { background-color: #eff6ff !important; }
.bg-success-subtle { background-color: #ecfdf5 !important; }
.bg-warning-subtle { background-color: #fffbeb !important; }
.bg-danger-subtle { background-color: #fef2f2 !important; }
.bg-info-subtle { background-color: #ecfeff !important; }
.bg-secondary-subtle { background-color: #f1f5f9 !important; }
