/* ==========================================================================
   L1 License System — Interface stylesheet
   Dark / glassmorphism / RTL-first
   ========================================================================== */

/* --------------------------------------------------------------- Tokens -- */
:root {
    --bg: #09090b;
    --bg-soft: #0c0c0f;
    --card: #111114;
    --card-hover: #18181b;
    --elevated: #18181b;
    --primary: #ab5ef7;
    --primary-strong: #7c3aed;
    --primary-soft: rgba(171, 94, 247, 0.12);
    --primary-line: rgba(171, 94, 247, 0.32);
    --white: #ffffff;
    --muted: #a1a1aa;
    --muted-dim: #71717a;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);

    --success: #34d399;
    --success-soft: rgba(52, 211, 153, 0.12);
    --warning: #fbbf24;
    --warning-soft: rgba(251, 191, 36, 0.12);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, 0.12);
    --info: #60a5fa;
    --info-soft: rgba(96, 165, 250, 0.12);

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
    --radius-full: 999px;

    --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
    --shadow-glow: 0 0 40px rgba(171, 94, 247, 0.22);

    --sidebar-w: 268px;
    --topbar-h: 68px;

    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --font: 'Cairo', 'Tajawal', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --mono: 'JetBrains Mono', 'Consolas', 'Courier New', monospace;

    /* Optional page backdrop. Set to `none` to fall back to the flat colour. */
}

/* ---------------------------------------------------------------- Reset -- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    color-scheme: dark;
}

body {
    font-family: var(--font);
    /* Colour first, image on top — the shorthand would otherwise drop it. */
    background-color: var(--bg);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--white);
    line-height: 1.7;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Ambient background glow shared by every page. */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(760px 420px at 85% -8%, rgba(171, 94, 247, 0.16), transparent 62%),
        radial-gradient(680px 400px at 8% 4%, rgba(124, 58, 237, 0.13), transparent 60%),
        radial-gradient(900px 600px at 50% 110%, rgba(124, 58, 237, 0.08), transparent 65%);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    background: none;
    border: none;
}

