/* ═══════════════════════════════════════════════════════════════════════
   SoftClub HR Control — панели маъмурият
   Mobile-first. Бе ягон вобастагии беруна (фонт, CDN, китобхона).
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Токенҳо ─────────────────────────────────────────────────────────── */

:root {
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans",
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-full: 999px;

  --gap: 14px;
  --pad: 16px;

  --tab-h: 62px;
  --ease: cubic-bezier(.32, .72, 0, 1);

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* Торик — пешфарз */
:root, [data-theme="dark"] {
  --bg:        #0B0F17;
  --bg-soft:   #0F141E;
  --surface:   #151B26;
  --surface-2: #1D2533;
  --surface-3: #262F3F;
  --line:      rgba(255, 255, 255, .09);
  --line-2:    rgba(255, 255, 255, .14);

  --text:      #EEF2F8;
  --text-2:    #9FADC2;
  --text-3:    #6C7C93;

  --brand:     #5B94F8;
  --brand-2:   #7BA9FA;
  --brand-ink: #FFFFFF;
  --brand-soft: rgba(91, 148, 248, .16);

  --ok:      #34D399;  --ok-soft:     rgba(52, 211, 153, .15);
  --warn:    #FBBF24;  --warn-soft:   rgba(251, 191, 36, .15);
  --danger:  #F87171;  --danger-soft: rgba(248, 113, 113, .15);
  --info:    #38BDF8;  --info-soft:   rgba(56, 189, 248, .15);
  --violet:  #A78BFA;  --violet-soft: rgba(167, 139, 250, .15);

  --shadow:   0 1px 2px rgba(0, 0, 0, .5), 0 8px 24px rgba(0, 0, 0, .32);
  --shadow-s: 0 1px 2px rgba(0, 0, 0, .4);
  --grid:     rgba(255, 255, 255, .07);
}

[data-theme="light"] {
  --bg:        #F4F6FA;
  --bg-soft:   #EDF1F7;
  --surface:   #FFFFFF;
  --surface-2: #F3F6FA;
  --surface-3: #E8EDF5;
  --line:      rgba(15, 23, 42, .10);
  --line-2:    rgba(15, 23, 42, .18);

  --text:      #0E1726;
  --text-2:    #55637A;
  --text-3:    #8A97AC;

  --brand:     #2563EB;
  --brand-2:   #1D4ED8;
  --brand-ink: #FFFFFF;
  --brand-soft: rgba(37, 99, 235, .10);

  --ok:      #15803D;  --ok-soft:     rgba(21, 128, 61, .10);
  --warn:    #B45309;  --warn-soft:   rgba(180, 83, 9, .10);
  --danger:  #DC2626;  --danger-soft: rgba(220, 38, 38, .10);
  --info:    #0369A1;  --info-soft:   rgba(3, 105, 161, .10);
  --violet:  #6D28D9;  --violet-soft: rgba(109, 40, 217, .10);

  --shadow:   0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .07);
  --shadow-s: 0 1px 2px rgba(15, 23, 42, .07);
  --grid:     rgba(15, 23, 42, .08);
}


/* ── Асосҳо ──────────────────────────────────────────────────────────── */

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

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

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  min-height: 100vh;
  min-height: 100dvh;
}

[hidden] { display: none !important; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; -webkit-tap-highlight-color: transparent; }

svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9;
      stroke-linecap: round; stroke-linejoin: round; display: block; }

::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: var(--r-full); }
::-webkit-scrollbar-track { background: transparent; }

::selection { background: var(--brand-soft); }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }


/* ── Логотип ─────────────────────────────────────────────────────────── */

.logo {
  width: 58px; height: 58px;
  display: grid; place-items: center;
  border-radius: var(--r-md);
  background: linear-gradient(140deg, var(--brand), var(--violet));
  color: #fff;
  font-weight: 800; font-size: 21px; letter-spacing: .5px;
  box-shadow: 0 6px 20px rgba(91, 148, 248, .35);
  flex: none;
}
.logo--sm { width: 36px; height: 36px; border-radius: 11px; font-size: 14px;
            box-shadow: 0 3px 10px rgba(91, 148, 248, .3); }


/* ═══════════════ ВУРУД ═══════════════ */

.login {
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: calc(24px + var(--safe-t)) 20px calc(24px + var(--safe-b));
  background:
    radial-gradient(120% 80% at 50% -10%, var(--brand-soft), transparent 60%),
    var(--bg);
}

