﻿:root {
    --maroon: #681C2C;
    --dark-maroon: #42111C;
    --gold: #C9A227;
    --soft-gold: #E5CF7A;
    --ink: #171717;
    --canvas: #F7F7F5;
    --line: #ece8e7;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", "DM Sans", Arial, sans-serif;
    color: var(--ink);
    background: var(--canvas);
}

a {
    color: inherit;
    text-decoration: none;
}

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

.sidebar {
    width: 274px;
    flex: 0 0 274px;
    background: var(--dark-maroon);
    color: #fff;
    display: flex;
    flex-direction: column;
}

.brand {
    padding: 28px 24px 22px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gold);
    color: var(--dark-maroon);
    font-weight: 800;
    margin-right: 12px;
}

.brand-title {
    display: inline-block;
    vertical-align: middle;
    font-weight: 800;
    letter-spacing: .12em;
    font-size: 12px;
}

.brand-subtitle {
    color: #d7c6c9;
    font-size: 10px;
    margin-top: 2px;
}

.nav {
    padding: 18px 12px;
    flex: 1;
    overflow-y: auto;
}

.nav-group {
    color: #aa878f;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .13em;
    margin: 22px 16px 8px;
    text-transform: uppercase;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    border-left: 3px solid transparent;
    border-radius: 0 8px 8px 0;
    color: #eadde0;
    font-size: 14px;
    transition: .18s ease;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(201,162,39,.16);
    color: #fff;
    border-left-color: var(--gold);
}

.main-zone {
    flex: 1;
    min-width: 0;
}

.topbar {
    height: 76px;
    background: #fff;
    border-bottom: 1px solid #e9e5e3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 5;
}

.breadcrumb {
    color: #78716c;
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.page {
    padding: 28px;
    max-width: 1700px;
    margin: 0 auto;
}

.eyebrow {
    color: var(--gold);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.page-title {
    margin: 5px 0 6px;
    font-size: 30px;
    letter-spacing: 0;
}

.muted {
    color: #69635f;
}

.grid {
    display: grid;
    gap: 18px;
}

.grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 4px 18px rgba(48,21,27,.045);
}

.card-pad {
    padding: 20px;
}

.kpi {
    min-height: 130px;
    position: relative;
    overflow: hidden;
}

.kpi:after {
    content: "";
    position: absolute;
    right: -18px;
    bottom: -24px;
    width: 94px;
    height: 94px;
    border-radius: 999px;
    background: rgba(104,28,44,.04);
}

.kpi-label {
    color: #69635f;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.kpi-value {
    margin-top: 14px;
    font-size: 32px;
    font-weight: 800;
    color: var(--maroon);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.badge-success {
    color: #216426;
    background: #e7f5e8;
}

.badge-warning {
    color: #96550a;
    background: #fff1d9;
}

.badge-danger {
    color: #a02626;
    background: #fbe6e6;
}

.badge-maroon {
    color: var(--maroon);
    background: #f6e9ec;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.field label {
    display: block;
    color: #57534e;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
}

.input,
.select,
.textarea {
    width: 100%;
    border: 1px solid #dedad8;
    border-radius: 8px;
    padding: 10px 12px;
    outline: none;
    background: #fff;
    font-size: 14px;
}

.textarea {
    min-height: 92px;
    resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
    border-color: var(--maroon);
    box-shadow: 0 0 0 3px rgba(104,28,44,.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    min-height: 40px;
    padding: 10px 14px;
    font-weight: 800;
    cursor: pointer;
}

.btn-primary {
    background: var(--maroon);
    color: #fff;
}

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

.btn-gold {
    background: var(--gold);
    color: #271c02;
}

.btn-light {
    background: #f1efed;
    color: #332d2a;
}

.btn-danger {
    background: #8a1f2d;
    color: #fff;
}

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

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 780px;
}

.data-table th {
    background: #f8f7f5;
    color: #6b6663;
    font-size: 11px;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.data-table th,
.data-table td {
    padding: 13px 15px;
    text-align: left;
    border-bottom: 1px solid #f0ecea;
    vertical-align: middle;
}

.section-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
}

.notice {
    border-left: 4px solid var(--gold);
    background: #fff9e8;
    padding: 12px 14px;
    border-radius: 8px;
    color: #5d4308;
    font-size: 13px;
}

@media (max-width: 1024px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        width: 100%;
        min-height: auto;
    }

    .grid-4,
    .grid-2,
    .form-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .page {
        padding: 18px;
    }

    .grid-4,
    .grid-2,
    .form-row {
        grid-template-columns: 1fr;
    }

    .topbar {
        padding: 0 18px;
    }
}

.brand-logo-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: #fff;
    object-fit: contain;
    padding: 3px;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,.1);
}

