@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&display=swap');

:root {
    color-scheme: light;
    --bg: #f4f6f9;
    --panel: #ffffff;
    --text: #172033;
    --muted: #657084;
    --line: #d8e0ec;
    --line-strong: #c4cedd;
    --primary: #145fc4;
    --primary-dark: #0c4998;
    --accent: #0f8f79;
    --surface-soft: #f8fafc;
    --surface-warm: #fffaf0;
    --danger-bg: #fff0f0;
    --danger-text: #a82424;
    font-family: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body,
button,
input,
select,
textarea,
table {
    font-family: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
}

.auth-page {
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-page-premium {
    overflow: hidden;
    background:
        linear-gradient(145deg, rgba(20, 95, 196, 0.12), rgba(15, 143, 121, 0.10)),
        var(--bg);
}

.auth-shell {
    width: min(100%, 440px);
}

.auth-shell-premium {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(380px, 0.85fr);
    width: min(100%, 1040px);
    min-height: 640px;
    border: 1px solid rgba(196, 206, 221, 0.82);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 30px 90px rgba(23, 32, 51, 0.18);
    overflow: hidden;
    padding: 0;
}

.auth-showcase {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(140deg, rgba(20, 95, 196, 0.94), rgba(8, 44, 91, 0.98) 52%, rgba(15, 143, 121, 0.92));
    color: #ffffff;
    min-height: 100%;
}

.showcase-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(115deg, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.18));
}

.showcase-grid::after {
    content: "";
    position: absolute;
    inset: -40% -20%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.20), transparent);
    transform: rotate(18deg);
    animation: auth-scan 7s linear infinite;
}

.showcase-content {
    position: relative;
    z-index: 1;
    display: grid;
    align-content: space-between;
    min-height: 100%;
    padding: 46px;
}

.showcase-logo {
    width: 190px;
    max-height: 76px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.showcase-copy {
    max-width: 430px;
}

.showcase-copy .eyebrow {
    color: rgba(255, 255, 255, 0.72);
}

.showcase-copy h2 {
    margin: 0;
    font-size: 40px;
    line-height: 1.12;
}

.motion-ledger {
    display: grid;
    gap: 12px;
    width: min(100%, 430px);
    margin: 26px 0;
}

.motion-ledger span {
    display: block;
    height: 14px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.20));
    transform-origin: left;
    animation: ledger-pulse 3.2s ease-in-out infinite;
}

.motion-ledger span:nth-child(1) {
    width: 76%;
}

.motion-ledger span:nth-child(2) {
    width: 54%;
    animation-delay: 0.35s;
}

.motion-ledger span:nth-child(3) {
    width: 86%;
    animation-delay: 0.7s;
}

.motion-ledger span:nth-child(4) {
    width: 62%;
    animation-delay: 1.05s;
}

.showcase-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.showcase-metrics div {
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(12px);
    padding: 14px;
}

.showcase-metrics span,
.showcase-metrics strong {
    display: block;
}

.showcase-metrics span {
    color: rgba(255, 255, 255, 0.70);
    font-size: 12px;
    font-weight: 800;
}

.showcase-metrics strong {
    margin-top: 6px;
    font-size: 14px;
    line-height: 1.25;
}

@keyframes auth-scan {
    0% {
        transform: translateX(-48%) rotate(18deg);
    }
    100% {
        transform: translateX(48%) rotate(18deg);
    }
}

@keyframes ledger-pulse {
    0%,
    100% {
        opacity: 0.48;
        transform: scaleX(0.72);
    }
    50% {
        opacity: 1;
        transform: scaleX(1);
    }
}

.auth-panel,
.welcome {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 50px rgba(23, 32, 51, 0.08);
    padding: 32px;
}

.auth-panel {
    padding: 36px;
}

.auth-panel-premium {
    display: grid;
    align-content: center;
    border-radius: 0;
    box-shadow: none;
    padding: 46px;
}

.brand-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    margin-bottom: 30px;
    text-align: center;
}

.brand-logo {
    display: block;
    width: min(100%, 250px);
    max-height: 96px;
    object-fit: contain;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
}

h1 {
    margin: 0;
    font-size: 26px;
    line-height: 1.2;
}

.login-form {
    display: grid;
    gap: 10px;
}

.login-form label {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.login-form input {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0 12px;
    color: var(--text);
    font-size: 15px;
}

.login-form input:focus {
    border-color: var(--primary);
    outline: 3px solid rgba(22, 103, 217, 0.16);
}

.login-form button {
    min-height: 46px;
    margin-top: 10px;
    border: 0;
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
}

.login-form button:hover {
    background: var(--primary-dark);
}

.login-form-premium .form-control {
    border-radius: 10px;
    min-height: 48px;
}

.login-form-premium button {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
}

.login-button-shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.35) 45%, transparent 70%);
    transform: translateX(-120%);
    animation: login-shine 3.8s ease-in-out infinite;
}

.login-form-premium button span:first-child {
    position: relative;
    z-index: 1;
}

@keyframes login-shine {
    0%,
    42% {
        transform: translateX(-120%);
    }
    72%,
    100% {
        transform: translateX(120%);
    }
}

.alert {
    margin-bottom: 18px;
    border: 1px solid #ffc9c9;
    border-radius: 6px;
    background: var(--danger-bg);
    color: var(--danger-text);
    padding: 12px;
    font-size: 14px;
}

.notice {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    font-weight: 700;
    padding: 14px 16px;
}

.notice.success {
    border-color: rgba(16, 163, 127, 0.35);
    background: #e9f8f3;
    color: #08745c;
}

.notice.error {
    border-color: #ffc9c9;
    background: var(--danger-bg);
    color: var(--danger-text);
}

.dashboard {
    width: min(100% - 32px, 1120px);
    margin: 0 auto;
    padding: 24px 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.topbar a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.welcome p:last-child {
    color: var(--muted);
    line-height: 1.6;
}

.panel-page {
    background: #f5f7fb;
}

.app-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 28px;
    width: 260px;
    flex-basis: 260px;
    border-right: 1px solid var(--line);
    background: #ffffff;
    padding: 24px 18px;
    transition: width 0.18s ease, flex-basis 0.18s ease, padding 0.18s ease, box-shadow 0.18s ease;
    overflow: hidden;
}

.sidebar-header {
    display: grid;
    gap: 10px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    min-height: 72px;
    padding: 0 10px;
}

.sidebar-brand img {
    display: block;
    width: 170px;
    max-height: 64px;
    object-fit: contain;
}

.sidebar-mini-brand {
    display: none;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: #edf5ff;
    color: var(--primary);
    font-weight: 900;
}

.sidebar-controls {
    display: grid;
    grid-template-columns: repeat(2, 34px);
    gap: 8px;
    padding: 0 8px;
}

.sidebar-control {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #ffffff;
    color: var(--muted);
    font-weight: 900;
    line-height: 1;
}

.sidebar-control:hover {
    border-color: rgba(20, 95, 196, 0.28);
    color: var(--primary);
    background: #f6faff;
}

.side-nav {
    display: grid;
    gap: 6px;
}

.side-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    border-radius: 6px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    padding: 0 12px;
    text-decoration: none;
}

.nav-icon {
    display: inline-block;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    color: #526178;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.nav-label {
    overflow: hidden;
    text-overflow: ellipsis;
}

body.sidebar-collapsed .sidebar {
    width: 76px;
    flex-basis: 76px;
    padding-left: 12px;
    padding-right: 12px;
}

body.sidebar-collapsed:not(.sidebar-pinned) .sidebar:hover {
    width: 260px;
    flex-basis: 260px;
    padding-left: 18px;
    padding-right: 18px;
    box-shadow: 18px 0 36px rgba(23, 32, 51, 0.1);
}

body.sidebar-collapsed .sidebar-brand img,
body.sidebar-collapsed .nav-label {
    opacity: 0;
    width: 0;
    pointer-events: none;
}

body.sidebar-collapsed .sidebar-mini-brand {
    display: grid;
}

body.sidebar-collapsed .sidebar-controls {
    grid-template-columns: 34px;
    justify-content: center;
    padding: 0;
}

body.sidebar-collapsed .side-nav a {
    justify-content: center;
    gap: 0;
    padding-left: 0;
    padding-right: 0;
}

body.sidebar-collapsed .nav-icon {
    color: #526178;
}

body.sidebar-collapsed:not(.sidebar-pinned) .sidebar:hover .sidebar-brand img,
body.sidebar-collapsed:not(.sidebar-pinned) .sidebar:hover .nav-label {
    opacity: 1;
    pointer-events: auto;
}

body.sidebar-collapsed:not(.sidebar-pinned) .sidebar:hover .sidebar-brand img {
    width: 170px;
}

body.sidebar-collapsed:not(.sidebar-pinned) .sidebar:hover .nav-label {
    width: auto;
}

body.sidebar-collapsed:not(.sidebar-pinned) .sidebar:hover .sidebar-mini-brand {
    display: none;
}

body.sidebar-collapsed:not(.sidebar-pinned) .sidebar:hover .sidebar-controls {
    grid-template-columns: repeat(2, 34px);
    justify-content: start;
    padding: 0 8px;
}

body.sidebar-collapsed:not(.sidebar-pinned) .sidebar:hover .side-nav a {
    justify-content: flex-start;
    gap: 10px;
    padding-left: 12px;
    padding-right: 12px;
}

.side-nav a:hover,
.side-nav a.active {
    background: #eef5ff;
    color: var(--primary);
}

.side-nav a:hover .nav-icon,
.side-nav a.active .nav-icon {
    color: var(--primary);
}

.main-area {
    min-width: 0;
}

.panel-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.82);
    padding: 22px 32px;
}

.panel-topbar h1 {
    font-size: 24px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.user-menu a,
.primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border-radius: 6px;
    font-weight: 700;
    text-decoration: none;
}

.user-menu a {
    border: 1px solid var(--line);
    color: var(--text);
    padding: 0 12px;
}

.primary-action {
    background: var(--primary);
    color: #fff;
    padding: 0 16px;
    white-space: nowrap;
}

.primary-action:hover {
    background: var(--primary-dark);
}

.secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    color: var(--text);
    font-weight: 700;
    padding: 0 14px;
    text-decoration: none;
    white-space: nowrap;
}

.full-action {
    width: 100%;
}

.panel-content {
    display: grid;
    gap: 22px;
    padding: 28px 32px 40px;
}

.panel-content.container-fluid {
    padding: 28px 32px 40px;
}

.hero-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 12px 34px rgba(23, 32, 51, 0.06);
    padding: 28px;
}

.hero-panel h2 {
    margin: 0;
    font-size: 26px;
    line-height: 1.2;
}

.hero-panel p:last-child {
    max-width: 660px;
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.compact-hero {
    align-items: flex-start;
}

.accounting-controls {
    display: grid;
    gap: 16px;
    width: 100%;
}

.accounting-control-group {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 12px;
}

.accounting-day-filter,
.accounting-month-filter {
    margin: 0;
}

.accounting-month-filter.monthly-report-filter {
    border-left: 0;
    margin-left: 0;
    padding-left: 0;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.action-row form {
    margin: 0;
}

.sms-hero-actions {
    display: grid;
    gap: 14px;
    justify-items: end;
    min-width: 260px;
}

.accounting-sms-action {
    justify-content: flex-start;
}

.accounting-sms-form {
    display: grid;
    gap: 6px;
    justify-items: start;
    text-align: left;
}

.sms-toggle-form {
    margin: 0;
}

.sms-toggle {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 190px;
    padding: 10px 12px;
    border: 1px solid #d6e0ec;
    border-radius: 8px;
    background: #ffffff;
    color: #172033;
    text-align: left;
    cursor: pointer;
}

.sms-toggle-track {
    position: relative;
    width: 44px;
    height: 24px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #cbd5e1;
}

.sms-toggle-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.25);
    transition: transform 0.16s ease;
}

