/* ==========================================================================
   VIVAH STUDIO — Employee Portal
   Brand: Maroon Royale + Regal Gold, on a light working surface.
   The public site is dark maroon; a portal people stare at all day is not.
   ========================================================================== */

:root {
  /* Brand (same tokens as the public site) */
  --maroon:      #4a0e0e;
  --maroon-lt:   #5f1414;
  --espresso:    #2c0606;
  --gold:        #d4af37;
  --gold-deep:   #b8912a;
  --gold-soft:   #f3e7c4;
  --sandstone:   #d8c4a0;
  --blush:       #f9e5d9;

  /* Working surface */
  --bg:          #f6f4f1;
  --card:        #ffffff;
  --card-2:      #fbfaf8;
  --line:        #e6e1da;
  --line-strong: #d5cec3;

  /* Text */
  --ink:         #241109;
  --ink-2:       #5c4a41;
  --ink-3:       #8a7a70;

  /* Semantic */
  --ok:          #1e7a4d;
  --ok-bg:       #e7f5ee;
  --warn:        #a86a00;
  --warn-bg:     #fdf1de;
  --danger:      #b3261e;
  --danger-bg:   #fdeceb;
  --info:        #1f5f8b;
  --info-bg:     #e8f1f8;

  --r:           10px;
  --r-sm:        7px;
  --r-lg:        16px;
  --shadow:      0 1px 2px rgba(36,17,9,.05), 0 8px 24px -12px rgba(36,17,9,.16);
  --shadow-lg:   0 20px 50px -20px rgba(36,17,9,.35);

  --side-w:      252px;
  --font:        "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-hi:     "Noto Sans Devanagari", "Inter", sans-serif;
  --font-display:"Playfair Display", Georgia, serif;
}

/* Hindi gets a Devanagari-first stack — Inter has no Devanagari glyphs. */
.lang-hi { --font: "Noto Sans Devanagari", "Inter", sans-serif; }
.lang-hi h1, .lang-hi h2, .lang-hi .brand strong { font-family: var(--font-hi); }

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; padding: 0; }
table { border-collapse: collapse; width: 100%; }

:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; border-radius: 3px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--maroon); color: #fff; padding: .6rem 1rem;
}
.skip:focus { left: 0; }

/* ==========================================================================
   Shell
   ========================================================================== */

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

/* ---- Sidebar ---- */
.side {
  width: var(--side-w);
  flex: 0 0 var(--side-w);
  background: linear-gradient(178deg, var(--maroon) 0%, var(--espresso) 100%);
  color: #f3ece2;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  z-index: 40;
}

