/* ===========================================================================
   Acharya Anand CRM — crm.css
   Additions on top of astromata.css (the brand design system).
   =========================================================================== */

/* --- Plain pages (login / installer) -------------------------------------- */
body.plain {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 18px;
  background:
    radial-gradient(130% 80% at 80% -10%, rgba(75,63,143,.10), transparent 60%),
    var(--stone);
}
.auth-shell { width: 100%; max-width: 880px; }
.auth-brand {
  display: flex; align-items: center; justify-content: center; gap: 13px;
  margin-bottom: 22px;
}
.auth-brand .seal { width: 48px; height: 48px; }
.auth-brand b {
  font-family: var(--disp); font-weight: 700; font-size: 24px;
  letter-spacing: .14em; color: var(--navy-900); line-height: 1; display: block;
}
.auth-brand .tag {
  font-size: 10px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--saf); font-weight: 600; display: block; margin-top: 4px;
}
.auth-split { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: stretch; }
.auth-split .form-card { display: flex; flex-direction: column; justify-content: center; }
@media (max-width: 760px) { .auth-split { grid-template-columns: 1fr; } .auth-aside { display: none; } }

/* --- Sidebar: signed-in identity + logout ---------------------------------- */
.cs-me { display: flex; align-items: center; gap: 11px; padding: 8px 10px 12px; }
.cs-me-av {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: rgba(230,201,100,.14); color: var(--gold-2);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--disp); font-weight: 700; font-size: 15px;
}
.cs-me-id b { display: block; color: var(--cream); font-size: 13.5px; font-weight: 600; }
.cs-me-id span { font-size: 11.5px; color: var(--cream-mute); }
.cs-logout { margin: 0; }
.cs-logout .cs-link { color: var(--cream-mute); }
.cs-logout .cs-link:hover { color: #F2B8B0; background: rgba(160,40,40,.18); }

/* --- Flash banners (console) ---------------------------------------------- */
.cflash {
  border-radius: 14px; padding: 13px 18px; margin-bottom: 18px;
  font-size: 13.5px; font-weight: 500; box-shadow: var(--raise-sm);
  display: flex; align-items: center; gap: 10px;
}
.cflash::before { font-size: 15px; }
.cflash-ok   { color: #1E8A55; } .cflash-ok::before   { content: "✓"; }
.cflash-err  { color: var(--status-danger); } .cflash-err::before  { content: "!"; font-weight: 800; }
.cflash-info { color: var(--navy-800); } .cflash-info::before { content: "ℹ"; }

/* --- Toolbar (page action row) -------------------------------------------- */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.toolbar .spacer { flex: 1; }
.searchbox {
  display: flex; align-items: center; gap: 9px; background: var(--stone);
  box-shadow: var(--inset); border-radius: 999px; padding: 10px 16px;
  min-width: 220px; color: var(--muted);
}
.searchbox input { border: none; background: transparent; outline: none; font-family: var(--ui); font-size: 13.5px; color: var(--ink); flex: 1; min-width: 0; }

/* --- Stat cards row ------------------------------------------------------- */
.crm-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.crm-stats.five { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1100px) { .crm-stats, .crm-stats.five { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .crm-stats, .crm-stats.five { grid-template-columns: 1fr; } }
.dstat.link { cursor: pointer; transition: transform .16s, box-shadow .16s; display: block; }
.dstat.link:hover { transform: translateY(-3px); box-shadow: var(--raise); }

/* --- Two-column detail layout --------------------------------------------- */
.crm-2col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 900px) { .crm-2col { grid-template-columns: 1fr; } }

/* --- Key/value list (detail panels) --------------------------------------- */
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; }
.kv dt { font-size: 12.5px; color: var(--muted); padding: 7px 0; }
.kv dd { font-size: 13.5px; color: var(--navy-900); font-weight: 500; padding: 7px 0; border-bottom: 1px solid var(--line); }
.kv dt { border-bottom: 1px solid var(--line); }
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: none; }

