:root {
  --color-canvas: #fcfcff;
  --color-surface: #ffffff;
  --color-surface-muted: #eef0ff;
  --color-text: #18213d;
  --color-text-muted: #606b85;
  --color-border: #e1e5f2;
  --color-brand: #5263c7;
  --color-brand-hover: #4354b8;
  --color-brand-active: #3545a4;
  --color-success: #19704d;
  --color-success-soft: #edf8f2;
  --color-warning: #a55b00;
  --color-warning-soft: #fff6e8;
  --color-danger: #b4233d;
  --color-danger-soft: #fff0f3;
  --font-display: 'Manrope', sans-serif;
  --font-body: 'Onest', sans-serif;
  --space-1: .25rem; --space-2: .5rem; --space-3: .75rem; --space-4: 1rem;
  --space-5: 1.25rem; --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem;
  --radius-sm: .5rem; --radius-md: .75rem; --radius-lg: 1rem; --radius-xl: 1.5rem;
  --shadow-sm: 0 .0625rem .125rem rgba(24, 33, 61, .04), 0 .25rem .75rem rgba(24, 33, 61, .04);
  --shadow-md: 0 .5rem 1.5rem rgba(24, 33, 61, .08);
  --shadow-lg: 0 1.5rem 4rem rgba(24, 33, 61, .2);
  --duration-fast: 150ms; --duration-normal: 250ms;
  --ease-standard: cubic-bezier(.2, 0, 0, 1);
  --content-width: 78rem;
  --app-bar-height: 3.5rem;
  --app-logo-height: 2.25rem;
  --sidebar-width: 15.5rem;
  --sidebar-width-collapsed: 4.5rem;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-width: 0; max-width: 100%; overflow-x: hidden; }
body { min-height: 100dvh; display: flex; flex-direction: column; background: var(--color-canvas); color: var(--color-text); font: 400 1rem/1.5 var(--font-body); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; }
h1, h2, h3, p { overflow-wrap: break-word; }
:focus-visible { outline: .125rem solid var(--color-brand); outline-offset: .125rem; }
[hidden] { display: none !important; }
option { padding: var(--space-2) var(--space-3); }

/* ---------- Боковая панель (Left Sidebar) ---------- */
.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--color-surface, #ffffff);
  border-right: .0625rem solid var(--color-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
  overflow: hidden;
}

.sidebar__header {
  height: var(--app-bar-height, 3.5rem);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  border-bottom: .0625rem solid var(--color-border);
  flex-shrink: 0;
  box-sizing: border-box;
}

.sidebar__brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  overflow: hidden;
}

.sidebar__logo--full {
  height: 2.75rem;
  max-height: 44px;
  width: auto;
  object-fit: contain;
  display: block;
}

.sidebar__logo--compact {
  display: none;
  width: 2.35rem;
  height: 2.35rem;
  object-fit: contain;
  border-radius: 8px;
}

.sidebar__scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.75rem 0.625rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.85rem;
  border-radius: var(--radius-sm, 8px);
  color: var(--color-text-muted, #606b85);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--duration-fast, 0.15s) var(--ease-standard, ease);
  position: relative;
  user-select: none;
}

