/* EduManager UI refresh. Presentation only; loaded after legacy module styles. */
:root {
  --font-head: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: var(--font-head);
  --teal-900: #123e3b; --teal-700: #17665d; --teal-500: #238377;
  --teal-100: #dff1e9; --teal-50: #f0f8f4;
  --slate-800: #243733; --slate-700: #405951; --slate-500: #52665f;
  --slate-400: #677a73; --slate-300: #85958f; --slate-200: #ccd7d1;
  --slate-100: #e4eae6; --slate-50: #f5f7f5;
  --sidebar-w: 230px; --radius-lg: 16px; --radius-md: 9px;
}
body { background: #f5f7f5; font-size: 14px; line-height: 1.55; }
button, input, select, textarea { font: inherit; }
a { color: var(--teal-700); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid #53a896; outline-offset: 3px; }
[hidden], .hidden { display: none !important; }
.layout { min-height: 100vh; }
.main-content { padding: 30px clamp(18px, 2.6vw, 44px) 42px; max-width: 1800px; width: 100%; }
.sidebar { background: #fff; border-right: 1px solid var(--slate-100); padding: 28px 14px 20px; height: 100dvh; }
.sidebar-brand { padding: 0 12px 25px; margin-bottom: 20px; border-color: var(--slate-100); }
.sidebar-brand .name { font-size: 21px; font-style: normal; font-weight: 750; letter-spacing: -.7px; color: var(--teal-900); }
.sidebar-brand .sub { color: var(--slate-400); font-size: 10px; margin-top: 6px; }
.sidebar-nav { gap: 5px; }
.sidebar-nav a { color: #5a6b64; min-height: 43px; padding: 10px 13px; font-size: 13px; font-weight: 550; }
.sidebar-nav a .nav-icon { opacity: 1; font-size: 19px; }
.sidebar-nav a:hover { background: #f2f6f3; color: var(--teal-900); }
.sidebar-nav a.active { background: #e6f2eb; border: 0; border-radius: 9px; padding-left: 13px; color: #165f4f; font-weight: 700; }
.sidebar-nav a.active .nav-icon { color: #176b55; }
.sidebar-divider { background: var(--slate-100); }
.sidebar-nav a.logout { color: #677a73; }
.sidebar-nav a.logout:hover { color: #9c362d; background: #fff1ee; }
.page-header { align-items: center; margin-bottom: 24px; gap: 14px; }
.page-header h1, .dashboard-hero h1 { font-style: normal; font-size: clamp(25px, 2.2vw, 32px); font-weight: 740; letter-spacing: -1px; line-height: 1.2; }
.page-header p { margin-top: 7px; font-size: 13px; color: #64776e; }
.card { border: 1px solid #e2e9e3; border-radius: 15px; padding: 22px; min-width: 0; box-shadow: 0 2px 3px #203c2c02; }
.main-content > .card { margin-bottom: 20px; }
.card h2 { font-family: var(--font-head); font-style: normal; font-size: 16px; font-weight: 680; letter-spacing: -.3px; color: #284137; }
.btn { min-height: 42px; padding: 10px 16px; font-size: 13px; font-weight: 650; letter-spacing: 0; border-radius: 8px; color: #fff; background: #186650; text-decoration: none; }
.btn:hover { background: #12533f; }
.btn-secondary { background: #fff; color: #3e594c; border: 1px solid #d8e2db; }
.btn-secondary:hover { background: #f1f7f3; border-color: #a9c4b4; }
.btn-auto { width: auto; }
.btn-sm { min-height: 36px; padding: 7px 12px; font-size: 12px; }
button:disabled, .btn:disabled { opacity: .55; cursor: not-allowed; }
.form-group label { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 650; color: #405b4d; }
.form-group input, .form-group select, .form-group textarea,
.main-content input:not([type=checkbox]):not([type=radio]):not([type=hidden]), .main-content select, .main-content textarea {
  border: 1px solid #d5dfd8; border-radius: 8px; min-height: 42px; background: #fff; color: #243f30; font-family: var(--font-head); padding: 9px 12px; max-width: 100%;
}
input::placeholder, textarea::placeholder { color: #7c8b82 !important; opacity: 1; }
input[type=checkbox], input[type=radio] { accent-color: #1c7055; width: 17px; height: 17px; flex-shrink: 0; }
input[readonly] { background: #f4f7f4 !important; }
.form-group { min-width: 0; }
[class$="-list-header"], .students-list-header { gap: 14px; flex-wrap: wrap; align-items: center; }
[class$="-filters"] { flex-wrap: wrap; gap: 10px; min-width: 0; }
[class$="-filter-form"] { gap: 12px; }
[class$="-filter-form"] .form-group { min-width: 0; }
.badge { text-transform: none; font-size: 11px; letter-spacing: 0; padding: 4px 9px; font-weight: 650; white-space: nowrap; }
.badge-teal { color: #176240; background: #e5f4e9; }
.badge-coral { color: #a34131; background: #fff0eb; }
.badge-slate { color: #58695f; background: #edf1ee; }
.badge-amber { color: #885d11; background: #fff4d9; }
.alert-error { border: 1px solid #f0c9bb; border-left: 3px solid #bc5744; border-radius: 10px; }
.ux-notice { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 13px 16px; border: 1px solid #dce6df; border-radius: 10px; background: #f0f5ef; color: #4b6653; font-size: 12px; margin-bottom: 20px; }
.ux-notice a { margin-left: auto; font-weight: 650; }
.ux-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ux-muted { color: #687c70; font-size: 12px; }
.ux-kicker { font-size: 10px; font-weight: 750; letter-spacing: .11em; text-transform: uppercase; color: #758779; }
.ux-money { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ux-person { display: block; font-weight: 650; color: #2d4436; text-decoration: none; }
.ux-person:hover { text-decoration: underline; }
.ux-subline { display: block; font-size: 11px; color: #718174; margin-top: 4px; }
/* Every table gets its own bounded viewport; no page-wide overflow. */
.table-responsive { max-width: 100%; overflow: auto; margin: 0; padding: 0; }
.ux-table-viewport { max-height: min(64vh, 660px); overflow: auto; overscroll-behavior-x: contain; scrollbar-color: #a5b9a9 #eef3ee; scrollbar-width: auto; border: 1px solid #e4eae4; border-radius: 10px; }
.ux-table-viewport::-webkit-scrollbar, .ux-top-scroll::-webkit-scrollbar { height: 12px; width: 12px; }
.ux-table-viewport::-webkit-scrollbar-thumb, .ux-top-scroll::-webkit-scrollbar-thumb { background: #a5b9a9; border-radius: 8px; border: 3px solid #eff4ef; }
.ux-table-viewport table { border-collapse: separate; border-spacing: 0; min-width: 640px; font-size: 12px; }
.ux-table-viewport thead th { position: sticky; top: 0; z-index: 2; background: #f4f7f3; color: #65776a; padding: 13px 14px; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; font-weight: 750; white-space: nowrap; border-bottom: 1px solid #dce5dc; }
.ux-table-viewport tbody td { padding: 14px; border-bottom: 1px solid #edf1ec; vertical-align: middle; }
.ux-table-viewport tbody tr:last-child td { border-bottom: 0; }
.ux-table-viewport tbody tr:hover td { background: #f7faf6; }
.ux-table-viewport tbody td:first-child { font-weight: 550; }
.ux-table-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; color: #708273; font-size: 11px; }
.ux-table-tools .ux-table-count { margin-right: auto; }
.ux-table-tools button { padding: 5px 10px; min-height: 32px; border: 1px solid #dfe7df; border-radius: 6px; background: #fff; cursor: pointer; color: #4a6450; }
.ux-table-tools button:hover { background: #edf4ed; }
.ux-top-scroll { overflow-x: auto; overflow-y: hidden; height: 14px; margin-bottom: 6px; }
.ux-top-scroll > div { height: 1px; }
.ux-table-viewport.ux-expanded { max-height: none; }
.ux-filter-empty { padding: 30px 15px; text-align: center; color: #718275; }
td [class$="-edit-btn"], td [class$="-delete-btn"], td [class$="-view-btn"] { min-width: 34px; min-height: 34px; border-radius: 7px; padding: 7px; }
td [class$="-edit-btn"], td [class$="-view-btn"] { background: #edf4ee; color: #3b6d4b; border: 1px solid #dce7dd; }
td [class$="-delete-btn"] { background: #fff2ed; color: #b35a47; border: 1px solid #f2dcd2; }
/* Native dialogs: keyboard focus stays inside; background stays inert. */
.ux-dialog { padding: 0; border: 1px solid #dce6dc; border-radius: 18px; width: min(740px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); margin: auto; color: #283c2e; background: #fff; box-shadow: 0 28px 100px #14281d40; overflow: auto; overscroll-behavior: contain; }
.ux-dialog::backdrop { background: #18362970; backdrop-filter: blur(3px); }
body.ux-modal-open { overflow: hidden; }
.ux-dialog > .card { border: 0; box-shadow: none; border-radius: 0; padding: 26px; margin: 0; }
.ux-dialog h2 { padding-right: 42px; margin-bottom: 24px; font-size: 20px; }
.ux-modal-close { position: sticky; top: 14px; z-index: 5; float: right; margin: 14px 14px -50px 0; width: 34px; height: 34px; border: 1px solid #dfe6dd; border-radius: 50%; color: #5b725d; background: #fff; font-size: 22px; cursor: pointer; }
.ux-dialog [class$="-form-grid"] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.ux-dialog [class$="-form-actions"], .ux-modal-actions { position: sticky; bottom: -26px; background: #fff; padding: 16px 0 0; margin-top: 10px; border-top: 1px solid #e6ece3; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; z-index: 3; }
.ux-dialog form > .form-group:last-of-type { margin-bottom: 16px; }
.ux-modal-context { background: #f4f8f2; padding: 15px; border: 1px solid #e2eadf; border-radius: 10px; margin-bottom: 22px; }
.ux-modal-context strong { display: block; font-size: 15px; }
.ux-modal-context p { font-size: 12px; color: #677c68; margin-top: 4px; }
.ux-payment-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 12px; margin-top: 12px; border-top: 1px solid #dce8d8; }
.ux-payment-summary strong { margin-top: 4px; }
.ux-payment-preview { display: flex; justify-content: space-between; gap: 12px; padding: 13px 16px; background: #f1f7ee; border-radius: 9px; margin-bottom: 15px; font-size: 13px; }
.ux-full { grid-column: 1 / -1; }
.ux-payments-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.ux-payment-stat { padding: 20px; background: #fff; border: 1px solid #e0e8df; border-radius: 14px; }
.ux-payment-stat > span { display: block; font-size: 12px; color: #6a7b6c; margin-bottom: 10px; }
.ux-payment-stat strong { font-size: clamp(20px, 2vw, 28px); font-weight: 700; letter-spacing: -.8px; }
.ux-payment-stat small { display: block; margin-top: 7px; font-size: 11px; color: #7a897b; }
.ux-payment-stat .ux-currency { display: inline; font-size: 11px; letter-spacing: 0; font-weight: 500; }
.ux-payment-stat.is-collected { background: #edf6eb; border-color: #d4e7cf; }
.ux-payment-stat.is-collected strong { color: #256542; }
.ux-payment-stat.is-outstanding strong { color: #a3682f; }
.ux-payment-toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 18px; }
.ux-segments { display: flex; gap: 4px; padding: 4px; background: #f1f5ef; border-radius: 9px; flex-wrap: wrap; }
.ux-segments button { padding: 7px 11px; border: 0; border-radius: 6px; background: transparent; color: #687c66; cursor: pointer; font-size: 12px; font-weight: 600; }
.ux-segments button[aria-pressed=true] { background: #fff; color: #205736; box-shadow: 0 1px 4px #263e1715; }
.ux-segments span { margin-left: 4px; font-size: 10px; opacity: .8; }
.ux-payment-table { min-width: 790px !important; }
.ux-payment-table td:nth-child(3), .ux-payment-table td:nth-child(4), .ux-payment-table td:nth-child(5) { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ux-payment-table td:nth-child(4) { color: #2b7750; font-weight: 650; }
.ux-payment-table td:nth-child(5) { font-weight: 700; }
.ux-payment-table .ux-pay-button { white-space: nowrap; }
.ux-payment-table th:last-child, .ux-payment-table td:last-child { position: sticky; right: 0; background: #fff; box-shadow: -5px 0 8px #243e1705; }
.ux-payment-table th:last-child { background: #f4f7f3; z-index: 3; }
.ux-pay-period { color: #74816d; font-size: 12px; }
.ux-filter-search { flex: 2 1 200px !important; }
.ux-live-count { font-size: 12px; color: #768272; }
.ux-select-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.ux-select-tools span { margin-right: auto; font-size: 12px; color: #557050; }
.student-check-item { border: 1px solid #dfe7dc; border-radius: 9px; padding: 13px !important; cursor: pointer; }
.student-check-item:has(input:checked) { border-color: #65a374; background: #edf6e9; }
.student-check-item span { min-width: 0; overflow-wrap: anywhere; }
.students-checkbox-list { max-height: 340px; overflow-y: auto; padding: 3px; }
.attendance-status-options { gap: 8px; }
.attendance-status-options label { padding: 7px 9px; border: 1px solid #e0e8da; border-radius: 7px; background: #fff; }
.attendance-status-options label:has(input:checked) { border-color: #91b58a; background: #edf6e7; }
.attendance-actions { padding-top: 15px; }
.calendar-day-header, .room-day-header { background: #eaf2e5; color: #365b32; }
.calendar-day-header small { color: #67805b; }
.calendar-day-card, .room-day-card { border-color: #dfe8d8; border-radius: 12px; }
.report-nav { background: #edf3e8; border-color: #dfe8d8; }
.report-nav a.btn:not(.btn-secondary) { background: #fff; color: #2f5a32; box-shadow: 0 1px 3px #233c1910; }
.attendance-stats-grid .stat-card .label { text-transform: none; letter-spacing: 0; color: #667c60; font-size: 12px; }
.attendance-stats-grid .stat-card .value { font-size: clamp(22px, 2.3vw, 30px); line-height: 1.2; overflow-wrap: anywhere; }
.dashboard-hero { background: #eaf2e6; border: 1px solid #dbe6d4; color: #284a2e; padding: 27px; }
.dashboard-hero h1 { color: #2c4a30; }
.dashboard-hero p, .dashboard-eyebrow { color: #677e5f; }
.dashboard-hero .btn { background: #246040; border-color: #246040; color: #fff; }
.dashboard-hero .btn-secondary { background: #fff; color: #365c3d; border-color: #d7e3cf; }
.dashboard-kpi-card { border-color: #e0e7dc; border-radius: 13px; }
.dashboard-kpi-card strong { font-size: 24px; letter-spacing: -.6px; }
.dashboard-kpi-card span { color: #6c7d67; }
.dashboard-row { border: 0; border-radius: 8px; background: #f5f8f2; }
.dashboard-row-main { min-width: 0; overflow-wrap: anywhere; }
.dashboard-tabs a { border-radius: 10px; padding: 14px 16px; }
.stat-card .value { font-variant-numeric: tabular-nums; }
.login-page { background: #edf3e9; }
.login-card { border: 1px solid #dbe6d4; box-shadow: 0 15px 70px #203c1910; padding: 38px; border-radius: 20px; }
.login-card h1 { font-weight: 750; font-style: normal; letter-spacing: -1px; }
.login-card > p { color: #6a7f62; }
@media (min-width: 681px) and (max-width: 1040px) {
  :root { --sidebar-w: 76px; }
  .sidebar-brand .name, .sidebar-brand .sub, .sidebar-nav a span { display: none; }
  .sidebar-brand::before { content: 'E'; display: block; color: #1b684c; font-size: 26px; font-weight: 800; text-align: center; }
  .sidebar-brand { padding: 0 0 20px; }
  .sidebar-nav a, .sidebar-nav a.active { justify-content: center; padding: 12px; }
}
@media (max-width: 760px) {
  .ux-payments-stats { gap: 8px; }
  .ux-payment-stat { padding: 14px 12px; }
  .ux-payment-stat strong { font-size: 20px; }
  .ux-payment-stat small { font-size: 10px; }
  .ux-payment-toolbar { align-items: stretch; }
  .ux-payment-toolbar > input { width: 100%; }
  .card { padding: 16px; }
  .ux-dialog > .card { padding: 22px; }
  .ux-dialog [class$="-form-actions"], .ux-modal-actions { bottom: -22px; }
}
@media (max-width: 680px) {
  .main-content { padding: 82px 14px 30px; }
  .sidebar { width: 260px; padding: 25px 14px 20px; z-index: 1200; }
  .sidebar-brand .name, .sidebar-brand .sub, .sidebar-nav a span { display: block; }
  .sidebar-brand::before { display: none; }
  .sidebar-nav a, .sidebar-nav a.active { justify-content: flex-start; }
  .mobile-topbar { background: #fff; border-bottom: 1px solid #e0e8dc; height: 62px; z-index: 1000; }
  .mobile-brand { color: #22573d; font-family: var(--font-head); font-style: normal; font-weight: 750; }
  .mobile-menu-btn { color: #285d3b; }
  .sidebar-close { color: #406d46; }
  .page-header { margin-bottom: 20px; align-items: flex-start; }
  .page-header h1 { font-size: 27px; }
  .page-header p { font-size: 12px; }
  [class$="-filters"], [class$="-filters"] input, [class$="-filters"] select { width: 100%; min-width: 0; }
  [class$="-filter-form"] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  [class$="-filter-form"] .form-group { margin-bottom: 0; min-width: 0; }
  .ux-filter-search { grid-column: 1 / -1; }
  [class$="-filter-form"] > button { width: 100% !important; grid-column: 1 / -1; }
  .form-group input, .form-group select, .form-group textarea, .main-content input:not([type=checkbox]):not([type=radio]):not([type=hidden]), .main-content select, .main-content textarea { font-size: 16px; }
  .ux-dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 24px); border-radius: 14px; }
  .ux-dialog [class$="-form-grid"] { grid-template-columns: minmax(0, 1fr); }
  .ux-dialog h2 { font-size: 19px; }
  .ux-table-viewport { max-height: 60vh; }
  .ux-table-tools { font-size: 10px; }
  .ux-scroll-hint { display: none; }
  .ux-payment-table th:last-child, .ux-payment-table td:last-child { position: static; box-shadow: none; }
  .ux-payments-stats { grid-template-columns: 1fr; }
  .ux-payment-stat { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; align-items: center; }
  .ux-payment-stat > span { margin: 0; font-size: 12px; }
  .ux-payment-stat strong { font-size: 22px; }
  .ux-payment-stat small { margin-top: 3px; grid-column: 1 / -1; }
  .ux-segments { width: 100%; justify-content: space-between; }
  .ux-segments button { padding: 8px; font-size: 11px; }
  .dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .dashboard-kpi-card { padding: 14px 10px; gap: 8px; }
  .dashboard-kpi-card strong { font-size: 19px; overflow-wrap: anywhere; }
  .kpi-icon { width: 28px; height: 32px; font-size: 19px; }
  .dashboard-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .dashboard-tabs a { padding: 12px; font-size: 11px; }
  .dashboard-hero { padding: 22px; }
  .students-checkbox-list { grid-template-columns: minmax(0, 1fr); }
}
@media print {
  .sidebar, .mobile-topbar, .sidebar-overlay, .ux-table-tools, .ux-top-scroll, .ux-dialog, .ux-actions, .ux-payment-toolbar, .payment-filter-card { display: none !important; }
  .layout { display: block; }
  .main-content { padding: 0; margin: 0; max-width: none; }
  .ux-table-viewport { max-height: none !important; overflow: visible !important; border: 0; }
  .ux-table-viewport table { min-width: 0 !important; font-size: 9px; }
  .ux-table-viewport th, .ux-table-viewport td { position: static !important; padding: 6px; }
  .ux-payment-table th:last-child, .ux-payment-table td:last-child { display: none; }
  .card { break-inside: auto; box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
