:root {
    --primary: #52525b; /* Zinc 600 */
    --primary-hover: #27272a; /* Zinc 800 */
    --bg-light: #fafaf9; /* Stone 50 */
    --sidebar-bg: #f5f5f4; /* Stone 100 */
    --card-bg: #ffffff;
    --border-color: #e7e5e4; /* Stone 200 */
    --text-main: #1c1917; /* Stone 900 */
    --text-muted: #78716c; /* Stone 500 */
    --danger: #b91c1c;
    --success: #15803d;
    --accent-beige: #f5f5f4;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: var(--bg-light);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    z-index: 100;
}

.logo {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--text-main);
    text-transform: uppercase;
}

.subtitle {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    border: none;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: white;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-light);
}

.btn-danger {
    background: white;
    color: var(--danger);
    border: 1px solid #fee2e2;
}

.btn-danger:hover {
    background: #fef2f2;
}

.glass {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

.stats-card h3 {
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
}

.sidebar-footer {
    margin-top: auto;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2.5rem;
    overflow-y: auto;
    background: white;
}

.calendar-container {
    width: 100%;
    min-height: 960px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    overflow: hidden;
}

.calendar-header {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
    font-weight: 500;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.calendar-grid {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    grid-template-rows: repeat(15, 60px);
    flex: 1;
    position: relative;
    background: white;
}

.time-label {
    grid-column: 1;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding-right: 1rem;
    padding-top: 6px;
    font-size: 0.7rem;
    color: var(--text-muted);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-light);
}

.grid-cell {
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

/* Course Card in Grid */
.course-card {
    position: absolute;
    left: 4px;
    right: 4px;
    border-radius: 6px;
    padding: 8px;
    font-size: 0.75rem;
    color: white;
    cursor: pointer;
    transition: filter 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 10;
    border: 1px solid rgba(0,0,0,0.05);
}

.course-card:hover {
    filter: brightness(0.95);
    z-index: 20;
}

.course-title {
    font-weight: 700;
    font-size: 0.8125rem;
    line-height: 1.2;
}

.course-info {
    font-size: 0.7rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 4px;
}

.course-info.link {
    background: rgba(255,255,255,0.25);
    padding: 1px 4px;
    border-radius: 4px;
    width: fit-content;
    text-decoration: none;
    color: white;
    font-size: 0.65rem;
    margin-top: 2px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.hidden { display: none !important; }

.modal {
    width: 100%;
    max-width: 480px;
    background: white;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
    max-height: 95vh;
    overflow-y: auto;
    padding: 2rem;
    border-radius: 1rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 { font-size: 1.125rem; font-weight: 700; color: var(--text-main); }

.form-group { margin-bottom: 1.25rem; }
.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }

.day-selector {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.day-btn {
    flex: 1;
    padding: 8px 4px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
}

.day-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

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

label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.375rem;
    color: var(--text-muted);
}

input, select, textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    color: var(--text-main);
    outline: none;
    font-size: 0.875rem;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(82, 82, 91, 0.1);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
}

/* Animations */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.modal { animation: slideUp 0.2s ease-out; }

/* Responsive */
@media (max-width: 768px) {
    .app-container { flex-direction: column; }
    .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border-color); padding: 1.5rem; }
    .main-content { padding: 1.5rem; }
    .calendar-container { overflow-x: auto; }
    .calendar-grid, .calendar-header { min-width: 800px; }
}
