/* ============================================================
   Abokrat Institute of Paramedical Studies - Design System
   Ported from the original Flutter app (app_colors.dart)
   ============================================================ */
:root {
    --primary:            #366B59;
    --primary-light:      #F9FFFC;
    --primary-dark:       #265747;

    --dash-green:         #003B1B;
    --dash-green-light:   #1A4F32;
    --beige:              #FDF6E9;
    --orange:            #F8892A;
    --blue:              #3D70EC;
    --green-accent:      #10AB7D;
    --purple:            #8E44AD;

    --text-dark:         #003B1B;
    --text-gray:         #888484;
    --heading:           #1F2937;
    --subtitle:          #6B7280;

    --border:            #E5E7EB;
    --table-even:        #F9FAFB;
    --bg:                #FAFAFA;

    --success:           #34C759;
    --error:             #EF4444;
    --warning:           #FF9500;

    --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,.10);
    --shadow-lg: 0 0 40px 5px rgba(0,0,0,.25);
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
    margin: 0;
    font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: #1a1a1a;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;             /* no horizontal page scroll */
}
img { max-width: 100%; }
.app-shell, .main-area, .content { max-width: 100%; min-width: 0; }
.card-abk { max-width: 100%; }

a { text-decoration: none; }

.font-montserrat { font-family: 'Montserrat', sans-serif; }

/* =========================================================
   LOGIN / AUTH
   ========================================================= */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    padding: 24px;
}

.auth-card {
    display: flex;
    width: 100%;
    max-width: 1200px;
    min-height: 560px;
    border-radius: 15px;
    overflow: hidden;
    background: var(--primary-light);
    box-shadow: var(--shadow-lg);
}
@media (max-width: 860px) {
    .auth-card { flex-direction: column; min-height: auto; max-width: 460px; }
    .auth-brand { padding: 32px 24px; }
    .auth-brand img { width: 150px; }
    .auth-brand h1 { font-size: 40px; }
    .auth-form-panel { padding: 32px 24px; }
}

.auth-brand {
    flex: 1;
    background: var(--primary);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 32px;
}

.auth-brand img { width: 230px; max-width: 70%; height: auto; margin-bottom: 24px; }
.auth-brand h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 52px;
    font-weight: 700;
    margin: 0 0 12px;
    line-height: 1.2;
}
.auth-brand .subtitle { font-size: 16px; font-weight: 500; margin: 0 0 40px; }
.auth-brand .tagline  { font-size: 13px; font-weight: 500; opacity: .85; }

.auth-form-panel {
    flex: 1;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px 48px;
}
.auth-form { width: 100%; max-width: 440px; }
.auth-form h2 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 30px;
    color: var(--heading);
    text-align: center;
    margin: 0 0 6px;
}
.auth-form .lead {
    text-align: center;
    color: var(--subtitle);
    font-size: 16px;
    margin: 0 0 36px;
}

