:root { --pebik-primary: #0f6e56; }
html, body { font-family: Inter, "Segoe UI", Roboto, sans-serif; }
body { background: var(--mud-palette-background); }

.app-bar { border-bottom: 1px solid var(--mud-palette-lines-default); }
.app-title { font-weight: 700; letter-spacing: .5px; color: var(--mud-palette-primary); }
.app-drawer { border-right: 1px solid var(--mud-palette-lines-default); }
.user-chip { font-weight: 500; }
.menu-logout { all: unset; display: flex; gap: 10px; align-items: center; padding: 8px 16px; width: 100%; box-sizing: border-box; cursor: pointer; }
.menu-logout:hover { background: var(--mud-palette-action-default-hover); }

.nav { padding: 8px 0; }
.nav-section { display: block; padding: 16px 20px 4px; color: var(--mud-palette-text-secondary); }
.soon-chip { margin-left: 6px; height: 18px !important; font-size: 10px !important; }

.page { padding-top: 24px; padding-bottom: 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-h { font-weight: 700 !important; }
.actions { display: flex; gap: 8px; }
.emp-head { display: flex; gap: 16px; align-items: center; }
.muted { color: var(--mud-palette-text-secondary); }

.panel { padding: 20px; margin-bottom: 20px; height: 100%; }
.panel-h { font-weight: 600 !important; margin-bottom: 8px; }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .grow { flex: 1 1 300px; }
.w-200 { width: 200px; flex: 0 0 200px; }
.clickable { cursor: pointer; }
.avatar-cell { width: 56px; }
.actions-cell { width: 96px; white-space: nowrap; text-align: right; }
.subgrid-bar { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.inline-upload { display: inline-flex; }

.stat { position: relative; display: flex; gap: 16px; align-items: center; padding: 20px; }
.stat-link { position: absolute; inset: 0; z-index: 1; }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--mud-palette-primary) 12%, transparent); color: var(--mud-palette-primary); }
.stat-warn .stat-icon { background: color-mix(in srgb, var(--mud-palette-warning) 15%, transparent); color: var(--mud-palette-warning); }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1.1; }
.stat-label { color: var(--mud-palette-text-secondary); font-size: 13px; }

.bar-row { display: grid; grid-template-columns: 140px 1fr 40px; gap: 12px; align-items: center; margin: 10px 0; }
.bar-label { font-size: 14px; }
.bar-track { height: 10px; border-radius: 6px; background: var(--mud-palette-lines-default); overflow: hidden; }
.bar-fill { height: 100%; background: var(--mud-palette-primary); border-radius: 6px; }
.bar-value { text-align: right; font-weight: 600; }

.photo-col { display: flex; flex-direction: column; gap: 8px; }
.photo-box { aspect-ratio: 3 / 4; border-radius: 12px; border: 1px solid var(--mud-palette-lines-default); display: grid; place-items: center; overflow: hidden; background: var(--mud-palette-background); }
.photo-box.logo { aspect-ratio: 1; }
.photo-box img { width: 100%; height: 100%; object-fit: cover; }
.photo-box.logo img { object-fit: contain; padding: 12px; }

#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; padding: 12px 20px; background: #fffbeb; border-top: 1px solid #f6e05e; z-index: 2000; }
#blazor-error-ui .reload { margin-left: 8px; }

@media (max-width: 600px) {
    .page { padding-top: 16px; }
    .bar-row { grid-template-columns: 100px 1fr 32px; }
    .w-200 { width: 100%; flex: 1 1 100%; }
}

/* payroll */
.sec-h { font-weight: 600 !important; margin-bottom: 4px; color: var(--mud-palette-primary); }
.sum-line { display: flex; justify-content: space-between; padding: 8px 2px; border-top: 1px dashed var(--mud-palette-lines-default); margin-top: 6px; font-size: 14px; }
.item-line { display: flex; gap: 6px; align-items: center; }
.item-line .grow { flex: 1; }
.item-line .amount { width: 110px; flex: 0 0 110px; }
.net-box { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; padding: 14px; border-radius: 12px; background: color-mix(in srgb, var(--mud-palette-primary) 7%, transparent); }
.net-box div { display: flex; flex-direction: column; }
.net-box span { font-size: 12px; color: var(--mud-palette-text-secondary); }
.net-box b { font-size: 18px; }
.net-box .net b { font-size: 24px; color: var(--mud-palette-primary); }

/* archive */
.attach { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--mud-palette-lines-default); }
.attach img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }
.attach-name { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }

/* finance */
.money-in { color: var(--mud-palette-success) !important; }
.money-out { color: var(--mud-palette-error) !important; }
.small { font-size: 12px; }
.pbar { display: inline-block; width: 70px; height: 8px; border-radius: 4px; background: var(--mud-palette-lines-default); vertical-align: middle; overflow: hidden; }
.pbar-fill { height: 100%; background: var(--mud-palette-primary); }
.pbar-fill.bad { background: var(--mud-palette-error); }
.pbar-fill.good { background: var(--mud-palette-success); }
.pbar-text { font-size: 12px; margin-left: 6px; }
.month-chart { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; height: 220px; align-items: end; }
.mc-col { display: flex; flex-direction: column; height: 100%; }
.mc-bars { flex: 1; display: flex; gap: 2px; align-items: flex-end; }
.mc-bar { flex: 1; border-radius: 4px 4px 0 0; min-height: 1px; }
.mc-bar.in, .dot.in { background: var(--mud-palette-success); }
.mc-bar.out, .dot.out { background: var(--mud-palette-error); }
.mc-label { text-align: center; font-size: 11px; color: var(--mud-palette-text-secondary); margin-top: 4px; }
.legend { margin-top: 8px; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }

