/*
 * Nemesis — Design System CSS
 * Inspirado en Gentelella v4 (colorlib.com)
 * Compatible con Bootstrap 5
 * ============================================================
 */

/* ── Google Fonts ──────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Glassmorphic Violet Dark Design System (Kronos Official Brand System) ── */
:root, [data-theme="dark"] {
    /* Brand Electric Violet Scale */
    --primary:             #8b5cf6;
    --primary-hover:       #7c3aed;
    --primary-active:      #6d28d9;
    --primary-dk:          #581c87;
    --primary-lt:          rgba(139, 92, 246, 0.12);
    --primary-contrast:    #ffffff;
    --primary-glow:        0 0 20px rgba(139, 92, 246, 0.45);
    --primary-glow-sm:     0 0 10px rgba(139, 92, 246, 0.30);

    /* Violet Accents & Neon Tones */
    --violet-neon:         #a855f7;
    --violet-bright:       #c084fc;
    --violet-muted:        #d8b4fe;
    --violet-glass:        rgba(139, 92, 246, 0.10);
    --violet-glass-border: rgba(168, 85, 247, 0.30);
    --violet-gradient:     linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    --violet-pill-bg:      rgba(139, 92, 246, 0.14);

    /* Void & Surface Glass (Preserving Pure Blacks & Charcoal Grays) */
    --bg:                  #08090d;
    --bg-darker:           #050608;
    --surface:             rgba(18, 17, 26, 0.72);
    --surface-solid:       #12111a;
    --surface-card:        rgba(22, 20, 32, 0.65);
    --border-color:        rgba(255, 255, 255, 0.08);
    --border-hover:        rgba(168, 85, 247, 0.40);
    --border-violet:       rgba(139, 92, 246, 0.25);
    --text:                #ffffff;
    --text-muted:          rgba(255, 255, 255, 0.48);
    --text-secondary:      rgba(255, 255, 255, 0.72);
    --placeholder-color:   rgba(255, 255, 255, 0.30);

    /* Sidebar Glass */
    --sidebar-bg:          rgba(12, 11, 18, 0.88);
    --sidebar-width:       270px;
    --sidebar-width-collapsed: 72px;
    --sidebar-text:        rgba(255, 255, 255, 0.65);
    --sidebar-hover:       rgba(139, 92, 246, 0.09);
    --sidebar-active:      rgba(139, 92, 246, 0.18);
    --sidebar-active-text: #ffffff;
    --sidebar-border:      rgba(255, 255, 255, 0.07);
    --brand-color:         #ffffff;

    /* Topbar Removed */
    --topbar-bg:           transparent;
    --topbar-border:       transparent;
    --topbar-h:            0px;

    /* Shape & Shadows */
    --radius:              14px;
    --radius-sm:           8px;
    --radius-pill:         9999px;
    --shadow:              0 8px 32px 0 rgba(0, 0, 0, 0.55), inset 0 1px 0 0 rgba(255, 255, 255, 0.10);
    --shadow-violet:       0 8px 32px 0 rgba(109, 40, 217, 0.25), inset 0 1px 0 0 rgba(168, 85, 247, 0.25);
    --glass-blur:          blur(20px) saturate(180%);
    --transition:          all .2s cubic-bezier(0.4, 0, 0.2, 1);
    --font:                'Inter', system-ui, -apple-system, sans-serif;
}