.accounting-report-button {
    border: 0;
    background: linear-gradient(135deg, #f2e3c6, #dfc7a0);
    color: #5b4218;
    box-shadow: 0 14px 24px rgba(127, 97, 47, 0.12);
    font-weight: 800;
}

.accounting-report-button:hover {
    background: linear-gradient(135deg, #ead6b0, #d6bc8a);
    color: #4a3613;
}

.accounting-sms-form small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.sms-toggle.is-on .sms-toggle-track {
    background: #0f8f79;
}

.sms-toggle.is-on .sms-toggle-knob {
    transform: translateX(20px);
}

.sms-toggle.is-off {
    border-color: #fecaca;
    background: #fff7f7;
}

.sms-toggle-copy {
    display: grid;
    gap: 2px;
}

.sms-toggle-copy strong {
    font-size: 13px;
    line-height: 1.1;
}

.sms-toggle-copy small {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.monthly-report-filter {
    border-left: 1px solid var(--line);
    margin-left: 8px;
    padding-left: 14px;
}

.stats-grid,
.module-grid {
    display: grid;
    gap: 16px;
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.monthly-account-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(320px, 1fr));
    gap: 16px;
}

.monthly-account-card {
    display: grid;
    gap: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    background: #ffffff;
}

.monthly-account-head,
.monthly-account-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.monthly-account-head span,
.monthly-account-actions span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.monthly-account-head h2 {
    margin: 3px 0 0;
    color: var(--text);
    font-size: 22px;
    line-height: 1.15;
}

.monthly-account-head strong {
    font-size: 22px;
    white-space: nowrap;
}

.monthly-account-lines {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.monthly-account-lines div {
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #f8fafc;
    padding: 10px 12px;
}

.monthly-account-lines dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.monthly-account-lines dd {
    margin: 4px 0 0;
    color: var(--text);
    font-size: 16px;
    font-weight: 900;
}

.stat-card,
.module-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    padding: 20px;
}

.stat-card.card,
.module-card.card,
.table-panel.card,
.hero-panel.card {
    border-radius: 8px;
}

.stat-card {
    display: grid;
    gap: 8px;
}

.stat-card span,
.stat-card small,
.module-card p {
    color: var(--muted);
}

.stat-card span {
    font-size: 13px;
    font-weight: 700;
}

.stat-card strong {
    color: var(--text);
    font-size: 28px;
    line-height: 1;
}

.stat-card small {
    font-size: 13px;
}

.module-card {
    position: relative;
    min-height: 150px;
}

.module-dot {
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #10a37f;
    margin-bottom: 18px;
}

.module-card h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.module-card p {
    margin: 0;
    line-height: 1.55;
}

.module-link {
    color: inherit;
    text-decoration: none;
}

.module-link:hover {
    border-color: rgba(22, 103, 217, 0.45);
    box-shadow: 0 12px 34px rgba(23, 32, 51, 0.08);
}

.table-panel {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.filters {
    display: grid;
    grid-template-columns: minmax(130px, 0.55fr) minmax(220px, 1.5fr) minmax(150px, 0.7fr) minmax(150px, 0.7fr) auto auto;
    align-items: end;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    padding: 18px;
}

.filters label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.filters input,
.filters select {
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    color: var(--text);
    font-size: 14px;
    padding: 0 10px;
}

.filters button {
    min-height: 40px;
    border: 0;
    border-radius: 6px;
    background: var(--primary);
    color: #ffffff;
    cursor: pointer;
    font-weight: 700;
    padding: 0 16px;
}

.filters > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    color: var(--muted);
    font-weight: 700;
    text-decoration: none;
}

.live-search-status {
    align-self: end;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
}

.live-search-empty td {
    color: var(--muted);
    font-weight: 800;
    padding: 18px;
    text-align: center;
}

.excel-table-wrap {
    overflow: auto;
    max-height: calc(100vh - 360px);
}

.excel-table {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

.excel-table.table {
    margin-bottom: 0;
}

.excel-table th,
.excel-table td {
    border-bottom: 1px solid #e8edf5;
    border-right: 1px solid #edf1f7;
    padding: 9px 10px;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

.excel-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fafc;
    color: #46566d;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.excel-table tbody tr:hover {
    background: #f9fbff;
}

.students-table-panel {
    overflow: visible;
}

.students-table-context {
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--line-strong);
    background: var(--surface-soft);
    padding: 10px 14px 0;
}

.students-table-context span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.students-table-context strong {
    color: var(--text);
    font-size: 13px;
}

.students-table-wrap {
    max-height: calc(100vh - 330px);
    min-height: 360px;
    overflow: auto;
    scrollbar-gutter: stable both-edges;
}

.students-table {
    font-size: 12px;
}

.students-table th,
.students-table td {
    padding: 5px 6px;
}

.students-table th {
    font-size: 11px;
}

.students-table .name-cell {
    min-width: 190px;
    font-weight: 700;
}

.students-table .phone-cell {
    min-width: 145px;
}

.students-table .name-preview {
    grid-template-columns: minmax(130px, 1fr) 26px;
    gap: 5px;
}

.students-table .compact-preview {
    grid-template-columns: minmax(100px, 1fr) 26px;
}

.students-table .icon-action,
.students-table .mini-action {
    min-width: 26px;
    min-height: 26px;
    padding: 0 7px;
    font-size: 11px;
}

.students-table .numeric-cell-input,
.students-table .paid-input,
.students-table .money-input {
    min-width: 70px;
    max-width: 82px;
    min-height: 28px;
    padding: 4px 6px;
    font-size: 12px;
}

.students-table .days-cell {
    min-width: 146px;
}

.students-table .day {
    width: 24px;
    height: 24px;
    font-size: 10px;
}

.students-table .meal-toggle {
    min-width: 68px;
    padding: 4px 6px;
}

.students-table .meal-toggle small {
    display: none;
}

.students-table .status {
    min-height: 22px;
    padding: 2px 7px;
    font-size: 11px;
}

.students-table .date-cell {
    min-width: 88px;
    gap: 4px;
}

.students-table .inline-select-form select,
.students-table .branch-select-form select {
    min-width: 82px;
    min-height: 28px;
    padding: 3px 6px;
    font-size: 12px;
}

.students-table .receipt-upload {
    grid-template-columns: minmax(84px, 1fr) auto;
    gap: 5px;
    min-width: 166px;
}

.students-table .receipt-upload input[type="file"] {
    max-width: 120px;
    font-size: 10px;
}

.students-table .receipt-upload button {
    min-height: 27px;
    padding: 0 8px;
    font-size: 11px;
}

.students-table td.note-cell {
    min-width: 220px;
    max-width: 260px;
}

.students-table .note-preview {
    grid-template-columns: minmax(0, 1fr) 26px;
}

.name-cell {
    min-width: 230px;
    font-weight: 800;
}

.name-preview {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 32px;
    align-items: center;
    gap: 8px;
}

.compact-preview {
    grid-template-columns: minmax(110px, 1fr) 32px;
}

.phone-cell {
    min-width: 170px;
}

.excel-table td.note-cell {
    max-width: 420px;
    min-width: 300px;
    white-space: normal;
    line-height: 1.45;
    vertical-align: top;
}

.note-preview {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 32px;
    align-items: start;
    gap: 8px;
}

.note-preview span {
    display: -webkit-box;
    overflow: hidden;
    min-height: 42px;
    max-width: 100%;
    color: var(--text);
    line-height: 1.45;
    white-space: normal;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.icon-action {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    color: var(--primary);
    cursor: pointer;
    font-size: 17px;
    font-weight: 800;
    line-height: 1;
}

.icon-action:hover {
    border-color: rgba(22, 103, 217, 0.45);
    background: #eef5ff;
}

.days-cell {
    display: flex;
    gap: 4px;
}

.day {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 24px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #ffffff;
    color: #96a0af;
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
    padding: 0 6px;
}

.day.on {
    border-color: rgba(16, 163, 127, 0.34);
    background: #e9f8f3;
    color: #08745c;
}

.day:hover {
    border-color: rgba(22, 103, 217, 0.45);
}

.day:focus {
    outline: 3px solid rgba(22, 103, 217, 0.16);
}

.day.save-error {
    border-color: #ffc9c9;
    background: #fff0f0;
    color: #a82424;
}

.branch-pill,
.institution-pill,
.code-pill,
.status {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    padding: 0 9px;
}

.branch-pill.badge,
.institution-pill.badge,
.status.badge {
    min-height: 24px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    padding: 0 9px;
}

.branch-pill {
    background: #eef5ff;
    color: var(--primary);
}

.institution-pill {
    max-width: 220px;
    background: #ecfdf5;
    color: #047857;
    white-space: normal;
}

.status.paid {
    background: #e9f8f3;
    color: #08745c;
}

.status.paid.text-bg-success {
    color: #fff !important;
}

.status.partial {
    background: #fff6df;
    color: #8a5a00;
}

.status.unpaid {
    background: #fff0f0;
    color: #a82424;
}

.status.unpaid.text-bg-danger {
    color: #fff !important;
}

.inline-select-form {
    margin: 0;
}

.branch-select-form {
    margin: 0;
}

.inline-select-form select {
    min-width: 138px;
    min-height: 32px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
    padding: 0 8px;
}

.branch-select-form select {
    min-width: 104px;
    min-height: 32px;
    border: 1px solid rgba(22, 103, 217, 0.16);
    border-radius: 999px;
    background: #eef5ff;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    padding: 0 8px;
}

.inline-select-form select:focus,
.branch-select-form select:focus {
    border-color: var(--primary);
    outline: 3px solid rgba(22, 103, 217, 0.16);
}

.meal-status-form {
    margin: 0;
}

.meal-toggle {
    display: inline-grid;
    gap: 2px;
    min-width: 82px;
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: 7px;
    cursor: pointer;
    font: inherit;
    padding: 5px 10px;
    text-align: left;
}

.meal-toggle span {
    font-size: 12px;
    font-weight: 900;
    line-height: 1.1;
}

.meal-toggle small {
    font-size: 10px;
    font-weight: 800;
    line-height: 1.1;
}

.meal-toggle.active {
    border-color: rgba(8, 116, 92, 0.22);
    background: #e9f8f3;
    color: #08745c;
}

.meal-toggle.passive {
    border-color: rgba(168, 36, 36, 0.22);
    background: #fff0f0;
    color: #a82424;
}

.meal-toggle:hover {
    box-shadow: 0 8px 18px rgba(23, 32, 51, 0.08);
}

.paid-input,
.numeric-cell-input {
    width: 112px;
    min-height: 32px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: #f8fafc;
    color: var(--text);
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    padding: 0 9px;
}

.numeric-cell-input {
    width: 72px;
}

.numeric-cell-input.money-input {
    width: 112px;
}

.paid-input:hover,
.numeric-cell-input:hover {
    border-color: var(--line);
    background: #ffffff;
}

.paid-input:focus,
.numeric-cell-input:focus {
    border-color: var(--primary);
    background: #ffffff;
    outline: 3px solid rgba(22, 103, 217, 0.16);
}

.paid-input.save-ok,
.numeric-cell-input.save-ok {
    border-color: rgba(16, 163, 127, 0.5);
    background: #e9f8f3;
}

.paid-input.save-error,
.numeric-cell-input.save-error {
    border-color: #ffc9c9;
    background: #fff0f0;
}

.date-cell {
    display: grid;
    gap: 6px;
    min-width: 104px;
}

.date-cell span {
    color: var(--text);
    font-weight: 800;
}

.mini-action {
    width: max-content;
    min-height: 28px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    color: var(--primary);
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    padding: 0 9px;
}

.mini-action:hover {
    border-color: rgba(22, 103, 217, 0.45);
    background: #eef5ff;
}

.mini-action:disabled,
.mini-action:disabled:hover {
    cursor: not-allowed;
    border-color: #e2e8f0;
    background: #f1f5f9;
    color: #94a3b8;
}

.sms-row-action {
    min-width: 54px;
    border-color: rgba(22, 103, 217, 0.28);
    color: var(--primary);
    font-weight: 900;
}

.receipt-upload {
    display: grid;
    grid-template-columns: minmax(170px, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-width: 280px;
}

.receipt-upload label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.receipt-upload input[type="file"] {
    max-width: 180px;
    color: var(--muted);
    font-size: 12px;
}

.receipt-upload button {
    min-height: 32px;
    border: 0;
    border-radius: 6px;
    background: var(--primary);
    color: #ffffff;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    padding: 0 10px;
}

.receipt-upload button:hover {
    background: var(--primary-dark);
}

.receipt-badge {
    display: inline-flex;
    align-items: center;
    width: max-content;
    min-height: 24px;
    border-radius: 999px;
    background: #e9f8f3;
    color: #08745c;
    font-size: 12px;
    font-weight: 800;
    padding: 0 9px;
}

.receipt-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.text-action {
    border: 0;
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    padding: 0;
    text-decoration: none;
}

.text-action:hover {
    color: var(--primary-dark);
}

.document-modal {
    width: min(96vw, 980px);
    height: min(92vh, 780px);
    border: 0;
    border-radius: 8px;
    box-shadow: 0 24px 80px rgba(23, 32, 51, 0.24);
    padding: 0;
}

.document-modal::backdrop {
    background: rgba(23, 32, 51, 0.48);
}

.document-modal-header,
.document-modal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    padding: 14px 16px;
}

.document-modal-header h2 {
    margin: 0;
    font-size: 18px;
}

.modal-close {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    color: var(--text);
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.document-modal iframe {
    display: block;
    width: 100%;
    height: calc(100% - 117px);
    border: 0;
    background: #f5f7fb;
}

.document-modal-actions {
    justify-content: flex-end;
    border-top: 1px solid var(--line);
    border-bottom: 0;
    gap: 10px;
}

.note-modal {
    width: min(94vw, 620px);
    border: 0;
    border-radius: 8px;
    box-shadow: 0 24px 80px rgba(23, 32, 51, 0.24);
    padding: 0;
}

.note-modal::backdrop {
    background: rgba(23, 32, 51, 0.48);
}

.note-modal-body {
    display: grid;
    gap: 10px;
    padding: 18px;
}

.note-modal-body p {
    margin: 0;
    color: var(--text);
    font-weight: 800;
}

.institution-modal-body {
    grid-template-columns: 1fr 1fr;
}

.institution-modal-body label,
.institution-modal-body input {
    width: 100%;
}

.note-modal-body label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.note-modal-body textarea {
    width: 100%;
    resize: vertical;
    min-height: 150px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    font: inherit;
    line-height: 1.5;
    padding: 10px 12px;
}

.note-modal-body textarea:focus {
    border-color: var(--primary);
    outline: 3px solid rgba(22, 103, 217, 0.16);
}

.note-modal-body input[type="date"] {
    width: min(100%, 260px);
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    font: inherit;
    font-weight: 800;
    padding: 0 10px;
}

.note-modal-body input[type="date"]:focus {
    border-color: var(--primary);
    outline: 3px solid rgba(22, 103, 217, 0.16);
}

.note-modal-body input[type="text"] {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    font: inherit;
    font-weight: 800;
    padding: 0 10px;
}

.note-modal-body input[type="text"]:focus {
    border-color: var(--primary);
    outline: 3px solid rgba(22, 103, 217, 0.16);
}

.sms-preview-modal {
    width: min(94vw, 760px);
    border: 0;
    border-radius: 8px;
    box-shadow: 0 24px 80px rgba(23, 32, 51, 0.24);
    padding: 0;
}

.sms-preview-modal::backdrop {
    background: rgba(23, 32, 51, 0.52);
}

.sms-preview-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 330px);
    gap: 22px;
    align-items: center;
    padding: 20px;
}

.sms-preview-meta {
    display: grid;
    gap: 9px;
    align-content: start;
    min-width: 0;
}

.sms-preview-meta strong {
    color: var(--text);
    font-size: 20px;
    line-height: 1.25;
}

.sms-preview-meta span,
.sms-preview-meta small {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.phone-mockup {
    position: relative;
    width: min(100%, 310px);
    min-height: 560px;
    border: 10px solid #111827;
    border-radius: 34px;
    background: #111827;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
    padding: 18px 12px 14px;
}

.phone-speaker {
    position: absolute;
    top: 9px;
    left: 50%;
    width: 74px;
    height: 5px;
    border-radius: 999px;
    background: #334155;
    transform: translateX(-50%);
}

.phone-screen {
    display: flex;
    flex-direction: column;
    min-height: 518px;
    border-radius: 24px;
    background: #f8fafc;
    overflow: hidden;
}

.phone-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
    color: #334155;
    font-size: 12px;
    font-weight: 900;
    padding: 14px 14px 11px;
}

.sms-bubble {
    align-self: flex-start;
    max-width: 86%;
    margin: 18px 12px;
    border-radius: 18px 18px 18px 4px;
    background: #e0f2fe;
    color: #0f172a;
    font-size: 13px;
    line-height: 1.48;
    padding: 13px 14px;
    white-space: pre-wrap;
    word-break: break-word;
}

.sms-template {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
    max-width: 860px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    padding: 16px;
}

.sms-template h3 {
    margin: 0;
    color: var(--text);
    font-size: 15px;
}

.sms-template p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.sms-table-wrap .excel-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.sms-table-wrap .excel-table th,
.sms-table-wrap .excel-table td {
    padding: 8px 10px;
    white-space: normal;
    vertical-align: top;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.sms-table-wrap .excel-table th:nth-child(1),
.sms-table-wrap .excel-table td:nth-child(1) {
    width: 72px;
}

.sms-table-wrap .excel-table th:nth-child(2),
.sms-table-wrap .excel-table td:nth-child(2) {
    width: 150px;
}

.sms-table-wrap .excel-table th:nth-child(3),
.sms-table-wrap .excel-table td:nth-child(3) {
    width: 126px;
}

.sms-table-wrap .excel-table th:nth-child(4),
.sms-table-wrap .excel-table td:nth-child(4) {
    width: 108px;
}

.sms-table-wrap .excel-table th:nth-child(5),
.sms-table-wrap .excel-table td:nth-child(5) {
    width: auto;
}

.sms-table-wrap .excel-table th:nth-child(6),
.sms-table-wrap .excel-table td:nth-child(6) {
    width: 128px;
    text-align: center;
}

.sms-table-wrap .excel-table td.sms-message-cell {
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.4;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 0;
    max-width: none;
    max-height: 96px;
    overflow: hidden;
}

.sms-send-form {
    margin: 0;
}

.sms-send-form button,
.sms-send-button {
    min-height: 34px;
    width: 100%;
    border: 0;
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    padding: 0 10px;
    white-space: normal;
}

.sms-send-form button:disabled,
.sms-send-button:disabled {
    cursor: not-allowed;
    background: #cbd5e1;
    color: #64748b;
}

.section-headıng {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.section-headıng h2 {
    margin: 4px 0 0;
    color: var(--text);
    font-size: 18px;
}

.institution-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.institution-summary-card {
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: inherit;
    padding: 15px;
    text-decoration: none;
}

.institution-summary-card:hover {
    border-color: rgba(22, 103, 217, 0.38);
    background: #f8fbff;
}

.institution-summary-card span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
}

.institution-summary-card strong {
    color: var(--text);
    font-size: 22px;
}

.institution-summary-card small,
.institution-contact {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.institutions-table-wrap .excel-table {
    min-width: 920px;
}

.institutions-table td:first-child {
    min-width: 260px;
}

.institutions-table td:first-child strong,
.institution-contact {
    display: block;
}

.period-filter {
    display: flex;
    align-items: end;
    gap: 10px;
}

.period-filter label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.period-filter input {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
    font-weight: 800;
    padding: 0 10px;
}

.period-filter button {
    min-height: 38px;
    border: 0;
    border-radius: 6px;
    background: var(--primary);
    color: #ffffff;
    cursor: pointer;
    font-weight: 800;
    padding: 0 14px;
}

.period-filter button:hover {
    background: var(--primary-dark);
}

.date-stepper {
    display: grid;
    grid-template-columns: 40px minmax(150px, 1fr) 40px;
    gap: 8px;
    align-items: center;
}

.date-step-button {
    display: inline-grid;
    place-items: center;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    color: var(--primary);
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
    text-decoration: none;
}

.date-step-button:hover {
    border-color: rgba(22, 103, 217, 0.45);
    background: #eef5ff;
}

.accounting-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.8fr);
    gap: 18px;
    align-items: start;
}

.accounting-manual-hero h2 {
    max-width: 720px;
}

.accounting-manual-hero {
    align-items: flex-start;
    flex-direction: column;
}

.day-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.day-switcher a {
    display: grid;
    gap: 4px;
    min-width: 58px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
    padding: 8px 9px;
    text-decoration: none;
}

.day-switcher a:hover,
.day-switcher a.active {
    border-color: rgba(22, 103, 217, 0.45);
    background: #eef5ff;
}

.day-switcher span {
    font-size: 13px;
    font-weight: 900;
}

.day-switcher small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.accounting-headıng {
    margin: 0;
    padding: 18px 18px 0;
}

.accounting-table-wrap {
    max-height: calc(100vh - 420px);
    min-height: 360px;
}

.accounting-table {
    width: 100%;
    min-width: 760px;
}

.accounting-table td:not(:first-child),
.accounting-table th:not(:first-child) {
    text-align: right;
}

.manual-entry-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.entry-form {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.entry-form.income {
    border-top: 4px solid #10a37f;
}

.entry-form.expense {
    border-top: 4px solid #dc2626;
}

.entry-form-headıng {
    margin: 0;
    padding: 18px 18px 0;
}

.entry-form-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    padding: 18px;
}

.entry-form-fields label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.entry-form-fields input,
.entry-form-fields select {
    min-height: 40px;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    padding: 0 10px;
}

.entry-form-fields input:focus,
.entry-form-fields select:focus {
    border-color: var(--primary);
    outline: 3px solid rgba(22, 103, 217, 0.16);
}

.entry-note-field {
    grid-column: 1 / -1;
}

.entry-form-fields button {
    align-self: end;
    min-height: 40px;
    border: 0;
    border-radius: 6px;
    background: var(--primary);
    color: #ffffff;
    cursor: pointer;
    font-weight: 800;
    padding: 0 16px;
}

.entry-form-fields button:hover {
    background: var(--primary-dark);
}

.entry-table-wrap {
    max-height: 360px;
}

.entry-table-wrap .accounting-table {
    min-width: 860px;
    font-size: 12px;
}

.entry-table-wrap .accounting-table th,
.entry-table-wrap .accounting-table td {
    padding: 6px 7px;
}

.entry-table-wrap .name-cell {
    min-width: 170px;
}

.empty-state {
    color: var(--muted);
    font-weight: 800;
    text-align: center !important;
}

.inline-delete-form {
    margin: 0;
}

.category-rule-panel {
    overflow: hidden;
}

.category-rule-form {
    display: grid;
    grid-template-columns: minmax(120px, 0.5fr) minmax(220px, 1fr) minmax(220px, 1fr) auto;
    gap: 12px;
    align-items: end;
    padding: 18px;
}

.category-rule-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.category-rule-form input,
.category-rule-form select {
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    padding: 0 10px;
}

.category-rule-form button {
    min-height: 40px;
}

.rule-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-top: 1px solid var(--line);
    padding: 0 18px 18px;
}

.rule-chip-list span {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f8fafc;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    padding: 6px 9px;
}

.reports-grid {
    margin-top: 4px;
    grid-template-columns: 1fr;
}

.category-rule-panel + .reports-grid {
    display: none;
}

.accounting-report-pivot-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.75fr);
    align-items: stretch;
    margin-top: 0;
}

