@import url('https://fonts.googleapis.com/css?family=Electrolize');

:root {
    --display-blue: var(--site-page-background, #4f83b5);
    --display-green: #176b55;
    --display-yellow: #ebc000;
    --display-ink: #24332f;
    --display-shadow: 0 10px 32px rgba(13, 38, 62, .22);
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    background: var(--display-blue);
}

body {
    color: #fff;
    font-family: 'Segoe UI', Arial, sans-serif;
}

h1,
h2,
h3,
.eyebrow {
    font-family: 'Electrolize', 'Segoe UI', Arial, sans-serif;
}

.screen-shell {
    width: 100%;
    height: 100vh;
    min-height: 640px;
    padding: 24px 30px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.screen-header {
    min-height: 112px;
    margin-bottom: 18px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
}

.screen-header .eyebrow,
.side-card .eyebrow,
.admin-header .eyebrow {
    margin: 0 0 5px;
    color: #f5dc75;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .14em;
}

.screen-jamat {
    margin: 0 0 4px;
    color: #f5dc75;
    font-family: 'Electrolize', 'Segoe UI', Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .14em;
}

.screen-header h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(25px, 2.3vw, 40px);
    text-align: left;
}

.screen-header h1 span {
    color: #ffdf52;
    font-size: .55em;
}

.screen-datetime {
    display: grid;
    justify-items: center;
    gap: 1px;
    white-space: nowrap;
    font-family: 'Electrolize', 'Segoe UI', Arial, sans-serif;
}

.screen-datetime strong {
    color: #fff;
    font-size: clamp(17px, 1.5vw, 25px);
    font-weight: 500;
}

.screen-datetime time {
    color: #ffdf52;
    font-size: clamp(30px, 3.1vw, 52px);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.screen-header-spacer {
    min-width: 0;
}

.screen-grid {
    min-height: 0;
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 27%);
    gap: 18px;
}

.contributions-panel,
.side-card {
    color: var(--display-ink);
    background: #fff;
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 12px;
    box-shadow: var(--display-shadow);
}

.contributions-panel {
    min-width: 0;
    padding: 14px 16px 10px;
    display: flex;
    flex-direction: column;
}

.contribution-table-wrap {
    min-height: 0;
    flex: 1;
    overflow: hidden;
}

.contribution-columns {
    height: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.contribution-table {
    width: 100%;
    height: 100%;
    border: 1px solid #dce7e2;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 8px;
    table-layout: fixed;
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    background: #fff;
}

.contribution-table thead {
    color: #fff;
    background: var(--display-green);
}

.contribution-table thead tr:first-child {
    background: #145b47;
}

.contribution-table th,
.contribution-table td {
    padding: 3px 5px;
    border-bottom: 1px solid #e6edf0;
    text-align: right;
    white-space: nowrap;
}

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

.contribution-table tbody tr:hover {
    background: #e8f1ed;
}

.contribution-table thead th {
    height: 30px;
    border-color: rgba(255, 255, 255, .2);
    font-size: clamp(10px, .72vw, 14px);
}

.contribution-table thead th:first-child {
    width: 36%;
    text-align: center;
}

.contribution-table thead tr:first-child th:not(:first-child) {
    color: #ffdf52;
    font-family: 'Electrolize', 'Segoe UI', Arial, sans-serif;
    font-size: clamp(13px, .9vw, 18px);
}

.year-heading {
    text-align: center;
}

.year-heading .gregorian-year,
.year-heading .islamic-year {
    display: block;
}

.year-heading .islamic-year {
    margin-top: 1px;
    color: #e6f2ec;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: clamp(8px, .58vw, 11px);
    font-weight: 500;
    letter-spacing: 0;
}

.contribution-table thead tr:nth-child(2) th {
    text-align: center;
}

.contribution-table tbody th,
.contribution-table tbody td {
    height: 24px;
    font-size: clamp(10px, .7vw, 14px);
}

.contribution-table tbody th {
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    font-weight: 600;
}

.contribution-table .member-months {
    color: #465d68;
    font-weight: 600;
}

.contribution-table .member-amount {
    color: #145b47;
    font-weight: 700;
}

.contribution-table .empty-state {
    height: 100%;
    color: #52636b;
    text-align: center;
    white-space: normal;
}

.screen-page-footer {
    min-height: 26px;
    padding-top: 7px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: #657780;
    font-size: 11px;
}

.screen-sidebar {
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(0, 1.2fr) minmax(0, .8fr);
    gap: 18px;
}

.side-card {
    min-height: 0;
    padding: 18px;
    overflow: hidden;
}

.side-card .eyebrow {
    color: var(--display-green);
    font-size: 10px;
}

.side-card h2 {
    margin: 0 0 12px;
    color: var(--display-green);
    font-size: clamp(18px, 1.45vw, 25px);
    text-align: center;
}

.side-card > .eyebrow,
.prayer-date {
    text-align: center;
}

.prayer-card {
    display: flex;
    flex-direction: column;
    background: linear-gradient(145deg, #fff 0%, #eff7f2 100%);
}

.prayer-date {
    margin: -5px 0 8px;
    color: #586c65;
    font-size: 12px;
}

.prayer-times-list {
    min-height: 0;
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.prayer-tile {
    min-width: 0;
    padding: 7px 10px;
    display: grid;
    grid-template-rows: auto 1fr auto;
    align-content: center;
    border: 1px solid #d6e4dc;
    border-radius: 8px;
    background: rgba(255, 255, 255, .86);
}

.prayer-tile.current {
    color: #fff;
    background: var(--display-green);
    border-color: var(--display-green);
    box-shadow: 0 3px 10px rgba(23, 107, 85, .24);
}

.prayer-tile.next {
    border: 2px solid #d1a900;
    background: #fff8d7;
}

.prayer-tile-state {
    min-height: 14px;
    color: #61756b;
    font-size: clamp(8px, .58vw, 11px);
    font-weight: 800;
    letter-spacing: .06em;
}

.prayer-tile.current .prayer-tile-state {
    color: #ffdf52;
}

.prayer-tile-name {
    align-self: center;
    overflow: hidden;
    font-size: clamp(12px, .95vw, 17px);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.prayer-tile-time {
    font-size: clamp(20px, 1.65vw, 30px);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.prayer-next {
    margin: 10px 0 0;
    padding: 11px 12px;
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    align-items: center;
    gap: 10px;
    color: var(--display-green);
    border-radius: 6px;
    background: #e4f0e9;
    font-weight: 700;
}

.prayer-summary-current,
.prayer-summary-upcoming {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.prayer-summary-current {
    padding-right: 10px;
    border-right: 1px solid #c5d9ce;
}

.prayer-summary-label {
    color: #526b60;
    font-size: clamp(9px, .62vw, 12px);
    font-weight: 800;
    letter-spacing: .06em;
}

.prayer-summary-current strong,
.prayer-summary-upcoming strong {
    font-size: clamp(16px, 1.25vw, 23px);
    line-height: 1.15;
}

.prayer-summary-upcoming strong {
    color: #104d3d;
    font-size: clamp(19px, 1.55vw, 29px);
}

.prayer-summary-upcoming small {
    color: #526b60;
    font-size: clamp(11px, .76vw, 14px);
}

.news-card {
    border-top: 5px solid var(--display-yellow);
}

.news-card h2 {
    margin-bottom: 8px;
}

.notice-item {
    padding: 9px 0;
    border-top: 1px solid #e4ebee;
}

.notice-item:first-child {
    border-top: 0;
}

.notice-item h3 {
    margin: 0 0 4px;
    color: var(--display-ink);
    font-size: clamp(14px, 1vw, 18px);
}

.notice-item p,
.no-notices {
    margin: 0;
    color: #51636b;
    font-size: clamp(12px, .86vw, 15px);
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.screen-error {
    position: fixed;
    right: 20px;
    bottom: 16px;
    padding: 9px 14px;
    color: #fff;
    background: #922f24;
    border-radius: 6px;
}

.admin-page {
    min-height: 100vh;
    padding: 24px;
}

.admin-shell {
    width: min(1500px, 100%);
    margin: 0 auto;
}

.admin-header,
.admin-header nav,
.admin-toolbar,
.section-title,
.section-title form,
.form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.admin-header {
    margin-bottom: 18px;
}

.admin-header h1 {
    margin: 0;
    font-size: 32px;
}

.admin-header nav a {
    color: #fff;
    font-weight: 700;
}

.admin-card {
    margin-bottom: 18px;
    padding: 20px;
    color: var(--display-ink);
    background: #fff;
    border-radius: 10px;
    box-shadow: var(--display-shadow);
}

.admin-card h2 {
    margin: 0 0 14px;
    color: var(--display-green);
}

.admin-card h3 {
    color: var(--display-green);
}

.login-card {
    max-width: 480px;
}

.admin-card label {
    display: grid;
    gap: 5px;
    color: #31423b;
    font-weight: 600;
}

.admin-card input,
.admin-card select,
.admin-card textarea {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid #cbd7d2;
    border-radius: 5px;
    background: #fff;
    color: var(--display-ink);
    font: inherit;
}

.admin-card input[type=checkbox] {
    width: 20px;
    min-height: 20px;
}

.admin-card form {
    margin: 0;
}

.member-form,
.notice-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.member-form .wide,
.notice-form .wide {
    grid-column: 1 / -1;
}

.member-form .check-label,
.notice-form .check-label {
    display: flex;
    align-items: center;
}

.help-text {
    margin: -6px 0 0;
    color: #687973;
    font-size: 13px;
}

.form-actions {
    justify-content: flex-start;
}

.admin-grid {
    display: grid;
    grid-template-columns: minmax(320px, .85fr) minmax(500px, 1.4fr);
    align-items: start;
    gap: 18px;
}

.payment-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(90px, 1fr));
    align-items: end;
    gap: 9px;
}

.year-settings-form {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 12px;
}

.year-settings-form label {
    min-width: 150px;
}

.table-scroll {
    max-width: 100%;
    margin-top: 12px;
    overflow: auto;
}

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

.admin-table th,
.admin-table td {
    padding: 8px;
    border-bottom: 1px solid #e2e9e5;
    text-align: left;
}

.admin-table th {
    color: #3d554b;
}

.admin-table a,
.link-button {
    color: #176b55;
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
}

.inline-form {
    display: inline;
}

.link-button {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

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

.payment-row-actions form {
    display: inline;
}

.action-button {
    min-height: 32px;
    padding: 6px 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 7px;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none !important;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}

.action-button:hover {
    transform: translateY(-1px);
}

.edit-action {
    color: #176b55 !important;
    border-color: #c8dfd5;
    background: #eef7f2;
}

.edit-action:hover {
    border-color: #176b55;
    background: #e1f0e8;
}

.delete-action {
    color: #a33d31 !important;
    border-color: #f0d0cc;
    background: #fff2f0;
}

.delete-action:hover {
    border-color: #a33d31;
    background: #fde5e1;
}

.danger-text {
    color: #a33d31;
}

.pagination {
    display: flex;
    gap: 5px;
    margin-top: 12px;
}

.pagination a {
    padding: 5px 9px;
    color: var(--display-green);
    border: 1px solid #cbd7d2;
    border-radius: 4px;
    text-decoration: none;
}

.pagination a.active {
    color: #fff;
    background: var(--display-green);
}

.admin-toolbar {
    justify-content: flex-start;
    margin-bottom: 16px;
}

.admin-toolbar p {
    margin: 0 auto 0 0;
}

.import-form {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 12px;
}

.import-form label {
    min-width: min(420px, 100%);
}

.button {
    min-height: 40px;
    padding: 9px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border: 0;
    border-radius: 5px;
    background: var(--display-green);
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.button.secondary {
    color: var(--display-green);
    border: 1px solid var(--display-green);
    background: #fff;
}

.button.danger {
    background: #a33d31;
}

.notice {
    margin: 0 0 15px;
    padding: 12px 14px;
    color: var(--display-ink);
    background: #fff;
    border-radius: 6px;
}

.notice.success {
    border-left: 5px solid #176b55;
}

.notice.error {
    border-left: 5px solid #a33d31;
}

.demo-tools form {
    display: inline-block;
    margin: 0 8px 0 0;
}

@media (max-width: 900px) {
    .screen-shell {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

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

    .contribution-columns {
        min-height: 480px;
    }

    .contribution-table tbody th,
    .contribution-table tbody td {
        height: 27px;
        font-size: clamp(10px, 1.2vw, 14px);
    }

    .screen-sidebar {
        grid-template-rows: minmax(350px, 1.2fr) minmax(200px, .8fr);
    }

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

@media (max-width: 560px) {
    .screen-shell,
    .admin-page {
        padding: 14px;
    }

    .screen-header {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .screen-header h1 {
        text-align: center;
    }

    .screen-header-spacer {
        display: none;
    }

    .screen-datetime {
        grid-row: 1;
    }

    .contribution-columns {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .contribution-table + .contribution-table {
        margin-top: 8px;
    }

    .prayer-times-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: repeat(3, minmax(110px, 1fr));
    }

    .prayer-next {
        grid-template-columns: 1fr;
    }

    .prayer-summary-current {
        padding: 0 0 8px;
        border-right: 0;
        border-bottom: 1px solid #c5d9ce;
    }

    .member-form,
    .notice-form {
        grid-template-columns: 1fr;
    }

    .member-form .wide,
    .notice-form .wide {
        grid-column: auto;
    }

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