[data-theme="light"] {
    /* Brand Electric Violet Scale */
    --primary:             #7c3aed;
    --primary-hover:       #6d28d9;
    --primary-active:      #5b21b6;
    --primary-dk:          #4c1d95;
    --primary-lt:          rgba(124, 58, 237, 0.10);
    --primary-contrast:    #ffffff;
    --primary-glow:        0 0 20px rgba(124, 58, 237, 0.25);
    --primary-glow-sm:     0 0 10px rgba(124, 58, 237, 0.18);

    /* Violet Accents & Neon Tones */
    --violet-neon:         #7c3aed;
    --violet-bright:       #8b5cf6;
    --violet-muted:        #6d28d9;
    --violet-glass:        rgba(124, 58, 237, 0.08);
    --violet-glass-border: rgba(124, 58, 237, 0.20);
    --violet-gradient:     linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    --violet-pill-bg:      rgba(124, 58, 237, 0.10);

    /* Clean Light Theme Surfaces */
    --bg:                  #f8fafc;
    --bg-darker:           #f1f5f9;
    --surface:             rgba(255, 255, 255, 0.92);
    --surface-solid:       #ffffff;
    --surface-card:        rgba(255, 255, 255, 0.95);
    --border-color:        rgba(15, 23, 42, 0.08);
    --border-hover:        rgba(124, 58, 237, 0.40);
    --border-violet:       rgba(124, 58, 237, 0.20);
    --text:                #0f172a;
    --text-muted:          #64748b;
    --text-secondary:      #334155;
    --placeholder-color:   #94a3b8;

    /* Sidebar Light Glass */
    --sidebar-bg:          rgba(255, 255, 255, 0.94);
    --sidebar-width:       270px;
    --sidebar-width-collapsed: 72px;
    --sidebar-text:        #475569;
    --sidebar-hover:       rgba(124, 58, 237, 0.07);
    --sidebar-active:      rgba(124, 58, 237, 0.12);
    --sidebar-active-text: #7c3aed;
    --sidebar-border:      rgba(15, 23, 42, 0.07);
    --brand-color:         #0f172a;

    --topbar-bg:           transparent;
    --topbar-border:       transparent;
    --topbar-h:            0px;

    --radius:              14px;
    --radius-sm:           8px;
    --radius-pill:         9999px;
    --shadow:              0 8px 30px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    --shadow-violet:       0 8px 24px rgba(124, 58, 237, 0.15);
    --glass-blur:          blur(20px) saturate(180%);
    --transition:          all .2s cubic-bezier(0.4, 0, 0.2, 1);
    --font:                'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { height: 100%; scroll-behavior: smooth; }

body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background: radial-gradient(circle at 50% 0%, #1e1333 0%, #0c0b14 45%, #08090d 100%) fixed;
    min-height: 100vh;
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

/* ── Shell Layout ───────────────────────────────────────────── */
.shell {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1040;
    transition: transform .28s cubic-bezier(.4,0,.2,1), width .28s cubic-bezier(.4,0,.2,1);
    overflow: hidden;
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.1) transparent;
}
.sidebar-inner::-webkit-scrollbar { width: 4px; }
.sidebar-inner::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }

/* Brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 16px 16px;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
    position: relative;
}
.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.brand-icon {
    width: 34px;
    height: 34px;
    background: rgba(139, 92, 246, 0.10);
    border: 1px solid rgba(168, 85, 247, 0.30);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 0 14px rgba(139, 92, 246, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.20);
    transition: var(--transition);
}
.brand-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 7px;
}
.brand-name {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -.3px;
    white-space: nowrap;
}

/* Sidebar Collapse Toggle Button */
.btn-sidebar-collapse {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: rgba(255, 255, 255, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
    flex-shrink: 0;
}
.btn-sidebar-collapse:hover {
    background: rgba(139, 92, 246, 0.22);
    border-color: rgba(168, 85, 247, 0.50);
    color: #ffffff;
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.40);
}

/* Nav */
.sidebar-nav {
    padding: 12px 0;
    flex: 1;
}
.nav-group { margin-bottom: 4px; }
.nav-label {
    font-size: 10px;
    font-weight: 600;
    color: rgba(255,255,255,.35);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 16px 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    margin: 2px 10px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
    background: none;
    border: 1px solid transparent;
    transition: var(--transition);
    position: relative;
}
.nav-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
    border-color: rgba(168, 85, 247, 0.18);
}
.nav-link.active {
    background: rgba(139, 92, 246, 0.16) !important;
    color: #ffffff !important;
    font-weight: 600;
    border: 1px solid rgba(168, 85, 247, 0.38) !important;
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
}
.nav-link .icon {
    flex-shrink: 0;
    opacity: .80;
    font-size: 15px;
    transition: var(--transition);
}
.nav-link.active .icon {
    opacity: 1;
    color: #c084fc !important;
    filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.65));
}
.nav-link:hover .icon {
    opacity: 1;
    color: #d8b4fe;
}
.nav-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    line-height: 1.4;
    flex-shrink: 0;
    background: rgba(139, 92, 246, 0.15) !important;
    border: 1px solid rgba(168, 85, 247, 0.35) !important;
    color: #d8b4fe !important;
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.20);
}

