/* Nattika Ayurveda Retreats - Integrated Operations Module family stylesheet, as used by the HR and Front Office modules.
   Accounts Renewals adds the state pills, foot-count and calendar rules at the end. */
:root{
  --gold:#b8893b; --gold-dark:#8f6a2c; --gold-light:#e7d4ad;
  --ink:#2c2620; --muted:#7d7669; --line:#e7e2d8; --bg:#f6f3ec;
  --card:#fffdf8; --green:#3c7d57; --red:#c0492f; --amber:#c98a1a;
  --blue:#2f6f9f;
  --shadow:0 1px 3px rgba(60,45,20,.08),0 6px 18px rgba(60,45,20,.06);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{font-family:"Segoe UI",Roboto,Helvetica,Arial,sans-serif;background:var(--bg);
  color:var(--ink);font-size:14.5px;line-height:1.5}
a{color:var(--gold-dark);text-decoration:none}
a:hover{text-decoration:underline}
h1,h2,h3{margin:0}

/* ---------- layout ---------- */
.layout{display:flex;min-height:100vh}
.sidebar{width:248px;background:#231f19;color:#efe9dd;display:flex;flex-direction:column;
  position:sticky;top:0;height:100vh;flex-shrink:0}
.brand{padding:16px 16px 18px;border-bottom:1px solid #3a342b;text-align:center}
.brand .brand-logo{background:#fff;border-radius:8px;padding:10px 12px;margin-bottom:10px}
.brand .brand-logo img{display:block;width:100%;height:auto}
.brand .sub{font-size:13.5px;font-weight:600;color:var(--gold-light);margin-top:8px;line-height:1.4}
.nav{padding:10px 0;overflow-y:auto;flex:1}
.nav .group{font-size:10.5px;text-transform:uppercase;letter-spacing:1.5px;color:#8a8275;
  padding:14px 18px 6px}
.nav a{display:flex;align-items:center;gap:10px;color:#d9d2c4;padding:9px 18px;font-size:13.5px}
.nav a:hover{background:#2e2920;text-decoration:none;color:#fff}
.nav a.active{background:var(--gold);color:#fff;font-weight:600}
.nav a.soon{opacity:.45;cursor:default;pointer-events:none}
.nav a.soon:after{content:"soon";margin-left:auto;font-size:9.5px;letter-spacing:.5px;
  text-transform:uppercase;background:#3a342b;color:#a89f8d;padding:2px 6px;border-radius:9px}
.sidebar .foot{padding:12px 18px;border-top:1px solid #3a342b;font-size:12px;color:#a89f8d}

.main{flex:1;min-width:0;display:flex;flex-direction:column}
.topbar{background:var(--card);border-bottom:1px solid var(--line);padding:12px 24px;
  display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:5}
.topbar h1{font-size:18px;font-weight:600}
.topbar .who{font-size:12.5px;color:var(--muted)}
.content{padding:24px;max-width:1240px;width:100%}

/* ---------- cards & grid ---------- */
.card{background:var(--card);border:1px solid var(--line);border-radius:10px;
  box-shadow:var(--shadow);padding:18px;margin-bottom:18px}
.card h2{margin:0 0 14px;font-size:15px;font-weight:600;display:flex;
  align-items:center;justify-content:space-between;gap:10px}
.card h2 .muted{font-weight:400;color:var(--muted);font-size:12.5px}
.card > p:first-of-type{margin-top:0}
.grid{display:grid;gap:16px}
.grid.cols-2{grid-template-columns:repeat(2,1fr)}
.grid.cols-3{grid-template-columns:repeat(3,1fr)}
.grid.cols-4{grid-template-columns:repeat(4,1fr)}
@media(max-width:1100px){.grid.cols-4{grid-template-columns:repeat(3,1fr)}}
@media(max-width:900px){.grid.cols-3,.grid.cols-4{grid-template-columns:repeat(2,1fr)}}
@media(max-width:640px){.grid{grid-template-columns:1fr!important}.layout{flex-direction:column}.sidebar{position:static;width:100%;height:auto;flex-direction:column}.sidebar .brand{padding:10px 12px}.sidebar .brand .brand-logo{max-width:160px;margin:0 auto 6px}.nav{display:flex;flex-wrap:wrap;padding:6px 8px;overflow:visible;flex:none}.nav .group{display:none}.nav a{padding:6px 10px;font-size:12.5px}
  .content{padding:14px}}

/* ---------- stat tiles ---------- */
.stat{background:var(--card);border:1px solid var(--line);border-radius:10px;padding:14px 16px;
  box-shadow:var(--shadow);position:relative;overflow:hidden}
.stat::before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;
  background:linear-gradient(180deg,var(--gold),var(--gold-light))}
.stat .label{font-size:11.5px;color:var(--muted);text-transform:uppercase;letter-spacing:.5px}
.stat .value{font-size:26px;font-weight:700;margin-top:4px}
.stat .value.sm{font-size:17px;margin-top:8px;line-height:1.35}
.stat .hint{font-size:11.5px;color:var(--muted);margin-top:3px}

/* ---------- buttons ---------- */
.btn{display:inline-flex;align-items:center;gap:6px;background:var(--gold);color:#fff;border:none;
  padding:9px 16px;border-radius:7px;font-size:13.5px;cursor:pointer;font-weight:600;
  font-family:inherit;line-height:1.3}
.btn:hover{background:var(--gold-dark);text-decoration:none;color:#fff}
.btn.secondary{background:#efe9dc;color:var(--ink)}
.btn.secondary:hover{background:#e4dccb}
.btn.ghost{background:transparent;border:1px solid var(--line);color:var(--ink)}
.btn.ghost:hover{background:#f4f1ea;color:var(--ink)}
.btn.danger{background:var(--red)}
.btn.danger:hover{background:#a13c26}
/* An outlined delete — destructive, but not competing with the primary action. */
.btn.ghost.danger{background:transparent;border-color:#e2b6ab;color:var(--red)}
.btn.ghost.danger:hover{background:#f9e9e5;color:var(--red)}
.btn.green{background:var(--green)}
.btn.sm{padding:5px 10px;font-size:12px;border-radius:6px}
.btn[disabled]{opacity:.5;cursor:not-allowed}

/* ---------- tables ---------- */
table{width:100%;border-collapse:collapse;font-size:13.5px}
th,td{text-align:left;padding:9px 10px;border-bottom:1px solid var(--line);vertical-align:middle}
th{font-size:11.5px;text-transform:uppercase;letter-spacing:.4px;color:var(--muted);font-weight:600}
tbody tr:hover td{background:#faf7f0}
td.num,th.num{text-align:right;font-variant-numeric:tabular-nums}
.table-wrap{overflow-x:auto}
table.tight td,table.tight th{padding:6px 8px}

/* ---------- forms ---------- */
label.fld{display:block;margin-bottom:14px}
label.fld .lbl{display:block;font-size:12.5px;color:var(--muted);margin-bottom:5px;
  font-weight:600;letter-spacing:.2px}
label.fld .lbl .req{color:var(--red);margin-left:2px}
label.fld .hint{font-size:11.5px;color:var(--muted);margin-top:4px;line-height:1.45}
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=submit]):not([type=button]),
select,textarea{
  width:100%;padding:10px 12px;border:1.5px solid var(--line);border-radius:8px;
  font-size:14.5px;font-family:inherit;background:#fff;color:var(--ink);min-height:42px;
  transition:border-color .15s ease, box-shadow .15s ease}
select{cursor:pointer}
input:hover:not(:focus),select:hover:not(:focus),textarea:hover:not(:focus){border-color:#cdc4b2}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--gold);
  box-shadow:0 0 0 3px rgba(184,137,59,.18)}
::placeholder{color:#b4ac9d}
input:disabled,input[readonly],select:disabled,textarea[readonly]{
  background:#f4f1ea;color:var(--muted);cursor:not-allowed}
input[type=checkbox],input[type=radio]{accent-color:var(--gold);width:18px;height:18px;cursor:pointer}
textarea{min-height:92px;resize:vertical;line-height:1.55}
.form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:0 16px}
.form-row{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap}
.form-row label.fld{flex:1;min-width:150px}
table input,table select{min-height:34px;padding:5px 8px;font-size:13px}

/* ---------- pills, badges & states ---------- */
.pill{display:inline-block;padding:3px 9px;border-radius:20px;font-size:11px;font-weight:600;
  letter-spacing:.3px;text-transform:uppercase;white-space:nowrap}
.pill.sent,.pill.done,.pill.ok{background:#e4f0e8;color:var(--green)}
.pill.draft,.pill.progress{background:#fbf0d8;color:#8a6410}
.pill.todo,.pill.pending{background:#f6e5e0;color:var(--red)}
.pill.muted,.pill.na{background:#efece4;color:var(--muted)}
.pill.info{background:#e2edf5;color:var(--blue)}

/* Front Office badge vocabulary — same names, so a template ported from the FO
   module renders identically here. Sentence case, not the .pill uppercase. */
.badge{display:inline-block;padding:2px 9px;border-radius:20px;font-size:11.5px;font-weight:600}
.badge.draft{background:#f3ebd6;color:var(--amber)}
.badge.sent{background:#dcefe3;color:var(--green)}
.badge.role{background:#e6eef5;color:var(--blue)}
.badge.open,.badge.todo{background:#fdeede;color:var(--amber)}
.badge.closed{background:#dcefe3;color:var(--green)}
.badge.overdue{background:#f8e3de;color:var(--red)}

/* ---------- progress ---------- */
.bar{height:7px;background:#efeae0;border-radius:5px;overflow:hidden;margin-top:7px}
.bar span{display:block;height:100%;background:linear-gradient(90deg,var(--gold),var(--gold-light));
  border-radius:5px}
.bar.full span{background:var(--green)}

/* ---------- flashes & callouts ---------- */
.flash{padding:11px 15px;border-radius:8px;margin-bottom:14px;font-size:13.5px;
  border-left:4px solid}
.flash.success{background:#e9f3ed;border-color:var(--green);color:#245a3b}
.flash.error,.flash.danger{background:#f9e9e5;border-color:var(--red);color:#8d3421}
.flash.info{background:#e8f0f6;border-color:var(--blue);color:#22516f}
.flash.warning{background:#fdf5e6;border-color:var(--amber);color:#7d5c0f}
.flash a{color:inherit;text-decoration:underline}
.note{background:#faf7f0;border:1px solid var(--line);border-left:4px solid var(--gold);
  border-radius:8px;padding:12px 15px;font-size:13px;color:#5b5346;margin-bottom:16px;
  line-height:1.6}
.note.warn{border-left-color:var(--amber);background:#fdf8ec}
.note strong{color:var(--ink)}
.note code{background:#efe9dc;padding:1px 5px;border-radius:4px;font-size:12px}

/* ---------- empty state ---------- */
.empty{padding:26px 16px;text-align:center;color:var(--muted);font-size:13.5px;
  background:#faf7f0;border:1px dashed var(--line);border-radius:10px}

/* ---------- standards (CCP & SOP) ---------- */
.std{margin-bottom:18px}
.std h3{font-size:14.5px;color:var(--gold-dark);margin:0 0 4px;font-weight:700}
.std .where{font-size:12px;color:var(--muted);font-style:italic;margin-bottom:9px;
  padding-left:11px;border-left:2px solid var(--gold-light)}
.std ul{margin:0;padding-left:20px}
.std li{margin:5px 0;line-height:1.55}
.std .block{margin-top:12px}
.std .block h4{font-size:12.5px;text-transform:uppercase;letter-spacing:.5px;
  color:var(--muted);margin:0 0 5px}
.toc{display:flex;flex-wrap:wrap;gap:7px;margin-bottom:6px}
.toc a{font-size:12px;background:#f2ede2;padding:5px 11px;border-radius:16px;color:#6a6154}
.toc a:hover{background:var(--gold-light);text-decoration:none;color:#5a4a28}

/* ---------- tabs ---------- */
.tabs{display:flex;gap:6px;border-bottom:1px solid var(--line);margin-bottom:16px;
  flex-wrap:wrap}
.tabs a{padding:8px 14px;font-size:13px;border-bottom:2px solid transparent;color:var(--muted);
  font-weight:600}
.tabs a:hover{color:var(--ink);text-decoration:none}
.tabs a.active{color:var(--gold-dark);border-bottom-color:var(--gold)}

/* ---------- login ---------- */
.login-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;
  background:linear-gradient(160deg,#241f18 0%,#3a3226 100%);padding:20px}
.login-card{background:var(--card);border-radius:14px;padding:32px 30px;width:100%;
  max-width:380px;box-shadow:0 18px 50px rgba(0,0,0,.3)}
.login-card .logo{background:#fff;border-radius:8px;padding:12px;margin-bottom:18px}
.login-card .logo img{display:block;width:100%;height:auto}
.login-card h1{font-size:15px;text-align:center;margin-bottom:4px;font-weight:600}
.login-card .tag{text-align:center;font-size:12px;color:var(--muted);margin-bottom:22px}
.login-card .btn{width:100%;justify-content:center;margin-top:6px}
.login-card .hint{font-size:11.5px;color:var(--muted);text-align:center;margin-top:16px;
  line-height:1.6}

/* ---------- Front Office layout vocabulary ----------
   .row-flex / .pill-link / .ic / .progress / .email-preview / .help are the
   class names the FO module's dashboard and report pages are built on. Keeping
   the names identical means a pattern proved there ports across unchanged. */
.row-flex{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.row-flex.between,.between{justify-content:space-between}

.pill-link{display:flex;align-items:center;gap:10px;padding:12px 14px;
  border:1px solid var(--line);border-radius:9px;background:var(--card);
  box-shadow:var(--shadow);color:var(--ink)}
.pill-link:hover{border-color:var(--gold);text-decoration:none;color:var(--ink)}
.pill-link .ic{width:34px;height:34px;border-radius:8px;background:var(--gold-light);
  color:var(--gold-dark);display:flex;align-items:center;justify-content:center;
  font-weight:700;flex-shrink:0}
.pill-link .ic.done{background:#dcefe3;color:var(--green)}
.pill-link .ic.todo{background:#f6e5e0;color:var(--red)}

.progress{height:9px;background:#eee6d6;border-radius:6px;overflow:hidden}
.progress > div{height:100%;background:var(--gold)}
.progress.full > div{background:var(--green)}

.email-preview{border:1px solid var(--line);border-radius:8px;background:#fff;
  padding:0;overflow:hidden}
.email-preview iframe{width:100%;border:none;min-height:520px;display:block}

.help{font-size:12px;color:var(--muted);margin-top:4px;line-height:1.5}

/* scrollable recipient checkbox list (Send page) */
.picklist{max-height:230px;overflow:auto;border:1px solid var(--line);
  border-radius:8px;padding:8px 10px;background:#fff}
.picklist label{display:flex;gap:9px;align-items:center;padding:3px 0;
  font-size:13px;cursor:pointer;margin:0}
.picklist label:hover{color:var(--gold-dark)}
.picklist input[type=checkbox]{flex-shrink:0}

/* ---------- misc ---------- */
.muted{color:var(--muted)}
.small{font-size:12px}
.right{text-align:right}
.nowrap{white-space:nowrap}
.stack{display:flex;flex-direction:column;gap:2px}
.inline{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.spacer{flex:1}
hr.soft{border:none;border-top:1px solid var(--line);margin:18px 0}

/* --- Phase 2b / 3: banded registers, footnotes, evidence marks ----------- */
.band{font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;
      color:var(--gold-dark);margin:22px 0 8px;display:flex;gap:9px;align-items:baseline}
.band:first-of-type{margin-top:4px}
.band .muted{font-weight:400;letter-spacing:0;text-transform:none;font-size:12px}
.legend{margin-top:14px;padding-top:12px;border-top:1px solid var(--line);
        font-size:12.5px;color:var(--muted);line-height:1.55}
.legend b{color:var(--ink);font-weight:600}
/* "Not Evidenced" is never styled as a zero or as a pass — it reads as a gap,
   because that is what it is (STRUCTURE.md §3.5). */
.unevidenced{color:var(--muted);font-style:italic}
.asof{font-size:11.5px;color:var(--muted);white-space:nowrap}
.assumption{font-size:12px;color:var(--muted);background:var(--wash,#faf7f1);
            border-left:3px solid var(--line);padding:8px 11px;margin:0 0 14px;
            line-height:1.55}
.grid.cols-5{grid-template-columns:repeat(5,1fr)}
.numgrid input{width:100%;min-width:58px;text-align:right;
               font-variant-numeric:tabular-nums}
table.tight td.num,table td.num,td.right,th.right{font-variant-numeric:tabular-nums}

/* ---------- stat tile states ----------
   `.stat.warn` was used nineteen times on the dashboard and never defined, so
   a tile flagging a gap looked exactly like one reporting a clean count. The
   left bar is the signal — it is already there on every tile, it just never
   changed colour. */
.stat.warn::before{background:linear-gradient(180deg,var(--amber),#f0d9a0)}
.stat.bad::before{background:linear-gradient(180deg,var(--red),#e8a99a)}
.stat.calm::before{background:linear-gradient(180deg,var(--green),#a9d4bb)}

/* A tile that is a link should feel like one. */
a.stat{display:block;color:inherit;transition:transform .08s ease,box-shadow .08s ease}
a.stat:hover{text-decoration:none;color:inherit;transform:translateY(-1px);
  box-shadow:0 4px 14px rgba(0,0,0,.09)}
a.stat:hover .label{color:var(--gold-dark)}

/* ---------- the mail board ----------
   The home screen's first block: the six families of mail, each one a way in.
   Bigger than a stat tile because this is the thing the module is for. */
.mailgrid{display:grid;gap:14px;grid-template-columns:repeat(3,1fr)}
@media(max-width:900px){.mailgrid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:640px){.mailgrid{grid-template-columns:1fr}}
.mailtile{display:block;background:var(--card);border:1px solid var(--line);
  border-radius:10px;padding:16px 18px;box-shadow:var(--shadow);position:relative;
  overflow:hidden;color:inherit;transition:transform .08s ease,box-shadow .08s ease}
.mailtile:hover{text-decoration:none;color:inherit;transform:translateY(-2px);
  box-shadow:0 6px 18px rgba(0,0,0,.10);border-color:var(--gold)}
.mailtile::before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;
  background:linear-gradient(180deg,var(--gold),var(--gold-light))}
.mailtile.due::before{background:linear-gradient(180deg,var(--red),#e8a99a)}
.mailtile .mt-top{display:flex;align-items:baseline;justify-content:space-between;gap:10px}
.mailtile .mt-name{font-size:15px;font-weight:650;letter-spacing:.1px}
.mailtile .mt-count{font-size:11.5px;color:var(--muted);white-space:nowrap}
.mailtile .mt-state{font-size:24px;font-weight:700;margin-top:10px;line-height:1}
.mailtile .mt-state.due{color:var(--red)}
.mailtile .mt-state.clear{color:var(--muted);font-size:15px;font-weight:600}
.mailtile .mt-hint{font-size:11.5px;color:var(--muted);margin-top:5px}
.mailtile .mt-go{font-size:11.5px;color:var(--gold-dark);margin-top:9px;font-weight:600}

/* ---------- a picker you may also type into ----------
   `<input list="...">` accepts a typed name AND offers the roster, which is
   exactly what the security pack needs — a relief hand who is not on the roster
   still has to be recorded. But Chrome draws it as a plain box: no arrow, no
   hint that anything is behind it, so the desk cannot tell a picker from a text
   field. The chevron is the affordance the browser does not give.

   The :not() chain is not decoration. The base input rule above carries five of
   them, which puts it at specificity (0,5,1) — and its `background` SHORTHAND
   resets background-image to none. A plain `input[list]` (0,1,1) loses silently:
   the rule loads, applies to nothing, and the box still looks like a text
   field. Matching the chain takes this to (0,6,1). */
input[list]:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=submit]):not([type=button]){
  background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238f6a2c' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 10px center;
  padding-right:28px;
  cursor:pointer;
}

/* The picker above draws its own chevron; <select> was still drawing the
   operating system's — so the two sat side by side on the same form looking
   like different kinds of control. Same chevron, same geometry, one species.
   `appearance:none` is what takes the native arrow off. */
select{
  appearance:none;-webkit-appearance:none;-moz-appearance:none;
  background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238f6a2c' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 10px center;
  padding-right:28px;
}
/* The disabled rule far above uses the `background` SHORTHAND, which clears
   the image — and then this rule puts it back. Say plainly that a dead control
   carries no chevron rather than letting declaration order decide it. */
select:disabled,input[list][readonly],input[list]:disabled{background-image:none}

/* Inside a table both controls need reining in. `table select` is (0,0,2) and
   beat the rule above, so the chevron was landing ON TOP of the option text —
   the native arrow used to reserve its own space and ours does not. And a duty
   column is narrow: 28px of right padding to clear a 10px chevron eats the
   text. Tighter geometry, applied to BOTH so they still match, and specific
   enough to win — `table input[list]` + the chain is (0,6,2) against the
   picker rule's (0,6,1). */
table select,
table input[list]:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=submit]):not([type=button]){
  padding-right:20px;
  background-position:right 6px center;
}



/* ---------- Accounts Renewals additions ----------
   The register's derived states, in the family's pill vocabulary. Sentence case
   like .badge, uppercase like .pill — these are pills. */
.pill.st-overdue{background:#f6e5e0;color:var(--red)}
.pill.st-due{background:#fbf0d8;color:#8a6410}
.pill.st-upcoming{background:#e2edf5;color:var(--blue)}
.pill.st-renewed{background:#e4f0e8;color:var(--green)}
.pill.st-missing_expiry{background:#efe6f5;color:#6b4a8a}
.pill.st-cancelled,.pill.st-retired,.pill.st-no_cycle{background:#efece4;color:var(--muted)}
.neg{color:var(--red);font-weight:600}
table.kv th{width:140px;color:var(--muted);font-weight:600;text-transform:none;letter-spacing:0;font-size:12.5px}
.topbar h1 .muted{font-weight:400}
details summary{cursor:pointer;color:var(--gold-dark);font-weight:600;font-size:13px}
.linkbtn{background:none;border:0;padding:0;font:inherit;color:var(--gold-light);cursor:pointer;text-decoration:none}
.linkbtn:hover{text-decoration:underline}
.flash.message{background:#e8f0f6;border-color:var(--blue);color:#22516f}
.pill.st-in_progress{background:#e2edf5;color:var(--blue)}
table.calendar td.cal{vertical-align:top;min-width:92px;font-size:11.5px;padding:4px 5px}
table.calendar th.now,table.calendar td.now{background:#fdf5e6}
table.calendar .cal-item{line-height:1.3;margin-bottom:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:150px}
table.calendar .cal-item.proj{opacity:.55}
table.calendar .cal-sum{margin-top:4px;padding-top:3px;border-top:1px dashed var(--line);font-weight:600;color:var(--gold-dark);white-space:nowrap}
.foot-count{margin:4px 0 14px;padding:10px 14px;border-top:1px solid var(--line);font-size:12.5px;color:var(--muted)}
.foot-count a{font-weight:600}
