/* ========================================================= */
/* SRMS Modern Design System & Stylesheet                    */
/* ========================================================= */

:root {
    --navy: #0f172a;
    --navy-2: #1e293b;
    --navy-light: #334155;
    --accent: #2563eb;
    --accent-dark: #1d4ed8;
    --accent-light: #eff6ff;
    --accent-ring: rgba(37, 99, 235, 0.16);
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --border-subtle: #f1f5f9;
    --text: #0f172a;
    --text-muted: #64748b;
    --muted: #64748b;
    --green: #15803d;
    --green-dark: #166534;
    --green-bg: #dcfce7;
    --green-border: #bbf7d0;
    --gray-bg: #f1f5f9;
    --gray-border: #e2e8f0;
    --red: #b91c1c;
    --red-bg: #fee2e2;
    --red-border: #fca5a5;
    --amber: #b45309;
    --amber-bg: #fef3c7;
    --amber-border: #fde68a;
    --purple: #7e22ce;
    --purple-bg: #f3e8ff;
    --purple-border: #e9d5ff;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.05), transparent 30%), var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s ease;
}
a:hover {
    color: var(--accent-dark);
    text-decoration: underline;
}

/* ---------- Layout Structure ---------- */
.shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: linear-gradient(180deg, #0d213b 0%, #102a47 60%, #0b1d34 100%);
    color: #cbd5e1;
    padding: 16px 0 24px;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 100;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 4px 0 20px rgba(15, 23, 42, 0.12);
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.sidebar .brand {
    align-items: center;
    color: #fff;
    display: flex;
    font-size: 14px;
    font-weight: 700;
    gap: 10px;
    padding: 0 18px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 10px;
}

.sidebar .brand-logo {
    display: block;
    flex: 0 0 36px;
    height: 36px;
    max-width: 36px;
    object-fit: contain;
    border-radius: 6px;
}

.sidebar .brand-name {
    min-width: 0;
    overflow-wrap: anywhere;
}
.sidebar .brand-name span {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: #94a3b8;
    margin-top: 2px;
}

.nav-group {
    font-size: 10.5px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    padding: 14px 18px 5px;
    margin-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.nav-group:first-of-type {
    border-top: none;
    margin-top: 0;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8.5px 12px;
    margin: 2px 10px;
    color: #cbd5e1;
    font-size: 13.5px;
    font-weight: 500;
    border-radius: 7px;
    border-left: 3px solid transparent;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.sidebar nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
    color: #ffffff;
    transform: translateX(2px);
}
.sidebar nav a.active {
    background: #2563eb;
    color: #ffffff;
    font-weight: 600;
    border-left-color: #93c5fd;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}
.sidebar nav a .nav-icon {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    opacity: 0.8;
}
.sidebar nav a:hover .nav-icon,
.sidebar nav a.active .nav-icon {
    opacity: 1;
}

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin-left: 250px;
}

/* ---------- Topbar ---------- */
.topbar {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    padding: 14px 28px;
    min-height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.topbar-title {
    font-size: 18px;
    font-weight: 750;
    color: #0f172a;
    letter-spacing: -0.02em;
}
.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13.5px;
    color: var(--muted);
}
.badge {
    display: inline-flex;
    align-items: center;
    background: #eff6ff;
    color: var(--accent);
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    border: 1px solid #bfdbfe;
}
.logout {
    color: var(--red);
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s ease;
}
.logout:hover {
    background: var(--red-bg);
    text-decoration: none;
}

.content {
    padding: 24px 30px;
    max-width: 100%;
    box-sizing: border-box;
}

/* ---------- Freeze Bar (Sticky Live Stats) ---------- */
.freeze-bar {
    position: sticky;
    top: 0;
    z-index: 200;
    display: flex;
    background: linear-gradient(120deg, #0f172a 0%, #1e293b 55%, #1e3a8a 100%);
    box-shadow: 0 4px 16px rgba(8, 15, 30, 0.3);
    border-bottom: 3px solid var(--accent);
}
.freeze-bar-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 12px 20px;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    position: relative;
    transition: background 0.15s ease;
}
.freeze-bar-item:hover {
    background: rgba(255, 255, 255, 0.05);
}
.freeze-bar-item:last-child {
    border-right: none;
}
.freeze-bar-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.2);
    color: #60a5fa;
}
.freeze-bar-icon svg {
    width: 20px;
    height: 20px;
}
.freeze-bar-item:nth-child(2) .freeze-bar-icon {
    background: rgba(180, 83, 9, 0.22);
    color: #fbbf24;
}
.freeze-bar-content {
    text-align: left;
}
.freeze-bar-value {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
    letter-spacing: -0.01em;
}
.freeze-bar-label {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}
.freeze-bar-today .freeze-bar-icon {
    background: rgba(5, 150, 105, 0.22);
    color: #34d399;
}
.freeze-bar-today .freeze-bar-value {
    color: #34d399;
}
.freeze-bar-today::after {
    content: '';
    position: absolute;
    top: 12px;
    right: 16px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    animation: freezePulse 2s infinite;
}
@keyframes freezePulse {
    0%   { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
    70%  { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* ---------- Cards / Stats Grid ---------- */
.cards, .metrics-subbar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.stat-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.stat-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.stat-value {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
    letter-spacing: -0.02em;
}
.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ---------- Panels ---------- */
.panel {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 22px 26px;
    margin-bottom: 22px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s ease;
}
.panel:hover {
    box-shadow: var(--shadow-md);
}
.panel.narrow {
    max-width: 580px;
}
.panel h2 {
    margin: 0 0 16px;
    font-size: 16.5px;
    font-weight: 750;
    color: #0f172a;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 10px;
    letter-spacing: -0.015em;
}
.panel h2:not(:first-child) {
    margin-top: 24px;
}
.panel-actions {
    margin-bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.hint {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
    margin-top: 0;
}

/* ---------- Forms & Inputs ---------- */
label {
    display: block;
    font-size: 13px;
    font-weight: 650;
    margin: 14px 0 6px;
    color: #1e293b;
}
input[type=text],
input[type=email],
input[type=password],
input[type=number],
input[type=date],
input[type=tel],
input[type=file],
select,
textarea {
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    font-size: 13.5px;
    font-family: inherit;
    background: #ffffff;
    color: #0f172a;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
    background: #ffffff;
}
input[type=file] {
    cursor: pointer;
    padding: 6px 10px;
}
input[type=file]::file-selector-button {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    color: #1d4ed8;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    margin-right: 10px;
    padding: 5px 10px;
}
.form-actions {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ---------- Buttons ---------- */
.btn, button.btn, a.btn, .row-actions > a.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    color: #ffffff !important;
    border: 1px solid #1d4ed8 !important;
    padding: 8px 16px;
    border-radius: 7px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none !important;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
    transition: all 0.15s ease;
    line-height: 1.4;
}
.btn:hover, button.btn:hover, a.btn:hover, .row-actions > a.btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af) !important;
    border-color: #1e40af !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
    text-decoration: none !important;
}
.btn-secondary, button.btn-secondary, a.btn-secondary, .row-actions > a.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #ffffff !important;
    color: #334155 !important;
    border: 1px solid #cbd5e1 !important;
    padding: 8px 16px;
    border-radius: 7px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: all 0.15s ease;
    line-height: 1.4;
}
.btn-secondary:hover, button.btn-secondary:hover, a.btn-secondary:hover, .row-actions > a.btn-secondary:hover {
    background: #f8fafc !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06);
    text-decoration: none !important;
}
.action-btn, .row-actions > a:not(.btn):not(.btn-secondary):not(.btn-danger), .row-actions .link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #2563eb;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    line-height: 1.3;
}
.action-btn:hover, .row-actions > a:not(.btn):not(.btn-secondary):not(.btn-danger):hover, .row-actions .link-btn:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.12);
    text-decoration: none;
}
.action-btn.action-danger {
    border-color: #fca5a5;
    color: #b91c1c;
}
.action-btn.action-danger:hover {
    background: #fee2e2;
    border-color: #f87171;
    color: #991b1b;
}
.link-btn {
    background: none;
    border: none;
    padding: 0;
    color: var(--accent);
    font-size: 13.5px;
    cursor: pointer;
    text-decoration: underline;
    font-family: inherit;
    font-weight: 600;
}