.accounting-report-headıng {
    display: grid;
    gap: 16px;
}

.accounting-report-filter {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    align-items: end;
    gap: 10px;
    width: 100%;
}

.accounting-report-filter label {
    min-width: 0;
}

.accounting-report-filter select,
.accounting-report-filter input {
    width: 100%;
}

.report-search-field {
    min-width: 0;
}

.accounting-report-filter .btn {
    min-height: 38px;
}

.accounting-report-table-wrap {
    min-height: 420px;
}

.accounting-report-table-wrap .accounting-table th:nth-child(2),
.accounting-report-table-wrap .accounting-table th:nth-child(3),
.accounting-report-table-wrap .accounting-table th:nth-child(4),
.accounting-report-table-wrap .accounting-table td:nth-child(2),
.accounting-report-table-wrap .accounting-table td:nth-child(3),
.accounting-report-table-wrap .accounting-table td:nth-child(4) {
    text-align: left;
}

.accounting-pivot-card {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    min-height: 560px;
}

.pivot-total-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 16px 18px;
}

.pivot-total-grid div {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    padding: 10px 12px;
}

.pivot-total-grid span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.pivot-total-grid strong {
    display: block;
    margin-top: 4px;
    font-size: 16px;
    line-height: 1.2;
}

.pivot-list {
    display: grid;
    align-content: start;
    gap: 8px;
    max-height: 520px;
    overflow: auto;
    padding: 0 18px 18px;
}

.pivot-row {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    padding: 10px 12px;
}

.pivot-row summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    cursor: pointer;
    list-style: none;
}

.pivot-row summary::-webkit-details-marker {
    display: none;
}

.pivot-row span,
.pivot-row small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.pivot-row summary > div > span {
    display: none;
}

.pivot-row strong {
    display: block;
    margin: 3px 0;
    color: var(--text);
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.pivot-row b {
    white-space: nowrap;
    font-size: 13px;
}

.pivot-detail-list {
    display: grid;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.pivot-detail-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    border-radius: 6px;
    background: #f8fafc;
    padding: 8px 9px;
}

.pivot-detail-row span {
    color: var(--text);
    overflow-wrap: anywhere;
}

.compact-period-filter {
    align-items: end;
}

.money-positive {
    color: #047857;
    font-weight: 800;
}

.money-negative {
    color: #b42318;
    font-weight: 800;
}

.audit-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.audit-list {
    display: grid;
    gap: 12px;
    padding: 18px;
}

.audit-note {
    display: grid;
    gap: 7px;
    border: 1px solid var(--line);
    border-left: 4px solid #94a3b8;
    border-radius: 8px;
    background: #f8fafc;
    padding: 13px;
}

.audit-note span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.audit-note strong {
    color: var(--text);
    font-size: 14px;
}

.audit-note p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.audit-note.high {
    border-left-color: #dc2626;
    background: #fff7f7;
}

.audit-note.warning {
    border-left-color: #d97706;
    background: #fffbeb;
}

.meal-table-wrap .excel-table {
    min-width: 760px;
}

.meal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 14px;
}

.check-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
}

.check-toggle input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.meal-proof-upload {
    max-width: 560px;
}

.meal-manual-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 12px;
    align-items: end;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    margin: 14px 0;
    padding: 14px;
}

.meal-manual-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.meal-manual-form input {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    font: inherit;
    padding: 0 10px;
}