.side__brand {
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem; padding: 1.1rem 1rem;
  border-bottom: 1px solid rgba(212,175,55,.18);
}
.brand { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.brand__mark {
  width: 38px; height: 38px; flex: 0 0 38px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: linear-gradient(135deg, #a8781c, var(--gold) 45%, #f0d878 70%, #a8781c);
  color: var(--espresso);
  font-family: var(--font-display); font-weight: 700; font-size: 1.25rem;
}
.brand__text { min-width: 0; line-height: 1.25; }
.brand__text strong { display: block; font-size: .95rem; font-weight: 600; letter-spacing: .01em; }
.brand__text small { display: block; font-size: .7rem; color: rgba(243,236,226,.6); }

.side__close { display: none; color: #f3ece2; font-size: 1.6rem; line-height: 1; padding: 0 .3rem; }

.side__nav { flex: 1; overflow-y: auto; padding: .75rem .6rem 1.5rem; }
.side__nav::-webkit-scrollbar { width: 6px; }
.side__nav::-webkit-scrollbar-thumb { background: rgba(212,175,55,.25); border-radius: 3px; }

.side__group {
  font-size: .66rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(212,175,55,.72);
  padding: 1rem .75rem .35rem;
}

.side__link {
  display: flex; align-items: center; gap: .7rem;
  padding: .55rem .75rem; border-radius: var(--r-sm);
  font-size: .875rem; font-weight: 500;
  color: rgba(243,236,226,.82);
  transition: background .15s, color .15s;
  position: relative;
}
.side__link:hover { background: rgba(255,255,255,.07); color: #fff; }
.side__link.is-active { background: rgba(212,175,55,.16); color: #fff; }
.side__link.is-active::before {
  content: ""; position: absolute; left: -.6rem; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--gold);
}
.side__link .ico { flex: 0 0 auto; opacity: .85; }
.side__link.is-active .ico { opacity: 1; color: var(--gold); }
.side__link span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.badge {
  flex: 0 0 auto;
  background: var(--gold); color: var(--espresso);
  font-size: .68rem; font-weight: 700; font-style: normal;
  min-width: 19px; height: 19px; padding: 0 .35rem;
  border-radius: 10px; display: grid; place-items: center;
}

.side__foot { padding: .6rem; border-top: 1px solid rgba(212,175,55,.18); }
.side__scrim { display: none; }

/* ---- Main column ---- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 1rem;
  padding: .7rem clamp(1rem, 2.5vw, 1.75rem);
  background: rgba(246,244,241,.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__burger { display: none; flex-direction: column; gap: 4px; padding: .4rem; }
.topbar__burger span { display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px; }

.topbar__title { flex: 1; min-width: 0; display: flex; align-items: center; gap: .6rem; }
.topbar__back {
  display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px;
  border-radius: 50%; background: var(--card); border: 1px solid var(--line);
  font-size: 1rem; color: var(--ink-2);
}
.topbar__back:hover { border-color: var(--gold); color: var(--maroon); }
.topbar h1 {
  font-family: var(--font-display); font-size: clamp(1.15rem, 1rem + .6vw, 1.5rem);
  font-weight: 600; line-height: 1.25; color: var(--maroon);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lang-hi .topbar h1 { font-weight: 600; }
.topbar__sub { font-size: .78rem; color: var(--ink-3); margin-top: -.1rem; }

.topbar__right { display: flex; align-items: center; gap: .55rem; }
.topbar__actions { display: flex; gap: .5rem; }

.langswitch {
  display: flex; border: 1px solid var(--line-strong); border-radius: 999px;
  overflow: hidden; background: var(--card);
}
.langswitch a {
  padding: .28rem .6rem; font-size: .74rem; font-weight: 600; color: var(--ink-3);
  line-height: 1.5;
}
.langswitch a.is-on { background: var(--maroon); color: #fff; }

.iconbtn {
  position: relative; display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--line); color: var(--ink-2);
}
.iconbtn:hover { border-color: var(--gold); color: var(--maroon); }
.iconbtn .dot {
  position: absolute; top: 6px; right: 7px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--danger); border: 2px solid var(--bg);
}

.whoami { display: flex; align-items: center; gap: .5rem; padding: .2rem .45rem .2rem .2rem; border-radius: 999px; }
.whoami:hover { background: var(--card); }
.whoami__text { line-height: 1.2; }
.whoami__text strong { display: block; font-size: .8rem; font-weight: 600; }
.whoami__text small { display: block; font-size: .68rem; color: var(--ink-3); }

.avatar {
  width: 32px; height: 32px; flex: 0 0 auto;
  border-radius: 50%; display: grid; place-items: center; overflow: hidden;
  color: #fff; font-size: .72rem; font-weight: 600; letter-spacing: .02em;
  background: var(--maroon);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.content {
  flex: 1;
  padding: clamp(1rem, 2.5vw, 1.75rem);
  max-width: 1320px; width: 100%;
}
.content--wide { max-width: none; }

.content__foot {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  padding: 1.25rem clamp(1rem, 2.5vw, 1.75rem);
  font-size: .74rem; color: var(--ink-3);
  border-top: 1px solid var(--line);
}

/* ==========================================================================
   Cards, grids, sections
   ========================================================================== */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.card--pad { padding: clamp(1rem, 2vw, 1.4rem); }
.card--flush { overflow: hidden; }

.card__head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem 1.1rem; border-bottom: 1px solid var(--line);
}
.card__head h2, .card__head h3 {
  font-family: var(--font-display); font-size: 1rem; font-weight: 600; color: var(--maroon);
}
.lang-hi .card__head h2, .lang-hi .card__head h3 { font-family: var(--font-hi); }
.card__head .link { font-size: .78rem; color: var(--ink-3); font-weight: 500; }
.card__head .link:hover { color: var(--maroon); }
.card__body { padding: 1.1rem; }
.card__foot { padding: .8rem 1.1rem; border-top: 1px solid var(--line); background: var(--card-2); }

.grid { display: grid; gap: 1rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid--main { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); align-items: start; }
@media (max-width: 900px) { .grid--main { grid-template-columns: 1fr; } }

.stack { display: flex; flex-direction: column; gap: 1rem; }
.row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.row--end { justify-content: flex-end; }
.spacer { flex: 1; }

.section-title {
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 600;
  color: var(--maroon); margin-bottom: .7rem;
}
.lang-hi .section-title { font-family: var(--font-hi); }

/* ---- Stat tiles ---- */
.stat {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: .95rem 1.05rem;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: transform .15s, border-color .15s;
}
a.stat:hover { transform: translateY(-2px); border-color: var(--gold); }
.stat::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--sandstone);
}
.stat--ok::after     { background: var(--ok); }
.stat--warn::after   { background: var(--warn); }
.stat--danger::after { background: var(--danger); }
.stat--gold::after   { background: var(--gold); }
.stat__label { display: block; font-size: .74rem; color: var(--ink-3); font-weight: 500; }
.stat__value {
  display: block; font-family: var(--font-display); font-size: 1.7rem;
  font-weight: 700; line-height: 1.15; color: var(--maroon); margin: .15rem 0;
}
.lang-hi .stat__value { font-family: var(--font-hi); }
.stat__sub { display: block; font-size: .72rem; color: var(--ink-3); }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .52rem 1rem; border-radius: var(--r-sm);
  background: var(--maroon); color: #fff;
  font-size: .84rem; font-weight: 600; line-height: 1.4;
  border: 1px solid var(--maroon);
  transition: background .15s, border-color .15s, transform .1s;
  white-space: nowrap;
}
.btn:hover { background: var(--maroon-lt); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }

