/* ============================================================
   Trunked — Vision layer (2026-11-07). PRESENTATION ONLY.
   Loaded LAST (after trunked-finish.css). Delete its <link> tags in
   includes/layout.php and login.php to revert completely.
   Goals: one consistent card language (crisp hairline + single soft
   shadow), clear KPI hierarchy, calmer sidebar/topbar, designed empty
   states, pill chips, better POS tiles, modern PIN-dot login.
   ============================================================ */
html body {
  --v-r: 16px;
  --v-r-sm: 11px;
  --v-line: color-mix(in srgb, var(--tk-text-primary) 9%, transparent);
  --v-line-strong: color-mix(in srgb, var(--tk-text-primary) 16%, transparent);
  --v-card: var(--tk-bg-card);
  --v-tint: color-mix(in srgb, var(--tk-accent) 9%, transparent);
  --v-shadow: 0 1px 2px color-mix(in srgb, #0b1530 7%, transparent);
  --v-shadow-hover: 0 1px 2px color-mix(in srgb, #0b1530 8%, transparent), 0 12px 28px -14px color-mix(in srgb, #0b1530 30%, transparent);
  --v-ok: #12a97f; --v-warn: #e39a1f; --v-bad: #e5484d; --v-info: #3b82f6;
  --v-ease: cubic-bezier(.2, .8, .2, 1);
}
html:not(.light) body { --v-shadow: 0 1px 2px #0007; --v-shadow-hover: 0 1px 2px #0008, 0 16px 32px -16px #000c; }

/* ---------- Page rhythm ---------- */
html body .tk-content { padding-top: 20px; padding-bottom: 72px; max-width: 1680px; }
html body .tk-dash-greeting { margin-bottom: 18px; }
html body .tk-dash-greeting h2 { margin: 0 0 4px; }
html body .tk-dash-greeting p { margin: 0; color: var(--tk-text-muted); font-size: .88rem; }

/* ---------- Unified cards ---------- */
html body .tk-content :is(.tk-card, .tk-stat-card, .tk-kpi-hero-card, .rpt-summary-card, .tk-quick-action-card, .tk-icon-stat-card, .tk-revenue-pair-card) {
  background: var(--v-card);
  border: 1px solid var(--v-line);
  border-radius: var(--v-r);
  box-shadow: var(--v-shadow);
}
html body .tk-content :is(.tk-card, .tk-stat-card, .tk-kpi-hero-card, .rpt-summary-card, .tk-quick-action-card):hover {
  box-shadow: var(--v-shadow-hover);
  border-color: var(--v-line-strong);
}
html body .tk-content .tk-card { padding: 22px 24px; }
html body .tk-content .tk-card-title { border-bottom: 0; padding-bottom: 0; margin-bottom: 14px; }
html body .tk-content .tk-card-title-text { font-size: .98rem; font-weight: 650; letter-spacing: 0; }
html body .tk-content .tk-card-title-text::before { display: none; }
html body .tk-content .tk-card-title-subtitle {
  background: var(--v-tint); border: 0; color: var(--tk-text-secondary);
  border-radius: 999px; padding: 4px 11px; font-size: .72rem; font-weight: 600;
}

/* KPI hero cards: one calm rail, icon tile, strong number, quiet label */
html body .tk-content .tk-kpi-hero-grid { gap: 16px; margin-bottom: 18px; }
html body .tk-content .tk-kpi-hero-card { padding: 20px 22px 18px; position: relative; overflow: hidden; }
html body .tk-content .tk-kpi-hero-card::before { display: none; }
html body .tk-content .tk-kpi-hero-card::after {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; height: auto; border-radius: 0;
  background: var(--tk-kpi-mark, var(--tk-accent)); opacity: .9;
}
html body .tk-content .tk-kpi-hero-top { align-items: center; margin-bottom: 14px; }
html body .tk-content .tk-kpi-hero-icon { width: 42px; height: 42px; border-radius: 12px; box-shadow: none; }
html body .tk-content .tk-kpi-hero-value { font-size: clamp(1.55rem, 2.1vw, 2.15rem); line-height: 1.1; font-weight: 700; letter-spacing: -.02em !important; }
html body .tk-content .tk-kpi-hero-label {
  margin-top: 6px; text-transform: none; letter-spacing: 0; font-size: .8rem; font-weight: 600; color: var(--tk-text-secondary);
}
html body .tk-content .tk-kpi-hero-badge { border-radius: 999px; padding: 3px 10px; font-size: .7rem; font-weight: 700; }

/* Stat cards (inventory / orders / reports) */
html body .tk-content .tk-stat-card { padding: 18px 20px; }
html body .tk-content .tk-stat-label { font-size: .72rem; letter-spacing: .05em; color: var(--tk-text-secondary); }
html body .tk-content .tk-stat-value { letter-spacing: -.02em !important; }

/* Quick actions: tidy tiles with a hover affordance */
html body .tk-content .tk-quick-action-card { padding: 16px 18px; gap: 14px; }
html body .tk-content .tk-quick-action-card:hover { transform: translateY(-2px); }
html body .tk-content .tk-quick-action-arrow { transition: transform .2s var(--v-ease); opacity: .55; }
html body .tk-content .tk-quick-action-card:hover .tk-quick-action-arrow { transform: translateX(4px); opacity: 1; }

/* ---------- Designed empty states ---------- */
html body .tk-content .tk-empty,
html body .tk-content .tk-card > p:only-child {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 150px; padding: 28px 16px; text-align: center; color: var(--tk-text-muted);
  border: 1px dashed var(--v-line-strong); border-radius: var(--v-r-sm);
  background: color-mix(in srgb, var(--tk-text-primary) 2.5%, transparent);
}
html body .tk-content .tk-empty::before,
html body .tk-content .tk-card > p:only-child::before {
  content: ''; width: 36px; height: 36px; border-radius: 12px; opacity: .85;
  background: var(--v-tint) center / 20px no-repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a86b8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5m6 4.125l2.25 2.25m0 0l2.25 2.25M12 13.875l2.25-2.25M12 13.875l-2.25 2.25M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z'/%3E%3C/svg%3E");
}

/* ---------- Progress / goal bars ---------- */
html body .tk-progress-bar, html body .tk-goal-bar-track { height: 8px; border-radius: 999px; background: var(--v-tint); overflow: hidden; }
html body .tk-progress-fill, html body .tk-goal-bar-fill { border-radius: 999px; }
html body .tk-pay-row { padding: 12px 0; }
html body .tk-pay-dot { border-radius: 50%; width: 9px; height: 9px; }

/* ---------- Tables ---------- */
html body .tk-content .tk-table-wrap { border-radius: var(--v-r); border: 1px solid var(--v-line); box-shadow: var(--v-shadow); overflow: auto; }
html body .tk-content .tk-table thead th { position: sticky; top: 0; z-index: 1; background: color-mix(in srgb, var(--tk-text-primary) 4.5%, var(--v-card)); }
html body .tk-content .tk-table tbody tr { transition: background .15s ease; }
html body .tk-content .tk-table td { padding-block: 13px; }

/* ---------- Badges: pill + status dot ---------- */
html body .tk-badge {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 11px;
  font-size: .72rem; font-weight: 650; letter-spacing: .01em; line-height: 1.5; white-space: nowrap;
}
html body .tk-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; flex: none; }

/* ---------- Forms ---------- */
html body :is(.tk-input, .tk-select, .tk-textarea) {
  border-radius: 11px; min-height: 42px; border: 1px solid var(--v-line-strong);
  background: color-mix(in srgb, var(--tk-text-primary) 2.5%, var(--tk-bg-input));
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
html body :is(.tk-input, .tk-select, .tk-textarea):hover { border-color: color-mix(in srgb, var(--tk-accent) 45%, var(--v-line-strong)); }
html body .tk-form-label { font-size: .78rem; font-weight: 650; color: var(--tk-text-secondary); margin-bottom: 6px; }

/* ---------- Buttons ---------- */
html body .tk-btn-primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--tk-accent) 92%, #fff), var(--tk-accent));
  box-shadow: 0 1px 2px #0b153033, inset 0 1px 0 #ffffff26; border: 0;
}
html body .tk-btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--tk-accent) 70%, transparent); }
html body .tk-btn-primary:active { transform: translateY(0); filter: brightness(.97); }
html body .tk-btn-secondary { border: 1px solid var(--v-line-strong); background: var(--v-card); box-shadow: var(--v-shadow); }
html body .tk-btn-secondary:hover { border-color: var(--tk-accent); background: var(--v-tint); }

