:root {
    --ink: #2f261b;
    --muted: #766b5d;
    --wood-dark: #3a1f12;
    --wood-mid: #7a4427;
    --wood-light: #b17445;
    --paper: #fff8e8;
    --paper-edge: #d4b77d;
    --gold: #c49a45;
    --line: #d8c49d;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    background-color: #f4f1ea;
    background-image:
        linear-gradient(90deg, rgba(255,255,255,.55) 1px, transparent 1px),
        linear-gradient(rgba(255,255,255,.55) 1px, transparent 1px),
        radial-gradient(circle at 20% 25%, rgba(175,175,175,.18), transparent 18%),
        radial-gradient(circle at 78% 68%, rgba(120,120,120,.12), transparent 22%),
        linear-gradient(135deg, #fbfaf7, #e9e5dc);
    background-size: 145px 145px, 145px 145px, 420px 420px, 520px 520px, auto;
}

.header {
    min-height: 82px;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 12px 28px;
    background-image:
        linear-gradient(180deg, rgba(255,255,255,.22), transparent 18%, rgba(0,0,0,.24)),
        repeating-linear-gradient(90deg, #3a1f12 0 18px, #7a4427 18px 42px, #b17445 42px 48px, #5b301b 48px 70px);
    border-bottom: 6px solid #2a160c;
    box-shadow: 0 8px 22px rgba(50, 31, 14, .32);
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #fff7df;
    font-weight: 700;
    font-size: 20px;
    text-decoration: none;
}

.brand img {
    height: 58px;
    max-width: 240px;
    object-fit: contain;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.header a {
    color: #fff2cb;
    text-decoration: none;
    font-weight: 700;
    padding: 10px 13px;
    border-radius: 6px;
}

.header a:hover {
    background: rgba(255,255,255,.14);
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 28px auto 48px;
}

.card,
.panel,
form,
.login-box {
    background:
        linear-gradient(90deg, rgba(132,87,35,.13), transparent 34px),
        linear-gradient(90deg, transparent calc(100% - 34px), rgba(132,87,35,.12)),
        linear-gradient(180deg, #fffdf5, var(--paper));
    border: 1px solid var(--paper-edge);
    border-radius: 8px;
    padding: 22px;
    box-shadow:
        inset 0 0 28px rgba(121,79,26,.10),
        0 14px 34px rgba(52, 35, 17, .16);
}

h1, h2, h3 {
    color: #3b2515;
    margin-top: 0;
}

p {
    color: var(--muted);
}

input,
select,
textarea {
    width: 100%;
    max-width: 520px;
    padding: 10px 12px;
    border: 1px solid #cbb68d;
    border-radius: 6px;
    background: #fffdf7;
    color: var(--ink);
    font-size: 15px;
}

select {
    cursor: pointer;
}

button,
.button,
input[type="submit"] {
    display: inline-block;
    width: auto;
    padding: 10px 15px;
    border: 1px solid #7e5522;
    border-radius: 6px;
    background: linear-gradient(180deg, #caa35a, #8d6428);
    color: #fff9e8;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 2px 0 rgba(65,38,10,.45);
}

button:hover,
.button:hover,
input[type="submit"]:hover {
    background: linear-gradient(180deg, #d7b36b, #9a6e2e);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fffaf0;
    border: 1px solid var(--line);
}

th,
td {
    padding: 10px 12px;
    border-bottom: 1px solid #e5d6b8;
    text-align: left;
}

th {
    background: #efe2c7;
    color: #3a2414;
}

tr:hover td {
    background: #fff4d8;
}

.stat,
.badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: #efe2c7;
    color: #4b321d;
    font-weight: 700;
}

@media (max-width: 700px) {
    .header {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        padding: 12px 16px;
    }

    .brand img {
        height: 48px;
        max-width: 200px;
    }

    .container {
        width: calc(100% - 18px);
        margin-top: 16px;
    }

    .card,
    .panel,
    form,
    .login-box {
        padding: 16px;
    }
}

.header .logout-link {
    margin-left: auto;
    padding-left: 18px;
    padding-right: 18px;
    border-left: 1px solid rgba(255,255,255,.35);
}

@media (max-width: 700px) {
    .header .logout-link {
        margin-left: 0;
        border-left: 0;
    }
}

.header-menu {
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-account {
    margin-left: auto;
    padding-left: 22px;
    border-left: 1px solid rgba(255,255,255,.4);
}

.header-account a {
    display: block;
    background: rgba(40,15,5,.3);
}

@media (max-width: 900px) {
    .header {
        flex-wrap: wrap;
    }

    .header-menu {
        flex-wrap: wrap;
    }

    .header-account {
        margin-left: auto;
    }
}

@media (max-width: 700px) {
    .header-account {
        margin-left: 0;
        padding-left: 0;
        border-left: 0;
    }
}

/* Admin dashboard */
.dashboard-page {
    min-height: 100vh;
    color: #fff9e9;
    background:
        linear-gradient(180deg, rgba(9, 10, 12, .36), rgba(17, 10, 4, .76)),
        radial-gradient(ellipse at 50% -8%, rgba(255, 210, 112, .48) 0 3%, transparent 17%),
        radial-gradient(ellipse at 19% 2%, rgba(255, 191, 82, .25), transparent 16%),
        radial-gradient(ellipse at 81% 2%, rgba(255, 191, 82, .25), transparent 16%),
        repeating-linear-gradient(90deg, transparent 0 12%, rgba(23, 11, 5, .44) 12% 14%),
        linear-gradient(135deg, #24150e, #4b2b17 48%, #161110);
    background-attachment: fixed;
    position: relative;
}

.dashboard-page::before,
.dashboard-page::after {
    content: "";
    position: fixed;
    z-index: 0;
    top: -7vh;
    width: 30px;
    height: 29vh;
    border-radius: 0 0 50% 50%;
    background:
        linear-gradient(90deg, transparent 44%, #b68b46 45% 55%, transparent 56%) top / 100% 58% no-repeat,
        radial-gradient(ellipse, #fff8cf 0 8%, #f2b94d 20%, rgba(230, 140, 31, .42) 38%, transparent 70%) bottom / 620% 48% no-repeat;
    filter: drop-shadow(0 8px 18px rgba(255, 183, 66, .52));
    pointer-events: none;
}

.dashboard-page::before {
    left: 12%;
}

.dashboard-page::after {
    right: 12%;
}

.dashboard-shell {
    position: relative;
    z-index: 1;
    width: min(1120px, calc(100% - 36px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 28px 0 34px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dashboard-top {
    width: 100%;
    min-height: 190px;
    display: grid;
    grid-template-columns: minmax(190px, 1fr) minmax(310px, 1.5fr) minmax(190px, 1fr);
    align-items: start;
    gap: 24px;
}

.dashboard-clock,
.dashboard-hebrew-date {
    margin-top: 22px;
    padding: 16px 18px;
    border: 1px solid rgba(255, 232, 177, .35);
    border-radius: 12px;
    background: rgba(18, 11, 7, .55);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .28);
    backdrop-filter: blur(8px);
}

.dashboard-clock {
    text-align: left;
}

.dashboard-clock time {
    display: block;
    color: #fff8e8;
}

#dashboard-time {
    font: 700 clamp(25px, 3vw, 42px)/1.1 Georgia, serif;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .8);
}

#dashboard-date {
    margin-top: 8px;
    color: #efd8a6;
    font-size: 15px;
}

.dashboard-identity {
    text-align: center;
}

.dashboard-identity img {
    display: block;
    width: 126px;
    height: 110px;
    margin: 0 auto 5px;
    object-fit: contain;
    filter: drop-shadow(0 5px 12px rgba(0, 0, 0, .58));
}

.dashboard-identity h1 {
    margin: 0;
    color: #fff5d8;
    font: 700 clamp(25px, 3vw, 40px)/1.2 Georgia, "Times New Roman", serif;
    text-shadow: 0 3px 12px #000;
}

.dashboard-hebrew-date {
    text-align: center;
}

.dashboard-hebrew-date span,
.dashboard-hebrew-date strong {
    display: block;
}

.dashboard-hebrew-date span {
    color: #d8bc82;
    font-size: 14px;
}

.dashboard-hebrew-date strong {
    margin-top: 6px;
    color: #fff8e8;
    font: 700 clamp(21px, 2.2vw, 30px)/1.3 Georgia, serif;
}

.dashboard-welcome p {
    margin: 2px 0 22px;
    color: #f2dfb7;
    text-shadow: 0 2px 7px #000;
}

.dashboard-grid {
    width: min(860px, 100%);
    display: grid;
    grid-template-columns: repeat(3, minmax(170px, 1fr));
    gap: 24px;
}

.dashboard-tile {
    position: relative;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 2px solid #c79a4b;
    border-radius: 18px;
    background:
        radial-gradient(circle at 50% 28%, rgba(255, 230, 161, .18), transparent 42%),
        linear-gradient(145deg, rgba(90, 50, 24, .96), rgba(38, 21, 13, .98));
    color: #3e2815;
    text-decoration: none;
    box-shadow:
        inset 0 0 0 4px rgba(255, 240, 190, .08),
        0 13px 28px rgba(0, 0, 0, .42);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.dashboard-tile:hover,
.dashboard-tile:focus-visible {
    transform: translateY(-5px);
    border-color: #ffe2a0;
    box-shadow:
        inset 0 0 0 4px rgba(255, 240, 190, .15),
        0 19px 34px rgba(0, 0, 0, .5),
        0 0 22px rgba(222, 171, 78, .26);
    outline: none;
}

.siddur-art {
    position: absolute;
    inset: 19% 11% 13%;
    display: flex;
    align-items: stretch;
    filter: drop-shadow(0 13px 8px rgba(0, 0, 0, .36));
}

.siddur-page {
    position: relative;
    flex: 1;
    border: 3px solid #6e4a26;
    background:
        repeating-linear-gradient(180deg, transparent 0 11%, rgba(102, 74, 42, .23) 12% 14%),
        linear-gradient(90deg, #e9d9ad, #fff8df);
}

.siddur-page-left {
    border-radius: 48% 8% 12% 40% / 11% 5% 10% 12%;
    transform: perspective(260px) rotateY(10deg) rotate(-2deg);
    transform-origin: right center;
}

.siddur-page-right {
    border-radius: 8% 48% 40% 12% / 5% 11% 12% 10%;
    background:
        repeating-linear-gradient(180deg, transparent 0 11%, rgba(102, 74, 42, .23) 12% 14%),
        linear-gradient(270deg, #e9d9ad, #fff8df);
    transform: perspective(260px) rotateY(-10deg) rotate(2deg);
    transform-origin: left center;
}

.siddur-art::after {
    content: "";
    position: absolute;
    left: calc(50% - 2px);
    top: 5%;
    bottom: 0;
    width: 4px;
    background: linear-gradient(#c89442, #71441c);
    border-radius: 4px;
}

.dashboard-tile-label {
    position: relative;
    z-index: 2;
    max-width: 82%;
    padding: 8px 13px;
    border: 1px solid rgba(112, 73, 31, .45);
    border-radius: 7px;
    background: rgba(255, 248, 221, .86);
    color: #3b2614;
    font: 700 clamp(17px, 2vw, 23px)/1.15 Georgia, serif;
    text-align: center;
    box-shadow: 0 3px 9px rgba(46, 25, 9, .28);
}

.dashboard-logout {
    margin-top: 28px;
    padding: 9px 24px;
    border: 1px solid rgba(255, 231, 177, .46);
    border-radius: 999px;
    background: rgba(22, 12, 7, .57);
    color: #ffe9b9;
    font-weight: 700;
    text-decoration: none;
}

.dashboard-logout:hover,
.dashboard-logout:focus-visible {
    background: rgba(95, 52, 25, .8);
    outline: 2px solid #eac77e;
}

.member-dashboard-grid {
    max-width: 860px;
}

.member-dashboard-content {
    width: 100%;
    margin-top: 34px;
    color: var(--ink);
    scroll-margin-top: 18px;
}

.member-dashboard-content .card + .card {
    margin-top: 18px;
}

.member-dashboard-content form {
    box-shadow: none;
}

@media (max-width: 780px) {
    .dashboard-top {
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-identity {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .dashboard-clock,
    .dashboard-hebrew-date {
        grid-row: 2;
        margin-top: 0;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(145px, 1fr));
        gap: 16px;
        margin-top: 22px;
    }
}

@media (max-width: 480px) {
    .dashboard-shell {
        width: min(100% - 20px, 1120px);
        padding-top: 16px;
    }

    .dashboard-top {
        gap: 10px;
    }

    .dashboard-identity img {
        width: 100px;
        height: 86px;
    }

    .dashboard-clock,
    .dashboard-hebrew-date {
        min-height: 106px;
        padding: 12px;
    }

    #dashboard-time {
        font-size: 22px;
    }

    #dashboard-date,
    .dashboard-hebrew-date span {
        font-size: 12px;
    }

    .dashboard-hebrew-date strong {
        font-size: 18px;
    }

    .dashboard-grid {
        gap: 10px;
    }

    .dashboard-tile {
        border-radius: 12px;
    }

    .dashboard-tile-label {
        padding: 6px 8px;
        font-size: 16px;
    }
}

.member-list-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.settings-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.settings-heading h1 {
    margin-bottom: 0;
}

.settings-section {
    margin-top: 18px;
}

.settings-add-form {
    margin-top: 20px;
    padding: 18px;
    box-shadow: none;
}

.settings-add-form h2 {
    margin-bottom: 14px;
}

.settings-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.settings-form-grid label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.settings-form-grid label span {
    display: block;
    margin-bottom: 5px;
}

.settings-form-grid input,
.settings-form-grid select,
.settings-table input[type="password"],
.settings-table select {
    max-width: none;
    padding: 7px 9px;
    font-size: 14px;
}

.settings-table-wrap {
    overflow-x: auto;
}

.settings-table {
    min-width: 700px;
}

.settings-table th,
.settings-table td {
    padding: 7px 9px;
}

.settings-table input[type="password"] {
    width: 150px;
}

.settings-table select {
    width: auto;
    min-width: 90px;
}

.settings-table input[type="checkbox"] {
    width: auto;
}

.settings-table button {
    padding: 7px 11px;
}

.inline-action-form {
    display: inline;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
}

.inline-action-form button {
    padding: 7px 10px;
    white-space: nowrap;
}

.muted-text {
    color: var(--muted);
    font-size: 13px;
}

.notice {
    padding: 10px 12px;
    border-radius: 6px;
}

.notice-success {
    color: #285b31;
    background: #e6f3e7;
    border: 1px solid #a9cdaa;
}

.notice-error {
    color: #7a2929;
    background: #f8e6e3;
    border: 1px solid #d9aaa3;
}

.report-menu {
    display: grid;
    grid-template-columns: repeat(3, minmax(190px, 1fr));
    gap: 12px;
}

.report-menu .button {
    text-align: center;
}

.report-filter {
    margin-top: 18px;
    padding: 16px;
    box-shadow: none;
}

.report-filter-grid {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 12px;
}

.report-filter-grid label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.report-filter-grid label span {
    display: block;
    margin-bottom: 5px;
}

.report-filter-grid input,
.report-filter-grid select {
    width: 180px;
    padding: 7px 9px;
}

.report-field-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 9px 14px;
    margin-bottom: 14px;
}

.report-field-options label {
    display: flex;
    align-items: center;
    gap: 7px;
}

.report-field-options input {
    width: auto;
}

.report-results {
    margin-top: 18px;
}

.report-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.report-table-wrap {
    overflow-x: auto;
}

.report-table {
    min-width: 760px;
}

.amount {
    text-align: right;
    white-space: nowrap;
}

@media (max-width: 800px) {
    .report-menu,
    .report-field-options {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
    }
}

@media (max-width: 520px) {
    .report-menu,
    .report-field-options {
        grid-template-columns: 1fr;
    }
}

.campaign-admin-form {
    margin-top: 18px;
    padding: 18px;
    box-shadow: none;
}

.campaign-admin-grid,
.campaign-payment-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 14px;
}

.campaign-admin-grid label span,
.campaign-payment-grid label span,
.campaign-payment-form fieldset > label span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.campaign-admin-grid input,
.campaign-admin-grid textarea,
.campaign-payment-grid input,
.campaign-payment-grid textarea {
    max-width: none;
}

.campaign-wide {
    grid-column: 1 / -1;
}

.campaign-admin-grid small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.campaign-active {
    display: flex;
    align-items: center;
    gap: 8px;
}

.campaign-active input {
    width: auto;
}

.campaign-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 50% 0, rgba(244, 207, 128, .3), transparent 35%),
        linear-gradient(135deg, #2d190f, #6c3e22 52%, #24140d);
}

.campaign-shell {
    width: min(920px, calc(100% - 28px));
    margin: 0 auto;
    padding: 28px 0 55px;
}

.campaign-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    margin-bottom: 22px;
    color: #fff3d2;
    text-align: center;
}

.campaign-brand img {
    width: 145px;
    height: 126px;
    object-fit: contain;
}

.campaign-brand p {
    margin: 3px 0;
    color: inherit;
}

.campaign-hebrew {
    font: 700 clamp(24px, 4vw, 40px)/1.2 Georgia, serif;
}

.campaign-english {
    font: 700 clamp(17px, 2vw, 24px)/1.2 Georgia, serif;
}

.campaign-card {
    padding: clamp(22px, 5vw, 48px);
    border: 1px solid #d7b36c;
    border-radius: 18px;
    background:
        linear-gradient(90deg, rgba(132,87,35,.09), transparent 42px),
        linear-gradient(180deg, #fffdf5, #fff4da);
    box-shadow: 0 22px 55px rgba(0, 0, 0, .35);
}

.campaign-intro {
    text-align: center;
}

.campaign-name {
    margin-bottom: 8px;
    color: #9a6b2d;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.campaign-intro h1,
.campaign-payment-shell h1 {
    font: 700 clamp(30px, 5vw, 54px)/1.08 Georgia, serif;
}

.campaign-message {
    max-width: 720px;
    margin: 0 auto 28px;
    color: #5e5041;
    font-size: 18px;
    line-height: 1.65;
}

.campaign-progress-labels {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 8px;
}

.campaign-progress {
    height: 22px;
    overflow: hidden;
    border: 1px solid #b78b43;
    border-radius: 999px;
    background: #ead9b6;
}

.campaign-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #916125, #d3a752);
}

.campaign-amounts,
.campaign-payment-amounts {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 28px 0;
}

.campaign-amount,
.campaign-payment-amounts label span {
    display: block;
    min-width: 105px;
    padding: 14px 18px;
    border: 2px solid #b98a3f;
    border-radius: 10px;
    background: #fffaf0;
    color: #4e3218;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.campaign-amount:hover,
.campaign-payment-amounts input:checked + span {
    background: #c99c4e;
    color: white;
}

.campaign-payment-amounts input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.campaign-custom {
    font-size: 15px;
}

.campaign-participate {
    display: inline-block;
    padding: 15px 26px;
    border-radius: 8px;
    background: linear-gradient(180deg, #d5ac5c, #8e6126);
    color: white;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
}

.campaign-payment-form,
.campaign-payment-form fieldset {
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
}

.campaign-payment-form fieldset {
    margin: 0 0 22px;
}

.campaign-payment-form legend {
    margin-bottom: 10px;
    color: #3b2515;
    font-size: 20px;
    font-weight: 700;
}

.payment-api-placeholder {
    margin: 22px 0;
    padding: 18px;
    border: 1px dashed #b58b4b;
    border-radius: 8px;
    background: #f7ecd4;
}

.payment-api-placeholder h2 {
    margin-bottom: 7px;
}

@media (max-width: 620px) {
    .campaign-brand {
        flex-direction: column;
        gap: 8px;
    }

    .campaign-brand img {
        width: 110px;
        height: 95px;
    }

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

    .campaign-wide {
        grid-column: auto;
    }
}

@media (max-width: 850px) {
    .settings-form-grid {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
    }
}

@media (max-width: 520px) {
    .settings-heading {
        align-items: flex-start;
        flex-direction: column;
    }

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

.view-toggle {
    display: inline-flex;
    border: 1px solid #bca36e;
    border-radius: 6px;
    overflow: hidden;
    background: #fffaf0;
}

.view-toggle a {
    padding: 6px 10px;
    color: #4b321d;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    border-right: 1px solid #bca36e;
}

.view-toggle a:last-child {
    border-right: 0;
}

.view-toggle a.selected {
    background: #8d6428;
    color: #fff;
}
