/* ========================================
   GNPP Enterprise Dashboard - Design System
   SaaS Enterprise Light Theme v2.0
   ======================================== */

/* === CSS Variables === */
:root {
    /* Backgrounds */
    --bg-primary: #f0f4ff;
    --bg-secondary: #e8edf7;
    --bg-card: #ffffff;
    --bg-card-hover: #fafbff;
    --bg-glass: #f8faff;
    --bg-glass-strong: #eef2ff;
    --border-glass: rgba(30, 58, 95, 0.08);
    --border-glass-hover: rgba(30, 58, 95, 0.16);

    /* Text */
    --text-primary: #0f1e36;
    --text-secondary: #334155;
    --text-muted: #64748b;

    /* Corporate Blue Palette */
    --accent-blue: #1d4ed8;
    --accent-blue-light: #3b82f6;
    --accent-blue-pale: rgba(29, 78, 216, 0.08);
    --accent-cyan: #0891b2;
    --accent-purple: #6d28d9;
    --accent-green: #059669;
    --accent-amber: #b45309;
    --accent-red: #dc2626;
    --accent-orange: #c2410c;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #1d4ed8, #2563eb);
    --gradient-sidebar: linear-gradient(180deg, #1e3a5f 0%, #1a2f4b 100%);
    --gradient-purple: linear-gradient(135deg, #6d28d9, #8b5cf6);
    --gradient-green: linear-gradient(135deg, #059669, #10b981);
    --gradient-amber: linear-gradient(135deg, #b45309, #d97706);
    --gradient-red: linear-gradient(135deg, #dc2626, #ef4444);

    /* Shift Colors - Premium Modern Palette */
    --shift1-bg: rgba(14, 165, 233, 0.06);
    --shift1-border: rgba(14, 165, 233, 0.20);
    --shift1-text: #0369a1;
    --shift2-bg: rgba(249, 115, 22, 0.06);
    --shift2-border: rgba(249, 115, 22, 0.20);
    --shift2-text: #c2410c;
    --shift3-bg: rgba(99, 102, 241, 0.06);
    --shift3-border: rgba(99, 102, 241, 0.20);
    --shift3-text: #4338ca;

    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;
    --sidebar-bg-start: #1e3a5f;
    --sidebar-bg-end: #1a2f4b;
    --sidebar-text: rgba(255, 255, 255, 0.75);
    --sidebar-text-hover: #ffffff;
    --sidebar-item-hover: rgba(255, 255, 255, 0.07);
    --sidebar-item-active: rgba(255, 255, 255, 0.12);
    --sidebar-border: rgba(255, 255, 255, 0.07);

    /* Border Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;

    /* Elevation Shadows */
    --shadow-xs:  0 1px 3px rgba(15, 30, 54, 0.06);
    --shadow-sm:  0 2px 8px rgba(15, 30, 54, 0.08);
    --shadow-md:  0 4px 20px rgba(15, 30, 54, 0.10);
    --shadow-lg:  0 8px 40px rgba(15, 30, 54, 0.13);
    --shadow-card: 0 1px 3px rgba(15, 30, 54, 0.06), 0 4px 16px rgba(15, 30, 54, 0.04);
    --shadow-card-hover: 0 4px 12px rgba(15, 30, 54, 0.08), 0 12px 32px rgba(15, 30, 54, 0.07);
    --shadow-blue: 0 4px 20px rgba(29, 78, 216, 0.20);
    --shadow-sidebar: 4px 0 24px rgba(10, 20, 40, 0.18);

    /* Transitions */
    --transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-sidebar: width 0.32s cubic-bezier(0.4, 0, 0.2, 1), margin 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    min-width: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Layout === */
.app-layout {
    width: 100%;
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 0;
}

/* =============================================
   SIDEBAR — Dark Corporate Navy
   ============================================= */
.sidebar {
    width: var(--sidebar-width);
    background: var(--gradient-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: width 0.32s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.32s ease;
    overflow: hidden;
    overflow-y: auto;
    scrollbar-width: none;
    box-shadow: var(--shadow-sidebar);
}
.sidebar::-webkit-scrollbar { display: none; }

/* Sidebar Brand Header */
.sidebar-brand {
    padding: 18px 16px;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 78px;
    overflow: hidden;
    white-space: nowrap;
    transition: padding 0.32s ease;
    background: rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}

.sidebar-brand-logo {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px;
}

.sidebar-brand-logo img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.sidebar-brand-text {
    overflow: hidden;
    transition: opacity 0.22s ease, width 0.32s ease;
    opacity: 1;
    width: auto;
}

.sidebar-brand h1 {
    font-size: 0.82rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.3px;
    line-height: 1.3;
    white-space: nowrap;
    text-transform: uppercase;
}

.sidebar-brand p {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 3px;
    line-height: 1.4;
    font-weight: 400;
    white-space: normal;
}

/* Sidebar Nav */
.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

/* Nav Separator Label */
.nav-section-label {
    font-size: 0.58rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.28);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 10px 14px 4px;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.22s ease;
}

/* === Nav Item + Tooltip === */
.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.83rem;
    font-weight: 500;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
}

/* Left accent line */
.nav-item::before {
    content: '';
    position: absolute;
    left: 0; top: 18%; bottom: 18%;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: #ffffff;
    opacity: 0;
    transform: scaleY(0);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.nav-item:hover::before {
    opacity: 0.4;
    transform: scaleY(1);
}

.nav-item.active::before {
    opacity: 1;
    transform: scaleY(1);
}

.nav-item:hover {
    background: var(--sidebar-item-hover);
    color: var(--sidebar-text-hover);
    border-color: rgba(255, 255, 255, 0.06);
    transform: translateX(3px);
}

.nav-item.active {
    background: var(--sidebar-item-active);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
    font-weight: 600;
}

.nav-item .nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: transform 0.22s ease;
    opacity: 0.8;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
    opacity: 1;
    transform: scale(1.1);
}

.nav-label {
    overflow: hidden;
    opacity: 1;
    transition: opacity 0.2s ease, max-width 0.32s ease;
    max-width: 200px;
    white-space: nowrap;
}

/* Tooltip untuk mode icon-only */
.nav-tooltip {
    position: absolute;
    left: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%) translateX(-6px);
    background: #0f1e36;
    color: #ffffff;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 7px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 9999;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.08);
}
.nav-tooltip::before {
    content: '';
    position: absolute;
    right: 100%; top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: #0f1e36;
}

/* Sidebar User Block */
.sidebar-user {
    padding: 14px 16px;
    border-top: 1px solid var(--sidebar-border);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.10);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--sidebar-border);
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.28);
    overflow: hidden;
    white-space: nowrap;
    transition: opacity 0.22s ease;
    background: rgba(0, 0, 0, 0.12);
    line-height: 1.5;
    flex-shrink: 0;
}

.sidebar-footer-text {
    opacity: 1;
    transition: opacity 0.2s ease;
}

/* === Main Content === */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    padding: 28px 32px;
    min-height: 100vh;
    min-width: 0;
    transition: margin-left 0.32s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Sidebar ICON-ONLY State (Desktop) === */
.app-layout.sidebar-icon-only .sidebar {
    width: var(--sidebar-collapsed-width);
}

.app-layout.sidebar-icon-only .sidebar-brand-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
    pointer-events: none;
}