/* ---------- Sidebar ---------- */
html body .tk-sidebar { box-shadow: 1px 0 0 var(--v-line); }
html body .tk-nav-section-label { font-size: .66rem; letter-spacing: .12em; font-weight: 700; color: var(--tk-text-muted); padding: 16px 12px 6px; }
html body .tk-nav-item { padding: 10px 12px; border-radius: 11px; font-weight: 550; }
html body .tk-nav-item:hover { background: var(--v-tint); transform: none; }
html body .tk-nav-item.tk-nav-active {
  background: color-mix(in srgb, var(--tk-accent) 13%, transparent); color: var(--tk-accent); font-weight: 700;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tk-accent) 22%, transparent);
}
html body .tk-nav-item.tk-nav-active::before { left: 0; width: 4px; height: 56%; border-radius: 0 4px 4px 0; background: var(--tk-accent); }
html body .tk-sidebar-bottom { border-top: 1px solid var(--v-line); padding-top: 12px; gap: 10px; }
html body .tk-user-card { border: 1px solid var(--v-line); border-radius: 13px; background: color-mix(in srgb, var(--tk-text-primary) 3%, transparent); margin-bottom: 8px; }
html body .tk-bigman-tag { opacity: .55; letter-spacing: .08em; font-size: .62rem; }

