﻿@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
      --primary: #0F172A;
      --primary-light: #2563EB; 
      --primary-gradient: linear-gradient(135deg, #0F172A 0%, #1E3A8A 100%);
      --gold: #60A5FA;
      --gold-gradient: linear-gradient(135deg, #93C5FD 0%, #3B82F6 100%);
      --gold-glow: rgba(59, 130, 246, 0.4);
      --accent: rgba(59, 130, 246, 0.15);
      --success: #059669;
      --success-light: #D1FAE5;
      --warning: #F59E0B;
      --danger: #DC2626;
      --danger-light: #FEE2E2;
      --bg-main: #0B1120;
      --bg-card: rgba(30, 41, 59, 0.7);
      --text-main: #F8FAFC;
      --text-muted: #94A3B8;
      --border: rgba(255, 255, 255, 0.05);
      --header-btn-bg: rgba(255, 255, 255, 0.05);
      --banner-bg: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
      --header-title: #FFFFFF;
      --header-subtitle: #94A3B8;
      --header-title-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
      --banner-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
      --input-bg: rgba(0, 0, 0, 0.2);
      --input-bg-focus: rgba(0, 0, 0, 0.4);
      --input-text: #FFFFFF;
      --surface-inner: rgba(0, 0, 0, 0.2);
      --surface-hover: rgba(255, 255, 255, 0.02);
      --glass-blur: blur(12px);
      --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
      --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
    --c-cadangan: #F59E0B;
    --c-ops: #3B82F6;
    --c-maint: #8B5CF6;
    --c-gaji: #10B981;
    --c-cadangan: #F59E0B;
    --c-ops: #3B82F6;
    --c-maint: #8B5CF6;
    --c-gaji: #10B981;
}

[data-theme="light"] {
    --bg-main: #F4F7FE;
    --bg-card: rgba(255, 255, 255, 0.9);
    --text-main: #1E293B;
    --text-muted: #64748B;
    --border: rgba(0, 0, 0, 0.1);
    
    --header-btn-bg: rgba(0, 0, 0, 0.05);
    --banner-bg: #F4F7FE;
    --header-title: #1E293B;
    --header-subtitle: #64748B;
    --header-title-shadow: none;
    --banner-shadow: none;
    
    --input-bg: #F8FAFC;
    --input-bg-focus: #F1F5F9;
    --input-text: #1E293B;

    --surface-inner: rgba(0, 0, 0, 0.04);
    --surface-hover: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .smart-insights-widget {
    background: linear-gradient(145deg, rgba(241, 245, 249, 0.9) 0%, rgba(255, 255, 255, 1) 100%);
    border-left: 4px solid #A855F7;
}

[data-theme="light"] .smart-insights-widget .insight-item {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

html, body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.hidden {
    display: none !important;
}

/* ===========================
   AUTHENTICATION (ROYAL VVIP ANIMATED)
=========================== */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    /* Animated Mesh Gradient */
    background: linear-gradient(-45deg, #0F172A, #1E1B4B, #0F172A, #020617);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    position: relative;
    overflow: hidden;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.auth-container::before {
    content: '';
    position: absolute;
    width: 900px;
    height: 900px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.4) 0%, rgba(0,0,0,0) 70%); /* Stronger Massive Gold Glow */
    top: -250px;
    left: -250px;
    filter: blur(80px);
    animation: floatGlow 12s ease-in-out infinite alternate;
}

.auth-container::after {
    content: '';
    position: absolute;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.4) 0%, rgba(0,0,0,0) 70%); /* Stronger Sapphire Glow */
    bottom: -200px;
    right: -150px;
    filter: blur(80px);
    animation: floatGlowReverse 14s ease-in-out infinite alternate;
}

@keyframes floatGlow {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 30px); }
}

@keyframes floatGlowReverse {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-40px, -40px); }
}

