/* KUSMIS secondary pages (privacy notice, Minu KUSMIS, organizer workspace).
 * Same tokens and type as the public app (app.css): Inter, brand red accent for
 * interactive text, neutral surfaces, 44px touch targets, visible focus. */
:root {
  --primary: #FF2D55;
  --primary-strong: #E12246;
  --primary-soft: #FFE8EC;
  --secondary: #0066FF;
  --bg: #F8F9FA;
  --surface: #FFFFFF;
  --muted-surface: #E9ECEF;
  --text: #111827;
  --text-2: #4B5563;
  --text-3: #6B7280;
  --border: #E5E7EB;
  --focus: #0066FF;
  --error: #B42318;
  --error-soft: #FEF3F2;
  --warning: #8A5A00;
  --warning-soft: #FFF7E0;
  --success: #067647;
  --success-soft: #ECFDF3;
  --info-soft: #EEF4FF;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, .06);
  --shadow-lg: 0 12px 32px rgba(17, 24, 39, .16);
  /* System fonts only: no third-party font requests (privacy) and no font licensing. */
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--primary-strong); }
h1, h2, h3 { line-height: 1.25; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--text); color: #fff; padding: 10px 14px; border-radius: var(--radius-sm); text-decoration: none; font-weight: 600; }
.skip-link:focus { top: 12px; }

/* ---- header ---- */
.p-header { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--border); }
.p-header__inner { max-width: 1040px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; min-height: 60px; }
.p-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: .02em; }
.p-brand img { width: 18px; height: 24px; }
.p-header__title { font-weight: 600; color: var(--text-2); padding-left: 12px; border-left: 1px solid var(--border); }
.p-header__end { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; min-width: 0; }
.p-header__end span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }

/* ---- layout ---- */
.p-main { max-width: 1040px; margin: 0 auto; padding: 20px 16px 48px; }
.p-main--narrow { max-width: 760px; }
.p-page-head { margin: 4px 0 18px; }
.p-page-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
.p-page-head p { margin: 6px 0 0; color: var(--text-2); }
.p-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin: 0 0 16px; box-shadow: var(--shadow-sm); }
.p-card > h2 { font-size: 18px; font-weight: 700; margin: 0 0 10px; }
.p-card > h3, .p-card h3 { font-size: 15px; font-weight: 700; margin: 16px 0 8px; }
.p-card p { margin: 0 0 10px; }
.p-card p:last-child { margin-bottom: 0; }
.p-muted { color: var(--text-2); }
.p-small { font-size: 13px; }
.p-grid { display: grid; gap: 16px; }
@media (min-width: 840px) { .p-grid--2 { grid-template-columns: 1fr 1fr; } .p-grid--sidebar { grid-template-columns: 240px 1fr; align-items: start; } }
.p-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.p-stack { display: grid; gap: 10px; }
.p-split { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }

/* ---- prose (privacy notice) ---- */
.p-prose h2 { font-size: 19px; margin: 26px 0 8px; }
.p-prose h3 { font-size: 16px; margin: 18px 0 6px; }
.p-prose p, .p-prose li { color: var(--text); }
.p-prose ul { padding-left: 20px; margin: 6px 0 12px; }
.p-prose li { margin: 4px 0; }
.p-prose table { width: 100%; border-collapse: collapse; margin: 8px 0 14px; font-size: 14px; }
.p-prose th, .p-prose td { text-align: left; vertical-align: top; padding: 8px; border-bottom: 1px solid var(--border); }
.p-prose th { color: var(--text-2); font-weight: 600; }
@media (max-width: 640px) {
  .p-prose table, .p-prose thead, .p-prose tbody, .p-prose tr, .p-prose td { display: block; }
  .p-prose thead { display: none; }
  .p-prose tr { padding: 8px 0; border-bottom: 1px solid var(--border); }
  .p-prose td { border: 0; padding: 2px 0; }
  .p-prose td:first-child { font-weight: 700; }
}

