:root {
    --primary: #2D5B87;
    --secondary: #4A90E2;
    --sidebar-width: 260px;
}

body {
    background: #f4f7fb;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.btn-primary {
    --bs-btn-bg: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: #244a6f;
    --bs-btn-hover-border-color: #244a6f;
}

.text-primary { color: var(--primary) !important; }
.bg-primary { background-color: var(--primary) !important; }
.progress-bar { background-color: var(--secondary); }

.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: linear-gradient(180deg, var(--primary) 0%, #1e3f5f 100%);
    flex-shrink: 0;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.85);
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
    padding: 0.65rem 1rem;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.sidebar-brand {
    font-weight: 700;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

#wrapper {
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
}

.stat-card .display-6 {
    line-height: 1.1;
}

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 1rem;
}

.auth-card {
    max-width: 420px;
    width: 100%;
    border: none;
    border-radius: 1rem;
}

.schedule-grid input {
    min-width: 72px;
    font-size: 0.8rem;
    background: #fff;
}

.schedule-grid input:focus {
    box-shadow: inset 0 0 0 2px var(--secondary);
}

.schedule-grid-wrap {
    max-height: 70vh;
    overflow: auto;
}

.cell-readonly {
    display: block;
    min-height: 1.5rem;
    font-size: 0.8rem;
}

.sticky-actions {
    position: sticky;
    bottom: 0;
}

.schedule-card {
    transition: transform 0.15s ease;
}

.schedule-card:hover {
    transform: translateY(-2px);
}

.template-form-wrap {
    overflow-x: auto;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
}

.template-form-table {
    font-size: 0.85rem;
    margin: 0;
    min-width: 100%;
}

.template-form-table td {
    vertical-align: middle;
    padding: 0.35rem 0.5rem;
    min-width: 80px;
}

.template-label {
    background: #f0f4f8;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
}

.template-label-text {
    display: block;
}

.template-input {
    border: 1px dashed #adb5bd !important;
    background: #fffef8 !important;
    min-width: 100px;
}

.template-input:focus {
    border-style: solid !important;
    border-color: var(--secondary) !important;
    background: #fff !important;
}

.template-filled {
    display: block;
    min-height: 1.5rem;
}

@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        z-index: 1050;
        transition: left 0.25s ease;
    }
    .sidebar.show {
        left: 0;
    }
}
