/* Sunkara Enterprises OS — design system.
   Premium, mobile-first. Deep emerald #0B6B4F + gold #C9A227.
   No build step: hand-written CSS, one file, loaded on every page. */

:root {
  --emerald-900: #073b2c;
  --emerald-700: #0b6b4f;
  --emerald-600: #0e7d5c;
  --emerald-100: #dcefe7;
  --emerald-50:  #f0f7f3;
  --gold-600: #a8861c;
  --gold-500: #c9a227;
  --gold-100: #f6ecd0;
  --ink: #1a2b26;
  --ink-soft: #4a5d57;
  --paper: #f7f5f0;
  --card: #ffffff;
  --line: #e6e1d6;
  --danger: #b3261e;
  --danger-bg: #fdecea;
  --warn: #8a5a00;
  --warn-bg: #fff6e0;
  --ok: #0b6b4f;
  --ok-bg: #e9f5ef;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(11,107,79,.06), 0 8px 24px rgba(11,107,79,.08);
  --font: "Inter", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--paper);
  font-size: 16px; line-height: 1.5;
}
a { color: var(--emerald-700); text-decoration: none; }
a:hover { text-decoration: underline; }

.os-shell { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- header ---------- */
.os-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: .65rem 1rem;
  background: linear-gradient(135deg, var(--emerald-900), var(--emerald-700));
  color: #fff; box-shadow: var(--shadow);
}
.os-brand { display: flex; align-items: center; gap: .6rem; color: #fff; }
.os-brand:hover { text-decoration: none; }
.os-brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--gold-500); color: var(--emerald-900);
  display: grid; place-items: center; font-weight: 800; font-size: 1.05rem;
  letter-spacing: .02em;
}
.os-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.os-brand-text strong { font-size: 1rem; letter-spacing: .01em; }
.os-brand-text small { font-size: .68rem; opacity: .75; text-transform: uppercase; letter-spacing: .14em; }
.os-header-actions { display: flex; align-items: center; gap: .5rem; }

.os-icon-btn {
  position: relative; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.12);
  color: #fff; border-radius: 999px; width: 42px; height: 42px; font-size: 1.2rem; cursor: pointer;
}
.os-bell-count {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px;
  background: var(--gold-500); color: var(--emerald-900); border-radius: 999px;
  font-size: .7rem; font-weight: 800; display: grid; place-items: center;
}
.os-ask-artha {
  border: 1px solid var(--gold-500); color: #fff; border-radius: 999px;
  padding: .5rem .9rem; font-weight: 700; font-size: .85rem; white-space: nowrap;
  background: rgba(201,162,39,.18);
}
.os-ask-artha:hover { background: rgba(201,162,39,.35); text-decoration: none; }
.os-user-chip {
  width: 42px; height: 42px; border-radius: 999px; background: var(--emerald-100);
  color: var(--emerald-900); display: grid; place-items: center; font-weight: 800;
}

/* ---------- module nav ---------- */
.os-nav {
  display: flex; gap: .25rem; overflow-x: auto; padding: .5rem .75rem;
  background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 66px; z-index: 30;
}
.os-nav a {
  padding: .5rem .8rem; border-radius: 999px; white-space: nowrap; font-size: .9rem;
  color: var(--ink-soft); font-weight: 600;
}
.os-nav a:hover { background: var(--emerald-50); color: var(--emerald-700); text-decoration: none; }

/* ---------- main ---------- */
.os-main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 1rem; }
.os-footer { text-align: center; color: var(--ink-soft); font-size: .78rem; padding: 1.25rem; }

/* ---------- cards ---------- */
.os-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.1rem; margin-bottom: 1rem;
}
.os-card h2 { margin: 0 0 .6rem; font-size: 1.05rem; }
.os-card-centered { max-width: 480px; margin: 4rem auto; text-align: center; }
.os-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .os-grid.cols-2 { grid-template-columns: 1fr 1fr; } .os-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; } }