/* ---------- Flash Messages ---------- */
.flashes {
    margin-bottom: 20px;
}
.flash {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 10px;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.flash-success {
    background: var(--green-bg);
    color: var(--green-dark);
    border-color: var(--green-border);
}
.flash-error {
    background: var(--red-bg);
    color: var(--red);
    border-color: var(--red-border);
}
.flash-warning {
    background: var(--amber-bg);
    color: var(--amber);
    border-color: var(--amber-border);
}

/* ---------- Filter Bars ---------- */
.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 16px;
}
.filter-bar input[type=text] {
    width: 260px;
}
.filter-bar select {
    width: auto;
}

/* ---------- Tables & Zebra Striping (Alternate Row Colors) ---------- */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #ffffff;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}
.table-scroll table {
    min-width: 880px;
    margin: 0;
    border: none;
    border-radius: 0;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13.5px;
    text-align: left;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

th {
    background: #f1f5f9;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 13px 14px;
    border-bottom: 2px solid #cbd5e1;
    border-top: none;
    white-space: nowrap;
    vertical-align: middle;
}
th a {
    color: #334155;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
th a:hover {
    color: #2563eb;
    text-decoration: none;
}

td {
    padding: 12px 14px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
    color: #1e293b;
    line-height: 1.45;
}

/* Alternating Row Zebra Striping */
table tbody tr:nth-child(even) {
    background-color: #f8fafc;
}
table tbody tr:nth-child(odd) {
    background-color: #ffffff;
}
table tbody tr {
    transition: background-color 0.15s ease-in-out;
}
table tbody tr:hover {
    background-color: #f0f7ff !important;
}

/* Edge cell borders and radius */
table tbody tr:last-child td {
    border-bottom: none;
}

.empty {
    color: var(--muted);
    text-align: center;
    padding: 32px 20px;
    font-size: 14px;
}
.mono {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 12px;
    color: #475569;
    max-width: 220px;
    overflow-wrap: anywhere;
    white-space: normal;
}
.row-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    white-space: nowrap;
}
.inline-form {
    display: inline;
}

/* Status-specific row tinting (blends nicely with zebra striping) */
.row-status-reported {
    background-color: #f0fdf4 !important;
}
.row-status-reported:hover {
    background-color: #dcfce7 !important;
}
.row-status-admitted {
    background-color: #fffbeb !important;
}
.row-status-admitted:hover {
    background-color: #fef3c7 !important;
}
.row-status-danger {
    background-color: #fef2f2 !important;
}
.row-status-danger:hover {
    background-color: #fee2e2 !important;
}

/* ---------- Tags & Badges ---------- */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #eef2ff;
    color: var(--accent-dark);
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.3;
    border: 1px solid #c7d2fe;
    white-space: nowrap;
}
.tag-green {
    background: var(--green-bg);
    color: var(--green);
    border-color: var(--green-border);
}
.tag-blue {
    background: #dbeafe;
    color: #1d4ed8;
    border-color: #bfdbfe;
}
.tag-gray {
    background: var(--gray-bg);
    color: #475569;
    border-color: var(--gray-border);
}
.tag-amber {
    background: var(--amber-bg);
    color: var(--amber);
    border-color: var(--amber-border);
}
.tag-red {
    background: var(--red-bg);
    color: var(--red);
    border-color: var(--red-border);
}
.tag-purple {
    background: var(--purple-bg);
    color: var(--purple);
    border-color: var(--purple-border);
}