.auth-card {
    background: rgba(15, 23, 42, 0.4); /* Deep dark glass */
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    padding: 60px 50px;
    border-radius: 32px;
    box-shadow: 0 40px 80px -20px rgba(0,0,0,0.9), inset 0 0 20px rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.15);
    border-top: 1px solid rgba(255,255,255,0.3);
    border-left: 1px solid rgba(255,255,255,0.3);
    width: 100%;
    max-width: 440px;
    z-index: 10;
    transform: translateY(20px);
    animation: slideUpFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUpFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-header {
    text-align: center;
    margin-bottom: 35px;
}

.logo-wrapper {
    background: #FFFFFF;
    display: inline-block;
    padding: 15px 25px;
    border-radius: 20px;
    margin-bottom: 25px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4), inset 0 0 10px rgba(0,0,0,0.05);
    border: 1px solid rgba(255,255,255,0.8);
    animation: floatingLogo 4s ease-in-out infinite;
}

.ut-logo {
    height: 75px;
    object-fit: contain;
    display: block;
}

@keyframes floatingLogo {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.auth-header h2 {
    color: #FFFFFF;
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.auth-header p {
    color: rgba(255,255,255,0.7);
    font-size: 15px;
    font-weight: 500;
}

.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.auth-card .input-group input {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    color: #FFFFFF;
}

.auth-card .input-group input:focus {
    background: rgba(0,0,0,0.5);
    border-color: var(--gold);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
}

.auth-card .input-group input::placeholder {
    color: rgba(255,255,255,0.4);
}

.input-group input, .input-group select, .input-group textarea {
    width: 100%;
    padding: 16px 20px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--input-bg);
    font-size: 15px;
    font-weight: 600;
    color: var(--input-text);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) inset;
}

.input-group select option {
    background: var(--bg-main);
    color: var(--text-main);
}

.input-group input:focus, .input-group select:focus, .input-group textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 4px var(--accent);
}

/* Fix browser autofill white background in Dark Mode */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #1E293B inset !important;
    -webkit-text-fill-color: #FFFFFF !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Fix browser default calendar icon color for dark mode */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.5);
    cursor: pointer;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #3B82F6 0%, #1E3A8A 100%); /* Sapphire Blue */
    color: #FFFFFF;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 16px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.5);
    position: relative;
    overflow: hidden;
}

/* Button Shimmer Glint Animation */
.btn-primary::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    animation: shimmerGlint 3s infinite;
}

@keyframes shimmerGlint {
    0% { left: -100%; }
    20%, 100% { left: 200%; }
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    transform: skewX(-20deg);
    transition: 0.5s;
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 15px 25px -5px rgba(245, 158, 11, 0.5);
}

.btn-primary:hover::after {
    left: 150%;
}

.btn-primary:active {
    transform: translateY(1px);
}