ul,
ol {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

table {
    border-collapse: collapse;
    width: 100%;
}

::selection {
    background: rgba(171, 94, 247, 0.35);
    color: #fff;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.09);
    border-radius: var(--radius-full);
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(171, 94, 247, 0.4);
    background-clip: content-box;
}

/* --------------------------------------------------------------- Layout -- */
.container {
    width: min(1240px, 100% - 48px);
    margin-inline: auto;
    position: relative;
    z-index: 1;
}

.stack {
    display: grid;
    gap: 22px;
}

.row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.grow {
    flex: 1;
}

.hidden {
    display: none !important;
}

/* ------------------------------------------------------------- Typography */
h1,
h2,
h3,
h4 {
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.section-title {
    font-size: 1.35rem;
    font-weight: 700;
}

.section-sub {
    color: var(--muted);
    font-size: 0.92rem;
}

.muted {
    color: var(--muted);
}

.dim {
    color: var(--muted-dim);
}

.mono {
    font-family: var(--mono);
    letter-spacing: 0.04em;
    direction: ltr;
    unicode-bidi: embed;
}

.gradient-text {
    background: linear-gradient(120deg, #ffffff 0%, #d8bcff 45%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* --------------------------------------------------------------- Surface -- */
.card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0)) , var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    position: relative;
    transition: border-color 0.28s var(--ease), transform 0.28s var(--ease), background 0.28s var(--ease);
}

.card.glass {
    background: rgba(17, 17, 20, 0.66);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.card.hoverable:hover {
    background: var(--card-hover);
    border-color: var(--border-strong);
    transform: translateY(-3px);
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title i {
    color: var(--primary);
    font-size: 0.95rem;
}

.divider {
    height: 1px;
    background: var(--border);
    margin: 18px 0;
}

/* --------------------------------------------------------------- Buttons -- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 11px 20px;
    border-radius: var(--radius-full);
    border: 1px solid transparent;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    transition: transform 0.2s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease),
        border-color 0.25s var(--ease), opacity 0.2s var(--ease);
}

.btn i {
    font-size: 0.85em;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled,
.btn.is-loading {
    opacity: 0.55;
    pointer-events: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
    color: #fff;
    box-shadow: 0 10px 26px rgba(124, 58, 237, 0.32);
}

.btn-primary:hover {
    box-shadow: 0 14px 34px rgba(171, 94, 247, 0.45);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border);
    color: var(--white);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-strong);
}

.btn-outline {
    border-color: var(--primary-line);
    color: var(--primary);
    background: var(--primary-soft);
}

.btn-outline:hover {
    background: rgba(171, 94, 247, 0.18);
}

.btn-danger {
    background: var(--danger-soft);
    border-color: rgba(248, 113, 113, 0.3);
    color: var(--danger);
}

.btn-danger:hover {
    background: rgba(248, 113, 113, 0.2);
}

.btn-success {
    background: var(--success-soft);
    border-color: rgba(52, 211, 153, 0.3);
    color: var(--success);
}

.btn-success:hover {
    background: rgba(52, 211, 153, 0.2);
}

.btn-sm {
    padding: 7px 14px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 15px 30px;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

.btn-discord {
    background: #5865f2;
    color: #fff;
    box-shadow: 0 10px 26px rgba(88, 101, 242, 0.34);
}

.btn-discord:hover {
    background: #4752e0;
    box-shadow: 0 14px 34px rgba(88, 101, 242, 0.45);
}

.icon-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    transition: all 0.22s var(--ease);
}

.icon-btn:hover {
    color: var(--white);
    border-color: var(--primary-line);
    background: var(--primary-soft);
}

.icon-btn.danger:hover {
    color: var(--danger);
    border-color: rgba(248, 113, 113, 0.35);
    background: var(--danger-soft);
}

/* ---------------------------------------------------------------- Badges -- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 13px;
    border-radius: var(--radius-full);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
    white-space: nowrap;
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
}

.badge.plain::before {
    display: none;
}

.badge-active,
.badge-approved,
.badge-enabled {
    color: var(--success);
    background: var(--success-soft);
    border-color: rgba(52, 211, 153, 0.26);
}

.badge-expired,
.badge-disabled {
    color: var(--muted);
    background: rgba(161, 161, 170, 0.1);
    border-color: rgba(161, 161, 170, 0.24);
}

.badge-suspended,
.badge-pending {
    color: var(--warning);
    background: var(--warning-soft);
    border-color: rgba(251, 191, 36, 0.26);
}

.badge-revoked,
.badge-rejected {
    color: var(--danger);
    background: var(--danger-soft);
    border-color: rgba(248, 113, 113, 0.26);
}

.badge-info {
    color: var(--info);
    background: var(--info-soft);
    border-color: rgba(96, 165, 250, 0.26);
}

.badge-primary {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: var(--primary-line);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 13px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--muted);
}

.chip i {
    color: var(--primary);
    font-size: 0.75rem;
}

/* ----------------------------------------------------------------- Forms -- */
.field {
    display: grid;
    gap: 8px;
}

.field label,
.label {
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--muted);
}

.label .req {
    color: var(--danger);
    margin-inline-start: 3px;
}

.input,
.select,
.textarea {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--white);
    font-size: 0.9rem;
    transition: border-color 0.22s var(--ease), background 0.22s var(--ease), box-shadow 0.22s var(--ease);
}

.input::placeholder,
.textarea::placeholder {
    color: var(--muted-dim);
}

.input:focus,
.select:focus,
.textarea:focus {
    outline: none;
    border-color: var(--primary-line);
    background: rgba(171, 94, 247, 0.06);
    box-shadow: 0 0 0 4px rgba(171, 94, 247, 0.1);
}

.textarea {
    min-height: 108px;
    resize: vertical;
    line-height: 1.7;
}

.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 17px;
    background-position: right 14px center;
    padding-right: 40px;
}

.select option {
    background: var(--elevated);
    color: var(--white);
}

.field-hint {
    font-size: 0.76rem;
    color: var(--muted-dim);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}