/* mosques */
.mosque-card { height: 100%; }
.mosque-img { display: grid; place-items: center; height: 170px; background: var(--mud-palette-background); overflow: hidden; border-radius: 10px 10px 0 0; }
.mosque-img img { width: 100%; height: 100%; object-fit: cover; }
.mosque-meta { display: flex; gap: 12px; align-items: center; margin-top: 6px; font-size: 13px; color: var(--mud-palette-text-secondary); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 12px; }
.photo-tile { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--mud-palette-lines-default); aspect-ratio: 4 / 3; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-del { position: absolute !important; top: 4px; right: 4px; background: rgba(255,255,255,.85) !important; }
.code-box { background: var(--mud-palette-background); border: 1px solid var(--mud-palette-lines-default); border-radius: 8px; padding: 12px; white-space: pre-wrap; word-break: break-all; font-family: ui-monospace, Menlo, monospace; font-size: 12px; margin: 10px 0; }

/* BIK institutional design system */
:root { --pebik-primary: #185646; --bik-forest: #123f34; --bik-gold: #c7ad76; }
a, button, input { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, .stat-link:focus-visible { outline: 3px solid #b49655; outline-offset: 4px; }
.eyebrow { display: block; font-size: 10px; letter-spacing: 2px; font-weight: 600; line-height: 1.6; }
.institution-shell .app-bar { box-shadow: none; }
.header-identity { display: flex; flex-direction: column; gap: 3px; margin-left: 16px; }
.header-kicker { font-size: 9px; letter-spacing: 1.8px; font-weight: 700; color: var(--mud-palette-primary); }
.header-title { font-size: 12px; color: var(--mud-palette-text-secondary); }
.header-date { font-size: 12px; color: var(--mud-palette-text-secondary); padding: 0 20px; border-right: 1px solid var(--mud-palette-lines-default); margin-right: 12px; }
.institution-shell .app-drawer { background: var(--bik-forest); color: #e3ece6; border: 0; }
.drawer-brand { display: flex; align-items: center; gap: 13px; padding: 28px 22px 22px; color: #fff; text-decoration: none; }
.drawer-brand img { width: 43px; height: 48px; object-fit: contain; }
.drawer-brand > span { font-family: 'Source Serif 4', Georgia, serif; font-size: 19px; line-height: 1.25; }
.drawer-brand small { display: block; font-size: 17px; }
.drawer-platform { display: flex; align-items: center; gap: 12px; margin: 0 22px 10px; padding: 15px 0; border-top: 1px solid #ffffff20; border-bottom: 1px solid #ffffff20; font-size: 13px; letter-spacing: 2px; font-weight: 700; }
.drawer-platform span { font-size: 8px; letter-spacing: 1px; color: #b2c6bc; font-weight: 400; }
.app-drawer .nav { padding: 4px 12px 18px; }
.app-drawer .nav-section { padding: 20px 13px 7px; font-size: 9px; letter-spacing: 1.7px; color: #9bb4a8; line-height: 1.5; }
.app-drawer .mud-nav-link { padding: 10px 12px; margin: 3px 0; border-radius: 7px; color: #dce7e0; font-size: 12px; min-height: 40px; border: 1px solid transparent; }
.app-drawer .mud-nav-link .mud-nav-link-icon { color: #9db8aa; font-size: 19px; }
.app-drawer .mud-nav-link:hover { background: #ffffff0b; }
.app-drawer .mud-nav-link.active:not(.mud-nav-link-disabled) { background: #ffffff10; color: #fff; border: 1px solid #ffffff20; border-left: 3px solid var(--bik-gold); }
.app-drawer .mud-nav-link.active .mud-nav-link-icon { color: var(--bik-gold); }
.drawer-footer { margin: auto 24px 20px; padding-top: 18px; border-top: 1px solid #ffffff20; font-size: 10px; color: #b2c6bc; display: flex; flex-direction: column; gap: 7px; }
.drawer-footer a { color: #e1cfaa; }
.institution-shell .page { padding: 34px 36px 20px; }
.page-head { margin-bottom: 26px; align-items: center; }
.page-h { font-family: 'Source Serif 4', Georgia, serif !important; font-size: 32px !important; font-weight: 500 !important; letter-spacing: -.7px !important; line-height: 1.3 !important; }
.page-head .mud-typography-body2 { margin-top: 6px; color: var(--mud-palette-text-secondary) !important; }
.dashboard-heading .eyebrow { color: var(--mud-palette-text-secondary); margin-bottom: 9px; }
.institution-shell .mud-button { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; padding: 9px 16px; box-shadow: none; }
.institution-shell .mud-button-filled-primary { box-shadow: 0 3px 7px #123f3410; }
.institution-shell .panel { padding: 24px; border-color: var(--mud-palette-lines-default); box-shadow: 0 3px 10px #132e2403; margin-bottom: 0; }
.institution-shell .panel-h { font-size: 15px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--mud-palette-lines-default); }
.institution-shell .panel > .mud-typography-body1 { font-size: 13px; color: var(--mud-palette-text-secondary) !important; line-height: 1.8; }
.institution-shell .mud-input-outlined .mud-input-outlined-border { border-color: var(--mud-palette-lines-default); }
.institution-shell .mud-input { font-size: 13px; }
.institution-shell .mud-input-label { font-size: 13px; }
.institution-shell .toolbar { gap: 16px; margin-bottom: 22px; }
.institution-shell .mud-table-container { border-radius: 8px; }
.institution-shell .mud-table-head .mud-table-cell { background: var(--mud-palette-background); font-size: 11px; font-weight: 600; color: var(--mud-palette-text-secondary); padding-top: 14px; padding-bottom: 14px; white-space: nowrap; }
.institution-shell .mud-table-body .mud-table-cell { padding-top: 13px; padding-bottom: 13px; font-size: 12px; border-color: var(--mud-palette-lines-default); }
.institution-shell .mud-table-pagination { border-top: 1px solid var(--mud-palette-lines-default); font-size: 12px; margin-top: 10px; }
.institution-shell .mud-chip { font-size: 11px; font-weight: 500; }
.institution-shell .mud-tab { text-transform: none; font-size: 12px; }
.institution-shell .mud-list-item-text .mud-typography { font-size: 12px; line-height: 1.7; }
.institution-shell .stat { align-items: flex-start; flex-direction: row-reverse; justify-content: space-between; padding: 24px; min-height: 138px; border-color: var(--mud-palette-lines-default); }
.stat-icon { width: 38px; height: 38px; border-radius: 9px; flex-shrink: 0; }
.stat-icon .mud-icon-root { font-size: 20px; }
.stat-value { font-size: 34px; font-weight: 500; letter-spacing: -1px; margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 11px; line-height: 1.5; }
.stat:has(.stat-link):hover { border-color: var(--mud-palette-primary); }
.dashboard-welcome { background: var(--bik-forest); color: #fff; padding: 32px; margin-bottom: 30px; border-radius: 12px; display: flex; align-items: center; justify-content: space-between; gap: 24px; position: relative; overflow: hidden; }
.dashboard-welcome::after { content: ''; position: absolute; width: 300px; height: 300px; border: 1px solid #c7ad7620; border-radius: 50% 50% 0 0; transform: rotate(35deg); right: 80px; top: -130px; pointer-events: none; }
.dashboard-welcome .eyebrow { color: #d9c59c; font-size: 9px; }
.dashboard-welcome h2 { font-family: 'Source Serif 4', Georgia, serif; font-size: 29px; font-weight: 400; margin: 10px 0; }
.dashboard-welcome p { font-size: 12px; color: #c3d4ca; max-width: 480px; line-height: 1.8; }
.dashboard-welcome a { flex-shrink: 0; padding: 12px 17px; border: 1px solid #ffffff40; border-radius: 7px; color: white; font-size: 12px; z-index: 1; }
.dashboard-welcome a:hover { background: #ffffff12; }
.dashboard-welcome a span { margin-left: 18px; color: #d9c59c; }
.section-heading { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 16px; }
.section-heading h2 { font-size: 14px; font-weight: 600; }
.section-heading > span { font-size: 10px; color: var(--mud-palette-text-secondary); }
.dashboard-grid > .mud-grid-item > .section-heading { margin-top: 14px; }
.quick-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.quick-links a { display: flex; gap: 12px; align-items: center; background: var(--mud-palette-surface); border: 1px solid var(--mud-palette-lines-default); padding: 20px 16px; border-radius: 10px; color: var(--mud-palette-text-primary); font-size: 12px; font-weight: 600; }
.quick-links a > .mud-icon-root { font-size: 22px; color: var(--mud-palette-primary); }
.quick-links small { display: block; color: var(--mud-palette-text-secondary); font-size: 10px; margin-top: 5px; font-weight: 400; }
.quick-links .quick-arrow { margin-left: auto; color: var(--mud-palette-text-secondary); }
.quick-links a:hover { border-color: var(--mud-palette-primary); }
.activity-heading { padding-top: 18px; margin-bottom: 0; }
.bar-track { height: 6px; }
.bar-label, .bar-value { font-size: 12px; }
.workspace-footer { display: flex; justify-content: space-between; gap: 16px; padding: 26px 0 6px; margin-top: 32px; border-top: 1px solid var(--mud-palette-lines-default); font-size: 10px; color: var(--mud-palette-text-secondary); }
/* The login is server-rendered, so its styles do not rely on a MudThemeProvider. */
.login-page { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 46% 54%; background: #fafbf8; color: #233b32; }
.login-story { display: flex; flex-direction: column; background: #123f34; color: #fff; padding: 48px 56px 28px; position: relative; overflow: hidden; isolation: isolate; }
.login-story::before, .login-story::after { content: ''; position: absolute; width: 480px; height: 650px; border: 1px solid #d9c59c16; border-radius: 50% 50% 0 0; bottom: -300px; right: -190px; transform: rotate(-25deg); z-index: -1; }
.login-story::after { width: 560px; height: 730px; bottom: -330px; right: -230px; }
.institution-brand { display: flex; gap: 16px; align-items: center; color: white; text-decoration: none; }
.institution-brand img { width: 55px; height: 60px; }
.institution-brand > span { font-family: 'Source Serif 4', Georgia, serif; font-size: 24px; line-height: 1.2; }
.brand-second { display: block; }
.login-story-content { margin: auto 0; padding: 90px 0; }
.login-story .eyebrow { color: #d5c095; }
.login-story h1 { font-family: 'Source Serif 4', Georgia, serif; font-weight: 400; font-size: clamp(40px, 4.1vw, 65px); line-height: 1.13; letter-spacing: -1.8px; margin: 25px 0 28px; }
.gold-rule { width: 48px; height: 2px; background: #c7ad76; margin-bottom: 26px; }
.login-story-content p { max-width: 355px; font-size: 13px; line-height: 1.95; color: #c2d1c8; }
.login-pillars { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 36px; font-size: 10px; color: #d9c59c; }
.login-pillars span + span { border-left: 1px solid #ffffff25; padding-left: 20px; }
.login-story-footer { display: flex; justify-content: space-between; gap: 15px; border-top: 1px solid #ffffff20; padding-top: 23px; font-size: 9px; color: #a9c0b3; }
.login-form-side { display: flex; flex-direction: column; padding: 32px 48px 28px; }
.login-topline { display: flex; justify-content: space-between; gap: 20px; font-size: 9px; letter-spacing: 1.2px; color: #78817a; }
.login-topline span:last-child { letter-spacing: 0; }
.login-card { width: 100%; max-width: 390px; margin: auto; padding: 55px 0; }
.login-monogram { width: 60px; height: 64px; margin-bottom: 28px; }
.login-monogram img { width: 100%; height: 100%; }
.login-card .eyebrow { color: #7a704f; font-size: 9px; margin-bottom: 12px; }
.login-card h2 { font-family: 'Source Serif 4', Georgia, serif; font-size: 32px; font-weight: 500; letter-spacing: -.7px; line-height: 1.25; margin: 0 0 14px; }
.login-intro { font-size: 12px; color: #728077; line-height: 1.85; margin-bottom: 30px; max-width: 340px; }
.login-card form { display: flex; flex-direction: column; }
.login-card label { font-size: 11px; font-weight: 600; color: #354d41; margin-bottom: 9px; }
.login-card input:not([type=checkbox]) { width: 100%; box-sizing: border-box; height: 49px; padding: 0 14px; background: white; border: 1px solid #dbe2d9; border-radius: 6px; font-size: 12px; font-family: inherit; color: #233b32; margin-bottom: 22px; }
.login-card input::placeholder { color: #8a958d; }
.login-card input:focus { outline: 2px solid #35765f; outline-offset: 2px; }
.password-field { position: relative; }
.password-field input { padding-right: 65px !important; }
.password-toggle { position: absolute; right: 12px; top: 14px; background: transparent; border: 0; font-family: inherit; font-size: 10px; color: #185646; cursor: pointer; padding: 3px; }
.login-card .login-remember { display: flex; align-items: center; gap: 9px; font-size: 11px; font-weight: 400; margin: 0 0 24px; cursor: pointer; }
.login-remember input { width: 15px; height: 15px; accent-color: #185646; }
.login-submit { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 48px; padding: 14px 18px; border: 1px solid #185646; border-radius: 6px; background: #185646; color: #fff; font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer; box-shadow: 0 4px 10px #123f3410; }
.login-submit:hover { background: #103f32; }
.login-submit span { font-size: 19px; line-height: 1; }
.login-help { margin-top: 30px; padding-top: 23px; border-top: 1px solid #dfe5dc; font-size: 11px; }
.login-help > span { color: #455b4e; font-weight: 600; }
.login-help p { font-size: 10px; color: #768279; line-height: 1.9; margin: 7px 0 0; }
.login-error { padding: 13px; margin-bottom: 20px; border: 1px solid #eac9c3; background: #fff3f0; color: #9c3526; border-radius: 6px; font-size: 12px; line-height: 1.6; }
.login-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 9px; color: #7b877e; }
.login-footer a { color: #476552; }
@media (min-width: 1600px) { .login-story { padding-left: 80px; padding-right: 80px; } .login-card { max-width: 420px; } }
@media (max-width: 1200px) { .quick-links { grid-template-columns: repeat(2, minmax(0, 1fr)); } .login-story { padding-left: 35px; padding-right: 35px; } .login-form-side { padding-left: 32px; padding-right: 32px; } .institution-shell .page { padding-left: 24px; padding-right: 24px; } }
@media (max-width: 800px) {
    .login-page { grid-template-columns: 1fr; }
    .login-story { padding: 25px 28px; }
    .institution-brand img { width: 38px; height: 42px; }
    .institution-brand > span { font-size: 20px; }
    .login-story-content { padding: 35px 0 5px; }
    .login-story h1 { font-size: 37px; margin: 15px 0; }
    .login-story h1 br { display: none; }
    .login-story-content p, .login-pillars, .gold-rule, .login-story-footer { display: none; }
    .login-form-side { padding: 25px 28px; }
    .login-card { max-width: 460px; padding: 35px 0; }
    .login-monogram { display: none; }
    .login-topline { font-size: 8px; }
    .login-card h2 { font-size: 29px; }
    .header-date { display: none; }
    .dashboard-welcome { padding: 26px; flex-direction: column; align-items: flex-start; }
    .dashboard-welcome h2 { font-size: 26px; }
    .header-kicker { font-size: 8px; letter-spacing: .8px; }
    .header-title { font-size: 10px; }
}
@media (max-width: 600px) {
    .institution-shell .page { padding: 22px 16px; }
    .header-identity { margin-left: 7px; }
    .user-chip { max-width: 100px; overflow: hidden; }
    .page-h { font-size: 28px !important; }
    .institution-shell .panel { padding: 16px; }
    .actions { flex-wrap: wrap; }
    .quick-links { gap: 10px; }
    .quick-links a { padding: 15px 12px; }
    .quick-links a > .mud-icon-root { display: none; }
    .section-heading > span { font-size: 9px; }
    .workspace-footer { flex-direction: column; }
    .login-footer { font-size: 8px; }
}
/* MudBlazor's selected-link palette must remain legible on the dark drawer. */
.app-drawer .mud-nav-link.active:not(.mud-nav-link-disabled),
.app-drawer .mud-nav-link.active .mud-nav-link-text { color: #fff !important; }
.app-drawer .mud-nav-link .mud-nav-link-icon { color: #a9c2b5 !important; }
.app-drawer .mud-nav-link.active .mud-nav-link-icon { color: #d9c59c !important; }

/* Readable navigation states, independent of the light/dark theme palette. */
.app-drawer .mud-nav-link { font-size: 14px; font-weight: 500; line-height: 1.5; min-height: 44px; }
.app-drawer .mud-nav-link .mud-nav-link-text { color: #e4eee8; margin-left: 12px; }
.app-drawer .mud-nav-link:hover:not(.active) { background: #ffffff14; }
.app-drawer .mud-nav-link.active:not(.mud-nav-link-disabled) {
    background: #f3eedf !important; color: #173f33 !important;
    border: 1px solid #f3eedf !important; border-left: 3px solid #c7ad76 !important;
    box-shadow: 0 2px 6px #071e2520;
}
.app-drawer .mud-nav-link.active .mud-nav-link-text,
.app-drawer .mud-nav-link.active .mud-nav-link-icon { color: #173f33 !important; font-weight: 700; }
.app-drawer .mud-nav-link:focus-visible { outline: 2px solid #e3c78e; outline-offset: -2px; }
.app-drawer .nav-section { font-size: 10px; color: #b6cbbf; }
/* Restore a comfortable reading size for data-heavy screens. */
.institution-shell .mud-table-body .mud-table-cell { font-size: 14px; line-height: 1.55; padding: 13px 16px; vertical-align: middle; }
.institution-shell .mud-table-head .mud-table-cell { font-size: 12px; color: var(--mud-palette-text-primary); padding: 14px 16px; }
.institution-shell .mud-table-container { max-height: 62vh; overflow: auto; border: 1px solid var(--mud-palette-lines-default); border-radius: 8px; scrollbar-width: thin; }
.institution-shell .mud-table-head { position: sticky; top: 0; z-index: 2; }
.institution-shell .mud-table-body .mud-table-row:hover { background-color: color-mix(in srgb, var(--mud-palette-primary) 6%, var(--mud-palette-surface)); }
.institution-shell .mud-table-cell { min-width: 90px; }
.institution-shell .mud-table-cell.avatar-cell { min-width: 64px; }
.institution-shell .mud-input, .institution-shell .mud-input-label { font-size: 14px; }
.institution-shell .mud-button, .institution-shell .mud-tab { font-size: 13px; }
.institution-shell .mud-chip { font-size: 12px; }
.institution-shell .mud-input-outlined { background: var(--mud-palette-surface); }
.institution-shell .mud-input-outlined .mud-input-outlined-border { border-color: color-mix(in srgb, var(--mud-palette-text-secondary) 45%, var(--mud-palette-surface)); }
.institution-shell .mud-input-outlined:hover .mud-input-outlined-border { border-color: var(--mud-palette-primary); }
.institution-shell .mud-input:focus-within .mud-input-outlined-border { border-color: var(--mud-palette-primary); }
/* The pager stays outside the scrolling rows and wraps instead of clipping. */
.institution-shell .mud-table-pagination { padding: 12px 0 0; margin-top: 12px; color: var(--mud-palette-text-primary); }
.institution-shell .mud-table-pagination .mud-toolbar { height: auto; min-height: 48px; padding: 0; flex-wrap: wrap; gap: 12px; }
.institution-shell .mud-table-pagination .mud-table-pagination-caption { font-size: 13px; margin: 0 8px; }
.institution-shell .mud-table-pagination .mud-input { font-size: 13px; }
.institution-shell .mud-table-pagination .mud-icon-button { border: 1px solid var(--mud-palette-lines-default); border-radius: 7px; padding: 8px; margin: 0 2px; color: var(--mud-palette-primary); }
.institution-shell .mud-table-pagination .mud-icon-button:disabled { color: var(--mud-palette-text-disabled); background: var(--mud-palette-background); }
.institution-shell .mud-table-pagination .mud-icon-button:hover:not(:disabled) { background: color-mix(in srgb, var(--mud-palette-primary) 10%, var(--mud-palette-surface)); }
.institution-shell .mud-table-pagination .mud-table-pagination-actions { display: flex; align-items: center; gap: 2px; margin-left: 8px; }
.stat > div:not(.stat-icon) { min-width: 0; }
.stat-value { font-size: clamp(19px, 1.65vw, 32px); white-space: nowrap; }
.stat-label { font-size: 12px; }
@media (max-width: 600px) {
    .institution-shell .mud-table-container { max-height: 55vh; }
    .institution-shell .mud-table-pagination .mud-toolbar { justify-content: center; gap: 10px 4px; }
    .institution-shell .mud-table-pagination .mud-spacer { display: none; }
    .institution-shell .mud-table-pagination .mud-table-pagination-actions { margin-left: 0; }
    .institution-shell .stat { padding: 16px; gap: 8px; flex-direction: column; }
    .stat-value { font-size: 24px; margin-top: 8px; }
}
.institution-shell .mud-table-body .mud-table-cell { white-space: nowrap; }
.institution-shell .mud-table-body .mud-table-cell.subject-cell { white-space: normal; min-width: 280px; max-width: 400px; }
.institution-shell .mud-table-container { max-height: clamp(240px, 46vh, 560px); }
.institution-shell .mud-table-pagination .mud-toolbar { padding-bottom: 4px; }

/* Printed documents (previews and "Ruaj si PDF"): BIK letterhead, ivory/forest/gold, no app theme needed. */
.print-root {
    --doc-forest: #123f34; --doc-green: #185646; --doc-gold: #b49655; --doc-gold-soft: #d9c9a0;
    --doc-ivory: #f7f4ec; --doc-ink: #20372e; --doc-muted: #66746c; --doc-line: #e4ddcc;
    background: #e9ede8; color: var(--doc-ink); min-height: 100vh; padding: 32px 16px; overflow-x: auto;
}
.print-toolbar { position: sticky; top: 0; z-index: 10; display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 16px 24px; background: #123f34; color: #fff; font-family: Inter, Arial, sans-serif; }
.print-back { color: #e8efea; font-size: 13px; }
.print-toolbar-title { display: flex; flex-direction: column; gap: 4px; }
.print-toolbar-title strong { font-size: 14px; }
.print-toolbar-title span { font-size: 11px; color: #cbd9d1; }
.print-toolbar button { display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 8px; background: #f3eedf; color: #173f33; border: 1px solid #d8cba9; font: 600 13px Inter, Arial, sans-serif; cursor: pointer; }
.print-toolbar button:disabled { opacity: .65; cursor: wait; }
.print-toolbar button svg { flex-shrink: 0; }
.print-status { background: #fff7df; color: #594619; text-align: center; font-size: 13px; }
.print-status:not(:empty) { padding: 12px; }

.sheet {
    position: relative; width: 210mm; min-height: 297mm; margin: 0 auto 28px; padding: 18mm 16mm 24mm; box-sizing: border-box;
    background: #fff; box-shadow: 0 6px 24px rgba(18, 63, 52, .14);
    font: 11.5px/1.55 Inter, Arial, sans-serif; color: var(--doc-ink);
    border-top: 5px solid var(--doc-forest);
}
.sheet.landscape { width: 297mm; min-height: 210mm; padding: 14mm 14mm 20mm; }
/* gold hairline under the forest band, and a page footer for the on-screen preview */
.sheet::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1.5px; background: var(--doc-gold); }
.sheet::after {
    content: "Bashkësia Islame e Kosovës  ·  Dokument i lëshuar nga platforma PEBIK";
    position: absolute; left: 16mm; right: 16mm; bottom: 9mm; padding-top: 6px; border-top: 1px solid var(--doc-line);
    font-size: 8.5px; letter-spacing: .4px; color: var(--doc-muted);
}

/* letterhead */
.doc-head { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding-bottom: 14px; margin-bottom: 4px; border-bottom: 1.5px solid var(--doc-green); break-inside: avoid; }
.doc-head img { width: 54px; height: 58px; object-fit: contain; }
.doc-institution { font-family: 'Source Serif 4', Georgia, serif; font-size: 19px; font-weight: 600; line-height: 1.2; color: var(--doc-forest); }
.doc-org { font-size: 12px; font-weight: 600; margin-top: 3px; color: var(--doc-green); }
.doc-org-sub { font-size: 9.5px; margin-top: 3px; line-height: 1.5; color: var(--doc-muted); }
.doc-meta { text-align: right; font-size: 9px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--doc-muted); white-space: nowrap; }
.doc-meta b { display: block; margin-top: 3px; font-size: 12px; letter-spacing: 0; text-transform: none; color: var(--doc-ink); }
.doc-rule { height: 1px; background: var(--doc-gold); margin-bottom: 22px; }

/* title */
.doc-title-block { text-align: center; margin-bottom: 22px; break-after: avoid; }
.doc-title { font-family: 'Source Serif 4', Georgia, serif; font-size: 24px; font-weight: 600; line-height: 1.25; letter-spacing: -.2px; color: var(--doc-forest); margin: 0; }
.doc-title:focus { outline: none; }
.doc-title-block::after { content: ""; display: block; width: 46px; height: 2px; margin: 10px auto 0; background: var(--doc-gold); }
.doc-sub { margin-top: 6px; font-size: 11px; color: var(--doc-muted); }
.landscape .doc-title-block { margin-bottom: 16px; }
.landscape .doc-title { font-size: 20px; }

/* data tables */
.doc-table { width: 100%; border-collapse: collapse; margin-bottom: 14px; font-variant-numeric: tabular-nums; }
.doc-table thead { display: table-header-group; }
.doc-table th { background: var(--doc-ivory); color: var(--doc-forest); font-size: 9px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; text-align: left; padding: 8px 8px; border-top: 1.5px solid var(--doc-green); border-bottom: 1px solid var(--doc-gold-soft); }
.doc-table td { padding: 6px 8px; border-bottom: 1px solid var(--doc-line); vertical-align: top; overflow-wrap: anywhere; }
.doc-table tbody tr:nth-child(even) td { background: #fbfaf6; }
.doc-table tr.sub td { background: var(--doc-ivory); font-weight: 700; }
.doc-table tfoot td { background: var(--doc-ivory); font-weight: 700; color: var(--doc-forest); border-top: 1.5px solid var(--doc-green); border-bottom: 1.5px solid var(--doc-green); }
.doc-table.small { font-size: 10px; }
.doc-table.small th { font-size: 8px; padding: 7px 6px; }
.doc-table.small td { padding: 5px 6px; }
.doc-table .r, .doc-table th.r { text-align: right; }

/* label / value pairs */
.doc-kv { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.doc-kv td { padding: 7px 8px; border-bottom: 1px solid var(--doc-line); vertical-align: top; overflow-wrap: anywhere; }
.doc-kv td:nth-child(odd) { width: 20%; color: var(--doc-muted); font-size: 9px; letter-spacing: .7px; text-transform: uppercase; padding-top: 9px; }
.doc-kv td[colspan] { color: var(--doc-forest) !important; font-size: 10px !important; background: var(--doc-ivory); border-top: 1.5px solid var(--doc-green); }
.doc-table tr, .doc-kv tr, .signatures, .doc-head, .slip-net { break-inside: avoid; page-break-inside: avoid; }

.mono { font-family: ui-monospace, Menlo, monospace; }
.doc-note { color: var(--doc-muted); font-style: italic; }
.print-h { font-family: 'Source Serif 4', Georgia, serif; font-size: 15px; font-weight: 600; color: var(--doc-forest); margin: 20px 0 8px; padding-bottom: 5px; border-bottom: 1px solid var(--doc-gold-soft); break-after: avoid; }
.print-photo { display: block; width: 100%; max-height: 90mm; object-fit: cover; border-radius: 4px; margin-bottom: 14px; }

/* payslip */
.slip-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.slip-net { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; padding: 12px 16px; background: var(--doc-forest); color: #fff; border-left: 4px solid var(--doc-gold); font-size: 12px; letter-spacing: .4px; text-transform: uppercase; }
.slip-net b { font-family: 'Source Serif 4', Georgia, serif; font-size: 20px; letter-spacing: 0; text-transform: none; }

/* receipts: two copies per A4 with a cut line between them */
.receipt { position: relative; box-sizing: border-box; min-height: 120mm; padding-bottom: 8mm; margin-bottom: 8mm; border-bottom: 1px dashed var(--doc-gold); }
.receipt:last-child { border-bottom: 0; margin-bottom: 0; }
.receipt:not(:last-child)::after { content: "✂"; position: absolute; left: -2mm; bottom: -7px; font-size: 11px; line-height: 1; color: var(--doc-gold); background: #fff; }
.receipt .doc-title-block { margin-bottom: 14px; }
.receipt .signatures { margin-top: 28px; }
.doc-amount { font-family: 'Source Serif 4', Georgia, serif; font-size: 17px; font-weight: 600; color: var(--doc-forest); }

/* certificates: framed page */
.cert-sheet .cert-frame { min-height: 254mm; padding: 10mm 11mm; border: 1px solid var(--doc-gold-soft); outline: 3px double var(--doc-gold-soft); outline-offset: 3px; box-sizing: border-box; }
.cert-text { font-family: 'Source Serif 4', Georgia, serif; font-size: 14.5px; line-height: 1.9; margin: 18px 0 22px; text-align: justify; }
.cert-text b { color: var(--doc-forest); }

/* signatures with the stamp place in the middle */
.signatures { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-top: 52px; }
.signatures > div:not(.sig-stamp) { width: 34%; text-align: center; font-size: 10.5px; color: var(--doc-muted); }
.sig-line { border-top: 1px solid var(--doc-ink); margin-bottom: 6px; }
.sig-stamp { display: grid; place-items: center; flex-shrink: 0; width: 26mm; height: 26mm; border: 1px dashed var(--doc-gold-soft); border-radius: 50%; font-size: 8.5px; letter-spacing: 1px; color: var(--doc-gold); }

.landscape .signatures { margin-top: 26px; }
.landscape .sig-stamp { width: 20mm; height: 20mm; }
.slip-cols .doc-kv td:nth-child(odd) { width: 36%; }

@media (max-width: 600px) {
    .print-toolbar { padding: 12px 16px; gap: 12px; }
    .print-toolbar-title { order: 3; width: 100%; }
    .print-toolbar button { font-size: 12px; padding: 10px; }
    .print-root { padding: 16px 8px; }
}

@media print {
    html, body { background: #fff !important; }
    .no-print, .print-toolbar, .print-status { display: none !important; }
    .print-root { display: block; min-height: 0; overflow: visible; background: #fff; padding: 0; }
    .sheet, .sheet.landscape { width: auto; min-height: 0; margin: 0; padding: 0; box-shadow: none; border-top: 0; }
    .sheet::before, .sheet::after { display: none; }
    .sheet { break-after: page; }
    .sheet:last-child { break-after: auto; }
    .sheet.landscape { page: landscape; }
    .sheet, .sheet * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .sheet a { color: inherit; text-decoration: none; }
    .doc-table tfoot { display: table-row-group; }
    .cert-sheet .cert-frame { min-height: 260mm; }
    @page {
        size: A4 portrait; margin: 16mm 14mm 18mm;
        @bottom-left { content: "Bashkësia Islame e Kosovës · PEBIK"; font: 7.5pt Inter, Arial, sans-serif; color: #66746c; }
        @bottom-right { content: "Faqja " counter(page) " / " counter(pages); font: 7.5pt Inter, Arial, sans-serif; color: #66746c; }
    }
    @page landscape {
        size: A4 landscape; margin: 12mm 12mm 15mm;
        @bottom-left { content: "Bashkësia Islame e Kosovës · PEBIK"; font: 7.5pt Inter, Arial, sans-serif; color: #66746c; }
        @bottom-right { content: "Faqja " counter(page) " / " counter(pages); font: 7.5pt Inter, Arial, sans-serif; color: #66746c; }
    }
}

/* Laptop screens (1366×768 up to a 13" MacBook on "More Space", ~1710 wide): the same layout, denser. */
@media (min-width: 801px) and (max-width: 1760px), (min-width: 801px) and (max-height: 900px) {
    :root { --mud-drawer-width-left: 236px !important; --mud-appbar-height: 56px !important; }
    .institution-shell .app-bar .mud-toolbar { min-height: 56px; height: 56px; }
    .drawer-brand { padding: 18px 18px 14px; gap: 11px; }
    .drawer-brand img { width: 34px; height: 38px; }
    .drawer-brand > span { font-size: 16px; }
    .drawer-brand small { font-size: 14px; }
    .drawer-platform { margin: 0 18px 4px; padding: 10px 0; font-size: 12px; }
    .app-drawer .nav { padding: 2px 10px 12px; }
    .app-drawer .nav-section { padding: 12px 11px 4px; }
    .app-drawer .mud-nav-link { font-size: 13px; min-height: 36px; padding: 7px 10px; margin: 1px 0; }
    .app-drawer .mud-nav-link .mud-nav-link-icon { font-size: 18px; }
    .drawer-footer { margin: auto 18px 14px; padding-top: 12px; }

    .institution-shell .page { padding: 22px 26px 14px; }
    .page-head { margin-bottom: 18px; }
    .page-h { font-size: 26px !important; }
    .page-head .mud-typography-body2 { margin-top: 2px; }
    .institution-shell .panel { padding: 18px; }
    .institution-shell .panel-h { margin-bottom: 12px; padding-bottom: 10px; }
    .institution-shell .toolbar { gap: 12px; margin-bottom: 14px; }
    .institution-shell .mud-button { padding: 7px 14px; }

    .institution-shell .stat { padding: 16px 18px; min-height: 0; }
    .stat-value { margin-bottom: 6px; }
    .dashboard-welcome { padding: 22px 26px; margin-bottom: 22px; }
    .dashboard-welcome h2 { font-size: 23px; margin: 6px 0; }
    .dashboard-welcome p { margin: 0; }
    .quick-links a { padding: 14px; }
    .section-heading { margin-bottom: 12px; }
    .workspace-footer { margin-top: 20px; padding-top: 14px; }

    .institution-shell .mud-input, .institution-shell .mud-input-label { font-size: 13px; }
    .institution-shell .mud-table-body .mud-table-cell { font-size: 13px; line-height: 1.45; padding: 8px 12px; }
    .institution-shell .mud-table-head .mud-table-cell { font-size: 11.5px; padding: 10px 12px; }
    .institution-shell .mud-table-cell .mud-avatar { width: 32px; height: 32px; font-size: 13px; }
    .institution-shell .mud-table-cell.avatar-cell { min-width: 48px; }
    /* fill the screen height instead of a fixed share of it */
    .institution-shell .mud-table-container { max-height: max(260px, calc(100vh - 330px)); }
    .institution-shell .mud-table-pagination { padding-top: 8px; margin-top: 8px; }
    .institution-shell .mud-table-pagination .mud-toolbar { min-height: 40px; }
    .institution-shell .mud-table-pagination .mud-icon-button { padding: 5px; }
}