.sidebar__link:hover {
  background: var(--color-surface-muted, #f4f6fc);
  color: var(--color-text, #18213d);
}

.sidebar__link--current,
.sidebar__link.app-bar__link--current {
  background: #eff6ff !important;
  color: var(--color-brand, #5263c7) !important;
  font-weight: 700;
}

/* Sublinks under integration nav */
.sidebar__nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar__sublinks {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 1px 0 3px 0;
}
.sidebar__sublink {
  padding: 0.42rem 0.85rem 0.42rem 1.85rem !important;
  font-size: 0.8125rem !important;
  color: var(--color-text-muted, #64748b) !important;
  position: relative;
  border-radius: 6px !important;
}
.sidebar__sublink:hover {
  background: var(--color-surface-muted, #f1f5f9) !important;
  color: var(--color-text, #1e293b) !important;
}
.sidebar__sublink--current,
.sidebar__sublink.sidebar__link--current {
  background: #eff6ff !important;
  color: var(--color-brand, #5263c7) !important;
  font-weight: 700 !important;
}
.sidebar__sublink-bullet {
  font-family: monospace;
  font-size: 0.9rem;
  font-weight: 700;
  color: #94a3b8;
  flex-shrink: 0;
  display: inline-block;
  line-height: 1;
  margin-right: -0.15rem;
}
.sidebar__sublink .sidebar__icon {
  width: 1.15rem;
  height: 1.15rem;
}
body.sidebar--collapsed .sidebar__sublink {
  padding: 0.5rem 0 !important;
  justify-content: center !important;
}
body.sidebar--collapsed .sidebar__sublink-bullet {
  display: none !important;
}
body.sidebar--collapsed .sidebar__sublinks {
  margin: 0;
}

.sidebar__link--dev {
  margin-top: 0.5rem;
  color: var(--color-brand, #5263c7) !important;
  background: rgba(82, 99, 199, 0.08);
  border: 1px solid rgba(82, 99, 199, 0.22);
  width: 100%;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.85rem;
  border-radius: var(--radius-sm, 8px);
  text-decoration: none;
  transition: all var(--duration-fast, 0.15s) var(--ease-standard, ease);
}

.sidebar__link--dev:hover {
  background: rgba(82, 99, 199, 0.16) !important;
  border-color: var(--color-brand, #5263c7);
  color: var(--color-brand-hover, #4353b3) !important;
}

.sidebar__icon {
  width: 1.35rem;
  height: 1.35rem;
  flex-shrink: 0;
  color: currentColor;
  transition: transform var(--duration-fast, 0.15s) ease;
}

.sidebar__icon--img {
  width: 1.5rem;
  height: 1.5rem;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.sidebar__link:hover .sidebar__icon {
  transform: scale(1.06);
}

.sidebar__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar__footer {
  padding: 0.65rem 0.85rem;
  border-top: .0625rem solid var(--color-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: #fafbfc;
  flex-shrink: 0;
}

.sidebar__lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #cbd5e1);
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-text, #334155);
  cursor: pointer;
  transition: all var(--duration-fast, 0.15s) ease;
}

.sidebar__feedback-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #cbd5e1);
  border-radius: 8px;
  padding: 0.42rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text, #334155);
  cursor: pointer;
  transition: all var(--duration-fast, 0.15s) ease;
}

.sidebar__feedback-btn:hover,
.sidebar__lang-btn:hover {
  border-color: var(--color-brand, #5263c7);
  color: var(--color-brand, #5263c7);
  background: #f8fafc;
}

.sidebar__collapse-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: all var(--duration-fast, 0.15s) ease;
}

.sidebar__collapse-btn:hover {
  background: #e2e8f0;
  color: var(--color-text, #18213d);
}

.sidebar__toggle-icon {
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Collapsed Sidebar (Desktop > 768px only) - Toggled strictly via button */
@media (min-width: 48.01rem) {
  body.sidebar--collapsed .app-sidebar {
    width: var(--sidebar-width-collapsed, 4.5rem);
    overflow: visible;
  }

  body.sidebar--collapsed .sidebar__logo--full {
    display: none;
  }

  body.sidebar--collapsed .sidebar__logo--compact {
    display: flex;
  }

  body.sidebar--collapsed .sidebar__header {
    padding: 0;
    justify-content: center;
  }

  body.sidebar--collapsed .sidebar__scroll {
    padding: 0.75rem 0.35rem;
    overflow: visible;
  }

  body.sidebar--collapsed .sidebar__link {
    justify-content: center;
    padding: 0.65rem 0;
    border-radius: 8px;
  }

  body.sidebar--collapsed .sidebar__label {
    display: none;
  }

  body.sidebar--collapsed .sidebar__footer {
    flex-direction: column;
    padding: 0.5rem 0.25rem;
    gap: 0.35rem;
  }

  body.sidebar--collapsed .sidebar__feedback-btn,
  body.sidebar--collapsed .sidebar__lang-btn {
    padding: 0.4rem;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 8px;
  }

  body.sidebar--collapsed .sidebar__feedback-btn .sidebar__label {
    display: none !important;
  }

  body.sidebar--collapsed .sidebar__toggle-icon {
    transform: rotate(180deg);
  }
}

/* Close button inside sidebar header for mobile */
.sidebar__close-btn {
  display: none;
  background: none;
  border: none;
  color: var(--color-text-muted, #64748b);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 6px;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  transition: background 0.15s, color 0.15s;
}

.sidebar__close-btn:hover {
  background: var(--color-surface-muted, #f1f5f9);
  color: var(--color-text, #18213d);
}

/* Collapsed Tooltip (shown on icon hover when sidebar is collapsed on Desktop) */
@media (min-width: 48.01rem) {
  body.sidebar--collapsed .sidebar__link[data-tooltip],
  body.sidebar--collapsed .sidebar__feedback-btn[data-tooltip],
  body.sidebar--collapsed .sidebar__lang-btn[data-tooltip],
  body.sidebar--collapsed .sidebar__collapse-btn[data-tooltip] {
    position: relative;
  }

  body.sidebar--collapsed .sidebar__link[data-tooltip]::after,
  body.sidebar--collapsed .sidebar__feedback-btn[data-tooltip]::after,
  body.sidebar--collapsed .sidebar__lang-btn[data-tooltip]::after,
  body.sidebar--collapsed .sidebar__collapse-btn[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    background: #1e293b;
    color: #ffffff;
    font-family: var(--font-body, 'Onest', sans-serif);
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.25;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.22);
    z-index: 1200;
  }

  body.sidebar--collapsed .sidebar__link[data-tooltip]::before,
  body.sidebar--collapsed .sidebar__feedback-btn[data-tooltip]::before,
  body.sidebar--collapsed .sidebar__lang-btn[data-tooltip]::before,
  body.sidebar--collapsed .sidebar__collapse-btn[data-tooltip]::before {
    content: '';
    position: absolute;
    left: calc(100% + 6px);
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    border-width: 6px 6px 6px 0;
    border-style: solid;
    border-color: transparent #1e293b transparent transparent;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
    z-index: 1200;
  }

  body.sidebar--collapsed .sidebar__link[data-tooltip]:hover::after,
  body.sidebar--collapsed .sidebar__feedback-btn[data-tooltip]:hover::after,
  body.sidebar--collapsed .sidebar__lang-btn[data-tooltip]:hover::after,
  body.sidebar--collapsed .sidebar__collapse-btn[data-tooltip]:hover::after,
  body.sidebar--collapsed .sidebar__link[data-tooltip]:hover::before,
  body.sidebar--collapsed .sidebar__feedback-btn[data-tooltip]:hover::before,
  body.sidebar--collapsed .sidebar__lang-btn[data-tooltip]:hover::before,
  body.sidebar--collapsed .sidebar__collapse-btn[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
  }
}

/* ---------- Верхняя панель (Compact App Bar) ---------- */
.app-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: calc(var(--app-bar-height, 3.5rem) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  border-bottom: .0625rem solid var(--color-border);
  background: rgba(252, 252, 255, .88);
  backdrop-filter: saturate(1.4) blur(.75rem);
  box-sizing: border-box;
}

.app-bar__inner {
  display: flex;
  width: 100%;
  max-width: 100%;
  height: 100%;
  margin: 0;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  box-sizing: border-box;
}

.app-bar__context {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.app-bar__title {
  font-family: var(--font-display, sans-serif);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-text, #18213d);
  letter-spacing: -0.02em;
}

.app-bar__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.app-bar__mobile-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0.45rem;
  color: var(--color-text, #18213d);
  cursor: pointer;
  border-radius: 8px;
  margin-right: 0.5rem;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.app-bar__mobile-btn:hover {
  background: var(--color-surface-muted, #f1f5f9);
  color: var(--color-brand, #5263c7);
}

.app-bar__user { display: flex; min-width: 0; margin-left: auto; align-items: center; gap: var(--space-3); }
.app-bar__identity { display: grid; min-width: 0; line-height: 1.25; text-align: right; }
.app-bar__name { overflow: hidden; max-width: 14rem; font-size: .875rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.app-bar__role { color: var(--color-text-muted); font-size: .75rem; }
.app-bar__switch { max-width: 15rem; min-height: 2.25rem; border: .0625rem dashed var(--color-brand); border-radius: var(--radius-sm); background: var(--color-surface); padding: 0 var(--space-2); font-size: .8125rem; }

.app-footer { width: min(100%, var(--content-width)); margin: auto auto 0; padding: 1rem 1.75rem; border-top: .0625rem solid var(--color-border); display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); font-size: .8125rem; color: var(--color-text-muted); box-sizing: border-box; flex-shrink: 0; }
.app-footer__copy { margin: 0; }
.app-footer__actions { display: inline-flex; align-items: center; gap: var(--space-4); margin-left: auto; flex-shrink: 0; }
.app-footer__user { display: flex; align-items: center; gap: var(--space-2); margin: 0; }
.app-footer__user[hidden] { display: none !important; }
.app-footer__user-label { font-size: .75rem; font-weight: 600; color: var(--color-text-muted); }

.avatar { display: grid; flex: none; width: 2.25rem; height: 2.25rem; place-items: center; border-radius: 50%; background: var(--color-surface-muted); color: var(--color-brand); font: 700 .8125rem/1 var(--font-display); }
.avatar--small { width: 1.75rem; height: 1.75rem; font-size: .6875rem; }

/* ---------- Каркас страницы ---------- */
.task-app__main { flex: 1 0 auto; width: min(100%, var(--content-width)); min-width: 0; max-width: 100%; margin: 0 auto; padding: var(--space-8) var(--space-5) calc(var(--space-10) + env(safe-area-inset-bottom)); box-sizing: border-box; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; width: 100%; max-width: 100%; gap: var(--space-8); }
.workspace > *, .workspace__body > *, .task-list > * { min-width: 0; max-width: 100%; }
.workspace__header { display: flex; min-width: 0; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-4); }
.workspace__intro { min-width: 0; flex: 1 1 16rem; }
.workspace__eyebrow, .task-form__eyebrow { margin: 0 0 var(--space-2); color: var(--color-brand); font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.workspace__title { margin: 0; font: 800 clamp(1.45rem, 4.5vw, 2.5rem)/1.15 var(--font-display); letter-spacing: -.035em; overflow-wrap: anywhere; }
.workspace__subtitle { margin: var(--space-2) 0 0; color: var(--color-text-muted); }
.workspace__body { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; width: 100%; max-width: 100%; align-items: start; gap: var(--space-8); }
.workspace__action, .task-form__submit { display: inline-flex; min-height: 2.75rem; align-items: center; justify-content: center; gap: var(--space-2); border: 0; border-radius: var(--radius-md); background: var(--color-brand); color: var(--color-surface); padding: 0 var(--space-5); font-weight: 700; transition: background var(--duration-fast) var(--ease-standard), transform var(--duration-fast) var(--ease-standard); }
.workspace__action:hover, .task-form__submit:hover { background: var(--color-brand-hover); }
.workspace__action:active, .task-form__submit:active { background: var(--color-brand-active); transform: translateY(.0625rem); }
.workspace__action:disabled, .task-form__submit:disabled { opacity: .4; }
.workspace__action-icon { font-size: 1.25rem; line-height: 1; }

/* ---------- Экран входа ---------- */
.access-screen { display: grid; min-height: 70dvh; place-content: center; justify-items: center; gap: var(--space-4); text-align: center; }
.access-screen__mark { display: grid; width: 3.5rem; aspect-ratio: 1; place-items: center; border-radius: var(--radius-lg); background: var(--color-surface-muted); color: var(--color-brand); font: 800 1.5rem/1 var(--font-display); }
.access-screen__title { margin: 0; font: 800 clamp(1.75rem, 6vw, 2.5rem)/1.1 var(--font-display); letter-spacing: -.035em; }
.access-screen__text { max-width: 28rem; margin: 0; color: var(--color-text-muted); line-height: 1.55; }

/* ---------- Сводка ---------- */
.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); }
.summary__item { display: grid; min-width: 0; gap: var(--space-1); border: .0625rem solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); padding: var(--space-4) var(--space-5); text-align: left; box-shadow: var(--shadow-sm); transition: border-color var(--duration-fast) var(--ease-standard), transform var(--duration-fast) var(--ease-standard); }
.summary__item:hover { border-color: var(--color-brand); }
.summary__item--active { border-color: var(--color-brand); box-shadow: 0 0 0 .1875rem var(--color-surface-muted); }
.summary__value { font: 800 1.75rem/1.1 var(--font-display); letter-spacing: -.03em; }
.summary__label { color: var(--color-text-muted); font-size: .8125rem; font-weight: 600; }
.summary__item--warning .summary__value { color: var(--color-warning); }
.summary__item--danger .summary__value { color: var(--color-danger); }
.summary__item--brand .summary__value { color: var(--color-brand); }

/* ---------- Загрузка команды ---------- */
.monitoring { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; gap: var(--space-4); border: .0625rem solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); padding: var(--space-5); box-shadow: var(--shadow-sm); }
.monitoring__heading { display: grid; gap: var(--space-1); }
.monitoring__title { margin: 0; font: 700 1.125rem/1.3 var(--font-display); letter-spacing: -.02em; }
.monitoring__text { margin: 0; color: var(--color-text-muted); font-size: .8125rem; }
.monitoring__list { display: flex; flex-wrap: wrap; gap: var(--space-4); margin: 0; padding: 0; list-style: none; }
.monitoring__employee { display: flex; flex-direction: column; flex: 1 1 12rem; align-items: flex-start; gap: var(--space-1); border-radius: var(--radius-md); background: var(--color-surface-muted); padding: var(--space-3) var(--space-4); border: 1.5px solid transparent; transition: all 0.15s ease; user-select: none; }
.monitoring__employee:hover { border-color: var(--color-brand, #5263c7); background: #ffffff; box-shadow: 0 2px 6px rgba(0,0,0,0.06); }
.monitoring__employee--selected { border-color: var(--color-brand, #5263c7); background: #ffffff; box-shadow: 0 0 0 2px var(--color-brand, #5263c7); }
.monitoring__employee-info { display: grid; min-width: 0; line-height: 1.3; }
.monitoring__employee-name { font-size: .875rem; font-weight: 600; }
.monitoring__employee-role { color: var(--color-text-muted); font-size: .75rem; }
.monitoring__employee-count { color: var(--color-text-muted); font-size: .75rem; font-weight: 600; }
.monitoring__bar { display: none; }
.monitoring__bar-fill { display: none; }
.monitoring__empty { margin: 0; color: var(--color-text-muted); font-size: .875rem; }

/* ---------- Список задач ---------- */
.task-list { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; width: 100%; max-width: 100%; align-content: start; gap: var(--space-5); }
.task-list__heading { display: flex; min-width: 0; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2) var(--space-4); }
.task-list__title { margin: 0; font: 700 1.25rem/1.3 var(--font-display); letter-spacing: -.02em; }
.task-list__text { margin: 0; color: var(--color-text-muted); font-size: .875rem; }
.task-list__cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: var(--space-4); align-items: stretch; }
.task-list__empty { margin: 0; border: .0625rem dashed var(--color-border); border-radius: var(--radius-lg); padding: var(--space-10) var(--space-5); color: var(--color-text-muted); text-align: center; }

.task-list__filter { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }
.task-list__filter-label { color: var(--color-text-muted); font-size: .875rem; }
.task-list__filter .task-list__select { width: auto; min-width: 12rem; }
.filter-chips { display: flex; min-width: 0; gap: var(--space-2); margin: 0 calc(var(--space-5) * -1); padding: 0 var(--space-5) var(--space-1); overflow-x: auto; scrollbar-width: none; }
.filter-chips::-webkit-scrollbar { display: none; }
.filter-chips__chip { display: inline-flex; flex: none; min-height: 2.25rem; align-items: center; gap: var(--space-2); border: .0625rem solid var(--color-border); border-radius: 999rem; background: var(--color-surface); padding: 0 var(--space-4); font-size: .8125rem; font-weight: 600; white-space: nowrap; transition: border-color var(--duration-fast) var(--ease-standard), background var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard); }
.filter-chips__chip:hover { border-color: var(--color-brand); }
.filter-chips__chip--active { border-color: var(--color-brand); background: var(--color-brand); color: var(--color-surface); }
.filter-chips__count { min-width: 1.25rem; border-radius: 999rem; background: var(--color-surface-muted); padding: 0 .375rem; color: var(--color-brand); font-size: .6875rem; line-height: 1.25rem; text-align: center; }
.filter-chips__chip--active .filter-chips__count { background: rgba(255, 255, 255, .2); color: var(--color-surface); }

/* ---------- Карточка задачи ---------- */
.task-card { display: flex; min-width: 0; flex-direction: column; gap: var(--space-4); border: .0625rem solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); padding: var(--space-5); box-shadow: var(--shadow-sm); transition: transform var(--duration-normal) var(--ease-standard), box-shadow var(--duration-normal) var(--ease-standard), border-color var(--duration-normal) var(--ease-standard); }
.task-card--overdue { border-color: #f1c3cc; }
.task-card--attention { border-color: var(--color-brand); }
.task-card--closed { background: #fafbfe; box-shadow: none; }
.task-card__topline { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: var(--space-2); }
.task-card__priority { display: inline-flex; align-items: center; gap: .375rem; border-radius: 999rem; background: var(--color-surface-muted); padding: .25rem .625rem; color: var(--color-brand); font-size: .75rem; font-weight: 700; }
.task-card__priority::before { width: .375rem; height: .375rem; border-radius: 50%; background: currentColor; content: ''; }
.task-card__priority--urgent { background: var(--color-danger-soft); color: var(--color-danger); }
.task-card__priority--low { background: var(--color-success-soft); color: var(--color-success); }
.task-card__status { color: var(--color-text-muted); font-size: .75rem; font-weight: 600; text-align: right; }
.task-card__status--submitted { color: var(--color-brand); }
.task-card__status--declined { color: var(--color-danger); }
.task-card__status--revision { color: var(--color-warning); }
.task-card__status--completed { color: var(--color-success); }
.task-card__topline-right { display: inline-flex; align-items: center; gap: 0.5rem; }
.task-card__delete-btn { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0; border: none; background: transparent; color: #94a3b8; border-radius: 6px; cursor: pointer; transition: all 0.15s ease; flex-shrink: 0; }
.task-card__delete-btn:hover { background: #fee2e2; color: #ef4444; }
.kanban-item__delete-btn { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; padding: 0; border: none; background: transparent; color: #94a3b8; border-radius: 4px; cursor: pointer; transition: all 0.15s ease; flex-shrink: 0; }
.kanban-item__delete-btn:hover { background: #fee2e2; color: #ef4444; }
.task-card__description { display: -webkit-box; margin: 0; overflow: hidden; font: 700 1.0625rem/1.4 var(--font-display); letter-spacing: -.01em; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.task-card__meta { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-3); margin: 0; border-top: .0625rem solid var(--color-border); padding-top: var(--space-4); }
.task-card__fact { display: grid; min-width: 0; align-content: start; gap: .375rem; margin: 0; }
.task-card__fact-label { color: var(--color-text-muted); font-size: .75rem; }
.task-card__deadline { display: inline-flex; align-items: center; gap: .375rem; margin: 0; font-size: .875rem; font-weight: 600; }
.task-card__deadline-icon { flex: none; font-size: .875rem; line-height: 1; }
.task-card__deadline--soon { color: var(--color-warning); }
.task-card__deadline--overdue { color: var(--color-danger); }
.task-card__person { display: flex; min-width: 0; align-items: center; gap: var(--space-2); margin: 0; font-size: .875rem; font-weight: 600; }
.task-card__person-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-card__checklist { display: grid; gap: var(--space-2); margin-top: var(--space-2); }
.task-card__checklist-item { display: flex; align-items: flex-start; gap: var(--space-2); font-size: .875rem; }
.task-card__checklist-checkbox { margin-top: .125rem; accent-color: var(--color-brand); width: 1.125rem; height: 1.125rem; }
.task-card__checklist-text { line-height: 1.4; color: var(--color-text); }
.task-card__checklist-text--done { text-decoration: line-through; color: var(--color-text-muted); }
.task-card__files { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; }
.task-card__files:empty { display: none; }
.task-card__file { display: inline-flex; align-items: center; gap: var(--space-2); font-size: .8125rem; font-weight: 600; text-decoration: none; color: var(--color-brand); border: .0625rem solid var(--color-border); border-radius: var(--radius-sm); padding: var(--space-1) var(--space-3); transition: background var(--duration-fast) var(--ease-standard); }
.task-card__file:hover { background: var(--color-surface-muted); }
.task-card__progress { display: grid; gap: var(--space-2); }
.task-card__timeline { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .25rem; }
.task-card__step { height: .3125rem; border-radius: 999rem; background: var(--color-border); }
.task-card__step--done { background: #aab3e6; }
.task-card__step--current { background: var(--color-brand); }
.task-card__stage { margin: 0; color: var(--color-text-muted); font-size: .75rem; }
.task-card__stage-name { color: var(--color-text); font-weight: 600; }
.task-card__notice { margin: 0; border-radius: var(--radius-sm); background: var(--color-surface-muted); padding: var(--space-2) var(--space-3); font-size: .8125rem; line-height: 1.45; }
.task-card__notice-label { display: block; margin-bottom: .125rem; font-size: .6875rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; opacity: .8; }
.task-card__notice--danger { background: var(--color-danger-soft); color: var(--color-danger); }
.task-card__notice--warning { background: var(--color-warning-soft); color: var(--color-warning); }
.task-card__notice--success { background: var(--color-success-soft); color: var(--color-success); }
.task-card__actions { display: flex; min-width: 0; flex-wrap: wrap; gap: var(--space-2); margin-top: auto; }
.task-card__actions:empty { display: none; }
.task-card__button, .button { display: inline-flex; min-height: 2.5rem; flex: 1 1 auto; align-items: center; justify-content: center; border: .0625rem solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface); padding: 0 var(--space-4); font-size: .875rem; font-weight: 700; transition: border-color var(--duration-fast) var(--ease-standard), background var(--duration-fast) var(--ease-standard); }
.task-card__button:hover, .button:hover { border-color: var(--color-brand); background: var(--color-surface-muted); }
.task-card__button:disabled, .button:disabled { opacity: .4; }
.task-card__button--primary, .button--primary { border-color: var(--color-brand); background: var(--color-brand); color: var(--color-surface); }
.task-card__button--primary:hover, .button--primary:hover { border-color: var(--color-brand-hover); background: var(--color-brand-hover); }
.task-card__button--primary:active, .button--primary:active { background: var(--color-brand-active); }
.task-card__button--danger { border-color: #fecaca; color: var(--color-danger); background: #fff; }
.task-card__button--danger:hover { border-color: var(--color-danger); background: var(--color-danger-soft); }

/* ---------- Диалоги и формы ---------- */
.task-form { width: min(calc(100% - var(--space-6)), 34rem); max-height: min(46rem, 92dvh); overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; border: 0; border-radius: var(--radius-xl); background: var(--color-surface); padding: 0; color: var(--color-text); box-shadow: var(--shadow-lg); box-sizing: border-box; }
.task-form[open] { animation: dialog-in var(--duration-normal) var(--ease-standard); }
.task-form::backdrop { background: rgba(24, 33, 61, .45); }
.task-form__form { display: grid; min-width: 0; gap: var(--space-5); padding: var(--space-6); }
.task-form__heading, .task-form__actions { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: var(--space-4); }
.task-form__heading { align-items: flex-start; }
.task-form__heading > * { min-width: 0; }
.task-form__actions { justify-content: flex-end; padding-top: var(--space-2); }
.task-form__title { margin: 0; font: 700 1.375rem/1.25 var(--font-display); letter-spacing: -.025em; }
.task-form__text { margin: 0; border-radius: var(--radius-sm); background: var(--color-canvas); padding: var(--space-3); color: var(--color-text-muted); font-size: .875rem; }
.task-form__close { display: grid; flex: none; width: 2.5rem; height: 2.5rem; place-items: center; border: 0; border-radius: var(--radius-sm); background: var(--color-surface-muted); font-size: 1.375rem; line-height: 1; }
.task-form__close:hover { background: var(--color-border); }
.task-form__field { display: grid; min-width: 0; gap: var(--space-2); margin: 0; border: 0; padding: 0; }
.task-form__label { padding: 0; font-size: .875rem; font-weight: 700; }
.task-form__hint { color: var(--color-text-muted); font-size: .8125rem; }

.archive-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-4); margin-bottom: var(--space-8); padding: var(--space-5); background: var(--color-surface); border: .0625rem solid var(--color-border); border-radius: var(--radius-lg); }
.task-card--archived { opacity: 0.85; filter: grayscale(20%); }
.task-form__input, .task-form__textarea, .task-list__select { width: 100%; min-height: 2.75rem; border: .0625rem solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface); padding: 0 var(--space-3); transition: border-color var(--duration-fast) var(--ease-standard); }
.task-form__input:hover, .task-form__textarea:hover { border-color: #c8cee3; }
.task-form__input:focus, .task-form__textarea:focus { border-color: var(--color-brand); }
.task-form__input[type="file"] {
  display: flex;
  align-items: center;
  min-height: 2.95rem;
  padding: 0.35rem 0.75rem 0.35rem 0.4rem !important;
  border: 1.5px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
}
.task-form__input[type="file"]:hover {
  border-color: var(--color-brand, #5263c7);
  background: #f5f7ff;
}
.task-form__input[type="file"]::file-selector-button,
.task-form__input[type="file"]::-webkit-file-upload-button {
  margin-right: 0.75rem;
  padding: 0.45rem 0.9rem;
  border: none;
  border-radius: 8px;
  background: #eef2ff;
  color: var(--color-brand, #5263c7);
  font-family: var(--font-sans, 'Onest', sans-serif);
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.task-form__input[type="file"]:hover::file-selector-button,
.task-form__input[type="file"]:hover::-webkit-file-upload-button {
  background: var(--color-brand, #5263c7);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(82, 99, 199, 0.22);
}

/* Custom Enhanced File Upload Dropzone */
.tf-file-upload {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 3.1rem;
  padding: 0.45rem 0.8rem 0.45rem 0.5rem;
  border-radius: 12px;
  border: 1.5px dashed #cbd5e1;
  background: #f8fafc;
  transition: all 0.18s ease;
  cursor: pointer;
  overflow: hidden;
}
.tf-file-upload:hover,
.tf-file-upload.is-dragover {
  border-color: var(--color-brand, #5263c7);
  background: #f5f7ff;
}
.tf-file-upload.has-files {
  border-style: solid;
  border-color: rgba(82, 99, 199, 0.35);
  background: #eef2ff;
}
.tf-file-upload > input[type="file"] {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  opacity: 0 !important;
  cursor: pointer !important;
  z-index: 2 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
}
.tf-file-upload__main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
  pointer-events: none;
}
.tf-file-upload__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.45rem 0.88rem;
  border-radius: 9px;
  background: #ffffff;
  color: var(--color-brand, #5263c7);
  font-size: 0.8125rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), inset 0 0 0 1px rgba(82, 99, 199, 0.2);
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.tf-file-upload:hover .tf-file-upload__btn,
.tf-file-upload.has-files .tf-file-upload__btn {
  background: var(--color-brand, #5263c7);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(82, 99, 199, 0.24);
}
.tf-file-upload__info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}
.tf-file-upload__name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tf-file-upload.has-files .tf-file-upload__name {
  color: #0f172a;
  font-weight: 700;
}
.tf-file-upload__sub {
  font-size: 0.71rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tf-file-upload.has-files .tf-file-upload__sub {
  color: #4f46e5;
  font-weight: 600;
}
.tf-file-upload__clear {
  position: relative;
  z-index: 3;
  display: none;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: #64748b;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
  padding: 0;
}
.tf-file-upload.has-files .tf-file-upload__clear {
  display: inline-flex;
}
.tf-file-upload__clear:hover {
  background: #fef2f2;
  color: #dc2626;
}
.task-form__textarea { min-height: 7rem; padding: var(--space-3); resize: vertical; line-height: 1.5; }
.task-form__grid { display: grid; min-width: 0; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.task-form__error { margin: 0; border-radius: var(--radius-sm); background: var(--color-danger-soft); padding: var(--space-2) var(--space-3); color: var(--color-danger); font-size: .875rem; }
.task-form__cancel { min-height: 2.75rem; border: 0; border-radius: var(--radius-md); background: transparent; padding: 0 var(--space-4); font-weight: 700; }
.task-form__cancel:hover { background: var(--color-surface-muted); }

.rating { display: flex; gap: var(--space-2); }
.rating__option { position: relative; flex: 1; }
.rating__input { position: absolute; inset: 0; opacity: 0; }
.rating__value { display: grid; min-height: 2.75rem; place-items: center; border: .0625rem solid var(--color-border); border-radius: var(--radius-sm); font: 700 1rem/1 var(--font-display); transition: background var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard); cursor: pointer; }
.rating__input:hover + .rating__value { border-color: var(--color-brand); }
.rating__input:checked + .rating__value { border-color: var(--color-brand); background: var(--color-brand); color: var(--color-surface); }
.rating__input:focus-visible + .rating__value { outline: .125rem solid var(--color-brand); outline-offset: .125rem; }

/* ---------- Уведомления (Toast) и Кастомные Модальные Окна ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--space-6) + env(safe-area-inset-bottom));
  z-index: 10000;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  max-width: min(calc(100% - var(--space-8)), 30rem);
  border-radius: 12px;
  background: #1e293b;
  padding: 0.75rem 1rem 0.75rem 1.1rem;
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.28);
  transform: translateX(-50%);
  animation: toast-in var(--duration-normal) var(--ease-standard);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.toast--success { background: #0f766e; }
.toast--error { background: #be123c; }
.toast--warning { background: #b45309; }
.toast--info { background: #1e293b; }
.toast__text { line-height: 1.35; }
.toast__close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  font-size: 1.15rem;
  line-height: 1;
  padding: 0 0 0 0.25rem;
  cursor: pointer;
  transition: color 0.15s ease;
}
.toast__close:hover { color: #ffffff; }

.tf-custom-modal {
  border: none;
  border-radius: 18px;
  padding: 0;
  background: var(--color-surface, #ffffff);
  color: var(--color-text, #18213d);
  width: min(calc(100% - 2rem), 25rem);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
  animation: dialog-in 0.18s cubic-bezier(0.2, 0, 0, 1);
  overflow: hidden;
}
.tf-custom-modal::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}
.tf-custom-modal__card {
  padding: 1.5rem 1.5rem 1.35rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.tf-custom-modal__icon {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.35rem;
}
.tf-custom-modal__icon--danger {
  background: #fee2e2;
  color: #e11d48;
}
.tf-custom-modal__icon--brand {
  background: rgba(82, 99, 199, 0.12);
  color: var(--color-brand, #5263c7);
}
.tf-custom-modal__title {
  margin: 0;
  font-family: var(--font-display, 'Manrope', sans-serif);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--color-text, #18213d);
  letter-spacing: -0.02em;
}
.tf-custom-modal__text {
  margin: 0;
  font-size: 0.925rem;
  line-height: 1.5;
  color: var(--color-text-muted, #64748b);
}
.tf-custom-modal__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 1rem;
}
.tf-custom-modal__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.625rem;
  padding: 0 1rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tf-custom-modal__btn--cancel {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}
.tf-custom-modal__btn--cancel:hover {
  background: #e2e8f0;
  color: #0f172a;
}
.tf-custom-modal__btn--confirm {
  background: var(--color-brand, #5263c7);
  color: #ffffff;
  border: 1px solid var(--color-brand, #5263c7);
}
.tf-custom-modal__btn--confirm:hover {
  background: var(--color-brand-hover, #4354b8);
}
.tf-custom-modal__btn--danger {
  background: #e11d48;
  color: #ffffff;
  border: 1px solid #e11d48;
}
.tf-custom-modal__btn--danger:hover {
  background: #be123c;
}

/* ---------- Сотрудники и приглашения ---------- */
.page-message { margin: 0; border-radius: var(--radius-md); background: var(--color-danger-soft); padding: var(--space-3) var(--space-4); color: var(--color-danger); font-size: .875rem; font-weight: 600; }
/* ---------- Person Card (Employees) Layout & Equal-Height Alignment ---------- */
.person-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-lg, 16px);
  background: var(--color-surface, #ffffff);
  padding: 1.35rem 1.45rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  box-sizing: border-box;
}

.person-card:hover {
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
  border-color: #cbd5e1;
}

.person-card__form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  height: 100%;
  gap: 0.85rem;
  min-width: 0;
}

.person-card .task-form__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.person-card .task-form__hint {
  display: block;
  min-height: 2.75rem;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--color-text-muted, #64748b);
}

.person-card__footer {
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.person-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
}

.person-card__tag {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.65rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
}

.person-card__facts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.78rem;
  color: #64748b;
}

.person-card__link {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.6rem;
  border-radius: 6px;
  background: #f1f5f9;
  color: #0284c7;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

.person-card__link:hover {
  background: #e0f2fe;
  color: #0369a1;
}

.person-card__tasks-link {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
}

.person-card__tasks-link:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

.person-card__warning {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  background: #fffbeb;
  color: #b45309;
  font-size: 0.74rem;
  font-weight: 600;
}

.person-card__status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  margin: 0;
}

.person-card__status::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.person-card__status--active {
  color: #059669;
}

.person-card__status--inactive {
  color: #94a3b8;
}

.person-card__actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.person-card__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.15rem;
  padding: 0.42rem 0.95rem;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  box-sizing: border-box;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.person-card__button[type="submit"],
.person-card__button--primary {
  background: linear-gradient(135deg, #0ea5e9, #0284c7) !important;
  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
}

.person-card__button[type="submit"]:hover:not(:disabled),
.person-card__button--primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.35);
  transform: translateY(-1px);
}

.person-card__button--ghost,
.person-card__button--outline {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #334155 !important;
}

.person-card__button--ghost:hover:not(:disabled),
.person-card__button--outline:hover:not(:disabled) {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}

.person-card__button--danger {
  background: #ffffff !important;
  border-color: #fecaca !important;
  color: #dc2626 !important;
}

.person-card__button--danger:hover:not(:disabled) {
  background: #fef2f2 !important;
  border-color: #f87171 !important;
  color: #b91c1c !important;
}

.person-card__button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}
.invite-form { display: grid; min-width: 0; max-width: 30rem; gap: var(--space-4); }
.invite-form--centered { width: min(100%, 24rem); justify-self: center; text-align: left; }
.invite-result { display: grid; min-width: 0; max-width: 30rem; gap: var(--space-3); border-top: .0625rem solid var(--color-border); padding-top: var(--space-4); }

@keyframes dialog-in { from { opacity: 0; transform: translateY(.5rem) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, .5rem); } to { opacity: 1; transform: translateX(-50%); } }

@media (hover: hover) {
  .task-card:hover { transform: translateY(-.125rem); box-shadow: var(--shadow-md); }
  .task-card--closed:hover { transform: none; box-shadow: none; }
}

@media (min-width: 68rem) {
  .workspace__body--with-aside { grid-template-columns: minmax(0, 1fr) 19rem; }
  .workspace__body--with-aside .monitoring { position: sticky; top: 5.5rem; }
}

@media (max-width: 52rem) {
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-bar__identity { display: none; }
}

/* Layout Offsets with Sidebar (Desktop > 768px) */
@media (min-width: 48.01rem) {
  body.has-sidebar .app-bar {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    transition: margin-left 0.2s cubic-bezier(0.4, 0, 0.2, 1), width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
  }
  body.has-sidebar.sidebar--collapsed .app-bar {
    margin-left: var(--sidebar-width-collapsed);
    width: calc(100% - var(--sidebar-width-collapsed));
  }
  body.has-sidebar .task-app__main,
  body.has-sidebar .app-footer {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    transition: margin-left 0.2s cubic-bezier(0.4, 0, 0.2, 1), width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
  }
  body.has-sidebar .app-footer {
    margin-top: auto;
    margin-bottom: 0;
  }
  body.has-sidebar.sidebar--collapsed .task-app__main,
  body.has-sidebar.sidebar--collapsed .app-footer {
    margin-left: var(--sidebar-width-collapsed);
    width: calc(100% - var(--sidebar-width-collapsed));
  }
  .app-bar__mobile-btn {
    display: none !important;
  }
}

/* ---------- Режим страницы авторизации (без боковой панели и шапки) ---------- */
body.is-login-screen {
  overflow-x: hidden;
  background: var(--color-canvas, #f4f6fc);
}

body.is-login-screen .app-sidebar,
body.is-login-screen .sidebar__backdrop,
body.is-login-screen .app-bar {
  display: none !important;
}

body.is-login-screen .task-app__main,
body.is-login-screen .app-footer {
  margin-left: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}

body.is-login-screen .task-app__main {
  min-height: calc(100vh - 5rem) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 2.5rem 1.25rem !important;
  box-sizing: border-box;
}

body.is-login-screen .access-screen {
  margin: 0 auto !important;
  width: 100% !important;
  max-width: 32rem !important;
  padding: 0 !important;
}

body.is-login-screen .app-footer {
  border-top: none !important;
  background: transparent !important;
  justify-content: center !important;
  text-align: center !important;
  padding: 1.5rem 1rem !important;
}

body.is-login-screen .app-footer__actions {
  display: none !important;
}

/* Mobile Layout with Sidebar (<= 768px) */
@media (max-width: 48rem) {
  body.has-sidebar .app-bar {
    margin-left: 0 !important;
    width: 100% !important;
  }
  .app-bar__inner {
    padding: 0 0.85rem;
    gap: 0.5rem;
  }
  .app-bar__title {
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .app-bar__mobile-btn {
    display: inline-flex !important;
    margin-right: 0.25rem;
  }
  .app-sidebar {
    transform: translateX(-100%);
    width: min(82vw, 17.5rem) !important;
    box-shadow: 8px 0 32px rgba(15, 23, 42, 0.22);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1100 !important;
  }
  body.sidebar--mobile-open .app-sidebar {
    transform: translateX(0);
  }
  .sidebar__logo--full {
    display: flex !important;
  }
  .sidebar__logo--compact {
    display: none !important;
  }
  .sidebar__close-btn {
    display: inline-flex !important;
  }
  .sidebar__header {
    justify-content: space-between !important;
    padding: 0 1.15rem !important;
  }
  .sidebar__scroll {
    padding: 0.75rem 0.75rem !important;
    overflow-y: auto !important;
  }
  .sidebar__link {
    justify-content: flex-start !important;
    padding: 0.7rem 0.9rem !important;
    gap: 0.85rem !important;
    border-radius: 10px !important;
    font-size: 0.925rem !important;
  }
  .sidebar__label {
    display: inline !important;
  }
  .sidebar__footer {
    flex-direction: column !important;
    padding: 0.75rem 0.85rem !important;
    gap: 0.5rem !important;
  }
  .sidebar__feedback-btn,
  .sidebar__lang-btn {
    width: 100% !important;
    height: 2.5rem !important;
    justify-content: center !important;
    padding: 0 0.85rem !important;
    border-radius: 10px !important;
  }
  .sidebar__backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    z-index: 1050;
  }
  body.sidebar--mobile-open .sidebar__backdrop {
    display: block;
  }
  .sidebar__collapse-btn {
    display: none !important;
  }
  .app-bar__context {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    gap: 0.4rem;
  }
  #app-bar-company-badge {
    max-width: min(170px, 42vw) !important;
    margin-left: 0.35rem !important;
    padding: 0.2rem 0.5rem !important;
    font-size: 0.72rem !important;
  }
  .app-bar__actions {
    flex-shrink: 0;
  }
  .app-footer {
    flex-wrap: wrap;
    padding: 0.85rem 1rem;
    gap: 0.75rem;
  }
  .app-footer__actions {
    flex-wrap: wrap;
    width: 100%;
    justify-content: space-between;
    gap: 0.5rem;
  }
  .app-footer__user {
    flex-wrap: wrap;
    flex: 1 1 auto;
    min-width: 0;
  }
  .app-bar__switch {
    max-width: 100%;
    min-width: 0;
    flex: 1 1 10rem;
  }
  .task-list__heading > div:last-child {
    width: 100%;
  }
  .view-switcher {
    width: 100%;
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
  }
  .view-switcher .view-btn {
    justify-content: center;
    padding: 0.45rem 0.5rem !important;
  }
  .task-list__filter {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
  }
  .task-list__filter .task-list__select {
    flex: 1 1 auto;
    min-width: 0;
  }
  #verifix-live-panel {
    padding: 1.15rem 1rem !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: visible !important;
  }
  #verifix-live-panel > * {
    min-width: 0 !important;
    max-width: 100% !important;
  }
  .calendar-container {
    overflow-x: auto;
  }
  .calendar-weekdays,
  .calendar-days {
    min-width: 520px;
  }
}

@media (max-width: 40rem) {
  .app-bar { height: var(--app-bar-height, 3.5rem); min-height: var(--app-bar-height, 3.5rem); }
  .app-bar__inner { padding: 0 0.75rem; }
  .task-app__main { padding: 1.25rem 0.9rem calc(var(--space-8) + env(safe-area-inset-bottom)); }
  .filter-chips { margin: 0 -0.9rem; padding: 0 0.9rem var(--space-1); }
  .workspace { gap: 1.25rem; }
  .workspace__header > div:last-child { width: 100%; }
  .workspace__header .button,
  .workspace__action { width: 100%; justify-content: center; }
  .summary__item { padding: var(--space-3) var(--space-4); }
  .summary__value { font-size: 1.4rem; }
  .task-form { width: min(calc(100% - 1.25rem), 34rem); max-height: min(92dvh, calc(100dvh - 1.5rem)); }
  .task-form__form { padding: 1.15rem; }
  .task-form__grid { grid-template-columns: 1fr !important; }
  .task-form__actions { flex-direction: column-reverse; align-items: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 1ms !important; transition-duration: 1ms !important; }
}


/* Analytics Table */
.analytics-actions { display: flex; gap: 1rem; }
.analytics-container { background: var(--color-surface); border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.1); margin-top: 1rem; overflow-x: auto; }
.analytics-table { width: 100%; border-collapse: collapse; text-align: left; }
.analytics-table th, .analytics-table td { padding: 1rem; border-bottom: 1px solid var(--color-border); }
.analytics-table th { background: #f8f9fa; font-weight: 600; color: #495057; }
.analytics-table tr:last-child td { border-bottom: none; }
.analytics-table tr:hover { background-color: #f1f3f5; }
.badge { padding: 0.25rem 0.5rem; border-radius: 99px; font-size: 0.875rem; font-weight: 500; }
.badge--info { background: #e7f5ff; color: #1971c2; }



/* ---------- Modern Calendar Styles ---------- */
.calendar-view {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: var(--color-surface, #ffffff);
  padding: 0.85rem 1.25rem;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.calendar-header__nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.calendar-header__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.125rem;
  padding: 0 0.85rem;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  background: var(--color-surface, #ffffff);
  color: var(--color-text, #1e293b);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.calendar-header__btn:hover {
  background: var(--color-surface-muted, #f8fafc);
  border-color: var(--color-brand, #5263c7);
  color: var(--color-brand, #5263c7);
}

.calendar-header__title {
  margin: 0;
  font-family: var(--font-display, sans-serif);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--color-text, #1e293b);
  letter-spacing: -0.02em;
}

.calendar-container {
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  background: #f8fafc;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
}

.calendar-weekday {
  text-align: center;
  padding: 0.75rem 0.25rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-text-muted, #64748b);
  user-select: none;
}

.calendar-weekday--weekend {
  color: #ef4444;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--color-border, #e2e8f0);
}

.calendar-day {
  min-height: 110px;
  min-width: 0;
  background: #ffffff;
  padding: 0.5rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: background-color 0.15s ease;
  overflow: hidden;
}

.calendar-day:hover {
  background: #fafbfe;
}

.calendar-day--other-month {
  background: #f8fafc;
}

.calendar-day--today {
  background: #eff6ff !important;
}

.calendar-day__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 1.5rem;
  margin-bottom: 0.15rem;
}

.calendar-day__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.625rem;
  height: 1.625rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-text, #1e293b);
}

.calendar-day--other-month .calendar-day__number {
  color: #94a3b8;
  font-weight: 500;
}

.calendar-day--weekend:not(.calendar-day--other-month) .calendar-day__number {
  color: #ef4444;
}

.calendar-day__number--today {
  background: var(--color-brand, #5263c7);
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(82, 99, 199, 0.35);
}

.calendar-day__badge {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--color-brand, #5263c7);
  background: #dbeafe;
  padding: 1px 6px;
  border-radius: 999px;
}

.calendar-tasks {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow: hidden;
  min-width: 0;
}

.calendar-task {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.45rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  background: #f1f5f9;
  color: #334155;
  border-left: 3px solid #94a3b8;
  transition: all 0.15s ease;
}

.calendar-task:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.calendar-task--urgent {
  background: #fee2e2;
  color: #991b1b;
  border-left-color: #ef4444;
}

.calendar-task--in_progress {
  background: #eff6ff;
  color: #1e40af;
  border-left-color: #3b82f6;
}

.calendar-task--accepted {
  background: #f0fdf4;
  color: #166534;
  border-left-color: #22c55e;
}

.calendar-task--submitted {
  background: #faf5ff;
  color: #6b21a8;
  border-left-color: #a855f7;
}

.calendar-task--revision {
  background: #fffbeb;
  color: #92400e;
  border-left-color: #f59e0b;
}

.calendar-task--completed {
  background: #f8fafc;
  color: #94a3b8;
  border-left-color: #cbd5e1;
  text-decoration: line-through;
  opacity: 0.75;
}

.calendar-task__title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}

/* ---------- Kanban Items ---------- */
.kanban-item {
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.kanban-item:hover {
  transform: translateY(-2px);
  border-color: var(--color-brand, #5263c7) !important;
  box-shadow: 0 4px 14px rgba(82, 99, 199, 0.15) !important;
}

/* ---------- Automation Schedule Builder ---------- */
.weekday-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  color: var(--color-text);
}

.weekday-chip:hover {
  border-color: var(--color-brand);
  background: var(--color-surface-muted);
}

.weekday-chip--active {
  background: var(--color-brand) !important;
  color: #ffffff !important;
  border-color: var(--color-brand) !important;
  box-shadow: 0 2px 6px rgba(82, 99, 199, 0.35);
}

/* ---------- Modern Custom Scrollbar ---------- */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
}

::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: 9999px;
  border: 1px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-brand, #5263c7);
  border: 1px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-corner {
  background: transparent;
}

dialog {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
}

/* ---------- Task Discussion Chat ---------- */
.chat-attach-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 2.375rem;
  width: 2.375rem;
  height: 2.375rem;
  min-height: 2.375rem;
  border: none;
  background: transparent;
  color: #64748b;
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  padding: 0;
  transition: all var(--duration-fast, 0.15s) var(--ease-standard, ease);
}

.chat-attach-btn:hover {
  background: var(--color-surface-muted, #f1f5f9);
  color: var(--color-brand, #5263c7);
}

.chat-attach-btn:active {
  transform: scale(0.92);
}

.chat-attach-btn--active {
  color: var(--color-brand, #5263c7) !important;
  background: #eff6ff !important;
}

/* ---------- Custom Styled Date Range Calendar Popover ---------- */
.vfx-date-bar {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  background: #f8fafc;
  padding: 0.3rem 0.55rem;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  max-width: 100%;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.02);
}

.vfx-date-input-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  padding: 0.18rem 0.45rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition: all 0.15s ease;
}

.vfx-date-input-wrap:hover {
  border-color: #94a3b8;
}

.vfx-date-input-wrap--active,
.vfx-date-input-wrap:focus-within {
  border-color: #0284c7 !important;
  background: #f0f9ff !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
}

.vfx-date-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem !important;
  height: 1.55rem !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  cursor: pointer;
  color: #0284c7;
  border-radius: 6px;
  transition: background 0.12s ease;
}

.vfx-date-icon-btn:hover {
  background: #e0f2fe !important;
}

.vfx-date-input {
  width: 5.6rem;
  min-height: 1.7rem;
  border: none;
  background: transparent;
  padding: 0;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #0f172a;
  outline: none;
}

.vfx-date-input::placeholder {
  color: #94a3b8;
  font-weight: 500;
}

.vfx-date-trigger {
  width: auto !important;
  min-height: 1.95rem !important;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.65rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.79rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition: all 0.15s ease;
}

.vfx-date-trigger:hover {
  border-color: #bae6fd;
  background: #f0f9ff;
  color: #0369a1;
}

.vfx-date-trigger--active {
  border-color: #0284c7 !important;
  background: #e0f2fe !important;
  color: #0369a1 !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.vfx-cal-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1200;
  width: min(304px, calc(100vw - 2rem));
  max-width: calc(100vw - 2rem);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 0.9rem;
  box-shadow: 0 18px 40px -10px rgba(15, 23, 42, 0.2), 0 4px 12px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  animation: vfxCalFadeIn 0.15s ease-out;
}

@keyframes vfxCalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.vfx-cal-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid #f1f5f9;
}

.vfx-cal-preset-chip {
  width: auto !important;
  min-height: 0 !important;
  padding: 0.25rem 0.55rem;
  border-radius: 7px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  font-size: 0.71rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s ease;
}

.vfx-cal-preset-chip:hover {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0369a1;
}

.vfx-cal-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  background: #f1f5f9;
  padding: 0.22rem;
  border-radius: 10px;
}

.vfx-cal-mode-tab {
  width: 100% !important;
  min-height: 0 !important;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.12s ease;
}

.vfx-cal-mode-tab--active {
  background: #ffffff;
  color: #0284c7;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.vfx-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.vfx-cal-nav-btn {
  width: 2rem !important;
  height: 2rem !important;
  min-height: 2rem !important;
  padding: 0;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s ease;
}

.vfx-cal-nav-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.vfx-cal-title-btn {
  width: auto !important;
  min-height: 2rem !important;
  padding: 0.25rem 0.75rem;
  border-radius: 9px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #0f172a;
  font-size: 0.84rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: all 0.12s ease;
}

.vfx-cal-title-btn:hover,
.vfx-cal-title-btn--open {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0369a1;
}

.vfx-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.69rem;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  padding-bottom: 0.2rem;
}

.vfx-cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.vfx-cal-day {
  width: 100% !important;
  height: 2.1rem !important;
  min-height: 2.1rem !important;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #1e293b;
  font-size: 0.79rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.1s ease;
}

.vfx-cal-day:hover:not(:disabled) {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0369a1;
  font-weight: 800;
}

.vfx-cal-day--muted {
  color: #cbd5e1;
  background: transparent;
  border-color: transparent;
}
}

.vfx-cal-day--in-range {
  background: #f0f9ff;
  color: #0369a1;
  border-radius: 4px;
  font-weight: 700;
}

.vfx-cal-day--selected {
  background: linear-gradient(135deg, #0ea5e9, #0284c7) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.32);
}

.vfx-cal-ym-picker {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.25rem 0;
}

.vfx-cal-year-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
}

.vfx-cal-year-btn,
.vfx-cal-month-btn {
  width: 100% !important;
  min-height: 2.05rem !important;
  padding: 0.3rem 0.4rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s ease;
}

.vfx-cal-year-btn:hover,
.vfx-cal-month-btn:hover {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0369a1;
}

.vfx-cal-year-btn--active,
.vfx-cal-month-btn--active {
  background: linear-gradient(135deg, #0ea5e9, #0284c7) !important;
  border-color: #0284c7 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
}

.vfx-cal-month-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}

@media (max-width: 40rem) {
  .vfx-cal-popover {
    right: 0 !important;
    left: auto !important;
    max-width: calc(100vw - 1.5rem);
  }
}

/* ---------- Universal Styled Action Buttons ---------- */
.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.35rem;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.825rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  white-space: nowrap;
}

.action-button--primary {
  border: 1px solid transparent;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.22);
}

.action-button--primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.32);
  transform: translateY(-1px);
}

.action-button--secondary {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155 !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.action-button--secondary:hover:not(:disabled) {
  border-color: #94a3b8;
  background: #f8fafc;
  color: #0f172a !important;
}

.action-button--danger {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #dc2626 !important;
}

.action-button--danger:hover:not(:disabled) {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c !important;
}

.action-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

/* ---------- Feedback & Bug Report Dialog ---------- */
.feedback-dialog {
  border: none;
  background: transparent;
  padding: 0;
  max-width: 540px;
  width: calc(100% - 2rem);
  box-sizing: border-box;
  margin: auto;
}

.feedback-dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}

.feedback-dialog[open] {
  animation: dialog-in 0.18s cubic-bezier(0.2, 0, 0, 1);
}

.feedback-modal__card {
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid var(--color-border, #e2e8f0);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.16);
  padding: 1.5rem 1.65rem;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  max-height: 90vh;
  overflow-y: auto;
}

.feedback-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.15rem;
}

.feedback-modal__icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  color: #5263c7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(82, 99, 199, 0.18);
}

.feedback-modal__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
}

.feedback-modal__subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.8125rem;
  color: #64748b;
  line-height: 1.35;
}

.feedback-modal__close-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  padding: 4px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
}

.feedback-modal__close-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.feedback-context-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem 0.85rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.75rem 0.95rem;
  font-size: 0.8125rem;
  margin-bottom: 1.15rem;
}

.feedback-context-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.feedback-context-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #64748b;
  font-weight: 600;
  font-size: 0.775rem;
  flex-shrink: 0;
}

.feedback-context-icon {
  color: #5263c7;
  flex-shrink: 0;
}

.feedback-context-value {
  color: #0f172a;
  font-weight: 700;
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feedback-form__label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.35rem;
}

.feedback-form__select,
.feedback-form__textarea {
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 0.84rem;
  color: #0f172a;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 9px;
  padding: 0.6rem 0.8rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.feedback-form__select:focus,
.feedback-form__textarea:focus {
  border-color: #5263c7;
  box-shadow: 0 0 0 3px rgba(82, 99, 199, 0.15);
}

.feedback-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 1.15rem 1rem;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.feedback-dropzone:hover,
.feedback-dropzone.is-dragover {
  border-color: #5263c7;
  background: #eef2ff;
}

.feedback-files-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.feedback-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.3rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #1e293b;
  max-width: 100%;
}

.feedback-file-chip__name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feedback-file-chip__remove {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  padding: 2px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  line-height: 1;
}

.feedback-file-chip__remove:hover {
  color: #ef4444;
  background: #fee2e2;
}

/* Feedback Modal Buttons */
.feedback-modal__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.65rem;
}

.feedback-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.65rem;
  padding: 0 1.35rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  box-sizing: border-box;
  text-decoration: none;
  line-height: 1;
}

.feedback-btn--secondary {
  background: #ffffff;
  color: #475569;
  border: 1px solid #cbd5e1;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.feedback-btn--secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.feedback-btn--secondary:active {
  background: #f1f5f9;
  transform: translateY(1px);
}

.feedback-btn--primary {
  background: #5263c7;
  color: #ffffff;
  border: 1px solid #5263c7;
  box-shadow: 0 2px 6px rgba(82, 99, 199, 0.32);
}

.feedback-btn--primary:hover {
  background: #4351a8;
  border-color: #4351a8;
  box-shadow: 0 4px 12px rgba(82, 99, 199, 0.4);
  transform: translateY(-1px);
}

.feedback-btn--primary:active {
  background: #38448f;
  border-color: #38448f;
  transform: translateY(0);
}

.feedback-btn--primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.feedback-btn--success {
  min-width: 140px;
  margin-top: 0.5rem;
}

@media (max-width: 600px) {
  .feedback-modal__card {
    padding: 1.25rem 1rem;
    width: 95vw;
  }
  .feedback-context-box {
    grid-template-columns: 1fr;
  }
  .feedback-modal__actions {
    flex-direction: column-reverse;
  }
  .feedback-btn {
    width: 100%;
  }
}





/* ---------- Mobile Responsive Enhancements ---------- */
.iiko-dishes-grid {
  grid-template-columns: minmax(290px, 350px) 1fr;
}
.iiko-creds-grid {
  grid-template-columns: 1fr 1fr;
}
.kanban-item__delete-btn {
  position: relative;
}
.kanban-item__delete-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 44px;
  min-height: 44px;
}

@media (max-width: 48rem) {
  .iiko-dishes-grid {
    grid-template-columns: 1fr !important;
  }
  input, select, textarea, .task-form__input, .task-form__textarea, .task-list__select {
    font-size: 16px !important;
  }
}

@media (max-width: 32rem) {
  .iiko-creds-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 30rem) {
  #chat-submit-btn span {
    display: none !important;
  }
}

/* ---------- Automation Rules Card & Compact Delete Button ---------- */
.automation-rule-card {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 1rem !important;
}

.automation-rule-card button,
.rule-delete-btn {
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: fit-content !important;
  white-space: nowrap !important;
}

.rule-delete-btn:hover {
  background: #fee2e2 !important;
  border-color: #fca5a5 !important;
  color: #b91c1c !important;
  transform: translateY(-1px);
}

.rule-delete-btn:active {
  transform: translateY(0);
}
  #chat-submit-btn {
    padding: 0.55rem 0.75rem !important;
  }
}

/* ---------- Head KPI Constructor & Tabs ---------- */
.head-kpi-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.25s ease;
  border-radius: 24px;
}
.head-kpi-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s ease;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
input:checked + .head-kpi-slider {
  background-color: #4f46e5 !important;
}
input:checked + .head-kpi-slider:before {
  transform: translateX(20px);
}

.head-metric-card {
  background: #ffffff;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}
.head-metric-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
}

.analytics-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  border: none;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  background: transparent;
  color: #64748b;
  transition: all 0.15s ease;
}
.analytics-mode-btn--active {
  background: #ffffff !important;
  color: #0f172a !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.custom-picker-nav-btn:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}
.custom-month-grid-btn {
  padding: 0.5rem 0.25rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: #f8fafc;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.custom-month-grid-btn:hover {
  background: #e0e7ff;
  color: #4338ca;
  border-color: #c7d2fe;
}
.custom-month-grid-btn--active {
  background: #4f46e5 !important;
  color: #ffffff !important;
  border-color: #4338ca !important;
}

/* Head KPI Constructor Grid & Mobile Adaptation */
#kpi-dialog,
#head-facts-dialog {
  box-sizing: border-box !important;
  width: min(calc(100% - 1.5rem), 680px) !important;
  max-width: 680px !important;
  height: min(92dvh, 760px) !important;
  max-height: min(92dvh, 760px) !important;
  margin: auto !important;
  padding: 0 !important;
  border: none !important;
  border-radius: var(--radius-xl, 16px) !important;
  overflow: hidden !important;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.28) !important;
  background: var(--color-surface, #ffffff) !important;
}