/* ---------- Topbar ---------- */
html body .tk-topbar { border-bottom: 1px solid var(--v-line); backdrop-filter: blur(10px); }
html body .tk-topbar-search { max-width: 460px; width: 100%; border-radius: 12px; border: 1px solid var(--v-line); background: color-mix(in srgb, var(--tk-text-primary) 3.5%, transparent); }
html body .tk-topbar-search:focus-within { border-color: var(--tk-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tk-accent) 22%, transparent); }
html body .tk-topbar-icon-btn { width: 38px; height: 38px; border-radius: 11px; display: inline-grid; place-items: center; transition: background .15s ease; }
html body .tk-topbar-icon-btn:hover { background: var(--v-tint); }
html body .tk-topbar-right { gap: 8px; }
html body .tk-live-clock { border-radius: 11px; border: 1px solid var(--v-line); padding: 5px 12px; font-variant-numeric: tabular-nums; }
html body .tk-user-dropdown, html body .tk-notif-dropdown, html body .tk-apps-dropdown {
  border: 1px solid var(--v-line); border-radius: 16px; box-shadow: 0 24px 56px -20px #0b1530aa;
}

/* ---------- Modals / alerts ---------- */
html body .tk-modal { border: 1px solid var(--v-line); }
html body .tk-alert { border-radius: var(--v-r-sm); }

/* ---------- POS: tiles, categories, cart ---------- */
html body.tk-pos-page .pos-item-card {
  border: 1px solid var(--v-line); border-radius: 14px !important; box-shadow: var(--v-shadow);
  transition: transform .15s var(--v-ease), box-shadow .2s ease, border-color .2s ease !important;
}
html body.tk-pos-page .pos-item-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--tk-accent) 55%, var(--v-line)); box-shadow: var(--v-shadow-hover) !important; }
html body.tk-pos-page .pos-item-card:active { transform: scale(.975); }
html body.tk-pos-page .pos-item-name { font-weight: 650; line-height: 1.25; }
html body.tk-pos-page .pos-item-price { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--tk-accent); }
html body.tk-pos-page .pos-cat-btn { border-radius: 999px !important; padding-inline: 16px; border: 1px solid var(--v-line); }
html body.tk-pos-page .pos-cat-btn.active { box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--tk-accent) 80%, transparent); }
html body.tk-pos-page .pos-cart { border: 1px solid var(--v-line); border-radius: 20px !important; box-shadow: var(--v-shadow-hover) !important; }
html body.tk-pos-page .cart-item { border-radius: 12px; }
html body.tk-pos-page .cart-qty-btn { border-radius: 9px; }
html body.tk-pos-page .cart-total-row span { font-variant-numeric: tabular-nums; }
html body.tk-pos-page .pos-pay-btn { border-radius: 12px; font-weight: 700; }
html body.tk-pos-page .pos-complete-btn { border-radius: 14px; font-weight: 800; letter-spacing: .02em; box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--tk-accent) 80%, transparent); }

