/*! Design system adapted from Fernly (145-fernly) © 2026 Hasib (OVERSHOOT). All rights reserved. Licensed to info@bookappointments.ai (order INS-97732DC2), not sold. Used under license inside the Fidelia portal. */
/* =========================================================================
   FIDELIA PORTAL — portal.css
   Fernly's bento language in Fidelia's colours. The SPA in index.html writes
   the markup; every visual decision lives here.
   ========================================================================= */

:root {
  --page:  #e9ece9;
  --panel: #f4f7f5;
  --card:  #fdfdfc;
  --hair:  #e2e8e4;

  --ink:   #0C1A16;
  --muted: #5e6b65;
  --faint: #6a7670;

  /* Fidelia greens, darkest to lightest (coal > emerald > mint). */
  --g-950: #0A231D;
  --g-800: #0B4F3C;
  --g-700: #0B8E68;
  --g-600: #0E9A72;
  --g-400: #27D6A0;
  --g-100: #E2F5EE;
  --hatch: #8d9a92;
  --deep:  color-mix(in srgb, var(--g-950) 70%, #000);
  --swirl: color-mix(in srgb, var(--g-400) 20%, transparent);

  --amber: #a8650a; --amber-bg: #fdf3e2;
  --rose:  #c23b3b; --rose-bg:  #fdeceb;
  --sky:   #2f66c9; --sky-bg:   #e8effc;

  /* legacy aliases still referenced by inline styles in index.html */
  --emerald: var(--g-700); --emerald-d: var(--g-800); --mint: var(--g-400);
  --coal: var(--g-950); --charcoal: #16251F; --slate: var(--muted);
  --line: var(--hair); --paper: var(--panel); --paper2: #edf2ef;
  --bad: var(--rose); --ok: var(--g-700);

  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r-lg: 26px;
  --r-md: 20px;
  --gap: 16px;
  --shadow: 0 1px 2px rgb(10 35 29 / .04), 0 8px 24px -12px rgb(10 35 29 / .12);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --focus: 0 0 0 3px var(--card), 0 0 0 5px var(--g-600);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden], .hidden { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100dvh;
  background: var(--page); color: var(--ink);
  font: 400 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: var(--g-700); text-decoration: none; }
img { max-width: 100%; }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:where(a, button, input, select, textarea, [tabindex]):focus-visible { outline: none; box-shadow: var(--focus); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--muted); font-size: 13px; }
.err { color: var(--rose); }
.ok { color: var(--g-700); }
.sp { flex: 1; }
#nl-badge-frame, #nl-hud-frame, #nl-card, #nl-mini, #nl-pop, #nl-badge { display: none !important; }

/* =========================================================================
   Buttons + form controls
   ========================================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; border-radius: 999px;
  font-size: 15px; font-weight: 600; white-space: nowrap; text-decoration: none;
  color: var(--ink); background: var(--card);
  box-shadow: inset 0 0 0 1.5px var(--hair);
  transition: background-color .2s, box-shadow .2s, color .2s, transform .2s var(--ease);
}
.btn:hover { background: var(--g-100); }
.btn:active { transform: scale(.98); }
.btn svg.i { width: 19px; height: 19px; }
.btn.pri { color: #f2f8f4; background: linear-gradient(180deg, var(--g-700), var(--g-950)); box-shadow: none; }
.btn.pri:hover { background: linear-gradient(180deg, var(--g-600), var(--g-800)); }
.btn.ghost { background: var(--card); box-shadow: inset 0 0 0 1.5px var(--g-950); }
.btn.ghost:hover { background: var(--g-100); }
.btn.danger { color: var(--rose); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--rose) 40%, transparent); }
.btn.danger:hover { background: var(--rose-bg); }
.btn.sm { height: 36px; padding: 0 14px; font-size: 13.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

input, select, textarea {
  width: 100%; min-height: 46px; padding: 11px 14px;
  border: 1.5px solid var(--hair); border-radius: 12px;
  background: var(--panel); color: var(--ink); font-size: 15px;
  outline: none; transition: border-color .2s, box-shadow .2s, background-color .2s;
}
textarea { resize: vertical; line-height: 1.5; }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; accent-color: var(--g-700); }
input[type="file"] { padding: 9px 12px; }
select {
  appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235e6b65' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
}
input:focus, select:focus, textarea:focus { border-color: var(--g-600); background: var(--card); box-shadow: 0 0 0 3px color-mix(in srgb, var(--g-600) 18%, transparent); }
label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.field { margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

/* =========================================================================
   Login
   ========================================================================= */