/* ---------- Typeahead Search Dropdown ---------- */
.typeahead-wrap {
    position: relative;
    width: 100%;
}
.typeahead-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    min-width: 260px;
    max-height: 280px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
    box-sizing: border-box;
}
.typeahead-dropdown.open {
    display: block;
}
.typeahead-item {
    padding: 9px 12px;
    font-size: 13px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    transition: background 0.12s ease;
}
.typeahead-item:last-child {
    border-bottom: none;
}
.typeahead-item:hover, .typeahead-item.active {
    background: var(--accent);
    color: #ffffff;
}
.typeahead-item:hover .badge, .typeahead-item.active .badge {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: transparent !important;
}
.typeahead-empty {
    padding: 10px 12px;
    font-size: 12px;
    color: var(--muted);
}
.search-clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 18px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
}
.search-clear-btn:hover {
    color: #ef4444;
}

/* Autocomplete (Student Master) */
.autocomplete {
    position: relative;
}
.autocomplete-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 50;
    width: 340px;
    max-height: 280px;
    overflow-y: auto;
    margin: 0;
    padding: 4px;
    list-style: none;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
}
.autocomplete-list li {
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    line-height: 1.35;
    transition: background 0.12s ease;
}
.autocomplete-list li:hover {
    background: #f1f5f9;
}
.autocomplete-list li .ac-name {
    font-weight: 600;
    color: #0f172a;
}
.autocomplete-list li .ac-meta {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

/* ---------- Tabs Component ---------- */
.tab-bar {
    display: flex;
    gap: 6px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 18px;
}
.tab-btn {
    appearance: none;
    border: none;
    background: none;
    cursor: pointer;
    padding: 10px 16px;
    font-size: 13.5px;
    font-weight: 650;
    color: var(--muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s ease;
}
.tab-btn:hover {
    color: var(--navy);
}
.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.tab-panel {
    display: none;
}
.tab-panel.active {
    display: block;
}

/* Day Pills & Subbar */
.counter-subbar {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 22px;
    margin-bottom: 22px;
    box-shadow: var(--shadow-sm);
}
.counter-day-tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
    margin-bottom: 16px;
    scrollbar-width: thin;
}
.day-tab-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s ease;
}
.day-tab-pill:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
    text-decoration: none;
    transform: translateY(-1px);
}
.day-tab-pill.active {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: #ffffff;
    border-color: #1d4ed8;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}
.day-tab-pill .pill-badge {
    background: rgba(0, 0, 0, 0.08);
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 11px;
}
.day-tab-pill.active .pill-badge {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

.counter-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}
.counter-stat-box {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
}
.counter-stat-box.highlight {
    background: #eff6ff;
    border-color: #bfdbfe;
}
.counter-stat-box.success {
    background: #f0fdf4;
    border-color: #bbf7d0;
}
.counter-stat-num {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
}
.counter-stat-num.blue { color: #2563eb; }
.counter-stat-num.green { color: #16a34a; }
.counter-stat-num.amber { color: #d97706; }
.counter-stat-lbl {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-top: 4px;
}

/* ---------- Duty & Room Planning ---------- */
.room-selector {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin: 16px 0;
    padding: 16px;
}
.room-selector legend {
    font-weight: 700;
    padding: 0 6px;
    color: #0f172a;
}
.room-checkboxes {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.room-checkbox {
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    display: flex;
    gap: 8px;
    min-height: 44px;
    padding: 8px 12px;
    transition: all 0.15s ease;
}
.room-checkbox:hover {
    background: #f8fafc;
    border-color: var(--accent);
}
.room-checkbox:has(input:checked) {
    background: #eff6ff;
    border-color: #60a5fa;
    box-shadow: 0 2px 7px rgba(37, 99, 235, 0.12);
}
.room-checkbox input {
    height: 17px;
    margin: 0;
    width: 17px;
}
.duty-assignment-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.duty-date-banner {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.duty-date-banner strong {
    color: var(--navy);
    font-size: 20px;
}

.checkbox-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    padding: 14px;
    max-height: 280px;
    overflow-y: auto;
}
.checkbox-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    font-size: 13.5px;
    margin: 0;
    cursor: pointer;
}
.checkbox-list input[type=checkbox] {
    width: auto;
}
.checkbox-list label.hidden-option {
    display: none;
}

.room-radio-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 8px;
}
.room-radio-card:hover {
    border-color: #3b82f6;
    background: #f8fafc;
}
.room-radio-card:has(input:checked) {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.12);
}
.room-radio-card input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

/* ---------- Student Detail View Layout ---------- */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 24px;
}
.detail-block {
    min-width: 0;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 20px;
    box-shadow: var(--shadow-sm);
}
.detail-block.full {
    grid-column: 1 / -1;
}
.detail-block h2 {
    margin: 0 0 10px !important;
    padding-bottom: 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--navy);
    border-bottom: 1px solid var(--border);
}
.detail-block table {
    border: none;
    box-shadow: none;
}
.detail-grid table td, .detail-grid table th {
    padding: 8px 10px;
    font-size: 13.5px;
}
.detail-block table td:first-child {
    color: var(--muted);
    white-space: nowrap;
}