.btn--gold { background: var(--gold); border-color: var(--gold); color: var(--espresso); }
.btn--gold:hover { background: var(--gold-deep); border-color: var(--gold-deep); }
.btn--ghost { background: var(--card); color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { background: var(--card-2); border-color: var(--gold); color: var(--maroon); }
.btn--danger { background: var(--danger); border-color: var(--danger); }
.btn--danger:hover { background: #8f1e17; border-color: #8f1e17; }
.btn--ok { background: var(--ok); border-color: var(--ok); }
.btn--ok:hover { background: #17603c; border-color: #17603c; }
.btn--sm { padding: .32rem .68rem; font-size: .76rem; }
.btn--lg { padding: .72rem 1.5rem; font-size: .95rem; }
.btn--block { display: flex; width: 100%; }
.btn .ico { width: 16px; height: 16px; }

.btn-group { display: inline-flex; gap: .4rem; flex-wrap: wrap; }

/* ==========================================================================
   Forms
   ========================================================================== */

.field { margin-bottom: 1rem; }
.field > label, .label {
  display: block; font-size: .78rem; font-weight: 600; color: var(--ink-2);
  margin-bottom: .3rem;
}
.field__hint { font-size: .73rem; color: var(--ink-3); margin-top: .28rem; line-height: 1.45; }
.field__opt { font-weight: 400; color: var(--ink-3); font-size: .72rem; }

input[type=text], input[type=password], input[type=tel], input[type=number],
input[type=date], input[type=time], input[type=email], input[type=url],
input[type=month], input[type=file], select, textarea {
  width: 100%;
  padding: .52rem .7rem;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  font-size: .87rem;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,175,55,.18);
}
input[disabled], select[disabled], textarea[disabled] { background: var(--card-2); color: var(--ink-3); }
textarea { min-height: 92px; resize: vertical; line-height: 1.6; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238a7a70' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .65rem center; padding-right: 1.9rem; }
input[type=file] { padding: .4rem; font-size: .8rem; }

.check { display: flex; align-items: flex-start; gap: .5rem; font-size: .85rem; cursor: pointer; }
.check input { width: 16px; height: 16px; margin-top: .18rem; flex: 0 0 auto; accent-color: var(--maroon); }

.field-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.form-actions {
  display: flex; gap: .6rem; flex-wrap: wrap; align-items: center;
  padding-top: .4rem;
}

.inline-form { display: inline; }

.filters {
  display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end;
  margin-bottom: 1rem;
}
.filters .field { margin: 0; min-width: 150px; }

.period { display: flex; gap: .4rem; }
.period select { width: auto; min-width: 105px; font-size: .82rem; padding: .35rem 1.9rem .35rem .6rem; }

/* ==========================================================================
   Tables
   ========================================================================== */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.tbl { font-size: .85rem; min-width: 560px; }
.tbl th {
  text-align: left; font-size: .7rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-3);
  padding: .6rem .8rem; border-bottom: 1px solid var(--line); white-space: nowrap;
  background: var(--card-2);
}
.tbl td { padding: .62rem .8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--card-2); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .nowrap { white-space: nowrap; }
.tbl .shrink { width: 1%; white-space: nowrap; }
.tbl--compact td, .tbl--compact th { padding: .45rem .6rem; }

.person { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.person__name { min-width: 0; line-height: 1.3; }
.person__name strong { display: block; font-weight: 600; font-size: .85rem; }
.person__name small { display: block; font-size: .72rem; color: var(--ink-3); }

/* ==========================================================================
   Pills, alerts, misc
   ========================================================================== */

.pill {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .13rem .5rem; border-radius: 999px;
  font-size: .71rem; font-weight: 600; line-height: 1.5;
  background: #eee9e2; color: var(--ink-2);
  white-space: nowrap;
}
.pill--green  { background: var(--ok-bg);     color: var(--ok); }
.pill--red    { background: var(--danger-bg); color: var(--danger); }
.pill--amber  { background: var(--warn-bg);   color: var(--warn); }
.pill--blue   { background: var(--info-bg);   color: var(--info); }
.pill--gold   { background: var(--gold-soft); color: #7a5f10; }
.pill--maroon { background: #f3e3e3;          color: var(--maroon); }
.pill--grey   { background: #eee9e2;          color: var(--ink-2); }

.alert {
  display: flex; gap: .65rem; align-items: flex-start;
  padding: .7rem .9rem; border-radius: var(--r-sm);
  font-size: .85rem; margin-bottom: 1rem;
  border: 1px solid transparent;
}
.alert__i {
  flex: 0 0 20px; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; font-size: .72rem; font-weight: 700;
  background: currentColor;
}
.alert__i::first-letter { color: #fff; }
.alert--ok    { background: var(--ok-bg);     border-color: #bfe3d0; color: var(--ok); }
.alert--error { background: var(--danger-bg); border-color: #f3c9c6; color: var(--danger); }
.alert--warn  { background: var(--warn-bg);   border-color: #f0dcb6; color: var(--warn); }
.alert--info  { background: var(--info-bg);   border-color: #c8ddec; color: var(--info); }
.alert > div { color: var(--ink); flex: 1; }
.alert__i { color: currentColor; }
.alert span.alert__i { color: #fff; }
.alert--ok    .alert__i { background: var(--ok); }
.alert--error .alert__i { background: var(--danger); }
.alert--warn  .alert__i { background: var(--warn); }
.alert--info  .alert__i { background: var(--info); }

.empty-state {
  text-align: center; padding: 2.5rem 1rem; color: var(--ink-3);
}
.empty-state__icon { font-size: 2rem; margin-bottom: .5rem; opacity: .8; }
.empty-state p { font-size: .9rem; margin-bottom: .9rem; }

.muted { color: var(--ink-3); }
.small { font-size: .78rem; }
.tiny  { font-size: .72rem; }
.strong { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.right { text-align: right; }
.mt { margin-top: 1rem; } .mt-sm { margin-top: .5rem; } .mt-lg { margin-top: 1.75rem; }
.mb { margin-bottom: 1rem; } .mb-sm { margin-bottom: .5rem; }
.hide { display: none !important; }

.divider { height: 1px; background: var(--line); margin: 1.1rem 0; border: 0; }

.pager { display: flex; gap: .3rem; justify-content: center; padding: 1rem 0; flex-wrap: wrap; }
.pager a {
  min-width: 32px; padding: .3rem .55rem; text-align: center;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  font-size: .8rem; background: var(--card);
}
.pager a.is-current { background: var(--maroon); color: #fff; border-color: var(--maroon); }
.pager__gap { padding: .3rem; color: var(--ink-3); }

.progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.progress__bar { height: 100%; background: var(--gold); border-radius: 3px; transition: width .4s; }
.progress__bar--ok   { background: var(--ok); }
.progress__bar--warn { background: var(--warn); }
.progress__bar--bad  { background: var(--danger); }

/* Tabs */
.tabs {
  display: flex; gap: .2rem; border-bottom: 1px solid var(--line);
  margin-bottom: 1.2rem; overflow-x: auto;
}
.tabs a {
  padding: .5rem .9rem; font-size: .83rem; font-weight: 600; color: var(--ink-3);
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs a:hover { color: var(--ink); }
.tabs a.is-on { color: var(--maroon); border-bottom-color: var(--gold); }

/* ==========================================================================
   Login page
   ========================================================================== */

.bare {
  min-height: 100vh; display: grid; place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(circle at 15% 15%, rgba(212,175,55,.16), transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(212,175,55,.10), transparent 45%),
    linear-gradient(170deg, var(--maroon), var(--espresso));
}
.login {
  width: 100%; max-width: 400px;
  background: var(--card); border-radius: var(--r-lg);
  padding: clamp(1.5rem, 4vw, 2.25rem);
  box-shadow: var(--shadow-lg);
  border-top: 3px solid var(--gold);
}
.login__brand { text-align: center; margin-bottom: 1.5rem; }
.login__mark {
  width: 56px; height: 56px; margin: 0 auto .7rem;
  border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(135deg, #a8781c, var(--gold) 45%, #f0d878 70%, #a8781c);
  color: var(--espresso); font-family: var(--font-display); font-size: 1.8rem; font-weight: 700;
}
.login__brand h1 {
  font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; color: var(--maroon);
}
.lang-hi .login__brand h1 { font-family: var(--font-hi); }
.login__brand p { font-size: .82rem; color: var(--ink-3); }
.login__lang { display: flex; justify-content: center; margin-top: 1.2rem; }
.login__help { font-size: .75rem; color: var(--ink-3); text-align: center; margin-top: 1rem; }

/* ==========================================================================
   Attendance
   ========================================================================== */

.punch {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 1.1rem 1.25rem;
  background: linear-gradient(120deg, var(--maroon), var(--espresso));
  border-radius: var(--r); color: #f3ece2;
  box-shadow: var(--shadow);
}
.punch__clock {
  font-family: var(--font-display); font-size: 2rem; font-weight: 700;
  color: var(--gold); line-height: 1; font-variant-numeric: tabular-nums;
}
.punch__meta { flex: 1; min-width: 150px; }
.punch__meta p { font-size: .8rem; color: rgba(243,236,226,.72); }
.punch__meta strong { font-size: .95rem; }
.punch .btn--gold { box-shadow: 0 8px 22px -10px rgba(212,175,55,.8); }

.att-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.att-cal__dow {
  text-align: center; font-size: .68rem; font-weight: 600; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .05em; padding-bottom: .2rem;
}
.att-day {
  aspect-ratio: 1; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--card); padding: .3rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: .78rem; line-height: 1.2; position: relative;
}
.att-day__n { font-weight: 600; font-size: .8rem; }
.att-day__t { font-size: .6rem; color: var(--ink-3); }
.att-day--present  { background: var(--ok-bg);     border-color: #bfe3d0; }
.att-day--absent   { background: var(--danger-bg); border-color: #f3c9c6; }
.att-day--half_day { background: var(--warn-bg);   border-color: #f0dcb6; }
.att-day--leave    { background: var(--info-bg);   border-color: #c8ddec; }
.att-day--week_off,
.att-day--holiday  { background: #f1eeea; border-style: dashed; color: var(--ink-3); }
.att-day--future   { opacity: .35; }
.att-day--late::after {
  content: ""; position: absolute; top: 4px; right: 4px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--warn);
}
.att-legend { display: flex; gap: .8rem; flex-wrap: wrap; font-size: .73rem; color: var(--ink-2); }
.att-legend span { display: flex; align-items: center; gap: .3rem; }
.att-legend i { width: 11px; height: 11px; border-radius: 3px; border: 1px solid var(--line); }

.steps { display: flex; gap: .5rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.steps div {
  flex: 1; min-width: 140px; padding: .55rem .8rem; border-radius: var(--r-sm);
  background: var(--card); border: 1px solid var(--line);
  font-size: .8rem; font-weight: 600; color: var(--ink-3);
}
.steps div.is-on { background: var(--maroon); color: #fff; border-color: var(--maroon); }
.steps div.is-done { background: var(--ok-bg); color: var(--ok); border-color: #bfe3d0; }

.mapping-preview {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .74rem; background: var(--card-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: .6rem; overflow-x: auto; white-space: pre;
  color: var(--ink-2); max-height: 200px; overflow-y: auto;
}

/* ==========================================================================
   Task board
   ========================================================================== */

.board { display: grid; grid-template-columns: repeat(4, minmax(215px, 1fr)); gap: .8rem; align-items: start; }
@media (max-width: 1100px) { .board { grid-template-columns: repeat(2, minmax(215px, 1fr)); } }
@media (max-width: 620px)  { .board { grid-template-columns: 1fr; } }

.board__col { background: #efeae4; border-radius: var(--r); padding: .55rem; min-height: 90px; }
.board__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: .2rem .35rem .55rem; font-size: .78rem; font-weight: 700; color: var(--ink-2);
}
.board__head b { background: var(--card); border-radius: 999px; padding: 0 .45rem; font-size: .7rem; }

.tcard {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-left: 3px solid var(--sandstone);
  border-radius: var(--r-sm); padding: .6rem .7rem; margin-bottom: .5rem;
  box-shadow: 0 1px 2px rgba(36,17,9,.05);
  transition: transform .12s, box-shadow .12s;
}
.tcard:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.tcard--urgent { border-left-color: var(--danger); }
.tcard--high   { border-left-color: var(--warn); }
.tcard--medium { border-left-color: var(--gold); }
.tcard--low    { border-left-color: var(--sandstone); }
.tcard__title { font-size: .85rem; font-weight: 600; line-height: 1.35; margin-bottom: .3rem; }
.tcard__meta { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; font-size: .7rem; color: var(--ink-3); }
.tcard__event {
  display: inline-block; font-size: .68rem; color: var(--maroon);
  background: #f6ebeb; padding: .05rem .4rem; border-radius: 4px; margin-bottom: .3rem;
}
.tcard--overdue .tcard__due { color: var(--danger); font-weight: 600; }

/* ==========================================================================
   Chat
   ========================================================================== */

.chat { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 780px) { .chat { grid-template-columns: 1fr; } }

.chan-list { max-height: 72vh; overflow-y: auto; }
.chan {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .7rem; border-radius: var(--r-sm); font-size: .82rem;
}
.chan:hover { background: var(--card-2); }
.chan.is-on { background: #f6ebeb; color: var(--maroon); font-weight: 600; }
.chan span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chan b { background: var(--maroon); color: #fff; font-size: .65rem; border-radius: 999px; padding: .05rem .35rem; font-style: normal; }

.msgs {
  height: 58vh; min-height: 320px; overflow-y: auto;
  padding: 1rem; display: flex; flex-direction: column; gap: .7rem;
  background: var(--card-2);
}
.msg { display: flex; gap: .55rem; max-width: 82%; }
.msg--mine { flex-direction: row-reverse; margin-left: auto; }
.msg__body {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px 12px 12px 3px; padding: .45rem .7rem; min-width: 0;
}
.msg--mine .msg__body { background: #f6ebeb; border-color: #eadada; border-radius: 12px 12px 3px 12px; }
.msg__who { font-size: .7rem; font-weight: 600; color: var(--maroon); margin-bottom: .1rem; }
.msg__text { font-size: .85rem; line-height: 1.5; word-wrap: break-word; overflow-wrap: anywhere; white-space: pre-wrap; }
.msg__time { font-size: .64rem; color: var(--ink-3); margin-top: .15rem; }
.msg__day {
  align-self: center; font-size: .7rem; color: var(--ink-3);
  background: var(--card); border: 1px solid var(--line);
  padding: .1rem .6rem; border-radius: 999px; max-width: none;
}
.composer { display: flex; gap: .5rem; padding: .7rem; border-top: 1px solid var(--line); background: var(--card); }
.composer textarea { min-height: 42px; max-height: 130px; resize: none; }

/* ==========================================================================
   SOP / training / announcements
   ========================================================================== */

.doc { font-size: .92rem; line-height: 1.75; }
.doc h2 { font-family: var(--font-display); font-size: 1.15rem; color: var(--maroon); margin: 1.3rem 0 .4rem; }
.doc h3 { font-size: 1rem; font-weight: 600; margin: 1.1rem 0 .3rem; }
.doc p { margin-bottom: .8rem; }
.doc ul, .doc ol { margin: 0 0 .9rem 1.2rem; }
.doc ul li { list-style: disc; margin-bottom: .3rem; }
.doc ol li { list-style: decimal; margin-bottom: .3rem; }
.doc strong { font-weight: 600; }
.doc a { color: var(--maroon); text-decoration: underline; }

.vid-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.vid { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.vid__thumb { position: relative; aspect-ratio: 16/9; background: #241109; }
.vid__thumb img { width: 100%; height: 100%; object-fit: cover; }
.vid__play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(36,17,9,.28); color: #fff; font-size: 2rem;
}
.vid__body { padding: .75rem .85rem; }
.vid__body h3 { font-size: .88rem; font-weight: 600; line-height: 1.35; margin-bottom: .3rem; }
.vid__frame { aspect-ratio: 16/9; }
.vid__frame iframe { width: 100%; height: 100%; border: 0; }

.ann {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 1rem 1.15rem; box-shadow: var(--shadow); border-left: 3px solid var(--sandstone);
}
.ann--important { border-left-color: var(--warn); }
.ann--urgent { border-left-color: var(--danger); }
.ann--unread { background: #fffdf6; }
.ann__head { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; margin-bottom: .35rem; }
.ann__head h3 { font-family: var(--font-display); font-size: 1.02rem; color: var(--maroon); font-weight: 600; }
.lang-hi .ann__head h3 { font-family: var(--font-hi); }
.ann__meta { font-size: .73rem; color: var(--ink-3); margin-bottom: .5rem; }
.ann__body { font-size: .88rem; line-height: 1.7; white-space: pre-wrap; }

/* ==========================================================================
   KPI / KRI / rewards
   ========================================================================== */

.score-ring {
  --pct: 0;
  width: 116px; height: 116px; border-radius: 50%;
  background: conic-gradient(var(--gold) calc(var(--pct) * 1%), var(--line) 0);
  display: grid; place-items: center; margin: 0 auto;
}
.score-ring__in {
  width: 88px; height: 88px; border-radius: 50%; background: var(--card);
  display: grid; place-items: center; text-align: center; line-height: 1.1;
}
.score-ring__in b { font-family: var(--font-display); font-size: 1.6rem; color: var(--maroon); }
.score-ring__in small { font-size: .64rem; color: var(--ink-3); }

.spark { display: flex; align-items: flex-end; gap: 4px; height: 54px; }
.spark div { flex: 1; background: var(--sandstone); border-radius: 3px 3px 0 0; min-height: 3px; position: relative; }
.spark div.is-last { background: var(--gold); }

.alert-row {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: .8rem 1rem; border-bottom: 1px solid var(--line);
}
.alert-row:last-child { border-bottom: 0; }
.alert-row__sev { width: 4px; align-self: stretch; border-radius: 2px; background: var(--ink-3); flex: 0 0 4px; }
.alert-row--low .alert-row__sev      { background: var(--info); }
.alert-row--medium .alert-row__sev   { background: var(--warn); }
.alert-row--high .alert-row__sev     { background: #e06c00; }
.alert-row--critical .alert-row__sev { background: var(--danger); }
.alert-row__main { flex: 1; min-width: 0; }
.alert-row__main h4 { font-size: .87rem; font-weight: 600; margin-bottom: .1rem; }
.alert-row__main p { font-size: .79rem; color: var(--ink-2); }

.rec {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: .9rem 1rem; box-shadow: var(--shadow);
  border-top: 3px solid var(--gold);
}
.rec__head { display: flex; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.rec__badge {
  font-size: .7rem; font-weight: 700; color: #7a5f10; background: var(--gold-soft);
  padding: .12rem .5rem; border-radius: 999px;
}
.rec__note { font-size: .86rem; line-height: 1.6; }
.rec__foot { font-size: .72rem; color: var(--ink-3); margin-top: .5rem; }

.lb { display: flex; align-items: center; gap: .6rem; padding: .5rem .2rem; border-bottom: 1px solid var(--line); }
.lb:last-child { border-bottom: 0; }
.lb__rank { width: 22px; font-weight: 700; color: var(--ink-3); font-size: .8rem; text-align: center; }
.lb:nth-child(1) .lb__rank { color: var(--gold-deep); }
.lb__pts { font-weight: 700; color: var(--maroon); font-size: .85rem; }

.badge-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; }
.badge-pick label {
  display: flex; align-items: center; gap: .45rem; padding: .5rem .6rem;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  font-size: .78rem; cursor: pointer; background: var(--card);
}
.badge-pick input { accent-color: var(--maroon); }
.badge-pick label:has(input:checked) { border-color: var(--gold); background: var(--gold-soft); }

/* ==========================================================================
   Salary slip (screen + print)
   ========================================================================== */

.slip { background: #fff; max-width: 820px; margin: 0 auto; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.slip__head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
  padding: 1.2rem 1.4rem; border-bottom: 2px solid var(--gold);
  background: linear-gradient(120deg, var(--maroon), var(--espresso)); color: #f3ece2;
}
.slip__head h2 { font-family: var(--font-display); font-size: 1.3rem; color: var(--gold); }
.slip__head p { font-size: .76rem; color: rgba(243,236,226,.75); line-height: 1.5; }
.slip__period { text-align: right; font-size: .8rem; }
.slip__period strong { display: block; font-size: 1rem; color: var(--gold); }
.slip__emp { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .6rem 1.5rem; padding: 1rem 1.4rem; border-bottom: 1px solid var(--line); }
.slip__emp div span { display: block; font-size: .68rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.slip__emp div strong { font-size: .88rem; font-weight: 600; }
.slip__cols { display: grid; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .slip__cols { grid-template-columns: 1fr; } }
.slip__col { padding: 1rem 1.4rem; }
.slip__col + .slip__col { border-left: 1px solid var(--line); }
.slip__col h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); margin-bottom: .6rem; }
.slip__line { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0; font-size: .86rem; }
.slip__line--total { border-top: 1px solid var(--line); margin-top: .4rem; padding-top: .5rem; font-weight: 700; }
.slip__net {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1rem 1.4rem; background: var(--gold-soft); border-top: 2px solid var(--gold);
}
.slip__net strong { font-family: var(--font-display); font-size: 1.4rem; color: var(--maroon); }
.slip__foot { padding: .9rem 1.4rem; font-size: .72rem; color: var(--ink-3); text-align: center; border-top: 1px solid var(--line); }

@media print {
  .side, .topbar, .content__foot, .no-print { display: none !important; }
  body { background: #fff; }
  .content { padding: 0; max-width: none; }
  .slip { border: 0; max-width: none; }
  .slip__head { background: #fff !important; color: var(--ink) !important; border-bottom: 2px solid var(--maroon); }
  .slip__head h2, .slip__period strong { color: var(--maroon) !important; }
  .slip__head p { color: var(--ink-2) !important; }
  .slip__net { background: #f5f0e2 !important; }
  @page { margin: 14mm; }
}

/* ==========================================================================
   Modal
   ========================================================================== */

dialog.modal {
  border: 0; border-radius: var(--r-lg); padding: 0;
  width: min(560px, calc(100vw - 2rem));
  box-shadow: var(--shadow-lg); color: var(--ink);
}
dialog.modal::backdrop { background: rgba(36,17,9,.5); backdrop-filter: blur(2px); }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
.modal__head h2 { font-family: var(--font-display); font-size: 1.05rem; color: var(--maroon); }
.lang-hi .modal__head h2 { font-family: var(--font-hi); }
.modal__body { padding: 1.2rem; max-height: 70vh; overflow-y: auto; }
.modal__foot { padding: .9rem 1.2rem; border-top: 1px solid var(--line); display: flex; gap: .6rem; justify-content: flex-end; background: var(--card-2); }
.modal__x { font-size: 1.5rem; line-height: 1; color: var(--ink-3); padding: 0 .3rem; }

/* ==========================================================================
   Studio System (modules/system.php)
   Its own quiet palette — a working diagram, not brand chrome. Stage colours
   arrive inline as --c. Widths:
     ≥1700  map + sticky details side by side; journey as swimlanes
     <1700  details slide in from the right (portal.js); journey as step cards
     <700   one column; details rise from the bottom
   ========================================================================== */

.sys {
  --sys-ink:     #1d1b18;
  --sys-ink-2:   #3d3832;
  --sys-ink-3:   #57514a;
  --sys-ink-4:   #6b655c;
  --sys-ink-5:   #8a8379;
  --sys-line:    #d9d3c9;
  --sys-line-2:  #ddd7cd;
  --sys-line-3:  #b7afa3;
  --sys-panel:   #f7f5f1;
  --sys-tint:    #f2efe9;
  --sys-node:    #fbfaf7;
  --sys-accent:  #9e4421;
  --sys-cta-bg:  #ffe4da;
  --sys-cta-fg:  #81300f;
  --sys-mono:    ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  display: flex; flex-direction: column; gap: clamp(1rem, 2.5vw, 2.5rem);
  color: var(--sys-ink);
}
.sys-mono { font-family: var(--sys-mono); }

.sys-sec {
  background: var(--sys-panel);
  border: 1px solid var(--sys-line); border-radius: 6px;
  padding: clamp(1rem, 2.6vw, 3rem);
  display: flex; flex-direction: column; gap: clamp(1.25rem, 2vw, 2rem);
  min-width: 0;
}

.sys-eyebrow {
  font-family: var(--sys-mono); font-size: 13px; line-height: 1.4;
  letter-spacing: .08em; text-transform: uppercase; color: var(--sys-ink-4);
}
.sys-eyebrow--sm { font-size: 12px; letter-spacing: .06em; }
.sys-label {
  font-family: var(--sys-mono); font-size: 12px; text-transform: uppercase;
  color: var(--sys-ink-4); margin-bottom: 8px;
}

.sys-h {
  font-size: clamp(1.35rem, 1.05rem + 1vw, 2rem); font-weight: 600;
  line-height: 1.15; letter-spacing: -.015em; text-wrap: pretty;
}
.sys-h--xl { font-size: clamp(1.6rem, 1.1rem + 1.6vw, 2.75rem); line-height: 1.05; letter-spacing: -.02em; }
.sys-lede {
  font-size: clamp(.95rem, .9rem + .2vw, 1.0625rem); line-height: 1.5;
  color: var(--sys-ink-3); max-width: 54rem; text-wrap: pretty;
}

/* ---- 01 System map ---- */
.sys-intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.25rem 2.5rem; }
.sys-intro__text { display: flex; flex-direction: column; gap: 10px; min-width: 0; flex: 1 1 auto; }

.sys-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; flex: 0 1 520px; }
.sys-legend li {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; line-height: 1.2; padding: 6px 10px;
  border: 1px solid var(--sys-line); border-radius: 999px; background: #fff;
}
.sys-dot { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--c); }
.sys-dot--sm { width: 8px; height: 8px; }

.sys-map { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; align-items: start; }
.sys-map__main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.sys-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px 24px; }
.sys-col { position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sys-col__head {
  display: flex; align-items: baseline; gap: 8px;
  padding-bottom: 10px; border-bottom: 2px solid var(--c);
}
.sys-col__head .sys-mono { font-size: 13px; color: var(--sys-ink-4); }
.sys-col__head h3 { font-size: 16px; font-weight: 600; line-height: 1.3; }
.sys-col__desc { font-size: 13px; line-height: 1.4; color: var(--sys-ink-4); min-height: 2.8em; }
.sys-col__arrow {
  display: none; position: absolute; top: 2px; right: -21px;
  font-size: 18px; line-height: 1; color: var(--sys-ink-5);
}

.sys-node {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 14px; border-radius: 6px;
  background: var(--sys-node); border: 1px solid var(--sys-line-2);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.sys-node:hover { border-color: var(--sys-ink); }
.sys-node.is-on {
  background: #fff; border-color: var(--sys-ink);
  box-shadow: 0 0 0 1px var(--sys-ink), 0 6px 16px rgba(29,27,24,.08);
}
.sys-node__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sys-node__top strong { font-size: 15px; font-weight: 600; line-height: 1.25; }
.sys-node__sub { font-size: 13px; line-height: 1.4; color: var(--sys-ink-3); }

.sys-loop {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 16px; align-items: center;
  padding: 14px 18px; background: #fff;
  border: 1px dashed var(--sys-line-3); border-radius: 6px;
}
.sys-loop__tag { font-size: 13px; color: var(--sys-accent); text-transform: uppercase; white-space: nowrap; }
.sys-loop__text { font-size: 14px; line-height: 1.5; color: var(--sys-ink-2); }

.sys-dash {
  display: flex; flex-direction: column; gap: 14px;
  padding: 20px 22px; border-radius: 6px;
  background: var(--sys-ink); color: #f2efe9;
}
.sys-dash__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; }
.sys-dash__head h3 { font-size: 16px; font-weight: 600; }
.sys-dash__note { font-size: 12px; color: #a59e93; }
.sys-dash__kpis { display: flex; flex-wrap: wrap; gap: 8px; }
.sys-dash__kpis li { font-size: 13px; line-height: 1.3; padding: 6px 10px; border: 1px solid #47423b; border-radius: 4px; }

/* Details. Without JS it simply sits under the map. */
.sys-detail {
  position: relative; overflow: hidden;
  background: #fff; border: 1px solid var(--sys-line); border-radius: 6px;
}
.sys-detail:focus { outline: none; }
.sys-detail__item { border-top: 6px solid var(--c); }
.sys-detail__head {
  display: flex; flex-direction: column; gap: 6px;
  padding: 20px 22px; border-bottom: 1px solid #ece7df;
}
.sys-detail__title { font-size: 24px; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }
.sys-detail__what { font-size: 14px; line-height: 1.5; color: var(--sys-ink-3); text-wrap: pretty; }
.sys-detail__body { display: flex; flex-direction: column; gap: 18px; padding: 18px 22px 22px; }
.sys-flow { display: flex; flex-direction: column; gap: 8px; }
.sys-flow li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px; font-size: 14px; line-height: 1.4; }
.sys-flow .sys-mono { color: var(--sys-ink-5); }
.sys-why { padding: 12px 14px; background: var(--sys-tint); border-radius: 4px; }
.sys-why .sys-label { margin-bottom: 6px; }
.sys-why p + p { font-size: 14px; line-height: 1.45; }
.sys-detail__close {
  display: none; place-items: center; z-index: 1;
  position: absolute; top: 16px; right: 14px;
  width: 34px; height: 34px; border-radius: 50%;
  background: #fff; border: 1px solid var(--sys-line);
  font-size: 1.4rem; line-height: 1; color: var(--sys-ink-3);
}
.sys-detail__close:hover { border-color: var(--sys-ink); color: var(--sys-ink); }

/* ---- 02 Client journey (step cards by default) ---- */
.sys-journey { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 12px; }
.sys-journey__lanes { display: none; }
.sys-step {
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border: 1px solid var(--sys-line-2); border-radius: 6px;
}
.sys-step__head { display: flex; align-items: baseline; gap: 8px; padding: 12px 14px 10px; border-bottom: 2px solid var(--c); }
.sys-step__head .sys-mono { font-size: 12px; color: var(--sys-ink-4); }
.sys-step__head h3 { font-size: 15px; font-weight: 600; line-height: 1.25; }
.sys-cell {
  display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 8px;
  padding: 8px 14px; border-top: 1px solid #f0ece5;
  font-size: 13px; line-height: 1.4; color: #2b2723;
}
.sys-step__head + .sys-cell { border-top: 0; }
.sys-cell.is-empty { display: none; }
.sys-cell__lane {
  font-family: var(--sys-mono); font-size: 11px; line-height: 1.6;
  letter-spacing: .04em; text-transform: uppercase; color: var(--sys-ink-4);
}
.sys-cell--crm .sys-cell__text {
  justify-self: start; padding: 0 6px; border-radius: 3px; background: var(--sys-tint);
}
.sys-lane { display: flex; flex-direction: column; gap: 2px; padding-top: 10px; font-size: 14px; font-weight: 600; line-height: 1.3; }
.sys-lane small { font-size: 12px; font-weight: 400; color: var(--sys-ink-4); }

/* ---- 03 Website ---- */
.sys-home { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; }
.sys-home__root {
  padding: 12px 28px; border-radius: 5px; text-align: center;
  background: var(--sys-ink); color: #f2efe9; font-size: 16px; font-weight: 600; line-height: 1.3;
}
.sys-home__note {
  padding: 8px 14px; border: 1px solid var(--sys-line); border-radius: 1.25rem; background: #fff;
  font-size: 13px; line-height: 1.35; color: var(--sys-ink-3);
}
.sys-home__rule { height: 1px; margin: 0 7%; background: var(--sys-line-3); }
.sys-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: 20px 14px; }
.sys-page { display: flex; flex-direction: column; gap: 8px; }
.sys-page__box {
  display: flex; flex-direction: column; gap: 4px; padding: 12px 14px;
  background: #fff; border: 1px solid var(--sys-line); border-radius: 5px;
}
.sys-page__box strong { font-size: 15px; font-weight: 600; line-height: 1.3; }
.sys-page__box .sys-mono { font-size: 12px; color: var(--sys-ink-4); overflow-wrap: anywhere; }
.sys-page__items { display: flex; flex-direction: column; gap: 8px; }
.sys-page__items li {
  margin-left: 12px; padding: 5px 10px; border-left: 1px solid var(--sys-line-3);
  font-size: 13px; line-height: 1.4; color: var(--sys-ink-2);
}
.sys-page__cta {
  margin-top: auto; padding: 6px 10px; border-radius: 3px;
  background: var(--sys-cta-bg); color: var(--sys-cta-fg); font-size: 12px; line-height: 1.4;
}

.sys-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(36,17,9,.45); }

/* Devanagari has no monospace face, and letter-spacing breaks the headline
   stroke that joins the letters — so Hindi labels use the normal font. */
.lang-hi .sys-eyebrow, .lang-hi .sys-label, .lang-hi .sys-loop__tag,
.lang-hi .sys-dash__note, .lang-hi .sys-page__cta, .lang-hi .sys-cell__lane {
  font-family: var(--font); letter-spacing: 0; text-transform: none;
}
.lang-hi .sys-h, .lang-hi .sys-detail__title { letter-spacing: 0; line-height: 1.35; }

/* ---- Widths ---- */
@media (min-width: 700px) {
  .sys-cols { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

@media (max-width: 1279.98px) {
  .sys-intro { flex-direction: column; align-items: flex-start; }
  .sys-legend { justify-content: flex-start; flex-basis: auto; }
}
@media (min-width: 1280px) {
  .sys-cols { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .sys-col__arrow { display: block; }
}

@media (min-width: 1700px) {
  .sys-map { grid-template-columns: minmax(0, 1fr) 340px; }
  .sys-detail { position: sticky; top: 84px; }
  .sys-scrim { display: none !important; }

  /* Journey as swimlanes: one grid, the step wrappers dissolve into it. */
  .sys-journey { grid-template-columns: 130px repeat(8, minmax(0, 1fr)); gap: 8px; }
  .sys-journey__lanes, .sys-step { display: contents; }
  .sys-lane          { grid-column: 1; }
  .sys-step > *      { grid-column: var(--col); }
  .sys-step__head    { grid-row: 1; flex-direction: column; align-items: flex-start; gap: 4px; padding: 0 4px 10px; }
  .sys-lane--client, .sys-cell--client { grid-row: 2; }
  .sys-lane--ai,     .sys-cell--ai     { grid-row: 3; }
  .sys-lane--team,   .sys-cell--team   { grid-row: 4; }
  .sys-lane--crm,    .sys-cell--crm    { grid-row: 5; }
  .sys-cell, .sys-step__head + .sys-cell {
    display: block; min-height: 72px; padding: 10px;
    background: #fff; border: 1px solid var(--sys-line-2); border-radius: 5px;
  }
  .sys-cell.is-empty { display: block; background: transparent; border-color: #e4dfd6; }
  .sys-cell--crm .sys-cell__text { padding: 0; background: none; }
  .sys-cell__lane {   /* the lane column says it; keep it for screen readers */
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }

  .sys-pages { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}

/* Slide-in details once portal.js has taken over (it adds .is-js). */
@media (max-width: 1699.98px) {
  .sys.is-js .sys-detail {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 60;
    width: min(400px, 92vw);
    border-width: 0 0 0 1px; border-radius: 0;
    overflow-y: auto; overscroll-behavior: contain;
    box-shadow: 0 20px 50px -20px rgba(29,27,24,.45);
    transform: translateX(100%); visibility: hidden;
    transition: transform .25s ease, visibility 0s linear .25s;
  }
  .sys.is-js .sys-detail.is-open { transform: none; visibility: visible; transition: transform .25s ease; }
  .sys.is-js .sys-detail__close { display: grid; }
  .sys.is-js .sys-detail__head { padding-right: 60px; }
}
@media (max-width: 699.98px) {
  .sys-intro__text { gap: 8px; }
  .sys-loop { grid-template-columns: minmax(0, 1fr); }
  .sys-detail__head, .sys-detail__body { padding-left: 18px; padding-right: 18px; }

  .sys.is-js .sys-detail {
    top: auto; left: 0; width: auto; max-height: 85vh;
    border-width: 1px 0 0; border-radius: 14px 14px 0 0;
    transform: translateY(100%);
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 980px) {
  .side {
    position: fixed; inset: 0 auto 0 0;
    transform: translateX(-100%); transition: transform .25s ease;
    box-shadow: var(--shadow-lg);
  }
  body.side-open .side { transform: none; }
  body.side-open .side__scrim {
    display: block; position: fixed; inset: 0; z-index: 35;
    background: rgba(36,17,9,.45);
  }
  .side__close { display: block; }
  .topbar__burger { display: flex; }
  .whoami__text { display: none; }
}

@media (max-width: 560px) {
  body { font-size: 14.5px; }
  .topbar { gap: .5rem; padding: .55rem .8rem; }
  .topbar__actions .btn span { display: none; }
  .topbar__actions .btn { padding: .5rem .6rem; }
  .content { padding: .8rem; }
  .card__head { padding: .75rem .9rem; }
  .card__body { padding: .9rem; }
  .grid { gap: .75rem; }
  .stat__value { font-size: 1.45rem; }
  .punch { padding: .9rem 1rem; }
  .punch__clock { font-size: 1.6rem; }
  .msgs { height: 52vh; }
  .msg { max-width: 92%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