.form-grid .span-2 {
    grid-column: 1 / -1;
}

.switch {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    cursor: pointer;
    user-select: none;
}

.switch input {
    display: none;
}

.switch .track {
    width: 44px;
    height: 25px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid var(--border);
    position: relative;
    transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
    flex: none;
}

.switch .track::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 3px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: var(--muted);
    transition: all 0.25s var(--ease);
}

.switch input:checked + .track {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    border-color: transparent;
}

.switch input:checked + .track::after {
    left: calc(100% - 20px);
    background: #fff;
}

.switch span.text {
    font-size: 0.86rem;
    color: var(--muted);
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-box i {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: var(--muted-dim);
    font-size: 0.85rem;
    pointer-events: none;
}

.search-box .input {
    padding-left: 40px;
}

/* -------------------------------------------------------------- Landing --- */
.nav {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(9, 9, 11, 0.72);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--topbar-h);
    gap: 20px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    font-weight: 800;
    font-size: 1.05rem;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: #fff;
    font-weight: 800;
    font-size: 0.95rem;
    box-shadow: var(--shadow-glow);
    flex: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-links a {
    padding: 9px 15px;
    border-radius: var(--radius-full);
    font-size: 0.88rem;
    color: var(--muted);
    transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.nav-links a:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.05);
}

.nav-toggle {
    display: none;
    color: var(--white);
    font-size: 1.15rem;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    border: 1px solid var(--border);
}

.hero {
    padding: 110px 0 90px;
    text-align: center;
    position: relative;
}

.hero .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 7px 17px;
    border-radius: var(--radius-full);
    background: var(--primary-soft);
    border: 1px solid var(--primary-line);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 26px;
}

.hero h1 {
    font-size: clamp(2.1rem, 5.4vw, 3.7rem);
    line-height: 1.25;
    margin-bottom: 20px;
}

.hero p.lead {
    color: var(--muted);
    font-size: clamp(0.98rem, 2vw, 1.12rem);
    max-width: 640px;
    margin: 0 auto 34px;
}

.hero-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-preview {
    margin-top: 66px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: rgba(17, 17, 20, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
    overflow: hidden;
    text-align: start;
}

.hero-preview .bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.hero-preview .dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
}

.hero-preview .body {
    padding: 26px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
}

.section {
    padding: 88px 0;
}

.section-head {
    text-align: center;
    max-width: 620px;
    margin: 0 auto 48px;
}

.section-head h2 {
    font-size: clamp(1.6rem, 3.4vw, 2.3rem);
    margin-bottom: 12px;
}

.section-head p {
    color: var(--muted);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    border: 1px solid var(--primary-line);
    color: var(--primary);
    font-size: 1.1rem;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 1.02rem;
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--muted);
    font-size: 0.88rem;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    counter-reset: step;
}

.step {
    position: relative;
    padding-top: 12px;
}

.step .num {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    font-weight: 800;
    color: var(--primary);
    background: var(--primary-soft);
    border: 1px solid var(--primary-line);
    margin-bottom: 15px;
}

.step h3 {
    font-size: 1rem;
    margin-bottom: 7px;
}

.step p {
    color: var(--muted);
    font-size: 0.88rem;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 20px;
    align-items: start;
}

.plan.featured {
    border-color: var(--primary-line);
    box-shadow: var(--shadow-glow);
}

.plan .plan-name {
    font-size: 0.95rem;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 10px;
}

.plan .price {
    font-size: 2.1rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.plan .price small {
    font-size: 0.82rem;
    color: var(--muted);
    font-weight: 500;
}

.plan ul {
    display: grid;
    gap: 11px;
    margin: 20px 0 24px;
}

.plan li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.87rem;
    color: var(--muted);
}

.plan li i {
    color: var(--success);
    font-size: 0.8rem;
}

.cta-band {
    text-align: center;
    padding: 56px 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--primary-line);
    background: linear-gradient(135deg, rgba(171, 94, 247, 0.14), rgba(124, 58, 237, 0.06));
}

.cta-band h2 {
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    margin-bottom: 12px;
}