/* ---------- Modal Popup ---------- */
.srms-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.srms-modal.open {
    display: flex;
}
.srms-modal-dialog {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    max-width: 680px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px 28px;
    position: relative;
    animation: modalIn 0.2s ease-out;
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.srms-modal-close {
    position: absolute;
    top: 18px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    font-weight: 700;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}
.srms-modal-close:hover {
    color: #0f172a;
}

/* ---------- Pagination Navigation ---------- */
nav[role="navigation"] {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 0 8px;
    margin-top: 16px;
    border-top: 1px solid #e2e8f0;
}
nav[role="navigation"] svg,
.w-5, .h-5,
svg.w-5, svg.h-5 {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    display: inline-block !important;
    vertical-align: middle;
}
nav[role="navigation"] > div {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
nav[role="navigation"] p {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}
nav[role="navigation"] a,
nav[role="navigation"] span.relative,
.pagination li a,
.pagination li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    text-decoration: none;
    line-height: 1.2;
    transition: all 0.15s ease;
}
nav[role="navigation"] a:hover {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1d4ed8;
}
nav[role="navigation"] span[aria-current="page"] > span,
nav[role="navigation"] span[aria-current="page"] {
    background: #2563eb !important;
    color: #ffffff !important;
    border-color: #2563eb !important;
}
nav[role="navigation"] span[aria-disabled="true"] {
    color: #94a3b8 !important;
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    cursor: not-allowed;
}

/* ---------- Login Screen ---------- */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--navy), #16304f);
}
.login-card {
    background: #ffffff;
    padding: 38px 36px;
    border-radius: 14px;
    width: 360px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
}
.login-card h1 {
    margin: 0 0 4px;
    color: var(--navy);
    font-size: 26px;
}
.login-card .subtitle {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 13px;
}
.login-card button {
    width: 100%;
    margin-top: 20px;
    padding: 11px;
}