.field-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.field-wrap { position: relative; margin-bottom: 20px; }
.field-wrap .field-icon {
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    width: 18px; height: 18px;
    opacity: .55;
    pointer-events: none;
}
.abk-input, .abk-select {
    width: 100%;
    height: 46px;
    border: 1px solid #d6ddda;
    border-radius: 9px;
    padding: 0 14px 0 42px;
    font-size: 14px;
    color: #1f2937;
    background: #fff;
    outline: none;
    box-shadow: 0 1px 2px rgba(16,24,40,.04);
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.abk-input::placeholder, textarea::placeholder { color: #9aa4a0; }
.abk-input:hover, .abk-select:hover { border-color: #b7c2bd; }
.abk-input:focus, .abk-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(54,107,89,.16); }
.abk-input:disabled, .abk-select:disabled, textarea:disabled,
fieldset:disabled .abk-input, fieldset:disabled .abk-select, fieldset:disabled textarea {
    background: #f2f4f3; color: #6b7280; cursor: not-allowed; box-shadow: none;
}
.abk-select {
    appearance: none; -webkit-appearance: none; cursor: pointer;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23366B59' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px;
}
/* rounded toolbar selects get the same caret (selects only, not pill buttons) */
select.pill-select {
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23366B59' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px;
}
.field-wrap .caret {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
    color: #9CA3AF; pointer-events: none;
}
.pw-toggle {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; color: #9CA3AF; padding: 4px;
}

.forgot-row { text-align: right; margin: -6px 0 16px; }
.forgot-row a { color: var(--primary); font-weight: 600; font-size: 14px; }

.remember-row { display: flex; align-items: center; gap: 8px; margin-bottom: 28px; color: #555; font-size: 14px; }
.remember-row input { width: 16px; height: 16px; accent-color: var(--primary); }

.btn-abk {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .5px;
    cursor: pointer;
    transition: background .15s;
}
.btn-abk:hover { background: var(--primary-dark); }
.btn-abk:disabled { opacity: .7; cursor: default; }

.signup-row { text-align: center; margin-top: 28px; color: #555; font-size: 14px; }
.signup-row a { color: var(--primary); font-weight: 700; text-decoration: underline; }

.auth-error {
    background: #FFE5E5;
    border: 1px solid var(--error);
    color: var(--error);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 13px;
    margin-bottom: 20px;
}
.field-validation-error, .text-danger { color: var(--error); font-size: 12.5px; }
.otp-input { text-align: center; letter-spacing: 12px; font-size: 22px; font-weight: 700; padding-left: 14px; }
/* required-field asterisk + locked/read-only field styling */
.req { color: #dc2626; font-weight: 700; }
.fee-locked { background-color: #f2f4f3 !important; color: #6b7280; cursor: not-allowed; }
.fee-note { background: #fdf6e9; border: 1px solid #f0e2c4; color: #8a6d3b; border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; font-size: 13.5px; }

/* =========================================================
   APP SHELL (sidebar + topbar)
   ========================================================= */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 260px;
    background: var(--dash-green);
    color: #fff;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.sidebar-brand {
    display: flex; align-items: center; gap: 12px;
    padding: 22px 20px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700; font-size: 24px;
}
.sidebar-brand .logo-badge {
    width: 40px; height: 40px; border-radius: 10px;
    background: #fff; color: var(--dash-green);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 22px;
}
.sidebar-section {
    padding: 16px 20px 6px;
    font-size: 11px; font-weight: 600; letter-spacing: 1px;
    color: rgba(255,255,255,.5); text-transform: uppercase;
}
.nav-list { list-style: none; margin: 0; padding: 0 12px; }
.nav-list li { margin: 2px 0; }
.nav-link-abk {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; border-radius: 8px;
    color: rgba(255,255,255,.85); font-size: 14px; font-weight: 500;
    transition: background .15s, color .15s;
}
.nav-link-abk:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-link-abk.active { background: var(--beige); color: var(--dash-green); font-weight: 600; }
.nav-link-abk svg, .nav-link-abk .ico { width: 18px; height: 18px; flex-shrink: 0; }

.main-area { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--beige); }

.topbar {
    height: 72px; background: #fff;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 28px; box-shadow: var(--shadow-sm);
    position: sticky; top: 0; z-index: 10;
}
.topbar .page-title { font-weight: 700; font-size: 20px; color: var(--primary); }
.topbar .page-sub { font-size: 12px; color: var(--text-gray); }
.topbar-right { display: flex; align-items: center; gap: 20px; }
.lang-select { border: 1px solid var(--border); border-radius: 999px; padding: 7px 12px; font-size: 13px; font-weight: 600; color: var(--primary); background: #fff; cursor: pointer; font-family: inherit; }
/* Right-to-left (Arabic) */
[dir="rtl"] .submenu, [dir="rtl"] .nav-list { text-align: right; }
[dir="rtl"] .sidebar-brand .collapse-btn { transform: scaleX(-1); }
.topbar .bell { position: relative; color: #333; }
.topbar .bell .dot {
    position: absolute; top: -4px; right: -4px;
    background: var(--error); color: #fff; font-size: 10px;
    border-radius: 999px; padding: 0 5px; line-height: 16px;
}
.topbar .user-chip { display: flex; align-items: center; gap: 8px; font-weight: 600; color: #333; }
.topbar .avatar {
    width: 40px; height: 40px; border-radius: 999px;
    background: var(--primary); color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 700;
}

.content { padding: 28px; }
.page-heading { font-size: 30px; font-weight: 600; color: var(--dash-green); margin: 0 0 20px; }

/* =========================================================
   DASHBOARD CARDS
   ========================================================= */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1300px){ .stat-cards { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 700px){ .stat-cards { grid-template-columns: 1fr; } }

.stat-card {
    border-radius: 12px; color: #fff; box-shadow: var(--shadow-md);
    display: flex; flex-direction: column; overflow: hidden;
}
.stat-card .body { padding: 16px 16px 12px; flex: 1; }
.stat-card .head { display: flex; justify-content: space-between; align-items: flex-start; }
.stat-card .title { font-size: 20px; font-weight: 700; }
.stat-card .badge-pill {
    font-size: 10px; font-weight: 500; padding: 3px 10px;
    border: 1px solid rgba(255,255,255,.5); border-radius: 20px; background: rgba(255,255,255,.2);
}
.stat-card .desc { font-size: 9px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; opacity: .9; margin: 12px 0 16px; line-height: 1.5; }
.stat-card .stats { display: flex; justify-content: space-between; align-items: flex-end; font-size: 13px; font-weight: 500; }
.stat-card .stats .big { font-size: 24px; font-weight: 700; }
.stat-card .foot {
    border-top: 1px solid rgba(255,255,255,.15);
    padding: 12px; text-align: center;
    font-size: 11px; font-weight: 700; letter-spacing: 1px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    cursor: pointer;
}
.grad-green  { background: linear-gradient(135deg, #10AB7D, #0D8C66); }
.grad-blue   { background: linear-gradient(135deg, #3D70EC, #2E54B1); }
.grad-orange { background: linear-gradient(135deg, #F8892A, #D96D12); }
.grad-dark   { background: linear-gradient(135deg, #003B1B, #002210); }

.section-title { font-size: 24px; font-weight: 600; color: var(--dash-green); margin: 24px 0 16px; }

/* Big-number stat cards (Student / Teacher dashboards) */
.num-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 8px; }
@media (max-width: 1300px){ .num-cards { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 700px){ .num-cards { grid-template-columns: 1fr; } }
.num-card { border-radius: 14px; color: #fff; box-shadow: var(--shadow-md); display: flex; flex-direction: column; min-height: 150px; }
.num-card .num-body { padding: 22px 22px 16px; flex: 1; }
.num-card .big-num { font-size: 42px; font-weight: 800; line-height: 1; margin-bottom: 12px; }
.num-card .num-label { font-size: 15px; font-weight: 600; opacity: .96; }
.num-card .num-foot { border-top: 1px solid rgba(255,255,255,.22); padding: 12px 22px; font-size: 12px; font-weight: 700; letter-spacing: 1px; display: flex; align-items: center; justify-content: space-between; }
.num-card .num-foot a { color: #fff; }

/* page header with action button on the right */
.page-head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.btn-dark-abk { background: var(--dash-green); color: #fff; border: none; border-radius: 999px; padding: 12px 22px; font-weight: 600; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.btn-dark-abk:hover { background: #002a14; color: #fff; }

/* list toolbar with Show / search / filters */
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.list-toolbar .left, .list-toolbar .right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pill-select { height: 42px; border: 1px solid var(--border); border-radius: 999px; padding: 0 16px; background-color: #fff; font-size: 14px; color: #333; outline: none; cursor: pointer; }
/* Only real dropdowns (not pill buttons like "Search") get the chevron caret. */
select.pill-select {
    appearance: none; -webkit-appearance: none; padding: 0 38px 0 16px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23366B59' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat; background-position: right 14px center;
}
.pill-input { height: 42px; border: 1px solid var(--border); border-radius: 999px; padding: 0 16px; background: #fff; font-size: 14px; outline: none; min-width: 220px; }
.pill-input, .pill-select { transition: border-color .15s, box-shadow .15s; }
.pill-input:hover, .pill-select:hover { border-color: #b7c2bd; }
.pill-input:focus, .pill-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(54,107,89,.15); }

/* ---- Safety net: any un-classed text control inside app content ---- */
.content input[type=text]:not(.abk-input):not(.pill-input),
.content input[type=email]:not(.abk-input):not(.pill-input),
.content input[type=number]:not(.abk-input):not(.pill-input),
.content input[type=date]:not(.abk-input):not(.pill-input),
.content input[type=tel]:not(.abk-input):not(.pill-input),
.content input[type=search]:not(.abk-input):not(.pill-input),
.content input[type=password]:not(.abk-input):not(.pill-input),
.content input[type=url]:not(.abk-input):not(.pill-input),
.content input:not([type]):not(.abk-input):not(.pill-input),
.content select:not(.abk-select):not(.pill-select) {
    height: 46px; border: 1px solid #d6ddda; border-radius: 9px; padding: 0 38px 0 14px;
    font-family: inherit; font-size: 14px; color: #1f2937; outline: none;
    appearance: none; -webkit-appearance: none; cursor: pointer;
    background-color: #fff;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23366B59' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat; background-position: right 12px center;
    box-shadow: 0 1px 2px rgba(16,24,40,.04); transition: border-color .15s, box-shadow .15s;
}
.content input[type=text]:not(.abk-input):not(.pill-input):focus,
.content input[type=email]:not(.abk-input):not(.pill-input):focus,
.content input[type=number]:not(.abk-input):not(.pill-input):focus,
.content input[type=date]:not(.abk-input):not(.pill-input):focus,
.content input[type=password]:not(.abk-input):not(.pill-input):focus,
.content input:not([type]):not(.abk-input):not(.pill-input):focus,
.content select:not(.abk-select):not(.pill-select):focus {
    border-color: var(--primary); box-shadow: 0 0 0 3px rgba(54,107,89,.16);
}
.show-label { font-size: 13px; font-weight: 600; color: var(--text-gray); letter-spacing: .5px; }

/* action icon buttons */
.icon-actions { display: inline-flex; gap: 8px; }
.icon-btn { width: 34px; height: 34px; border-radius: 8px; border: none; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 15px; }
.icon-view { background: #E8F0FE; color: #3D70EC; }
.icon-edit { background: #FFF2E5; color: #F8892A; }
.icon-del  { background: #FDECEC; color: #EF4444; }
.icon-fee  { background: #FBF3DA; color: #B5891F; }
.icon-print { background: #EAF0FB; color: #2f6b4f; }
.icon-print { background: #EDE7F6; color: #7E57C2; }
.icon-btn:hover { filter: brightness(0.95); }

.status-onduty  { background: #D1EDDA; color: #157347; }
.status-onleave { background: #F8D7DA; color: #b02a37; }
.sub-id { font-size: 12px; color: var(--text-gray); margin-top: 2px; }

/* =========================================================
   STEPPED REGISTRATION FORMS
   ========================================================= */
.reg-sub { color: var(--text-gray); font-size: 15px; margin: -12px 0 22px; }
.step { padding: 4px 0 26px; border-bottom: 1px solid var(--border); margin-bottom: 26px; }
.step:last-of-type { border-bottom: none; }
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.step-badge { width: 30px; height: 30px; border-radius: 7px; background: var(--dash-green); color: #fff; font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.step-badge.check::after { content: "✓"; }
.step-title { font-weight: 700; font-size: 16px; color: #1a1a1a; letter-spacing: .3px; }
.step-title .muted { color: var(--text-gray); font-weight: 600; }

.reg-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px 28px; }
.reg-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px 28px; }
.reg-grid-2 .full, .reg-grid-3 .full { grid-column: 1 / -1; }
@media (max-width: 1000px){ .reg-grid-3 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 680px){ .reg-grid-2, .reg-grid-3 { grid-template-columns: 1fr; } }
.reg-field label { display: block; font-size: 12px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: #4b5563; margin-bottom: 8px; }
/* NOTE: use background-color (not the `background` shorthand) — the shorthand would
   reset background-image and wipe the .abk-select dropdown caret. */
.reg-field .abk-input, .reg-field .abk-select, .reg-field textarea { padding-left: 14px; width: 100%; background-color: #fff; }

/* upload box */
.upload-box { border: 1.5px dashed #9db8f0; background: #f4f8ff; border-radius: 10px; padding: 18px; display: flex; align-items: center; gap: 18px; max-width: 420px; cursor: pointer; }
.upload-box .thumb { width: 74px; height: 74px; border-radius: 8px; background: #e3ecfb; display: flex; align-items: center; justify-content: center; font-size: 26px; color: #6b8fd6; overflow: hidden; }
.upload-box .thumb img { width: 100%; height: 100%; object-fit: cover; }
.upload-box .up-title { color: #2f5fc7; font-weight: 700; font-size: 15px; }
.upload-box .up-sub { color: var(--text-gray); font-size: 12px; letter-spacing: .5px; text-transform: uppercase; margin-top: 2px; }
.upload-box input[type=file] { display: none; }

.reg-footer { display: flex; justify-content: flex-end; gap: 14px; margin-top: 8px; }
.btn-pill-dark { background: var(--dash-green); color: #fff; border: none; border-radius: 999px; padding: 13px 30px; font-weight: 700; font-size: 14px; cursor: pointer; }
.btn-pill-dark:hover { background: #002a14; color: #fff; }
.btn-pill-muted { background: #d6d3cb; color: #7a766c; border: none; border-radius: 999px; padding: 13px 30px; font-weight: 700; font-size: 14px; cursor: pointer; }

/* =========================================================
   FINANCE SUMMARY CARDS (Other Income / Total Expenses)
   ========================================================= */
.fin-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; margin-bottom: 26px; }
.fin-cards.g5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1300px){ .fin-cards, .fin-cards.g5 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 700px){ .fin-cards, .fin-cards.g5 { grid-template-columns: 1fr; } }
.fin-card { border-radius: 14px; padding: 22px; min-height: 150px; display: flex; flex-direction: column; }
.fin-card .fin-icon { width: 46px; height: 46px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 18px; }
.fin-card .fin-label { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.fin-card .fin-value { font-size: 30px; font-weight: 800; line-height: 1; }
.fin-card .fin-value .cur { font-size: 14px; font-weight: 600; margin-left: 4px; }
.fin-card .fin-note { font-size: 12px; margin-top: 8px; opacity: .8; font-style: italic; }

.fin-green  { background: #5f9d78; color: #fff; }
.fin-green  .fin-icon { background: rgba(255,255,255,.22); }
.fin-grey   { background: #e9eaec; color: #374151; }
.fin-grey   .fin-icon { background: #3d70ec; color: #fff; }
.fin-grey   .fin-value { color: #3d70ec; }
.fin-lgreen { background: #e6f0ea; color: #2f6b4f; }
.fin-lgreen .fin-icon { background: #cfe6d8; color: #2f6b4f; }
.fin-peach  { background: #f7e7e2; color: #b45a43; }
.fin-peach  .fin-icon { background: #e8a08c; color: #fff; }

/* recent transactions log list */
.txn-log { }
.txn-row { display: flex; align-items: center; justify-content: space-between; padding: 16px 6px; border-bottom: 1px solid var(--border); }
.txn-row:last-child { border-bottom: none; }
.txn-left { display: flex; align-items: flex-start; gap: 12px; }
.txn-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green-accent); margin-top: 6px; flex-shrink: 0; }
.txn-name { font-weight: 700; color: #1a1a1a; }
.txn-meta { font-size: 12.5px; color: var(--text-gray); }
.txn-right { text-align: right; }
.txn-amt { font-weight: 700; color: var(--green-accent); }
.txn-ref { display: inline-block; margin-top: 6px; font-size: 11px; color: #2f6b4f; background: #e6f0ea; border-radius: 6px; padding: 2px 8px; }
.grand-row td { font-weight: 700; font-style: italic; background: var(--table-even); }

/* section headers (Create Subject etc.) */
.sec-head { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; letter-spacing: .5px; color: var(--dash-green); padding-bottom: 14px; border-bottom: 1px solid var(--border); margin: 28px 0 22px; text-transform: uppercase; }
.sec-head:first-of-type { margin-top: 6px; }
.sec-head .sec-ico { font-size: 18px; }
.sec-head .sec-right { margin-left: auto; text-transform: none; }
.btn-outline-pill { background: #fff; color: var(--dash-green); border: 1px solid #cfd8d3; border-radius: 999px; padding: 9px 18px; font-weight: 700; font-size: 13px; cursor: pointer; }
.btn-outline-pill:hover { background: #f2f6f4; }
.map-empty { text-align: center; color: var(--text-gray); font-style: italic; padding: 22px; }

/* timetable grid */
.tt-grid { width: 100%; border-collapse: collapse; }
.tt-grid th, .tt-grid td { border: 1px solid var(--border); padding: 10px; vertical-align: top; height: 84px; }
.tt-grid thead th { background: #eef1f0; color: var(--dash-green); font-weight: 700; font-size: 13.5px; text-align: center; }
.tt-grid td.day { background: #f7f7f5; font-weight: 700; color: var(--dash-green); width: 110px; text-align: center; vertical-align: middle; }
.tt-cell { font-size: 12.5px; line-height: 1.5; }
.tt-cell .mod { font-weight: 600; color: var(--dash-green); }
.tt-cell .subj { font-weight: 700; color: #1a1a1a; }
.tt-cell .room { color: var(--text-gray); }
.tt-cell .tch { color: var(--blue); font-size: 11.5px; }
.tt-empty { color: #d8d8d8; text-align: center; display: block; margin-top: 22px; }
.alert-warn-abk { background: #FFF3CD; color: #8a6d1b; border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; font-size: 13.5px; }

/* ===== Management (finance) dashboard ===== */
.report-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 24px; }
.report-cards.g5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width:1300px){ .report-cards, .report-cards.g5 { grid-template-columns: repeat(2,1fr); } }
@media (max-width:700px){ .report-cards, .report-cards.g5 { grid-template-columns: 1fr; } }
.report-card { background: #fff; border-radius: 14px; padding: 20px; box-shadow: var(--shadow-md); display: flex; flex-direction: column; }
.report-card .rc-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.report-card .rc-icon { width: 44px; height: 44px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.report-card .rc-badge { font-size: 11px; font-weight: 700; letter-spacing: .5px; padding: 5px 12px; border-radius: 999px; }
.report-card .rc-label { font-size: 12px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--text-gray); }
.report-card .rc-value { font-size: 24px; font-weight: 800; color: var(--dash-green); margin: 4px 0; }
.report-card .rc-value .cur { font-size: 12px; font-weight: 600; color: var(--text-gray); margin-left: 4px; }
.report-card .rc-sub { font-size: 12px; color: var(--text-gray); margin-bottom: 14px; }
.report-card .rc-link { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12px; font-weight: 700; letter-spacing: .5px; }
.report-card.dark { background: var(--dash-green); }
.report-card.dark .rc-label, .report-card.dark .rc-sub { color: rgba(255,255,255,.75); }
.report-card.dark .rc-value { color: #fff; }
.report-card.dark .rc-link { color: #fff; border-top-color: rgba(255,255,255,.2); }
.ic-blue { background: #E8F0FE; color: #3D70EC; } .lk-blue { color: #3D70EC; }
.ic-green { background: #E6F0EA; color: #10AB7D; } .lk-green { color: #10AB7D; }
.ic-orange { background: #FFF2E5; color: #F8892A; } .lk-orange { color: #F8892A; }
.ic-dark { background: rgba(255,255,255,.15); color: #fff; }
.bd-blue { background: #E8F0FE; color: #3D70EC; } .bd-green { background: #E6F0EA; color: #10AB7D; }
.bd-orange { background: #FFF2E5; color: #F8892A; } .bd-dark { background: rgba(255,255,255,.15); color: #fff; }

.prog-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 24px; }
@media (max-width:900px){ .prog-cards { grid-template-columns: 1fr; } }
.prog-card { border-radius: 16px; padding: 26px; position: relative; }
.prog-card.green { background: #eaf1ec; } .prog-card.orange { background: #fbefe2; }
.prog-badge { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .5px; padding: 6px 14px; border-radius: 999px; }
.prog-badge.green { background: #cfe3d6; color: #1f6b4a; } .prog-badge.orange { background: #f6d9be; color: #b45a12; }
.prog-value { font-size: 44px; font-weight: 800; margin: 16px 0 6px; }
.prog-value.green { color: var(--dash-green); } .prog-value.orange { color: #F8892A; }
.prog-desc { color: var(--text-gray); font-size: 14px; margin-bottom: 18px; }
.prog-row { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: #555; margin-bottom: 8px; }
.prog-track { height: 8px; border-radius: 999px; background: #ffffff; overflow: hidden; }
.prog-fill { height: 100%; border-radius: 999px; }
.prog-fill.green { background: var(--dash-green); } .prog-fill.orange { background: #F8892A; }

.stmt-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 22px; }
@media (max-width:900px){ .stmt-cards { grid-template-columns: 1fr; } }
.stmt-card { background: #fff; border-radius: 14px; padding: 22px; box-shadow: var(--shadow-md); }
.stmt-card h4 { margin: 0 0 16px; font-size: 15px; color: var(--dash-green); display: flex; justify-content: space-between; }
.stmt-row2 { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; color: #555; }
.stmt-row2 .neg { color: var(--error); font-weight: 600; }
.stmt-foot { display: flex; justify-content: space-between; padding-top: 14px; margin-top: 8px; border-top: 1px solid var(--border); font-weight: 700; color: var(--dash-green); }

.seg-toggle { display: inline-flex; background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 5px; gap: 4px; box-shadow: var(--shadow-sm); }
.seg-toggle button { border: none; background: none; padding: 9px 20px; border-radius: 999px; font-weight: 700; font-size: 12px; letter-spacing: .5px; color: var(--text-gray); cursor: pointer; }
.seg-toggle button.active { background: var(--dash-green); color: #fff; }
.rep-badge { position: absolute; top: 22px; left: 22px; font-size: 11px; font-weight: 700; letter-spacing: .5px; padding: 5px 12px; border-radius: 999px; }
.btn-pay { background: var(--dash-green); color: #fff; border: none; border-radius: 999px; padding: 8px 18px; font-weight: 700; font-size: 12px; cursor: pointer; }
.link-slip { color: var(--blue); font-weight: 700; font-size: 12px; letter-spacing: .5px; }

/* searchable combobox */
.combo-list { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; background: #fff; border: 1px solid #d6ddda; border-radius: 10px; box-shadow: var(--shadow-md); max-height: 280px; overflow-y: auto; z-index: 40; }
.combo-item { padding: 11px 14px; font-size: 14px; cursor: pointer; border-bottom: 1px solid #f2f4f3; }
.combo-item:last-child { border-bottom: none; }
.combo-item:hover, .combo-item.hi { background: #eef4f1; }
.combo-empty { padding: 12px 14px; color: var(--text-gray); font-size: 13px; }

/* =========================================================
   TABLES / CARDS
   ========================================================= */
.card-abk { background: #fff; border-radius: 8px; box-shadow: var(--shadow-md); overflow: hidden; }
.table-abk { width: 100%; border-collapse: collapse; }
.table-abk thead th {
    text-align: left; font-size: 15px; font-weight: 600; color: var(--dash-green);
    padding: 16px; border-bottom: 1px solid #A3A3A3;
}
.table-abk tbody td { padding: 16px; font-size: 14px; color: #1a1a1a; border-bottom: 1px solid #ececec; }
.table-abk tbody tr:last-child td { border-bottom: none; }
.table-abk tbody tr:hover { background: var(--table-even); }

.pager {
    display: inline-flex; align-items: center; gap: 12px;
    margin-top: 16px; padding: 12px 24px;
    background: #F9F9F9; border: 1px solid #F0ECEC; border-radius: 8px;
    font-size: 14px; color: #707070;
}
.pager .pg {
    min-width: 32px; height: 32px; padding: 0 8px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); border-radius: 8px; background: #fff;
    color: var(--text-gray); font-weight: 500; box-shadow: var(--shadow-sm);
}
.pager .pg.active { background: var(--dash-green); color: #fff; border-color: var(--dash-green); }

/* Generic module toolbar / forms */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.search-box { position: relative; }
.search-box input { height: 42px; border: 1px solid var(--border); border-radius: 8px; padding: 0 14px; width: 280px; font-size: 14px; outline: none; }
.search-box input:focus { border-color: var(--primary); }

.btn-primary-abk { background: var(--primary); color: #fff; border: none; border-radius: 8px; padding: 10px 18px; font-weight: 600; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.btn-primary-abk:hover { background: var(--primary-dark); color: #fff; }
.btn-light-abk { background: #fff; color: var(--dash-green); border: 1px solid var(--border); border-radius: 8px; padding: 8px 14px; font-weight: 600; font-size: 13px; cursor: pointer; }
.btn-danger-abk { background: #fff; color: var(--error); border: 1px solid #f3c6c6; border-radius: 8px; padding: 8px 14px; font-weight: 600; font-size: 13px; cursor: pointer; }

.status-pill { padding: 3px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.status-active { background: #D1EDDA; color: #157347; }
.status-inactive { background: #F8D7DA; color: #b02a37; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 24px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 700px){ .form-grid { grid-template-columns: 1fr; } }
.form-group label { display:block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 6px; }
.form-group .abk-input, .form-group .abk-select, .form-group textarea {
    padding-left: 14px; width: 100%;
}
.content textarea, .auth-form textarea, .form-group textarea, .reg-field textarea {
    width: 100%; min-height: 92px; border: 1px solid #d6ddda; border-radius: 9px;
    padding: 12px 14px; font-family: inherit; font-size: 14px; color: #1f2937; background: #fff;
    outline: none; resize: vertical; box-shadow: 0 1px 2px rgba(16,24,40,.04);
    transition: border-color .15s, box-shadow .15s;
}
.content textarea:hover, .form-group textarea:hover, .reg-field textarea:hover { border-color: #b7c2bd; }
.content textarea:focus, .auth-form textarea:focus, .form-group textarea:focus, .reg-field textarea:focus {
    border-color: var(--primary); box-shadow: 0 0 0 3px rgba(54,107,89,.16);
}
.form-actions { display: flex; gap: 12px; margin-top: 8px; }

.alert-success-abk { background: #D1EDDA; color: #157347; border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; font-size: 14px; }

.empty-state { text-align: center; padding: 48px 16px; color: var(--text-gray); }

/* Responsive sidebar toggle */
.sidebar-toggle { background: none; border: none; cursor: pointer; color: #333; display: inline-flex; }
.sidebar { transition: width .2s ease; }
@media (max-width: 1000px){
    .sidebar { position: fixed; z-index: 50; transform: translateX(-100%); transition: transform .25s; }
    .sidebar.open { transform: translateX(0); }
}
.table-scroll { overflow-x: auto; }

/* ---- Collapsible sidebar (icon-only <-> icon+text) ---- */
.collapse-btn { margin-left: auto; background: rgba(255,255,255,.1); border: none; color: #fff; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.collapse-btn:hover { background: rgba(255,255,255,.2); }
.sb-collapsed .sidebar { width: 78px; }
.sb-collapsed .sidebar .side-text,
.sb-collapsed .sidebar .sidebar-section,
.sb-collapsed .sidebar .chev,
.sb-collapsed .sidebar .submenu { display: none !important; }
.sb-collapsed .sidebar .sidebar-brand { justify-content: center; gap: 0; padding: 22px 0; }
.sb-collapsed .sidebar .collapse-btn { margin: 0; }
.sb-collapsed .sidebar .nav-link-abk { justify-content: center; padding-left: 0; padding-right: 0; }
.sb-collapsed .sidebar .nav-group > .nav-link-abk .grp-left { gap: 0; }
.sb-collapsed .sidebar .nav-list { padding: 0 10px; }

/* ---- Tabbed wizard (registration) ---- */
.tabs-nav { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 26px; flex-wrap: wrap; }
.tab-btn { display: flex; align-items: center; gap: 10px; padding: 13px 18px; border: none; background: none; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--text-gray); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tab-btn .tab-num { width: 26px; height: 26px; border-radius: 7px; background: #e5e7eb; color: #6b7280; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.tab-btn:hover { color: var(--dash-green); }
.tab-btn.active { color: var(--dash-green); border-bottom-color: var(--dash-green); }
.tab-btn.active .tab-num { background: var(--dash-green); color: #fff; }
.tab-btn.done .tab-num { background: var(--green-accent); color: #fff; }
.tab-panel { display: none; animation: fadeIn .15s ease; }
.tab-panel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.tab-actions { display: flex; justify-content: space-between; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--border); }

/* =========================================================
   BREADCRUMBS / CARD HEADER / FORM HELPERS / TOGGLE
   ========================================================= */
.breadcrumb-abk { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-gray); margin: -10px 0 22px; flex-wrap: wrap; }
.breadcrumb-abk a { color: var(--text-gray); }
.breadcrumb-abk a:hover { color: var(--primary); }
.breadcrumb-abk .sep { opacity: .5; }
.breadcrumb-abk .current { color: var(--dash-green); font-weight: 600; }

.card-header-abk { margin-bottom: 24px; }
.card-header-abk h3 { margin: 0 0 4px; font-size: 20px; font-weight: 700; color: var(--dash-green); }
.card-header-abk p { margin: 0; font-size: 14px; color: var(--text-gray); }

.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px 28px; }
@media (max-width: 1000px){ .form-grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 680px){ .form-grid-3 { grid-template-columns: 1fr; } }
.form-grid-3 .full { grid-column: 1 / -1; }

.form-group .req { color: var(--error); }
.field-hint { display: block; font-size: 12.5px; color: var(--text-gray); margin-top: 6px; }

/* iOS-style toggle (label.switch specificity beats `.form-group label { display:block }`) */
label.switch { position: relative; display: inline-flex !important; align-items: center; gap: 12px; cursor: pointer; user-select: none; margin-bottom: 0; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { display: inline-block; width: 46px; height: 26px; background: #cfd4d2; border-radius: 999px; position: relative; transition: background .18s; flex-shrink: 0; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: transform .18s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch .switch-label { font-weight: 600; color: #1a1a1a; }

/* footer action bar aligned right (matches original) */
.form-footer { display: flex; justify-content: flex-end; gap: 14px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); }

/* Sidebar submenu (expandable) */
.nav-group > .nav-link-abk { justify-content: space-between; }
.nav-group > .nav-link-abk .grp-left { display: flex; align-items: center; gap: 12px; }
.nav-group > .nav-link-abk .chev { transition: transform .2s; font-size: 11px; opacity: .8; }
.nav-group.open > .nav-link-abk .chev { transform: rotate(180deg); }
.submenu { list-style: none; margin: 2px 0 4px; padding: 0 0 0 8px; max-height: 0; overflow: hidden; transition: max-height .25s ease; }
.nav-group.open .submenu { max-height: 520px; }
.submenu-label { padding: 9px 14px 4px 18px; font-size: 10.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: rgba(255,255,255,.45); }
.submenu-label::before { content: none; }
.submenu li a { display: flex; align-items: center; gap: 10px; padding: 9px 14px 9px 26px; border-radius: 8px; color: rgba(255,255,255,.78); font-size: 13.5px; }
.submenu li a::before { content: "•"; color: rgba(255,255,255,.5); }
.submenu li a:hover { background: rgba(255,255,255,.08); color: #fff; }
.submenu li a.active { color: #fff; font-weight: 600; }
.submenu li a.active::before { color: var(--beige); }

/* =========================================================
   GLOBAL RESPONSIVE (all pages)
   ========================================================= */
@media (max-width: 1000px) {
    .content { padding: 20px 16px; }
    .page-heading { font-size: 26px; }
}
@media (max-width: 768px) {
    .content { padding: 16px 12px; }
    .page-heading { font-size: 22px; margin-bottom: 16px; }
    .topbar { height: auto; min-height: 64px; padding: 10px 14px; flex-wrap: wrap; gap: 8px; }
    .topbar .page-title { font-size: 16px; }
    .topbar .page-sub { font-size: 11px; }
    .topbar-right { gap: 12px; }
    .topbar .user-chip { gap: 6px; font-size: 13px; }

    /* stack the page header + its action button */
    .page-head-row { flex-direction: column; align-items: stretch; }

    /* collapse every multi-column grid to a single column (overrides inline grid-template-columns) */
    .reg-grid-2, .reg-grid-3, .form-grid, .form-grid-3,
    .stat-cards, .num-cards, .fin-cards, .report-cards, .prog-cards, .stmt-cards {
        grid-template-columns: 1fr !important;
    }
    /* filter/toolbar rows wrap instead of forcing width */
    .list-toolbar, .list-toolbar .left, .list-toolbar .right { flex-wrap: wrap; }
    .search-box input, .pill-input { min-width: 0; width: 100%; }

    /* inline grid rows inside cards (fee structure, filters, dashboards) go single-column */
    .card-abk > form[style*="grid"], .card-abk div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    /* footer action bars stack */
    .reg-footer, .tab-actions, .form-footer { flex-direction: column; gap: 10px; }
    .reg-footer > *, .tab-actions > *, .form-footer > * { width: 100%; text-align: center; }
    .tab-actions > div { display: flex; flex-direction: column; gap: 10px; }
}
@media (max-width: 520px) {
    .tabs-nav { gap: 2px; }
    .tab-btn { padding: 10px 10px; font-size: 12px; }
    .tab-btn .tab-num { width: 22px; height: 22px; }
    .num-card .big-num, .fin-card .fin-value, .prog-value { font-size: 32px; }
}

/* ============ Reusable delete-confirmation modal ============ */
.modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(17, 34, 26, .55); backdrop-filter: blur(2px);
    display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal-card {
    background: #fff; border-radius: 22px; padding: 34px 38px;
    max-width: 520px; width: 100%; text-align: center;
    box-shadow: 0 24px 70px rgba(0,0,0,.30); animation: modalPop .16s ease-out;
}
@keyframes modalPop { from { transform: translateY(10px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-card h3 { margin: 0 0 14px; font-size: 25px; font-weight: 800; color: #0f1b16; letter-spacing: -.3px; }
.modal-card p { margin: 0 0 28px; color: #5b6b63; font-size: 15px; line-height: 1.55; }
.modal-card p strong { color: #0f1b16; }
.modal-actions { display: flex; justify-content: center; align-items: center; gap: 14px; }
.modal-cancel {
    background: none; border: none; color: #6b7280; font-family: inherit;
    font-weight: 600; font-size: 15px; cursor: pointer; padding: 12px 20px; border-radius: 12px;
}
.modal-cancel:hover { background: #f3f4f6; }
.modal-confirm {
    background: #ef4444; border: none; color: #fff; font-family: inherit;
    font-weight: 700; font-size: 15px; cursor: pointer; padding: 13px 42px; border-radius: 14px;
    box-shadow: 0 8px 18px rgba(239,68,68,.35);
}
.modal-confirm:hover { background: #dc2626; }

/* ============ Subject Details Profile ============ */
.subj-detail-grid { display: grid; grid-template-columns: 360px 1fr; gap: 22px; align-items: start; }
@media (max-width: 900px) { .subj-detail-grid { grid-template-columns: 1fr; } }
.subj-avatar {
    width: 92px; height: 92px; border-radius: 50%; background: var(--dash-green, #003B1B);
    color: #fff; font-size: 38px; font-weight: 800; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 20px rgba(0,59,27,.25);
}
.subj-code-badge {
    display: inline-block; margin-top: 10px; background: #e7f3ec; color: #1f7a4d;
    font-weight: 700; font-size: 12px; padding: 5px 14px; border-radius: 999px;
}
.subj-stat-list { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 8px; }
.subj-stat { display: flex; justify-content: space-between; align-items: center; padding: 13px 0; border-bottom: 1px solid #f1f4f2; }
.subj-stat:last-child { border-bottom: none; }
.subj-stat .k { color: #6b7280; font-size: 14px; }
.subj-stat .v { color: #0f1b16; font-weight: 700; font-size: 15px; }
.subj-sec-head { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 13px; letter-spacing: .5px; text-transform: uppercase; color: #0f1b16; }
.subj-sec-head .sec-ico { font-size: 16px; }

/* ============================================================
   ADMIN DASHBOARD — KPI strip + charts
   ============================================================ */
.kpi-grid {
    display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin: 4px 0 22px;
}
.kpi-card { display: flex; align-items: center; gap: 13px; padding: 16px 16px; }
.kpi-ico {
    width: 46px; height: 46px; flex: 0 0 46px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.kpi-val { font-size: 22px; font-weight: 800; color: var(--heading, #0f1b16); line-height: 1.1; }
.kpi-lbl { font-size: 12.5px; color: var(--text-gray, #6b7280); font-weight: 600; margin-top: 3px; }
.kpi-sub { color: #9aa4b2; font-weight: 500; }

.chart-grid {
    display: grid; grid-template-columns: 1.3fr 1fr 1.1fr; gap: 18px; margin-bottom: 8px;
}
.chart-card { padding: 18px 20px; }
.chart-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.chart-head h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--heading, #0f1b16); }
.chart-note { font-size: 12px; color: var(--text-gray, #9aa4b2); }
.bar-svg { width: 100%; height: 210px; display: block; }

.donut-wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.donut-legend { font-size: 13px; color: var(--text-dark, #374151); display: flex; flex-direction: column; gap: 7px; }
.donut-legend .dot { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.donut-legend b { font-weight: 700; }
.donut-split { font-size: 11.5px; color: var(--text-gray, #9aa4b2); }

.hbar-list { display: flex; flex-direction: column; gap: 13px; margin-top: 4px; }
.hbar-row { display: grid; grid-template-columns: 92px 1fr 34px; align-items: center; gap: 10px; }
.hbar-label { font-size: 12.5px; color: var(--text-dark, #374151); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { background: var(--border, #eef0f3); border-radius: 999px; height: 12px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 999px; min-width: 4px; }
.hbar-val { font-size: 12.5px; font-weight: 700; color: var(--heading, #0f1b16); text-align: right; }

@media (max-width: 1200px) {
    .kpi-grid { grid-template-columns: repeat(3, 1fr); }
    .chart-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   CHAT / MESSAGES
   ============================================================ */
.chat-wrap {
    display: grid; grid-template-columns: 320px 1fr; height: calc(100vh - 210px); min-height: 460px;
    padding: 0; overflow: hidden;
}
.chat-sidebar { border-right: 1px solid var(--border, #e5e7eb); display: flex; flex-direction: column; min-width: 0; }
.chat-search { padding: 14px; border-bottom: 1px solid var(--border, #e5e7eb); }
.chat-search .abk-input { width: 100%; }
.chat-list { overflow-y: auto; flex: 1; }
.chat-empty-sm { padding: 22px 16px; color: var(--text-gray, #9aa4b2); font-size: 13px; text-align: center; }

.chat-item { display: flex; align-items: center; gap: 11px; padding: 12px 14px; cursor: pointer; border-bottom: 1px solid var(--table-even, #f3f5f4); position: relative; }
.chat-item:hover { background: var(--table-even, #f6f8f7); }
.chat-item.active { background: rgba(16,171,125,.10); }
.chat-item-body { flex: 1; min-width: 0; }
.chat-item-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.chat-item-name { font-weight: 700; font-size: 13.5px; color: var(--heading, #0f1b16); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item-time { font-size: 11px; color: var(--text-gray, #9aa4b2); flex: 0 0 auto; }
.chat-item-last { font-size: 12.5px; color: var(--text-gray, #6b7280); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.chat-badge { background: var(--dash-green, #10AB7D); color: #fff; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 999px; display: flex; align-items: center; justify-content: center; padding: 0 6px; }

.chat-avatar {
    width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%;
    background: var(--dash-green, #10AB7D); color: #fff; font-weight: 700; font-size: 14px;
    display: flex; align-items: center; justify-content: center;
}

.chat-main { display: flex; flex-direction: column; min-width: 0; }
.chat-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-gray, #9aa4b2); gap: 10px; }
.chat-empty-ico { font-size: 46px; }
.chat-thread { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border, #e5e7eb); }
.chat-peer-name { font-weight: 700; font-size: 15px; color: var(--heading, #0f1b16); }
.chat-peer-role { font-size: 12px; color: var(--text-gray, #9aa4b2); }

.chat-messages { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 8px; background: var(--content-bg, #FDF6E9); }
.msg { display: flex; }
.msg.mine { justify-content: flex-end; }
.msg-bubble { max-width: 70%; padding: 9px 13px 20px; border-radius: 14px; font-size: 13.5px; line-height: 1.4; position: relative; word-wrap: break-word; }
.msg.theirs .msg-bubble { background: var(--card-bg, #fff); color: var(--text-dark, #1f2937); border: 1px solid var(--border, #e5e7eb); border-bottom-left-radius: 4px; }
.msg.mine .msg-bubble { background: var(--dash-green, #10AB7D); color: #fff; border-bottom-right-radius: 4px; }
.msg-time { position: absolute; right: 10px; bottom: 5px; font-size: 10px; opacity: .7; }

.chat-composer { display: flex; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border, #e5e7eb); background: var(--card-bg, #fff); }
.chat-composer .abk-input { flex: 1; }

/* nav unread badge */
.nav-chat-badge { display: inline-block; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px; border-radius: 999px; background: #dc2626; color: #fff; font-size: 11px; font-weight: 700; text-align: center; margin-left: auto; }

@media (max-width: 820px) {
    .chat-wrap { grid-template-columns: 1fr; height: auto; }
    .chat-sidebar { border-right: none; border-bottom: 1px solid var(--border, #e5e7eb); max-height: 260px; }
    .chat-thread { height: 60vh; }
}