.login {
  min-height: 100dvh; display: grid; place-items: center; padding: 16px;
}
.login__box {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 14px;
  width: min(940px, 100%); padding: 14px;
  background: var(--panel); border-radius: 30px;
  animation: rise .7s var(--ease) both;
}
.login__art {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 460px; padding: 30px; border-radius: 22px;
  color: #eef6f1; background: var(--deep);
}
.login__art::before {
  content: ''; position: absolute; inset: -40%; z-index: -1;
  background:
    repeating-radial-gradient(circle at 80% 78%, transparent 0 14px, var(--swirl) 15px 16px),
    radial-gradient(70% 60% at 85% 85%, var(--g-700), transparent 70%),
    radial-gradient(60% 50% at 10% 0%, var(--g-950), transparent 70%);
}
.login__art img { height: 30px; width: auto; align-self: flex-start; }
.login__art h2 { font-size: clamp(28px, 3vw, 38px); font-weight: 600; line-height: 1.08; letter-spacing: -.035em; max-width: 11em; }
.login__art p { margin-top: 10px; font-size: 14px; color: #b9d4c8; max-width: 30em; }
.login__form { display: flex; flex-direction: column; justify-content: center; padding: 34px 30px; background: var(--card); border-radius: 22px; }
.login__form h1 { font-size: 30px; font-weight: 600; letter-spacing: -.035em; }
.login__form .sub { margin: 6px 0 24px; color: var(--muted); font-size: 14.5px; }
.login__form .btn { width: 100%; height: 52px; }
.login__msg { margin-top: 14px; min-height: 20px; text-align: center; font-size: 13.5px; color: var(--muted); }

/* =========================================================================
   Frame
   ========================================================================= */
.app {
  display: grid; grid-template-columns: 252px minmax(0, 1fr); gap: 14px;
  padding: 14px; min-height: 100dvh; max-width: 1680px; margin: 0 auto;
}
.shell { display: grid; grid-template-rows: auto 1fr; gap: 14px; min-width: 0; }

.sidebar {
  position: sticky; top: 14px; height: calc(100dvh - 28px);
  display: flex; flex-direction: column;
  padding: 26px 0 18px; background: var(--panel); border-radius: var(--r-lg);
  overflow-y: auto; overscroll-behavior: contain;
}
.sidebar__top { display: flex; align-items: center; justify-content: space-between; padding: 0 20px 0 28px; }
.brand img { display: block; height: 30px; width: auto; }
.icon-btn.sidebar__close { display: none; }
.nav { margin-top: 32px; }
.nav + .nav { margin-top: 26px; }
.nav__label { padding: 0 28px 10px; font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.nav__link {
  position: relative; display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 11px 28px; text-align: left;
  font-size: 15.5px; color: var(--muted); transition: color .2s;
}
.nav__link svg.i { width: 22px; height: 22px; transition: color .2s; }
.nav__link:hover { color: var(--ink); }
.nav__link[aria-current="page"] { color: var(--ink); font-weight: 600; }
.nav__link[aria-current="page"] svg.i { color: var(--g-700); }
.nav__link[aria-current="page"]::before {
  content: ''; position: absolute; left: 0; top: 50%; translate: 0 -50%;
  width: 5px; height: 36px; border-radius: 0 6px 6px 0; background: var(--g-700);
  animation: rail .4s var(--ease);
}
.nav__link:focus-visible { box-shadow: inset 0 0 0 2px var(--g-600); }
.nav__badge { margin-left: auto; padding: 2px 7px; border-radius: 6px; font-size: 10.5px; font-weight: 600; color: #f0f7f2; background: var(--g-950); }

.promo {
  position: relative; isolation: isolate; overflow: hidden;
  margin: auto 18px 0; padding: 18px 16px 16px;
  border-radius: var(--r-md); color: #eef6f1; background: var(--deep);
}
.promo::before {
  content: ''; position: absolute; inset: -40%; z-index: -1;
  background:
    repeating-radial-gradient(circle at 78% 70%, transparent 0 14px, var(--swirl) 15px 16px),
    radial-gradient(70% 60% at 85% 85%, var(--g-700), transparent 70%),
    radial-gradient(60% 50% at 10% 0%, var(--g-950), transparent 70%);
}
.promo__icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #eef6f1; color: var(--g-950); }
.promo__icon svg.i { width: 15px; height: 15px; }
.promo__title { margin-top: 12px; font-size: 19px; line-height: 1.15; letter-spacing: -.02em; max-width: 9em; }
.promo__sub { margin-top: 6px; font-size: 12px; color: #b9d4c8; }
.promo__btn { display: block; width: 100%; margin-top: 22px; padding: 10px; border-radius: 999px; text-align: center; font-size: 13.5px; font-weight: 600; color: inherit; background: var(--g-700); transition: background .2s; }
.promo__btn:hover { background: var(--g-600); }

.topbar { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: var(--panel); border-radius: var(--r-lg); }
.icon-btn.topbar__menu { display: none; }
.search { position: relative; flex: 0 1 400px; }
.search input { height: 50px; padding: 0 64px 0 50px; border: 0; border-radius: 999px; background: var(--card); }
.search input:focus { box-shadow: var(--focus); }
.search input::-webkit-search-cancel-button { display: none; }
.search__icon { position: absolute; left: 18px; top: 50%; translate: 0 -50%; width: 22px; height: 22px; color: var(--ink); pointer-events: none; }
.search__kbd { position: absolute; right: 12px; top: 50%; translate: 0 -50%; padding: 3px 8px; border-radius: 7px; font: 500 12px var(--font); background: var(--panel); pointer-events: none; }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: var(--ink); }
.icon-btn svg.i { width: 22px; height: 22px; }
.icon-btn--round { width: 52px; height: 52px; border-radius: 50%; background: var(--card); transition: transform .25s var(--ease); }
.icon-btn--round:hover { transform: translateY(-2px); }
.profile { position: relative; display: flex; align-items: center; gap: 12px; padding: 2px 6px 2px 2px; border-radius: 999px; text-align: left; }
.profile__text { display: grid; }
.profile__name { font-size: 15.5px; font-weight: 600; }
.profile__mail { font-size: 13px; color: var(--muted); text-transform: capitalize; }

.avatar {
  display: grid; place-items: center; flex: none;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--av, var(--g-100)); color: rgb(10 35 29 / .8);
  font-size: 13.5px; font-weight: 600; letter-spacing: .02em;
}
.avatar--lg { width: 52px; height: 52px; font-size: 16px; }
.avatar--sm { width: 30px; height: 30px; font-size: 10.5px; }

.menu {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 50;
  min-width: 200px; padding: 6px; border-radius: 14px; background: var(--card);
  box-shadow: 0 0 0 1px var(--hair), 0 18px 40px -12px rgb(10 35 29 / .35);
  animation: pop .25s var(--ease);
}
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 9px; font-size: 14px; text-align: left; color: var(--ink); }
.menu button:hover { background: var(--g-100); }

/* =========================================================================
   Board (content area) + page head
   ========================================================================= */
.board { min-width: 0; padding: 28px 22px 26px; background: var(--panel); border-radius: var(--r-lg); }
.page-h { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 20px; margin-bottom: 24px; }
.page-h h2 { font-size: clamp(30px, 3vw, 40px); font-weight: 600; letter-spacing: -.035em; line-height: 1.1; }
.page-h .page-sub { display: block; margin-top: 8px; font-size: 15px; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.page-h > .muted { font-size: 14px; }
.view-in > * { animation: rise .55s var(--ease) both; }
.view-in > *:nth-child(2) { animation-delay: .05s; }
.view-in > *:nth-child(3) { animation-delay: .1s; }
.view-in > *:nth-child(4) { animation-delay: .15s; }

.card { position: relative; min-width: 0; padding: 22px; background: var(--card); border-radius: var(--r-md); box-shadow: var(--shadow); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card__title { font-size: 19px; font-weight: 500; letter-spacing: -.02em; white-space: nowrap; }
.card__sub { margin-top: 4px; font-size: 13px; color: var(--muted); }
.link-btn { font-size: 13.5px; font-weight: 600; color: var(--g-700); border-radius: 6px; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

/* =========================================================================
   Dashboard bento
   ========================================================================= */
.grid {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-areas:
    "s1 s1 s1 s2 s2 s2 s3 s3 s3 s4 s4 s4"
    "an an an an an an re re re sd sd sd"
    "tm tm tm tm tm pg pg pg pg sd sd sd";
}
.grid > * { animation: rise .6s var(--ease) both; }
.grid > *:nth-child(2) { animation-delay: .04s; } .grid > *:nth-child(3) { animation-delay: .08s; }
.grid > *:nth-child(4) { animation-delay: .12s; } .grid > *:nth-child(5) { animation-delay: .16s; }
.grid > *:nth-child(6) { animation-delay: .2s; }  .grid > *:nth-child(7) { animation-delay: .24s; }
.grid > *:nth-child(8) { animation-delay: .28s; }
.side { grid-area: sd; display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.side .plist-card { flex: 1; }

.stat { display: flex; flex-direction: column; min-height: 178px; }
.stat__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.stat__title { font-size: 17px; font-weight: 500; letter-spacing: -.015em; }
.arrow { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 50%; color: inherit; box-shadow: inset 0 0 0 1.5px currentColor; transition: transform .3s var(--ease), background .2s, color .2s; }
.arrow svg.i { width: 18px; height: 18px; }
.arrow:hover { transform: rotate(45deg); background: var(--ink); color: var(--card); }
.stat__num { margin: auto 0 10px; padding-top: 18px; font-size: clamp(34px, 3.4vw, 50px); font-weight: 600; letter-spacing: -.04em; line-height: 1; white-space: nowrap; }
.stat__note { font-size: 13.5px; color: var(--muted); }
.stat__note b { font-weight: 600; color: var(--ink); }
.stat--hero { color: #f1f8f3; background: linear-gradient(135deg, var(--g-800) 0%, var(--g-950) 100%); box-shadow: 0 14px 30px -16px rgb(10 35 29 / .7); }
.stat--hero::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(90% 80% at 100% 100%, rgb(39 214 160 / .26), transparent 60%); }
.stat--hero .arrow { background: #f1f8f3; color: var(--g-950); box-shadow: none; }
.stat--hero .arrow:hover { background: var(--g-400); }
.stat--hero .stat__note, .stat--hero .stat__note b { color: #b9e6d3; }

.analytics { grid-area: an; display: flex; flex-direction: column; }
.sbars { flex: 1; display: grid; grid-template-columns: repeat(var(--n, 7), minmax(0, 1fr)); gap: clamp(6px, 1.1vw, 14px); min-height: 200px; margin-top: 22px; }
.sbars li { display: grid; grid-template-rows: auto 1fr auto; gap: 8px; min-width: 0; }
.sbar__n { text-align: center; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.sbar { position: relative; align-self: end; width: 100%; height: calc(var(--h) * 100%); min-height: 34px; border-radius: 999px; overflow: hidden; transform-origin: 50% 100%; animation: grow .9s var(--ease) both; animation-delay: calc(var(--i) * 60ms + .2s); }
.sbar__fill { position: absolute; inset: 0; border-radius: inherit; background: var(--g-700); }
.sbar--light .sbar__fill { background: var(--g-400); }
.sbar--dark .sbar__fill { background: var(--g-950); }
.sbar--plan .sbar__fill { background: repeating-linear-gradient(-45deg, var(--hatch) 0 2.4px, transparent 2.4px 8px); box-shadow: inset 0 0 0 1.5px rgb(141 154 146 / .35); }
.sbar:hover .sbar__fill { filter: brightness(1.08); }
.sbar__lbl { text-align: center; font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.reminder { grid-area: re; display: flex; flex-direction: column; }
.reminder__what { margin-top: 24px; font-size: clamp(20px, 1.8vw, 24px); font-weight: 600; line-height: 1.15; letter-spacing: -.025em; color: var(--g-800); }
.reminder__when { margin: 10px 0 20px; font-size: 14.5px; color: var(--muted); }
.reminder .btn { margin-top: auto; width: 100%; height: 50px; }

.plist { display: grid; gap: 14px; margin-top: 18px; max-height: 300px; overflow-y: auto; scrollbar-width: thin; }
.pitem { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border-radius: 12px; }
.pitem:hover .pitem__name { color: var(--g-700); }
.pitem__name { display: block; font-size: 15px; font-weight: 500; line-height: 1.3; transition: color .2s; }
.pitem__due { display: block; font-size: 12px; color: var(--faint); }
.pitem .avatar { width: 34px; height: 34px; font-size: 11.5px; }

.tracker { overflow: hidden; isolation: isolate; min-height: 200px; display: flex; flex-direction: column; color: #f1f8f3; background: var(--deep); }
.tracker::before {
  content: ''; position: absolute; inset: -30%; z-index: -1;
  background:
    repeating-radial-gradient(ellipse at 95% 105%, transparent 0 11px, var(--swirl) 12px 13px),
    radial-gradient(60% 70% at 100% 100%, var(--g-700), transparent 70%),
    radial-gradient(55% 55% at 0% 0%, var(--g-950), transparent 70%);
}
.tracker__time { margin: auto 0 0; padding-top: 12px; text-align: center; font-size: clamp(36px, 3.2vw, 46px); font-weight: 600; letter-spacing: -.02em; }
.tracker__sub { text-align: center; font-size: 13px; color: #b9d4c8; }
.tracker__ctrl { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }
.tbtn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--g-950); background: #f1f8f3; transition: transform .25s var(--ease); }
.tbtn:hover { transform: scale(1.04); }
.tbtn svg.i { width: 18px; height: 18px; }

.team-card { grid-area: tm; }
.tlist { display: grid; gap: 14px; margin-top: 20px; }
.titem { display: flex; align-items: center; gap: 14px; }
.titem__body { flex: 1; min-width: 0; display: grid; }
.titem__name { font-size: 15px; font-weight: 500; }
.titem__task { font-size: 12.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.titem__task b { font-weight: 600; color: var(--ink); }
.meter { height: 6px; border-radius: 99px; background: var(--panel); overflow: hidden; }
.meter__fill { height: 100%; border-radius: inherit; background: var(--g-600); transform-origin: 0 50%; animation: growx .9s var(--ease) both .3s; }

.progress { grid-area: pg; display: flex; flex-direction: column; }
.gauge { position: relative; flex: 1; display: grid; place-items: end center; margin: 16px auto 0; width: min(100%, 290px); }
.gauge svg { width: 100%; height: auto; overflow: visible; }
.gauge__track, .gauge__seg { stroke-width: 40; stroke-linecap: round; fill: none; }
.gauge__track { stroke: var(--panel); }
.gauge__seg--done { stroke: var(--g-700); }
.gauge__seg--prog { stroke: var(--g-950); }
.gauge__seg--pend { stroke: url(#hatch); }
.gauge__read { position: absolute; left: 0; right: 0; bottom: 0; display: grid; justify-items: center; }
.gauge__pct { font-size: clamp(38px, 3.6vw, 52px); font-weight: 600; letter-spacing: -.05em; line-height: 1; }
.gauge__lbl { margin-top: 4px; font-size: 13.5px; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; margin-top: 20px; font-size: 13.5px; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.sw { width: 14px; height: 14px; border-radius: 50%; }
.sw--done { background: var(--g-700); } .sw--prog { background: var(--g-950); }
.sw--pend { background: repeating-linear-gradient(-45deg, var(--hatch) 0 2px, transparent 2px 5px); box-shadow: inset 0 0 0 1px rgb(141 154 146 / .4); }

/* =========================================================================
   Chips, pills, tags
   ========================================================================= */
.chip { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--panel); text-transform: capitalize; }
.chip.lead { color: var(--sky); background: var(--sky-bg); }
.chip.client { color: var(--g-800); background: var(--g-100); }
.pill { display: inline-flex; padding: 2px 9px; border-radius: 7px; font-size: 12px; font-weight: 600; text-transform: capitalize; color: var(--ink); background: var(--panel); box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 30%, transparent); }

/* =========================================================================
   Toolbar + tables
   ========================================================================= */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; padding: 8px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); }
.toolbar input, .toolbar select { width: auto; min-height: 42px; border: 0; border-radius: 999px; background: var(--panel); }
.toolbar .grow { flex: 1; min-width: 200px; padding-left: 18px; }
.toolbar label { display: inline-flex; align-items: center; gap: 8px; margin: 0 12px 0 4px; font-size: 14px; color: var(--ink); }

.tbl { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border-radius: var(--r-md); box-shadow: var(--shadow); overflow: hidden; }
.tbl th { padding: 14px 18px; text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); border-bottom: 1px solid var(--hair); }
.tbl td { padding: 14px 18px; font-size: 14.5px; vertical-align: middle; border-bottom: 1px solid var(--hair); }
.tbl td b { font-weight: 600; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: color-mix(in srgb, var(--g-100) 55%, transparent); }
.tbl td .btn.sm { margin: 2px 0; }
.tblwrap { overflow-x: auto; border-radius: var(--r-md); }

/* =========================================================================
   Pipeline kanban (Fernly columns + task cards)
   ========================================================================= */
.kb { display: flex; gap: var(--gap); overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x proximity; align-items: flex-start; }
.kcol {
  flex: 0 0 280px; display: flex; flex-direction: column; min-height: 420px; padding: 14px;
  border-radius: var(--r-md); background: rgb(253 253 252 / .55); box-shadow: inset 0 0 0 1px var(--hair);
  scroll-snap-align: start; transition: background-color .2s, box-shadow .2s;
}
.kcol.drop { background: var(--g-100); box-shadow: inset 0 0 0 2px var(--g-400); }
.kcol .kh { padding: 4px 4px 12px; }
.kcol .khtop { display: flex; align-items: center; gap: 10px; }
.kcol .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--sc, #94a3b8); flex: none; }
.kcol .ttl { font-size: 15px; font-weight: 600; }
.kcol .cnt { margin-left: auto; min-width: 28px; padding: 2px 8px; border-radius: 999px; text-align: center; font-size: 12.5px; font-weight: 600; background: var(--card); box-shadow: inset 0 0 0 1px var(--hair); }
.kcol .val { margin: 6px 0 0 20px; font-size: 13px; font-weight: 600; color: var(--g-700); }
.kcol .kbody { flex: 1; display: grid; align-content: start; gap: 12px; min-height: 60px; }
.kcol .empty { padding: 22px 10px; border-radius: 14px; text-align: center; font-size: 13px; color: var(--faint); box-shadow: inset 0 0 0 1.5px var(--hair); }
.kcard { position: relative; padding: 14px 14px 12px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); cursor: grab; user-select: none; transition: transform .2s var(--ease), box-shadow .2s; }
.kcard:hover { transform: translateY(-2px); box-shadow: 0 1px 2px rgb(10 35 29 / .05), 0 14px 28px -14px rgb(10 35 29 / .25); }
.kcard:active { cursor: grabbing; }
.kcard.dragging { opacity: .35; }
.kcard .row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kcard .nm { margin: 10px 0 2px; font-size: 15px; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; }
.kcard .meta { font-size: 12.5px; color: var(--muted); }
.kcard .meter { margin: 12px 0 0; }
.kcard .meter__fill { background: var(--sc, var(--g-600)); animation: none; }
.kcard .foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.kcard .amt { font-size: 14px; font-weight: 600; color: var(--ink); }
.kcard .amt small { font-weight: 500; color: var(--faint); font-size: 11.5px; }
.kcard .foot .avatar { margin-left: auto; }

/* =========================================================================
   Agenda
   ========================================================================= */
.agday { margin-bottom: 24px; }
.agdate { margin: 0 0 12px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--g-700); }
.agrow { display: flex; gap: 16px; align-items: center; margin-bottom: 10px; padding: 14px 16px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); border-left: 0 !important; }
.agtime { display: grid; place-items: center; flex: none; width: 64px; height: 52px; border-radius: 14px; font-size: 16px; font-weight: 600; color: var(--g-800); background: var(--g-100); }
.agmain { flex: 1; min-width: 0; }
.agttl { font-size: 15px; font-weight: 600; }
.agmeta { margin-top: 2px; font-size: 13px; color: var(--muted); }
.agmeta::first-letter { text-transform: uppercase; }
.agacts { display: flex; gap: 6px; }
.agacts button { height: 34px; padding: 0 13px; border-radius: 999px; font-size: 13px; font-weight: 600; box-shadow: inset 0 0 0 1.5px var(--hair); transition: background .2s; }
.agacts button:hover { background: var(--g-100); }
.board > .empty, #agwrap > .empty { padding: 40px; border-radius: var(--r-md); text-align: center; color: var(--faint); background: var(--card); box-shadow: var(--shadow); }

/* =========================================================================
   Notes + training cards
   ========================================================================= */
.note { margin-bottom: 8px; padding: 11px 13px; border-radius: 12px; font-size: 14px; background: var(--panel); }
.note .who { margin-bottom: 2px; font-size: 11.5px; color: var(--faint); }
.matcard { border: 0 !important; border-radius: var(--r-md) !important; background: var(--card) !important; box-shadow: var(--shadow); padding: 18px !important; transition: transform .2s var(--ease), box-shadow .2s; }
.matcard:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -14px rgb(10 35 29 / .25); }
.matcard > div:first-child > div:first-child { background: var(--g-100) !important; border-radius: 12px !important; }
.matcard .btn { height: 36px; padding: 0 14px; font-size: 13.5px; }

/* =========================================================================
   Drawer (Fernly side panel) + modals (Fernly dialog)
   ========================================================================= */
.scrim { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: flex-end; padding: 12px; background: rgb(10 24 19 / .34); backdrop-filter: blur(2px); animation: fade .25s ease both; }
.drawer { display: flex; flex-direction: column; width: min(480px, 100%); height: 100%; overflow-y: auto; overscroll-behavior: contain; border-radius: 26px; background: var(--card); box-shadow: -30px 0 80px -30px rgb(10 35 29 / .45); animation: slidein .45s var(--ease) both; }
.modal-center { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgb(10 24 19 / .4); backdrop-filter: blur(3px); animation: fade .25s ease both; }
.mcard { width: min(560px, 100%); max-height: 90vh; overflow: auto; border-radius: 22px; background: var(--card); box-shadow: 0 30px 80px -20px rgb(10 35 29 / .45); animation: dlgin .35s var(--ease) both; }
.dh { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 22px 24px 14px; background: var(--card); }
.dh h3 { font-size: 22px; font-weight: 600; letter-spacing: -.03em; }
.dh .x { margin-left: auto; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; font-size: 20px; line-height: 1; color: var(--ink); background: var(--panel); transition: background .2s; }
.dh .x:hover { background: var(--g-100); }
.db { padding: 6px 24px 24px; }
.modal-center label { margin: 12px 0 0; }
.modal-center label input, .modal-center label select, .modal-center label textarea { margin-top: 6px; }
.drawer h3 { font-weight: 600; }

/* loaders */
.center-load { padding: 70px 20px; text-align: center; color: var(--muted); }
.spin { display: inline-block; width: 24px; height: 24px; border: 3px solid color-mix(in srgb, var(--g-700) 25%, transparent); border-top-color: var(--g-700); border-radius: 50%; animation: sp .7s linear infinite; }
.skel { border-radius: var(--r-md); background: linear-gradient(90deg, var(--card) 0%, #f0f4f1 50%, var(--card) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }

/* =========================================================================
   Motion
   ========================================================================= */
@keyframes sp { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
@keyframes dlgin { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@keyframes slidein { from { transform: translateX(105%); } }
@keyframes grow { from { transform: scaleY(0); } }
@keyframes growx { from { transform: scaleX(0); } }
@keyframes rail { from { transform: scaleY(.2); opacity: 0; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 1360px) {
  .app { grid-template-columns: 224px minmax(0, 1fr); }
  .card { padding: 20px; }
  .stat__title { font-size: 16px; }
}
@media (max-width: 1180px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "s1 s2" "s3 s4" "an an" "re re" "tm tm" "pg pg" "sd sd"; }
  .side { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1024px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 70; width: min(290px, 84vw); height: 100dvh;
    border-radius: 0 var(--r-lg) var(--r-lg) 0; box-shadow: 20px 0 60px -20px rgb(10 35 29 / .35);
    transform: translateX(-105%); visibility: hidden;
    transition: transform .45s var(--ease), visibility 0s .45s;
  }
  .sidebar.is-open { transform: none; visibility: visible; transition: transform .45s var(--ease); }
  .icon-btn.sidebar__close, .icon-btn.topbar__menu { display: grid; }
  .nav-scrim { position: fixed; inset: 0; z-index: 65; background: rgb(10 24 19 / .35); }
}
@media (max-width: 720px) {
  .app { padding: 10px; gap: 10px; }
  .shell { gap: 10px; }
  .topbar { padding: 10px; gap: 8px; border-radius: 22px; }
  .search { flex: 1; }
  .search input { height: 44px; padding-right: 16px; }
  .search__kbd, .profile__text { display: none; }
  .icon-btn--round { width: 44px; height: 44px; }
  .avatar--lg { width: 44px; height: 44px; font-size: 14px; }
  .board { padding: 22px 12px 14px; border-radius: 22px; }
  .page-h > .btn, .page-h > button { flex: 1; }
  .grid { gap: 12px; grid-template-areas: "s1 s1" "s2 s3" "s4 s4" "an an" "re re" "tm tm" "pg pg" "sd sd"; }
  .side { grid-template-columns: 1fr; }
  .stat { min-height: 150px; padding: 16px; }
  .stat__num { font-size: 34px; }
  .sbars { gap: 5px; }
  .sbar__lbl { font-size: 10.5px; }
  .grid2 { grid-template-columns: 1fr; }
  .login__box { grid-template-columns: 1fr; }
  .login__art { min-height: 220px; }
  .toolbar { border-radius: 22px; }
  .toolbar .grow { min-width: 100%; }
  .scrim { padding: 0; }
  .drawer { border-radius: 0; }
  .tbl th, .tbl td { padding: 12px; }
}
