/* Admin page – uses the site's tokens from style.css */
.admin-page { background: var(--paper); min-height: 100vh; }
.adm-head-act { margin-inline-start: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.adm-user { display: flex; gap: 10px; align-items: center; color: rgba(245,234,216,.75); font-size: 14px; }
.adm-home { padding: 8px 14px; white-space: nowrap; }
@media (max-width: 600px) { #adm-email { display: none; } .adm-home { padding: 7px 10px; font-size: 14px; } }
.adm-out { padding: 6px 12px; }

.adm-login { display: grid; place-items: center; padding-block: 64px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.adm-login .adm-card { max-width: 420px; width: 100%; text-align: center; display: grid; gap: 14px; justify-items: center; }
.adm-login-logo { width: 140px; height: auto; background: var(--navy); border-radius: 14px; padding: 12px; }
.adm-login h1 { font-size: 30px; }
.adm-login p { margin: 0; color: var(--ink-2); }
.adm-err { color: #b4442e !important; min-height: 1.2em; }
.adm-demo { font-size: 13px; color: var(--ink-3) !important; background: var(--gold-soft); border-radius: 8px; padding: 8px 12px; margin: 0 0 14px; }

.adm { padding-block: 26px 60px; }
.adm-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; box-shadow: var(--shadow); min-width: 0; }
.adm-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.adm-tabs button { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 10px; padding: 9px 16px; font-weight: 600; display: inline-flex; gap: 8px; align-items: center; }
.adm-tabs button[aria-selected="true"] { background: var(--navy); color: var(--gold-bright); border-color: var(--navy); }
.adm-count:empty { display: none; }
.adm-count { background: var(--gold-soft); color: var(--ink); font-size: 12px; border-radius: 99px; padding: 1px 8px; font-variant-numeric: tabular-nums; }
.adm-count.adm-new { background: #b4442e; color: #fff; }

.adm-grid { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .adm-grid { grid-template-columns: 1fr; } }
.adm-form { display: grid; gap: 6px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 80px); }
@media (max-width: 900px) { .adm-form { position: static; } }
.adm-form h2, .adm-list-head h2 { font-size: 22px; margin-bottom: 6px; }
.adm-form label { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-top: 6px; }
.adm-form input, .adm-form select, .adm-filters input, .adm-filters select { font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); width: 100%; }
.adm-form input:focus, .adm-form select:focus { outline: 2px solid var(--gold); border-color: transparent; }
.adm-date-heb { font: 700 16px/1.3 var(--f-display); color: var(--gold); }
.adm-preview:empty { display: none; }
.adm-preview { margin-top: 10px; background: linear-gradient(135deg, var(--navy), #4a2914); color: var(--on-navy); border-radius: 10px; padding: 14px; display: grid; gap: 4px; text-align: center; }
.adm-preview b { font: 700 19px/1.3 var(--f-display); color: var(--gold-bright); }
.adm-prev-lab, .adm-prev-days { font-size: 12px; color: rgba(245,234,216,.7); }
.adm-warn { font-size: 12.5px; color: #ffcf8a; font-weight: 700; }
.adm-actions { display: flex; gap: 8px; margin-top: 10px; }
.adm-actions .btn-gold { flex: 1; justify-content: center; }
.adm-status { font-size: 14px; color: var(--ink-2); margin: 4px 0 0; min-height: 1.2em; }

.adm-list-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.adm-filters { display: flex; gap: 8px; }
.adm-filters input { width: 180px; }
.adm-filters select { width: auto; }
.adm-table-wrap { overflow-x: auto; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.adm-table th { text-align: start; font-size: 12.5px; color: var(--ink-3); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.adm-table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.adm-table td small { display: block; color: var(--ink-3); font-size: 12px; text-align: start; }
.adm-table tr.is-today td { background: var(--gold-soft); }
.adm-note { color: var(--gold) !important; }
.adm-row-act { white-space: nowrap; display: flex; gap: 6px; justify-content: flex-end; }
.adm-row-act .btn-line, .adm-msg-act .btn-line, .adm-msg-act .btn-gold { padding: 5px 10px; font-size: 13px; }
.adm-del { color: #b4442e !important; }
.adm-empty, .adm-hint { color: var(--ink-3); margin: 8px 0; }

.adm-msgs { display: grid; gap: 12px; max-height: 70vh; overflow-y: auto; padding-inline-end: 4px; overscroll-behavior: contain; }
.adm-table-wrap { max-height: 70vh; overflow-y: auto; }
.adm-table thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.adm-more { justify-self: center; margin-top: 4px; }
.adm-msg { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: var(--paper); }
.adm-msg.is-new { border-color: var(--gold); box-shadow: inset 4px 0 0 var(--gold-bright); background: var(--surface); }
[dir="rtl"] .adm-msg.is-new { box-shadow: inset -4px 0 0 var(--gold-bright); }
.adm-msg header { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.adm-msg header b { font: 700 16px/1.3 var(--f-display); }
.adm-msg header small { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.adm-msg p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.adm-contact { margin-top: 8px; font-size: 14px; }
.adm-contact span:first-child { color: var(--ink-3); }
.adm-copy { color: var(--gold); font-weight: 600; user-select: all; }
.adm-msg-act { display: flex; gap: 8px; margin-top: 10px; }
.adm-pct { font-weight: 700; color: var(--ink-3); }
.adm-pct.ok { color: #2f7a3d; } .adm-pct.mid { color: var(--gold); }
@media (max-width: 600px) { .adm-filters { width: 100%; } .adm-filters input { flex: 1; width: auto; } .adm-card { padding: 16px; } }

/* Company of a sponsor + section */
.adm-co { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 12px; margin: 14px 0 4px; display: grid; gap: 6px; }
.adm-co legend { padding: 0 6px; font-weight: 700; color: var(--gold); font-size: 14px; }
.adm-co-logo { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.adm-co-logo img { height: 44px; max-width: 120px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 3px; }
.adm-co-logo input[type=file] { font-size: 13px; max-width: 100%; }
.adm-part { display: inline-block; margin-top: 4px; font-size: 11.5px; font-weight: 700; background: var(--gold-soft); color: var(--gold); padding: 2px 8px; border-radius: 99px; }
.adm-part.whole { background: transparent; color: var(--ink-3); padding: 0; }
.adm-co-tag { display: block; color: var(--gold); font-weight: 600; margin-top: 2px; }

/* Password sign-in */
.adm-pw { display: grid; gap: 8px; width: 100%; max-width: 300px; margin: 6px auto 0; text-align: start; }
.adm-pw label { font-weight: 600; font-size: 14px; color: var(--ink-2); }
.adm-pw input[type=password] { font: inherit; font-size: 17px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); direction: ltr; text-align: center; letter-spacing: .15em; }
.adm-pw input[type=password]:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.adm-pw .btn-gold { justify-content: center; margin-top: 4px; }
.adm-pw .btn-gold:disabled { opacity: .6; cursor: wait; }

/* admin: sign in with Google first, the password tucked under it */
.adm-google { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 13px 16px; margin: 6px 0 12px; border-radius: 12px; border: 1px solid #d9cbb3; background: #fff; font: 700 16px/1 var(--f-ui); color: #1f1f1f; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.adm-google:hover { background: #f8f8f8; }
.adm-pw-more summary { cursor: pointer; color: #8a5a2b; font-size: 14px; margin-bottom: 8px; }
.adm-pwchange { margin-top: 18px; }
.adm-pwchange summary { cursor: pointer; font-weight: 700; }
.adm-pwchange form { display: grid; gap: 6px; max-width: 360px; margin-top: 10px; }
.adm-pwchange input { padding: 10px 12px; border-radius: 10px; border: 1px solid #d9cbb3; font-size: 15px; }
.adm-pwchange .btn-gold { justify-self: start; margin-top: 6px; }