#kpi-dialog[open],
#head-facts-dialog[open] {
  display: flex !important;
  flex-direction: column !important;
}

#kpi-dialog:not([open]),
#head-facts-dialog:not([open]) {
  display: none !important;
}

#kpi-dialog::backdrop,
#head-facts-dialog::backdrop {
  background: rgba(15, 23, 42, 0.6) !important;
  backdrop-filter: blur(2px) !important;
}

#kpi-form,
#head-facts-form {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}

#kpi-dialog .task-form__heading,
#head-facts-dialog .task-form__heading {
  flex: 0 0 auto !important;
  padding: 1.1rem 1.35rem 0.85rem !important;
  border-bottom: 1px solid var(--color-border, #e2e8f0) !important;
  background: #ffffff !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  position: static !important;
}

#kpi-dialog-scroll-body,
#head-facts-scroll-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  padding: 1rem 1.35rem !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0.85rem !important;
}

#kpi-dialog .task-form__actions,
#head-facts-dialog .task-form__actions {
  flex: 0 0 auto !important;
  padding: 0.85rem 1.35rem !important;
  border-top: 1px solid var(--color-border, #e2e8f0) !important;
  background: #ffffff !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: row !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 0.5rem !important;
  position: static !important;
}

.head-metric-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.15s ease;
}