.meal-manual-form button {
    min-height: 38px;
    border: 0;
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 900;
    padding: 0 16px;
}

.manual-meal-row {
    background: #fbfdf8;
}

.manual-badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 11px;
    font-weight: 900;
    margin-left: 8px;
    padding: 0 7px;
}

.print-page {
    background: #eef2f7;
    color: #111827;
    font-family: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 0;
}

.meal-print-sheet {
    width: min(100%, 920px);
    min-height: 100vh;
    margin: 0 auto;
    background: #fff;
    padding: 28px;
}

.meal-print-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 2px solid #111827;
    padding-bottom: 16px;
    margin-bottom: 18px;
}

.meal-print-header p,
.meal-print-header h1,
.meal-print-header span {
    margin: 0;
}

.meal-print-header p {
    color: #475569;
    font-size: 13px;
    font-weight: 800;
}

.meal-print-header h1 {
    color: #111827;
    font-size: 24px;
    margin-top: 4px;
}

.meal-print-header span {
    display: block;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
    margin-top: 6px;
}

.meal-print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.meal-print-table th,
.meal-print-table td {
    border: 1px solid #111827;
    padding: 9px 10px;
    text-align: left;
}

.meal-print-table th {
    background: #e2e8f0;
    font-weight: 900;
}

.print-check-cell {
    width: 80px;
    height: 30px;
}

.meal-print-footer {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 26px;
    color: #111827;
    font-size: 13px;
    font-weight: 800;
}

.print-warning {
    border: 1px solid #f59e0b;
    background: #fff7ed;
    color: #92400e;
    font-weight: 800;
    padding: 12px;
    margin-bottom: 14px;
}

/* Visual refresh: clearer hierarchy, separators, and denser admin readability. */
.auth-page {
    background:
        linear-gradient(135deg, rgba(20, 95, 196, 0.08), rgba(15, 143, 121, 0.08)),
        var(--bg);
}

.auth-panel,
.welcome,
.hero-panel,
.stat-card,
.module-card,
.table-panel,
.sms-template {
    border-color: var(--line-strong);
    box-shadow: 0 14px 38px rgba(23, 32, 51, 0.07);
}

.auth-panel {
    position: relative;
    overflow: hidden;
}

.auth-panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.login-form {
    gap: 12px;
}

.login-form input,
.filters input,
.filters select,
.inline-select-form select,
.branch-select-form select,
.paid-input,
.numeric-cell-input,
.note-modal-body textarea,
.note-modal-body input[type="date"],
.note-modal-body input[type="text"] {
    border-color: var(--line-strong);
}

.app-shell {
    background:
        linear-gradient(180deg, #ffffff 0, #ffffff 86px, transparent 86px),
        var(--bg);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    border-right-color: var(--line-strong);
    box-shadow: 10px 0 26px rgba(23, 32, 51, 0.035);
}

.sidebar-brand {
    border-bottom: 1px solid var(--line);
    padding-bottom: 18px;
}

.side-nav {
    gap: 4px;
}

.side-nav a {
    position: relative;
    border: 1px solid transparent;
    border-radius: 7px;
}

.side-nav a + a {
    margin-top: 3px;
}

.side-nav a::before {
    content: "";
    position: absolute;
    left: 0;
    top: 9px;
    bottom: 9px;
    width: 3px;
    border-radius: 999px;
    background: transparent;
}

.side-nav a:hover {
    border-color: #dbe8fb;
    background: #f6faff;
}

.side-nav a.active {
    border-color: rgba(20, 95, 196, 0.24);
    background: #edf5ff;
    color: var(--primary);
}

.side-nav a.active::before {
    background: var(--primary);
}

.main-area {
    background: var(--bg);
}

.panel-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom-color: var(--line-strong);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 10px 28px rgba(23, 32, 51, 0.045);
    backdrop-filter: blur(12px);
}

.user-menu {
    min-height: 42px;
    border-left: 1px solid var(--line);
    padding-left: 18px;
}

.panel-content {
    gap: 26px;
}

.panel-content > section {
    scroll-margin-top: 96px;
}

.panel-content > section + section {
    position: relative;
}

