:root {
    --brand: #6366f1;
    --brand-dark: #4f46e5;
    --sidebar-bg: #1e1e2e;
    --sidebar-text: #cdd6f4;
    --sidebar-hover: #313244;
    --sidebar-active: #6366f1;
}

/* ---- Sidebar ---- */
.sidebar {
    width: 260px;
    min-height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 1.25rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.08);
    letter-spacing: .02em;
}

.sidebar-brand span {
    color: var(--brand);
}

.sidebar-nav .nav-link {
    color: var(--sidebar-text);
    padding: .6rem 1.5rem;
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: .65rem;
    font-size: .9rem;
    transition: background .15s;
}

.sidebar-nav .nav-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    background: var(--sidebar-active);
    color: #fff;
}

.sidebar-nav .nav-section {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #6c7086;
    padding: 1rem 1.5rem .35rem;
}

/* ---- Main content ---- */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
    background: #f8f9fa;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: .75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 99;
}

.content-area {
    padding: 1.75rem 1.5rem;
}

/* ---- Status badges ---- */
.badge-active         { background: #198754; }
.badge-trial          { background: #0d6efd; }
.badge-inactive       { background: #6c757d; }
.badge-expired        { background: #dc3545; }
.badge-grace          { background: #fd7e14; }
.badge-grace_exceeded { background: #842029; }
.badge-invalid        { background: #212529; }
.badge-cancelled      { background: #adb5bd; color:#333; }

/* ---- Stat cards ---- */
.stat-card {
    border: none;
    border-radius: .75rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: .5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

/* ---- Tables ---- */
.table-card {
    border: none;
    border-radius: .75rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
    overflow: hidden;
}

.table-card .table {
    margin-bottom: 0;
}

/* ---- Order / checkout page ---- */
.checkout-wrap {
    max-width: 860px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.plan-card {
    border: 2px solid #dee2e6;
    border-radius: .75rem;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}

.plan-card:hover,
.plan-card.selected {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

.plan-card .plan-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--brand-dark);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .main-content { margin-left: 0; }
}