.error-msg {
    margin-top: 20px;
    color: white;
    background: rgba(220, 38, 38, 0.9);
    padding: 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

/* ===========================
   MAIN LAYOUT (SEAMLESS ROYAL NAVY)
=========================== */
.app-layout {
    display: flex;
    height: 100vh;
    background: var(--bg-main);
    position: relative;
    overflow: hidden;
}

.sidebar {
    width: 290px;
    background: #0F172A; /* Deep Royal Navy */
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    box-shadow: none; /* No shadow to seamlessly blend with banner */
    z-index: 10;
    color: white;
}

.sidebar-brand {
    padding: 40px 30px 30px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-icon {
    width: 44px;
    height: 44px;
    background: var(--gold-gradient);
    color: #0F172A;
    border-radius: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: 800;
    box-shadow: 0 4px 15px var(--gold-glow);
}

.sidebar-brand h2 {
    color: white;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 10px 20px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    border-radius: 14px;
    margin-bottom: 8px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: white;
    transform: translateX(4px);
}

.nav-item.active {
    background: rgba(245, 158, 11, 0.1);
    color: var(--gold);
    box-shadow: inset 4px 0 0 var(--gold);
}

.nav-item i {
    font-size: 24px;
}

.sidebar-footer {
    padding: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
    color: rgba(255,255,255,0.9);
}

.user-info i {
    font-size: 32px;
    color: var(--gold);
}

.btn-logout {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 14px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    color: rgba(255,255,255,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: rgba(220, 38, 38, 0.2);
    color: #FCA5A5;
    border-color: rgba(220, 38, 38, 0.4);
}

/* ===========================
   MAIN CONTENT & ROYAL BANNER
=========================== */
.main-content {
    flex: 1;
    padding: 50px 60px;
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

/* The Royal Navy Animated Banner */
.main-content::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 330px; /* Covers the summary cards completely */
    background: var(--banner-bg); 
    z-index: -2;
    border-bottom-right-radius: 40px; 
    box-shadow: var(--banner-shadow);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

/* Glowing Aura inside the banner */
.main-content::after {
    content: '';
    position: absolute;
    top: 0; left: 100px;
    width: 600px;
    height: 300px;
    background: radial-gradient(ellipse at center, rgba(245, 158, 11, 0.15) 0%, rgba(0,0,0,0) 70%);
    z-index: -1;
    pointer-events: none;
    animation: floatGlow 8s ease-in-out infinite alternate;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 45px;
}

.greeting-sec h1 {
    font-size: 34px;
    font-weight: 800;
    color: var(--header-title);
    letter-spacing: -1px;
    margin-bottom: 8px;
    text-shadow: var(--header-title-shadow);
    transition: color 0.3s ease;
}

.greeting-sec p {
    color: var(--header-subtitle);
    font-size: 16px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.btn-add-transaction {
    width: auto;
    padding: 14px 28px;
    font-size: 16px;
    border-radius: 14px;
}

/* ===========================
   FROSTED GLASS CARDS
=========================== */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 45px;
    margin-top: 0; /* Remove negative margin that overlaps header text */
}

.card {
    background: var(--bg-card); /* Dark Frosted Acrylic */
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    padding: 30px;
    border-radius: 24px;
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    gap: 24px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.clickable-card {
    cursor: pointer;
}

.clickable-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255,255,255,0.15) inset;
}

.clickable-card.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary), 0 15px 35px -10px rgba(0, 0, 0, 0.4);
    background: linear-gradient(145deg, var(--bg-card), rgba(99, 102, 241, 0.05));
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 40px 80px -15px rgba(15, 23, 42, 0.3);
}

.card-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 32px;
}

/* Card Icon Colors */
.balance-card .card-icon { background: var(--accent-light); color: var(--accent-primary); }
.income-card .card-icon { background: var(--success-light); color: var(--success); }
.expense-card .card-icon { background: var(--danger-light); color: var(--danger); }

.card-info {
    flex: 1;
}

.card-info p {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-info h2 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

/* Main Layout Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}
.dashboard-grid > div {
    min-width: 0;
}

.card-box {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    padding: 35px;
    border: 1px solid var(--border);
    transition: background-color 0.3s ease, border-color 0.3s ease;
    min-width: 0;
    box-sizing: border-box;
}

/* --- PREMIUM DASHBOARD WIDGETS --- */
.smart-insights-widget {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.9) 100%);
    border-left: 4px solid #A855F7;
    position: relative;
    overflow: hidden;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.smart-insights-widget .insights-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.smart-insights-widget::before {
    content: '';
    position: absolute;
    top: -50px; right: -50px;
    width: 150px; height: 150px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.15) 0%, rgba(0,0,0,0) 70%);
    border-radius: 50%;
    pointer-events: none;
}
.insights-content strong {
    color: var(--text-main);
    font-weight: 700;
}
.insight-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 15px;
    background: rgba(0,0,0,0.15);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.03);
}

.quick-actions button {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}
.quick-actions button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}
.mini-tx-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.mini-tx-item:last-child {
    border-bottom: none;
}
.mini-tx-left {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
    min-width: 0;
}
.mini-tx-info {
    flex: 1;
    min-width: 0;
}
.mini-tx-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #FFF;
    flex-shrink: 0;
}
.mini-tx-info h5 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
}
.mini-tx-info p {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mini-tx-right {
    text-align: right;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
    margin-left: 10px;
}

.box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.box-header h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.box-header h3 small {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    margin-left: 8px;
}

/* Modern Tabs */
.modern-tabs {
    display: flex;
    gap: 10px;
    background: rgba(0,0,0,0.2);
    padding: 8px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 25px;
    overflow-x: auto;
}

.modern-tabs button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.modern-tabs button:hover {
    color: var(--text-main);
    background: rgba(255,255,255,0.05);
}

.modern-tabs button.active {
    background: linear-gradient(135deg, var(--primary) 0%, #1e3a8a 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(37,99,235,0.3);
}

/* Allocation List */
.allocation-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.alloc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] .alloc-item {
    background: rgba(255, 255, 255, 0.6);
}

.alloc-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
    border-color: rgba(245, 158, 11, 0.4);
}