.app-layout.sidebar-icon-only .nav-label {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    pointer-events: none;
}

.app-layout.sidebar-icon-only .sidebar-footer-text {
    opacity: 0;
    pointer-events: none;
}

.app-layout.sidebar-icon-only .nav-section-label {
    opacity: 0;
    pointer-events: none;
}

/* Collapsed sidebar nav */
.app-layout.sidebar-icon-only .sidebar-nav {
    padding: 16px 0 !important;
    align-items: center !important;
    gap: 4px !important;
}

/* Each nav-item: centered square */
.app-layout.sidebar-icon-only .nav-item {
    width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    margin: 0 auto !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    border-radius: 10px !important;
    position: relative !important;
    overflow: visible !important;
    gap: 0 !important;
}

.app-layout.sidebar-icon-only .nav-item .nav-icon {
    font-size: 1.2rem !important;
    margin: 0 !important;
    width: auto !important;
    height: auto !important;
    flex-shrink: 0 !important;
}

.app-layout.sidebar-icon-only .nav-item::before {
    left: -14px !important;
    width: 3px !important;
    height: 22px !important;
    border-radius: 0 3px 3px 0 !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
}

.app-layout.sidebar-icon-only .nav-item:hover .nav-tooltip {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.app-layout.sidebar-icon-only .nav-item:hover {
    transform: none !important;
}

.app-layout.sidebar-icon-only .sidebar-brand {
    padding: 16px 12px !important;
    justify-content: center !important;
    gap: 0 !important;
}

.app-layout.sidebar-icon-only .sidebar-user {
    padding: 8px !important;
    overflow: hidden !important;
}
.app-layout.sidebar-icon-only .sidebar-user .nav-label { display: none !important; }
.app-layout.sidebar-icon-only .sidebar-user a.btn { display: none !important; }

.app-layout.sidebar-icon-only .sidebar-footer { padding: 8px !important; }

.app-layout.sidebar-icon-only .main-content {
    margin-left: var(--sidebar-collapsed-width);
    width: calc(100% - var(--sidebar-collapsed-width));
}

/* =============================================
   TOP BAR
   ============================================= */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-glass);
}

