/* ============================================================
   theme.css  –  NexusMLM Dark Luxury Base Theme
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
    --primary:         #0D9488;
    --primary-light:   #2DD4BF;
    --primary-dark:    #0F766E;
    --primary-glow:    rgba(20,184,166,0.24);
    --secondary:       #10242B;
    --accent:          #22D3EE;
    --accent-glow:     rgba(34,211,238,0.18);
    --success:         #22C55E;
    --danger:          #EF4444;
    --warning:         #F59E0B;
    --info:            #06B6D4;
    --purple:          #8B5CF6;
    --pink:            #EC4899;

    --bg:              #071319;
    --bg-secondary:    #08181F;
    --bg-card:         #10242B;
    --bg-card-hover:   #16323A;
    --bg-input:        #081B21;
    --bg-hover:        rgba(20,184,166,0.08);

    --text:            #F0FDFA;
    --text-soft:       #CCFBF1;
    --text-muted:      #94B8B5;
    --text-dim:        #5F8584;

    --border:          rgba(94,234,212,0.10);
    --border-strong:   rgba(94,234,212,0.20);
    --border-active:   rgba(45,212,191,0.45);

    --radius-xs:       6px;
    --radius-sm:       8px;
    --radius:          14px;
    --radius-lg:       20px;
    --radius-xl:       28px;

    --shadow-sm:       0 2px 8px rgba(0,0,0,0.25);
    --shadow:          0 4px 24px rgba(0,0,0,0.35);
    --shadow-lg:       0 8px 40px rgba(0,0,0,0.5);
    --shadow-glow:     0 0 24px var(--primary-glow);

    --transition:      all 0.25s cubic-bezier(0.4,0,0.2,1);
    --transition-fast: all 0.15s ease;

    --font:            'Inter', system-ui, -apple-system, sans-serif;
    --font-mono:       'JetBrains Mono', 'Fira Code', 'Courier New', monospace;

    --sidebar-w:       260px;
    --topbar-h:        64px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-image: radial-gradient(circle at 88% 4%, rgba(20,184,166,.08), transparent 28%);
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ---------- Typography ---------- */
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.3; color: var(--text); }
p { color: var(--text-soft); margin: 0; }
a { color: var(--primary-light); text-decoration: none; transition: var(--transition-fast); }
a:hover { color: var(--accent); }

/* ---------- App Layout ---------- */
.app-layout    { display: flex; min-height: 100vh; }
.main-content  { flex: 1; min-width: 0; display: flex; flex-direction: column;
                 margin-left: var(--sidebar-w); transition: margin-left 0.3s ease; }
.page-body     { flex: 1; padding: 24px; overflow-y: auto; }