.logout-link {
    width: 100%;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 700;
    text-align: right;
}

.login-body {
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(66,17,28,.92), rgba(104,28,44,.76)),
        radial-gradient(circle at 18% 18%, rgba(201,162,39,.42), transparent 28%),
        linear-gradient(45deg, #f7f7f5, #ece8e7), url("../Images/BG%20MRSM%20JELI.jpg");
    background-size: cover;
    background-position: center;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
}

.login-panel {
    width: min(100%, 440px);
    background: rgba(255,255,255,.96);
    border: 1px solid rgba(255,255,255,.55);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(20, 8, 12, .26);
    padding: 30px;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.login-logo {
    width: 82px;
    height: 82px;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid #ece8e7;
    background: #fff;
    padding: 5px;
}

.login-brand h1 {
    margin: 4px 0 0;
    font-size: 28px;
    color: var(--dark-maroon);
    line-height: 1.05;
}

.login-copy {
    margin: 18px 0 20px;
    font-size: 14px;
}

.login-field {
    margin-top: 14px;
}

.login-button {
    width: 100%;
    margin-top: 18px;
}

.login-error {
    margin: 0 0 14px;
    border-left-color: #a02626;
    background: #fbe6e6;
    color: #781b1b;
}

@media (max-width: 1024px) {
    .sidebar-footer {
        padding-top: 0;
    }

    .nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .nav-group {
        grid-column: 1 / -1;
    }

    .nav-link {
        border-left: 0;
        border-bottom: 3px solid transparent;
        border-radius: 8px;
    }

    .nav-link:hover,
    .nav-link.active {
        border-left-color: transparent;
        border-bottom-color: var(--gold);
    }
}

@media (max-width: 640px) {
    .login-page {
        padding: 18px;
        align-items: stretch;
    }

    .login-panel {
        align-self: center;
        padding: 22px;
    }

    .login-logo {
        width: 68px;
        height: 68px;
    }

    .login-brand h1 {
        font-size: 23px;
    }

    .user-chip {
        flex-direction: column;
        align-items: flex-end;
        gap: 4px;
        font-size: 11px;
    }

    .nav {
        grid-template-columns: 1fr;
    }
}

.staff-form-actions {
    grid-template-columns: 1fr 1fr auto;
    margin-top: 12px;
}

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: end;
    justify-content: flex-end;
}

.bulk-upload-row {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.data-table input[type="button"],
.data-table input[type="submit"] {
    border: 0;
    border-radius: 8px;
    background: #f1efed;
    color: #332d2a;
    padding: 8px 10px;
    font-weight: 700;
    cursor: pointer;
}

.data-table input[type="button"]:hover,
.data-table input[type="submit"]:hover {
    background: #e5dfdc;
}

@media (max-width: 640px) {
    .staff-form-actions,
    .bulk-upload-row {
        grid-template-columns: 1fr;
    }

    .inline-actions {
        justify-content: stretch;
    }

    .inline-actions .btn,
    .bulk-upload-row .btn {
        width: 100%;
    }
}

.login-body:before {
    content: "";
    position: fixed;
    inset: 0;
    background: url("../Images/BG%20MRSM%20JELI.jpg") center/cover no-repeat;
    opacity: .18;
    filter: blur(5px);
    transform: scale(1.03);
    pointer-events: none;
}

.login-body:after {
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, rgba(66,17,28,.88), rgba(104,28,44,.68));
    pointer-events: none;
}