.alloc-amount {
    font-weight: 800;
    color: var(--text-main);
    font-size: 15px;
}

.alloc-envelope {
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] .alloc-envelope {
    background: rgba(255, 255, 255, 0.6);
}

.alloc-envelope:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
    border-color: rgba(245, 158, 11, 0.4);
}

.alloc-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    margin-bottom: 12px;
    color: var(--text-main);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.bg-cadangan { background: var(--c-cadangan); }
.bg-ops { background: var(--c-ops); }
.bg-maint { background: var(--c-maint); }
.bg-gaji { background: var(--c-gaji); }

.alloc-cadangan { background: var(--c-cadangan); box-shadow: 0 0 10px rgba(245,158,11,0.4); }
.alloc-ops { background: var(--c-ops); box-shadow: 0 0 10px rgba(59,130,246,0.4); }
.alloc-maint { background: var(--c-maint); box-shadow: 0 0 10px rgba(139,92,246,0.4); }
.alloc-gaji { background: var(--c-gaji); box-shadow: 0 0 10px rgba(16,185,129,0.4); }

.alloc-progress-bg {
    width: 100%;
    height: 8px;
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

[data-theme="light"] .alloc-progress-bg {
    background: rgba(0,0,0,0.05);
}

.alloc-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.alloc-stats {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.stat-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-col.text-right {
    align-items: flex-end;
}

.stat-col small {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-col .val {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-main);
}

.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }

/* ===========================
   TABLE STYLES (PREMIUM)
=========================== */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px; 
}

.data-table th {
    text-align: left;
    padding: 16px 20px;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(15,23,42,0.1);
}

.data-table td {
    padding: 20px;
    font-size: 15px;
    background: var(--row-bg);
    vertical-align: middle;
    transition: background 0.3s ease;
}

.data-table tbody tr {
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.data-table tbody tr td:first-child { border-radius: 12px 0 0 12px; border-left: 1px solid var(--border); }
.data-table tbody tr td:last-child { border-radius: 0 12px 12px 0; border-right: 1px solid var(--border); }
.data-table tbody tr td { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.data-table tbody tr:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    position: relative;
    z-index: 2;
}

.btn-outline {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.3);
}

.data-table tbody tr:hover td {
    background: var(--hover-bg);
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    padding: 8px;
    border-radius: 10px;
    transition: all 0.2s ease;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.btn-icon:hover {
    background: rgba(255,255,255,0.1);
    transform: scale(1.1);
}

/* ===========================
   MODALS
=========================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    background: var(--bg-card); /* Adaptive Glass */
    backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px);
    width: 100%;
    max-width: 500px;
    border-radius: 24px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border);
    padding: 40px;
    transform: scale(0.95) translateY(20px);
    opacity: 0;
    animation: scaleUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes scaleUp {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-main);
}

.modal-header .btn-icon {
    background: var(--input-bg);
    color: var(--text-muted);
}

.modal-header .btn-icon:hover {
    background: var(--danger-light);
    color: var(--danger);
}

/* Utilities */
.type-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    display: inline-block;
}

.type-income {
    background: var(--success-light);
    color: var(--success);
}

