:root {
    --primary: #004a99;
    --primary-light: #e0f2fe;
    --secondary: #f1f5f9;
    --accent: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --white: #ffffff;
    --border: #e2e8f0;
    --sidebar-width: 260px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--secondary);
    color: var(--text-main);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: #003366;
    color: white;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.6rem;
    font-weight: bold;
    margin-bottom: 2.5rem;
    text-decoration: none;
    color: white;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
}

.nav-link:hover,
.nav-link.active {
    background-color: var(--primary);
    color: white;
}

/* Main Content */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

header {
    padding: 1.5rem 2rem;
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.view-area {
    flex-grow: 1;
    overflow-y: auto;
    padding: 2rem;
}

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

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
}

.stat-card .label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.stat-card .value {
    font-size: 1.5rem;
    font-weight: bold;
    margin-top: 5px;
    color: var(--primary);
}

/* Tables */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
    margin-bottom: 2rem;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem 1.5rem;
    background: #f8fafc;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
}

td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

tr:hover {
    background-color: #f8fafc;
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-amber { background: #fef3c7; color: #92400e; }
.badge-red { background: #fee2e2; color: #b91c1c; }

/* Buttons */
.btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: white;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
}

.btn-primary:hover { background: #003366; }

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active { 
    display: flex; 
    opacity: 1;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 500px;
    max-width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--primary);
    color: white;
}

.modal-header h3 {
    font-size: 1.25rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header button {
    color: white;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #f8fafc;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}

.input-field {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: 0.2s;
}

.input-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Agenda Grid Specifics */
.agenda-grid {
    display: grid;
    grid-template-columns: 80px repeat(5, 1fr);
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.agenda-header-cell {
    padding: 1rem;
    text-align: center;
    font-weight: bold;
    background: #f8fafc;
    border-bottom: 2px solid var(--border);
    border-right: 1px solid var(--border);
    font-size: 0.8rem;
}

.time-cell {
    padding: 1rem;
    text-align: center;
    font-weight: bold;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    background: #fcfcfd;
    font-size: 0.8rem;
    height: 80px;
}

.slot-cell {
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    position: relative;
    padding: 4px;
    min-height: 80px;
}

.apt {
    border-radius: 6px;
    padding: 8px;
    font-size: 0.75rem;
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: 0.2s;
}

.apt-doc { background-color: #dbeafe; border-left: 4px solid var(--primary); color: #1e40af; }
.apt-student { background-color: #fef3c7; border-left: 4px solid var(--warning); color: #92400e; }
.apt-validating { background-color: #dcfce7; border-left: 4px solid var(--accent); color: #166534; }