/* ---------- Registration Form (Student Portal + Faculty Review) ---------- */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
}
.form-grid > div { min-width: 0; }
@media (max-width: 720px) {
    .form-grid { grid-template-columns: 1fr; }
}

.radio-group { display: flex; flex-wrap: wrap; gap: 16px; margin: 6px 0 4px; }
.radio-inline { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 400; margin: 0; }
.radio-inline input[type=radio], .radio-inline input[type=checkbox] { width: auto; }

.declaration-box {
    margin-top: 22px;
    padding: 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
}

.status-badge-lg { font-size: 14px; padding: 6px 14px; }

/* ---------- Media Queries ---------- */
@media (max-width: 900px) {
    .sidebar { width: 220px; }
    .main { margin-left: 220px; }
    .content { padding: 20px; }
    .topbar { padding: 14px 20px; }
}
@media (max-width: 680px) {
    .shell { display: block; }
    .sidebar { position: static; width: 100%; max-height: 260px; }
    .main { margin-left: 0; }
    .content { padding: 16px; }
    .topbar { align-items: flex-start; flex-direction: column; gap: 10px; }
    .panel { border-radius: 10px; padding: 16px; }
    .filter-bar input[type=text], .filter-bar select { width: 100%; }
    .form-actions { align-items: stretch; flex-direction: column; }
    .form-actions .btn, .form-actions .btn-secondary { width: 100%; }
    .duty-assignment-grid { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .freeze-bar { flex-direction: column; }
    .freeze-bar-item { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.12); justify-content: flex-start; }
    .freeze-bar-item:last-child { border-bottom: none; }
}
