/* =============================================
   KDMP Project Monitoring System - Global Styles
   PT. Tri Abhiseka Sentosa
   Design System: Dark Navy + Gold Accent
   ============================================= */

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

/* ---- CSS Variables (Design Tokens) ---- */
:root {
    --navy-950: #0B1120;
    --navy-900: #0F172A;
    --navy-800: #1E293B;
    --navy-700: #334155;
    --navy-600: #475569;
    --navy-500: #64748B;
    --navy-400: #94A3B8;
    --navy-300: #CBD5E1;
    --navy-200: #E2E8F0;
    --navy-100: #F1F5F9;
    --navy-50: #F8FAFC;
    --gold-500: #C9961A;
    --gold-600: #A67C14;
    --gold-400: #D4A83A;
    --gold-300: #E8C96A;
    --emerald-500: #10B981;
    --emerald-600: #059669;
    --amber-500: #F59E0B;
    --red-500: #EF4444;
    --red-600: #DC2626;
    --blue-500: #3B82F6;
    --white: #FFFFFF;
    
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --topbar-height: 64px;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.15);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.2);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.25);
    --shadow-xl: 0 16px 48px rgba(0,0,0,0.3);
    --shadow-gold: 0 0 20px rgba(201,150,26,0.25);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--navy-300);
    background: var(--navy-100);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
a { color: var(--gold-500); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* ---- Layout ---- */
.app-layout { display: flex; min-height: 100vh; }
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px 32px;
    min-height: 100vh;
    transition: margin-left 0.25s ease;
}
.main-content.collapsed { margin-left: var(--sidebar-collapsed); }

@media (max-width: 1023px) {
    .main-content { margin-left: var(--sidebar-collapsed); padding: 16px 20px; }
}
@media (max-width: 767px) {
    .main-content { margin-left: 0 !important; padding: 12px 16px; }
}

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--navy-950);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: width 0.25s ease;
    border-right: 1px solid var(--navy-800);
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }

.sidebar-brand {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--navy-800);
}
.brand-logo { height: 48px; width: auto; border-radius: 8px; }
.brand-text { display: flex; flex-direction: column; }
.sidebar.collapsed .brand-text { display: none; }
.brand-name { font-size: 16px; font-weight: 700; color: var(--white); letter-spacing: 0.02em; }
.brand-tagline { font-size: 11px; font-weight: 500; color: var(--navy-500); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 0; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--navy-700); border-radius: 4px; }

.nav-section { margin-bottom: 8px; }
.nav-section-title {
    font-size: 11px; font-weight: 600; color: var(--navy-600);
    text-transform: uppercase; letter-spacing: 0.08em;
    padding: 16px 20px 8px;
}
.sidebar.collapsed .nav-section-title { display: none; }

.nav-item {
    display: flex; align-items: center; gap: 12px;
    height: 44px; padding: 0 20px;
    color: var(--navy-400); font-size: 14px; font-weight: 500;
    text-decoration: none; border-left: 3px solid transparent;
    transition: all 0.15s ease; white-space: nowrap;
}
.nav-item i { width: 20px; text-align: center; color: var(--navy-500); font-size: 16px; }
.nav-item:hover { background: var(--navy-800); color: var(--navy-300); }
.nav-item:hover i { color: var(--navy-400); }
.nav-item.active {
    background: rgba(201,150,26,0.1); color: var(--gold-500);
    border-left-color: var(--gold-500);
}
.nav-item.active i { color: var(--gold-500); }
.sidebar.collapsed .nav-item { justify-content: center; padding: 0; }
.sidebar.collapsed .nav-item span { display: none; }
.sidebar.collapsed .nav-item i { margin: 0; }

.sidebar-footer {
    border-top: 1px solid var(--navy-800);
    padding: 16px 20px;
}
.sidebar.collapsed .sidebar-footer { padding: 16px 10px; }
.user-mini { display: flex; align-items: center; gap: 10px; }
.sidebar.collapsed .user-mini { justify-content: center; }
.sidebar.collapsed .user-info { display: none; }
.user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--gold-500); color: var(--navy-950);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; color: var(--navy-300); display: block; line-height: 1.3; }
.user-role { font-size: 11px; font-weight: 500; color: var(--navy-500); display: block; line-height: 1.3; }

/* Mobile sidebar overlay */
.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
    z-index: 99;
}
.sidebar-overlay.active { display: block; }

/* ---- Topbar ---- */
.topbar {
    height: var(--topbar-height);
    background: var(--navy-900);
    border-bottom: 1px solid var(--navy-800);
    padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 50;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 16px; }

.sidebar-toggle {
    width: 40px; height: 40px; border-radius: var(--radius-sm);
    background: var(--navy-800); border: none; color: var(--navy-400);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 16px; transition: all 0.15s ease;
}
.sidebar-toggle:hover { background: var(--navy-700); color: var(--navy-300); }

.breadcrumb { font-size: 13px; font-weight: 500; color: var(--navy-500); display: flex; align-items: center; gap: 8px; }
.breadcrumb-item.active { color: var(--navy-300); }
.breadcrumb i { font-size: 10px; }

.icon-btn {
    width: 40px; height: 40px; border-radius: var(--radius-sm);
    background: transparent; border: none; color: var(--navy-400);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 16px; position: relative; transition: all 0.15s ease;
}
.icon-btn:hover { background: var(--navy-800); color: var(--navy-300); }
.notification-btn .badge {
    position: absolute; top: -4px; right: -4px;
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--red-500); color: var(--white);
    font-size: 10px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}