.login__box { width: 100%; max-width: 380px; animation: rise .5s var(--ease); }

.login__brand { text-align: center; margin-bottom: 26px; }
.login__brand .logo { margin: 0 auto 14px; }
.login__brand h1 { font-size: 24px; font-weight: 750; letter-spacing: -.4px; }
.login__brand p { color: var(--text-2); font-size: 14px; margin-top: 2px; }

.login__form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px 20px;
  box-shadow: var(--shadow);
  display: grid; gap: 16px;
}

.login__foot { text-align: center; color: var(--text-3); font-size: 12px; margin-top: 18px; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } }


/* ── Майдонҳо ────────────────────────────────────────────────────────── */

.field { display: grid; gap: 7px; }

.field__label {
  font-size: 11.5px; font-weight: 650; letter-spacing: .6px;
  text-transform: uppercase; color: var(--text-3);
}

.field input, .field select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  font-size: 16px;               /* < 16px → iOS zoom мекунад */
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
  outline: none;
  transition: border-color .18s, background .18s, box-shadow .18s;
  appearance: none; -webkit-appearance: none;
}

.field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%),
                    linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position: calc(100% - 19px) 21px, calc(100% - 13px) 21px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 38px;
}

.field input::placeholder { color: var(--text-3); }

.field input:focus, .field select:focus {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3.5px var(--brand-soft);
}

.field input[type="date"] { min-height: 48px; }
.field--sm input, .field--sm select { height: 42px; font-size: 15px; }
.field--sm select { background-position: calc(100% - 19px) 18px, calc(100% - 13px) 18px; }

.field__wrap { position: relative; display: block; }
.field__eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; display: grid; place-items: center;
  color: var(--text-3); border-radius: var(--r-xs);
}
.field__eye:hover { color: var(--text); background: var(--surface-3); }


/* ── Тугмаҳо ─────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 20px;
  font-size: 15px; font-weight: 650;
  border-radius: var(--r-sm);
  border: 1.5px solid transparent;
  transition: transform .12s var(--ease), filter .18s, background .18s, border-color .18s;
  white-space: nowrap;
}
.btn:active { transform: scale(.975); }
.btn:disabled { opacity: .55; pointer-events: none; }
.btn--block { width: 100%; }
.btn--sm { height: 38px; padding: 0 14px; font-size: 13.5px; border-radius: var(--r-xs); }

.btn--primary {
  background: var(--brand); color: var(--brand-ink);
  box-shadow: 0 4px 14px rgba(91, 148, 248, .3);
}
.btn--primary:hover { filter: brightness(1.08); }

.btn--ghost { background: var(--surface-2); border-color: var(--line); color: var(--text); }
.btn--ghost:hover { background: var(--surface-3); border-color: var(--line-2); }

.btn--ok     { background: var(--ok-soft);     color: var(--ok);     border-color: var(--ok); }
.btn--danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }

.linkbtn { color: var(--brand); font-size: 13.5px; font-weight: 650; padding: 4px; }

.iconbtn {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-2);
  transition: color .18s, background .18s, border-color .18s;
}
.iconbtn:hover { color: var(--text); background: var(--surface-3); }
.iconbtn:active { transform: scale(.94); }
.iconbtn--danger:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }

.ico-sun  { display: none; }
[data-theme="light"] .ico-sun  { display: block; }
[data-theme="light"] .ico-moon { display: none; }


/* ── Огоҳиномаҳо ─────────────────────────────────────────────────────── */

.alert {
  padding: 11px 13px; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 550; text-align: center;
  border: 1px solid transparent;
}
.alert--danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }


/* ═══════════════ КОРПУСИ БАРНОМА ═══════════════ */

.app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

.appbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--bg);
  padding-top: var(--safe-t);
  border-bottom: 1px solid var(--line);
}

.appbar__row {
  height: 58px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 0 var(--pad);
}