/* Sub-menu (collapsible) */
.nav-tree .nav-sub {
    overflow: hidden;
    max-height: 0;
    transition: max-height .25s ease;
}
.nav-tree.open .nav-sub { max-height: 1200px; }
.nav-sublink {
    display: block;
    padding: 8px 16px 8px 44px;
    color: rgba(255,255,255,.55);
    text-decoration: none;
    font-size: 13px;
    transition: var(--transition);
    border-radius: 6px;
    margin: 1px 10px;
}
.nav-sublink:hover {
    color: #fff;
    background: rgba(139, 92, 246, 0.08);
}
.nav-sublink.active {
    color: #fff;
    background: rgba(139, 92, 246, 0.16) !important;
    font-weight: 600;
    border: 1px solid rgba(168, 85, 247, 0.25);
}
.nav-chev {
    flex-shrink: 0;
    transition: transform .2s;
    font-size: 11px;
}
.nav-tree.open .nav-chev { transform: rotate(90deg); }

/* Sidebar Footer / Admin & Perfil */
.sidebar-footer {
    border-top: 1px solid var(--sidebar-border);
    padding: 14px 16px;
    flex-shrink: 0;
    background: rgba(12, 11, 18, 0.6);
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}
.avatar-user-brand {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.15);
    border: 1.5px solid rgba(168, 85, 247, 0.45);
    color: #c4b5fd;
    font-size: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 0 14px rgba(139, 92, 246, 0.35);
    cursor: pointer;
    transition: var(--transition);
}
.avatar-user-brand:hover {
    transform: scale(1.05);
    border-color: #a855f7;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.55);
}
.avatar-user-brand .online-indicator {
    position: absolute;
    bottom: 0px;
    right: 0px;
    width: 9px;
    height: 9px;
    background: #a855f7;
    box-shadow: 0 0 6px #a855f7;
    border-radius: 50%;
    border: 2px solid #0c0b12;
}
.user-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-role-badge {
    font-size: 11px;
    color: #d8b4fe;
    display: flex;
    align-items: center;
    gap: 4px;
}
.badge-dot {
    width: 6px;
    height: 6px;
    background: #a855f7;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 5px #a855f7;
}

.btn-profile-pill {
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(168, 85, 247, 0.32);
    color: #e9d5ff;
    border-radius: 9999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-profile-pill:hover {
    background: rgba(139, 92, 246, 0.24);
    border-color: rgba(168, 85, 247, 0.60);
    color: #ffffff;
    box-shadow: 0 0 14px rgba(139, 92, 246, 0.35);
}
.btn-admin-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
    flex-shrink: 0;
}
.btn-admin-icon:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(168, 85, 247, 0.4);
    color: #fff;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

/* ── Collapsed Sidebar System (Compact Icon Rail: 72px) ──────── */
body.sidebar-collapsed .sidebar {
    width: 72px !important;
    transform: none !important;
    left: 0 !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 1040 !important;
}

body.sidebar-collapsed .main,
body.sidebar-collapsed .main-wrapper {
    margin-left: 72px !important;
}

body.sidebar-collapsed .brand-name,
body.sidebar-collapsed .nav-text,
body.sidebar-collapsed .nav-badge,
body.sidebar-collapsed .nav-chev,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-sub,
body.sidebar-collapsed .user-info,
body.sidebar-collapsed .btn-profile-pill .btn-text {
    display: none !important;
}

body.sidebar-collapsed .sidebar-brand {
    padding: 16px 8px 12px !important;
    justify-content: center !important;
    flex-direction: column !important;
    gap: 8px !important;
    align-items: center !important;
}

body.sidebar-collapsed .brand-wrapper {
    justify-content: center !important;
    width: 100% !important;
}

body.sidebar-collapsed .brand-icon {
    width: 38px !important;
    height: 38px !important;
    margin: 0 auto !important;
}

body.sidebar-collapsed .btn-sidebar-collapse {
    margin: 0 auto !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
    background: rgba(139, 92, 246, 0.16) !important;
    border: 1px solid rgba(168, 85, 247, 0.40) !important;
    color: #c4b5fd !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.25) !important;
}