/* stat tiles */
.os-stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.os-stat small { color: var(--ink-soft); text-transform: uppercase; letter-spacing: .08em; font-size: .7rem; font-weight: 700; }
.os-stat .os-stat-value { font-size: 1.6rem; font-weight: 800; color: var(--emerald-900); margin-top: .25rem; }
.os-stat .os-stat-sub { font-size: .82rem; color: var(--ink-soft); }

/* ---------- buttons ---------- */
.os-btn {
  display: inline-block; border: none; border-radius: 10px; padding: .65rem 1.1rem;
  font-weight: 700; font-size: .95rem; cursor: pointer; text-align: center;
}
.os-btn:hover { text-decoration: none; filter: brightness(.97); }
.os-btn-primary { background: var(--emerald-700); color: #fff; }
.os-btn-gold { background: var(--gold-500); color: var(--emerald-900); }
.os-btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.os-btn-danger { background: var(--danger); color: #fff; }
.os-btn-sm { padding: .4rem .7rem; font-size: .82rem; border-radius: 8px; }
.os-btn-block { display: block; width: 100%; }

/* ---------- forms ---------- */
.os-field { margin-bottom: .9rem; }
.os-field label { display: block; font-weight: 700; font-size: .85rem; margin-bottom: .3rem; }
.os-field input, .os-field select, .os-field textarea {
  width: 100%; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 10px;
  font-size: 1rem; font-family: var(--font); background: #fff; color: var(--ink);
}
.os-field input:focus, .os-field select:focus, .os-field textarea:focus {
  outline: 2px solid var(--emerald-600); border-color: var(--emerald-600);
}
.os-hint { font-size: .8rem; color: var(--ink-soft); margin-top: .25rem; }
.os-error { background: var(--danger-bg); color: var(--danger); border-radius: 10px; padding: .7rem .9rem; margin-bottom: 1rem; font-weight: 600; }

/* ---------- tables ---------- */
.os-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table.os-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.os-table th { text-align: left; padding: .7rem .8rem; background: var(--emerald-50); color: var(--emerald-900); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }
.os-table td { padding: .7rem .8rem; border-top: 1px solid var(--line); vertical-align: top; }
.os-table tr:hover td { background: #faf9f6; }
.os-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- badges / alerts ---------- */
.os-badge { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.os-badge.ok { background: var(--ok-bg); color: var(--ok); }
.os-badge.warn { background: var(--warn-bg); color: var(--warn); }
.os-badge.danger { background: var(--danger-bg); color: var(--danger); }
.os-badge.info { background: var(--emerald-100); color: var(--emerald-900); }
.os-badge.gold { background: var(--gold-100); color: var(--gold-600); }

.os-alert { border-radius: var(--radius); padding: .9rem 1rem; margin-bottom: 1rem; border: 1px solid; }
.os-alert.critical { background: var(--danger-bg); border-color: var(--danger); }
.os-alert.warning { background: var(--warn-bg); border-color: var(--warn); }
.os-alert.info { background: var(--emerald-50); border-color: var(--emerald-600); }

/* ---------- escalation bar ---------- */
#escalation-bar:empty { display: none; }
.os-escalation {
  background: var(--danger); color: #fff; padding: .6rem 1rem; font-size: .9rem; font-weight: 600;
  display: flex; gap: .75rem; align-items: center; justify-content: space-between;
}
.os-escalation a { color: #fff; text-decoration: underline; font-weight: 800; }

/* ---------- slide-over panel ---------- */
.os-slide-panel {
  position: fixed; top: 0; right: -100%; width: min(420px, 94vw); height: 100vh; z-index: 60;
  background: #fff; box-shadow: -8px 0 32px rgba(0,0,0,.18); transition: right .25s ease;
  display: flex; flex-direction: column;
}
.os-slide-panel.open { right: 0; }
.os-panel-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 55; display: none; }
.os-slide-panel.open ~ .os-panel-backdrop, body:has(.os-slide-panel.open) .os-panel-backdrop { display: block; }
.os-panel-head { padding: 1rem; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.os-panel-body { overflow-y: auto; padding: 1rem; flex: 1; }

/* notification cards */
.os-notif { border: 1px solid var(--line); border-radius: 12px; padding: .9rem; margin-bottom: .8rem; background: #fff; }
.os-notif.critical { border-left: 5px solid var(--danger); }
.os-notif.warning { border-left: 5px solid var(--gold-500); }
.os-notif.info { border-left: 5px solid var(--emerald-600); }
.os-notif h3 { margin: 0 0 .3rem; font-size: .95rem; }
.os-notif p { margin: 0 0 .7rem; font-size: .87rem; color: var(--ink-soft); }
.os-notif-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- page headers ---------- */
.os-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.os-page-head h1 { margin: 0; font-size: 1.4rem; color: var(--emerald-900); }
.os-page-head p { margin: .2rem 0 0; color: var(--ink-soft); font-size: .9rem; }

/* ---------- auth pages ---------- */
.os-auth-wrap { max-width: 430px; margin: 3rem auto; padding: 0 1rem; }
.os-auth-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 1.8rem 1.5rem; }
.os-auth-card .os-brand-mark { width: 52px; height: 52px; font-size: 1.3rem; margin-bottom: .8rem; }
.os-otp-input { font-size: 1.6rem !important; letter-spacing: .5em; text-align: center; font-weight: 800; }

/* chat (Ask Artha) */
.os-chat { display: flex; flex-direction: column; gap: .7rem; }
.os-msg { max-width: 85%; padding: .75rem 1rem; border-radius: 14px; font-size: .95rem; }
.os-msg.user { align-self: flex-end; background: var(--emerald-700); color: #fff; border-bottom-right-radius: 4px; }
.os-msg.artha { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.os-chat-form { display: flex; gap: .5rem; margin-top: .5rem; }
.os-chat-form input { flex: 1; }

/* misc */
.os-muted { color: var(--ink-soft); font-size: .85rem; }
.os-mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .85em; }
.os-divider { border: none; border-top: 1px solid var(--line); margin: 1rem 0; }
.os-list { list-style: none; margin: 0; padding: 0; }
.os-list li { padding: .6rem 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: .75rem; align-items: center; }
.os-list li:last-child { border-bottom: none; }

/* ============ PREMIUM UPGRADE (2026-10-19) — matching the prototype's bar ============ */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&display=swap');

:root {
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --gold-700: #8a6d15;
  --shadow-lift: 0 2px 4px rgba(11,107,79,.07), 0 16px 40px rgba(11,107,79,.12);
}

/* display headings get the serif — premium editorial voice */
.os-page-head h1, .os-card h2, .os-auth-card h1 {
  font-family: var(--serif); font-weight: 600; letter-spacing: .005em;
}
.os-page-head h1 { font-size: 1.75rem; }

/* richer header: deeper gradient + hairline gold rule */
.os-header {
  background: linear-gradient(120deg, #052e22 0%, var(--emerald-900) 55%, var(--emerald-700) 100%);
  border-bottom: 2px solid var(--gold-500);
  padding: .8rem 1.1rem;
}
.os-brand-mark {
  background: linear-gradient(135deg, var(--gold-500), #e8c84a);
  box-shadow: 0 2px 10px rgba(201,162,39,.45);
}

/* dashboard hero — the first thing you see */
.os-hero {
  background: linear-gradient(135deg, var(--emerald-900), var(--emerald-600));
  border-radius: 20px; color: #fff; padding: 1.6rem 1.4rem; margin-bottom: 1.1rem;
  box-shadow: var(--shadow-lift); position: relative; overflow: hidden;
}
.os-hero::after {
  content: ""; position: absolute; top: -40px; right: -40px; width: 180px; height: 180px;
  border-radius: 50%; background: radial-gradient(circle, rgba(201,162,39,.35), transparent 70%);
}
.os-hero h1 { font-family: var(--serif); font-size: 1.5rem; margin: 0 0 .3rem; font-weight: 600; }
.os-hero p { margin: 0; opacity: .85; font-size: .92rem; }
.os-hero .os-hero-profit { font-size: 2.1rem; font-weight: 800; margin-top: .6rem; color: #ffe9a8; }

/* stat tiles: gold top-accent, lift on hover */
.os-stat {
  border-top: 3px solid var(--gold-500);
  transition: transform .15s ease, box-shadow .15s ease;
}
.os-stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.os-stat .os-stat-value { font-family: var(--serif); font-size: 1.9rem; }

/* cards: a touch more air + stronger presence */
.os-card { padding: 1.3rem; }
.os-card h2 { font-size: 1.2rem; }

/* gold section dividers */
.os-gold-rule { border: none; border-top: 2px solid var(--gold-500); margin: 1.2rem 0; opacity: .6; }

/* primary buttons: subtle gradient + depth */
.os-btn-primary {
  background: linear-gradient(135deg, var(--emerald-700), var(--emerald-600));
  box-shadow: 0 4px 14px rgba(11,107,79,.3);
}
.os-btn-gold {
  background: linear-gradient(135deg, var(--gold-500), #e8c84a);
  box-shadow: 0 4px 14px rgba(201,162,39,.35);
}

/* tables: softer, more premium header */
.os-table th { background: linear-gradient(180deg, var(--emerald-50), #e4efe8); }

/* auth card: centered brand moment */
.os-auth-card { border-top: 4px solid var(--gold-500); }

/* bell icon: crisp SVG, not emoji */
.os-bell-icon { display: block; }
.os-icon-btn { display: grid; place-items: center; }

/* Ask Artha floating button — bottom-right, every page */
.os-artha-fab {
  position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 50;
  display: flex; align-items: center; gap: .5rem;
  background: linear-gradient(135deg, var(--emerald-700), var(--emerald-600));
  color: #fff; border: 1px solid var(--gold-500); border-radius: 999px;
  padding: .8rem 1.15rem; font-weight: 700; font-size: .92rem;
  box-shadow: 0 8px 24px rgba(11,107,79,.35);
  transition: transform .15s ease, box-shadow .15s ease;
}
.os-artha-fab:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(11,107,79,.45); text-decoration: none; color: #fff; }
.os-artha-fab svg { flex: none; }
@media (max-width: 480px) {
  .os-artha-fab span { display: none; }
  .os-artha-fab { padding: .9rem; border-radius: 50%; }
}

/* member role under the name */
.os-member-role {
  display: inline-block; margin: .3rem 0 0; font-size: .75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em; color: var(--gold-700);
  background: var(--gold-100); border: 1px solid var(--gold-500);
  padding: .2rem .7rem; border-radius: 999px;
}

/* company logo */
.os-brand-logo { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: #f7f5f0; flex: none; }
.os-auth-logo { width: 120px; height: auto; display: block; margin: 0 auto .8rem; }

/* ---- Bottom tab bar (mobile-app style) ---- */
.os-tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  background: #fff;
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 12px rgba(0,0,0,.06);
  padding: .35rem 0 calc(.35rem + env(safe-area-inset-bottom));
}
.os-tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: .3rem 0;
  color: var(--muted);
  text-decoration: none;
  font-size: .68rem;
  border-radius: 8px;
  min-width: 0;
}
.os-tab-icon { font-size: 1.25rem; line-height: 1; }
.os-tab-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.os-tabbar a.active { color: var(--emerald-700); font-weight: 600; }
/* keep page content clear of the fixed bar */
.os-shell { padding-bottom: 4.2rem; }
/* Ask Artha FAB floats above the tab bar */
.os-artha-fab { bottom: 5rem; }

/* ---- Password visibility toggle ---- */
.os-pw-wrap { position: relative; }
.os-pw-wrap input[type="password"],
.os-pw-wrap input[type="text"] { padding-right: 2.8rem; width: 100%; }
.os-pw-toggle {
  position: absolute; right: .6rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; font-size: 1.15rem; cursor: pointer;
  opacity: .55; padding: .25rem; line-height: 1;
}
.os-pw-toggle:hover { opacity: 1; }