.appbar__brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.appbar__brand strong { display: block; font-size: 16px; font-weight: 700; letter-spacing: -.2px;
                        white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar__brand small  { display: block; font-size: 11.5px; color: var(--text-3); }

.appbar__actions { display: flex; gap: 8px; flex: none; }

/* Pills — танҳо дар планшет/десктоп */
.pills { display: none; }


/* ── Мундариҷа ───────────────────────────────────────────────────────── */

.main {
  flex: 1;
  padding: var(--pad);
  padding-bottom: calc(var(--tab-h) + var(--safe-b) + 24px);
  display: grid;
  gap: var(--gap);
  align-content: start;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
}

.view { display: none; gap: var(--gap); grid-auto-rows: min-content; }
.view.is-active { display: grid; animation: fade .28s var(--ease); }

@keyframes fade { from { opacity: 0; transform: translateY(6px); } }


/* ── Панели поёнӣ ────────────────────────────────────────────────────── */

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
  box-shadow: 0 -2px 16px rgba(0, 0, 0, .18);
}

.tab {
  height: var(--tab-h);
  display: grid; place-items: center; gap: 3px;
  align-content: center;
  color: var(--text-3);
  font-size: 10.5px; font-weight: 600;
  transition: color .18s;
  position: relative;
}
.tab svg { width: 22px; height: 22px; }
.tab.is-active { color: var(--brand); }
.tab.is-active::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand);
}
.tab:active { transform: scale(.94); }


/* ── Кортҳо ──────────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-s);
  overflow: hidden;
}

.card__head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 15px var(--pad) 13px;
  border-bottom: 1px solid var(--line);
}
.card__head h2 { font-size: 14.5px; font-weight: 700; letter-spacing: -.1px; }
.card__note { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.card__body { padding: var(--pad); }


/* ── Плиткаҳои омор ──────────────────────────────────────────────────── */

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.stat {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 14px 13px;
  box-shadow: var(--shadow-s);
  overflow: hidden;
}
.stat::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: var(--c, var(--brand));
}
.stat__label {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px;
}
.stat__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--brand)); flex: none; }
.stat__num {
  font-size: 27px; font-weight: 780; letter-spacing: -1px; line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.stat__sub { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }


/* ── Рӯйхат ва кортҳои дархост ───────────────────────────────────────── */

.list { display: grid; }
.list--cards { gap: 10px; }

.rq {
  display: grid; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--c, var(--text-3));
  border-radius: var(--r-sm);
  padding: 13px 14px;
  text-align: left;
  width: 100%;
  box-shadow: var(--shadow-s);
  transition: border-color .18s, transform .12s var(--ease);
}
.rq:active { transform: scale(.99); }
.rq:hover { border-color: var(--line-2); border-left-color: var(--c, var(--text-3)); }

.rq__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rq__who { display: flex; align-items: center; gap: 9px; min-width: 0; }

.avatar {
  width: 34px; height: 34px; flex: none;
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 12.5px; font-weight: 750;
  background: var(--brand-soft); color: var(--brand);
  letter-spacing: .3px;
}

.rq__name {
  font-size: 14.5px; font-weight: 650; letter-spacing: -.1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rq__id { font-family: var(--mono); font-size: 11px; color: var(--text-3); }

.rq__meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.rq__reason {
  font-size: 13.5px; color: var(--text-2); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rq__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums;
}

/* Рӯйхати фишурда (дар «Хулоса») */
.list--compact .rq { border-radius: 0; border-left-width: 3px; border-right: 0;
                     border-top: 0; box-shadow: none; }
.list--compact .rq:first-child { border-top: 0; }
.list--compact .rq + .rq { border-top: 1px solid var(--line); }


/* ── Нишонҳо ─────────────────────────────────────────────────────────── */

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 23px; padding: 0 9px;
  border-radius: var(--r-full);
  font-size: 11.5px; font-weight: 650; letter-spacing: .1px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.chip svg { width: 13px; height: 13px; stroke-width: 2.4; }

.chip--pending   { background: var(--warn-soft);   color: var(--warn);   border-color: var(--warn); }
.chip--accepted  { background: var(--ok-soft);     color: var(--ok);     border-color: var(--ok); }
.chip--rejected  { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.chip--cancelled { background: var(--surface-3);   color: var(--text-3); border-color: var(--line-2); }

.chip--late            { background: var(--warn-soft);   color: var(--warn); }
.chip--absent          { background: var(--danger-soft); color: var(--danger); }
.chip--at_work_waiting { background: var(--info-soft);   color: var(--info); }
.chip--leaving_early   { background: var(--violet-soft); color: var(--violet); }

.chip--soft { background: var(--surface-3); color: var(--text-2); }


/* ── Ҷустуҷӯ ва филтрҳо ──────────────────────────────────────────────── */

.searchbar {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  padding: 0 8px 0 12px;
  height: 48px;
  transition: border-color .18s, box-shadow .18s;
}
.searchbar:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3.5px var(--brand-soft); }
.searchbar__ico { color: var(--text-3); flex: none; }
.searchbar input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0;
  background: none; font-size: 16px;
}
.searchbar input::-webkit-search-cancel-button { -webkit-appearance: none; }
.searchbar__filter {
  position: relative; width: 36px; height: 36px; flex: none;
  display: grid; place-items: center; border-radius: var(--r-xs);
  color: var(--text-2); background: var(--surface-2);
}
.searchbar__filter .dot {
  position: absolute; top: 5px; right: 5px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--brand);
}