.panel-content > section + section::before {
    content: "";
    position: absolute;
    top: -14px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

.hero-panel {
    border-left: 5px solid var(--primary);
    background:
        linear-gradient(90deg, rgba(20, 95, 196, 0.06), rgba(15, 143, 121, 0.035)),
        #ffffff;
}

.hero-panel h2 {
    max-width: 860px;
}

.hero-panel p:last-child {
    color: #526178;
}

.primary-action,
.secondary-action,
.user-menu a,
.filters button,
.receipt-upload button,
.mini-action,
.icon-action,
.modal-close,
.sms-send-form button,
.sms-send-button {
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.primary-action,
.filters button,
.receipt-upload button,
.sms-send-form button,
.sms-send-button {
    box-shadow: 0 8px 18px rgba(20, 95, 196, 0.18);
}

.primary-action:hover,
.filters button:hover,
.receipt-upload button:hover,
.sms-send-form button:hover,
.sms-send-button:hover {
    transform: translateY(-1px);
}

.secondary-action:hover,
.user-menu a:hover,
.mini-action:hover,
.icon-action:hover,
.modal-close:hover {
    box-shadow: 0 8px 18px rgba(23, 32, 51, 0.08);
}

.stats-grid {
    gap: 14px;
}

.stat-card {
    position: relative;
    overflow: hidden;
    border-left: 4px solid #d8e0ec;
    background: #ffffff;
}

.stat-card:nth-child(1) {
    border-left-color: var(--primary);
}

.stat-card:nth-child(2) {
    border-left-color: var(--accent);
}

.stat-card:nth-child(3) {
    border-left-color: #c27a12;
}

.stat-card:nth-child(4) {
    border-left-color: #b4232b;
}

.stat-card span {
    color: #5c6a80;
}

.module-card {
    border-top: 4px solid #d8e0ec;
    background: #ffffff;
}

.module-card h3 {
    padding-bottom: 9px;
    border-bottom: 1px solid var(--line);
}

.module-dot {
    background: var(--accent);
}

.table-panel {
    background: #ffffff;
}

.table-panel .section-headıng {
    margin: 0;
    border-bottom: 1px solid var(--line-strong);
    background: var(--surface-soft);
    padding: 18px 20px;
}

.institution-summary-grid {
    padding: 18px;
}

.institution-summary-card {
    border-color: var(--line-strong);
}

.filters {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    border-bottom-color: var(--line-strong);
    background: var(--surface-soft);
}

.filters label {
    padding-right: 12px;
    border-right: 1px solid var(--line);
}

.filters label:last-of-type {
    border-right: 0;
}

.filters button,
.filters > a {
    width: 100%;
}

.filters button {
    align-self: end;
}

.student-import-form {
    grid-template-columns: minmax(420px, 1.35fr) minmax(220px, 0.7fr) minmax(220px, 0.7fr) 1fr;
    align-items: end;
}

.student-import-form label:first-child {
    min-width: 0;
}

.student-import-form input[type="file"] {
    width: 100%;
    min-width: 320px;
    padding: 8px 10px;
}

.excel-table-wrap {
    background:
        linear-gradient(90deg, rgba(20, 95, 196, 0.05), transparent 28px) left top / 28px 100% no-repeat,
        #ffffff;
}

.excel-table th,
.excel-table td {
    border-bottom-color: var(--line);
    border-right-color: var(--line);
}

.excel-table th {
    border-bottom: 1px solid var(--line-strong);
    background: #eef3f9;
    color: #2f3f55;
}

.excel-table th:first-child,
.excel-table td:first-child {
    border-left: 1px solid var(--line);
}

.excel-table tbody tr:nth-child(even) {
    background: #fbfdff;
}

.excel-table tbody tr:hover {
    background: #f2f7ff;
}

.name-cell,
.excel-table td strong {
    color: #142033;
}

.branch-pill,
.institution-pill,
.code-pill,
.status {
    border: 1px solid transparent;
}

.branch-pill {
    border-color: rgba(20, 95, 196, 0.16);
}

.institution-pill {
    border-color: rgba(15, 143, 121, 0.18);
}

.code-pill {
    border-color: rgba(91, 33, 182, 0.18);
}

.status.paid {
    border-color: rgba(8, 116, 92, 0.18);
}

.status.partial {
    border-color: rgba(138, 90, 0, 0.18);
}

.status.unpaid {
    border-color: rgba(168, 36, 36, 0.18);
}

.receipt-upload {
    border-left: 1px solid var(--line);
    padding-left: 10px;
}

.empty-state {
    background: var(--surface-soft);
    color: #526178;
}

@media print {
    .no-print {
        display: none !important;
    }

    .print-page {
        background: #fff;
    }

    .meal-print-sheet {
        width: 100%;
        min-height: auto;
        padding: 0;
    }

    .meal-print-header {
        padding-bottom: 6px;
        margin-bottom: 7px;
    }

    .meal-print-header p {
        font-size: 10px;
    }

    .meal-print-header h1 {
        font-size: 17px;
        margin-top: 1px;
    }

    .meal-print-header span {
        font-size: 10px;
        margin-top: 2px;
    }

    .meal-print-table {
        font-size: 11px;
        table-layout: fixed;
    }

    .meal-print-table th,
    .meal-print-table td {
        padding: 2px 5px;
        line-height: 1.08;
        vertical-align: middle;
    }

    .meal-print-table th:nth-child(1),
    .meal-print-table td:nth-child(1) {
        width: 28px;
        text-align: center;
    }

    .meal-print-table th:nth-child(3),
    .meal-print-table td:nth-child(3) {
        width: 44px;
        text-align: center;
    }

    .meal-print-table th:nth-child(4),
    .meal-print-table td:nth-child(4) {
        width: 92px;
    }

    .print-check-cell {
        height: 14px;
        width: 44px;
    }

    .meal-print-footer {
        gap: 8px;
        margin-top: 8px;
        font-size: 10px;
    }
}

@media (max-width: 980px) {
    .auth-shell-premium {
        grid-template-columns: 1fr;
        width: min(100%, 480px);
        min-height: auto;
    }

    .auth-showcase {
        display: none;
    }

    .auth-panel-premium {
        border-radius: 18px;
    }

    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        width: 100%;
        flex-basis: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line-strong);
        box-shadow: 0 10px 26px rgba(23, 32, 51, 0.04);
    }

    body.sidebar-collapsed .sidebar,
    body.sidebar-collapsed:not(.sidebar-pinned) .sidebar:hover {
        width: 100%;
        flex-basis: auto;
        padding-left: 18px;
        padding-right: 18px;
    }

    body.sidebar-collapsed .sidebar-brand img,
    body.sidebar-collapsed .nav-label {
        opacity: 1;
        width: auto;
        pointer-events: auto;
    }

    body.sidebar-collapsed .sidebar-mini-brand {
        display: none;
    }

    body.sidebar-collapsed .sidebar-controls {
        grid-template-columns: repeat(2, 34px);
        justify-content: start;
        padding: 0 8px;
    }

    .side-nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    body.sidebar-collapsed .side-nav a {
        justify-content: flex-start;
        gap: 10px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .stats-grid,
    .institution-summary-grid,
    .monthly-account-grid,
    .module-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filters label {
        border-right: 0;
        padding-right: 0;
    }

    .accounting-grid {
        grid-template-columns: 1fr;
    }

    .accounting-report-pivot-grid {
        grid-template-columns: 1fr;
    }

    .accounting-report-filter {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .manual-entry-grid {
        grid-template-columns: 1fr;
    }

    .entry-form-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .meal-manual-form {
        grid-template-columns: 1fr;
    }

    .entry-note-field {
        grid-column: span 2;
    }

    .category-rule-form {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 680px) {
    .panel-topbar,
    .hero-panel {
        align-items: flex-start;
        flex-direction: column;
    }

    .sms-hero-actions {
        width: 100%;
        justify-items: stretch;
    }

    .accounting-sms-action {
        width: 100%;
    }

    .accounting-sms-form {
        width: 100%;
        justify-items: stretch;
    }

    .accounting-report-button {
        width: 100%;
    }

    .sms-toggle {
        width: 100%;
    }

    .panel-content,
    .panel-topbar {
        padding-left: 18px;
        padding-right: 18px;
    }

    .panel-topbar {
        position: static;
    }

    .side-nav,
    .stats-grid,
    .institution-summary-grid,
    .monthly-account-grid,
    .monthly-account-lines,
    .module-grid,
    .accounting-report-filter,
    .pivot-total-grid,
    .filters {
        grid-template-columns: 1fr;
    }

    .action-row {
        justify-content: flex-start;
        width: 100%;
    }

    .pivot-detail-row {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .action-row .primary-action,
    .action-row .secondary-action {
        width: 100%;
    }

    .user-menu {
        flex-wrap: wrap;
        border-left: 0;
        padding-left: 0;
    }

    .period-filter {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .accounting-control-group {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .accounting-day-filter,
    .accounting-month-filter {
        width: 100%;
    }

    .entry-form-fields {
        grid-template-columns: 1fr;
    }

    .entry-note-field {
        grid-column: span 1;
    }

    .category-rule-form {
        grid-template-columns: 1fr;
    }

    .institution-modal-body {
        grid-template-columns: 1fr;
    }

    .sms-preview-body {
        grid-template-columns: 1fr;
    }

    .phone-mockup {
        justify-self: center;
        min-height: 500px;
    }

    .phone-screen {
        min-height: 458px;
    }
}
.payment-lookup-page {
    min-height: 100vh;
    min-height: 100svh;
    background:
        linear-gradient(180deg, #eef6f3 0%, #f7faf9 42%, #ffffff 100%);
}

.payment-lookup-shell {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 100vh;
    min-height: 100svh;
    padding: 18px 14px 32px;
}

.payment-lookup-logo {
    display: block;
    width: clamp(112px, 42vw, 176px);
    max-height: 96px;
    height: auto;
    margin: 0 auto 16px;
    object-fit: contain;
}

.payment-lookup-card-top {
    padding: 28px 24px 18px;
    text-align: center;
    border-bottom: 1px solid #e3ece8;
    background: #f8fbfa;
}

.payment-lookup-card-top .eyebrow {
    margin-bottom: 6px;
    color: #0f766e;
    letter-spacing: 0;
}

.payment-lookup-card-top h1 {
    margin: 0 0 10px;
    font-size: 28px;
    font-weight: 800;
    color: #16202a;
    letter-spacing: 0;
}

.payment-lookup-copy {
    max-width: 360px;
    margin: 0 auto;
    color: #526170;
    font-size: 15px;
    line-height: 1.5;
}

.payment-lookup-panel {
    width: min(100%, 480px);
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid #dce8e4;
    background: #ffffff;
    box-shadow: 0 22px 60px rgba(28, 47, 42, 0.14);
}

.payment-lookup-panel .card-body {
    display: grid;
    gap: 18px;
}

.payment-lookup-panel .form-label {
    color: #24313d;
    font-weight: 700;
}

.payment-lookup-panel .form-control {
    min-height: 54px;
    border-color: #cfddd8;
    border-radius: 8px;
    color: #17212b;
    font-weight: 700;
}

.payment-lookup-panel .form-control:focus {
    border-color: #0f766e;
    box-shadow: 0 0 0 0.2rem rgba(15, 118, 110, 0.15);
}

.payment-lookup-panel .btn-primary {
    min-height: 52px;
    border-color: #0f766e;
    background: #0f766e;
    border-radius: 8px;
    font-weight: 800;
}

.payment-lookup-panel .btn-primary:hover,
.payment-lookup-panel .btn-primary:focus {
    border-color: #0b5f59;
    background: #0b5f59;
}

.payment-lookup-panel .btn-outline-secondary {
    min-height: 48px;
    border-radius: 8px;
    font-weight: 700;
}

.payment-reference {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid #cfddd8;
    border-radius: 8px;
    background: #f8fbfa;
}

.payment-reference span,
.bank-info span,
.payment-result-header span,
.payment-result-grid dt {
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.payment-reference strong {
    font-size: 18px;
    letter-spacing: 0;
    color: #17212b;
}

.code-input {
    text-align: center;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 0;
}

.payment-result-stack {
    display: grid;
    gap: 16px;
}

.payment-result {
    padding: 16px;
    border: 1px solid #dce8e4;
    border-radius: 8px;
    background: #ffffff;
}

.payment-result-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.payment-result-header h2 {
    margin: 4px 0;
    color: #16202a;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0;
}

.payment-result-header p {
    margin: 0;
    color: #64748b;
}

.payment-result-header > strong {
    white-space: nowrap;
    color: #0f766e;
    font-size: 22px;
}

.payment-result-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
}

.payment-result-grid div {
    min-width: 0;
    padding: 12px;
    border-radius: 8px;
    background: #f8fbfa;
}

.payment-result-grid dd {
    margin: 4px 0 0;
    color: #16202a;
    font-weight: 800;
}

.sms-table-wrap .excel-table {
    table-layout: fixed;
}

.sms-table-wrap .excel-table th,
.sms-table-wrap .excel-table td {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.sms-table-wrap .excel-table th:nth-child(1),
.sms-table-wrap .excel-table td:nth-child(1) {
    width: 104px;
}

.sms-table-wrap .excel-table th:nth-child(2),
.sms-table-wrap .excel-table td:nth-child(2) {
    width: 170px;
}

.sms-table-wrap .excel-table .name-cell {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.25;
}

.sms-table-wrap .excel-table .branch-pill {
    max-width: 100%;
    min-width: 0;
    white-space: nowrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.1;
    text-align: center;
}

.sms-table-wrap .excel-table td:nth-child(3) {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.bank-info {
    display: grid;
    gap: 10px;
    padding: 18px 16px;
    border-radius: 8px;
    background: #17212b;
    color: #ffffff;
}

.bank-info h2 {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 800;
}

.bank-info-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}

.bank-info p {
    display: grid;
    gap: 2px;
    margin: 0;
    min-width: 0;
}

.bank-info span {
    color: #cbd5e1;
}

.bank-info strong {
    overflow-wrap: anywhere;
}

.bank-copy-button {
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    min-height: 36px;
    padding: 0 12px;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
    white-space: nowrap;
}

.bank-copy-button:hover,
.bank-copy-button:focus {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.48);
}

.bank-copy-button.copied {
    background: #dcfce7;
    border-color: #dcfce7;
    color: #166534;
}

@media (max-width: 991.98px) {
    .payment-lookup-shell {
        align-items: flex-start;
    }
}

@media (max-width: 575.98px) {
    .payment-lookup-page {
        background: #f3f8f6;
    }

    .payment-lookup-shell {
        display: block;
        min-height: auto;
        padding: 8px;
    }

    .payment-lookup-panel {
        width: 100%;
        min-height: calc(100svh - 16px);
        border-radius: 8px;
    }

    .payment-lookup-card-top {
        padding: 16px 14px 14px;
    }

    .payment-lookup-logo {
        width: clamp(96px, 34vw, 132px);
        max-height: 74px;
        margin-bottom: 10px;
    }

    .payment-lookup-card-top h1 {
        font-size: 22px;
        margin-bottom: 8px;
    }

    .payment-lookup-copy {
        font-size: 13px;
        line-height: 1.45;
    }

    .payment-lookup-panel .card-body {
        gap: 14px;
        padding: 14px !important;
    }

    .payment-lookup-panel .form-control {
        min-height: 50px;
        font-size: 16px;
    }

    .payment-lookup-panel .btn-primary {
        min-height: 50px;
        font-size: 16px;
    }

    .payment-lookup-panel .btn-outline-secondary {
        min-height: 46px;
        font-size: 15px;
    }

    .payment-reference {
        gap: 8px;
        padding: 12px;
    }

    .payment-reference strong {
        font-size: 16px;
        overflow-wrap: anywhere;
    }

    .code-input {
        font-size: 24px;
    }

    .payment-result-header,
    .payment-reference {
        display: grid;
    }

    .payment-result-header > strong {
        white-space: normal;
        font-size: 20px;
    }

    .payment-result-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .payment-result {
        padding: 14px;
    }

    .payment-result-header {
        gap: 8px;
        margin-bottom: 14px;
    }

    .payment-result-header h2,
    .bank-info h2 {
        font-size: 18px;
    }

    .payment-result-grid div {
        padding: 10px 12px;
    }

    .bank-info {
        gap: 12px;
        padding: 16px 14px;
    }

    .bank-info-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
    }

    .bank-info strong {
        font-size: 14px;
        line-height: 1.35;
    }

    .bank-copy-button {
        align-self: center;
        min-height: 34px;
        padding: 0 10px;
        font-size: 12px;
    }
}

@media (max-width: 359.98px) {
    .payment-lookup-shell {
        padding: 0;
    }

    .payment-lookup-panel {
        min-height: 100svh;
        border-radius: 0;
        border-width: 0;
    }

    .payment-lookup-card-top {
        padding: 14px 12px 12px;
    }

    .payment-lookup-logo {
        width: clamp(82px, 32vw, 112px);
        max-height: 62px;
    }

    .payment-lookup-panel .card-body {
        padding: 12px !important;
    }

    .bank-info-row {
        grid-template-columns: 1fr;
    }

    .bank-copy-button {
        justify-self: stretch;
    }
}

/* Modern panel refresh */
:root {
    --bg: #eef3f8;
    --panel: #ffffff;
    --text: #142033;
    --muted: #66758a;
    --line: #dce4ef;
    --line-strong: #c8d3e2;
    --primary: #1f6feb;
    --primary-dark: #1756ba;
    --accent: #0f9f8f;
    --surface-soft: #f6f9fd;
    --surface-warm: #fff8e7;
    --shadow-soft: 0 14px 38px rgba(20, 32, 51, 0.08);
    --shadow-lift: 0 22px 58px rgba(20, 32, 51, 0.12);
}

body.panel-page {
    background:
        radıal-gradient(circle at 0 0, rgba(31, 111, 235, 0.11), transparent 34%),
        linear-gradient(135deg, #f7fafd 0%, #eef3f8 42%, #f5f8fb 100%);
    color: var(--text);
}

.app-shell {
    grid-template-columns: 282px minmax(0, 1fr);
}

.sidebar {
    width: 282px;
    flex-basis: 282px;
    border-right: 1px solid rgba(200, 211, 226, 0.82);
    background: rgba(255, 255, 255, 0.92) !important;
    box-shadow: 10px 0 34px rgba(20, 32, 51, 0.05);
    backdrop-filter: blur(18px);
}

.sidebar-brand {
    min-height: 68px;
    border: 1px solid rgba(220, 228, 239, 0.82);
    border-radius: 8px;
    background: linear-gradient(135deg, #ffffff, #f6f9fd);
}

.sidebar-control {
    border-radius: 8px;
    box-shadow: 0 7px 18px rgba(20, 32, 51, 0.05);
}

.side-nav {
    gap: 8px;
}

.side-nav a {
    position: relative;
    min-height: 46px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #536278;
    font-weight: 600;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.side-nav a:hover {
    border-color: rgba(31, 111, 235, 0.16);
    background: #eef5ff;
    color: #1f5fbf;
    transform: translateX(2px);
}

.side-nav a.active {
    border-color: rgba(31, 111, 235, 0.25);
    background: #1f6feb;
    color: #ffffff;
    box-shadow: inset 3px 0 0 var(--primary);
}

.side-nav a:hover .nav-icon {
    color: #1f5fbf;
}

.side-nav a.active .nav-icon {
    color: #ffffff;
}

body.sidebar-collapsed:not(.sidebar-pinned) .sidebar:hover {
    width: 282px;
    flex-basis: 282px;
}

.panel-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid rgba(200, 211, 226, 0.74);
    background: rgba(247, 250, 253, 0.86) !important;
    box-shadow: 0 12px 34px rgba(20, 32, 51, 0.06) !important;
    backdrop-filter: blur(16px);
}

.panel-topbar h1 {
    color: #111b2d;
    font-size: 25px;
    font-weight: 650;
}

.panel-topbar .eyebrow {
    color: #6b7a90 !important;
}

.user-menu {
    border: 1px solid rgba(220, 228, 239, 0.9);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.74);
    padding: 7px;
    font-weight: 500;
}

.user-menu a {
    border-color: rgba(31, 111, 235, 0.18);
    background: #f7faff;
    color: var(--primary);
}

.panel-content.container-fluid,
.panel-content {
    gap: 18px;
    max-width: 1760px;
    margin-inline: auto;
    padding: 30px 34px 44px;
}

.hero-panel,
.stat-card,
.module-card,
.table-panel,
.monthly-account-card {
    border: 1px solid rgba(220, 228, 239, 0.92);
    border-radius: 8px !important;
    box-shadow: var(--shadow-soft);
}

.hero-panel {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.98)),
        #ffffff;
    padding: 26px 30px;
}

.hero-panel::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: linear-gradient(180deg, var(--primary), var(--accent));
}

.hero-panel h2 {
    color: #111b2d;
    font-size: 24px;
    font-weight: 650;
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.stat-card {
    position: relative;
    overflow: hidden;
    min-height: 118px;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    padding: 20px 22px;
}

.stat-card::after {
    content: none;
}

.stat-card span {
    color: #66758a;
    font-size: 12px;
    font-weight: 600;
}

.stat-card strong {
    color: #111b2d;
    font-size: 29px;
    font-weight: 650;
}

.stat-card small {
    color: #8390a2;
    font-weight: 500;
}

.table-panel {
    background: rgba(255, 255, 255, 0.96);
}

.students-table-context {
    min-height: 48px;
    border-bottom: 1px solid rgba(220, 228, 239, 0.9);
    background: linear-gradient(135deg, #ffffff, #f6f9fd);
    padding: 11px 18px;
}

.students-table-context span {
    color: #8390a2;
    font-size: 11px;
    text-transform: uppercase;
}

.students-table-context strong {
    color: #172033;
    font-size: 14px;
    font-weight: 600;
}

.filters {
    grid-template-columns: minmax(140px, 0.55fr) minmax(260px, 1.35fr) minmax(180px, 0.8fr) minmax(150px, 0.65fr) minmax(150px, 0.65fr) auto auto minmax(130px, auto);
    gap: 12px;
    border-bottom: 1px solid rgba(220, 228, 239, 0.9);
    background: #fbfdff;
    padding: 16px 18px;
}

.filters label {
    color: #66758a;
    font-size: 12px;
    font-weight: 600;
}

.filters input,
.filters select {
    min-height: 42px;
    border-color: rgba(200, 211, 226, 0.95);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 1px 0 rgba(20, 32, 51, 0.03);
}

.filters input:focus,
.filters select:focus {
    border-color: rgba(31, 111, 235, 0.65);
    outline: 3px solid rgba(31, 111, 235, 0.14);
}

.filters button,
.receipt-upload button,
.primary-action,
.btn-primary {
    border-color: var(--primary) !important;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), #2f7ff4) !important;
    box-shadow: 0 10px 20px rgba(31, 111, 235, 0.18);
    font-weight: 600;
}

.filters button:hover,
.receipt-upload button:hover,
.primary-action:hover,
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary)) !important;
}

.filters > a,
.secondary-action,
.btn-outline-secondary {
    border-radius: 8px;
    color: #536278;
}

.filters.student-import-form {
    grid-template-columns: minmax(560px, 1fr) minmax(210px, 0.35fr) minmax(260px, 0.45fr);
    align-items: end;
}

.filters.student-import-form label {
    min-width: 0;
}

.filters.student-import-form input[type="file"] {
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.live-search-status {
    color: #66758a;
}

.excel-table-wrap {
    background: #ffffff;
}

.students-table-wrap {
    border-radius: 0 0 8px 8px;
}

.excel-table {
    font-size: 13px;
}

.students-table {
    font-size: 12px;
}

.excel-table th {
    background: #f4f7fb;
    color: #536278;
    box-shadow: inset 0 -1px 0 rgba(200, 211, 226, 0.9);
}

.excel-table th,
.excel-table td {
    border-right-color: #eef2f7;
    border-bottom-color: #e8eef6;
}

.students-table th,
.students-table td {
    padding: 7px 8px;
}

.students-table tbody tr {
    transition: background 0.12s ease, box-shadow 0.12s ease;
}

.students-table tbody tr:nth-child(even) {
    background: #fcfdff;
}

.students-table tbody tr:hover {
    background: #f2f7ff;
    box-shadow: inset 3px 0 0 rgba(31, 111, 235, 0.55);
}

.students-table td[data-row-number] {
    color: #7a8798;
    font-weight: 600;
    text-align: center;
}

.name-preview span,
.note-preview span,
.date-cell span {
    color: #142033;
}

.icon-action,
.mini-action,
.modal-close {
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 6px 14px rgba(20, 32, 51, 0.05);
}

.icon-action:hover,
.mini-action:hover,
.modal-close:hover {
    border-color: rgba(31, 111, 235, 0.35);
    background: #edf5ff;
}

.day {
    border-radius: 7px;
    background: #f9fbfd;
}

.day.on {
    border-color: rgba(15, 159, 143, 0.36);
    background: #e8f8f5;
    color: #087f73;
}

.status,
.branch-select-form select,
.inline-select-form select,
.meal-toggle,
.paid-input,
.numeric-cell-input {
    border-radius: 8px;
}

.branch-select-form select {
    background: #edf5ff;
    color: #1f5fbf;
}

.status.paid,
.meal-toggle.active,
.receipt-badge {
    background: #e8f8f5;
    color: #087f73;
}

.status.partial {
    background: #fff4d6;
    color: #8f5e00;
}

.status.unpaid,
.meal-toggle.passive {
    background: #fff0f0;
    color: #b4232a;
}

.paid-input,
.numeric-cell-input {
    background: #f7f9fc;
}

.paid-input:focus,
.numeric-cell-input:focus {
    outline-color: rgba(31, 111, 235, 0.14);
}

.receipt-upload {
    align-items: end;
}

.receipt-actions {
    color: #66758a;
}

.document-modal,
.note-modal {
    border-radius: 8px;
    box-shadow: 0 30px 90px rgba(20, 32, 51, 0.26);
}

@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filters.student-import-form {
        grid-template-columns: minmax(360px, 1fr) minmax(190px, 0.5fr) minmax(190px, 0.5fr);
    }
}

@media (max-width: 991.98px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        width: 100%;
        flex-basis: auto;
        box-shadow: none;
    }

    .panel-topbar {
        position: static;
    }
}

@media (max-width: 680px) {
    .panel-content.container-fluid,
    .panel-content {
        padding: 18px;
    }

    .stats-grid,
    .filters {
        grid-template-columns: 1fr;
    }

    .filters.student-import-form {
        grid-template-columns: 1fr;
    }

    .filters.student-import-form input[type="file"] {
        min-width: 0;
    }

    .user-menu {
        width: 100%;
        justify-content: space-between;
    }
}

body.panel-page {
    font-weight: 400;
}

body.panel-page .eyebrow,
body.panel-page .side-nav a,
body.panel-page .filters label,
body.panel-page .students-table-context span,
body.panel-page .excel-table th,
body.panel-page .stat-card span,
body.panel-page .stat-card small,
body.panel-page .module-card p,
body.panel-page .monthly-account-head span,
body.panel-page .monthly-account-actions span,
body.panel-page .monthly-account-lines dt,
body.panel-page .live-search-status,
body.panel-page .receipt-upload label,
body.panel-page .receipt-actions {
    font-weight: 500;
}

body.panel-page h1,
body.panel-page h2,
body.panel-page h3,
body.panel-page .stat-card strong,
body.panel-page .module-card h3,
body.panel-page .monthly-account-head h2,
body.panel-page .monthly-account-head strong,
body.panel-page .monthly-account-lines dd,
body.panel-page .date-cell span,
body.panel-page .name-cell,
body.panel-page .students-table .name-cell {
    font-weight: 600;
}

body.panel-page .btn,
body.panel-page button,
body.panel-page select,
body.panel-page input,
body.panel-page .status,
body.panel-page .branch-pill,
body.panel-page .institution-pill,
body.panel-page .code-pill,
body.panel-page .mini-action,
body.panel-page .icon-action,
body.panel-page .text-action,
body.panel-page .primary-action,
body.panel-page .secondary-action,
body.panel-page .day,
body.panel-page .meal-toggle span,
body.panel-page .paid-input,
body.panel-page .numeric-cell-input {
    font-weight: 500;
}

.bulk-save-button {
    min-height: 42px;
    border: 1px solid #16a34a;
    border-radius: 8px;
    background: #16a34a;
    color: #ffffff;
    font-weight: 700;
    padding: 0 14px;
}

.bulk-save-button:disabled {
    border-color: #cbd5e1;
    background: #e2e8f0;
    color: #64748b;
    cursor: not-allowed;
    box-shadow: none;
}

.bulk-save-status {
    align-self: center;
    color: #946200;
    font-weight: 700;
}

.payment-total-cell {
    display: grid;
    gap: 6px;
    min-width: 120px;
}

.paid-total {
    font-weight: 800;
    color: var(--text);
    white-space: nowrap;
}

.payment-history-text {
    display: block;
    min-width: 170px;
    max-width: 240px;
    white-space: pre-line;
    line-height: 1.35;
    font-size: .82rem;
    color: var(--text);
}

.has-pending-change {
    background: #fffaf0;
}

.pending-change {
    border-color: #f59e0b !important;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.16) !important;
}

.day.pending-change,
.month-day.pending-change,
.meal-toggle.pending-change,
.note-preview span.pending-change,
.name-preview span.pending-change,
.date-cell span.pending-change {
    outline: 2px solid rgba(245, 158, 11, 0.35);
    outline-offset: 2px;
}

.students-table .month-calendar-cell {
    min-width: 224px;
}

.month-calendar {
    display: grid;
    grid-template-columns: repeat(7, 26px);
    gap: 3px;
    align-items: center;
}

.month-calendar-weekday,
.month-calendar-spacer {
    width: 26px;
    height: 18px;
}

.month-calendar-weekday {
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
}

.month-day {
    width: 26px;
    height: 24px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #ffffff;
    color: var(--text);
    cursor: pointer;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
}

.month-day.on {
    border-color: rgba(15, 159, 143, 0.38);
    background: #e8f8f5;
    color: #087f73;
}

.month-day.closed,
.month-day:disabled {
    cursor: not-allowed;
    border-color: #e2e8f0;
    background: #f1f5f9;
    color: #94a3b8;
}

.month-day:hover:not(:disabled) {
    border-color: rgba(31, 111, 235, 0.35);
    background: #edf5ff;
}

.delete-student-form {
    margin: 0;
}

.danger-action {
    border-color: #ffc9c9;
    color: var(--danger-text);
}

.danger-action:hover {
    border-color: #f5a3a3;
    background: var(--danger-bg);
    color: var(--danger-text);
}

.credit-layout {
    display: grid;
    grid-template-columns: minmax(520px, 0.82fr) minmax(720px, 1.18fr);
    gap: 18px;
    align-items: start;
}

.credit-main,
.credit-detail {
    display: grid;
    gap: 18px;
}

.credit-open-form,
.credit-edit-tab-form,
.credit-item-form {
    overflow: hidden;
}

.credit-tabs-wrap .excel-table {
    min-width: 900px;
}

.credit-row-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.selected-row {
    background: #eef5ff;
}

.credit-detail-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
    gap: 10px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-soft);
    padding: 14px;
}