body.sidebar-collapsed .btn-sidebar-collapse:hover {
    background: rgba(139, 92, 246, 0.32) !important;
    border-color: rgba(168, 85, 247, 0.65) !important;
    color: #ffffff !important;
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.50) !important;
    transform: scale(1.05);
}

body.sidebar-collapsed .sidebar-nav {
    padding: 8px 0 !important;
}

body.sidebar-collapsed .nav-link {
    justify-content: center !important;
    padding: 0 !important;
    width: 48px !important;
    height: 48px !important;
    margin: 6px auto !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center !important;
}

body.sidebar-collapsed .nav-link .icon {
    font-size: 20px !important;
    margin: 0 !important;
    opacity: 0.85;
}

body.sidebar-collapsed .nav-link.active .icon {
    opacity: 1 !important;
    color: #c084fc !important;
    filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.7));
}

body.sidebar-collapsed .sidebar-footer {
    padding: 14px 6px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

body.sidebar-collapsed .sidebar-user {
    justify-content: center !important;
    margin: 0 auto 10px !important;
}

body.sidebar-collapsed .avatar-user-brand {
    width: 36px !important;
    height: 36px !important;
}

body.sidebar-collapsed .sidebar-admin-actions {
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
}

body.sidebar-collapsed .btn-profile-pill {
    padding: 0 !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

body.sidebar-collapsed .btn-profile-pill i {
    margin: 0 !important;
    font-size: 15px !important;
}

body.sidebar-collapsed .btn-admin-icon {
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-info .name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user-info .role {
    font-size: 11px;
    color: rgba(255,255,255,.4);
}
.sidebar-user-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,.4);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
}
.sidebar-user-btn:hover { color: #fff; background: var(--sidebar-hover); }

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-h);
    background: var(--topbar-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--topbar-border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    z-index: 1030;
    transition: left .28s cubic-bezier(.4,0,.2,1);
}
.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Hamburger toggle */
.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    transition: var(--transition);
}
.sidebar-toggle:hover { background: var(--bg); color: var(--text); }

/* Breadcrumb */
.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}
.breadcrumb-nav a { color: var(--text-muted); text-decoration: none; }
.breadcrumb-nav a:hover { color: var(--primary); }
.breadcrumb-sep { color: var(--border-color); }
.breadcrumb-current { color: var(--text); font-weight: 500; }

/* Topbar buttons */
.tb-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 7px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    text-decoration: none;
}
.tb-btn:hover { background: var(--bg); color: var(--text); }

/* Notification dot */
.tb-btn .dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 7px;
    height: 7px;
    background: #ffffff;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    border: 2px solid var(--topbar-bg);
}

/* Avatar button */
.tb-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.tb-avatar:hover { opacity: .85; }
.tb-avatar:hover { opacity: .85; }

/* Theme toggle */
.theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-light { display: none; }
[data-theme="dark"] .theme-icon-dark  { display: block; }

/* ── Main Content Area ──────────────────────────────────────── */
.main {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-h);
    flex: 1;
    min-width: 0;
    transition: margin-left .28s cubic-bezier(.4,0,.2,1);
}

.page-wrapper {
    padding: 24px;
    /* max-width: 1600px; */
}

/* Page header */
.page-header { margin-bottom: 24px; }
.page-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.page-pretitle {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 2px;
}
.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    letter-spacing: -.4px;
}
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}
.card:hover {
    border-color: rgba(255, 255, 255, 0.16);
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.015);
    gap: 12px;
}
.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}
.card-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 1px;
}
.card-body {
    padding: 20px;
}
.card-body.p-0 { padding: 0; }
.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.015);
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Grid Rows ──────────────────────────────────────────────── */
.grid-row {
    display: grid;
    gap: 16px;
    margin-bottom: 16px;
}
.col-4    { grid-template-columns: repeat(4, 1fr); }
.col-3    { grid-template-columns: repeat(3, 1fr); }
.col-2    { grid-template-columns: repeat(2, 1fr); }
.col-8-4  { grid-template-columns: 1fr 380px; }
.col-full { grid-template-columns: 1fr; }