.cta-band p {
    color: var(--muted);
    margin-bottom: 26px;
}

.footer {
    border-top: 1px solid var(--border);
    padding: 34px 0;
    margin-top: 60px;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.85rem;
}

/* ----------------------------------------------------------------- Login -- */
.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 40px 24px;
    position: relative;
    z-index: 1;
}

.auth-card {
    width: min(440px, 100%);
    padding: 40px 34px;
    text-align: center;
    border-radius: var(--radius-lg);
    background: rgba(17, 17, 20, 0.7);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.auth-card .brand-mark {
    width: 56px;
    height: 56px;
    border-radius: 17px;
    font-size: 1.25rem;
    margin: 0 auto 20px;
}

.auth-card h1 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.auth-card p.sub {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 28px;
}

.auth-note {
    margin-top: 22px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    font-size: 0.79rem;
    color: var(--muted);
    text-align: start;
    display: flex;
    gap: 11px;
}

.auth-note i {
    color: var(--primary);
    margin-top: 4px;
}

/* --------------------------------------------------------------- Shell ---- */
.shell {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.sidebar {
    width: var(--sidebar-w);
    flex: none;
    border-inline-end: 1px solid var(--border);
    background: rgba(12, 12, 15, 0.82);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    display: flex;
    flex-direction: column;
    padding: 22px 16px;
    z-index: 50;
    transition: transform 0.32s var(--ease);
    overflow-y: auto;
}

.sidebar .brand {
    padding: 4px 8px 22px;
}

.nav-group {
    margin-bottom: 20px;
}

.nav-group-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--muted-dim);
    padding: 0 12px 9px;
    text-transform: uppercase;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 13px;
    border-radius: 12px;
    color: var(--muted);
    font-size: 0.89rem;
    font-weight: 500;
    transition: all 0.22s var(--ease);
    margin-bottom: 3px;
    position: relative;
}

.nav-item i {
    width: 18px;
    text-align: center;
    font-size: 0.92rem;
}

.nav-item:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.045);
}

.nav-item.active {
    color: var(--white);
    background: var(--primary-soft);
    border: 1px solid var(--primary-line);
    padding: 10px 12px;
}

.nav-item.active i {
    color: var(--primary);
}

.nav-item .count {
    margin-inline-start: auto;
    background: var(--primary-soft);
    border: 1px solid var(--primary-line);
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: var(--radius-full);
}