/* --- Panels & section titles ---------------------------------------------- */
.panel + .panel { margin-top: 22px; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.panel-h h3 { font-family: var(--disp); font-weight: 700; font-size: 20px; color: var(--navy-900); }
.panel-h .sub { font-size: 12.5px; color: var(--muted); }

/* --- Forms ---------------------------------------------------------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid.three { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 680px) { .form-grid, .form-grid.three { grid-template-columns: 1fr; } }
.fset { margin-bottom: 18px; }
.fset-legend { font-family: var(--disp); font-weight: 700; font-size: 17px; color: var(--navy-900); margin: 6px 0 14px; padding-bottom: 8px; border-bottom: 1px dotted var(--line); }
.form-actions { display: flex; gap: 12px; align-items: center; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }

/* --- Empty state ---------------------------------------------------------- */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .e-ic { width: 56px; height: 56px; border-radius: 16px; background: var(--stone); box-shadow: var(--raise-sm); display: flex; align-items: center; justify-content: center; color: var(--saf); margin: 0 auto 16px; }
.empty h3 { font-family: var(--disp); font-weight: 700; font-size: 22px; color: var(--navy-900); margin-bottom: 6px; }
.empty p { font-size: 14px; max-width: 38ch; margin: 0 auto 18px; }

/* --- Misc utilities ------------------------------------------------------- */
.muted { color: var(--muted); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.tline { display: flex; align-items: center; gap: 10px; }
.tline .av { width: 34px; height: 34px; border-radius: 9px; background: var(--g-band); color: var(--gold-2); display: flex; align-items: center; justify-content: center; font-family: var(--disp); font-weight: 700; font-size: 13px; flex-shrink: 0; }
.tline b { color: var(--navy-900); font-weight: 600; font-size: 13.5px; }
.tline span.sub { color: var(--muted); font-size: 12px; display: block; }
.crumb-back { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--saf); margin-bottom: 14px; }
.ltv-badge { font-family: var(--disp); font-weight: 700; font-size: 30px; color: var(--navy-900); }
.req { color: var(--saf); }

/* select sizing parity with .field */
select.field[multiple] { min-height: 120px; }

/* ===========================================================================
   Refinements (warmer fields, compact picker, neumorphic dropdown)
   =========================================================================== */

/* --- Warmer parchment fields (was reading too white) ---------------------- */
.field, textarea.field, select.field, .neusel-trig {
  background: #E8E1D2;
}
.field:focus, textarea.field:focus, select.field:focus {
  background: #ECE6D9;
}
/* Kill the blue/white browser autofill wash; keep parchment + dark ink. */
input.field:-webkit-autofill,
input.field:-webkit-autofill:hover,
input.field:-webkit-autofill:focus,
textarea.field:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px #E8E1D2 inset;
  caret-color: var(--ink);
  transition: background-color 9999s ease-in-out 0s;
}
.field::placeholder { color: #A6997F; }

/* --- Compact neumorphic date/time picker (ampicker) ----------------------- */
.amdp-pop { width: 268px !important; max-width: calc(100vw - 28px) !important; padding: 14px 14px 10px !important; border-radius: 18px !important; }
.amdp-head { margin-bottom: 10px !important; padding-bottom: 10px !important; }
.amdp-nav { width: 32px !important; height: 32px !important; }
.amdp-title { font-size: 15px !important; padding: 8px 10px !important; }
.amdp-dow span { font-size: 10px !important; padding: 3px 0 !important; }
.amdp-grid, .amdp-dow { grid-template-columns: repeat(7, 1fr) !important; gap: 2px !important; }
.amdp-day { font-size: 12.5px !important; min-width: 0 !important; aspect-ratio: 1 / 1 !important; }
.amdp-dow span { min-width: 0 !important; }
.amdp-mg { gap: 7px 6px !important; }
.amdp-mo { padding: 10px 4px !important; font-size: 13px !important; }
.amdp-foot { margin-top: 10px !important; padding-top: 10px !important; }
.amdp-pop.time { width: 244px !important; }
.amdp-num { width: 44px !important; height: 42px !important; font-size: 22px !important; }
.amdp-colon { font-size: 20px !important; padding-top: 30px !important; }

/* --- Neumorphic <select> replacement (neuselect.js) ----------------------- */
.neusel { position: relative; margin-bottom: 14px; }
.neusel .field { margin-bottom: 0; }
.neusel-trig { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; }
.neusel-trig .ns-val { color: var(--ink); font-weight: 500; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.neusel-trig .ns-ic { color: var(--gold); flex-shrink: 0; }
.neusel-pop {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 130;
  background: linear-gradient(145deg, #F1ECE1, #E7E0D2); border-radius: 16px;
  box-shadow: 10px 12px 30px rgba(40,28,8,.18), -8px -8px 22px rgba(255,255,255,.85);
  padding: 8px; display: none; max-height: 260px; overflow-y: auto;
}
.neusel-pop.on { display: block; animation: amdpIn .18s ease; }
.neusel-opt { padding: 11px 14px; border-radius: 10px; font-size: 14px; color: var(--navy-800); cursor: pointer; transition: .13s; }
.neusel-opt:hover { color: var(--saf); box-shadow: 3px 3px 7px rgba(40,28,8,.12), -3px -3px 7px rgba(255,255,255,.85); }
.neusel-opt.sel { color: var(--saf); font-weight: 600; }

/* --- Consultation time as available-slot boxes ---------------------------- */
.slotbox { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.slot {
  border: none; border-radius: 12px; background: #E8E1D2; box-shadow: var(--raise-sm);
  padding: 11px 6px; font-family: var(--ui); font-size: 13px; font-weight: 600; color: var(--ink-2);
  cursor: pointer; transition: .14s; text-align: center;
}
.slot:hover { transform: translateY(-1px); color: var(--saf); }
.slot.on { box-shadow: var(--inset); color: var(--saf); background: var(--stone-2); }
.slot.taken { opacity: .4; text-decoration: line-through; cursor: not-allowed; box-shadow: var(--inset-sm); }
.slot-empty { grid-column: 1 / -1; font-size: 13px; color: var(--muted); padding: 8px 2px; }

/* Sankalpa intake form: place-search dropdown hover */
#pobDrop .place-opt:hover { background: var(--stone); color: var(--saf); }

/* Devanagari text rendering for Sankalpa output */
textarea#sankalpaText {
  background: var(--stone-2);
  box-shadow: var(--inset);
  font-feature-settings: "kern" 1;
}

/* admin availability slot states */
.slot.s-open    { color: var(--status-success); }
.slot.s-blocked { color: var(--status-danger); background: #EFE6DE; box-shadow: var(--inset-sm); }
.slot.s-booked  { color: var(--navy-700); opacity: .7; cursor: not-allowed; box-shadow: var(--inset-sm); }
.slot.s-past    { opacity: .4; cursor: not-allowed; }

/* Multi-select selection state on availability page */
.slot.selectable { user-select: none; cursor: pointer; position: relative; }
.slot.sel {
  box-shadow: var(--raise-card), inset 0 0 0 2px var(--saf) !important;
  transform: translateY(-2px);
  background: linear-gradient(145deg, #F4EFE5, #E7E0D2) !important;
  color: var(--saf) !important;
}
.slot.sel::after {
  content: "✓";
  position: absolute;
  top: 4px; right: 6px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--saf);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(180,98,12,.4);
}

/* Sticky bulk-action bar */
.bulk-bar {
  display: none;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  position: sticky; bottom: 14px; z-index: 20;
  margin-top: 18px;
  padding: 12px 16px;
  background: var(--navy-900);
  color: var(--cream);
  border-radius: 999px;
  box-shadow: 0 16px 36px rgba(5,7,16,.45), inset 0 0 0 1px rgba(230,201,100,.25);
}
.bulk-bar.on { display: flex; }
.bulk-bar .bulk-count { font-size: 13.5px; color: var(--cream); }
.bulk-bar .bulk-count strong {
  font-family: var(--disp); font-size: 17px; color: var(--gold-2);
  padding: 2px 9px; border-radius: 999px; background: rgba(230,201,100,.12); margin-right: 4px;
}
.bulk-bar .muted { color: var(--cream-mute); font-size: 12.5px; }
.bulk-bar .btn-ghost {
  background: rgba(255,255,255,.06);
  color: var(--cream);
  box-shadow: inset 0 0 0 1px rgba(230,201,100,.25);
}
.bulk-bar .btn-ghost:hover {
  background: rgba(255,255,255,.12);
  transform: translateY(-1px);
}
.bulk-bar .spacer { flex: 1; }
.slot small { display: block; font-size: 9.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; margin-top: 3px; opacity: .85; }
.slotbox form { display: contents; }
.slot-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-bottom: 16px; }
.slot-legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