.head-metric-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
}

.head-metric-row-middle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.head-metric-row-bottom {
  display: grid;
  grid-template-columns: 1.1fr 0.8fr 1.1fr 0.8fr;
  gap: 0.45rem;
}

/* Mobile Responsiveness for screens <= 580px */
@media (max-width: 580px) {
  #dept-dialog,
  #emp-dialog,
  #company-settings-dialog,
  #kpi-dialog,
  #head-facts-dialog {
    width: calc(100% - 0.75rem) !important;
    max-width: 100vw !important;
    height: auto !important;
    max-height: calc(100dvh - 0.75rem) !important;
    margin: auto !important;
    border-radius: 14px !important;
  }

  #kpi-dialog,
  #head-facts-dialog {
    height: calc(100dvh - 0.75rem) !important;
  }

  #kpi-dialog .task-form__heading,
  #head-facts-dialog .task-form__heading {
    padding: 0.75rem 0.85rem 0.65rem !important;
  }

  #kpi-dialog-scroll-body,
  #head-facts-scroll-body {
    padding: 0.75rem 0.85rem !important;
    gap: 0.65rem !important;
  }

  #kpi-dialog .task-form__actions,
  #head-facts-dialog .task-form__actions {
    padding: 0.65rem 0.85rem !important;
    gap: 0.4rem !important;
    display: flex !important;
    flex-direction: row !important;
  }

  #kpi-dialog .task-form__actions button,
  #head-facts-dialog .task-form__actions button {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    padding: 0 0.5rem !important;
    font-size: 0.8125rem !important;
    text-align: center !important;
    justify-content: center !important;
  }

  .head-metric-card {
    padding: 0.65rem 0.75rem !important;
    gap: 0.5rem !important;
  }

  .head-metric-top-row {
    flex-wrap: wrap !important;
    gap: 0.4rem !important;
  }
  .head-metric-top-row > div:first-child {
    min-width: 100% !important;
  }
  .head-metric-top-row > div:last-child {
    width: 100% !important;
    justify-content: space-between !important;
  }

  .head-metric-row-middle {
    grid-template-columns: 1fr !important;
    gap: 0.4rem !important;
  }

  .head-metric-row-bottom {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.45rem 0.4rem !important;
  }

  .head-fact-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.5rem !important;
  }
  .head-fact-row > div:last-child {
    display: flex !important;
    justify-content: flex-end !important;
  }

  .head-metric-del-btn {
    padding: 0.2rem 0.35rem !important;
  }

  #head-kpi-apply-all-btn {
    width: 100% !important;
    justify-content: center !important;
    margin-top: 0.35rem !important;
  }

  #analytics-mode-switcher {
    width: 100% !important;
    display: flex !important;
  }

  .analytics-mode-btn {
    flex: 1 1 0 !important;
    justify-content: center !important;
    padding: 0.45rem 0.5rem !important;
    font-size: 0.75rem !important;
  }

  #heads-month-dropdown {
    width: calc(100vw - 2rem) !important;
    max-width: 290px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
  }

  .kpi-tab-btn-text-full {
    display: none !important;
  }
  .kpi-tab-btn-text-short {
    display: inline !important;
  }
}