/* ---------- Floor / tables cards ---------- */
html body .tk-floor-card { border: 1px solid var(--v-line); border-radius: var(--v-r); box-shadow: var(--v-shadow); transition: transform .18s var(--v-ease), box-shadow .2s ease; }
html body .tk-floor-card:hover { transform: translateY(-2px); box-shadow: var(--v-shadow-hover); }

/* ---------- Scrollbars & selection ---------- */
html body * { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--tk-text-muted) 55%, transparent) transparent; }
html body ::selection { background: color-mix(in srgb, var(--tk-accent) 30%, transparent); }

/* ============================================================
   LOGIN: PIN dots + round keypad
   ============================================================ */
html body .tk-login-form-panel { justify-content: center; }
html body .tk-login-form-card {
  border: 1px solid var(--v-line); border-radius: 24px; padding: 28px 26px 26px;
  box-shadow: 0 1px 2px #0b15300d, 0 30px 60px -30px #0b153055;
}
html body .tk-login-heading { margin-bottom: 4px; }
html body .tk-login-sub { margin-bottom: 20px; }
.tk-pin-field { position: relative; margin-bottom: 18px; }
.tk-pin-field label { display: block; text-align: center; margin-bottom: 12px; }
.tk-pin-dots { display: flex; justify-content: center; gap: 16px; padding: 6px 0 2px; }
.tk-pin-dot {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--v-line-strong);
  background: transparent; transition: transform .15s var(--v-ease), background .15s ease, border-color .15s ease;
}
.tk-pin-dot.is-on { background: var(--tk-accent); border-color: var(--tk-accent); transform: scale(1.12); }
.tk-pin-field:focus-within .tk-pin-dot:not(.is-on) { border-color: color-mix(in srgb, var(--tk-accent) 60%, transparent); }
.tk-pin-field.is-error .tk-pin-dots { animation: tkVShake .4s ease; }
.tk-pin-field.is-error .tk-pin-dot { border-color: var(--v-bad); }
@keyframes tkVShake { 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }
/* Real input stays in the DOM (keyboard, paste, password managers, auto-submit) but is invisible. */
html body .tk-pin-field #pin {
  position: absolute; left: 0; right: 0; bottom: 0; height: 44px; width: 100%; opacity: 0;
  border: 0; background: transparent; box-shadow: none; caret-color: transparent; cursor: text; font-size: 16px;
}
.tk-pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
html body .tk-pin-pad .tk-btn {
  justify-content: center; min-height: 58px; border-radius: 16px; font-size: 1.35rem !important; font-weight: 600 !important;
  font-family: var(--tk-font-title) !important; letter-spacing: 0 !important; font-variant-numeric: tabular-nums;
}
html body .tk-pin-pad .tk-btn:active { transform: scale(.94); background: var(--v-tint); }
html body .tk-pin-pad .tk-pin-aux { font-size: .8rem !important; font-family: inherit !important; font-weight: 650 !important; color: var(--tk-text-secondary); background: transparent; box-shadow: none; border-color: transparent; }
html body .tk-pin-pad .tk-pin-aux svg { width: 24px; height: 24px; }
html body .tk-error-box { border-radius: 12px; border: 1px solid color-mix(in srgb, var(--v-bad) 40%, transparent); background: color-mix(in srgb, var(--v-bad) 9%, transparent); }

@media (max-width: 640px) {
  html body .tk-mobile-right { gap: 8px; }
  html body .tk-content .tk-kpi-hero-card { padding: 16px 16px 14px; }
  html body .tk-content { padding-bottom: 96px; }
  html body .tk-content .tk-card { padding: 18px; }
  html body .tk-login-form-card { padding: 22px 18px; border-radius: 20px; }
  html body .tk-pin-pad .tk-btn { min-height: 54px; }
}
@media (prefers-reduced-motion: reduce) {
  html body * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
@media print {
  html body .tk-content :is(.tk-card, .tk-stat-card, .tk-kpi-hero-card) { box-shadow: none; }
}
