/* ===========================================================
   DMU Clearance Management System — main stylesheet
   =========================================================== */

:root {
    --primary:        #1e6091;   /* DMU deep blue */
    --primary-dark:   #144870;
    --primary-light:  #e8f1f9;
    --accent:         #c89b3c;   /* DMU gold */
    --success:        #198754;
    --info:           #0dcaf0;
    --warning:        #ffc107;
    --danger:         #dc3545;
    --text:           #1f2d3d;
    --muted:          #6b7a90;
    --bg:             #f4f6fb;
    --card-bg:        #ffffff;
    --border:         #e3e8f0;
    --sidebar-bg:     #0f3d5e;
    --sidebar-text:   #d5e2ee;
    --shadow:         0 1px 2px rgba(15,40,80,.04), 0 4px 14px rgba(15,40,80,.06);
    --radius:         10px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    font-size: 14.5px;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #f0f3f8; padding: 1px 6px; border-radius: 4px; font-size: 13px; }

/* ===== Typography helpers ===== */
h1, h2, h3, h4 { color: var(--text); margin: 0 0 .6em; line-height: 1.25; }
h1 { font-size: 24px; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
h4 { font-size: 15px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-info    { color: #0a8bb4; }
.text-warning { color: #b07a00; }
.truncate {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 7px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    transition: .15s;
}
.btn:hover { background: #f5f7fa; text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { filter: brightness(.93); }
.btn-danger  { background: var(--danger);  color: #fff; border-color: var(--danger); }
.btn-danger:hover  { filter: brightness(.93); }
.btn-light   { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.25); }
.btn-light:hover { background: rgba(255,255,255,.2); }
.btn-lg { padding: 12px 22px; font-size: 15px; }
.btn-sm { padding: 4px 10px; font-size: 12.5px; }
.btn-block { display: block; width: 100%; }
.inline { display: inline-block; margin-right: 4px; }

/* ===== Cards ===== */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}
.card-header h3 { margin: 0; }
.feature { text-align: center; }
.feature-icon { font-size: 36px; margin-bottom: 6px; }
.empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
}
.empty h3 { color: var(--text); }
.empty p { margin-bottom: 14px; }

/* ===== Forms ===== */
.form { max-width: 100%; }
.form .form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #34465d;
    margin: 12px 0 5px;
}
.form .form-control {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.form .form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30,96,145,.15);
}
.form .form-control:disabled { background: #f5f7fa; color: #888; }
.form .checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}
.form .form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}
.filterbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.filterbar .form-control { flex: 1 1 220px; }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; }
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}
.table thead th {
    background: #f7f9fc;
    color: #34465d;
    text-align: left;
    padding: 10px 12px;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--border);
}
.table tbody td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table tbody tr:hover { background: #f9fbff; }
.table .actions { white-space: nowrap; }
.kv { width: 100%; border-collapse: collapse; }
.kv th { width: 38%; text-align: left; padding: 6px 0; color: var(--muted); font-weight: 500; }
.kv td { padding: 6px 0; }

/* ===== Badges ===== */
.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .02em;
    background: #eef1f6;
    color: #34465d;
}
.badge-success { background: #d4edda; color: #155724; }
.badge-danger  { background: #f8d7da; color: #721c24; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-info    { background: #cce7f6; color: #055160; }
.badge-secondary { background: #e2e3e5; color: #383d41; }
.chip {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 5px;
    background: #f0f3f8;
    font-size: 12px;
    margin-right: 2px;
}

/* ===== Alerts ===== */
.alert {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 14px;
    border: 1px solid transparent;
    font-size: 14px;
}
.alert-success { background: #d4edda; color: #155724; border-color: #c3e6cb; }
.alert-danger  { background: #f8d7da; color: #721c24; border-color: #f5c6cb; }
.alert-warning { background: #fff3cd; color: #856404; border-color: #ffeeba; }
.alert-info    { background: #d1ecf1; color: #0c5460; border-color: #bee5eb; }

/* ===== Layout (sidebar + main) ===== */
.app-body { background: var(--bg); min-height: 100vh; }
.app-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}
.sidebar {
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 22px 0;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 18px 18px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    margin-bottom: 14px;
}
.sidebar-logo {
    width: 38px; height: 38px;
    border-radius: 8px;
    background: rgba(255,255,255,.15);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}
.sidebar-brand strong { display: block; color: #fff; font-size: 15px; }
.sidebar-brand span  { color: rgba(255,255,255,.65); font-size: 11.5px; }
.side-nav { flex: 1; padding: 0 8px; }
.side-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--sidebar-text);
    font-size: 14px;
    margin-bottom: 2px;
}
.side-link:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.side-link.active { background: rgba(255,255,255,.16); color: #fff; }
.side-link span { font-size: 17px; width: 22px; text-align: center; }
.sidebar-foot { padding: 12px 14px 0; border-top: 1px solid rgba(255,255,255,.08); }

.app-main { padding: 0 28px 28px; min-width: 0; }
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0 18px;
    flex-wrap: wrap;
    gap: 10px;
}
.topbar-title { margin: 0; }
.topbar-sub { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600;
}
.topbar-user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.topbar-user-meta strong { font-size: 13.5px; }
.topbar-user-meta span  { font-size: 12px; color: var(--muted); }
.page { padding-top: 6px; }
.app-footer { color: var(--muted); padding: 20px 0 8px; text-align: center; }

/* ===== Grid ===== */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-5 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.mt-3 { margin-top: 20px; }

/* ===== Stats ===== */
.stat .stat-label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.stat .stat-value { font-size: 30px; font-weight: 700; color: var(--text); }

/* ===== Office list (used on student / office pages) ===== */
.office-list { list-style: none; padding: 0; margin: 0; }
.office-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
}
.office-item:last-child { border-bottom: none; }
.office-emoji { font-size: 19px; }
.office-name { flex: 1; font-weight: 500; }
.grow { flex: 1; }

/* ===== Steps ===== */
.steps { padding-left: 22px; }
.steps li { margin-bottom: 6px; }

/* ===== Auth pages ===== */
.auth-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #1e6091 0%, #0f3d5e 100%);
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
.auth-wrapper { width: 100%; max-width: 420px; }
.auth-wrapper-wide { max-width: 720px; }
.auth-card {
    background: #fff;
    padding: 28px 30px;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-logo {
    width: 64px; height: 64px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 32px;
    margin: 0 auto 10px;
}
.auth-brand h1 { font-size: 20px; margin-bottom: 4px; }
.auth-brand p { margin: 0; color: var(--muted); font-size: 13px; }
.auth-foot {
    text-align: center;
    margin-top: 18px;
    font-size: 13.5px;
    color: var(--muted);
}
.auth-creds {
    margin-top: 18px;
    padding: 12px 14px;
    background: var(--primary-light);
    border-radius: 8px;
    font-size: 12.5px;
    color: #1d3e5a;
}
.auth-creds ul { margin: 6px 0 0; padding-left: 18px; }
.install-body { background: #0f3d5e; min-height: 100vh; padding: 40px 16px; }
.install-card {
    background: #fff;
    max-width: 700px;
    margin: 0 auto;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

/* ===== Landing page ===== */
.landing-body { background: var(--bg); }
.landing-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 5%;
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 10;
}
.landing-nav .brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
    width: 44px; height: 44px;
    background: var(--primary);
    color: #fff;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
}
.landing-nav strong { display: block; font-size: 15px; }
.landing-nav small  { color: var(--muted); font-size: 12.5px; }
.landing-nav-links { display: flex; align-items: center; gap: 18px; }
.landing-nav-links a { color: var(--text); font-size: 14px; font-weight: 500; }

.hero {
    padding: 80px 5%;
    text-align: center;
    background:
        radial-gradient(circle at 20% 20%, rgba(30,96,145,.15), transparent 40%),
        radial-gradient(circle at 80% 30%, rgba(200,155,60,.18), transparent 40%),
        linear-gradient(180deg, #fff, var(--bg));
}
.hero-inner { max-width: 760px; margin: 0 auto; }
.hero h1 { font-size: 44px; line-height: 1.15; margin-bottom: 14px; }
.hero p  { font-size: 17px; color: #2c3e57; margin-bottom: 26px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.section { padding: 60px 5%; }
.section-alt { background: #fff; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-title { text-align: center; margin-bottom: 32px; font-size: 28px; }

.office-card { text-align: center; padding: 22px 16px; }
.office-emoji { font-size: 36px; margin-bottom: 6px; }
.office-card h4 { margin-bottom: 6px; }
.office-card p  { color: var(--muted); margin: 0; font-size: 13px; }

.landing-footer {
    text-align: center;
    padding: 30px 5%;
    color: var(--muted);
    border-top: 1px solid var(--border);
}
.landing-footer small { display: block; margin-top: 4px; }

/* ===== Misc ===== */
.bar {
    background: #eef1f6;
    border-radius: 999px;
    overflow: hidden;
    height: 8px;
    margin-bottom: 4px;
}
.bar-fill {
    background: var(--primary);
    height: 100%;
    transition: width .3s;
}
.popover { position: relative; display: inline-block; }
.popover summary {
    list-style: none;
    cursor: pointer;
}
.popover summary::-webkit-details-marker { display: none; }
.popover-body {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: #fff;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 200px;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: relative;
        height: auto;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        padding: 10px;
        overflow-x: auto;
    }
    .sidebar-brand { border: none; padding: 0; margin: 0 8px 0 0; }
    .side-nav { display: flex; gap: 4px; padding: 0; flex: 1; overflow-x: auto; }
    .sidebar-foot { padding: 0; border: none; }
    .app-main { padding: 0 16px 24px; }
    .hero h1 { font-size: 32px; }
    .hero p  { font-size: 15px; }
}
@media (max-width: 600px) {
    .topbar { padding: 14px 0; }
    .topbar-title { font-size: 19px; }
    .stat .stat-value { font-size: 24px; }
    .card { padding: 14px; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-5 { grid-template-columns: repeat(2, 1fr); }
}