.sidebar-foot {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.side-user {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 11px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    margin-bottom: 10px;
}

.side-user img,
.side-user .avatar-fallback {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex: none;
}

.side-user .meta {
    min-width: 0;
}

.side-user .name {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.side-user .id {
    font-size: 0.71rem;
    color: var(--muted-dim);
    direction: ltr;
    text-align: start;
}

.avatar-fallback {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
}

.main {
    flex: 1;
    min-width: 0;
    margin-inline-start: var(--sidebar-w);
}

.topbar {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 28px;
    border-bottom: 1px solid var(--border);
    background: rgba(9, 9, 11, 0.72);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 40;
}

.topbar .page-title {
    font-size: 1.05rem;
    font-weight: 700;
}

.topbar .crumbs {
    font-size: 0.76rem;
    color: var(--muted-dim);
}

.content {
    padding: 28px;
    max-width: 1400px;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.page-head h1 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.page-head p {
    color: var(--muted);
    font-size: 0.88rem;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    z-index: 45;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease);
}

.sidebar-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

/* ------------------------------------------------------------ Statistics -- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
}

.stat {
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--card);
    position: relative;
    overflow: hidden;
    transition: all 0.28s var(--ease);
}

.stat::after {
    content: '';
    position: absolute;
    inset-block-start: -40px;
    inset-inline-end: -40px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--primary-soft);
    filter: blur(24px);
    opacity: 0;
    transition: opacity 0.3s var(--ease);
}

.stat:hover {
    border-color: var(--border-strong);
    background: var(--card-hover);
    transform: translateY(-3px);
}

.stat:hover::after {
    opacity: 1;
}

.stat .stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.stat .stat-label {
    font-size: 0.82rem;
    color: var(--muted);
    font-weight: 500;
}

.stat .stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    font-size: 0.88rem;
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid var(--primary-line);
}

.stat .stat-value {
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.stat .stat-foot {
    font-size: 0.75rem;
    color: var(--muted-dim);
    margin-top: 6px;
}

.stat.green .stat-icon {
    background: var(--success-soft);
    color: var(--success);
    border-color: rgba(52, 211, 153, 0.26);
}

.stat.amber .stat-icon {
    background: var(--warning-soft);
    color: var(--warning);
    border-color: rgba(251, 191, 36, 0.26);
}

.stat.red .stat-icon {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: rgba(248, 113, 113, 0.26);
}

.stat.blue .stat-icon {
    background: var(--info-soft);
    color: var(--info);
    border-color: rgba(96, 165, 250, 0.26);
}

.stat.gray .stat-icon {
    background: rgba(161, 161, 170, 0.1);
    color: var(--muted);
    border-color: rgba(161, 161, 170, 0.24);
}

/* -------------------------------------------------------------- Profile --- */
.profile-head {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.profile-head img,
.profile-head .avatar-fallback {
    width: 78px;
    height: 78px;
    border-radius: 24px;
    border: 1px solid var(--border-strong);
    font-size: 1.6rem;
}

.profile-head h2 {
    font-size: 1.3rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 2px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.info-cell {
    background: var(--card);
    padding: 16px 18px;
}

.info-cell .k {
    font-size: 0.76rem;
    color: var(--muted-dim);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.info-cell .k i {
    color: var(--primary);
    font-size: 0.72rem;
}

.info-cell .v {
    font-size: 0.92rem;
    font-weight: 600;
    word-break: break-word;
}

/* ---------------------------------------------------------- License card -- */
.license-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 18px;
}

.license-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    cursor: pointer;
}

.license-card .lc-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.license-card .lc-product {
    font-size: 1.02rem;
    font-weight: 700;
}

.license-card .lc-type {
    font-size: 0.75rem;
    color: var(--muted-dim);
    margin-top: 2px;
}

.key-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    background: rgba(171, 94, 247, 0.06);
    border: 1px dashed var(--primary-line);
}

.key-box .key {
    font-family: var(--mono);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    direction: ltr;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.key-box button {
    color: var(--muted);
    transition: color 0.2s var(--ease);
    font-size: 0.85rem;
}

.key-box button:hover {
    color: var(--primary);
}

.lc-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.lc-meta .k {
    font-size: 0.72rem;
    color: var(--muted-dim);
    margin-bottom: 3px;
}

.lc-meta .v {
    font-size: 0.84rem;
    font-weight: 600;
}

.progress {
    height: 6px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.07);
    overflow: hidden;
}

.progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--primary-strong));
    transition: width 0.6s var(--ease);
}

.progress.warn span {
    background: linear-gradient(90deg, var(--warning), #f59e0b);
}

.progress.danger span {
    background: linear-gradient(90deg, var(--danger), #ef4444);
}

/* --------------------------------------------------------------- Tables --- */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
}

table.data {
    min-width: 760px;
    font-size: 0.85rem;
}

table.data thead th {
    text-align: start;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 0.02em;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.025);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

table.data tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

table.data tbody tr:last-child td {
    border-bottom: none;
}

table.data tbody tr {
    transition: background 0.2s var(--ease);
}

table.data tbody tr:hover {
    background: rgba(255, 255, 255, 0.025);
}

table.data .actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.cell-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cell-user img,
.cell-user .avatar-fallback {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex: none;
    font-size: 0.78rem;
}

.cell-user .n {
    font-weight: 600;
    font-size: 0.84rem;
}

.cell-user .s {
    font-size: 0.72rem;
    color: var(--muted-dim);
    direction: ltr;
}

.toolbar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 18px;
}