.kpi-tab-btn-text-short {
  display: none;
}


/* ---------- Analytics Page Mobile Responsiveness (<= 768px / <= 48rem) ---------- */
.analytics-mobile-cards-wrap,
.heads-mobile-cards-wrap {
  display: none;
}

@media (max-width: 48rem) {
  .analytics-desktop-table-wrap,
  .heads-desktop-table-wrap {
    display: none !important;
  }

  .analytics-mobile-cards-wrap,
  .heads-mobile-cards-wrap {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.85rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .heads-table-card,
  #employees-view-container > div:nth-child(2) {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
  }

  #my-kpi-summary-bar {
    padding: 0.95rem 1rem !important;
    gap: 0.85rem !important;
    margin-bottom: 0.9rem !important;
  }

  .analytics-rewards-showcase {
    padding: 1.1rem 1rem !important;
    margin-top: 1rem !important;
  }

  .heads-summary-grid {
    grid-template-columns: 1fr !important;
    gap: 0.65rem !important;
  }

  .heads-summary-grid > div {
    padding: 0.85rem 1rem !important;
  }

  .heads-month-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
    padding: 0.85rem 1rem !important;
  }

  .heads-month-bar > div:first-child {
    width: 100% !important;
    justify-content: space-between !important;
  }

  .heads-month-bar > div:last-child {
    font-size: 0.75rem !important;
    width: 100% !important;
  }

  #custom-period-fields {
    width: 100% !important;
  }

  #custom-period-fields input {
    flex: 1 1 calc(50% - 1rem) !important;
    min-width: 0 !important;
  }

  #custom-period-fields button {
    width: 100% !important;
    margin-top: 0.25rem !important;
  }

  .workspace__header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
  }

  .workspace__header > div:last-child {
    width: 100% !important;
  }

  .workspace__header select {
    width: 100% !important;
    flex: 1 1 100% !important;
  }
}