.credit-detail-summary span {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.credit-detail-summary strong {
    color: var(--text);
    font-size: 18px;
}

.credit-edit-tab-form {
    border-bottom: 1px solid var(--line);
}

.table-input {
    width: 100%;
    min-height: 32px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    padding: 6px 8px;
    color: var(--text);
    font-size: 12px;
}

.table-input.date-input {
    min-width: 126px;
}

.table-input.product-input {
    min-width: 150px;
}

.table-input.note-input {
    min-width: 180px;
}

.credit-note-cell {
    min-width: 200px;
}

.table-input.number-input {
    min-width: 86px;
}

.inline-update-form,
.inline-delete-form {
    margin: 0;
}

.credit-payment-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
    border-top: 1px solid var(--line);
    padding: 14px;
}

.credit-payment-form button {
    grid-column: 1 / -1;
}

.credit-payment-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.credit-payment-form input,
.credit-payment-form select {
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px 10px;
}

.credit-empty-detail {
    padding: 22px;
}

.credit-delete-tab-form {
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid var(--line);
    padding: 0 14px 14px;
}

@media (max-width: 1100px) {
    .credit-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .students-table-wrap {
        max-height: calc(100vh - 260px);
        min-height: 320px;
    }
}

.students-table-wrap {
    max-width: 100%;
    overflow: auto;
}

.students-table {
    min-width: 1940px;
    table-layout: fixed;
    font-size: 11px;
}

.students-table th,
.students-table td {
    overflow: hidden;
    vertical-align: middle;
    padding: 4px 5px;
}

.students-table th {
    position: sticky;
    top: 0;
    z-index: 4;
    white-space: nowrap;
    font-size: 10.5px;
}

.students-table th:nth-child(1),
.students-table td:nth-child(1) {
    width: 36px;
    text-align: center;
}

.students-table th:nth-child(2),
.students-table td:nth-child(2) {
    width: 82px;
}

.students-table th:nth-child(3),
.students-table td:nth-child(3) {
    width: 78px;
}

.students-table th:nth-child(4),
.students-table td:nth-child(4) {
    width: 58px;
}

.students-table th:nth-child(5),
.students-table td:nth-child(5) {
    width: 180px;
}

.students-table th:nth-child(6),
.students-table td:nth-child(6) {
    width: 128px;
}

.students-table th:nth-child(7),
.students-table td:nth-child(7) {
    width: 68px;
}

.students-table th:nth-child(8),
.students-table td:nth-child(8) {
    width: 176px;
}

.students-table th:nth-child(9),
.students-table td:nth-child(9) {
    width: 54px;
}

.students-table th:nth-child(10),
.students-table td:nth-child(10) {
    width: 64px;
}

.students-table th:nth-child(11),
.students-table td:nth-child(11),
.students-table th:nth-child(12),
.students-table td:nth-child(12) {
    width: 82px;
}

.students-table th:nth-child(13),
.students-table td:nth-child(13) {
    width: 76px;
}

.students-table th:nth-child(14),
.students-table td:nth-child(14) {
    width: 78px;
}

.students-table th:nth-child(15),
.students-table td:nth-child(15) {
    width: 112px;
}

.students-table th:nth-child(16),
.students-table td:nth-child(16) {
    width: 58px;
}

.students-table th:nth-child(17),
.students-table td:nth-child(17) {
    width: 86px;
}

.students-table th:nth-child(18),
.students-table td:nth-child(18) {
    width: 78px;
}