.top-bar h2 {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

.top-bar-info {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.info-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 600;
    background: #ffffff;
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    box-shadow: var(--shadow-xs);
    transition: var(--transition);
    letter-spacing: 0.01em;
}

.info-badge .dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    animation: pulse-dot 2.2s infinite;
    flex-shrink: 0;
}

.info-badge.shift-1 {
    background: var(--shift1-bg);
    border-color: var(--shift1-border);
    color: var(--shift1-text);
}
.info-badge.shift-1 .dot { background: var(--shift1-text); }

.info-badge.shift-2 {
    background: var(--shift2-bg);
    border-color: var(--shift2-border);
    color: var(--shift2-text);
}
.info-badge.shift-2 .dot { background: var(--shift2-text); }

.info-badge.shift-3 {
    background: var(--shift3-bg);
    border-color: var(--shift3-border);
    color: var(--shift3-text);
}
.info-badge.shift-3 .dot { background: var(--shift3-text); }

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

/* === Sidebar Toggle Button === */
.sidebar-toggle {
    background: #ffffff !important;
    border: 1px solid var(--border-glass) !important;
    box-shadow: var(--shadow-xs) !important;
    color: var(--accent-blue);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    z-index: 100;
    flex-shrink: 0;
}
.sidebar-toggle:hover {
    background: var(--bg-glass-strong) !important;
    border-color: var(--border-glass-hover) !important;
    box-shadow: var(--shadow-sm) !important;
}

/* =============================================
   CARDS
   ============================================= */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    transition: var(--transition);
    box-shadow: var(--shadow-card);
    max-width: 100%;
}

.card:hover {
    border-color: rgba(29, 78, 216, 0.12);
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-glass);
}

