/* =============================================================================
   RINO OvO 2026 — Sign Monitoring Dashboard
   Design tokens VERIFIED from rino.nl live theme (see DESIGN_TOKENS.md).
   Palette: deep purple ink #220037, lime CTA #45d345, sand bg #fff9f3.
   Type:    Noto Serif (headings) + Barlow (body).
   Signature: pill radii (40–50px) that morph to 4px on interaction; cards
              round outward on hover. Reproduced faithfully below.
   ============================================================================= */
:root {
  --purple: #220037;
  --purple-70: #4a3358;
  --purple-tint: #2200370f;
  --green: #45d345;
  --green-deep: #1f9d3f;
  --pink: #b25cff;
  --pink-dark: #766383;
  --sand: #f4e9dd;
  --sand-light: #fff9f3;
  --white: #fff;
  --black: #0a0a0a;
  --gray: #efebeb;

  /* Semantic set — extends the brand green/red with readable badge tones. */
  --ok-bg: #e7f8e7;      --ok-fg: #197a2e;
  --pending-bg: #fdf1dd; --pending-fg: #9a6100;
  --danger-bg: #fde7e7;  --danger-fg: #c0201f;
  --info-bg: #f3e9fb;    --info-fg: #6b2fa0;
  --muted-bg: #efebeb;   --muted-fg: #766383;

  --radius-pill: 40px;
  --radius-tight: 4px;
  --radius-card: 8px;
  --shadow-card: 0 12px 20px -8px var(--purple-tint), 0 2px 4px var(--purple-tint);
  --shadow-header: 0 1px 0 rgba(34,0,55,0.06);

  --body-font: "Barlow", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --head-font: "Noto Serif", Georgia, "Times New Roman", serif;

  --sp-1: 4px; --sp-2: 8px; --sp-3: 16px; --sp-4: 24px; --sp-5: 40px;
  --content-max: 1240px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--body-font);
  color: var(--purple);
  background: var(--sand-light);
  line-height: 1.5;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--head-font); font-weight: 600; margin: 0; }
a { color: var(--purple); text-decoration: none; transition: .2s; }
a:hover { text-decoration: none; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; }
.muted { color: var(--pink-dark); }
.small { font-size: .82rem; }
.nowrap { white-space: nowrap; }
.ellipsis { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-between { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--sp-3); flex-wrap: wrap; }

/* --- Header / nav --------------------------------------------------------- */
.app-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--sp-4);
  padding: 14px var(--sp-4);
  background: rgba(255,249,243,0.9);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--sand);
  box-shadow: var(--shadow-header);
  flex-wrap: wrap;
}
.brand { display: flex; flex-direction: column; gap: 3px; line-height: 1; }
.brand-logo { display: block; height: 13px; width: auto; }
.brand-sub { font-size: .66rem; letter-spacing: .04em; color: var(--pink-dark); text-transform: uppercase; }
.app-nav { display: flex; gap: var(--sp-1); margin-left: var(--sp-3); }
.nav-link {
  padding: 8px 16px; border-radius: var(--radius-pill);
  color: var(--pink-dark); font-weight: 500; transition: .2s;
}
.nav-link:hover { background: var(--white); color: var(--purple); border-radius: var(--radius-tight); }
.nav-link.active { color: var(--purple); background: var(--white); box-shadow: var(--shadow-card); }
.app-user { margin-left: auto; display: flex; align-items: center; gap: var(--sp-3); }
.user-meta { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.user-name { font-weight: 600; }
.user-role { font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--pink-dark); }
.app-main { max-width: var(--content-max); margin: var(--sp-5) auto; padding: 0 var(--sp-4); }
.app-footer { max-width: var(--content-max); margin: var(--sp-5) auto var(--sp-4); padding: 0 var(--sp-4); color: var(--pink-dark); font-size: .78rem; }

/* --- Headings ------------------------------------------------------------- */
.page-head { margin-bottom: var(--sp-4); }
.page-head h1 { font-size: 2rem; letter-spacing: -.01em; }
.section-title { font-family: var(--body-font); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; font-size: .82rem; color: var(--pink-dark); margin: var(--sp-5) 0 var(--sp-3); }
.head-actions { display: flex; align-items: center; gap: var(--sp-2); }
.back-link { color: var(--pink-dark); font-weight: 600; font-size: .85rem; }
.back-link:hover { color: var(--purple); }