.toolbar .select {
    max-width: 190px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.pagination .info {
    font-size: 0.82rem;
    color: var(--muted);
}

.pagination .pages {
    display: flex;
    gap: 6px;
}

/* --------------------------------------------------------------- Tabs ----- */
.tabs {
    display: flex;
    gap: 6px;
    padding: 5px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    width: fit-content;
    max-width: 100%;
    overflow-x: auto;
}

.tab {
    padding: 8px 18px;
    border-radius: var(--radius-full);
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
    transition: all 0.22s var(--ease);
}

.tab:hover {
    color: var(--white);
}

.tab.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: #fff;
    box-shadow: 0 6px 18px rgba(124, 58, 237, 0.3);
}

/* ------------------------------------------------------------- Timeline --- */
.timeline {
    position: relative;
    padding-inline-start: 26px;
}

.timeline::before {
    content: '';
    position: absolute;
    inset-block: 6px;
    inset-inline-start: 7px;
    width: 2px;
    background: linear-gradient(180deg, var(--primary-line), transparent);
}

.timeline-item {
    position: relative;
    padding-bottom: 22px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    inset-inline-start: -25px;
    top: 7px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--card);
    border: 2px solid var(--primary);
    box-shadow: 0 0 0 4px rgba(171, 94, 247, 0.12);
}

.timeline-item .t-action {
    font-size: 0.88rem;
    font-weight: 600;
}

.timeline-item .t-meta {
    font-size: 0.75rem;
    color: var(--muted-dim);
    margin-top: 3px;
}

.timeline-item .t-body {
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 6px;
}

/* ---------------------------------------------------------------- Modal --- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.66);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: grid;
    place-items: center;
    padding: 24px;
    z-index: 120;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.26s var(--ease);
}

.modal-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    width: min(560px, 100%);
    max-height: min(86vh, 880px);
    display: flex;
    flex-direction: column;
    background: rgba(17, 17, 20, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transform: translateY(18px) scale(0.97);
    transition: transform 0.3s var(--ease);
}

.modal.wide {
    width: min(760px, 100%);
}

.modal-backdrop.show .modal {
    transform: translateY(0) scale(1);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-head h3 {
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-head h3 i {
    color: var(--primary);
    font-size: 0.92rem;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    display: grid;
    gap: 16px;
}

.modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 18px 24px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

/* ---------------------------------------------------------------- Toast --- */
.toast-stack {
    position: fixed;
    top: 22px;
    inset-inline-end: 22px;
    z-index: 200;
    display: grid;
    gap: 11px;
    width: min(370px, calc(100vw - 44px));
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius);
    background: rgba(24, 24, 27, 0.94);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow);
    animation: toast-in 0.34s var(--ease);
    position: relative;
    overflow: hidden;
}

.toast.out {
    animation: toast-out 0.28s var(--ease) forwards;
}

.toast .t-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    font-size: 0.8rem;
    flex: none;
}

.toast .t-text {
    font-size: 0.86rem;
    line-height: 1.6;
    flex: 1;
}

.toast .t-close {
    color: var(--muted-dim);
    font-size: 0.8rem;
}

.toast .t-close:hover {
    color: var(--white);
}

.toast.success .t-icon {
    background: var(--success-soft);
    color: var(--success);
}

.toast.error .t-icon {
    background: var(--danger-soft);
    color: var(--danger);
}

.toast.warning .t-icon {
    background: var(--warning-soft);
    color: var(--warning);
}

.toast.info .t-icon {
    background: var(--info-soft);
    color: var(--info);
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(28px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateX(28px) scale(0.96);
    }
}

/* --------------------------------------------------- Loading / empty ------ */
.skeleton {
    background: linear-gradient(
        100deg,
        rgba(255, 255, 255, 0.04) 30%,
        rgba(255, 255, 255, 0.09) 50%,
        rgba(255, 255, 255, 0.04) 70%
    );
    background-size: 220% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: var(--radius-sm);
}

.skeleton.line {
    height: 13px;
    margin-bottom: 9px;
}

.skeleton.line.short {
    width: 45%;
}

.skeleton.card-sk {
    height: 168px;
    border-radius: var(--radius);
}