.type-expense {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-cadangan { background: rgba(245,158,11,0.15); color: var(--c-cadangan); border: 1px solid rgba(245,158,11,0.3); }
.badge-ops { background: rgba(59,130,246,0.15); color: var(--c-ops); border: 1px solid rgba(59,130,246,0.3); }
.badge-maint { background: rgba(139,92,246,0.15); color: var(--c-maint); border: 1px solid rgba(139,92,246,0.3); }
.badge-gaji { background: rgba(16,185,129,0.15); color: var(--c-gaji); border: 1px solid rgba(16,185,129,0.3); }

/* ===========================
   GROUPED TABLES (LAPORAN)
=========================== */
.group-header {
    background: var(--primary);
    padding: 18px 24px;
    font-weight: 800;
    font-size: 16px;
    color: white;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
    margin-bottom: 16px;
    box-shadow: 0 10px 20px -5px rgba(15,23,42,0.3);
}
.group-header:first-child {
    margin-top: 0;
}
.group-subtotal {
    background: var(--row-bg);
    padding: 16px 24px;
    font-weight: 800;
    text-align: right;
    font-size: 16px;
    color: var(--primary-light); /* Lighter blue for dark mode */
    border-radius: 16px;
    border: 1px dashed var(--border);
    margin-top: 8px;
    margin-bottom: 32px;
}
.report-controls {
    display: flex; gap: 20px; align-items: flex-end; margin-bottom: 35px; margin-top: 0;
    background: var(--bg-card); padding: 24px 30px; border-radius: 24px; 
    backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-lg); border: 1px solid var(--border);
}
.control-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.control-group label {
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.control-group input, .control-group select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    background: var(--input-bg);
    border-radius: 12px;
    outline: none;
    font-size: 15px;
    font-weight: 600;
    color: var(--input-text);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.control-group input:focus, .control-group select:focus {
    border-color: var(--gold);
    background: var(--input-bg-focus);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
}
.btn-filter {
    background: linear-gradient(135deg, #3B82F6 0%, #1E3A8A 100%);
    color: #FFFFFF;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 0 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.4);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    height: 52px;
}
.btn-filter:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -5px rgba(37, 99, 235, 0.6);
}

/* ===========================
   RESPONSIVE (Optional)
=========================== */
.dashboard-content, .transactions-view, .laporan-view {
    animation: slideUpFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    /* Premium Widgets Mobile Fixes */
    .quick-actions {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
    }
    .quick-actions button {
        width: 100% !important;
        min-width: 0 !important;
        padding: 12px 5px !important;
        font-size: 10px !important;
        flex-direction: column !important;
        gap: 6px !important;
        text-align: center;
        letter-spacing: 0;
    }
    .quick-actions button i {
        font-size: 22px;
        margin: 0;
    }
    .box-header h3 {
        line-height: 1.4;
    }
    .box-header h3 small {
        display: block;
        margin-top: 6px;
    }
    .allocation-list .alloc-item {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 8px;
    }
    .allocation-list .alloc-amount {
        font-size: 18px !important;
    }
    /* Mobile Layout for Allocation Stats */
    .alloc-stats {
        flex-direction: column;
        gap: 12px;
    }
    .stat-col {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        border-bottom: 1px dashed rgba(255,255,255,0.1);
        padding-bottom: 8px;
    }
    .stat-col:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }
    .stat-col.text-right {
        align-items: center;
    }
    
    /* Prevent any overflow universally */
    html, body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Main Layout */
    .app-layout { 
        flex-direction: column; 
        padding-bottom: 0px; 
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    } 
    
    .main-content { 
        padding: 20px 15px 100px 15px; 
        margin-bottom: 0px; 
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    
    /* Prevent absolute pseudo-elements from stretching mobile viewport */
    .main-content::after, .main-content::before {
        width: 100%;
        left: 0;
    }
    
    .main-content::after {
        display: none; /* Hide the giant glowing aura on mobile */
    }
    
        /* Mobile Off-Canvas Sidebar */
    .sidebar {
        position: fixed;
        top: 0;
        left: -320px;
        width: 300px;
        height: 100vh;
        transition: left 0.3s ease;
        z-index: 10000;
        background: #0F172A;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .mobile-menu-btn {
        display: flex !important;
    }

    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.6);
        z-index: 9999;
        backdrop-filter: blur(2px);
    }
    .mobile-overlay.active {
        display: block;
    }
    
    /* Normal Block Button (Revert FAB) */
    .top-header { flex-direction: column; align-items: flex-start; margin-bottom: 20px; width: 100%; box-sizing: border-box; }
    .header-actions { margin-top: 12px; width: 100%; }
    
    #openModalBtn {
        position: relative;
        border-radius: 12px;
        display: flex;
        justify-content: center;
        align-items: center;
        box-shadow: 0 4px 15px rgba(37,99,235,0.4);
        font-size: 14px;
        gap: 8px !important;
        background: var(--primary);
        color: white;
    }
    
    #openModalBtn i {
        font-size: 18px;
        margin: 0;
    }
    
    /* Grid & Cards */
    .dashboard-grid { 
        grid-template-columns: 1fr; 
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .summary-cards { 
        grid-template-columns: 1fr; 
        margin-top: 0; 
        gap: 15px; 
        width: 100%;
        box-sizing: border-box;
    }
    
    .card-box { 
        padding: 20px 15px; 
        border-radius: 20px; 
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
    
    .alloc-item {
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    canvas {
        max-width: 100% !important;
    }
    
    /* Grouped Header (Laporan) Fix for Mobile */
    .group-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px;
        padding: 15px;
    }
    
    .group-header > span {
        align-self: flex-start;
    }
    
    .alloc-amount {
        white-space: nowrap;
    }
    
    /* Bottom Sheet Modal */
    .modal-overlay { align-items: flex-end; }
    .modal-card {
        margin: 0;
        max-width: 100%;
        width: 100%;
        border-radius: 30px 30px 0 0;
        padding: 30px 20px;
        animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
        max-height: 90vh;
        overflow-y: auto;
        border-bottom: none;
    }
    
    @keyframes slideUp {
        from { transform: translateY(100%); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }
    
    /* Mobile Card-based List View for Tables */
    .table-responsive {
        background: transparent;
        border: none;
        padding: 0;
        overflow: visible;
        width: 100%;
    }
    
    .data-table, .data-table tbody, .data-table tr {
        display: flex;
        flex-direction: column;
        width: 100%;
        box-sizing: border-box;
    }
    
    .data-table thead { display: none; }
    
    .data-table tbody tr {
        background: var(--bg-card);
        border: 1px solid var(--border) !important;
        border-radius: 16px;
        margin-bottom: 15px;
        padding: 15px;
        box-shadow: var(--shadow-sm);
        gap: 8px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .data-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 5px 0 !important;
        border: none !important;
        background: transparent !important;
        width: 100%;
        box-sizing: border-box;
    }
    
    .data-table thead {
        display: none; 
    }
    
    .data-table tbody tr {
        background: var(--bg-card);
        border: 1px solid var(--border) !important;
        border-radius: 16px;
        margin-bottom: 15px;
        padding: 15px;
        box-shadow: var(--shadow-sm);
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .data-table tbody tr:hover td { background: transparent; }
    
    .data-table tbody tr td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 !important;
        border: none !important;
        background: transparent !important;
        text-align: right;
        font-size: 14px;
    }
    
    .data-table tbody tr td::before {
        content: attr(data-label);
        font-size: 12px;
        font-weight: 700;
        color: var(--text-muted);
        text-transform: uppercase;
        text-align: left;
    }
    
    .data-table tbody tr td:last-child {
        margin-top: 10px;
        padding-top: 10px !important;
        border-top: 1px dashed rgba(255,255,255,0.1) !important;
        justify-content: flex-end;
        gap: 10px;
    }
    
    .data-table tbody tr td:last-child::before { display: none; }
    
    /* Laporan Page Fixes */
    .report-controls {
        flex-direction: column;
        align-items: stretch;
        padding: 20px 15px;
        gap: 15px;
    }
    
    .control-group {
        width: 100%;
    }
}

/* Role Based Access Control */
html.viewer-mode .admin-only, body.viewer-mode .admin-only, html.viewer-mode .admin-only-field, body.viewer-mode .admin-only-field { display: none !important; }

/* Progress Bars */
.progress-container { width: 100%; background: rgba(255,255,255,0.1); border-radius: 10px; height: 10px; overflow: hidden; margin-top: 10px; }
.progress-bar { height: 100%; border-radius: 10px; transition: width 0.3s; }
.progress-safe { background: #10B981; }
.progress-warning { background: #F59E0B; }
.progress-danger { background: #EF4444; }
.budget-text { font-size: 12px; color: var(--text-muted); margin-top: 5px; display: flex; justify-content: space-between; }

/* Budget Settings */
.budget-input { width: 100%; padding: 12px; margin-top: 5px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text-main); font-size: 14px; outline: none; }
.budget-input:focus { border-color: var(--primary); }
#budgetInputsContainer { max-height: 50vh; overflow-y: auto; padding-right: 10px; }

.invoice-watermark {
    width: 140px;
    height: 140px;
    border: 4px solid #1d4ed8; /* UT blue */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -80px;
    right: 20px;
    transform: rotate(-15deg);
    opacity: 0.85;
    z-index: 10;
    pointer-events: none;
    background: transparent;
}
.stamp-inner {
    width: 124px;
    height: 124px;
    border: 2px dashed #1d4ed8;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #1d4ed8;
}
.stamp-center {
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 2px;
    margin: 5px 0;
    color: #1d4ed8;
    border-top: 2px solid #1d4ed8;
    border-bottom: 2px solid #1d4ed8;
    padding: 2px 5px;
}
.stamp-top, .stamp-bottom {
    font-size: 0.5rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

html.viewer-mode .admin-only, body.viewer-mode .admin-only, html.viewer-mode .admin-only-field, body.viewer-mode .admin-only-field { display: none !important; }

.hover-history:hover { color: #3b82f6 !important; text-decoration: underline; }

.badge.not-eligible { background: rgba(148, 163, 184, 0.15); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.3); }

.admin-tab-content {
    padding: 30px;
}


/* ===========================
   LIGHT MODE OVERRIDES
=========================== */


/* Anti-FOUC Logic */
html.is-logged-in #loginScreen { display: none !important; }
html.is-logged-in #mainApp { display: flex !important; }


/* Fix for Safari details marker */
details.staff-task-accordion summary::-webkit-details-marker { display:none; }
details.staff-task-accordion summary { outline: none; }












/* UNIFIED MOBILE HEADER FIX */
.mobile-header-bar {
    display: none;
}
@media (max-width: 768px) {
    .mobile-header-bar {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        margin-bottom: 20px;
    }
    .mobile-header-left {
        display: flex;
        align-items: center;
        gap: 15px;
    }
    .mobile-header-left h2 {
        margin: 0;
        font-size: 1.2rem;
        font-weight: 800;
        letter-spacing: 1px;
        color: var(--text-main);
    }
    .top-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .desktop-only-btn {
        display: none !important;
    }
    .header-actions {
        margin-top: 10px;
        width: 100%;
        display: flex;
        flex-direction: row !important;
        gap: 10px;
    }
    .mobile-menu-btn {
        background: var(--header-btn-bg);
        border: none;
        color: var(--text-main);
        font-size: 24px;
        cursor: pointer;
        width: 45px;
        height: 45px;
        border-radius: 14px;
        display: flex !important;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }
}


/* Task column layout */
.task-col-wrapper {
    height: 560px;
    display: flex;
    flex-direction: column;
}
.task-col-inner {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
#myTasksList {
    flex: 1;
    overflow-y: auto;
}

/* Mobile: stack columns, give task col fixed height with scroll */
@media (max-width: 768px) {
    .task-col-wrapper {
        height: 500px !important;
        max-height: 500px !important;
    }
    .grid-2 {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr !important;
    }
}



/* Mobile Only Utilities */
.mobile-only {
    display: none !important;
}
@media (max-width: 768px) {
    .mobile-only {
        display: block !important;
    }
}

@media (max-width: 768px) {
    .auth-card {
        padding: 40px 20px;
        max-width: 90%;
        border-radius: 20px;
    }
    .auth-header h2 {
        font-size: 1.5rem;
    }
    .auth-container {
        padding: 0 15px;
    }
}
