/* ---------------------------------------------------------------------------
   Graphite, yellow and frosted glass - a design trial (DECISIONS D-096).

   Loaded after style.css and only overrides it. Removing the one <link> to this
   file in base.html puts the previous blue skin back exactly as it was; the
   tag pre-redesign-2026-11 holds the whole version from before the trial.

   Colours: graphite #595959 is the ground, yellow #FDD41A is the one colour that
   acts (buttons, the current month, money owed), stone #BFB6A5 is for titles.
   The status colours (green, amber, red) still carry meaning, so they stay
   distinct from the yellow, lightened to read on a dark ground.
   --------------------------------------------------------------------------- */

:root {
  color-scheme: dark;              /* date pickers, selects and scrollbars follow */

  --ink: #f5f2ec;
  --muted: #d9d2c5;
  --title: #bfb6a5;
  --line: rgba(255, 255, 255, 0.14);
  --paper: rgba(0, 0, 0, 0.18);    /* inner wells: code, quiet buttons */
  /* Light enough over the dark honeycomb to read as glass: the cells and lines show through,
     softened by a light blur rather than wiped out by a heavy one. */
  --card: linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0) 45%), rgba(105, 105, 105, 0.30);
  --accent: #fdd41a;
  --accent-deep: #e9bf0c;
  --accent-bright: #ffe25e;
  --on-accent: #2b2b2b;            /* text on yellow */
  --band: rgba(253, 212, 26, 0.12);

  --good: #8fdca0;
  --bad: #ff8f87;
  --warn: #ffc56b;
  --good-soft: rgba(143, 220, 160, 0.14);
  --bad-soft: rgba(255, 143, 135, 0.14);
  --warn-soft: rgba(255, 197, 107, 0.14);

  --radius: 12px;
  --glass-blur: blur(7px) saturate(160%);
  --glass-edge: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  --shadow: var(--glass-edge), 0 14px 36px rgba(0, 0, 0, 0.28);
}

::selection { background: var(--accent); color: var(--on-accent); }
::-moz-selection { background: var(--accent); color: var(--on-accent); }

/* The backdrop the glass shows through. A fixed layer rather than background-attachment,
   which iPhone Safari ignores. */
body { background: #222222; color: var(--ink); }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background: #222222 url("backdrop.svg?v=5") center top / cover no-repeat;
}

/* --- frosted surfaces -------------------------------------------------------------------- */

.card, .panel, .summary, .detail, .receipt-field, .claim-line, .login, .owed-card {
  background: var(--card);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  color: var(--ink);
}

.bar {
  background: rgba(38, 38, 38, 0.45);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22);
}