.skeleton.row-sk {
    height: 52px;
    margin-bottom: 8px;
}

@keyframes shimmer {
    from {
        background-position: 220% 0;
    }
    to {
        background-position: -20% 0;
    }
}

.empty {
    text-align: center;
    padding: 56px 24px;
    color: var(--muted);
}

.empty .e-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    margin: 0 auto 18px;
    font-size: 1.4rem;
    background: var(--primary-soft);
    border: 1px solid var(--primary-line);
    color: var(--primary);
}

.empty h3 {
    font-size: 1.02rem;
    color: var(--white);
    margin-bottom: 8px;
}

.empty p {
    font-size: 0.87rem;
    max-width: 400px;
    margin: 0 auto 20px;
}

.spinner {
    width: 17px;
    height: 17px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.22);
    border-top-color: #fff;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.page-loader {
    display: grid;
    place-items: center;
    padding: 70px 0;
}

/* ---------------------------------------------------------------- Chart --- */
.chart-card {
    min-height: 280px;
}

.chart {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 190px;
    padding-top: 12px;
}

.chart .bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.chart .bar {
    width: 100%;
    max-width: 46px;
    border-radius: 8px 8px 3px 3px;
    background: linear-gradient(180deg, var(--primary), rgba(124, 58, 237, 0.35));
    position: relative;
    transition: height 0.7s var(--ease), filter 0.2s var(--ease);
    min-height: 4px;
}

.chart .bar:hover {
    filter: brightness(1.25);
}

.chart .bar-label {
    font-size: 0.68rem;
    color: var(--muted-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.chart .bar-value {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
}

.donut-wrap {
    display: flex;
    align-items: center;
    gap: 26px;
    flex-wrap: wrap;
}

.donut {
    width: 156px;
    height: 156px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    position: relative;
    flex: none;
}

.donut::after {
    content: '';
    position: absolute;
    inset: 22px;
    border-radius: 50%;
    background: var(--card);
}

.donut .donut-center {
    position: relative;
    z-index: 1;
    text-align: center;
}

.donut .donut-center .n {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
}

.donut .donut-center .l {
    font-size: 0.7rem;
    color: var(--muted-dim);
    margin-top: 3px;
}

.legend {
    display: grid;
    gap: 10px;
    flex: 1;
    min-width: 170px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.83rem;
}

.legend-item .swatch {
    width: 11px;
    height: 11px;
    border-radius: 4px;
    flex: none;
}

.legend-item .lv {
    margin-inline-start: auto;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* ----------------------------------------------------------- Animations --- */
.reveal {
    opacity: 0;
    transform: translateY(18px);
}

.reveal.in {
    animation: reveal-up 0.6s var(--ease) forwards;
}

@keyframes reveal-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fade-in 0.4s var(--ease);
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* -------------------------------------------------------------- Utility --- */
.copyable {
    cursor: pointer;
    transition: color 0.2s var(--ease);
}

.copyable:hover {
    color: var(--primary);
}

.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.w-full { width: 100%; }
.nowrap { white-space: nowrap; }

.two-col {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

/* ---------------------------------------------------------- Responsive --- */
@media (max-width: 1100px) {
    .two-col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    :root {
        --sidebar-w: 260px;
    }

    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main {
        margin-inline-start: 0;
    }

    .nav-links {
        display: none;
    }

    .nav-toggle {
        display: grid;
        place-items: center;
    }
}

@media (max-width: 768px) {
    .container {
        width: min(1240px, 100% - 32px);
    }

    .content,
    .topbar {
        padding-inline: 18px;
    }

    .hero {
        padding: 74px 0 60px;
    }

    .section {
        padding: 62px 0;
    }

    .license-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .toast-stack {
        inset-inline: 16px;
        width: auto;
        top: 16px;
    }

    .modal-foot {
        justify-content: stretch;
    }

    .modal-foot .btn {
        flex: 1;
    }
}

@media (max-width: 520px) {
    .stat .stat-value {
        font-size: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lc-meta {
        grid-template-columns: 1fr;
    }

    .page-head .btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
