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

:root {
    --bg-gradient: #f8f9fa;
    --surface: #ffffff;
    --surface-border: #e5e7eb;
    --primary: #4A90E2;
    --primary-hover: #357abd;
    --secondary: #dc3545;
    --text: #1e293b;
    --text-muted: #64748b;
    --success: #10b981;
    --danger: #dc3545;
    --sidebar-bg: #ffffff;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-gradient);
    color: var(--text);
    margin: 0;
    height: 100vh;
    overflow: hidden;
}

.brand-logo {
    width: auto;
    height: 40px;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

/* App Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--surface-border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    box-sizing: border-box;
    z-index: 10;
    box-shadow: 2px 0 10px rgba(0,0,0,0.02);
}

.sidebar h2 {
    margin: 0 0 2rem 0;
    font-weight: 800;
    color: var(--primary);
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar img.logo {
    height: 60px;
    width: auto;
    border-radius: 12px;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    margin-top: 1rem;
}

.sidebar-link {
    padding: 12px 16px;
    border-radius: 10px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-link:hover, .sidebar-link.active {
    background: rgba(74, 144, 226, 0.1);
    color: var(--primary);
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2.5rem;
    box-sizing: border-box;
    background: var(--bg-gradient);
    position: relative;
}

/* Components */
.glass-panel {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.logout-btn {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger);
    padding: 12px 16px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid rgba(220, 53, 69, 0.2);
    transition: all 0.2s;
    text-align: center;
    margin-top: auto;
}
.logout-btn:hover {
    background: rgba(220, 53, 69, 0.2);
}

.page-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-top: 0;
    margin-bottom: 2rem;
    color: var(--text);
    animation: slideDown 0.5s ease-out;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    animation: fadeIn 0.5s ease-out backwards;
}

.card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.card h3 {
    margin-top: 0;
    color: var(--text);
    font-size: 1.2rem;
    border-bottom: 1px solid var(--surface-border);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

input, select, textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid var(--surface-border);
    background: #ffffff;
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    outline: none;
    box-sizing: border-box;
    margin-bottom: 1rem;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15);
}

button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
    width: 100%;
}
button.btn-danger {
    background: var(--secondary);
}
button:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.styled-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.styled-list li {
    padding: 1rem;
    border: 1px solid var(--surface-border);
    border-radius: 10px;
    margin-bottom: 0.8rem;
    background: #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.badge {
    background: rgba(74, 144, 226, 0.15);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}
.badge-danger { background: rgba(220, 53, 69, 0.15); color: var(--danger); }

.alert {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(16, 185, 129, 0.2);
    font-weight: 500;
}

.log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.log-table th, .log-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--surface-border);
}
.log-table th { color: var(--text-muted); font-weight: 500; }
.log-container {
    max-height: 500px;
    overflow-y: auto;
}
.log-container::-webkit-scrollbar { width: 8px; }
.log-container::-webkit-scrollbar-track { background: var(--surface); }
.log-container::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 4px; }


/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.modal-content {
    background: #ffffff;
    border: 1px solid var(--surface-border);
    padding: 2rem;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    transform: translateY(20px);
    transition: transform 0.3s;
    box-shadow: 0 25px 50px rgba(0,0,0,0.1);
}
.modal-overlay.active .modal-content {
    transform: translateY(0);
}

/* Schedule Table Advanced UI */
.schedule-wrapper {
    overflow-x: auto;
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--surface-border);
    margin-bottom: 2.5rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}
.schedule-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}
.schedule-table th, .schedule-table td {
    border: 1px solid var(--surface-border);
    text-align: center;
    padding: 0;
}
.schedule-table th {
    background: #f1f5f9;
    color: var(--text-muted);
    font-weight: 600;
    padding: 12px 8px;
    font-size: 0.9rem;
}
.schedule-table th.day-col {
    background: rgba(74, 144, 226, 0.05);
    color: var(--primary);
    width: 80px;
    font-weight: 700;
}
.schedule-table td.pause-col {
    background: #f8fafc;
    width: 40px;
    color: var(--text-muted);
    font-weight: 800;
    letter-spacing: 2px;
    writing-mode: vertical-rl;
    text-orientation: upright;
}
.schedule-table td.slot-cell {
    height: 120px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
}
.schedule-table td.slot-cell:hover {
    background: #f8fafc;
}
.slot-content {
    padding: 8px;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.s-code { font-weight: 800; color: var(--text); font-size: 1.05rem; }
.s-title { font-size: 0.85rem; margin: 4px 0; color: var(--text-muted); line-height: 1.3; }
.s-room { font-size: 0.8rem; color: #357abd; font-weight:600;}
.s-empty { color: #e2e8f0; font-size: 2rem; font-weight: 300; }

.flex-row { display: flex; justify-content: space-between; align-items: center; width: 100%; gap: 10px; }
.flex-column { display: flex; flex-direction: column; gap: 0.5rem; }

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

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