.filters {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--pad);
  display: grid; gap: 14px;
  animation: fade .22s var(--ease);
}
.filters__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.filters__foot { display: flex; gap: 9px; }
.filters__foot .btn { flex: 1; }


/* ── Кормандон ───────────────────────────────────────────────────────── */

.team { display: grid; gap: 11px; }

.member {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 15px;
  box-shadow: var(--shadow-s);
  display: grid; gap: 13px;
}

.member__top { display: flex; align-items: center; gap: 12px; }
.member__top .avatar { width: 44px; height: 44px; border-radius: 13px; font-size: 15px; }
.member__name { font-size: 15.5px; font-weight: 700; letter-spacing: -.2px;
                white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member__sub  { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.member__total {
  margin-left: auto; flex: none; text-align: right;
}
.member__total b { font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; }
.member__total span { display: block; font-size: 10.5px; color: var(--text-3); }

.member__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.mstat {
  background: var(--surface-2);
  border-radius: var(--r-xs);
  padding: 8px 6px;
  text-align: center;
}
.mstat b { display: block; font-size: 15px; font-weight: 700; color: var(--c, var(--text));
           font-variant-numeric: tabular-nums; }
.mstat span { font-size: 10px; color: var(--text-3); }

.meter { display: grid; gap: 6px; }
.meter__row { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2); }
.meter__row b { color: var(--text); font-variant-numeric: tabular-nums; }
.meter__track { height: 7px; border-radius: var(--r-full); background: var(--surface-3); overflow: hidden; }
.meter__fill  { height: 100%; border-radius: var(--r-full);
                background: linear-gradient(90deg, var(--brand), var(--info));
                transition: width .7s var(--ease); }


/* ── Графикҳо (SVG-и худӣ) ───────────────────────────────────────────── */

/* Қоидаи глобалии `svg{stroke:currentColor}` мерос мемонад ва ба элементҳои
   график хатти нодаркор мекашад — дар ин ҷо онро хомӯш мекунем. Ҳар элементи
   график ранги худро ошкоро мегузорад. */
.chart {
  width: 100%; display: block; overflow: visible;
  fill: none; stroke: none; stroke-width: 0;
}
.chart text { font-family: var(--font); fill: var(--text-3); font-size: 10px; stroke: none; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .val  { fill: var(--text-2); font-size: 10px; font-weight: 650; }

/* Дидаву дониста бе анимация: элементҳои график ҳамеша намоёнанд.
   Ҳаракат дар сатҳи `.view` ҳаст ва он бе fill-mode кор мекунад. */

.legend { display: grid; gap: 8px; margin-top: 14px; }
.legend__item { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.legend__sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend__name { color: var(--text-2); }
.legend__val { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }

.donut-wrap { display: grid; place-items: center; gap: 4px; }


/* ── Ҳолати холӣ / бор шудан ─────────────────────────────────────────── */

.empty { text-align: center; padding: 44px 20px; color: var(--text-3); }
.empty svg { width: 38px; height: 38px; margin: 0 auto 12px; opacity: .45; }
.empty b { display: block; color: var(--text-2); font-size: 14.5px; margin-bottom: 3px; }
.empty span { font-size: 13px; }

.skeleton {
  position: relative; overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  min-height: 88px;
}
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, var(--surface-3), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

.skeleton--row { min-height: 72px; border-radius: var(--r-sm); }


/* ── Панели поёнии тафсилот ──────────────────────────────────────────── */

.sheet { position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-end; }
.sheet__scrim { position: absolute; inset: 0; background: rgba(3, 6, 12, .6);
                animation: fade .2s ease; }
.sheet__panel {
  position: relative; width: 100%;
  max-height: 88vh; max-height: 88dvh;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  border-top: 1px solid var(--line);
  padding-bottom: calc(var(--safe-b) + 16px);
  animation: slideUp .3s var(--ease);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, .35);
}
@keyframes slideUp { from { transform: translateY(100%); } }

.sheet__grip { padding: 12px 0 6px; display: grid; place-items: center; cursor: grab; }
.sheet__grip::before { content: ""; width: 40px; height: 4px; border-radius: 4px; background: var(--line-2); }

.sheet__body { padding: 6px var(--pad) 4px; display: grid; gap: 15px; }

.detail { display: grid; gap: 11px; }
.detail__head { display: flex; align-items: center; gap: 12px; }
.detail__head .avatar { width: 46px; height: 46px; border-radius: 14px; font-size: 16px; }
.detail__name { font-size: 17px; font-weight: 720; letter-spacing: -.2px; }
.detail__id { font-family: var(--mono); font-size: 12px; color: var(--text-3); }

.kv { display: grid; gap: 1px; background: var(--line); border-radius: var(--r-sm); overflow: hidden; }
.kv__row { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start;
           background: var(--surface-2); padding: 11px 13px; }
.kv__k { font-size: 12.5px; color: var(--text-3); flex: none; }
.kv__v { font-size: 13.5px; font-weight: 600; text-align: right; word-break: break-word; }

.sheet__actions { display: grid; gap: 9px; }
.sheet__actions .row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }

.msgbox {
  width: 100%; min-height: 88px; resize: vertical;
  padding: 12px 13px; font-size: 16px; line-height: 1.45;
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  outline: none;
}
.msgbox:focus { border-color: var(--brand); box-shadow: 0 0 0 3.5px var(--brand-soft); }


/* ── Toast ───────────────────────────────────────────────────────────── */

.toast {
  position: fixed; left: 50%; z-index: 120;
  bottom: calc(var(--tab-h) + var(--safe-b) + 16px);
  transform: translateX(-50%);
  max-width: min(92vw, 420px);
  padding: 12px 18px;
  border-radius: var(--r-full);
  background: var(--text);
  color: var(--bg);
  font-size: 13.5px; font-weight: 650; text-align: center;
  box-shadow: var(--shadow);
  animation: toastIn .28s var(--ease);
}
.toast--ok     { background: var(--ok);     color: #04140C; }
.toast--danger { background: var(--danger); color: #1A0505; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 14px); } }


/* ═══════════════ ПЛАНШЕТ ═══════════════ */

@media (min-width: 620px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
  .filters__grid { grid-template-columns: repeat(4, 1fr); }
  .team { grid-template-columns: 1fr 1fr; }
  .list--cards { grid-template-columns: 1fr 1fr; }
}


/* ═══════════════ ДЕСКТОП ═══════════════ */

@media (min-width: 900px) {
  body { font-size: 15px; }

  .tabbar { display: none; }

  .pills {
    display: flex; gap: 6px;
    padding: 0 var(--pad) 11px;
    overflow-x: auto; scrollbar-width: none;
  }
  .pills::-webkit-scrollbar { display: none; }

  .pill {
    height: 36px; padding: 0 16px;
    border-radius: var(--r-full);
    font-size: 13.5px; font-weight: 620;
    color: var(--text-2);
    border: 1px solid transparent;
    transition: all .18s;
    white-space: nowrap;
  }
  .pill:hover { color: var(--text); background: var(--surface-2); }
  .pill.is-active { color: var(--brand-ink); background: var(--brand); border-color: var(--brand); }

  .main { padding: 22px 24px 40px; gap: 18px; }
  .view { gap: 18px; }

  .team { grid-template-columns: repeat(3, 1fr); }
  .list--cards { grid-template-columns: repeat(2, 1fr); }

  #view-charts { grid-template-columns: 1fr 1fr; }
  #view-charts .card:last-child { grid-column: 1 / -1; }

  .sheet { align-items: center; justify-content: center; padding: 24px; }
  .sheet__panel {
    max-width: 480px; border-radius: var(--r-lg);
    max-height: 86vh; padding-bottom: 16px;
    animation: rise .26s var(--ease);
  }
  .sheet__grip { display: none; }
  .sheet__body { padding-top: 20px; }

  .toast { bottom: 26px; }
}

@media (min-width: 1200px) {
  .list--cards { grid-template-columns: repeat(3, 1fr); }
  .team { grid-template-columns: repeat(4, 1fr); }
}


/* ── Дастрасӣ ────────────────────────────────────────────────────────── */

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