/* ============================================================
   SZABUL — Online Attendance · Brand Theme
   Shaheed Zulfiqar Ali Bhutto University of Law, Karachi
   ------------------------------------------------------------
   Palette (from the university crest)
     Crest green   #00441F   primary / headers / buttons
     Leaf green    #0B6B38   hover / focus / accents
     Pressed green #06331A   active states
     Brass gold    #B28E40   hairline rules only (scales of justice)
     Paper         #F4F7F4   page background
     Ink           #1E2A22   body text
     Row tint      #F3F8F4   zebra rows
     Line          #D8E2DA   table / input borders
   Type
     Wordmark & headings : Georgia / Times New Roman (serif)
     Data & controls     : Segoe UI / Tahoma / Arial (sans)
   Notes
   - Selectors are prefixed with `body` so they outrank the
     legacy <style> blocks left in each page at equal cascade.
   - Row colours are NOT !important on purpose: code-behind
     still paints semantic rows (e.g. red = problem, green =
     present) via inline styles and must keep winning.
   ============================================================ */

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    padding: 0;
    background: #F4F7F4;
    color: #1E2A22;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    font-size: 13px;
}

/* ---------- Links ---------- */
body a { color: #0B6B38; }
body a:hover { color: #00441F; }

/* ---------- University band (inner pages) ---------- */
body .szb-band {
    overflow: hidden;
    background: #00441F;
    border-bottom: 3px solid #B28E40;
    padding: 10px 16px;
    margin: 0 0 14px 0;
    text-align: left;
}
body .szb-band .szb-band-inner {
    display: inline-block;
    vertical-align: middle;
}
body .szb-band img {
    height: 40px; width: 40px;
    vertical-align: middle;
    background: #fff;
    border-radius: 50%;
    margin-right: 10px;
}
body .szb-band .szb-uni {
    display: inline-block;
    vertical-align: middle;
    color: #FFFFFF;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 15px;
    letter-spacing: 0.06em;
}
body .szb-band .szb-uni small {
    display: block;
    color: #CBDCCB;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    font-size: 10.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-top: 1px;
}
body .szb-band .szb-page {
    float: right;
    color: #E7D9B4;
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    font-size: 14px;
    line-height: 40px;
}

/* ---------- Buttons ----------
   Legacy pages use CssClass="gray"; the theme reclaims it. */
body .gray,
body .szb-btn,
body input[type="submit"],
body input[type="button"] {
    color: #FFFFFF;
    border: 1px solid #06331A;
    background: #00441F;
    background: linear-gradient(#0B6B38, #00441F);
    text-shadow: 0 1px 1px rgba(0,0,0,.35);
    border-radius: 4px;
    cursor: pointer;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    padding: 0 12px;
    box-shadow: 0 1px 2px rgba(0,20,8,.25);
}
body .gray:hover,
body .szb-btn:hover,
body input[type="submit"]:hover,
body input[type="button"]:hover {
    background: #0B6B38;
    background: linear-gradient(#128246, #0B6B38);
}
body .gray:active,
body .szb-btn:active,
body input[type="submit"]:active,
body input[type="button"]:active {
    background: #06331A;
    box-shadow: inset 0 1px 3px rgba(0,0,0,.35);
}
body .gray[disabled],
body input[type="submit"][disabled] {
    background: #9DB3A4;
    border-color: #8AA391;
    cursor: default;
    text-shadow: none;
}

/* ---------- Inputs ---------- */
body input[type="text"],
body input[type="password"],
body select,
body textarea {
    border: 1px solid #C3D2C6;
    border-radius: 4px;
    background: #FFFFFF;
    color: #1E2A22;
    padding: 4px 7px;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    font-size: 13px;
}
body input[type="text"]:focus,
body input[type="password"]:focus,
body select:focus,
body textarea:focus {
    border-color: #0B6B38;
    outline: 2px solid rgba(11,107,56,.35);
    outline-offset: 1px;
}
body input[type="checkbox"],
body input[type="radio"] { accent-color: #0B6B38; }

body .lbl { color: #37473C; }

body hr.dottedline {
    border-top: 1px dotted #B7C9BC;
    color: #B7C9BC;
}

/* ---------- Data grids (GridView renders a table) ---------- */
body table.tbl-szabul {
    /* GridView emits border="1" rules="all" style="border-collapse:collapse"
       inline; separate must win or sticky headers shed their borders. */
    border-collapse: separate !important;
    border-spacing: 0;
    background: #FFFFFF;
    border: 1px solid #D8E2DA;
    box-shadow: 0 1px 3px rgba(20,40,28,.08);
}
body table.tbl-szabul th,
body table.tbl-szabul tr th {
    background: #00441F;
    color: #FFFFFF;
    font-weight: bold;
    font-size: 11.5px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 7px 10px;
    border: 0;                          /* cancel the rules="all" hint */
    border-right: 1px solid rgba(255,255,255,.15);
    border-bottom: 2px solid #B28E40;   /* the brass rule of the bench */
    text-align: left;
    white-space: nowrap;
    position: sticky;                   /* header stays visible in scrolling panels */
    top: 0;
    z-index: 2;
}
body table.tbl-szabul td {
    padding: 5px 10px;
    border: 0;                          /* cancel the rules="all" hint */
    border-bottom: 1px solid #E2EAE3;
    border-right: 1px solid #E2EAE3;
    font-size: 12.5px;
}
/* Stripe the ROW, not the cells: code-behind paints semantic rows
   (red = clash/problem) as inline tr styles, which must stay visible. */
body table.tbl-szabul tr:nth-child(even) { background: #F3F8F4; }
body table.tbl-szabul tr:hover { background: #E9F3EC; }
body table.tbl-szabul a { color: #0B6B38; font-weight: bold; }

/* Grid pager (GridView pager renders a nested table row) */
body table.tbl-szabul tr.pgr,
body table.tbl-szabul .pgr { background: #EAF1EB; }

/* ---------- Scrollable panels around grids ---------- */
body div[id*="Panel"] { scrollbar-color: #0B6B38 #E4ECE5; }
body div[id*="Panel"]::-webkit-scrollbar { width: 10px; height: 10px; }
body div[id*="Panel"]::-webkit-scrollbar-track { background: #E4ECE5; }
body div[id*="Panel"]::-webkit-scrollbar-thumb {
    background: #0B6B38; border-radius: 5px;
}

/* ---------- AjaxControlToolkit calendar ---------- */
body .ajax__calendar_container {
    border: 1px solid #C3D2C6;
    background: #FFFFFF;
    box-shadow: 0 3px 10px rgba(20,40,28,.18);
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}
body .ajax__calendar_header { background: #00441F; }
body .ajax__calendar_title,
body .ajax__calendar_next,
body .ajax__calendar_prev { color: #FFFFFF; }
body .ajax__calendar_hover .ajax__calendar_day,
body .ajax__calendar_hover .ajax__calendar_month,
body .ajax__calendar_hover .ajax__calendar_year { background: #E9F3EC; color: #00441F; }
body .ajax__calendar_active .ajax__calendar_day,
body .ajax__calendar_active .ajax__calendar_month,
body .ajax__calendar_active .ajax__calendar_year {
    background: #0B6B38; color: #FFFFFF; font-weight: bold;
}
body .ajax__calendar_today .ajax__calendar_day { border-color: #B28E40; }
body .ajax__calendar_other .ajax__calendar_day { color: #9DB3A4; }

/* ============================================================
   Sign-in page (Default.aspx)
   ============================================================ */
body.szb-login {
    background: #00441F;
    background: radial-gradient(ellipse at 50% 18%, #0A5A30 0%, #00441F 55%, #002A13 100%);
    min-height: 100vh;
}
body.szb-login form { display: block; }

body .szb-login-wrap {
    max-width: 400px;
    margin: 6vh auto 24px auto;
    padding: 0 14px;
}
body .szb-card {
    background: #FFFFFF;
    border-radius: 10px;
    border-top: 4px solid #B28E40;
    box-shadow: 0 18px 45px rgba(0,15,7,.45);
    padding: 30px 34px 26px 34px;
    text-align: center;
}
body .szb-card .szb-crest {
    width: 96px; height: 96px;
    margin: 0 auto 10px auto;
    display: block;
}
body .szb-wordmark {
    font-family: Georgia, "Times New Roman", serif;
    color: #00441F;
    font-size: 17px;
    font-weight: bold;
    letter-spacing: 0.04em;
    line-height: 1.35;
    margin: 0 0 2px 0;
}
body .szb-sub {
    color: #6B7A6F;
    font-size: 10.5px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin: 0 0 18px 0;
    padding-bottom: 14px;
    border-bottom: 1px solid #E4ECE5;
}
body .szb-field { text-align: left; margin-bottom: 13px; }
body .szb-field .lbl,
body .szb-field label,
body .szb-field span {
    display: block;
    font-size: 10.5px !important;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif !important;
    letter-spacing: 0.12em;
    color: #4A5A4F !important;
    font-weight: bold;
    margin-bottom: 4px;
}
body .szb-card input[type="text"],
body .szb-card input[type="password"],
body .szb-card select {
    width: 100% !important;
    max-width: 100%;
    height: 36px !important;
    box-sizing: border-box;
    border: 1px solid #C3D2C6 !important;
    border-radius: 5px;
    font-size: 13.5px;
}
body .szb-card .szb-btn {
    width: 100%;
    height: 38px !important;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 0.14em;
    margin-top: 6px;
}
body .szb-error {
    min-height: 20px;
    margin-top: 12px;
    font-size: 12px;
    text-align: center;
}
body .szb-error img { vertical-align: middle; margin-right: 5px; }
body .szb-foot {
    text-align: center;
    margin-top: 16px;
}
body .szb-foot,
body .szb-foot span {
    color: #BFD6C3 !important;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif !important;
    font-size: 11px !important;
}

/* ---------- Bootstrap pages on Site.Master ---------- */
body .navbar-inverse {
    background: #00441F;
    border-color: #06331A;
    border-bottom: 3px solid #B28E40;
}
body .navbar-inverse .navbar-brand,
body .navbar-inverse .navbar-nav > li > a { color: #E6F0E8; }
body .navbar-inverse .navbar-nav > li > a:hover { color: #FFFFFF; }

/* ---------- Print ---------- */
@media print {
    body { background: #FFFFFF; }
    body .szb-band { background: #FFFFFF; border-bottom: 2px solid #00441F; }
    body .szb-band .szb-uni, body .szb-band .szb-page { color: #00441F; }
    body table.tbl-szabul th {
        background: #FFFFFF; color: #000000;
        border-bottom: 2px solid #000000;
    }
    body table.tbl-szabul tr:nth-child(even) td { background: #FFFFFF; }
    body .gray, body .szb-btn { display: none; }
}

/* ============================================================
   Attendance workspace (Attendance.aspx — body.szb-attend)
   ============================================================ */
body.szb-attend {
    background: #E8F0E9;
    background: linear-gradient(#EDF4EE, #E3EDE5);
    min-height: 100vh;
}
/* faint crest watermark, bottom-right of the desk */
body.szb-attend::before {
    content: "";
    position: fixed;
    right: -110px; bottom: -130px;
    width: 540px; height: 540px;
    background: url("../images/szabul-crest-512.png") no-repeat center;
    background-size: contain;
    opacity: .06;
    pointer-events: none;
    z-index: 0;
}
body.szb-attend .szb-band { position: relative; z-index: 1; }

/* the white working sheet the whole page sits on */
body .szb-sheet {
    position: relative;
    z-index: 1;
    background: #FFFFFF;
    max-width: 1060px;
    margin: 0 auto 28px auto;
    padding: 20px 22px;
    text-align: left;
    border: 1px solid #DCE7DE;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(15,45,25,.12);
}

/* AjaxControlToolkit modal panels (Edit Attendance / Unconfirmed list) */
body .szb-pop {
    border-radius: 6px;
    border: 1px solid #C3D2C6;
    box-shadow: 0 22px 55px rgba(0,20,8,.38);
    background: #FFFFFF;
}

/* row edit glyph in the marking grid */
body .szb-edit {
    color: #0B6B38;
    font-size: 15px;
    text-decoration: none;
}
body table.tbl-szabul a { text-decoration: none; }

@media print {
    body.szb-attend::before { display: none; }
    body .szb-sheet { border: none; box-shadow: none; max-width: none; padding: 0; }
}

/* ============================================================
   Sessions-wise summary card (PnlAttndSummary)
   ============================================================ */
body .szb-summary {
    border: 1px solid #DCE7DE;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(20,40,28,.10);
    height: auto !important;          /* content-sized card */
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}
body .szb-sum-head {
    background: #00441F;
    border-bottom: 2px solid #B28E40;
    padding: 8px 10px;
    text-align: center;
}
body .szb-sum-head span {
    color: #FFFFFF;
    font-size: 11.5px;
    font-weight: bold;
    letter-spacing: 0.12em;
}
body table.szb-sum-tbl {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
body .szb-sum-cols td {
    background: #EAF1EB;
    color: #4A5A4F;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-align: center;
    padding: 6px 8px;
    border-bottom: 1px solid #D8E2DA;
}
body .szb-sum-tbl td {
    padding: 8px;
    text-align: center;
    font-size: 12.5px;
    border-bottom: 1px solid #EEF3EF;
}
body .szb-sum-tbl td:first-child {
    text-align: left;
    padding-left: 12px;
    color: #37473C;
    font-weight: 600;
}
body .szb-sum-tbl tr:nth-child(odd) td { background: #FAFCFA; }
body .szb-sum-tbl .szb-p span { color: #0B6B38; font-weight: bold; font-size: 13.5px; }
body .szb-sum-tbl .szb-a span { color: #C0392B; font-weight: bold; font-size: 13.5px; }
/* hide a session row whose labels are server-side invisible */
body .szb-sum-tbl tr:has(> td:first-child:empty) { display: none; }
body .szb-sum-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    background: #F3F8F4;
    border-top: 1px solid #D8E2DA;
    padding: 8px 12px;
}
body .szb-sum-total span { font-size: 12px; font-weight: bold; color: #37473C; }
body .szb-sum-total .szb-sum-num { font-size: 18px; color: #00441F; }

/* ============================================================
   Mobile / responsive layer
   Legacy fixed layout tables are linearized into a single
   column; data grids (.tbl-szabul) and the summary card keep
   their table layout and scroll inside their panels instead.
   ============================================================ */
@media (max-width: 760px) {
    body { font-size: 14px; }

    /* 1. linearize layout tables (never the data grids / summary) */
    body table:not(.tbl-szabul):not(.szb-sum-tbl),
    body table:not(.tbl-szabul):not(.szb-sum-tbl) > tbody,
    body table:not(.tbl-szabul):not(.szb-sum-tbl) > tbody > tr,
    body table:not(.tbl-szabul):not(.szb-sum-tbl) > tbody > tr > td {
        display: block;
        width: auto !important;
        height: auto !important;
    }

    /* 2. scrolling panels become fluid; wide grids pan inside them */
    body div[id*="Panel"] {
        width: auto !important;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    body table.tbl-szabul { width: auto !important; }

    /* 3. touch-friendly controls; 16px stops iOS auto-zoom */
    body input[type="text"],
    body input[type="password"],
    body select,
    body textarea {
        font-size: 16px;
        max-width: 100%;
        box-sizing: border-box;
    }
    body .gray, body .szb-btn,
    body input[type="submit"], body input[type="button"] {
        min-height: 36px;
        font-size: 14px;
    }
    body img { max-width: 100%; height: auto; }

    /* 4. band stacks; page name drops under the wordmark */
    body .szb-band { padding: 8px 12px; }
    body .szb-band .szb-page {
        float: none;
        display: block;
        line-height: 1.4;
        margin-top: 4px;
    }

    /* 5. the sheet hugs the screen */
    body .szb-sheet {
        margin: 0 6px 16px 6px;
        padding: 12px 10px;
        border-radius: 8px;
    }
    body.szb-attend::before { width: 320px; height: 320px; right: -80px; bottom: -90px; }

    /* 6. popups and summary fit the viewport */
    body .szb-pop {
        max-width: 94vw;
        width: auto !important;
        overflow-x: auto;
    }
    body .szb-summary { width: auto !important; max-width: 420px; }

    /* 7. login card breathing room on small screens */
    body .szb-login-wrap { margin-top: 3vh; }
    body .szb-card { padding: 22px 18px 20px 18px; }
}
