@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Light Theme Variables */
    --primary: #0056b3; 
    --success: #28a745; 
    --danger: #dc3545;
    --warning: #ffc107; 
    --info: #007bff; 
    --secondary: #6c757d;
    
    --bg-color: #f4f7f6; 
    --card-bg: #ffffff; 
    --text-main: #2d3748; 
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --input-bg: #f8fafc;
    --input-focus-bg: #ffffff;
    --topbar-bg: #ffffff;
    --overlay-bg: rgba(0,0,0,0.5);
}

body.dark-mode {
    /* Dark Theme Variables */
    --primary: #3b82f6; 
    --success: #22c55e; 
    --danger: #ef4444;
    --secondary: #94a3b8;
    
    --bg-color: #0f172a; 
    --card-bg: #1e293b; 
    --text-main: #f8fafc; 
    --text-muted: #94a3b8;
    --border-color: #334155;
    --input-bg: #0f172a;
    --input-focus-bg: #1e293b;
    --topbar-bg: #1e293b;
    --overlay-bg: rgba(0,0,0,0.7);
}

/* Universal Box Sizing */
* { box-sizing: border-box; }

body { 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; 
    background-color: var(--bg-color); 
    padding: 0; 
    margin: 0; 
    color: var(--text-main); 
    padding-top: 65px; 
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Top Navigation Bar */
.top-bar { 
    position: fixed; top: 0; left: 0; width: 100%; height: 55px; 
    background: var(--topbar-bg); 
    box-shadow: 0 2px 10px rgba(0,0,0,0.08); 
    display: flex; justify-content: space-between; align-items: center; 
    padding: 0 15px; z-index: 900; 
    transition: background-color 0.3s ease;
}

.top-bar-left { display: flex; align-items: center; gap: 12px; }
.top-bar-title { font-weight: 700; color: var(--primary); font-size: 1.15rem; letter-spacing: -0.3px; }
.nav-actions { display: flex; align-items: center; gap: 16px; }

.nav-icon { 
    cursor: pointer; transition: transform 0.2s; user-select: none; 
    display: flex; align-items: center; justify-content: center;
    color: var(--text-main);
    width: 24px; height: 24px;
}
.nav-icon:active { transform: scale(0.85); }
.nav-icon svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Sidebar Navigation */
.sidebar-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--overlay-bg); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    z-index: 999; opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.sidebar-overlay.active { opacity: 1; pointer-events: auto; }

.sidebar {
    position: fixed; top: 0; left: -280px; width: 280px; height: 100%;
    background: var(--card-bg); z-index: 1000; box-shadow: 4px 0 15px rgba(0,0,0,0.1);
    transition: left 0.3s ease; display: flex; flex-direction: column; padding: 20px 0;
}
.sidebar.active { left: 0; }
.sidebar-header { padding: 0 20px 20px 20px; border-bottom: 1px solid var(--border-color); margin-bottom: 10px; font-weight: 700; font-size: 1.2rem; color: var(--primary);}
.sidebar-link {
    padding: 15px 20px; color: var(--text-main); text-decoration: none;
    font-weight: 500; display: flex; align-items: center; gap: 12px;
    transition: background 0.2s;
}
.sidebar-link:hover, .sidebar-link:active { background: var(--input-bg); color: var(--primary); }
.sidebar-link svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }

/* Layouts & Cards */
.container { padding: 15px; max-width: 600px; margin: 0 auto; }
.card { 
    background: var(--card-bg); border-radius: 12px; padding: 20px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.03); margin-bottom: 20px; 
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Forms */
label { display: block; margin-top: 14px; font-weight: 600; font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
input, select, textarea { 
    width: 100%; min-height: 46px; padding: 10px 14px; margin-top: 6px; 
    border: 1px solid var(--border-color); border-radius: 8px; 
    font-size: 1rem; font-family: inherit; background-color: var(--input-bg); color: var(--text-main);
    transition: all 0.2s ease; appearance: none;
}
select { background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23718096%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E"); background-repeat: no-repeat; background-position: right 14px top 50%; background-size: 12px auto; padding-right: 40px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); background-color: var(--input-focus-bg); box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.15); }

/* Buttons */
button { border: none; padding: 14px 20px; text-align: center; font-size: 1rem; border-radius: 8px; cursor: pointer; width: 100%; font-weight: 600; transition: transform 0.1s ease, box-shadow 0.2s ease; }
button:active { transform: translateY(1px); }
.btn-submit { background-color: var(--primary); color: white; box-shadow: 0 4px 10px rgba(0, 86, 179, 0.25); margin-top: 15px;}

/* Floating Action Button (FAB) */
.fab {
    position: fixed; bottom: 30px; right: 30px; width: 60px; height: 60px;
    background-color: var(--primary); color: white; border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    box-shadow: 0 6px 15px rgba(0, 86, 179, 0.4); cursor: pointer; z-index: 800;
    transition: transform 0.2s ease, background-color 0.2s;
}
.fab:active { transform: scale(0.9); }
.fab svg { width: 28px; height: 28px; stroke: white; stroke-width: 2; fill: none; }

/* Login Screen Extras */
.login-header { text-align: center; margin-bottom: 30px; }
.login-header h2 { color: var(--primary); margin-bottom: 5px; }
.login-header p { color: var(--text-muted); margin-top: 0; font-size: 0.9rem; }