.topbar-user { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.user-avatar-sm { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.user-info-sm .user-name { font-size: 14px; }
.user-info-sm .user-role { font-size: 12px; }

/* Notification dropdown */
.notification-dropdown {
    position: absolute; top: 56px; right: 16px;
    width: 360px; max-height: 480px; overflow-y: auto;
    background: var(--navy-900); border: 1px solid var(--navy-800);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
    z-index: 200; display: none;
}
.notification-dropdown.active { display: block; }
.notif-header {
    padding: 16px 20px; border-bottom: 1px solid var(--navy-800);
    display: flex; align-items: center; justify-content: space-between;
}
.notif-header h4 { font-size: 16px; font-weight: 600; color: var(--navy-300); }
.notif-header button { font-size: 12px; color: var(--gold-500); background: none; border: none; cursor: pointer; }
.notif-list { max-height: 400px; overflow-y: auto; }
.notif-item {
    padding: 14px 20px; border-bottom: 1px solid var(--navy-800);
    display: flex; align-items: flex-start; gap: 12px; cursor: pointer;
    transition: background 0.15s ease;
}
.notif-item:hover { background: var(--navy-800); }
.notif-item.unread { border-left: 3px solid var(--gold-500); background: rgba(201,150,26,0.05); }
.notif-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.notif-icon.info { background: rgba(59,130,246,0.15); color: var(--blue-500); }
.notif-icon.warning { background: rgba(245,158,11,0.15); color: var(--amber-500); }
.notif-icon.success { background: rgba(16,185,129,0.15); color: var(--emerald-500); }
.notif-icon.danger { background: rgba(239,68,68,0.15); color: var(--red-500); }
.notif-text { font-size: 13px; font-weight: 500; color: var(--navy-300); line-height: 1.4; }
.notif-time { font-size: 11px; color: var(--navy-600); margin-top: 4px; display: block; }

/* ---- Page Header ---- */
.page-header {
    margin-bottom: 24px;
    display: flex; justify-content: space-between; align-items: flex-end;
    flex-wrap: wrap; gap: 16px;
}
.page-title { font-size: 36px; font-weight: 700; color: var(--navy-950); line-height: 1.2; letter-spacing: -0.02em; }
.page-subtitle { font-size: 14px; color: var(--navy-500); margin-top: 4px; }
.page-header-right { display: flex; align-items: center; gap: 12px; }

/* ---- Animations ---- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}
@keyframes subtlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}
@keyframes countUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.animate-in { animation: fadeInUp 0.3s ease forwards; opacity: 0; }
.shake { animation: shake 0.3s ease; }

/* Stagger delays */
.stagger-1 { animation-delay: 0ms; }
.stagger-2 { animation-delay: 60ms; }
.stagger-3 { animation-delay: 120ms; }
.stagger-4 { animation-delay: 180ms; }
.stagger-5 { animation-delay: 240ms; }
.stagger-6 { animation-delay: 300ms; }

/* ---- Toast Notifications ---- */
.toast-container {
    position: fixed; top: 16px; right: 16px; z-index: 9999;
    display: flex; flex-direction: column; gap: 8px;
}
.toast {
    background: var(--navy-900); border: 1px solid var(--navy-700);
    border-radius: var(--radius-md); padding: 14px 18px;
    box-shadow: var(--shadow-lg); min-width: 280px; max-width: 400px;
    display: flex; align-items: flex-start; gap: 10px;
    animation: slideInRight 0.25s ease-out;
}
.toast.toast-out { animation: slideOutRight 0.2s ease-in forwards; }
.toast-success { border-left: 3px solid var(--emerald-500); }
.toast-warning { border-left: 3px solid var(--amber-500); }
.toast-error { border-left: 3px solid var(--red-500); }
.toast-info { border-left: 3px solid var(--blue-500); }
.toast-icon { font-size: 18px; flex-shrink: 0; margin-top: 2px; }
.toast-success .toast-icon { color: var(--emerald-500); }
.toast-warning .toast-icon { color: var(--amber-500); }
.toast-error .toast-icon { color: var(--red-500); }
.toast-info .toast-icon { color: var(--blue-500); }
.toast-message { font-size: 13px; color: var(--navy-300); line-height: 1.4; }
.toast-close { margin-left: auto; background: none; border: none; color: var(--navy-500); cursor: pointer; font-size: 14px; padding: 0; }

/* ---- Loading Spinner ---- */
.spinner {
    width: 20px; height: 20px;
    border: 2px solid var(--navy-700);
    border-top-color: var(--gold-500);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Empty State ---- */
.empty-state {
    text-align: center; padding: 48px 20px;
    color: var(--navy-500);
}
.empty-state i { font-size: 48px; margin-bottom: 16px; color: var(--navy-700); }
.empty-state h4 { font-size: 18px; font-weight: 600; color: var(--navy-400); margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* ---- Utilities ---- */
.text-gold { color: var(--gold-500); }
.text-emerald { color: var(--emerald-500); }
.text-red { color: var(--red-500); }
.text-amber { color: var(--amber-500); }
.text-blue { color: var(--blue-500); }
.bg-navy-900 { background: var(--navy-900); }
.hidden { display: none !important; }

/* Form highlight section */
.form-section-highlight {
    background: rgba(201,150,26,0.05);
    border: 1px solid var(--gold-500);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 20px;
}
.section-title-gold {
    font-size: 18px; font-weight: 600; color: var(--navy-300);
    margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
    border-left: 3px solid var(--gold-500); padding-left: 12px;
}
.section-title-gold i { color: var(--gold-500); font-size: 16px; }