.students-table th:nth-child(19),
.students-table td:nth-child(19) {
    width: 82px;
}

.students-table th:nth-child(20),
.students-table td:nth-child(20) {
    width: 132px;
}

.students-table th:nth-child(21),
.students-table td:nth-child(21) {
    width: 150px;
}

.students-table th:nth-child(22),
.students-table td:nth-child(22) {
    width: 52px;
}

.students-table .grade-cell select,
.students-table .branch-select-form select,
.students-table .inline-select-form select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding-right: 20px;
    padding-left: 4px;
    text-overflow: ellipsis;
}

.students-table .grade-cell select {
    padding-right: 14px;
    text-align: center;
}

.students-table .name-cell,
.students-table .phone-cell,
.students-table td.note-cell,
.students-table .days-cell {
    min-width: 0;
    max-width: none;
}

.students-table .name-preview,
.students-table .compact-preview,
.students-table .note-preview {
    min-width: 0;
}

.students-table .name-preview span,
.students-table .compact-preview span,
.students-table .note-preview span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.students-table .numeric-cell-input,
.students-table .paid-input,
.students-table .money-input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding-inline: 4px;
}

.students-table .month-calendar {
    grid-template-columns: repeat(7, 20px);
    gap: 2px;
    width: 152px;
}

.students-table .month-calendar-weekday,
.students-table .month-calendar-spacer {
    width: 20px;
    height: 16px;
}

.students-table .month-day {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    font-size: 9px;
}

.credit-print-sheet {
    width: min(100%, 860px);
    min-height: 100vh;
    margin: 0 auto;
    background: #ffffff;
    padding: 28px;
}

.credit-print-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 2px solid #111827;
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.credit-print-header p,
.credit-print-header h1,
.credit-print-header span {
    margin: 0;
}

.credit-print-header p {
    color: #475569;
    font-size: 13px;
    font-weight: 800;
}

.credit-print-header h1 {
    color: #111827;
    font-size: 21px;
    margin-top: 4px;
}

.credit-print-header span {
    display: block;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
    margin-top: 6px;
}

.credit-print-meta,
.credit-print-totals {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.credit-print-meta div,
.credit-print-totals div {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    padding: 7px 8px;
}

.credit-print-meta span,
.credit-print-totals span {
    display: block;
    color: #475569;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.credit-print-meta strong,
.credit-print-totals strong {
    display: block;
    color: #111827;
    font-size: 15px;
    margin-top: 4px;
}

.credit-print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: fixed;
}

.credit-print-table th,
.credit-print-table td {
    border: 1px solid #111827;
    padding: 4px 6px;
    text-align: left;
    line-height: 1.2;
    vertical-align: top;
}

.credit-print-table th {
    background: #e2e8f0;
    font-weight: 900;
}

.credit-print-table th:nth-child(1),
.credit-print-table td:nth-child(1) {
    width: 76px;
}

.credit-print-table th:nth-child(3),
.credit-print-table td:nth-child(3) {
    width: 92px;
}

.credit-print-table th:nth-child(4),
.credit-print-table td:nth-child(4),
.credit-print-table th:nth-child(5),
.credit-print-table td:nth-child(5),
.credit-print-table th:nth-child(6),
.credit-print-table td:nth-child(6) {
    width: 72px;
}

.credit-print-note {
    color: #334155;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.credit-print-totals {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 10px;
}

.credit-print-totals .balance {
    background: #fff7ed;
    border-color: #f59e0b;
}

.credit-print-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid #cbd5e1;
    margin-top: 12px;
    padding-top: 8px;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
}

@media print {
    @page {
        size: A4 portrait;
        margin: 10mm;
    }

    .no-print {
        display: none !important;
    }

    .print-page {
        background: #ffffff;
    }

    .credit-print-sheet {
        width: 100%;
        min-height: auto;
        padding: 0;
        box-shadow: none;
        margin: 0;
    }

    .credit-print-header {
        display: flex;
        margin-bottom: 10px;
    }

    .credit-print-header h1 {
        font-size: 19px;
    }

    .credit-print-meta {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .credit-print-totals {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .credit-print-meta strong,
    .credit-print-totals strong {
        font-size: 13px;
    }

    .credit-print-footer {
        display: flex;
    }
}

@media screen and (max-width: 720px) {
    .credit-payment-form,
    .credit-print-meta,
    .credit-print-totals {
        grid-template-columns: 1fr;
    }

    .credit-print-header,
    .credit-print-footer {
        display: grid;
    }
}
.selected-sms-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid rgba(220, 228, 239, 0.9);
    padding: 14px 18px;
    background: #fbfdff;
}

.selected-sms-actions strong {
    color: #536278;
    font-size: 13px;
}

.sms-select-col {
    width: 42px;
    text-align: center;
}

.sms-select-col input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}
/* SMS panel table sizing overrides */
.sms-table-wrap {
    overflow-x: auto;
}

.sms-table-wrap .excel-table {
    width: 100%;
    min-width: 980px;
    table-layout: auto;
}

.sms-table-wrap .excel-table th,
.sms-table-wrap .excel-table td {
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
    vertical-align: middle;
}

.sms-table-wrap .excel-table th:nth-child(1),
.sms-table-wrap .excel-table td:nth-child(1) {
    width: 48px;
    min-width: 48px;
    text-align: center;
}

.sms-table-wrap .excel-table th:nth-child(2),
.sms-table-wrap .excel-table td:nth-child(2) {
    width: 170px;
    min-width: 170px;
}

.sms-table-wrap .excel-table th:nth-child(3),
.sms-table-wrap .excel-table td:nth-child(3) {
    width: 300px;
    min-width: 240px;
}

.sms-table-wrap .excel-table th:nth-child(4),
.sms-table-wrap .excel-table td:nth-child(4) {
    width: 210px;
    min-width: 190px;
    font-variant-numeric: tabular-nums;
}

.sms-table-wrap .excel-table th:nth-child(5),
.sms-table-wrap .excel-table td:nth-child(5) {
    width: 150px;
    min-width: 130px;
}

.sms-table-wrap .excel-table th:nth-child(6),
.sms-table-wrap .excel-table td:nth-child(6) {
    width: 260px;
    min-width: 220px;
}

.sms-table-wrap .excel-table .name-cell {
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
    line-height: 1.25;
}

.sms-table-wrap .sms-send-button {
    width: auto;
    min-width: 180px;
    padding-inline: 18px;
    white-space: nowrap;
}

.contract-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 0, rgba(20, 95, 196, 0.14), transparent 28%),
        linear-gradient(180deg, #f7fafc 0%, #edf3f8 100%);
    color: #172033;
}

.contract-shell {
    width: min(100%, 560px);
    min-height: 100vh;
    margin: 0 auto;
    padding: 18px 16px calc(178px + env(safe-area-inset-bottom));
}

.contract-header {
    padding: 8px 2px 18px;
}

.contract-logo {
    display: block;
    width: 132px;
    max-height: 52px;
    object-fit: contain;
    margin-bottom: 18px;
}

.contract-header h1 {
    margin: 0;
    font-size: 26px;
    line-height: 1.18;
}

.contract-version {
    display: inline-flex;
    margin-top: 12px;
    border: 1px solid #d8e0ec;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: #657084;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 800;
}

.contract-reader {
    height: min(58vh, 620px);
    min-height: 360px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid #d8e0ec;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 20px 55px rgba(23, 32, 51, 0.12);
    padding: 22px;
    scroll-behavior: smooth;
}

.contract-reader:focus {
    outline: 3px solid rgba(20, 95, 196, 0.18);
}

.contract-section + .contract-section {
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid #edf1f6;
}

.contract-section h2 {
    margin: 0 0 10px;
    font-size: 17px;
    line-height: 1.35;
}

.contract-section p {
    margin: 0;
    color: #455268;
    font-size: 15px;
    line-height: 1.68;
}

.contract-section p + p,
.contract-section p + ul,
.contract-section ul + p {
    margin-top: 10px;
}

.contract-section ul {
    margin: 10px 0 0;
    padding-left: 20px;
    color: #455268;
    font-size: 15px;
    line-height: 1.6;
}

.contract-section li + li {
    margin-top: 6px;
}

.contract-end-marker {
    margin-top: 24px;
    border-radius: 8px;
    background: #eef7f4;
    color: #0f766e;
    padding: 12px;
    text-align: center;
    font-size: 13px;
    font-weight: 800;
}

.contract-consent-bar {
    position: fixed;
    left: 50%;
    bottom: 0;
    z-index: 40;
    display: grid;
    gap: 12px;
    width: min(100%, 560px);
    transform: translateX(-50%);
    border: 1px solid #d8e0ec;
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -18px 45px rgba(23, 32, 51, 0.14);
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
    backdrop-filter: blur(14px);
}

.contract-scroll-state {
    border-radius: 8px;
    background: #fff7ed;
    color: #9a4f08;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}

.contract-scroll-state.ready {
    background: #e9f8f3;
    color: #08745c;
}

.contract-check {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    margin: 0;
    color: #172033;
    font-size: 14px;
    font-weight: 800;
}

.contract-check input {
    width: 22px;
    height: 22px;
    accent-color: #145fc4;
}

.contract-check input:disabled + span {
    color: #8a96a8;
}

.contract-consent-bar .btn:disabled {
      cursor: not-allowed;
      opacity: 0.58;
  }

.student-create-modal-body {
    grid-template-columns: 1fr 1fr;
}

.note-modal-body select,
.note-modal-body input[type="month"],
.note-modal-body input[type="tel"] {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    color: var(--text);
    font: inherit;
    padding: 8px 10px;
}

.note-modal-body select:focus,
.note-modal-body input[type="month"]:focus,
.note-modal-body input[type="tel"]:focus {
    border-color: var(--primary);
    outline: 3px solid rgba(22, 103, 217, 0.16);
}

.registration-page {
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(31, 111, 235, 0.08), rgba(15, 118, 110, 0.08)),
        #f5f7fb;
}

.registration-shell {
    width: min(100%, 560px);
}

.registration-panel {
    display: grid;
    gap: 18px;
    border-radius: 8px;
    padding: 32px 28px;
}

.registration-brand {
    display: grid;
    justify-items: center;
    gap: 12px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
    text-align: center;
}

.registration-brand img {
    width: min(58vw, 190px);
    height: auto;
}

.registration-brand h1 {
    margin: 0;
    color: var(--text);
    font-size: 28px;
    line-height: 1.15;
}

.registration-brand .eyebrow {
    margin-bottom: 6px;
}

.registration-form {
    display: grid;
    gap: 14px;
}

.registration-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.registration-form input,
.registration-form select {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    color: var(--text);
    font: inherit;
    padding: 9px 12px;
}

.registration-form input:focus,
.registration-form select:focus {
    border-color: rgba(31, 111, 235, 0.65);
    outline: 3px solid rgba(31, 111, 235, 0.14);
}

.registration-form .registration-consent {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: #fbfdff;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
}

.registration-form .registration-consent input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-height: 0;
    margin-top: 1px;
    padding: 0;
}

.registration-form .registration-consent a {
    color: var(--primary);
    font-weight: 700;
}

.registration-form button {
    min-height: 48px;
}

@media (max-width: 640px) {
    .student-create-modal-body {
        grid-template-columns: 1fr;
    }

    .registration-shell {
        width: 100%;
    }

    .registration-panel {
        min-height: 100vh;
        border-radius: 0;
        padding: 28px 18px 24px;
    }

    .registration-brand {
        gap: 10px;
        padding-bottom: 18px;
    }

    .registration-brand img {
        width: min(68vw, 210px);
    }

    .registration-brand h1 {
        font-size: 25px;
    }

    .registration-form {
        gap: 13px;
    }

    .registration-form input,
    .registration-form select,
    .registration-form button {
        min-height: 52px;
        font-size: 16px;
    }
}

  .contract-alert {
      margin-bottom: 14px;
}

.contract-result {
    display: grid;
    justify-items: center;
    gap: 14px;
    border: 1px solid #d8e0ec;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 20px 55px rgba(23, 32, 51, 0.12);
    padding: 34px 22px;
    text-align: center;
}

.contract-result-mark {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 999px;
    background: #10a37f;
    color: #ffffff;
    font-size: 28px;
    font-weight: 900;
}

.contract-result h2 {
    margin: 0;
    font-size: 22px;
}

.contract-result p {
    margin: 0;
    color: #657084;
}

@media (max-width: 575.98px) {
    .contract-shell {
        padding-inline: 12px;
    }

    .contract-reader {
        height: 56vh;
        min-height: 330px;
        padding: 18px;
    }

    .contract-header h1 {
        font-size: 24px;
    }
}
/* Student list table readability overrides */
.students-table-wrap {
    max-height: calc(100vh - 300px);
    overflow: auto;
}

.students-table-wrap .students-table {
    width: max-content;
    min-width: 2660px;
    table-layout: auto;
}

.students-table th,
.students-table td {
    padding: 7px 8px;
    vertical-align: middle;
}