.login-page {
    position: relative;
    z-index: 1;
}
.schedule-paper {
    background: #fff;
    color: #111;
}

.schedule-title {
    text-align: center;
    font-size: 16px;
    line-height: 1.35;
    margin-bottom: 10px;
}

.schedule-logo {
    display: block;
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin: 0 auto 6px;
}

.schedule-day {
    margin: 14px 0 0;
    border: 1px solid #777;
    border-bottom: 0;
    padding: 4px 8px;
    font-size: 22px;
    text-transform: uppercase;
}

.schedule-matrix {
    width: 100%;
    border-collapse: collapse;
    min-width: 980px;
    font-family: Arial, sans-serif;
    font-weight: 700;
}

.schedule-matrix th,
.schedule-matrix td {
    border: 2px solid #111;
    padding: 5px 8px;
    text-align: center;
    vertical-align: middle;
    line-height: 1.1;
}

.schedule-matrix th {
    background: #f4f4f4;
    text-transform: uppercase;
}

.time-cell,
.subject-cell,
.coord-cell,
.level-cell {
    white-space: nowrap;
}

.inv-cell {
    min-width: 110px;
    text-transform: uppercase;
}

.level-1 td { background: #e8e3ee; }
.level-2 td { background: #f5e4d4; }
.level-3 td { background: #e6f0de; }
.level-4 td { background: #f4dada; }
.level-5 td { background: #dde8f3; }
.level-6 td { background: #f1ead2; }

.schedule-matrix .inv-cell:empty {
    background: #8d8d8d;
}

.schedule-note {
    margin-top: 6px;
    text-align: center;
    font-size: 14px;
    line-height: 1.35;
    text-transform: uppercase;
}

.schedule-signoff {
    margin-top: 34px;
    margin-left: auto;
    width: min(360px, 100%);
    font-size: 13px;
    line-height: 1.35;
    text-transform: uppercase;
}

.signature-line {
    border-bottom: 1.5px solid #111;
    height: 58px;
    margin: 8px 0 6px;
}

@media print {
    .schedule-paper {
        padding: 0 !important;
        width: 100% !important;
    }

    .schedule-title {
        font-size: 11pt;
    }

    .schedule-day {
        font-size: 13pt;
    }

    .schedule-matrix {
        min-width: 0;
        width: 100%;
        table-layout: fixed;
        font-size: 7.2pt;
    }

    .schedule-matrix th,
    .schedule-matrix td {
        padding: 2px 3px;
        border-width: 1px;
        word-break: break-word;
    }

    .schedule-note {
        font-size: 8pt;
    }

    .schedule-logo {
        width: 48px;
        height: 48px;
    }

    .schedule-signoff {
        break-inside: avoid;
        page-break-inside: avoid;
        margin-top: 22px;
        font-size: 8.5pt;
    }
}

.sidebar {
    min-height: 100vh;
}

.sidebar-footer {
    margin-top: auto;
}

@media (min-width: 1025px) {
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        height: 100vh;
        overflow: hidden;
        z-index: 10;
    }

    .main-zone {
        margin-left: 274px;
    }

    .nav {
        min-height: 0;
    }

    .sidebar-footer {
        flex: 0 0 auto;
    }
}

.compact-select-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #57534e;
    font-size: 13px;
    font-weight: 700;
}

.compact-select {
    width: auto;
    min-width: 76px;
    padding: 8px 10px;
}

.compact-search {
    width: min(240px, 100%);
}

.tall-select {
    min-height: 126px;
}

.data-table .pager table {
    margin: 8px auto 0;
}

.data-table .pager td {
    border: 0;
    padding: 4px;
}

.data-table .pager a,
.data-table .pager span {
    display: inline-flex;
    min-width: 34px;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f1efed;
    color: #332d2a;
    font-weight: 800;
}

.data-table .pager span {
    background: var(--maroon);
    color: #fff;
}

@media (max-width: 1024px) {
    .main-zone {
        margin-left: 0;
    }
}
