:root {
    color-scheme: light;
    --ink: #172a3a;
    --muted: #5d6f7b;
    --line: #e1e9e2;
    --surface: #ffffff;
    --background: #f4f7f1;
    --primary: #0b7a35;
    --primary-dark: #08602a;
    --gold: #e2b91c;
    --gold-soft: #f3d768;
    --success-bg: #e6f5ee;
    --success-ink: #17633c;
    --error-bg: #fff0ed;
    --error-ink: #9c3426;
    --star-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80' fill='none' stroke='%230b7a35' stroke-opacity='.055' stroke-width='1.2'%3E%3Crect x='20' y='20' width='40' height='40'/%3E%3Cpath d='M40 11.7 68.3 40 40 68.3 11.7 40Z'/%3E%3Ccircle cx='40' cy='40' r='6'/%3E%3Cpath d='M0 0 8 8M80 0 72 8M0 80 8 72M80 80 72 72'/%3E%3C/svg%3E");
    --star-pattern-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 80 80' fill='none' stroke='white' stroke-opacity='.11' stroke-width='1.2'%3E%3Crect x='20' y='20' width='40' height='40'/%3E%3Cpath d='M40 11.7 68.3 40 40 68.3 11.7 40Z'/%3E%3Ccircle cx='40' cy='40' r='6'/%3E%3Cpath d='M0 0 8 8M80 0 72 8M0 80 8 72M80 80 72 72'/%3E%3C/svg%3E");
    --diamond-band: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='12' viewBox='0 0 28 12'%3E%3Cpath d='M14 1 21 6 14 11 7 6Z' fill='%23e2b91c'/%3E%3Cpath d='M0 6H4M24 6H28' stroke='%23e2b91c' stroke-width='1.5'/%3E%3C/svg%3E");
    --star-marker: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='%23e2b91c'%3E%3Crect x='2.5' y='2.5' width='9' height='9'/%3E%3Cpath d='M7 0 14 7 7 14 0 7Z'/%3E%3C/svg%3E");
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--star-pattern), var(--background);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

.container {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
    padding: 28px 0 28px;
}

.page-header,
.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.page-header {
    margin-bottom: 28px;
}