.students-table th {
    line-height: 1.2;
}

.students-table th:nth-child(1),
.students-table td:nth-child(1) { min-width: 44px; text-align: center; }
.students-table th:nth-child(2),
.students-table td:nth-child(2) { min-width: 92px; }
.students-table th:nth-child(3),
.students-table td:nth-child(3) { min-width: 124px; }
.students-table th:nth-child(4),
.students-table td:nth-child(4) { min-width: 96px; }
.students-table th:nth-child(5),
.students-table td:nth-child(5) { min-width: 250px; }
.students-table th:nth-child(6),
.students-table td:nth-child(6) { min-width: 185px; }
.students-table th:nth-child(7),
.students-table td:nth-child(7) { min-width: 96px; }
.students-table th:nth-child(8),
.students-table td:nth-child(8) { min-width: 172px; }
.students-table th:nth-child(9),
.students-table td:nth-child(9) { min-width: 68px; }
.students-table th:nth-child(10),
.students-table td:nth-child(10) { min-width: 92px; }
.students-table th:nth-child(11),
.students-table td:nth-child(11) { min-width: 112px; }
.students-table th:nth-child(12),
.students-table td:nth-child(12) { min-width: 116px; }
.students-table th:nth-child(13),
.students-table td:nth-child(13) { min-width: 102px; }
.students-table th:nth-child(14),
.students-table td:nth-child(14) { min-width: 96px; }
.students-table th:nth-child(15),
.students-table td:nth-child(15) { min-width: 170px; }
.students-table th:nth-child(16),
.students-table td:nth-child(16) { min-width: 76px; }
.students-table th:nth-child(17),
.students-table td:nth-child(17) { min-width: 118px; }
.students-table th:nth-child(18),
.students-table td:nth-child(18) { min-width: 170px; }
.students-table th:nth-child(19),
.students-table td:nth-child(19) { min-width: 220px; }
.students-table th:nth-child(20),
.students-table td:nth-child(20) { min-width: 270px; }
.students-table th:nth-child(21),
.students-table td:nth-child(21) { min-width: 74px; }

.students-table .branch-select-form,
.students-table .grade-level-select-form,
.students-table .inline-select-form,
.students-table .meal-status-form,
.students-table .delete-student-form {
    margin: 0;
}

.students-table .branch-select-form select {
    width: 112px;
    min-width: 112px;
}

.students-table .grade-level-select-form select {
    width: 78px;
    min-width: 78px;
}

.students-table .inline-select-form select {
    width: 146px;
    min-width: 146px;
}

.students-table .branch-select-form select,
.students-table .grade-level-select-form select,
.students-table .inline-select-form select {
    min-height: 34px;
    padding: 5px 30px 5px 10px;
    border: 1px solid #b9c9df;
    border-radius: 8px;
    background-color: #f8fbff;
    color: #172033;
    font-size: 12px;
    font-weight: 700;
}

.students-table .numeric-cell-input,
.students-table .paid-input,
.students-table .money-input {
    width: 88px;
    min-width: 88px;
    max-width: none;
    min-height: 34px;
    padding: 5px 8px;
    border: 1px solid #b9c9df;
    border-radius: 8px;
    background: #f8fbff;
}

.students-table .name-cell {
    min-width: 250px;
}

.students-table .phone-cell {
    min-width: 185px;
}

.students-table .name-preview {
    grid-template-columns: minmax(190px, 1fr) 30px;
}

.students-table .compact-preview {
    grid-template-columns: minmax(140px, 1fr) 30px;
}

.students-table .date-cell {
    display: grid;
    min-width: 108px;
    grid-template-columns: 1fr;
    gap: 5px;
    justify-items: start;
}

.students-table .date-cell .mini-action {
    min-width: 68px;
}

.students-table .status {
    min-width: 148px;
    justify-content: center;
}

.students-table .meal-toggle {
    min-width: 78px;
    min-height: 38px;
    border-radius: 8px;
}

.students-table .mini-action,
.students-table .icon-action,
.students-table .receipt-upload button {
    border-radius: 8px;
    border: 1px solid #b9c9df;
    box-shadow: none;
}

.students-table .mini-action {
    min-width: 38px;
    min-height: 32px;
    padding: 0 10px;
}

.students-table .icon-action {
    min-width: 30px;
    min-height: 30px;
}

.students-table .receipt-upload {
    min-width: 210px;
    grid-template-columns: minmax(128px, 1fr) auto;
}

.students-table .receipt-upload input[type="file"] {
    max-width: 150px;
}

.students-table td.note-cell {
    min-width: 270px;
    max-width: 340px;
}

.students-table .note-preview {
    grid-template-columns: minmax(220px, 1fr) 30px;
}

.filters .btn,
.filters .bulk-save-button,
.filters a.btn {
    min-height: 40px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.students-table .js-numeric-field[data-field="total_day_count"] {
    width: 56px;
    min-width: 56px;
}
/* Wider workspace for dense operational screens */
.panel-content.container-fluid,
.panel-content {
    width: 100%;
    max-width: none;
    margin-inline: 0;
    padding: 20px 16px 40px;
}

.panel-topbar {
    padding-inline: 24px;
}

.students-table-panel {
    width: 100%;
}

/* Collapsed sidebar labels */
.sidebar {
    overflow: visible;
}

body.sidebar-collapsed.sidebar-pinned .side-nav a {
    position: relative;
}

body.sidebar-collapsed.sidebar-pinned .side-nav a::after {
    content: attr(data-label);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    z-index: 30;
    transform: translateY(-50%) translateX(-4px);
    min-width: max-content;
    max-width: 220px;
    padding: 7px 10px;
    border: 1px solid rgba(185, 201, 223, 0.95);
    border-radius: 7px;
    background: #ffffff;
    color: #172033;
    box-shadow: 0 12px 28px rgba(23, 32, 51, 0.14);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    transition: opacity 0.12s ease, transform 0.12s ease;
}

body.sidebar-collapsed.sidebar-pinned .side-nav a:hover::after,
body.sidebar-collapsed.sidebar-pinned .side-nav a:focus-visible::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

@media (max-width: 680px) {
    .panel-content.container-fluid,
    .panel-content {
        padding: 16px 12px 32px;
    }
}

.students-table th:nth-child(17),
.students-table td:nth-child(17) {
    min-width: 210px;
}

.students-table th:nth-child(18),
.students-table td:nth-child(18) {
    min-width: 120px;
}

.payment-history-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    white-space: normal;
    line-height: 1.35;
}

.payment-history-entry {
    display: block;
    font-variant-numeric: tabular-nums;
}

.payment-history-empty {
    color: var(--muted);
}

.payment-history-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    white-space: normal;
    line-height: 1.35;
}

.payment-history-entry {
    display: block;
    font-variant-numeric: tabular-nums;
}

.payment-history-badge {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: #e8f0ff;
    color: #214f9c;
    font-size: 11px;
    font-weight: 700;
}

.payment-history-empty {
    color: var(--muted);
}

/* Ledger module layout */
.ledger-layout {
    grid-template-columns: minmax(520px, 0.82fr) minmax(720px, 1.18fr);
}

.ledger-main,
.ledger-detail {
    min-width: 0;
}

.ledger-open-fields {
    grid-template-columns: 190px minmax(220px, 1fr) 190px 190px 190px;
}

.ledger-side-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ledger-side-fields .ledger-span-2,
.ledger-side-fields button {
    grid-column: 1 / -1;
}

.ledger-form-headıng {
    border-top: 1px solid var(--line);
    padding: 14px 14px 0;
}

.ledger-form-headıng h2 {
    font-size: 16px;
    margin: 0;
}

.ledger-debt-form,
.ledger-payment-entry-form {
    border-top: 1px solid var(--line);
}

.ledger-payment-entry-form {
    background: linear-gradient(180deg, rgba(236, 253, 245, .65), rgba(255, 255, 255, 0));
}

.ledger-entries-panel {
    min-height: 320px;
}

.ledger-entries-wrap .excel-table {
    min-width: 1280px;
}

.ledger-accounts-wrap .excel-table {
    min-width: 880px;
}

.ledger-type-input {
    min-width: 138px;
}

.ledger-method-input {
    min-width: 120px;
}

@media (max-width: 1420px) {
    .ledger-layout {
        grid-template-columns: minmax(500px, .9fr) minmax(620px, 1.1fr);
    }

    .ledger-open-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ledger-open-fields button {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1100px) {
    .ledger-layout,
    .ledger-open-fields,
    .ledger-side-fields {
        grid-template-columns: 1fr;
    }

    .ledger-side-fields .ledger-span-2,
    .ledger-side-fields button,
    .ledger-open-fields button {
        grid-column: auto;
    }
}
/* Ledger print sheet */
.ledger-print-sheet {
    width: min(100%, 1040px);
}

.ledger-print-meta {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ledger-print-meta .ledger-print-wide {
    grid-column: 1 / -1;
}

.ledger-print-table {
    table-layout: auto;
}

.ledger-print-table th:nth-child(1),
.ledger-print-table td:nth-child(1) {
    width: 78px;
}

.ledger-print-table th:nth-child(2),
.ledger-print-table td:nth-child(2) {
    width: 105px;
}

.ledger-print-table th:nth-child(4),
.ledger-print-table td:nth-child(4) {
    width: 58px;
    text-align: right;
}

.ledger-print-table th:nth-child(5),
.ledger-print-table td:nth-child(5) {
    width: 78px;
    text-align: right;
}

.ledger-print-table th:nth-child(6),
.ledger-print-table td:nth-child(6) {
    width: 88px;
}

.ledger-print-table th:nth-child(8),
.ledger-print-table td:nth-child(8),
.ledger-print-table th:nth-child(9),
.ledger-print-table td:nth-child(9),
.ledger-print-table th:nth-child(10),
.ledger-print-table td:nth-child(10) {
    width: 86px;
    text-align: right;
}

.ledger-print-totals {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ledger-payment-print-block {
    margin-top: 14px;
}

.ledger-payment-print-block h2 {
    color: #111827;
    font-size: 15px;
    margin: 0 0 8px;
}

.ledger-payment-print-table th:nth-child(1),
.ledger-payment-print-table td:nth-child(1) {
    width: 90px;
}

.ledger-payment-print-table th:nth-child(2),
.ledger-payment-print-table td:nth-child(2) {
    width: 110px;
}

.ledger-payment-print-table th:nth-child(4),
.ledger-payment-print-table td:nth-child(4) {
    width: 110px;
    text-align: right;
}

@media print {
    .ledger-print-sheet {
        width: 100%;
    }

    .ledger-print-meta {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media screen and (max-width: 720px) {
    .ledger-print-meta,
    .ledger-print-totals {
        grid-template-columns: 1fr;
    }
}
/* credit-layout-wide-note: right detail panel is intentionally wider for ledger and credit forms. */
@media (min-width: 1101px) and (max-width: 1420px) {
    .credit-layout:not(.ledger-layout) {
        grid-template-columns: minmax(500px, .9fr) minmax(620px, 1.1fr);
    }
}
/* Fixed two-column accounting/credit workspaces */
@media (min-width: 1101px) {
    .credit-layout,
    .ledger-layout,
    .credit-layout:not(.ledger-layout) {
        display: grid;
        grid-template-columns: minmax(0, 48fr) minmax(0, 52fr);
        gap: 18px;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .credit-main,
    .credit-detail,
    .ledger-main,
    .ledger-detail,
    .credit-layout > *,
    .ledger-layout > * {
        min-width: 0;
        max-width: 100%;
    }

    .credit-layout .excel-table-wrap,
    .ledger-layout .excel-table-wrap {
        max-width: 100%;
        overflow-x: auto;
        overflow-y: auto;
    }
}

@media (max-width: 1100px) {
    .credit-layout,
    .ledger-layout,
    .credit-layout:not(.ledger-layout) {
        grid-template-columns: minmax(0, 1fr);
        overflow: visible;
    }
}
/* Ledger list print sheet */
.ledger-list-print-sheet {
    width: min(100%, 1120px);
}

.ledger-list-print-totals {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ledger-list-print-table {
    table-layout: auto;
    font-size: 11px;
}

.ledger-list-print-table th,
.ledger-list-print-table td {
    padding: 4px 5px;
}

.ledger-list-print-table th:nth-child(1),
.ledger-list-print-table td:nth-child(1) {
    min-width: 150px;
}

.ledger-list-print-table th:nth-child(6),
.ledger-list-print-table td:nth-child(6),
.ledger-list-print-table th:nth-child(7),
.ledger-list-print-table td:nth-child(7),
.ledger-list-print-table th:nth-child(8),
.ledger-list-print-table td:nth-child(8) {
    text-align: right;
    white-space: nowrap;
}

@media print {
    @page {
        size: A4 landscape;
        margin: 9mm;
    }

    .ledger-list-print-sheet {
        width: 100%;
    }

    .ledger-list-print-totals {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media screen and (max-width: 720px) {
    .ledger-list-print-totals {
        grid-template-columns: 1fr;
    }
}