/* TIMOSIA / shared design system
   Tokens → base elements → controls → surfaces → feedback → utilities.
   Page styles are selected in app/core/View.php. See docs/CSS-TERKEP.md. */
:root {
  --bg: #f6f7f4;
  --panel: #ffffff;
  --surface: #f0f3ee;
  --border: #e0e6df;
  --text: #24362f;
  --muted: #718077;
  --brand: #285e4d;
  --brand-hover: #1c4739;
  --brand-soft: #eaf2ec;
  --primary: var(--brand);
  --radius: 18px;
  --shadow-xs: 0 2px 5px #253c2f03;
  --shadow-sm: 0 8px 28px #253c2f06;
  --container: 1240px;
  --navbar-h: 80px;
  --sidebar-w: 248px;
  --font-ui: 'Segoe UI', Inter, ui-sans-serif, system-ui, sans-serif;
  --font-editorial: Georgia, 'Times New Roman', serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font-ui); font-size: 14px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { touch-action: manipulation; }
a { color: var(--brand); text-underline-offset: 4px; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #7caa90; outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -.035em; font-weight: 600; overflow-wrap: anywhere; }
h1 { font-size: clamp(28px,3vw,40px); margin: 0 0 18px; }
h2 { font-size: 26px; margin: 0 0 16px; }
h3 { font-size: 18px; margin: 0 0 12px; }
p { margin: 0 0 16px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 28px 0; }
.page { min-height: 100dvh; display: flex; flex-direction: column; }
.container { width: min(var(--container), calc(100% - 64px)); margin-inline: auto; }
main { flex: 1; min-width: 0; padding: 0 0 48px; }
.inner-page main { padding-top: 40px; }
.container .container { width: 100%; }
.microsite-content { min-width: 0; }
.microsite-admin .microsite-content { width: min(var(--container), calc(100% - 72px)); margin: 40px auto 0; }
.eyebrow { display: block; color: var(--brand); font-size: 11px; font-weight: 700; letter-spacing: .17em; text-transform: uppercase; margin-bottom: 14px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 32px; }
.page-heading h1 { margin-bottom: 8px; }
.page-heading p { color: var(--muted); margin: 0; }
.ui-icon { width: 20px; height: 20px; flex: 0 0 20px; vertical-align: middle; }

/* Every native button and field follows the same system, including older forms. */
.btn, button, input[type=submit] { display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 11px 18px; border: 1px solid var(--border); border-radius: 10px; font-size: 13px; font-weight: 600; line-height: 1.5; background: var(--panel); color: var(--text); cursor: pointer; text-decoration: none; transition: background .18s,border-color .18s,box-shadow .18s,transform .18s; }
.btn:hover, button:hover { background: var(--surface); border-color: #bdccbf; }
.btn-primary, button[type=submit]:not(.btn), input[type=submit] { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 3px 8px #285e4d12; }
.btn-primary:hover, button[type=submit]:not(.btn):hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
.btn-secondary { background: var(--surface); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-danger { background: #fff4f1; border-color: #f0d8d0; color: #aa4a36; }
.btn-danger:hover { background: #f9e6e0; border-color: #e6c1b5; }
.btn:disabled, button:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: 7px 12px; font-size: 12px; }
.btn-lg { padding: 15px 23px; border-radius: 12px; font-size: 14px; }
.form { display: grid; gap: 22px; }
.field { min-width: 0; }
label { color: #4d6155; font-size: 12px; font-weight: 600; }
.field label, .form-group label { display: block; margin-bottom: 8px; }
input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=color]), select, textarea, .input { width: 100%; min-width: 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; background: var(--panel); color: var(--text); transition: border-color .18s,box-shadow .18s; }
input::placeholder, textarea::placeholder { color: #9aa59c; }
input:focus, select:focus, textarea:focus { border-color: #7caa90; box-shadow: 0 0 0 3px #285e4d0a; }
input:disabled, select:disabled, textarea:disabled { background: var(--surface); opacity: .7; }
textarea { resize: vertical; min-height: 100px; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--brand); vertical-align: middle; margin-right: 6px; }
input[type=color] { width: 64px; height: 44px; padding: 4px; border: 1px solid var(--border); border-radius: 10px; background: white; }
input[type=file]::file-selector-button { background: var(--surface); border: 0; border-radius: 6px; padding: 7px 12px; margin-right: 12px; color: var(--text); font: inherit; cursor: pointer; }

/* Surfaces, lists and data */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; min-width: 0; box-shadow: var(--shadow-xs); }
.card-title { font-size: 20px; margin: 0 0 7px; font-weight: 600; }
.card-sub { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; text-align: left; font-size: 13px; }
.table th { background: #f8faf7; font-size: 10px; font-weight: 700; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.table th, .table td { padding: 17px 16px; border-bottom: 1px solid #edf0eb; vertical-align: middle; }
.table th:first-child { border-radius: 10px 0 0 10px; }
.table th:last-child { border-radius: 0 10px 10px 0; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbf9; }
.table-wrap { max-width: 100%; overflow-x: auto; }
.badge { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 7px; padding: 4px 9px; font-size: 11px; font-weight: 600; background: #f7f9f5; color: #617061; }
.badge-green { background: #eaf4ec; color: #347250; border-color: #d7e8da; }
.badge-red { background: #fcf0ec; color: #aa5b43; border-color: #f0dcd3; }
.badge-gray { background: #f1f3ef; color: #69736b; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 18px; margin-bottom: 28px; }
.stat-card { position: relative; padding: 24px; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; }
.stat-label, .kpi-label { color: var(--muted); font-size: 12px; font-weight: 500; margin-bottom: 18px; }
.stat-value, .kpi-value { font-size: 34px; font-weight: 600; letter-spacing: -.05em; line-height: 1.2; overflow-wrap: anywhere; }
.stat-note { font-size: 11px; color: var(--muted); margin-top: 12px; }
.stat-icon { position: absolute; right: 22px; top: 20px; color: #819386; }
.stat-card.featured { background: var(--brand); color: white; border-color: var(--brand); }
.stat-card.featured .stat-label, .stat-card.featured .stat-note, .stat-card.featured .stat-icon { color: #c9ded0; }
.kpi-item { flex: 1; padding: 22px; border: 1px solid var(--border); border-radius: 14px; min-width: 0; }
.dashboard-columns { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(260px,1fr); gap: 24px; }
.action-list { display: grid; gap: 2px; }
.action-link { display: flex; align-items: center; gap: 14px; padding: 16px 4px; border-bottom: 1px solid #edf0eb; text-decoration: none; color: var(--text); }
.action-link:last-child { border-bottom: 0; }
.action-link:hover { color: var(--brand); }
.action-link .ui-icon { color: #78917f; }
.action-link .action-arrow { margin-left: auto; color: #9ba99d; }
.action-link small { display: block; color: var(--muted); font-size: 11px; font-weight: 400; margin-top: 3px; }
.definition-list { margin: 0; }
.definition-list div { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid #edf0eb; }
.definition-list div:last-child { border: 0; }
.definition-list dt { color: var(--muted); font-size: 12px; }
.definition-list dd { margin: 0; font-size: 13px; font-weight: 600; }
.empty-state { text-align: center; padding: 60px 24px; }
.empty-state p { color: var(--muted); max-width: 400px; margin: 0 auto 24px; }
.settings-card { max-width: 900px; }
.settings-form { display: grid; gap: 16px; }
.settings-form h3 { margin: 14px 0 0; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.settings-form br { display: none; }
.help { font-size: 12px; color: var(--muted); }

/* Feedback, footer, spacing */
.alert { padding: 15px 18px; border-radius: 12px; margin-bottom: 20px; font-size: 13px; border: 1px solid transparent; }
.alert-error, .alert.error { background: #fcf0ec; color: #9c4934; border-color: #f0d9d0; }
.alert.success { background: #eaf4ec; color: #347250; border-color: #d7e8da; }
.alert.warning { background: #fbf5e9; color: #93732e; border-color: #eee1c5; }
.alert.info { background: #edf3ee; color: #506f59; border-color: #d9e6db; }
.footer { border-top: 1px solid var(--border); padding: 28px 0; font-size: 11px; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.footer-mark { font-weight: 700; font-size: 14px; letter-spacing: -.04em; color: var(--text); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: 18px; }
.mt-12 { margin-top: 12px; } .mt-18 { margin-top: 18px; } .mt-24 { margin-top: 24px; } .mb-20 { margin-bottom: 20px; }
.muted { color: var(--muted); } .w-full { width: 100%; } .text-danger { color: #aa4a36; }
.toast-wrap { position: fixed; right: 24px; bottom: 24px; z-index: 10000; display: grid; gap: 12px; max-width: calc(100% - 48px); }
.toast { display: flex; gap: 20px; padding: 20px; background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 12px 40px #223e2c15; opacity: 0; transition: opacity .2s; }
.toast.show { opacity: 1; } .toast .t { margin: 0; font-weight: 600; } .toast .m { margin: 4px 0 0; color: var(--muted); }
.toast .x { border: 0; padding: 0 8px; background: transparent; color: inherit; font-size: 20px; }
@media (max-width: 900px) { .dashboard-columns { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 640px) {
  .container, .microsite-admin .microsite-content { width: calc(100% - 32px); }
  .container .container { width: 100%; }
  .inner-page main { padding-top: 26px; }
  .microsite-admin .microsite-content { margin-top: 26px; }
  .card { padding: 20px; border-radius: 14px; }
  .row > .field { flex-basis: 100% !important; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 16px; }
  .stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .stat-card { padding: 18px; } .stat-icon { display: none; } .stat-value { font-size: 28px; }
  .footer-inner { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* Shared secondary screens: plans, empty states and compact table actions. */
.plan-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr)); gap:24px; }
.plan-card { display:flex; flex-direction:column; border-top:3px solid var(--brand); }
.plan-price { font-size:clamp(24px,3vw,34px); font-weight:600; letter-spacing:-.04em; margin:24px 0; }
.table-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.table-actions form { margin:0; }
.empty-state { text-align:center; padding:64px 24px; background:var(--panel); border:1px dashed var(--border); border-radius:18px; }
.empty-state > .ui-icon { width:32px; height:32px; color:var(--brand); margin-bottom:18px; }
.status-page { min-height:100dvh; display:grid; place-items:center; padding:24px; }
.status-card { max-width:560px; padding:clamp(28px,6vw,60px); border:1px solid var(--border); border-radius:24px; background:var(--panel); text-align:center; }
.status-card > .ui-icon { display:block; width:40px; height:40px; margin:24px auto; color:var(--brand); }
.status-card h1 { font-size:36px; }
.status-card p { color:var(--muted); }

.help { color:var(--muted); font-size:12px; margin-top:7px; }
.kpi-label { font-size:11px; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); }
.kpi-value { font-size:16px; font-weight:600; overflow-wrap:anywhere; }
.setup-progress { appearance:none; width:100%; height:8px; border:0; border-radius:99px; overflow:hidden; background:var(--surface); margin-bottom:18px; }
.setup-progress::-webkit-progress-bar { background:var(--surface); }
.setup-progress::-webkit-progress-value { background:var(--brand); border-radius:99px; }
.setup-progress::-moz-progress-bar { background:var(--brand); }
@media(max-width:640px) { .row > select, .row > input { min-width:0 !important; max-width:100%; } }

.timosia-wordmark{display:block;width:170px;max-width:100%;height:auto;object-fit:contain}
.footer .timosia-wordmark{width:140px}
[data-theme=dark] .timosia-wordmark{filter:brightness(0) invert(.94)}

.onboarding-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:22px}
.plan-selection{border:0;padding:24px 0;margin:0;min-width:0}.plan-selection legend{padding:0}.plan-selection h2{margin-bottom:0}
.plan-option{cursor:pointer;transition:border-color .15s,box-shadow .15s}.plan-option:has(input:checked){border-color:var(--brand);box-shadow:0 0 0 2px var(--brand)}
.plan-option:focus-within{outline:3px solid #9aba8f;outline-offset:3px}.plan-option-top{display:flex;gap:12px;align-items:center;justify-content:space-between}.plan-option input{accent-color:var(--brand);width:18px;height:18px}.plan-unavailable{cursor:default;background:#f1f3ee}.plan-unavailable .badge{background:#e4e8df}.plan-option ul{padding-left:20px;line-height:2}.onboarding-submit{padding:28px 0 50px}

.domain-input{display:flex;align-items:stretch;border:1px solid var(--border);border-radius:10px;overflow:hidden;background:white;min-width:0}.domain-input .input{border:0;border-radius:0;min-width:0;flex:1;width:100%;box-shadow:none}.domain-input>span{display:flex;align-items:center;padding:0 12px;background:#edf2e8;color:#526b5b;white-space:nowrap;font-size:13px}.domain-input:focus-within{outline:2px solid #88a991;outline-offset:2px}
