:root {
  --ink: #1f1b25;
  --muted: #766f7c;
  --line: #e6e0da;
  --paper: #fbfaf8;
  --surface: #ffffff;
  --canvas: #f4f1ed;
  --purple: #6e36d8;
  --purple-dark: #5623b9;
  --purple-soft: #eee7fb;
  --green: #187b60;
  --green-soft: #e3f4ee;
  --amber: #9a5b13;
  --amber-soft: #fff0d7;
  --red: #bd3a4a;
  --shadow: 0 18px 48px rgba(38, 28, 45, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }

html { min-width: 980px; background: var(--canvas); }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 80% -10%, rgba(110, 54, 216, 0.07), transparent 28rem),
    var(--canvas);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button { color: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 236px minmax(0, 1fr); }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px 18px 20px;
  display: flex;
  flex-direction: column;
  background: rgba(252, 251, 249, 0.9);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(20px);
}

.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 26px; }
.brand-mark {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 13px; color: white; font-weight: 900; font-size: 21px;
  background: linear-gradient(145deg, #8a4ff2, #5723bd);
  box-shadow: 0 9px 22px rgba(110, 54, 216, 0.3);
}
.brand strong, .brand span { display: block; }
.brand strong { letter-spacing: -0.02em; }
.brand span { margin-top: 3px; color: var(--muted); font-size: 12px; }

.nav-list { display: grid; gap: 6px; }
.nav-item {
  width: 100%; min-height: 46px; padding: 0 12px; display: flex; align-items: center; gap: 11px;
  border: 0; border-radius: 13px; background: transparent; color: #615a67; cursor: pointer;
  text-align: left; transition: 150ms ease;
}
.nav-item:hover { background: #f0ece7; color: var(--ink); }
.nav-item.is-active { color: var(--purple-dark); background: var(--purple-soft); font-weight: 700; }
.nav-icon { width: 24px; font-size: 20px; text-align: center; }
.nav-count {
  min-width: 23px; height: 23px; margin-left: auto; padding: 0 7px; display: grid; place-items: center;
  border-radius: 999px; background: rgba(110, 54, 216, 0.12); font-size: 12px;
}

.sidebar-footer {
  margin-top: auto; padding: 15px 12px; display: flex; align-items: flex-start; gap: 10px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
}
.sidebar-footer strong, .sidebar-footer span { display: block; }
.sidebar-footer strong { font-size: 12px; }
.sidebar-footer span { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.connection-dot { width: 9px; height: 9px; margin-top: 3px; flex: 0 0 auto; border-radius: 99px; background: #d79730; box-shadow: 0 0 0 4px #f7e8cb; }
.connection-dot.real { background: #2d9a78; box-shadow: 0 0 0 4px #dff2eb; }
.admin-only { display: none; }
body.is-admin .admin-only { display: flex; }
.labels-only { display: none; }
body.can-manage-labels .labels-only { display: flex; }

.main-area { min-width: 0; padding: 0 38px 56px; }
.topbar {
  min-height: 108px; display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--line);
}
.eyebrow { margin: 0 0 5px; color: var(--purple); font-size: 11px; font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 29px; letter-spacing: -0.035em; }
h2 { margin-bottom: 0; font-size: 25px; letter-spacing: -0.03em; }
h3 { margin-bottom: 4px; letter-spacing: -0.015em; }

.topbar-actions { display: flex; align-items: center; gap: 18px; }
.account-switcher { min-width: 170px; display: grid; gap: 4px; }
.account-switcher > span { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.account-switcher select {
  max-width: 210px; height: 38px; padding: 0 32px 0 10px; border: 1px solid #d9cdef; border-radius: 11px;
  outline: none; background: #f7f2ff; color: var(--purple-dark); font-size: 11px; font-weight: 800; cursor: pointer;
}
.account-switcher select:focus { border-color: #a88ae0; box-shadow: 0 0 0 3px var(--purple-soft); }
.sync-state { text-align: right; }
.sync-state span, .sync-state strong { display: block; }
.sync-state span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; }
.sync-state strong { margin-top: 3px; font-size: 12px; }
.user-menu { position: relative; }
.user-chip {
  min-height: 46px; padding: 5px 10px 5px 6px; display: flex; align-items: center; gap: 9px;
  border: 1px solid var(--line); border-radius: 13px; background: var(--surface); cursor: pointer; text-align: left;
}
.user-chip > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: white; background: var(--purple); font-size: 12px; font-weight: 900; }
.user-chip strong, .user-chip small { display: block; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip strong { font-size: 11px; }
.user-chip small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.user-chip[aria-expanded="true"] { border-color: #bfa9e8; box-shadow: 0 0 0 3px var(--purple-soft); }
.user-popover { width: 260px; padding: 14px; position: absolute; z-index: 80; top: calc(100% + 8px); right: 0; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,0.98); box-shadow: 0 18px 44px rgba(36, 27, 43, 0.16); }
.user-popover[hidden] { display: none; }
.user-popover-heading strong, .user-popover-heading span { display: block; }
.user-popover-heading strong { font-size: 13px; }
.user-popover-heading span { margin-top: 3px; color: var(--purple-dark); font-size: 10px; font-weight: 800; }
.user-popover p { margin: 11px 0 13px; padding: 10px; border-radius: 9px; background: #f7f4f1; color: var(--muted); font-size: 10px; line-height: 1.45; }
.user-logout-button { width: 100%; min-height: 38px; border: 1px solid #efc4ca; border-radius: 10px; background: #fff4f5; color: var(--red); font: inherit; font-size: 11px; font-weight: 800; cursor: pointer; }
.user-logout-button:hover { background: #fbe7ea; }
.user-logout-button:focus-visible { outline: 3px solid rgba(193, 57, 79, 0.18); outline-offset: 2px; }

.button {
  min-height: 42px; padding: 0 16px; display: inline-flex; justify-content: center; align-items: center; gap: 8px;
  border: 1px solid transparent; border-radius: 12px; font-weight: 700; font-size: 13px; cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { opacity: 0.45; cursor: not-allowed; }
.button[hidden] { display: none; }
.button-primary { color: white; background: var(--purple); box-shadow: 0 8px 20px rgba(110, 54, 216, 0.2); }
.button-primary:hover:not(:disabled) { background: var(--purple-dark); }
.button-secondary { border-color: var(--line); background: var(--surface); }
.button-secondary:hover:not(:disabled) { background: #f8f5f2; }
.button-quiet { min-height: 36px; padding: 0 12px; color: var(--purple-dark); background: var(--purple-soft); }
.button-success { color: var(--green); background: var(--green-soft); }
.button-icon { font-size: 19px; font-weight: 400; }
.is-loading .button-icon { animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.view { display: none; padding-top: 28px; }
.view.is-visible { display: block; animation: appear 180ms ease; }
@keyframes appear { from { opacity: 0; transform: translateY(4px); } }

.stats-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.stat-card {
  min-height: 126px; padding: 19px 20px; position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 4px 18px rgba(32, 25, 37, 0.025);
  color: var(--ink); font: inherit; text-align: left;
}
.stat-card span, .stat-card strong, .stat-card small { display: block; }
.stat-card span { color: var(--muted); font-size: 12px; font-weight: 700; }
.stat-card strong { margin: 9px 0 4px; font-size: 34px; line-height: 1; letter-spacing: -0.04em; }
.stat-card small { color: #9a929e; font-size: 11px; }
.stat-switch { cursor: pointer; transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease, background 140ms ease; }
.stat-switch:hover { transform: translateY(-2px); border-color: #cfc1eb; box-shadow: 0 9px 24px rgba(71, 42, 112, 0.09); }
.stat-switch:focus-visible { outline: 3px solid rgba(116, 67, 207, 0.24); outline-offset: 3px; }
.stat-switch.is-active { border-color: #c9b3f1; background: linear-gradient(145deg, #faf8ff, #eee4ff); box-shadow: 0 8px 24px rgba(83, 43, 151, 0.11); }
.stat-switch.is-active strong { color: var(--purple-dark); }
.stat-switch.is-active::after { content: "Открыто"; position: absolute; top: 17px; right: 18px; padding: 4px 7px; border-radius: 7px; color: var(--purple-dark); background: rgba(116, 67, 207, 0.1); font-size: 8px; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; }
.stat-warning { background: linear-gradient(145deg, #fffdf9, #fff5e6); }
.stat-warning strong { color: var(--amber); }
.stat-next:not(.is-active) { background: linear-gradient(145deg, #fbfdff, #eef6ff); }
.stat-next:not(.is-active) strong { color: #2563a5; }
.shift-strip {
  margin-top: 14px; min-height: 68px; padding: 11px 16px; display: grid; grid-template-columns: 1.25fr repeat(4, 1fr); gap: 8px;
  border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,0.72);
}
.shift-strip > div { padding: 3px 14px; display: flex; flex-direction: column; justify-content: center; border-left: 1px solid var(--line); }
.shift-strip > div:first-child { border-left: 0; padding-left: 4px; }
.shift-strip span { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.shift-strip strong { margin-top: 5px; font-size: 16px; }
.shift-strip .shift-money strong { color: var(--green); }

.workspace-toolbar { margin: 22px 0 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.label-profile-select { height: 42px; padding: 0 34px 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; font-size: 11px; font-weight: 800; }
.search-field {
  min-width: 220px; flex: 1; height: 44px; padding: 0 13px; display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted);
}
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }

.notice { padding: 14px 16px; display: flex; align-items: center; gap: 13px; border: 1px solid #ddcff6; border-radius: 15px; background: #f8f4ff; }
.demo-notice[hidden] { display: none; }
.notice-icon { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; color: white; background: var(--purple); font-weight: 800; }
.notice strong { display: block; font-size: 12px; }
.notice p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.owner-shift-notice { margin-top: 12px; border-color: #efc68e; background: #fff7e9; }
.owner-shift-notice[hidden] { display: none; }
.owner-shift-notice .notice-icon { background: #b96b09; }
.future-shipment-notice { margin-top: 12px; border-color: #b9d5ef; background: #f2f8ff; }
.future-shipment-notice[hidden] { display: none; }
.future-shipment-notice .notice-icon { background: #347ab5; }
.text-button { margin-left: auto; border: 0; background: transparent; color: var(--purple-dark); font-size: 12px; font-weight: 800; cursor: pointer; }

.product-groups { margin-top: 14px; display: grid; gap: 12px; }
.product-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; box-shadow: 0 5px 20px rgba(32, 25, 37, 0.035); }
.product-card-header { min-height: 78px; padding: 13px 15px; display: flex; align-items: center; gap: 13px; }
.product-thumb {
  width: 50px; height: 50px; display: grid; place-items: center; flex: 0 0 auto;
  border-radius: 13px; overflow: hidden; color: white; font-size: 20px; font-weight: 900;
  background: linear-gradient(145deg, #bb98ef, #6e36d8);
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-identity { min-width: 0; }
.product-identity h3 { margin: 0 0 5px; font-size: 16px; }
.product-meta { display: flex; gap: 12px; color: var(--muted); font-size: 11px; }
.product-total { margin-left: auto; text-align: right; }
.product-total strong, .product-total span { display: block; }
.product-total strong { font-size: 24px; letter-spacing: -0.04em; }
.product-total span { color: var(--muted); font-size: 10px; }
.product-header-action { margin-left: 13px; }

.size-list { border-top: 1px solid var(--line); }
.size-row { min-height: 68px; padding: 10px 15px 10px 78px; display: grid; grid-template-columns: minmax(100px, 0.7fr) minmax(120px, 0.8fr) 92px minmax(330px, auto); align-items: center; gap: 12px; }
.size-row + .size-row { border-top: 1px solid #eee9e4; }
.size-name strong, .size-name span { display: block; }
.size-name strong { font-size: 14px; }
.size-name span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.location-pill { width: fit-content; padding: 5px 9px; border-radius: 8px; background: #f2efec; color: #645c69; font-size: 10px; }
.location-pill.is-empty { color: var(--amber); background: var(--amber-soft); }
.quantity { display: flex; align-items: baseline; gap: 5px; }
.quantity strong { font-size: 21px; }
.quantity span { color: var(--muted); font-size: 10px; }
.row-actions { display: flex; justify-content: flex-end; gap: 7px; }
.label-missing { color: var(--amber) !important; background: var(--amber-soft) !important; }

.section-heading { margin-bottom: 20px; display: flex; justify-content: space-between; align-items: end; gap: 24px; }
.section-heading > p { max-width: 480px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; text-align: right; }
.heading-actions { display: flex; align-items: center; gap: 12px; }
.catalog-progress { color: var(--muted); font-size: 12px; font-weight: 700; }

.supply-list { display: grid; gap: 12px; }
.supply-card { padding: 19px 20px; display: grid; grid-template-columns: 1fr auto; gap: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.supply-card h3 { margin: 0 0 7px; }
.supply-card p { margin: 0; color: var(--muted); font-size: 12px; }
.supply-badges { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.badge { padding: 6px 9px; border-radius: 8px; background: #f2efec; color: #615a67; font-size: 10px; font-weight: 700; }
.badge.green { color: var(--green); background: var(--green-soft); }
.badge.purple { color: var(--purple-dark); background: var(--purple-soft); }
.badge.amber { color: var(--amber); background: var(--amber-soft); }
.badge.red { color: var(--red); background: #fff0f2; }
.supply-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.supply-box-setup { display: flex; align-items: end; gap: 8px; }
.supply-box-setup label { display: grid; gap: 3px; color: var(--muted); font-size: 9px; font-weight: 700; }
.supply-box-setup .field-control { width: 70px; height: 38px; }
.supply-external-note { max-width: 160px; color: var(--muted); font-size: 10px; line-height: 1.35; text-align: right; }
.supply-card .supply-sync-error { margin-top: 9px; color: var(--red); font-size: 10px; line-height: 1.45; }
.supply-warning { padding: 16px 18px; display: grid; gap: 4px; border: 1px solid #efc483; border-radius: var(--radius); background: #fff7e9; color: #8a500c; }
.supply-warning span { font-size: 11px; line-height: 1.45; }

.catalog-table-wrap { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.catalog-table { width: 100%; border-collapse: collapse; }
.catalog-table th { padding: 13px 17px; color: var(--muted); background: #f8f6f3; font-size: 10px; text-align: left; text-transform: uppercase; letter-spacing: 0.08em; }
.catalog-table td { padding: 14px 17px; border-top: 1px solid var(--line); vertical-align: middle; }
.catalog-product { display: flex; align-items: center; gap: 11px; }
.catalog-product .product-thumb { width: 40px; height: 40px; border-radius: 10px; font-size: 15px; }
.catalog-product strong, .catalog-product span { display: block; }
.catalog-product strong { font-size: 13px; }
.catalog-product span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.pdf-status { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; }
.pdf-status.ready { color: var(--green); }
.pdf-status.missing { color: var(--amber); }
.pdf-pair { display: grid; gap: 6px; }
.pdf-actions { display: grid; gap: 6px; }
.location-input { width: 150px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 9px; outline: none; background: var(--paper); font-size: 11px; }
.location-input:focus { border-color: #b89ce9; box-shadow: 0 0 0 3px var(--purple-soft); }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.settings-card { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 5px 20px rgba(32, 25, 37, 0.03); }
.settings-card-wide { grid-column: 1 / -1; }
.settings-card-heading { margin-bottom: 19px; display: flex; gap: 12px; align-items: center; }
.settings-card-heading h3 { font-size: 16px; }
.settings-card-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.active-account-card { margin-bottom: 14px; padding: 12px 14px; display: grid; gap: 3px; border: 1px solid #d9cdef; border-radius: 11px; background: #f8f4ff; }
.active-account-card span { color: var(--purple); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.active-account-card strong { font-size: 14px; }
.active-account-card small { color: var(--muted); font-size: 9px; }
.settings-icon { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; font-size: 12px; font-weight: 900; }
.settings-icon.purple { color: var(--purple-dark); background: var(--purple-soft); }
.settings-icon.green { color: var(--green); background: var(--green-soft); }
.settings-icon.sand { color: var(--amber); background: var(--amber-soft); }
.settings-icon.blue { color: #2563a5; background: #edf6ff; }
.field-label { margin: 13px 0 6px; display: block; color: #5d5662; font-size: 11px; font-weight: 700; }
.field-control { width: 100%; height: 42px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; outline: none; background: var(--paper); color: var(--ink); }
.field-control:focus { border-color: #b89ce9; box-shadow: 0 0 0 3px var(--purple-soft); }
.password-field { position: relative; }
.password-field .field-control { padding-right: 128px; }
.password-toggle { height: 30px; padding: 0 9px; position: absolute; top: 6px; right: 6px; border: 0; border-radius: 7px; background: var(--purple-soft); color: var(--purple-dark); font: inherit; font-size: 9px; font-weight: 800; cursor: pointer; }
.password-toggle:hover { background: #e7dcfa; }
.password-toggle:focus-visible { outline: 3px solid rgba(116, 67, 207, 0.2); outline-offset: 1px; }
.password-toggle[aria-pressed="true"] { color: var(--green); background: var(--green-soft); }
.token-row { display: flex; align-items: center; gap: 8px; }
.token-row .field-control { flex: 1; }
.field-hint { margin: 10px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.moysklad-fields { margin-top: 10px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.setting-status { margin-top: 10px; min-height: 18px; color: var(--muted); font-size: 10px; }
.setting-status.ok { color: var(--green); }
.connection-test-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.connection-test-row .setting-status { flex: 1; }
.access-check { margin-top: 8px; padding: 10px 12px; display: grid; gap: 7px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.access-check[hidden] { display: none; }
.access-check-row { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 10px; }
.access-check-row strong { color: var(--green); }
.access-check-row.is-error strong { color: var(--red); }
.inline-settings { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto; align-items: end; gap: 20px; }

.team-layout { display: grid; grid-template-columns: minmax(280px, 0.7fr) minmax(520px, 1.6fr); gap: 16px; align-items: start; }
.form-submit, .auth-submit { width: 100%; margin-top: 18px; }
.report-toolbar { display: flex; align-items: end; gap: 10px; }
.report-toolbar > div { margin-right: auto; }
.report-toolbar h3 { margin: 0; }
.report-toolbar label { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.report-toolbar input { height: 38px; margin-top: 5px; padding: 0 8px; display: block; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--ink); }
.report-total { margin: 20px 0 12px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; border-radius: 12px; background: var(--green-soft); color: var(--green); }
.report-total span { font-size: 11px; font-weight: 700; }
.report-total strong { font-size: 21px; }
.report-recovery { margin: 0 0 12px; padding: 12px; display: grid; grid-template-columns: minmax(220px, 1fr) minmax(150px, 220px) auto; align-items: center; gap: 10px; border: 1px solid #efc68e; border-radius: 12px; background: #fff7e9; }
.report-recovery[hidden] { display: none; }
.report-recovery strong { color: #9a5705; font-size: 11px; }
.report-recovery p { margin: 3px 0 0; color: var(--muted); font-size: 9px; line-height: 1.4; }
.team-table-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.team-table { width: 100%; border-collapse: collapse; }
.team-table th, .team-table td { padding: 10px 12px; text-align: left; border-top: 1px solid var(--line); font-size: 11px; }
.team-table th { border-top: 0; color: var(--muted); background: #f8f6f3; font-size: 9px; text-transform: uppercase; }
.team-table td:last-child { color: var(--green); font-weight: 800; }
.team-list-heading { margin-top: 30px; }
.manager-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.manager-card { padding: 17px; display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.manager-avatar { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 13px; color: white; background: linear-gradient(145deg, #9b70e7, #6730ca); font-weight: 900; }
.manager-card h3 { margin: 0 0 4px; font-size: 14px; }
.manager-card p { margin: 0; color: var(--muted); font-size: 10px; }
.manager-kpis { margin-top: 8px; display: flex; gap: 7px; }
.manager-label-select { margin-top: 8px; height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); font-size: 10px; }
.manager-kpis span { padding: 4px 7px; border-radius: 7px; background: #f4f1ee; color: #655e69; font-size: 9px; }
.manager-state { padding: 6px 8px; border: 0; border-radius: 8px; color: var(--green); background: var(--green-soft); font-size: 9px; font-weight: 800; cursor: pointer; }
.manager-state.off { color: var(--red); background: #fbe7ea; }

.auth-gate { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; padding: 30px; background: radial-gradient(circle at 55% 20%, #eee5fb, transparent 36rem), #f4f1ed; }
body.is-authenticated .auth-gate { display: none; }
.auth-panel { width: min(420px, 100%); padding: 34px; border: 1px solid var(--line); border-radius: 24px; background: rgba(255,255,255,0.92); box-shadow: var(--shadow); }
.auth-logo { width: 52px; height: 52px; margin-bottom: 25px; display: grid; place-items: center; border-radius: 16px; color: white; background: linear-gradient(145deg, #8a4ff2, #5723bd); box-shadow: 0 10px 25px rgba(110,54,216,.28); font-size: 25px; font-weight: 900; }
.auth-panel h1 { margin-bottom: 10px; }
.auth-copy { color: var(--muted); font-size: 12px; line-height: 1.55; }
.auth-error { min-height: 18px; margin: 12px 0 0; color: var(--red); font-size: 11px; }
.auth-local { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: #9b949e; font-size: 9px; text-align: center; text-transform: uppercase; letter-spacing: .08em; }

.empty-state { padding: 72px 20px; text-align: center; color: var(--muted); }
.empty-state > div { width: 54px; height: 54px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 17px; color: var(--green); background: var(--green-soft); font-size: 24px; }
.empty-state h2 { color: var(--ink); font-size: 20px; }
.empty-state p { margin: 8px 0 0; font-size: 12px; }

.confirm-dialog { width: min(440px, calc(100vw - 40px)); padding: 0; border: 0; border-radius: 22px; color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.confirm-dialog::backdrop { background: rgba(25, 20, 29, 0.44); backdrop-filter: blur(3px); }
.confirm-dialog form { padding: 27px; }
.dialog-icon { width: 44px; height: 44px; margin-bottom: 17px; display: grid; place-items: center; border-radius: 13px; color: var(--purple-dark); background: var(--purple-soft); font-size: 22px; }
.confirm-dialog h2 { font-size: 21px; }
.confirm-dialog p { margin: 10px 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.dialog-summary { margin: 15px 0; padding: 12px 14px; border-radius: 11px; background: #f7f4f1; font-size: 12px; }
.dialog-actions { margin-top: 22px; display: flex; justify-content: flex-end; gap: 8px; }

.toast-region { position: fixed; z-index: 100; right: 24px; bottom: 24px; width: 340px; display: grid; gap: 9px; }
.toast { padding: 13px 15px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,0.97); box-shadow: var(--shadow); animation: toast-in 180ms ease; }
.toast strong, .toast span { display: block; }
.toast strong { font-size: 12px; }
.toast span { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.toast.error { border-color: #f0bbc3; }
.toast.error strong { color: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } }

@media (max-width: 1120px) {
  .main-area { padding-left: 25px; padding-right: 25px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .size-row { padding-left: 20px; grid-template-columns: 110px 130px 75px minmax(310px, 1fr); }
  .shift-strip { grid-template-columns: repeat(5, 1fr); }
  .team-layout { grid-template-columns: 1fr; }
  .topbar-actions { gap: 10px; }
  .account-switcher { min-width: 140px; }
  .account-switcher select { max-width: 160px; }
}

@media print {
  .sidebar, .topbar, .workspace-toolbar, .notice { display: none !important; }
  .app-shell { display: block; }
  .main-area { padding: 0; }
}