/* --- Buttons (radius-morph signature) ------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: 10px 24px; border: 2px solid var(--green); border-radius: var(--radius-pill);
  font-family: var(--head-font); font-size: .9rem; font-weight: 500; color: var(--black);
  background: var(--white); cursor: pointer; transition: border-radius .2s, background .2s, border-color .2s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { border-radius: var(--radius-tight); }
.btn:focus-visible { outline: none; border-radius: var(--radius-tight); border-style: dashed; border-color: var(--purple); }
.btn-primary { background: var(--green); border-color: var(--green); color: var(--black); }
.btn-primary:hover { background: var(--green-deep); border-color: var(--green-deep); color: #fff; }
.btn-secondary { background: var(--white); border-color: var(--green); }
.btn-tertiary { background: var(--white); border: 1px solid var(--black); color: var(--purple); }
.btn-sm { padding: 6px 16px; font-size: .82rem; }
.btn.disabled, .btn:disabled { background: var(--gray); border-color: var(--gray); color: var(--pink-dark); cursor: not-allowed; pointer-events: none; }

/* --- Progress card -------------------------------------------------------- */
.progress-card {
  background: var(--white); border-radius: var(--radius-card); box-shadow: var(--shadow-card);
  padding: var(--sp-4); margin-bottom: var(--sp-4);
}
.progress-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--sp-2); }
.progress-title { font-weight: 600; }
.progress-pct { font-family: var(--head-font); font-size: 1.8rem; color: var(--green-deep); }
.progress-track { height: 12px; background: var(--sand); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--green), var(--green-deep)); border-radius: 999px; transition: width .4s; }
.progress-legend { margin-top: var(--sp-2); font-size: .85rem; }

/* --- Summary cards -------------------------------------------------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--sp-3); }
.card {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--white); border: 2px solid transparent; border-radius: var(--radius-tight);
  padding: var(--sp-4); box-shadow: var(--shadow-card); transition: border-radius .2s, transform .2s, border-color .2s;
  color: var(--purple);
}
a.card:hover { border-radius: var(--radius-pill); transform: translateY(-2px); }
.card-value { font-family: var(--head-font); font-size: 2.1rem; font-weight: 600; line-height: 1.1; }
.card-label { font-size: .82rem; color: var(--pink-dark); }
.card-completed { border-left: 4px solid var(--green); }
.card-pending { border-left: 4px solid var(--pending-fg); }
.card-declined { border-left: 4px solid var(--danger-fg); }
.card-expired { border-left: 4px solid var(--info-fg); }
.card-neutral { border-left: 4px solid var(--pink-dark); }

/* --- Status strip --------------------------------------------------------- */
.status-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--sp-3); margin-top: var(--sp-4); }
.status-item { background: var(--white); border: 1px solid var(--sand); border-radius: var(--radius-card); padding: var(--sp-3) var(--sp-4); }
.status-label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--pink-dark); }
.status-value { font-weight: 600; }

/* --- Panels / empty states ----------------------------------------------- */
.panel { background: var(--white); border: 1px solid var(--sand); border-radius: var(--radius-card); padding: var(--sp-4); box-shadow: var(--shadow-card); }
.empty-state { color: var(--pink-dark); }
.panel.empty { text-align: center; padding: var(--sp-5); }
.panel code, .empty-state code { background: var(--sand); padding: 2px 8px; border-radius: var(--radius-tight); font-size: .85em; }

/* --- Filter bar ----------------------------------------------------------- */
.filter-bar { display: flex; flex-direction: column; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.search-field { display: flex; gap: var(--sp-2); }
.search-field input {
  flex: 1; padding: 11px 20px; border: 1px solid var(--pink-dark); border-radius: var(--radius-pill);
  font-family: var(--body-font); font-size: .95rem; background: var(--white); transition: border-radius .2s, border-color .2s;
}
.search-field input:focus { outline: none; border-radius: var(--radius-tight); border-color: var(--purple); }
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip {
  padding: 7px 16px; border: 1px solid var(--pink); border-radius: var(--radius-tight);
  color: var(--purple); font-size: .82rem; font-weight: 500; background: var(--white); transition: border-radius .2s, background .2s;
}
.chip:hover { border-radius: var(--radius-pill); }
.chip-active { background: var(--purple); color: var(--white); border-color: var(--purple); }

/* --- Data table ----------------------------------------------------------- */
.table-wrap { background: var(--white); border-radius: var(--radius-card); box-shadow: var(--shadow-card); overflow: hidden; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.data-table thead th {
  position: sticky; top: 0; background: var(--sand-light); z-index: 1;
  text-align: left; padding: 12px 16px; font-family: var(--body-font); font-weight: 800;
  text-transform: uppercase; letter-spacing: .03em; font-size: .68rem; color: var(--pink-dark);
  border-bottom: 2px solid var(--sand); white-space: nowrap;
}
.data-table th.sortable a { color: var(--pink-dark); display: inline-block; }
.data-table th.sorted a { color: var(--purple); }
.data-table tbody td { padding: 12px 16px; border-bottom: 1px solid var(--sand); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.clickable-row { cursor: pointer; transition: background .12s; }
.clickable-row:hover { background: var(--sand-light); }
.cell-name { font-weight: 600; }
.data-table .chevron { color: var(--pink-dark); font-size: 1.3rem; text-align: right; width: 1px; }

/* --- Badges --------------------------------------------------------------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 600; white-space: nowrap; }
.badge-completed, .badge-delivered { background: var(--ok-bg); color: var(--ok-fg); }
.badge-pending, .badge-draft { background: var(--pending-bg); color: var(--pending-fg); }
.badge-declined { background: var(--danger-bg); color: var(--danger-fg); }
.badge-expired, .badge-deleted { background: var(--info-bg); color: var(--info-fg); }
.badge-unknown, .badge-muted { background: var(--muted-bg); color: var(--muted-fg); }

/* --- Pagination ----------------------------------------------------------- */
.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: var(--sp-3); flex-wrap: wrap; gap: var(--sp-2); }
.pager { display: flex; align-items: center; gap: var(--sp-3); }
.page-indicator { font-size: .85rem; color: var(--pink-dark); }

/* --- Detail view ---------------------------------------------------------- */
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: var(--sp-4); align-items: start; }
.detail-main { display: flex; flex-direction: column; gap: var(--sp-4); }
.detail-side { display: flex; flex-direction: column; gap: var(--sp-4); position: sticky; top: 80px; }
.info-card { background: var(--white); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: var(--sp-4); }
.info-title { font-family: var(--body-font); font-weight: 800; text-transform: uppercase; letter-spacing: .03em; font-size: .72rem; color: var(--pink-dark); margin-bottom: var(--sp-3); }
.info-body { display: flex; flex-direction: column; gap: 10px; }
.kv { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); }
.kv-label { color: var(--pink-dark); font-size: .85rem; }
.kv-value { font-weight: 600; text-align: right; }
.kv-value.mono { font-weight: 500; font-size: .78rem; word-break: break-all; }
.hash { background: var(--sand); padding: 2px 6px; border-radius: var(--radius-tight); font-size: .76rem; }