/* ---------- Section Title ---------- */
.section-title {
    font-size: 12px; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.1em;
    display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.section-title::after { content:''; flex:1; height:1px; background: var(--border); }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 999px;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em;
    white-space: nowrap;
}
.badge-primary  { background: rgba(37,99,235,0.12);  color: #60A5FA; border: 1px solid rgba(37,99,235,0.25); }
.badge-success  { background: rgba(34,197,94,0.1);   color: #4ADE80; border: 1px solid rgba(34,197,94,0.25); }
.badge-danger   { background: rgba(239,68,68,0.1);   color: #F87171; border: 1px solid rgba(239,68,68,0.25); }
.badge-warning  { background: rgba(245,158,11,0.1);  color: #FCD34D; border: 1px solid rgba(245,158,11,0.25); }
.badge-accent   { background: rgba(6,182,212,0.1);   color: #22D3EE; border: 1px solid rgba(6,182,212,0.25); }
.badge-purple   { background: rgba(139,92,246,0.1);  color: #A78BFA; border: 1px solid rgba(139,92,246,0.25); }
.badge-muted    { background: rgba(148,163,184,0.08);color: #94A3B8; border: 1px solid rgba(148,163,184,0.15); }

.badge.dot::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%;
    background: currentColor; flex-shrink: 0;
}

/* ---------- Avatar ---------- */
.avatar { border-radius: 50%; object-fit: cover; display: inline-block; flex-shrink: 0; }
.avatar-xs  { width: 28px;  height: 28px; }
.avatar-sm  { width: 36px;  height: 36px; }
.avatar-md  { width: 44px;  height: 44px; }
.avatar-lg  { width: 60px;  height: 60px; }
.avatar-xl  { width: 86px;  height: 86px; }
.avatar-xxl { width: 110px; height: 110px; }
.avatar-ring { border: 2px solid var(--primary); }
.avatar-ring-accent { border: 2px solid var(--accent); }

/* ---------- Icon Box ---------- */
.icon-box {
    display: grid; place-items: center; flex-shrink: 0;
    border-radius: var(--radius-sm); font-size: 16px; transition: transform 0.25s;
}
.icon-box-sm  { width: 32px; height: 32px; font-size: 14px; }
.icon-box-md  { width: 44px; height: 44px; font-size: 18px; }
.icon-box-lg  { width: 56px; height: 56px; font-size: 22px; border-radius: 14px; }
.ib-primary   { background: rgba(37,99,235,0.12);  color: #60A5FA; }
.ib-success   { background: rgba(34,197,94,0.12);  color: #4ADE80; }
.ib-danger    { background: rgba(239,68,68,0.12);  color: #F87171; }
.ib-warning   { background: rgba(245,158,11,0.12); color: #FCD34D; }
.ib-accent    { background: rgba(6,182,212,0.12);  color: #22D3EE; }
.ib-purple    { background: rgba(139,92,246,0.12); color: #A78BFA; }
.ib-pink      { background: rgba(236,72,153,0.12); color: #F472B6; }
.ib-teal      { background: rgba(20,184,166,0.12); color: #2DD4BF; }
.ib-indigo    { background: rgba(99,102,241,0.12); color: #818CF8; }

/* ---------- Skeleton ---------- */
.skeleton {
    background: linear-gradient(90deg,#1e293b 25%,#243147 50%,#1e293b 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: var(--radius-sm);
    display: block;
}

/* ---------- Overlay ---------- */
#sidebarOverlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.6); z-index: 1040;
    backdrop-filter: blur(2px);
}
#sidebarOverlay.active { display: block; }

/* ---------- Divider ---------- */
hr.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ---------- Progress ---------- */
.progress-track {
    height: 8px; background: rgba(30,41,59,0.8);
    border-radius: 99px; overflow: hidden;
}
.progress-fill {
    height: 100%; border-radius: 99px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.9s cubic-bezier(0.4,0,0.2,1);
}

/* ---------- Bootstrap Modal Overrides ---------- */
.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
}
.modal-header  { border-bottom: 1px solid var(--border); padding: 20px 24px; }
.modal-footer  { border-top:    1px solid var(--border); padding: 16px 24px; }
.modal-title   { font-size: 16px; font-weight: 700; color: var(--text); }
.btn-close     { filter: invert(1) brightness(0.6); }
.btn-close:hover { filter: invert(1) brightness(1); }

/* ---------- Dropdown Overrides ---------- */
.dropdown-menu {
    background: #162035; border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
    padding: 6px;
}
.dropdown-item {
    color: var(--text-soft); border-radius: var(--radius-xs);
    padding: 9px 14px; font-size: 13px; font-weight: 500;
    transition: var(--transition-fast); display: flex; align-items: center; gap: 9px;
}
.dropdown-item i { font-size: 14px; width: 16px; text-align: center; }
.dropdown-item:hover { background: var(--bg-hover); color: var(--text); }
.dropdown-item:active { background: rgba(37,99,235,0.12); }
.dropdown-item.text-danger:hover { background: rgba(239,68,68,0.08); color: #F87171; }
.dropdown-divider { border-color: var(--border); margin: 5px 0; }

/* ---------- Tooltip ---------- */
.tooltip-inner { background: #162035; color: var(--text-soft); border: 1px solid var(--border); font-size: 12px; border-radius: 6px; }

/* ---------- Utility classes ---------- */
.text-primary  { color: var(--primary-light) !important; }
.text-accent   { color: var(--accent)         !important; }
.text-success  { color: var(--success)        !important; }
.text-danger   { color: var(--danger)         !important; }
.text-warning  { color: var(--warning)        !important; }
.text-muted    { color: var(--text-muted)     !important; }
.text-dim      { color: var(--text-dim)       !important; }
.bg-card       { background: var(--bg-card)   !important; }
.border-card   { border-color: var(--border)  !important; }
.font-mono     { font-family: var(--font-mono); }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.cursor-pointer { cursor: pointer; }

/* ---------- Animations ---------- */
@keyframes shimmer  { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
@keyframes fadeIn   { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
@keyframes fadeOut  { from{opacity:1;transform:translateY(0)} to{opacity:0;transform:translateY(8px)} }
@keyframes slideInL { from{opacity:0;transform:translateX(-16px)} to{opacity:1;transform:translateX(0)} }
@keyframes slideInR { from{opacity:0;transform:translateX(16px)}  to{opacity:1;transform:translateX(0)} }
@keyframes scaleIn  { from{opacity:0;transform:scale(0.95)} to{opacity:1;transform:scale(1)} }
@keyframes spin     { to{transform:rotate(360deg)} }
@keyframes pulse    { 0%,100%{opacity:1} 50%{opacity:0.4} }
@keyframes glow     { 0%,100%{box-shadow:0 0 10px var(--primary-glow)} 50%{box-shadow:0 0 24px var(--primary-glow)} }

.fade-in    { animation: fadeIn   0.4s ease both; }
.slide-in-l { animation: slideInL 0.35s ease both; }
.slide-in-r { animation: slideInR 0.35s ease both; }
.scale-in   { animation: scaleIn  0.3s ease both; }
.anim-d1 { animation-delay: 0.05s; }
.anim-d2 { animation-delay: 0.10s; }
.anim-d3 { animation-delay: 0.15s; }
.anim-d4 { animation-delay: 0.20s; }
.anim-d5 { animation-delay: 0.25s; }
.anim-d6 { animation-delay: 0.30s; }

/* Spinning loader */
.spinner {
    width: 20px; height: 20px;
    border: 2px solid rgba(255,255,255,0.15);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}
.spinner-sm { width: 14px; height: 14px; border-width: 2px; }

/* ---------- Page Loader Overlay ---------- */
.page-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loader-content {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 40px;
    border-radius: 10px;
    backdrop-filter: blur(5px);
}

.spinner-border-lg {
    width: 4rem;
    height: 4rem;
    border-width: 0.4em;
}

/* ---------- Card Elevated (used throughout admin views) ---------- */
.card-elevated {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-elevated .card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--text);
    padding: 14px 20px;
}
.card-elevated .card-body  { padding: 20px; }
.card-elevated .card-body .fw-semibold,
.card-elevated .card-body .fs-5 { color: var(--text); }
.license-detail-item {
    height: 100%; padding: 14px 16px; border-radius: 10px;
    background: rgba(15, 23, 42, .62); border: 1px solid var(--border);
    color: var(--text);
}
.license-detail-item code { color: #67E8F9; font-weight: 700; }
.license-detail-item a { color: #60A5FA; font-weight: 600; }
.usage-metric {
    background: rgba(15, 23, 42, .62); border-color: var(--border) !important;
}
.card-elevated .table {
    --bs-table-color: var(--text); --bs-table-bg: transparent;
    --bs-table-border-color: var(--border); margin-bottom: 0;
}
.card-elevated .table thead th { color: var(--text-muted); background: rgba(15, 23, 42, .7); }
.card-elevated .card-footer {
    background: transparent;
    border-top: 1px solid var(--border);
    padding: 12px 20px;
}

/* ---------- Badges (custom ELMS variants) ---------- */
.badge-primary { background: rgba(37,99,235,0.18);  color: #60A5FA; font-size:11px; font-weight:700; padding:3px 9px; border-radius:99px; display:inline-flex; align-items:center; gap:4px; }
.badge-success { background: rgba(34,197,94,0.18);  color: #4ADE80; font-size:11px; font-weight:700; padding:3px 9px; border-radius:99px; display:inline-flex; align-items:center; gap:4px; }
.badge-danger  { background: rgba(239,68,68,0.18);  color: #F87171; font-size:11px; font-weight:700; padding:3px 9px; border-radius:99px; display:inline-flex; align-items:center; gap:4px; }
.badge-warning { background: rgba(245,158,11,0.18); color: #FCD34D; font-size:11px; font-weight:700; padding:3px 9px; border-radius:99px; display:inline-flex; align-items:center; gap:4px; }
.badge-accent  { background: rgba(6,182,212,0.18);  color: #22D3EE; font-size:11px; font-weight:700; padding:3px 9px; border-radius:99px; display:inline-flex; align-items:center; gap:4px; }
.badge-muted   { background: rgba(148,163,184,0.12);color: #94A3B8; font-size:11px; font-weight:700; padding:3px 9px; border-radius:99px; display:inline-flex; align-items:center; gap:4px; }
.badge.dot::before { content:''; width:6px; height:6px; border-radius:50%; background:currentColor; display:inline-block; margin-right:4px; }

/* ---------- Empty State (generic) ---------- */
.empty-state { padding: 48px 24px; text-align: center; }
.empty-state-icon { font-size: 48px; color: var(--text-dim); }