.card-title {
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.card-title .icon {
    width: 32px; height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    flex-shrink: 0;
}

.card-title .icon.blue { background: rgba(29, 78, 216, 0.1); color: var(--accent-blue); }
.card-title .icon.green { background: rgba(5, 150, 105, 0.1); color: var(--accent-green); }
.card-title .icon.purple { background: rgba(109, 40, 217, 0.1); color: var(--accent-purple); }
.card-title .icon.amber { background: rgba(180, 83, 9, 0.1); color: var(--accent-amber); }
.card-title .icon.cyan { background: rgba(8, 145, 178, 0.1); color: var(--accent-cyan); }
.card-title .icon.red { background: rgba(220, 38, 38, 0.1); color: var(--accent-red); }

/* =============================================
   STAT CARDS (Metric Cards with Left Border)
   ============================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
    position: relative;
    z-index: 2;
}

.stat-card {
    border-radius: 20px;
    padding: 24px 22px;
    position: relative;
    overflow: hidden;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 140px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: none;
    z-index: 2;
}

/* Base Gradients */
.stat-card.blue { background: linear-gradient(135deg, #2563eb 0%, #60a5fa 100%); box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.4); }
.stat-card.green { background: linear-gradient(135deg, #059669 0%, #34d399 100%); box-shadow: 0 10px 20px -5px rgba(5, 150, 105, 0.4); }
.stat-card.purple { background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%); box-shadow: 0 10px 20px -5px rgba(124, 58, 237, 0.4); }
.stat-card.amber { background: linear-gradient(135deg, #d97706 0%, #fbbf24 100%); box-shadow: 0 10px 20px -5px rgba(217, 119, 6, 0.4); }
.stat-card.red { background: linear-gradient(135deg, #dc2626 0%, #f87171 100%); box-shadow: 0 10px 20px -5px rgba(220, 38, 38, 0.4); }
.stat-card.cyan { background: linear-gradient(135deg, #0891b2 0%, #22d3ee 100%); box-shadow: 0 10px 20px -5px rgba(8, 145, 178, 0.4); }

.stat-card:hover {
    transform: translateY(-8px) scale(1.03);
}
.stat-card.blue:hover { box-shadow: 0 20px 30px -10px rgba(37, 99, 235, 0.6); }
.stat-card.green:hover { box-shadow: 0 20px 30px -10px rgba(5, 150, 105, 0.6); }
.stat-card.purple:hover { box-shadow: 0 20px 30px -10px rgba(124, 58, 237, 0.6); }
.stat-card.amber:hover { box-shadow: 0 20px 30px -10px rgba(217, 119, 6, 0.6); }

/* Top Left Icon */
.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.5rem;
    position: absolute;
    top: 24px;
    left: 22px;
    transition: transform 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 2;
}

.stat-card:hover .stat-icon {
    transform: rotate(10deg) scale(1.1);
}

/* Background Decorative Abstract Shapes for WOW effect */
.stat-card::before, .stat-card::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    z-index: 0;
    transition: all 0.5s ease;
}

/* Big circle bottom right */
.stat-card::before {
    width: 140px;
    height: 140px;
    bottom: -40px;
    right: -40px;
}

/* Small circle top right */
.stat-card::after {
    width: 80px;
    height: 80px;
    top: -20px;
    right: 30px;
}

.stat-card:hover::before { transform: scale(1.2); background: rgba(255, 255, 255, 0.25); }
.stat-card:hover::after { transform: translateY(10px) translateX(10px); }

/* Remove previous subtle glow bar */
/* (We completely replaced it so it's gone) */

.stat-card .stat-label {
    margin-top: 64px;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    margin-bottom: 2px;
    position: relative;
    z-index: 1;
}

.stat-card .stat-value {
    font-size: 2.1rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: #ffffff;
    font-feature-settings: "tnum";
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

/* =============================================
   TABLES
   ============================================= */
.table-wrapper,
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
}

.table-wrapper::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar {
    height: 5px; width: 5px;
}
.table-wrapper::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track {
    background: rgba(15, 30, 54, 0.03);
    border-radius: 3px;
}
.table-wrapper::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb {
    background: rgba(15, 30, 54, 0.15);
    border-radius: 3px;
}
.table-wrapper::-webkit-scrollbar-thumb:hover,
.table-responsive::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 30, 54, 0.28);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.82rem;
}

thead th {
    background: #f0f4ff;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.71rem;
    text-transform: uppercase;
    letter-spacing: 0.055em;
    padding: 13px 12px;
    border-bottom: 2px solid rgba(29, 78, 216, 0.1);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 5;
}

thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
thead th:last-child { border-radius: 0 var(--radius-sm) 0 0; }

tbody td {
    padding: 11px 12px;
    border-bottom: 1px solid rgba(15, 30, 54, 0.05);
    transition: background 0.15s ease;
    color: var(--text-primary);
    font-size: 0.83rem;
}

/* Striped rows */
tbody tr:nth-child(even) td {
    background: rgba(240, 244, 255, 0.45);
}

tbody tr:hover td {
    background: rgba(29, 78, 216, 0.04) !important;
}

tbody tr:hover td.col-shift1 { background: rgba(14, 165, 233, 0.1) !important; }
tbody tr:hover td.col-shift2 { background: rgba(249, 115, 22, 0.1) !important; }
tbody tr:hover td.col-shift3 { background: rgba(99, 102, 241, 0.1) !important; }

tbody tr:last-child td { border-bottom: none; }

/* Text Utilities */
.text-right  { text-align: right; }
.text-center { text-align: center; }
.text-left   { text-align: left; }

.angka {
    text-align: center;
    font-family: 'Inter', monospace;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

.text-blue   { color: var(--accent-blue); }
.text-green  { color: var(--accent-green); }
.text-red    { color: var(--accent-red); }
.text-amber  { color: var(--accent-amber); }
.text-cyan   { color: var(--accent-cyan); }
.text-purple { color: var(--accent-purple); }
.text-orange { color: var(--accent-orange); }
.text-muted  { color: var(--text-muted); }

/* Shift column backgrounds */
.col-shift1 { background: var(--shift1-bg) !important; }
.col-shift2 { background: var(--shift2-bg) !important; }
.col-shift3 { background: var(--shift3-bg) !important; }

.th-shift1 {
    background: rgba(14, 165, 233, 0.08) !important;
    color: var(--shift1-text) !important;
    border-bottom: 2px solid rgba(14, 165, 233, 0.20) !important;
}
.th-shift2 {
    background: rgba(249, 115, 22, 0.08) !important;
    color: var(--shift2-text) !important;
    border-bottom: 2px solid rgba(249, 115, 22, 0.20) !important;
}
.th-shift3 {
    background: rgba(99, 102, 241, 0.08) !important;
    color: var(--shift3-text) !important;
    border-bottom: 2px solid rgba(99, 102, 241, 0.20) !important;
}

/* =============================================
   GRID LAYOUTS
   ============================================= */
.grid-2   { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3   { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }

/* =============================================
   FORMS
   ============================================= */
.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 7px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: #ffffff;
    border: 1.5px solid #dde3ef;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    transition: var(--transition);
    outline: none;
    box-shadow: 0 1px 2px rgba(15, 30, 54, 0.03);
}

.form-control:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
    background: #ffffff;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
    background-color: #ffffff;
}

select.form-control option {
    background: #ffffff;
    color: var(--text-primary);
}

.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.01em;
}

/* Ripple */
.btn::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.45s ease, height 0.45s ease, opacity 0.45s ease;
    opacity: 0;
}
.btn:active::after {
    width: 280px; height: 280px; opacity: 0;
}
.btn:active { transform: translateY(1px) scale(0.98) !important; }

.btn-primary {
    background: var(--gradient-primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.20);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-blue);
    background: linear-gradient(135deg, #1e40af, #1d4ed8);
}

.btn-success {
    background: var(--gradient-green);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.20);
}
.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.30);
}

.btn-secondary {
    background: #ffffff;
    color: var(--text-secondary);
    border: 1.5px solid #dde3ef;
    box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
    border-color: var(--border-glass-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-block { width: 100%; }

/* =============================================
   ALERTS
   ============================================= */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 0.84rem;
    font-weight: 500;
    border: 1px solid;
    margin-bottom: 18px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert-warning {
    background: rgba(180, 83, 9, 0.06);
    border-color: rgba(180, 83, 9, 0.15);
    color: var(--accent-amber);
}
.alert-info {
    background: rgba(29, 78, 216, 0.06);
    border-color: rgba(29, 78, 216, 0.15);
    color: var(--accent-blue);
}
.alert-success {
    background: rgba(5, 150, 105, 0.06);
    border-color: rgba(5, 150, 105, 0.15);
    color: var(--accent-green);
}
.alert-danger {
    background: rgba(220, 38, 38, 0.06);
    border-color: rgba(220, 38, 38, 0.15);
    color: var(--accent-red);
}

/* =============================================
   SEPARATOR
   ============================================= */
.separator {
    height: 1px;
    background: var(--border-glass);
    margin: 22px 0;
}

/* =============================================
   RESPONSIVE — Laptops (1366px)
   ============================================= */
@media (max-width: 1366px) {
    .grid-2 { grid-template-columns: 1fr; }

    table { font-size: 0.76rem; }
    thead th { padding: 9px 8px !important; font-size: 0.69rem !important; }
    tbody td { padding: 9px 8px !important; font-size: 0.76rem !important; }
}

/* =============================================
   RESPONSIVE — Tablet & Mobile (≤1024px)
   ============================================= */
@media (max-width: 1024px) {
    :root { --sidebar-width: 280px; }

    .sidebar {
        position: fixed !important;
        top: 0; left: 0; height: 100vh;
        width: var(--sidebar-width);
        transform: translateX(-100%);
        transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1) !important;
        z-index: 9999 !important;
    }

    .app-layout.sidebar-mobile-open .sidebar {
        transform: translateX(0);
        box-shadow: 8px 0 40px rgba(0,0,0,0.3);
    }

    .app-layout.sidebar-icon-only .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width) !important;
    }
    .app-layout.sidebar-icon-only.sidebar-mobile-open .sidebar {
        transform: translateX(0);
    }

    .app-layout.sidebar-mobile-open::after {
        content: '';
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(10, 20, 40, 0.5);
        backdrop-filter: blur(4px);
        z-index: 9998;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 16px !important;
        padding-top: 78px !important;
        min-width: 0 !important;
    }

    .card {
        padding: 16px !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }

    .sidebar-toggle {
        position: fixed !important;
        top: 14px; left: 14px;
        z-index: 10000;
        background: #ffffff !important;
        box-shadow: var(--shadow-md) !important;
    }

    .top-bar { flex-direction: column !important; align-items: flex-start !important; }
    .stats-grid { grid-template-columns: 1fr 1fr !important; }
    .grid-2, .grid-3, .grid-2-1 { grid-template-columns: 1fr !important; }
    .table-wrapper, .table-responsive {
        margin: 0 -16px !important;
        width: calc(100% + 32px) !important;
        max-width: calc(100% + 32px) !important;
        border-radius: 0 !important;
        overflow-x: auto !important;
    }
    table { min-width: 600px; }

    .stat-card:hover { transform: none !important; }
    .nav-item:hover { transform: none; }
    .card:hover { transform: none; }
}