/* ── Stat Cards ─────────────────────────────────────────────── */
.stat {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 20px;
}
.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon.teal, .stat-icon.blue, .stat-icon.green, .stat-icon.yellow, .stat-icon.red, .stat-icon.purple, .stat-icon.azure {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
}

.stat-content { flex: 1; min-width: 0; }
.stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .6px;
    margin-bottom: 4px;
}
.stat-value-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}
.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    letter-spacing: -.8px;
}
.stat-change {
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 2px;
    color: rgba(255, 255, 255, 0.75);
}
.stat-change.up, .stat-change.down { color: rgba(255, 255, 255, 0.85); }
.stat-subtext {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Sparkline bars */
.stat-spark {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 36px;
    flex-shrink: 0;
    padding: 4px 0;
}
.stat-spark .bar {
    width: 5px;
    background: #ffffff;
    border-radius: 2px 2px 0 0;
    opacity: .35;
    transition: opacity .2s;
}
.stat-spark .bar:last-child { opacity: 0.95; }

/* Progress thin */
.progress-thin {
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
}
.progress-thin .bar {
    height: 100%;
    background: #ffffff;
    border-radius: 4px;
    transition: width .5s ease;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    text-decoration: none;
    white-space: nowrap;
}
.btn svg { width: 14px; height: 14px; }
.btn-sm  { padding: 5px 14px; font-size: 12px; }
.btn-lg  { padding: 10px 24px; font-size: 14.5px; }

.btn-primary {
    background: var(--violet-gradient) !important;
    color: #ffffff !important;
    border: 1px solid rgba(192, 132, 252, 0.40) !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 18px rgba(124, 58, 237, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #9333ea 0%, #7c3aed 100%) !important;
    color: #ffffff !important;
    border-color: rgba(216, 180, 254, 0.60) !important;
    box-shadow: 0 6px 26px rgba(139, 92, 246, 0.60), inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
    transform: translateY(-1px);
}

.btn-outline, .btn-outline-primary, .btn-outline-secondary {
    background: rgba(139, 92, 246, 0.08) !important;
    color: #e9d5ff !important;
    border: 1px solid rgba(168, 85, 247, 0.28) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.btn-outline:hover, .btn-outline-primary:hover, .btn-outline-secondary:hover {
    background: rgba(139, 92, 246, 0.20) !important;
    color: #ffffff !important;
    border-color: rgba(168, 85, 247, 0.60) !important;
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.35) !important;
    transform: translateY(-1px);
}

.btn-view-profile {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    background: rgba(139, 92, 246, 0.10) !important;
    border: 1px solid rgba(168, 85, 247, 0.30) !important;
    color: #c4b5fd !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: var(--transition) !important;
    padding: 0 !important;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.15) !important;
}
.btn-view-profile:hover {
    background: rgba(139, 92, 246, 0.28) !important;
    border-color: rgba(168, 85, 247, 0.65) !important;
    color: #ffffff !important;
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.50) !important;
    transform: scale(1.08) !important;
}

.btn-danger, .btn-success, .btn-warning, .btn-secondary, .btn-dark {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    border-radius: var(--radius-pill);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.btn-danger:hover, .btn-success:hover, .btn-warning:hover, .btn-secondary:hover, .btn-dark:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    transform: translateY(-1px);
}

/* ── Tables ─────────────────────────────────────────────────── */
.table-responsive { overflow-x: auto; }
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
.table th {
    padding: 11px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: rgba(255, 255, 255, 0.45);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.02) !important;
}
.table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
    vertical-align: middle;
    background: transparent !important;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: rgba(255, 255, 255, 0.035) !important; }