.sheet {
  background: rgba(24, 24, 24, 0.40);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.sheet-panel {
  background: rgba(72, 72, 72, 0.70);
  -webkit-backdrop-filter: blur(28px) saturate(150%);
  backdrop-filter: blur(28px) saturate(150%);
  border: 1px solid var(--line);
  box-shadow: var(--glass-edge), 0 24px 60px rgba(0, 0, 0, 0.45);
  color: var(--ink);
}

/* Glass inside glass reads as a box in a box: a panel nested in a card is a flat inset well. */
.card .detail, .card .panel, .card .card, .card .claim-line, .card .receipt-field {
  background: rgba(0, 0, 0, 0.14);
  -webkit-backdrop-filter: none; backdrop-filter: none;
  box-shadow: none; border-color: rgba(255, 255, 255, 0.08); border-radius: 12px;
}

/* A browser without backdrop-filter gets solid panels rather than see-through unreadable ones. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card, .panel, .summary, .detail, .receipt-field, .claim-line, .login, .owed-card { background: #535353; }
  .bar { background: #3c3c3c; }
  .sheet-panel { background: #4d4d4d; }
}

/* --- type ------------------------------------------------------------------------------- */

h1, h2, h3, .card-title { color: var(--title); }
h1 { font-weight: 650; letter-spacing: -0.01em; }
.section-heading, .panel-heading {
  color: var(--title); text-transform: none; letter-spacing: 0.01em;
  font-size: 1.05rem; font-weight: 600; margin: 1.75rem 0 0.75rem;
}
.panel-heading { font-size: 0.95rem; margin-top: 0; }

/* --- masthead --------------------------------------------------------------------------- */

/* BYZ Expenses (D-097): the firm in bold, the tool in stone, in normal case - the wide-spaced
   capitals belonged to the old TESSERA wordmark. */
.wordmark-name { color: var(--title); letter-spacing: 0.01em; font-weight: 500; font-size: 1.02rem; }
.wordmark-name strong { color: var(--ink); font-weight: 750; }
.wordmark-firm { color: var(--muted); }
.wordmark-divider { color: rgba(255, 255, 255, 0.3); }
.bar nav a, .bar .link { color: var(--muted); }
.bar nav a:hover, .bar .link:hover { color: var(--accent); }
.wordmark-logo { background: none; box-shadow: none; padding: 0; border-radius: 0; height: 27px; width: auto; }
.wordmark-large { color: var(--title); letter-spacing: 0.01em; font-weight: 500; font-size: 1.8rem; }
.wordmark-large strong { color: var(--ink); font-weight: 750; }
.login { padding: 2rem 1.75rem; }
.login-logo { background: none; border-radius: 0; padding: 0; width: 88px; margin-bottom: 1.25rem; }

/* --- controls --------------------------------------------------------------------------- */

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], select, textarea, #currency-search, .amount-row .amount-input {
  background: rgba(0, 0, 0, 0.22); color: var(--ink); border-color: var(--line);
}
option { background: #4a4a4a; color: var(--ink); }
input::placeholder { color: rgba(245, 242, 236, 0.5); }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* Anything that acts is yellow with dark text. */
button, .primary-action, .receipt-action, .capture-done, .filter-on, .pane-tab-on, .action-send {
  background: var(--accent); color: var(--on-accent); border-color: transparent;
}
/* Plain buttons only: the classed ones (sign out, tabs, currency rows) keep their own hover. */
button:not([class]):hover, .primary-action:hover, .receipt-action:hover, .action-send:hover {
  background: var(--accent-bright);
}
button.approve { background: #2f7d50; color: #fff; }
button.reject { background: #b23a31; color: #fff; }
button.return { background: #a6620d; color: #fff; }

button.secondary, button.danger, .add-receipt, .sheet-button, .pane-tab, .filter, .sheet-close,
.capture-cancel, .currency-button, .capture-done.is-waiting, .action-add, .action-pullback,
.receipt-action.secondary {
  background: rgba(255, 255, 255, 0.06); border-color: var(--line);
}
button.secondary, .add-receipt, .sheet-button, .currency-button, .action-add, .action-pullback,
.receipt-action.secondary { color: var(--accent); }
button.danger { color: var(--bad); border-color: var(--bad); }
.pane-tab, .filter, .sheet-close, .capture-cancel, .capture-done.is-waiting { color: var(--muted); }
button.secondary:hover, .action-add:hover, .action-pullback:hover { background: var(--band); }
.action-create { background: var(--band); color: var(--accent); border-color: var(--accent); }
.action-create:hover { background: var(--accent); color: var(--on-accent); }
.add-receipt, .action-add { border-color: var(--accent); }

.capture-button {
  background: var(--accent); color: var(--on-accent);
  box-shadow: 0 8px 24px rgba(253, 212, 26, 0.30), 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* --- links, lists, badges --------------------------------------------------------------- */

.copy, .more, .admin-nav a, .attested { color: var(--accent); }
.admin-nav a { background: var(--card); border-color: var(--line);
               -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.back:hover { color: var(--accent); }
details.format code { background: var(--paper); }

.state { background: rgba(255, 255, 255, 0.10); color: var(--muted); }
.state-approved { background: var(--good-soft); color: var(--good); }
.state-pending, .state-in_payment_run { background: var(--band); color: var(--accent-bright); }
.state-returned { background: var(--warn-soft); color: var(--warn); }
.state-rejected { background: var(--bad-soft); color: var(--bad); }
.state-draft { background: rgba(255, 255, 255, 0.08); color: var(--muted); }
.state-paid { background: var(--accent); color: var(--on-accent); }

.month-summary, .submitter-summary { background: rgba(253, 212, 26, 0.08); border-bottom-color: var(--line); }
.month-summary .what, .submitter-summary .what,
.month-summary .amount, .submitter-summary .amount { color: var(--accent); }

.notice { background: var(--band); border-color: var(--accent); color: var(--ink); }
.tickbox { background: var(--band); border-left-color: var(--accent); }
.tickbox span { color: var(--ink); }
.claim-line-what { color: var(--ink); }
.claim-line-amount { color: var(--accent); }
.claim-line-detail dd { color: var(--ink); }
.activity-override > a { border-left-color: var(--accent); }

/* --- the home screen -------------------------------------------------------------------- */

.hero {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 1rem 1.5rem; margin: 0.5rem 0 1.5rem;
}
.hero .greeting { font-size: 1.9rem; line-height: 1.15; margin: 0; color: var(--title); }
.hero-date { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.95rem; }

/* The primary action. Its label changes on hover to the reason for pressing it, and the plus
   slides through in a loop - the one piece of motion on the page. */
.cta-new {
  display: inline-flex; align-items: center; gap: 0.75rem;
  padding: 0.85rem 1.4rem 0.85rem 0.95rem; border-radius: 999px;
  background: var(--accent); color: var(--on-accent); text-decoration: none;
  font-weight: 700; font-size: 1.05rem;
  box-shadow: 0 10px 28px rgba(253, 212, 26, 0.28), 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.cta-new:hover, .cta-new:focus-visible {
  background: var(--accent-bright); transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(253, 212, 26, 0.40), 0 2px 6px rgba(0, 0, 0, 0.25);
}

.cta-icon {
  position: relative; width: 2rem; height: 2rem; flex: none; overflow: hidden;
  border-radius: 50%; background: rgba(43, 43, 43, 0.14);
}
.cta-icon > span {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 1.45rem; font-weight: 600; line-height: 1;
}
.cta-icon > span:last-child { transform: translateX(-130%); }
.cta-new:hover .cta-icon > span:first-child,
.cta-new:focus-visible .cta-icon > span:first-child { animation: cta-plus-out 1.4s ease-in-out infinite; }
.cta-new:hover .cta-icon > span:last-child,
.cta-new:focus-visible .cta-icon > span:last-child { animation: cta-plus-in 1.4s ease-in-out infinite; }

/* Both plus signs move in the first half, then hold. At the end the incoming one sits exactly
   where the outgoing one started, so the loop restarts without a jump. */
@keyframes cta-plus-out {
  0%   { transform: translateX(0) rotate(0deg); }
  50%, 100% { transform: translateX(130%) rotate(90deg); }
}
@keyframes cta-plus-in {
  0%   { transform: translateX(-130%) rotate(-90deg); }
  50%, 100% { transform: translateX(0) rotate(0deg); }
}

.cta-label { display: grid; overflow: hidden; }
.cta-label > span {
  grid-area: 1 / 1; white-space: nowrap;
  transition: transform 0.28s ease, opacity 0.28s ease;
}
.cta-label-win { transform: translateY(110%); opacity: 0; }
.cta-new:hover .cta-label-rest, .cta-new:focus-visible .cta-label-rest { transform: translateY(-110%); opacity: 0; }
.cta-new:hover .cta-label-win, .cta-new:focus-visible .cta-label-win { transform: translateY(0); opacity: 1; }

@media (max-width: 34rem) {
  .hero .greeting { font-size: 1.55rem; }
  .cta-new { width: 100%; justify-content: center; }
}

/* Overview: the chart takes the width, money owed sits beside it. */
.overview { display: grid; gap: 1rem; }
@media (min-width: 48rem) { .overview { grid-template-columns: 2fr 1fr; } }
.overview .card { margin-bottom: 0; }
.overview-side { display: grid; gap: 1rem; align-content: start; }
.year-amount { font-size: 1.5rem; font-weight: 700; line-height: 1.1; margin-top: 0.3rem;
               color: var(--ink); font-variant-numeric: tabular-nums; }

.card-title { display: block; font-size: 1rem; font-weight: 600; margin: 0; }
.card-sub { display: block; margin: 0.2rem 0 0; color: var(--muted); font-size: 0.8rem; }

.spend-card { padding: 1.1rem 1.2rem 1rem; }
.spend-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.spend-now { display: grid; }
.spend-now-label { font-size: 0.78rem; color: var(--muted); }
.spend-now-amount { font-size: 1.45rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }

.spend-chart {
  list-style: none; margin: 1.1rem 0 0.75rem; padding: 0;
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 0.4rem; height: 12rem;
}
.spend-month {
  display: grid; grid-template-rows: auto 1fr auto; gap: 0.3rem; min-width: 0;
  text-align: center; border-radius: 6px; position: relative;
}
.spend-value {
  font-size: 0.68rem; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums;
  opacity: 0; transition: opacity 0.15s ease;
  justify-self: center;
}
.spend-month.is-current .spend-value { opacity: 1; color: var(--accent); font-weight: 600; }
.spend-chart:hover .spend-month.is-current:not(:hover) .spend-value { opacity: 0; }
.spend-month:hover .spend-value, .spend-month:focus-visible .spend-value { opacity: 1; }

.spend-track {
  display: flex; align-items: flex-end; min-height: 0;
  background: rgba(255, 255, 255, 0.04); border-radius: 6px 6px 3px 3px;
}
.spend-bar {
  display: block; width: 100%; border-radius: 6px 6px 3px 3px;
  background: rgba(191, 182, 165, 0.55); transition: background 0.15s ease;
}
.spend-month:hover .spend-bar, .spend-month:focus-visible .spend-bar { background: rgba(191, 182, 165, 0.9); }
.spend-month.is-current .spend-bar { background: var(--accent); }
.spend-label { font-size: 0.72rem; color: var(--muted); }
.spend-month.is-current .spend-label { color: var(--ink); font-weight: 600; }

/* On a phone twelve month names do not fit side by side: every other one, counting back from
   the current month, which is always named. */
@media (max-width: 34rem) {
  .spend-chart { gap: 0.25rem; }
  .spend-month:nth-last-child(even) .spend-label { visibility: hidden; }
}

/* One class per five per cent: the policy refuses a height written inline (D-094). */
.bar-h-0 { height: 0; }        .bar-h-5 { height: 5%; }       .bar-h-10 { height: 10%; }
.bar-h-15 { height: 15%; }     .bar-h-20 { height: 20%; }     .bar-h-25 { height: 25%; }
.bar-h-30 { height: 30%; }     .bar-h-35 { height: 35%; }     .bar-h-40 { height: 40%; }
.bar-h-45 { height: 45%; }     .bar-h-50 { height: 50%; }     .bar-h-55 { height: 55%; }
.bar-h-60 { height: 60%; }     .bar-h-65 { height: 65%; }     .bar-h-70 { height: 70%; }
.bar-h-75 { height: 75%; }     .bar-h-80 { height: 80%; }     .bar-h-85 { height: 85%; }
.bar-h-90 { height: 90%; }     .bar-h-95 { height: 95%; }     .bar-h-100 { height: 100%; }

.spend-totals { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; margin: 0; padding-top: 0.75rem;
                border-top: 1px solid var(--line); }
.spend-totals dt { font-size: 0.75rem; color: var(--muted); }
.spend-totals dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

.owed-card {
  display: grid; align-content: start; gap: 0.35rem; padding: 1.1rem 1.2rem;
  text-decoration: none; color: inherit; transition: border-color 0.2s ease;
}
.owed-card:hover { border-color: rgba(253, 212, 26, 0.55); }
.owed-amount { font-size: 2.1rem; font-weight: 700; line-height: 1.1; margin-top: 0.4rem;
               color: var(--accent); font-variant-numeric: tabular-nums; }
.owed-card .tile-note { font-size: 0.78rem; color: var(--muted); }

/* Task cards. The count is yellow when there is something in it, amber when someone is
   waiting on you or something has come back. */
.task-count { background: var(--accent); color: var(--on-accent); }
.task-count-quiet { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.task-card-attention .task-count:not(.task-count-quiet) { background: var(--warn); }
.task-label { color: var(--ink); }
.task-arrow { color: var(--muted); }
.task-head:hover .task-arrow { color: var(--accent); }
.task-list, .task-list li { border-color: var(--line); }
.task-list li > a:hover { background: rgba(255, 255, 255, 0.04); }
.task-tick { background: var(--good-soft); border-color: transparent; color: var(--good); }

/* Movement for those who want it; none for those who have asked their system for less. */
@media (prefers-reduced-motion: reduce) {
  .cta-new, .cta-label > span, .spend-value, .spend-bar, .owed-card { transition: none; }
  .cta-new:hover .cta-icon > span, .cta-new:focus-visible .cta-icon > span { animation: none; }
  .cta-new:hover { transform: none; }
}

/* Withdrawn (D-100): settled and out of the way, so as quiet as a draft. */
.state-withdrawn { background: rgba(255, 255, 255, 0.08); color: var(--muted); }