@media (max-width: 640px) {
    .stats-grid { grid-template-columns: 1fr !important; }
    .main-content { padding: 12px !important; padding-top: 72px !important; }
    .top-bar-info { flex-wrap: wrap; gap: 6px; }
    .info-badge { font-size: 0.7rem; padding: 4px 10px; }
}

@media (max-width: 768px) {
    .form-row { flex-direction: column !important; gap: 12px !important; }
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.94) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes sidebarSlideIn {
    from { opacity: 0; transform: translateX(-16px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes rowFadeIn {
    from { opacity: 0; transform: translateX(-6px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse-text {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

@keyframes navPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes toast-shrink {
    from { width: 100%; }
    to   { width: 0%; }
}

/* Apply animations */
.card { animation: fadeInUp 0.42s ease-out forwards; }
.stat-card { animation: scaleIn 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }

.stat-card:nth-child(1) { animation-delay: 0.04s; }
.stat-card:nth-child(2) { animation-delay: 0.10s; }
.stat-card:nth-child(3) { animation-delay: 0.16s; }
.stat-card:nth-child(4) { animation-delay: 0.22s; }

.card:nth-child(1) { animation-delay: 0.04s; }
.card:nth-child(2) { animation-delay: 0.10s; }
.card:nth-child(3) { animation-delay: 0.18s; }
.card:nth-child(4) { animation-delay: 0.26s; }

.nav-item { animation: sidebarSlideIn 0.32s ease-out both; }
.nav-item:nth-child(1) { animation-delay: 0.04s; }
.nav-item:nth-child(2) { animation-delay: 0.08s; }
.nav-item:nth-child(3) { animation-delay: 0.12s; }
.nav-item:nth-child(4) { animation-delay: 0.16s; }
.nav-item:nth-child(5) { animation-delay: 0.20s; }
.nav-item:nth-child(6) { animation-delay: 0.24s; }
.nav-item:nth-child(7) { animation-delay: 0.28s; }
.nav-item:nth-child(8) { animation-delay: 0.32s; }

tbody tr { animation: rowFadeIn 0.36s ease-out both; }
tbody tr:nth-child(1)  { animation-delay: 0.04s; }
tbody tr:nth-child(2)  { animation-delay: 0.07s; }
tbody tr:nth-child(3)  { animation-delay: 0.10s; }
tbody tr:nth-child(4)  { animation-delay: 0.13s; }
tbody tr:nth-child(5)  { animation-delay: 0.16s; }
tbody tr:nth-child(6)  { animation-delay: 0.19s; }
tbody tr:nth-child(7)  { animation-delay: 0.22s; }
tbody tr:nth-child(8)  { animation-delay: 0.25s; }
tbody tr:nth-child(9)  { animation-delay: 0.28s; }
tbody tr:nth-child(10) { animation-delay: 0.31s; }

.stat-value.counting { transition: none; }

/* =============================================
   SCROLLBARS
   ============================================= */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c8d0e0; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #9ba8be; }

/* =============================================
   PRINT
   ============================================= */
@media print {
    body { background: white; color: #333; }
    .sidebar { display: none; }
    .main-content { margin-left: 0; }
    .card { border: 1px solid #ddd; background: white; }
}

/* =============================================
   PREMIUM TOAST NOTIFICATION SYSTEM
   ============================================= */
#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    background: #ffffff;
    border: 1px solid var(--border-glass);
    box-shadow: 0 8px 32px rgba(15, 30, 54, 0.13), 0 2px 8px rgba(15, 30, 54, 0.07);
    min-width: 300px;
    max-width: 420px;
    pointer-events: all;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
}

.toast-item.show { transform: translateX(0); opacity: 1; }
.toast-item.hide { transform: translateX(120%); opacity: 0; }

.toast-icon-wrap {
    width: 38px; height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-text { flex: 1; }
.toast-title {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 2px;
    color: var(--text-primary);
}
.toast-msg {
    font-size: 0.76rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1;
    padding: 2px;
    flex-shrink: 0;
    opacity: 0.5;
    transition: opacity 0.2s;
}
.toast-close:hover { opacity: 1; }

/* Toast left accent bar */
.toast-item::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

/* Toast types */
.toast-success .toast-icon-wrap { background: rgba(5, 150, 105, 0.10); color: #059669; }
.toast-success::before { background: var(--gradient-green); }

.toast-error .toast-icon-wrap { background: rgba(220, 38, 38, 0.10); color: #dc2626; }
.toast-error::before { background: var(--gradient-red); }

.toast-warning .toast-icon-wrap { background: rgba(180, 83, 9, 0.10); color: #b45309; }
.toast-warning::before { background: var(--gradient-amber); }

.toast-info .toast-icon-wrap { background: rgba(29, 78, 216, 0.10); color: #1d4ed8; }
.toast-info::before { background: var(--gradient-primary); }

/* Progress bar */
.toast-progress {
    position: absolute;
    bottom: 0; left: 0;
    height: 3px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    animation: toast-shrink linear forwards;
    opacity: 0.35;
}
.toast-success .toast-progress { background: #059669; }
.toast-error   .toast-progress { background: #dc2626; }
.toast-warning .toast-progress { background: #b45309; }
.toast-info    .toast-progress { background: #1d4ed8; }

/* =============================================
   FLOATING TOAST (Readonly)
   ============================================= */
.floating-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(255, 255, 255, 0.97);
    padding: 16px 22px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border-left: 5px solid #dc2626;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.55s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 9999;
    min-width: 300px;
}
.floating-toast.show { transform: translateY(0); opacity: 1; }

/* =============================================
   GLOBAL LOADER
   ============================================= */
.global-loader {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(240, 244, 255, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s;
}
.global-loader.hidden {
    opacity: 0;
    visibility: hidden;
}
.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}
.spinner {
    width: 44px; height: 44px;
    border: 3.5px solid rgba(29, 78, 216, 0.12);
    border-top: 3.5px solid var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.5, 0.1, 0.4, 0.9) infinite;
}
.loader-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent-blue);
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: pulse-text 1.5s ease-in-out infinite;
}

/* =============================================
   BADGE OVERRIDES (inline style compatibility)
   ============================================= */
.info-badge[style*="background-color: #6c757d"],
.info-badge[style*="background-color:#6c757d"] {
    background: rgba(100, 116, 139, 0.07) !important;
    color: #475569 !important;
    border-color: rgba(100, 116, 139, 0.15) !important;
}
.info-badge[style*="background-color: #17a2b8"],
.info-badge[style*="background-color:#17a2b8"] {
    background: rgba(8, 145, 178, 0.07) !important;
    color: #0891b2 !important;
    border-color: rgba(8, 145, 178, 0.15) !important;
}
.info-badge[style*="background-color: #10b981"],
.info-badge[style*="background-color:#10b981"] {
    background: rgba(5, 150, 105, 0.07) !important;
    color: #059669 !important;
    border-color: rgba(5, 150, 105, 0.15) !important;
}

/* =============================================
   COUNT-UP ANIMATION CLASS
   ============================================= */
.stat-value.counting { transition: none; }

/* =============================================
   MAIN CONTENT & CHART GLOW OVERLAYS
   ============================================= */
.main-content {
    position: relative;
    overflow: hidden;
}

.main-content::before,
.main-content::after {
    content: "";
    position: absolute;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    filter: blur(120px);
    z-index: 0;
    pointer-events: none;
    opacity: 0.38;
}

.main-content::before {
    top: 5%;
    right: -10%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.22) 0%, rgba(59, 130, 246, 0) 70%);
}

.main-content::after {
    top: 35%;
    left: -10%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.18) 0%, rgba(139, 92, 246, 0) 70%);
}

.chart-card-custom {
    background: #ffffff !important;
    border: none !important;
    border-radius: 20px !important;
    box-shadow: 0 10px 40px -10px rgba(15, 30, 54, 0.12) !important;
    z-index: 2;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chart-card-custom::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 6px;
    background: linear-gradient(90deg, #2563eb, #10b981, #8b5cf6, #d97706);
    z-index: 10;
}

.chart-card-custom:hover {
    box-shadow: 0 20px 50px -15px rgba(15, 30, 54, 0.18) !important;
    transform: translateY(-4px);
}

.chart-card-custom .card-header {
    border-bottom: 1px solid rgba(30, 58, 95, 0.04);
    padding: 24px 28px;
    position: relative;
    z-index: 11;
}

/* Live Pulsing Dot */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
    font-weight: 800;
    color: #059669;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(5, 150, 105, 0.08);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(5, 150, 105, 0.12);
}

.live-dot {
    width: 6px;
    height: 6px;
    background-color: #10b981;
    border-radius: 50%;
    animation: livePulse 2s infinite;
}

@keyframes livePulse {
    0% { transform: scale(0.95); opacity: 0.5; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
    70% { transform: scale(1.15); opacity: 1; box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); opacity: 0.5; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* =============================================
   Animated Aurora Background (Floating Bubbles)
   ============================================= */
.app-layout::before, .app-layout::after {
    content: '';
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    z-index: -1;
    filter: blur(120px);
    opacity: 0.45; /* Increased opacity slightly for better visibility */
    animation: float-aurora 20s infinite ease-in-out alternate;
    pointer-events: none;
}

.app-layout::before {
    background: radial-gradient(circle, var(--accent-blue-light) 0%, rgba(59,130,246,0) 70%);
    top: -100px;
    left: -100px;
}

.app-layout::after {
    background: radial-gradient(circle, var(--accent-purple) 0%, rgba(109,40,217,0) 70%);
    bottom: -100px;
    right: -100px;
    animation-delay: -10s;
    animation-duration: 25s;
}

@keyframes float-aurora {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(150px, 100px) scale(1.1); }
    66% { transform: translate(-50px, 200px) scale(0.9); }
    100% { transform: translate(50px, -50px) scale(1.2); }
}