.cell-mono  { font-family: monospace; font-size: 12px; color: var(--text-muted); }
.cell-strong { font-weight: 600; }
.cell-customer { display: flex; align-items: center; gap: 8px; }
.cell-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ── Status / Badge Pills ───────────────────────────────────── */
.status, .badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--radius-pill) !important;
    font-size: 11.5px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: rgba(255, 255, 255, 0.9) !important;
}
.status::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.6);
    flex-shrink: 0;
}
.status-green, .status-blue, .status-yellow, .status-red, .status-gray, .status-purple, .status-teal {
    background: rgba(255, 255, 255, 0.06) !important;
    color: rgba(255, 255, 255, 0.88) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

/* ── Activity Feed ──────────────────────────────────────────── */
.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}
.activity-item:last-child { border-bottom: none; }
.activity-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.activity-body { font-size: 13px; color: var(--text); }
.activity-time { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

/* ── Alerts ─────────────────────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    font-size: 13px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    background: rgba(255, 255, 255, 0.04) !important;
    color: #ffffff !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.alert-success, .alert-danger, .alert-warning, .alert-info {
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
}

/* ── Forms ──────────────────────────────────────────────────── */
.form-label {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 5px;
    display: block;
}
.form-check-label {
    color: var(--text);
}
.form-control, .form-select {
    width: 100%;
    padding: 8px 14px;
    font-size: 13px;
    font-family: var(--font);
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.035) !important;
    border: 1px solid rgba(255, 255, 255, 0.10) !important;
    border-radius: 10px;
    transition: var(--transition);
    outline: none;
    appearance: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
}
.form-control:focus, .form-select:focus {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08), inset 0 1px 2px rgba(0, 0, 0, 0.25) !important;
    color: #ffffff !important;
}
.form-select option {
    background: #14161a !important;
    color: #ffffff !important;
}
.form-text { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.is-invalid { border-color: rgba(255, 255, 255, 0.4) !important; }

/* ── Placeholders con alto contraste (Modo Claro & Modo Oscuro) ── */
.form-control::placeholder,
.form-select::placeholder,
textarea::placeholder,
input::placeholder {
    color: var(--placeholder-color) !important;
    opacity: 1 !important;
}
.form-control::-webkit-input-placeholder,
textarea::-webkit-input-placeholder,
input::-webkit-input-placeholder {
    color: var(--placeholder-color) !important;
    opacity: 1 !important;
}
.form-control::-moz-placeholder,
textarea::-moz-placeholder,
input::-moz-placeholder {
    color: var(--placeholder-color) !important;
    opacity: 1 !important;
}
.form-control:-ms-input-placeholder,
textarea:-ms-input-placeholder,
input:-ms-input-placeholder {
    color: var(--placeholder-color) !important;
    opacity: 1 !important;
}

/* Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 1039;
    backdrop-filter: blur(2px);
}
body.sidebar-open .sidebar-overlay { display: block; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .col-8-4   { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .col-4     { grid-template-columns: repeat(2, 1fr); }
    .col-3     { grid-template-columns: repeat(2, 1fr); }
    .page-wrapper { padding: 16px; }
    .stat-value { font-size: 22px; }
}
@media (max-width: 991px) {
    body.sidebar-collapsed .sidebar {
        transform: none !important;
        width: 72px !important;
        display: flex !important;
    }
    body.sidebar-collapsed .main-wrapper {
        margin-left: 72px !important;
    }
}
@media (max-width: 480px) {
    .col-4 { grid-template-columns: 1fr; }
    .col-3 { grid-template-columns: 1fr; }
    .col-2 { grid-template-columns: 1fr; }
    .page-header-row { flex-direction: column; align-items: flex-start; }
}

/* ── Utilities ──────────────────────────────────────────────── */
.text-muted   { color: var(--text-muted) !important; }
.text-primary  { color: var(--primary) !important; }
.text-success  { color: var(--green) !important; }
.text-danger   { color: var(--red) !important; }
.text-warning  { color: var(--yellow) !important; }
.fw-600        { font-weight: 600; }
.fw-700        { font-weight: 700; }
.mb-0          { margin-bottom: 0; }
.mb-1          { margin-bottom: 4px; }
.mb-2          { margin-bottom: 8px; }
.mb-3          { margin-bottom: 16px; }
.mb-4          { margin-bottom: 24px; }
.gap-2         { gap: 8px; }
.gap-3         { gap: 16px; }
.d-flex        { display: flex; }
.align-center  { align-items: center; }
.justify-between { justify-content: space-between; }

/* ── Animations ─────────────────────────────────────────────── */
@keyframes countUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.stat-value { animation: countUp .4s ease both; }

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.card { animation: fadeIn .3s ease both; }

/* ── Skip link (accessibility) ──────────────────────────────── */
.skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    background: var(--primary);
    color: #fff;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    z-index: 9999;
    font-size: 13px;
    transition: top .2s;
}
.skip-link:focus { top: 8px; }


