:root {
  --bg: #eef1f4;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --card: #ffffff;
  --text: #1a1f29;
  --ink: #1b222b;
  --muted: #64707d;
  --border: #e3e7eb;

  /* Kiinteä, tumma/hillitty peruspaletti (ei asiakaskohtaisesti muutettavissa) */
  --primary: #26313e;
  --primary-2: #333f4d;

  /* Brändin korostusväri — SuperAdmin voi vaihtaa (branding.primaryColor), oletus sama
     poltettu oranssi kuin kalenterin tehostevärissä, jotta ulkoasu on yhtenäinen. */
  --accent: #bb6a2c;
  --accent-2: #a55a20;

  --free: #eef2f0;
  --free-border: #6f8f82;
  --busy: #f6dbd4;
  --busy-border: #c1503a;

  --radius: 14px;
  --radius-lg: 18px;
  --shadow-card: 0 1px 2px rgba(15,23,32,.04), 0 10px 24px -14px rgba(15,23,32,.18);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  background-image: radial-gradient(1200px 400px at 50% -120px, rgba(38,49,62,.05), transparent);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

/* ===== Julkisen varaussivun rakenne ===== */
.site-header {
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}
.site-header-inner { max-width: 1080px; margin: 0 auto; padding: clamp(12px, 2.5vw, 16px) clamp(16px, 4vw, 24px); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: clamp(28px, 6vw, 36px); border-radius: 8px; }
.brand-mark {
  width: clamp(30px, 7vw, 38px); height: clamp(30px, 7vw, 38px); border-radius: 10px;
  background: var(--accent); color: white; font-weight: 800; display: flex; align-items: center; justify-content: center;
  font-size: clamp(.95rem, 3vw, 1.1rem); flex-shrink: 0;
  box-shadow: 0 2px 6px -1px rgba(187,106,44,.45);
}
.brand h1 { font-size: clamp(1.05rem, 3vw, 1.3rem); margin: 0; color: var(--ink); font-weight: 700; letter-spacing: -.01em; }

.page { max-width: 1080px; margin: 0 auto; padding: clamp(16px, 4vw, 28px); padding-bottom: 90px; }
.hero-text {
  color: var(--muted); font-size: clamp(.9rem, 2.2vw, 1rem); margin: 0 0 20px; max-width: 640px;
}

/* ===== Etenemispalkki ===== */
.stepper { display: flex; align-items: center; margin: 0 0 16px; max-width: 460px; }
.stepper .step { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.stepper .step-num {
  width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border);
  color: var(--muted); font-size: .78rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stepper .step-label { font-size: .78rem; color: var(--muted); white-space: nowrap; display: none; }
.stepper .step.active .step-num { background: var(--accent); border-color: var(--accent); color: white; }
.stepper .step.active .step-label { color: var(--ink); font-weight: 700; display: inline; }
.stepper .step.done .step-num { background: var(--primary); border-color: var(--primary); color: white; }
.stepper .step-line { flex: 1; height: 2px; background: var(--border); margin: 0 4px; min-width: 12px; }
@media (min-width: 560px) { .stepper .step-label { display: inline; } }

/* ===== Luottamusmerkit ===== */
.trust-row { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 20px; }
.trust-item { font-size: .8rem; color: var(--muted); }

.site-footer { text-align: center; margin-top: 32px; padding-top: 16px; border-top: 1px solid rgba(0,0,0,.08); }
.site-footer a { color: var(--muted); font-size: .85rem; text-decoration: underline; }

.layout { display: block; }
.steps-col { display: flex; flex-direction: column; gap: 18px; }
.summary-col { display: flex; flex-direction: column; gap: 18px; margin-top: 18px; }
@media (min-width: 960px) {
  .layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 26px; align-items: start; }
  .summary-col { margin-top: 0; position: sticky; top: 20px; }
}

.step-card, .summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(16px, 4vw, 22px);
  box-shadow: var(--shadow-card);
}
.step-card h2, .summary-card h2 {
  display: flex; align-items: center; gap: 10px;
  font-size: .78rem; margin: 0 0 14px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em; font-weight: 700;
}
.step-card h2::before, .summary-card h2:not(.no-icon)::before {
  content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); flex-shrink: 0;
}
.summary-card#infoCard { background: var(--surface-2); box-shadow: none; }
#instructionsText { margin: 0; }
.summary-card.confirm-card { text-align: center; }
h2.no-icon { text-transform: none; font-size: 1.15rem; letter-spacing: 0; color: var(--ink); justify-content: center; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
h2 { font-size: 1rem; margin: 0 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
select, input, textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 10px;
  background: white;
  font-family: inherit;
}
/* Ilman tätä textarea olisi oletuksena kapeampi kuin muut nimi-/yhteystietokentät (esim.
   asiakkaan oma "Lisätiedot"-kenttä varauslomakkeella) — sama täysi leveys kaikille. */
textarea { resize: vertical; }
select:focus, input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip {
  padding: 10px 16px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: white;
  font-size: .95rem;
  cursor: pointer;
  user-select: none;
  min-height: 44px;
}
.chip.selected { border-color: var(--primary); background: #e8ebee; font-weight: 600; color: var(--primary); }

/* ===== Aikakalenteri (tumma/hillitty, tunti-rivit + puolen tunnin jako) ===== */
.cal-card { padding: 0; overflow: hidden; }
.cal-card h2 { padding: 16px 16px 0; }
.cal-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px; background: var(--primary); color: #eef1f4; padding: 12px 14px; margin-top: 12px;
}
.cal-toolbar-left, .cal-toolbar-mid, .cal-toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-icon-btn {
  width: clamp(32px, 8vw, 38px); height: clamp(32px, 8vw, 38px); border-radius: 10px; border: 1px solid #3c4757;
  background: var(--primary-2); color: #eef1f4; font-size: clamp(.9rem, 3vw, 1.05rem); cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0; margin: 0; min-height: unset; flex-shrink: 0;
}
.cal-icon-btn:hover { background: #3d4a59; }
.cal-nav-btn { border-radius: 50%; }
.cal-view-label { font-size: .8rem; color: #a9b2bd; white-space: nowrap; }
.cal-switch { position: relative; display: inline-block; width: 40px; height: 23px; flex-shrink: 0; }
.cal-switch input { opacity: 0; width: 0; height: 0; }
.cal-switch-slider { position: absolute; cursor: pointer; inset: 0; background: #48545f; border-radius: 999px; transition: .15s; }
.cal-switch-slider::before {
  content: ""; position: absolute; height: 17px; width: 17px; left: 3px; top: 3px; background: white; border-radius: 50%; transition: .15s;
}
.cal-switch input:checked + .cal-switch-slider { background: var(--accent); }
.cal-switch input:checked + .cal-switch-slider::before { transform: translateX(17px); }
.cal-week-badge {
  background: var(--primary-2); border: 1px solid #3c4757; border-radius: 8px; padding: 7px 9px;
  font-size: .8rem; color: #a9b2bd; min-width: 26px; text-align: center; flex-shrink: 0;
}
.cal-date-input {
  width: auto; margin: 0; padding: 7px 9px; font-size: .84rem; border-radius: 8px; border: 1px solid #3c4757;
  background: var(--primary-2); color: #eef1f4; min-width: 0;
}
.cal-weekdays { display: flex; gap: 4px; padding: 10px 14px; background: var(--primary-2); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cal-weekday-btn {
  flex: 1; min-width: 38px; text-align: center; padding: 8px 4px; border-radius: 8px; border: 1px solid transparent;
  background: transparent; color: #a9b2bd; font-size: .8rem; font-weight: 600; cursor: pointer; min-height: 36px;
}
.cal-weekday-btn.active { background: var(--accent); color: white; }
.cal-weekday-btn:hover:not(.active) { background: #3d4a59; color: #eef1f4; }
.cal-manual { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.cal-manual label { margin-top: 0; }
.cal-manual-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cal-manual-row input, .cal-manual-row select { margin-bottom: 0; flex: 1; min-width: 110px; }
.cal-manual-btn { width: auto; padding: 10px 16px; flex-shrink: 0; }
.cal-header { background: var(--accent); color: white; text-align: center; font-weight: 700; padding: 10px; font-size: .95rem; }
.cal-legend { display: flex; justify-content: center; gap: 16px; padding: 8px 14px; font-size: .76rem; color: var(--muted); border-bottom: 1px solid var(--border); }
.cal-legend-item { display: flex; align-items: center; gap: 5px; }
.cal-legend-dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.cal-legend-dot.free { background: var(--free); border: 1px solid var(--free-border); }
.cal-legend-dot.busy { background: var(--busy); border: 1px solid var(--busy-border); }
.cal-legend-dot.picked { background: var(--primary); }
.cal-empty-state { padding: 32px 16px; text-align: center; color: var(--muted); font-size: .9rem; }
.cal-week-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 6px; padding: 14px; }
.cal-week-day-card { border: 1px solid var(--border); border-radius: 10px; padding: 10px 6px; text-align: center; cursor: pointer; background: white; }
.cal-week-day-card:hover { border-color: var(--primary); }
.cal-week-day-card .wd-label { font-size: .74rem; color: var(--muted); font-weight: 700; }
.cal-week-day-card .wd-date { font-size: .82rem; margin: 4px 0; }
.cal-week-day-card .wd-status { font-size: .7rem; padding: 3px 6px; border-radius: 999px; display: inline-block; }
.cal-week-day-card .wd-status.free { background: var(--free); color: var(--free-border); }
.cal-week-day-card .wd-status.full { background: var(--busy); color: var(--busy-border); }
.cal-day-grid {
  /* Ei enää omaa sisäistä skrollia — koko sivu skrollaa yhtenä kokonaisuutena.
     Aiemmin tällä oli max-height + overflow-y: auto, jolloin sivulla oli kaksi
     päällekkäistä skrollausaluetta (koko sivu + kalenterilaatikko), mikä oli
     hämmentävää sekä työpöydällä että mobiilissa. */
}
.cal-hour-row { display: flex; border-bottom: 1px solid var(--border); }
.cal-hour-row:nth-child(odd) { background: var(--surface-2); }
.cal-hour-label { width: 54px; flex-shrink: 0; padding: 8px 6px; font-size: .76rem; color: var(--muted); font-weight: 600; }
.cal-hour-cells { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.cal-slot {
  padding: 9px 8px; font-size: .82rem; border-left: 3px solid var(--free-border); background: var(--free);
  cursor: pointer; min-height: 44px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px dashed #e5e8eb; touch-action: manipulation;
}
.cal-hour-cells .cal-slot:last-child { border-bottom: none; }
.cal-slot .cs-cap { font-size: .72rem; color: var(--free-border); font-weight: 600; }
.cal-slot.busy { border-left-color: var(--busy-border); background: var(--busy); color: #7a2e1c; font-weight: 600; cursor: not-allowed; }
.cal-slot.busy .cs-cap { color: var(--busy-border); font-weight: 700; }
.cal-slot.past { border-left-color: var(--border); background: var(--surface-2); color: var(--muted); cursor: not-allowed; opacity: .65; }
.cal-slot.picked { background: var(--primary); border-left-color: var(--primary); color: white; font-weight: 700; }
.cal-slot.picked .cs-cap { color: #dfe6ee; }
.cal-slot:hover:not(.busy):not(.picked) { background: #e6ede9; }

.cal-period-info { padding: 16px; }
.cal-period-info .pi-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .92rem; }
.cal-period-info .pi-row:last-child { border-bottom: none; }
.cal-period-info .pi-row strong { color: var(--ink); }
.cal-period-info .pi-hint { color: var(--muted); font-size: .84rem; margin-top: 10px; }

/* ===== Napit ===== */
button.primary, .btn-cta {
  width: 100%; padding: clamp(13px, 3vw, 16px); font-size: clamp(.95rem, 2.5vw, 1.05rem);
  border: none; border-radius: 12px; background: var(--accent); color: white; font-weight: 700;
  cursor: pointer; min-height: 48px; transition: background .12s;
}
button.primary:hover, .btn-cta:hover { background: var(--accent-2); }
button.primary:disabled, .btn-cta:disabled { background: #c7cdd3; cursor: not-allowed; }
.payment-badge {
  text-align: center; font-size: .78rem; color: var(--muted, #6b7280); margin-top: 8px;
  display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap;
}
.payment-badge strong { color: var(--ink); }
.payment-badge-icon { font-size: .95rem; }
button.secondary, .btn-outline {
  width: 100%; padding: clamp(11px, 2.5vw, 13px); border-radius: 12px; border: 2px solid var(--border);
  background: white; color: var(--ink); font-weight: 600; cursor: pointer; min-height: 44px; transition: background .12s;
}
button.secondary:hover, .btn-outline:hover { background: var(--surface-2); }

.price-line { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.05rem; margin: 4px 0 14px; }
.price-line strong { font-size: clamp(1.4rem, 4vw, 1.7rem); color: var(--accent); }
.muted { color: var(--muted); font-size: .9rem; }
.muted.small { font-size: .8rem; margin-top: 10px; }
.pin-display {
  text-align: center; font-size: clamp(2rem, 8vw, 2.6rem); font-weight: 800; letter-spacing: .28em;
  background: var(--surface-2); border-radius: 12px; padding: clamp(16px, 5vw, 24px); margin: 14px 0; color: var(--primary);
}
.mobile-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  background: var(--surface); border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(15,23,32,.08);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px;
}
.mobile-cta-price { display: flex; flex-direction: column; line-height: 1.2; }
.mobile-cta-price strong { font-size: 1.15rem; color: var(--accent); }
.mobile-cta .btn-cta { width: auto; flex: 1; margin: 0; }
@media (min-width: 960px) { .mobile-cta { display: none !important; } }

.toast {
  position: fixed; bottom: 16px; left: 16px; right: 16px; max-width: 700px; margin: 0 auto;
  background: var(--ink); color: white; padding: 14px 18px; border-radius: 12px; text-align: center; z-index: 50;
}
@media (max-width: 959px) { .toast { bottom: 84px; } }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
table th, table td { text-align: left; padding: 8px; border-bottom: 1px solid #eee; }
label { font-size: .85rem; color: var(--muted); display: block; margin-bottom: 4px; margin-top: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.badge.paid { background: #e6f4ea; color: #1e7e34; }
.badge.hold { background: #fff4e0; color: #a86a00; }

/* ===== WordPress-tyylinen SuperAdmin-hallintapaneeli ===== */
.wp-shell { display: flex; min-height: 100vh; }
.wp-sidebar { width: 230px; background: #1d2327; color: #dcdcde; flex-shrink: 0; }
/* KORJAUS: yleinen .brand-sääntö (ks. yllä) on "display:flex" vaakariviä varten (logo + teksti
   vierekkäin), mutta täällä .brand sisältää vain kaksiriviisen otsikko+alaotsikko-tekstin
   ("Varausjärjestelmä" / "Hallintapaneeli"). Peritty flex-rivi asetti ne VIEREKKÄIN, jolloin
   "Hallintapaneeli" jäi osittain sivupalkin reunan taakse piiloon — pakotetaan pystysuuntaiseksi. */
.wp-sidebar .brand {
  display: block; padding: 18px 20px; font-weight: 700; color: white;
  border-bottom: 1px solid #2c3338; font-size: 1.05rem; line-height: 1.3; word-break: break-word;
}
.wp-sidebar .brand small { display: block; font-weight: 400; color: #9ea3a8; font-size: .72rem; margin-top: 2px; }
.wp-sidebar nav button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 12px 20px; background: none; border: none; color: #dcdcde; cursor: pointer;
  font-size: .92rem; border-left: 3px solid transparent; min-height: 44px;
}
.wp-sidebar nav button:hover { background: #2c3338; color: white; }
.wp-sidebar nav button.active { background: #2271b1; color: white; border-left-color: #72aee6; font-weight: 600; }
/* Ryhmitellyt päävalikot: kukin <details> on yksi taittuva ryhmä, jonka <summary> on
   ryhmän otsikko. Pitää hallintapaneelin selkeänä vaikka välilehtien määrä kasvaa. */
.wp-sidebar nav .nav-group { border-bottom: 1px solid #2c3338; }
.wp-sidebar nav .nav-group summary {
  padding: 11px 20px; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
  color: #8c8f94; cursor: pointer; list-style: none; user-select: none;
  display: flex; align-items: center; justify-content: space-between;
}
.wp-sidebar nav .nav-group summary::-webkit-details-marker { display: none; }
.wp-sidebar nav .nav-group summary::after { content: '▸'; transition: transform .15s; }
.wp-sidebar nav .nav-group[open] summary::after { transform: rotate(90deg); }
.wp-sidebar nav .nav-group summary:hover { color: #dcdcde; }
.wp-sidebar .logout-btn { margin: 16px 20px; padding: 10px; width: calc(100% - 40px); background: #2c3338; color: #dcdcde; border: none; border-radius: 4px; cursor: pointer; }
.sidebar-docs { margin: 10px 20px 0; padding-top: 14px; border-top: 1px solid #3c434a; }
.sidebar-docs-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #8c8f94; margin-bottom: 8px; }
.sidebar-docs a { display: block; color: #dcdcde; text-decoration: none; font-size: .85rem; padding: 5px 0; }
.sidebar-docs a:hover { color: #72aee6; }
.sidebar-docs button.sidebar-doc-btn { display: block; width: 100%; text-align: left; background: none; border: none; color: #dcdcde; font-size: .85rem; padding: 5px 0; cursor: pointer; font-family: inherit; }
.sidebar-docs button.sidebar-doc-btn:hover { color: #72aee6; }
.wp-content { flex: 1; background: #f0f0f1; min-height: 100vh; }
.wp-topbar { background: white; padding: 14px 26px; border-bottom: 1px solid #dcdcde; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.wp-topbar .who { font-size: .85rem; color: #646970; white-space: nowrap; }
.topbar-search { position: relative; flex: 1; max-width: 420px; }
.topbar-search input { width: 100%; padding: 8px 12px; border: 1px solid #dcdcde; border-radius: 6px; font-size: .9rem; }
.topbar-search input:focus { outline: 2px solid #2271b1; border-color: #2271b1; }
.topbar-search-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff;
  border: 1px solid #dcdcde; border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  max-height: 420px; overflow-y: auto; z-index: 200;
}
.topbar-search-results .tsr-group-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: #8c8f94; padding: 8px 14px 2px; }
.topbar-search-results .tsr-item { display: block; width: 100%; text-align: left; background: none; border: none; padding: 8px 14px; cursor: pointer; font-size: .85rem; border-bottom: 1px solid #f0f0f1; }
.topbar-search-results .tsr-item:last-child { border-bottom: none; }
.topbar-search-results .tsr-item:hover, .topbar-search-results .tsr-item.tsr-active { background: #f0f6fc; }
.topbar-search-results .tsr-item .tsr-title { font-weight: 600; display:block; }
.topbar-search-results .tsr-item .tsr-snippet { color: #646970; font-size: .78rem; display:block; margin-top: 2px; }
.topbar-search-results .tsr-empty { padding: 14px; color: #8c8f94; font-size: .85rem; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 500;
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto;
}
.modal-box { background: #fff; border-radius: 10px; max-width: 680px; width: 100%; padding: 28px 30px; position: relative; box-shadow: 0 10px 40px rgba(0,0,0,0.2); }
.modal-close { position: absolute; top: 14px; right: 14px; background: none; border: none; font-size: 1.1rem; cursor: pointer; color: #646970; }
.modal-close:hover { color: #1d2327; }
.modal-body { white-space: pre-wrap; font-size: .9rem; line-height: 1.6; margin-top: 10px; max-height: 60vh; overflow-y: auto; }
.wp-main { padding: 22px 26px; max-width: 1150px; }
.wp-panel-title { font-size: 1.5rem; margin: 0 0 18px; font-weight: 600; color: #1d2327; }
.wp-card { background: white; border: 1px solid #dcdcde; border-radius: 4px; padding: 20px; margin-bottom: 20px; }
.wp-card h3 { margin-top: 0; font-size: 1rem; border-bottom: 1px solid #f0f0f1; padding-bottom: 10px; color: #1d2327; }
button.wp-btn { background: #2271b1; color: white; border: none; padding: 9px 18px; border-radius: 3px; cursor: pointer; font-size: .9rem; min-height: 40px; }
button.wp-btn:hover { background: #135e96; }
button.wp-btn.danger { background: #d63638; }
button.wp-btn.danger:hover { background: #a02224; }
button.wp-btn.secondary { background: white; color: #2271b1; border: 1px solid #2271b1; }
button.wp-btn:disabled, button.wp-btn.secondary:disabled, button.wp-btn.danger:disabled {
  background: #e2e5e8; color: #8a9199; border-color: #d3d7db; cursor: not-allowed;
}
.wp-main input:disabled, .wp-main select:disabled, .wp-main textarea:disabled { background: #f1f2f3; color: #8a9199; cursor: not-allowed; }
.wp-table { width: 100%; border-collapse: collapse; }
.wp-table th { text-align: left; background: #f6f7f7; padding: 9px 10px; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: #646970; border-bottom: 1px solid #dcdcde; }
.wp-table td { padding: 9px 10px; border-bottom: 1px solid #f0f0f1; font-size: .88rem; vertical-align: top; }
.wp-row-actions button { font-size: .78rem; padding: 4px 9px; margin-right: 4px; min-height: unset; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 12px 0; }
.perm-chip { display: flex; align-items: center; gap: 7px; padding: 9px; border: 1px solid #dcdcde; border-radius: 4px; font-size: .85rem; cursor: pointer; background: #f9f9f9; }
.perm-chip input { width: auto; margin: 0; }
.wp-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wp-empty { color: #8c8f94; font-style: italic; padding: 10px 0; }
.log-entry { padding: 8px 0; border-bottom: 1px solid #f0f0f1; font-size: .86rem; }
.log-entry .log-time { color: #8c8f94; font-size: .78rem; }
.log-entry .log-tag { display: inline-block; background: #f0f0f1; border-radius: 3px; padding: 1px 7px; font-size: .72rem; margin-right: 6px; color: #2271b1; font-weight: 600; }
@media (max-width: 780px) {
  .wp-shell { flex-direction: column; }
  .wp-sidebar { width: 100%; }
  /* HUOM: aiemmin täällä purettiin <details>-ryhmät "display:contents"-tempulla yhdeksi
     vaakascrollattavaksi flex-riviksi. Se osoittautui epäluotettavaksi — display:contents
     yhdistettynä flex-wrap:nowrap-asetukseen rikkoi asettelun (napit järjestyivät sekaisin
     pystysuuntaisiksi "sarakkeiksi" ryhmittäin scrollattavan alueen sisällä sen sijaan että
     olisivat pysyneet yhdellä vaakarivillä). Yksinkertaisempi ja luotettavampi ratkaisu:
     käytetään mobiilissa SAMAA taittuvaa (accordion) valikkoa kuin työpöydällä, vain koko
     leveydeltään — vie vähemmän tilaa kerralla eikä nojaa herkkään CSS-yhdistelmään. */
  .wp-sidebar .brand { display: none; }
  .wp-sidebar .logout-btn { display: none; }
  .wp-form-row { grid-template-columns: 1fr; }
  .wp-main { padding: 16px; }
}

/* Admin-lomakkeen kentät jotka pitää pysyä piilossa roolista riippumatta muista display-asetuksista */
.force-hidden { display: none !important; }