/* ---- controls ---- */
.p-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600; text-decoration: none; cursor: pointer; }
.p-btn:hover { background: var(--muted-surface); }
.p-btn--primary { background: var(--primary-strong); border-color: var(--primary-strong); color: #fff; }
.p-btn--primary:hover { background: #c81d3d; }
.p-btn--danger { background: var(--surface); border-color: var(--error); color: var(--error); }
.p-btn--danger:hover { background: var(--error-soft); }
.p-btn--ghost { border-color: transparent; background: transparent; }
.p-btn--small { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.p-btn:disabled { opacity: .55; cursor: not-allowed; }
.p-link-btn { border: 0; background: none; padding: 0; color: var(--primary-strong); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; min-height: 44px; }
.p-field { display: grid; gap: 4px; margin: 0 0 12px; }
.p-field > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.p-field small { color: var(--text-3); }
.p-input, .p-field input, .p-field select, .p-field textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #C9CDD3; border-radius: var(--radius-sm); background: var(--surface); }
.p-field textarea { min-height: 96px; resize: vertical; }
.p-check { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; }
.p-check input { width: 20px; height: 20px; margin-top: 2px; }

/* ---- status ---- */
.p-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--muted-surface); color: var(--text-2); white-space: nowrap; }
.p-badge--ok { background: var(--success-soft); color: var(--success); }
.p-badge--warn { background: var(--warning-soft); color: var(--warning); }
.p-badge--error { background: var(--error-soft); color: var(--error); }
.p-badge--info { background: var(--info-soft); color: #1849A9; }
.p-notice { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--info-soft); margin: 0 0 14px; }
.p-notice--warn { background: var(--warning-soft); }
.p-notice--error { background: var(--error-soft); color: var(--error); }
.p-notice--ok { background: var(--success-soft); }
.p-empty { color: var(--text-2); padding: 14px; border: 1px dashed var(--border); border-radius: var(--radius-sm); text-align: center; }

/* ---- lists & tables ---- */
.p-list { list-style: none; margin: 0; padding: 0; }
.p-list > li { padding: 12px 0; border-bottom: 1px solid var(--border); }
.p-list > li:last-child { border-bottom: 0; }
.p-item-title { font-weight: 700; }
.p-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.p-table th, .p-table td { text-align: left; padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.p-table th { color: var(--text-2); font-weight: 600; font-size: 13px; }
@media (max-width: 640px) {
  .p-table thead { display: none; }
  .p-table tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--border); }
  .p-table td { display: block; border: 0; padding: 2px 0; }
}

/* ---- tabs / nav ---- */
.p-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; }
.p-tab { min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-weight: 600; cursor: pointer; color: var(--text-2); }
.p-tab[aria-selected="true"] { background: var(--text); border-color: var(--text); color: #fff; }
.p-side-nav { display: grid; gap: 4px; }
.p-side-nav a { display: block; padding: 10px 12px; border-radius: var(--radius-sm); text-decoration: none; color: var(--text); font-weight: 600; }
.p-side-nav a:hover { background: var(--muted-surface); }

/* ---- kpis ---- */
.p-kpis { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 0 0 16px; }
.p-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.p-kpi__label { display: block; font-size: 13px; color: var(--text-2); }
.p-kpi__value { display: block; font-size: 24px; font-weight: 800; margin-top: 2px; }

/* ---- footer & toast ---- */
.p-footer { max-width: 1040px; margin: 0 auto; padding: 8px 16px 32px; color: var(--text-3); font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.p-footer a, .p-footer button { color: var(--text-2); font-size: 13px; font-weight: 500; }
.p-toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--text); color: #fff; padding: 12px 16px; border-radius: var(--radius-sm); max-width: min(92vw, 520px); z-index: 70; box-shadow: var(--shadow-lg); }
.p-toast--error { background: var(--error); }
.p-prose .p-link-btn { min-height: 0; vertical-align: baseline; }
@media (max-width: 839px) {
  .p-side-nav { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .p-side-nav a { white-space: nowrap; border: 1px solid var(--border); border-radius: 999px; padding: 8px 14px; background: var(--surface); font-size: 14px; }
}
@media (max-width: 520px) { .p-header__title { display: none; } .p-page-head h1 { font-size: 23px; } }
.p-grid > * { min-width: 0; }
.p-row > input, .p-row > select { min-height: 44px; padding: 10px 12px; border: 1px solid #C9CDD3; border-radius: var(--radius-sm); background: var(--surface); flex: 1 1 220px; min-width: 0; }
.p-header__end { gap: 12px; }
/* Sign in with Apple (HIG: black button, white logo + title). */
.p-btn--apple { margin-top: 8px; background: #000; border-color: #000; color: #fff; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; }
.p-btn--apple:hover { background: #1d1d1f; border-color: #1d1d1f; color: #fff; }
.p-apple-mark { width: 17px; height: 17px; flex: none; margin-top: -2px; }