/* --- Timeline ------------------------------------------------------------- */
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.timeline li { position: relative; padding-left: 20px; }
.timeline li::before { content: ""; position: absolute; left: 3px; top: 6px; bottom: -14px; width: 2px; background: var(--sand); }
.timeline li:last-child::before { display: none; }
.tl-dot { position: absolute; left: 0; top: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.tl-time { display: block; font-size: .72rem; color: var(--pink-dark); }
.tl-body { font-size: .85rem; }

/* --- Login ---------------------------------------------------------------- */
body.auth { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: radial-gradient(1200px 600px at 50% -10%, #fff 0%, var(--sand-light) 55%); }
.login-card { background: var(--white); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: var(--sp-5); width: min(420px, 92vw); }
.login-brand { display: flex; flex-direction: column; gap: 4px; margin-bottom: var(--sp-4); }
.login-brand .brand-mark { font-family: var(--head-font); font-weight: 700; font-size: 1.6rem; color: var(--purple); letter-spacing: .02em; }
.login-brand .brand-sub { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--pink-dark); }
.login-card h1 { font-size: 1.5rem; margin-bottom: var(--sp-4); }
.login-form { display: flex; flex-direction: column; gap: var(--sp-3); }
.login-form label { display: flex; flex-direction: column; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--pink-dark); }
.login-form input { padding: 12px 20px; border: 1px solid var(--pink-dark); border-radius: var(--radius-pill); font: inherit; background: var(--white); transition: border-radius .2s, border-color .2s; }
.login-form input:focus { outline: none; border-radius: var(--radius-tight); border-color: var(--purple); }
.login-form .btn { justify-content: center; margin-top: var(--sp-2); }
.login-note { margin-top: var(--sp-4); font-size: .74rem; color: var(--pink-dark); }
.form-error { background: var(--danger-bg); color: var(--danger-fg); border-radius: var(--radius-tight); padding: 10px 14px; font-size: .85rem; }

/* --- Error page ----------------------------------------------------------- */
body.error-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.error-card { text-align: center; background: var(--white); padding: var(--sp-5); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.error-card h1 { font-size: 3.5rem; color: var(--purple); }
.error-card p { color: var(--pink-dark); margin: var(--sp-3) 0 var(--sp-4); }

/* --- Ops / flash ---------------------------------------------------------- */
.ops-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-3); }
.flash { padding: 12px 18px; border-radius: var(--radius-card); font-size: .9rem; font-weight: 600; margin-bottom: var(--sp-3); }
.flash-ok { background: var(--ok-bg); color: var(--ok-fg); }
.flash-pending { background: var(--pending-bg); color: var(--pending-fg); }

/* --- Responsive ----------------------------------------------------------- */
@media (max-width: 860px) {
  .detail-grid { grid-template-columns: 1fr; }
  .detail-side { position: static; }
}
@media (max-width: 640px) {
  .app-header { gap: var(--sp-2); padding: 10px var(--sp-3); }
  .app-nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; }
  .app-user { margin-left: auto; }
  .page-head h1 { font-size: 1.6rem; }
  .ellipsis { max-width: 120px; }
}