.site-header {
    position: relative;
    margin-bottom: 28px;
    overflow: hidden;
    border-radius: 20px;
    background: var(--star-pattern-light), linear-gradient(135deg, #0b7a35 0%, #09672d 55%, #07522a 100%);
    box-shadow: 0 12px 30px rgb(8 96 42 / 22%);
    color: #fff;
}

.site-header .page-header {
    margin-bottom: 0;
    padding: 24px 26px 26px;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.brand-logo {
    display: grid;
    flex: none;
    width: 96px;
    height: 96px;
    place-items: center;
    border: 2px solid var(--gold);
    border-radius: 50%;
    background: rgb(255 255 255 / 12%);
    box-shadow: 0 0 0 5px rgb(255 255 255 / 10%);
}

.brand-logo img {
    width: 74px;
    height: auto;
    filter: drop-shadow(0 2px 4px rgb(0 0 0 / 35%));
}

.site-header .eyebrow {
    margin-bottom: 4px;
    color: var(--gold-soft);
    font-size: 11px;
}

.site-header .institution-ar {
    display: block;
    margin-bottom: 2px;
    font-family: "Amiri", "Noto Naskh Arabic", "Scheherazade New", "Traditional Arabic", "Segoe UI", serif;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.5;
    text-align: left;
}

.site-header h1 {
    margin-bottom: 2px;
    color: #fff;
    font-size: clamp(24px, 4vw, 34px);
}

.brand-tagline {
    margin: 0;
    color: rgb(255 255 255 / 80%);
    font-size: 13px;
}

.ornament-band {
    height: 14px;
    border-top: 1px solid rgb(226 185 28 / 55%);
    background: var(--diamond-band) repeat-x center, rgb(0 0 0 / 20%);
}

.site-header .navigation a {
    border-radius: 99px;
    padding: 7px 13px;
    background: rgb(255 255 255 / 12%);
    color: #fff;
    font-weight: 650;
    text-decoration: none;
}

.site-header .navigation a:hover {
    background: rgb(255 255 255 / 24%);
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 750;
    letter-spacing: 0.12em;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 6px;
    font-size: clamp(30px, 5vw, 40px);
    letter-spacing: -0.04em;
}

.subtitle,
.section-heading p {
    margin-bottom: 0;
    color: var(--muted);
}

.rate-card,
.summary-card,
.panel {
    border: 1px solid var(--line);
    border-top: 3px solid var(--gold);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 8px 24px rgb(8 60 30 / 6%);
}

.panel h2::before,
.section-heading h2::before {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 9px;
    background: var(--star-marker) center / contain no-repeat;
    content: "";
    vertical-align: -1px;
}

.rate-card {
    min-width: 180px;
    padding: 14px 18px;
}

.rate-card span,
.summary-card span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.rate-card strong {
    display: block;
    margin-top: 3px;
    font-size: 20px;
}

.summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.summary-card {
    padding: 18px 20px;
}

.summary-card strong {
    display: block;
    margin-top: 6px;
    font-size: 26px;
    letter-spacing: -0.03em;
}

.panel {
    margin-bottom: 20px;
    padding: 22px;
}

.section-heading {
    margin-bottom: 20px;
}

.section-heading h2 {
    margin-bottom: 3px;
    font-size: 19px;
}

.section-heading p {
    font-size: 13px;
}

.call-form {
    display: grid;
    grid-template-columns: 1.1fr 1fr 1fr auto;
    align-items: end;
    gap: 14px;
}

label {
    display: grid;
    gap: 7px;
    color: #34495a;
    font-size: 13px;
    font-weight: 650;
}

input,
select,
textarea {
    width: 100%;
    min-height: 43px;
    border: 1px solid #d5e0e5;
    border-radius: 8px;
    padding: 9px 11px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-weight: 400;
}

.password-field {
    position: relative;
    display: block;
}

.password-field input {
    padding-right: 46px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    transform: translateY(-50%);
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    background: var(--background);
    color: var(--primary-dark);
}

.password-toggle svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.password-toggle .eye-slash {
    display: none;
}

.password-toggle[aria-pressed="true"] .eye-slash {
    display: block;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    outline: 3px solid rgb(11 122 53 / 16%);
}

textarea {
    min-height: 43px;
    resize: vertical;
}

.navigation {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

a {
    color: var(--primary-dark);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
    gap: 14px;
}

.single-column {
    grid-template-columns: 1fr;
}

.narrow {
    max-width: 500px;
    margin-inline: auto;
}

.inline-form {
    display: flex;
    align-items: end;
    gap: 10px;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
}

.student-photo {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 8px;
}

.transaction-student {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 20px;
}

.transaction-student h3 {
    margin: 0 0 6px;
}

.transaction-student p {
    margin: 0 0 8px;
}

.transaction-photo {
    width: 180px;
    height: 180px;
    flex: 0 0 180px;
    border-radius: 12px;
    object-fit: cover;
}

.photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background);
    color: var(--muted);
}

.student-search {
    margin-bottom: 18px;
}

.student-search label {
    flex: 1;
}

.student-search-results {
    margin-bottom: 18px;
}

.student-search-results h3 {
    margin-bottom: 8px;
    font-size: 15px;
}

.student-search-results ul {
    margin: 0;
    padding-left: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
}

.checkbox-label input {
    width: auto;
    min-height: auto;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.button {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    border: 1px solid #d5e0e5;
    border-radius: 8px;
    padding: 8px 12px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.button:hover {
    border-color: #9eb4bd;
    background: #f7fafb;
}

.button.primary {
    min-height: 43px;
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.button.primary:hover {
    border-color: var(--primary-dark);
    background: var(--primary-dark);
}

.button.small {
    min-height: 32px;
    padding: 5px 9px;
}

.notice {
    margin-bottom: 16px;
    border-radius: 9px;
    padding: 12px 15px;
}

.notice.success {
    background: var(--success-bg);
    color: var(--success-ink);
}

.notice.error {
    background: var(--error-bg);
    color: var(--error-ink);
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 13px 10px;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

td {
    font-size: 14px;
}

tbody tr:last-child td {
    border-bottom: 0;
}

.badge {
    display: inline-block;
    border-radius: 99px;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.badge.paid {
    background: var(--success-bg);
    color: var(--success-ink);
}

.badge.unpaid {
    background: #fff5df;
    color: #855c0a;
}

.action-cell {
    text-align: right;
}

.empty-state {
    padding: 32px 12px;
    color: var(--muted);
    text-align: center;
}

footer {
    padding: 14px 0 6px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

footer p {
    margin: 0 0 3px;
}

footer .developer strong {
    color: var(--primary-dark);
}

@media (max-width: 850px) {
    .call-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.user-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 99px;
    padding: 7px 12px;
    background: rgb(255 255 255 / 18%);
    color: #fff;
    font-size: 13px;
    font-weight: 650;
    white-space: nowrap;
}

.muted-note {
    color: var(--muted);
    font-size: 13px;
}

.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.days-fieldset {
    border: 1px solid #d5e0e5;
    border-radius: 8px;
    padding: 12px;
}

.days-fieldset legend {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    padding: 0 6px;
}

@media (max-width: 560px) {
    .two-column {
        grid-template-columns: 1fr;
    }
}
    .container {
        width: min(100% - 24px, 1120px);
        padding-top: 14px;
    }

    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-header .page-header {
        padding: 18px 16px 22px;
    }

    .brand-logo {
        width: 68px;
        height: 68px;
    }

    .brand-logo img {
        width: 50px;
    }

    .rate-card {
        width: 100%;
    }

    .summary {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .panel {
        padding: 16px;
    }

    .call-form,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .inline-form {
        align-items: stretch;
        flex-direction: column;
    }

    .transaction-student {
        align-items: flex-start;
        flex-direction: column;
    }
}
