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

:root {
    /* Professional Dark Theme Palette */
    --bg-body: #09090b;
    /* Zinc 950 */
    --bg-card: #18181b;
    /* Zinc 900 */
    --bg-subtle: #27272a;
    /* Zinc 800 */

    --border-subtle: #3f3f46;
    /* Zinc 700 */
    --border-focus: #52525b;
    /* Zinc 600 */

    --text-main: #fafafa;
    /* Zinc 50 */
    --text-muted: #a1a1aa;
    /* Zinc 400 */

    --primary: #2563eb;
    /* Blue 600 */
    --primary-hover: #1d4ed8;
    /* Blue 700 */
    --primary-glow: rgba(37, 99, 235, 0.2);

    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;

    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;

    --font-sans: 'Inter', sans-serif;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* --- Utilities --- */
.text-gold {
    color: #eab308;
}

.text-green {
    color: #10b981;
}

.text-blue {
    color: #3b82f6;
}

.text-red {
    color: #ef4444;
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.overflow-hidden {
    overflow: hidden;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Layout --- */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

/* --- Typography --- */
h1,
h2,
h3,
h4 {
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: -0.025em;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

/* --- Navbar --- */
header {
    background: rgba(9, 9, 11, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 50;
    height: 64px;
    display: flex;
    align-items: center;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.brand {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand span {
    color: var(--text-muted);
}

.nav-links a {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-left: 24px;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-main);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    height: 36px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.btn-primary {
    background-color: var(--text-main);
    color: var(--bg-body);
}

.btn-primary:hover {
    background-color: #e4e4e7;
    /* Zinc 200 */
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
}

.btn-outline:hover {
    border-color: var(--text-muted);
    color: var(--text-main);
}

.btn-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.btn-danger:hover {
    background-color: rgba(239, 68, 68, 0.2);
}

.btn-sm {
    height: 28px;
    padding: 0 12px;
    font-size: 0.8rem;
}

/* --- Cards (Stats) --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
}

/* --- Table --- */
.table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

thead {
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border-subtle);
}

th {
    text-align: left;
    padding: 12px 24px;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-main);
}

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

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* --- Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid;
}

.badge-blue {
    background: rgba(37, 99, 235, 0.1);
    color: #60a5fa;
    border-color: rgba(37, 99, 235, 0.2);
}

.badge-green {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.2);
}

/* --- Forms --- */
.form-panel {
    max-width: 480px;
    margin: 48px auto;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

input,
select {
    width: 100%;
    height: 40px;
    background: var(--bg-body);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0 12px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--text-muted);
    box-shadow: 0 0 0 1px var(--text-muted);
}

input::placeholder {
    color: #52525b;
}

/* --- Utilities --- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 40px 0 24px 0;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--text-muted);
}

/* --- Empty Types --- */
.empty-state {
    padding: 64px;
    text-align: center;
    color: var(--text-muted);
}

/* --- Dashboard Layout --- */
.dashboard-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
    margin-top: 24px;
}

.dept-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 12px;
    height: fit-content;
    position: sticky;
    top: 88px;
}

.dept-link {
    display: block;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: all 0.2s;
    margin-bottom: 4px;
    line-height: 1.4;
    word-wrap: break-word;
}

.dept-link:hover {
    background: var(--bg-subtle);
    color: var(--text-main);
}

.dept-link.active {
    background: var(--primary);
    color: white;
}

.dept-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 12px 16px 8px 16px;
    letter-spacing: 0.05em;
}

/* --- Year Tabs --- */
.tabs-container {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
}

.tab-link {
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.2s;
    background: transparent;
}

.tab-link:hover {
    color: var(--text-main);
    background: var(--bg-subtle);
}

.tab-link.active {
    color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.2);
}

/* --- Auth & Alerts --- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.2);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.2);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.2);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.2);
}

.badge {
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.badge-green {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.2);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-main);
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-main);
    transition: all 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.nav-user {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding-left: 14px;
    border-left: 1px solid var(--border-subtle);
    margin: 0 16px;
}

.nav-user-name {
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-main);
    background: rgba(37, 99, 235, 0.08);
    padding: 4px 12px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(37, 99, 235, 0.15);
}

.nav-logout-btn {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--danger);
    text-decoration: none;
}