:root {
  --bg: #f3efe7;
  --panel: #fffdf8;
  --panel-strong: #fff7e8;
  --line: #d9cdbd;
  --text: #241b14;
  --muted: #75685d;
  --accent: #a63d1f;
  --accent-soft: #f7d6c7;
  --green: #2f7d4b;
  --green-soft: #dff3e5;
  --teal: #0f766e;
  --blue-strong: #1d4ed8;
  --amber: #b06c00;
  --amber-soft: #fbecc7;
  --red: #b63a2b;
  --red-soft: #fad8d4;
  --violet: #7c3aed;
  --cyan: #0f766e;
  --cyan-soft: #d8f5f1;
  --slate-strong: #243446;
  --module-dashboard: #a63d1f;
  --module-machine: #ea580c;
  --module-cutting: #0f4c81;
  --module-inventory: #15803d;
  --module-clients: #0f766e;
  --module-expenses: #b45309;
  --module-internal-tasks: #0f766e;
  --module-users: #334155;
  --shadow: 0 18px 40px rgba(36, 27, 20, 0.09);
  --radius: 22px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(247, 214, 199, 0.75), transparent 26%),
    radial-gradient(circle at bottom right, rgba(223, 243, 229, 0.6), transparent 24%),
    var(--bg);
  color: var(--text);
  font: 15px/1.45 "Segoe UI", "Trebuchet MS", sans-serif;
}

a { color: inherit; text-decoration: none; }

.shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}

.sidebar {
  background:
    radial-gradient(circle at top right, rgba(249, 115, 22, 0.18), transparent 26%),
    radial-gradient(circle at bottom left, rgba(15, 118, 110, 0.14), transparent 22%),
    linear-gradient(180deg, #201814 0%, #32241c 100%);
  color: #f6eadb;
  padding: 28px 22px;
  position: relative;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}

.brand-logo {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 22px rgba(15, 8, 6, 0.22);
  background: #fff;
}

.brand-copy {
  min-width: 0;
}

.brand h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.05;
}

.brand p {
  margin: 6px 0 0;
  color: #d6c2ac;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sidebar-auth-card {
  margin-bottom: 14px;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 8px;
}

.sidebar-auth-main strong {
  display: block;
  color: #fff3e4;
  font-size: 13px;
}

.sidebar-auth-main small {
  display: block;
  margin-top: 2px;
  color: #d6c2ac;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
}

.sidebar-auth-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.sidebar-auth-actions .link-button {
  padding: 5px 8px;
  font-size: 10px;
}

.nav-group {
  display: grid;
  gap: 10px;
}

.sidebar-links-block {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-links-title {
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #e9d9c6;
}

.sidebar-links-grid {
  display: grid;
  gap: 8px;
}

.sidebar-link-card {
  padding: 8px 9px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-link-head strong {
  display: block;
  font-size: 11px;
  color: #fff3e4;
  line-height: 1.2;
}

.sidebar-link-head small {
  display: block;
  margin-top: 2px;
  color: #cdb9a6;
  font-size: 10px;
  line-height: 1.2;
}

.sidebar-link-actions {
  display: flex;
  flex: 0 0 auto;
  margin-top: 0;
}

.sidebar-link-open {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff3e4;
  min-width: 0;
  padding: 4px 8px;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
  box-shadow: none;
  white-space: nowrap;
}

.sidebar-link-open:hover {
  background: rgba(255, 255, 255, 0.14);
}

.sidebar-link-empty {
  margin-top: 10px;
  color: #cdb9a6;
  font-size: 12px;
}

.sidebar-qr-panel {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-qr-panel img {
  width: 96px;
  height: 96px;
  display: block;
  border-radius: 14px;
  background: #fff;
  margin-bottom: 8px;
}

.nav-link {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.nav-link:hover {
  transform: translateY(-1px);
  background: rgba(255, 247, 232, 0.12);
  border-color: rgba(255, 247, 232, 0.2);
  box-shadow: 0 14px 24px rgba(15, 8, 6, 0.18);
}

.nav-link__icon {
  display: grid;
  place-items: center;
  height: 40px;
  width: 40px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: #fff7ef;
  background: rgba(255, 255, 255, 0.14);
}

.nav-link__text strong {
  display: block;
  font-size: 14px;
}

.nav-link__version {
  margin-left: 4px;
  font-size: 10px;
  font-weight: 700;
  vertical-align: super;
  color: #e9d9c7;
}

.nav-link__text small {
  display: block;
  margin-top: 3px;
  color: #c8b6a4;
  font-size: 12px;
}

.nav-link.active {
  background: rgba(255, 247, 232, 0.14);
  border-color: rgba(255, 247, 232, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255, 247, 232, 0.08), 0 16px 28px rgba(15, 8, 6, 0.2);
}

.nav-link.active .nav-link__text small {
  color: #efe1cf;
}

.nav-link.active .nav-link__version {
  color: #fff4e5;
}

.nav-link-dashboard.active .nav-link__icon { background: linear-gradient(135deg, #d06a39, #a63d1f); }
.nav-link-machine.active .nav-link__icon { background: linear-gradient(135deg, #fb923c, #ea580c); }
.nav-link-cutting.active .nav-link__icon { background: linear-gradient(135deg, #38bdf8, #0f4c81); }
.nav-link-inventory.active .nav-link__icon { background: linear-gradient(135deg, #34d399, #15803d); }
.nav-link-clients.active .nav-link__icon { background: linear-gradient(135deg, #2dd4bf, #0f766e); }
.nav-link-expenses.active .nav-link__icon { background: linear-gradient(135deg, #f59e0b, #b45309); }
.nav-link-internal-tasks.active .nav-link__icon { background: linear-gradient(135deg, #14b8a6, #0f766e); }
.nav-link-users.active .nav-link__icon { background: linear-gradient(135deg, #64748b, #334155); }

.sidebar-note-strong {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.04) 100%);
}

.sidebar-note__kicker {
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #f1decb;
}

.sidebar-shortcuts {
  display: grid;
  gap: 8px;
}

.sidebar-shortcuts a {
  display: block;
  color: #f5e9dc;
  font-size: 13px;
}

.sidebar-shortcuts a:hover {
  color: #ffffff;
}

.sidebar-note {
  margin-top: 22px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  color: #e6d7c5;
  font-size: 13px;
}

.content {
  padding: 28px;
  height: 100vh;
  min-width: 0;
  overflow-y: auto;
}

body.module-dashboard .page-head h2,
body.module-default .page-head h2 { color: var(--module-dashboard); }
body.module-machine .page-head h2 { color: var(--module-machine); }
body.module-cutting .page-head h2 { color: var(--module-cutting); }
body.module-inventory .page-head h2 { color: var(--module-inventory); }
body.module-clients .page-head h2 { color: var(--module-clients); }
body.module-expenses .page-head h2 { color: var(--module-expenses); }
body.module-internal-tasks .page-head h2 { color: var(--module-internal-tasks); }
body.module-users .page-head h2 { color: var(--module-users); }

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 22px;
  padding: 22px 24px;
  border: 1px solid rgba(121, 95, 73, 0.12);
  border-radius: 26px;
  box-shadow: var(--shadow);
  background: linear-gradient(135deg, rgba(255, 253, 248, 0.95) 0%, rgba(255, 244, 230, 0.96) 100%);
}

.page-head h2 {
  margin: 0;
  font-size: 34px;
  line-height: 1.05;
}

.module-version-sup {
  margin-left: 6px;
  font-size: 0.38em;
  font-weight: 700;
  line-height: 1;
  vertical-align: super;
  opacity: 0.78;
}

.page-head p {
  margin: 10px 0 0;
  color: var(--muted);
  max-width: 720px;
}

.head-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.button,
button,
.link-button {
  appearance: none;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff8f2;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  line-height: 1.15;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(166, 61, 31, 0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.button:hover,
button:hover,
.link-button:hover {
  transform: translateY(-1px);
}

.button.secondary,
.link-button.secondary,
button.secondary {
  background: #efe3d3;
  color: var(--text);
  border: 1px solid rgba(113, 85, 61, 0.08);
  box-shadow: none;
}

.button.ghost,
.link-button.ghost,
button.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}

.button.danger,
.link-button.danger,
button.danger {
  background: #b42318;
  color: #fff;
  border: 1px solid #8f1a13;
  box-shadow: none;
}

.button.indigo,
.link-button.indigo,
button.indigo {
  background: linear-gradient(180deg, #4f46e5 0%, #4338ca 100%);
  color: #fff;
  border: 1px solid #3730a3;
  box-shadow: 0 12px 24px rgba(67, 56, 202, 0.24);
}

.button.active,
.link-button.active,
button.active {
  box-shadow: 0 0 0 3px rgba(166, 61, 31, 0.16);
  transform: translateY(-1px);
}

.draft-saved-toast {
  position: fixed;
  left: 50%;
  top: 50%;
  right: auto;
  bottom: auto;
  z-index: 5000;
  max-width: min(640px, calc(100vw - 32px));
  text-align: center;
  border-radius: 10px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #eef2ff 0%, #e0e7ff 100%);
  border: 1px solid #c7d2fe;
  color: #312e81;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 16px 36px rgba(67, 56, 202, 0.2);
  opacity: 0;
  transform: translate(-50%, calc(-50% + 12px));
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.draft-saved-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.module-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.module-link-card {
  display: block;
  padding: 15px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fffdf9 0%, #fff4e7 100%);
  border: 1px solid #ebddcd;
  box-shadow: 0 14px 28px rgba(76, 43, 18, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.module-link-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(76, 43, 18, 0.12);
}

.module-link-card strong {
  display: block;
  font-size: 16px;
}

.module-link-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.module-link-card.module-dashboard { border-color: #f0c6b4; }
.module-link-card.module-machine { border-color: #f6cfb0; }
.module-link-card.module-cutting { border-color: #b7d5ed; }
.module-link-card.module-inventory { border-color: #bfe7cc; }
.module-link-card.module-clients { border-color: #b8e5df; }
.module-link-card.module-expenses { border-color: #efd5a4; }
.module-link-card.module-internal-tasks { border-color: #b7e6de; }
.module-link-card.module-users { border-color: #d9e0ea; }

body.module-dashboard .page-head { border-top: 6px solid var(--module-dashboard); }
body.module-machine .page-head { border-top: 6px solid var(--module-machine); }
body.module-cutting .page-head { border-top: 6px solid var(--module-cutting); }
body.module-inventory .page-head { border-top: 6px solid var(--module-inventory); }
body.module-clients .page-head { border-top: 6px solid var(--module-clients); }
body.module-expenses .page-head { border-top: 6px solid var(--module-expenses); }
body.module-internal-tasks .page-head { border-top: 6px solid var(--module-internal-tasks); }
body.module-internal-tasks .page-head {
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
}

body.module-internal-tasks .head-actions {
  width: 100%;
  justify-content: flex-start;
}

body.module-internal-tasks .internal-task-calendar-actions {
  display: grid;
  gap: 6px;
  justify-items: start;
  margin-top: 8px;
}

body.module-internal-tasks .internal-task-calendar-actions-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body.module-internal-tasks .task-create-action-group {
  display: grid;
  gap: 4px;
  align-content: start;
  justify-items: start;
}

body.module-internal-tasks .internal-task-archive-top-link {
  margin-left: auto;
  white-space: nowrap;
}

body.module-internal-tasks .cards {
  gap: 10px;
  margin-bottom: 14px;
}

body.module-internal-tasks .card,
body.module-internal-tasks .panel {
  border-radius: 16px;
}

body.module-internal-tasks .card {
  padding: 12px;
}

body.module-internal-tasks .internal-task-stats .metric {
  font-size: 28px;
}

body.module-internal-tasks .panel {
  padding: 14px;
}

body.module-internal-tasks label {
  gap: 5px;
}

body.module-internal-tasks input,
body.module-internal-tasks textarea,
body.module-internal-tasks select {
  border-radius: 10px;
  padding: 8px 10px;
}

body.module-internal-tasks th,
body.module-internal-tasks td {
  padding: 8px 7px;
}

body.module-internal-tasks th {
  font-size: 11px;
}

body.module-internal-tasks .internal-task-filter-trigger {
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.15;
}

body.module-internal-tasks .internal-task-filter-form {
  gap: 8px;
  margin-bottom: 10px;
}

body.module-internal-tasks .internal-task-filter-form .machine-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
}

body.module-internal-tasks .internal-task-filter-form .machine-filter-option {
  font-size: 10px;
  padding: 4px 7px;
  line-height: 1.15;
}

body.module-internal-tasks .internal-task-filter-group-users .machine-filter-options {
  max-height: 120px;
  overflow: auto;
  padding-right: 3px;
}

body.module-internal-tasks .internal-task-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

body.module-internal-tasks .internal-task-type-badge-internal {
  background: #dbeafe;
  border: 1px solid #93c5fd;
  color: #1d4ed8;
}

body.module-internal-tasks .internal-task-type-badge-planned {
  background: #ffedd5;
  border: 1px solid #fdba74;
  color: #9a3412;
}

body.module-internal-tasks .internal-task-mini {
  gap: 2px;
  border-radius: 10px;
  padding: 6px 8px;
  border-left-width: 5px;
}

body.module-internal-tasks .day-orders {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

body.module-internal-tasks .day-orders .order-pill {
  min-width: 0;
}

body.module-internal-tasks .day-orders .order-title,
body.module-internal-tasks .day-orders .order-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.module-internal-tasks .internal-task-mini-internal {
  border-left-style: solid;
}

body.module-internal-tasks .internal-task-mini-planned {
  border-left-style: dashed;
  box-shadow: inset 0 0 0 1px rgba(154, 52, 18, 0.2);
}

body.module-internal-tasks .internal-task-mini.active {
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  border-left-color: #2563eb;
}

body.module-internal-tasks .internal-task-mini.in_progress {
  background: linear-gradient(180deg, #fff7ed 0%, #fed7aa 100%);
  border-left-color: #ea580c;
}

body.module-internal-tasks .internal-task-mini.completed {
  background: linear-gradient(180deg, #ecfdf5 0%, #bbf7d0 100%);
  border-left-color: #16a34a;
}

body.module-internal-tasks .internal-task-mini.cancelled {
  background: linear-gradient(180deg, #fef2f2 0%, #fecaca 100%);
  border-left-color: #dc2626;
}

body.module-internal-tasks .internal-task-chip {
  box-shadow: none;
  background: #f6ecde;
  color: var(--text);
  border: 1px solid #e2c8ab;
}

body.module-internal-tasks .internal-task-chip-internal {
  border-left: 4px solid #2563eb;
}

body.module-internal-tasks .internal-task-chip-planned {
  border-left: 4px dashed #ea580c;
}

body.module-internal-tasks .internal-task-chip-active {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}

body.module-internal-tasks .internal-task-chip-in_progress {
  background: #ffe0be;
  border-color: #fdba74;
  color: #9a3412;
}

body.module-internal-tasks .internal-task-chip-completed {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

body.module-internal-tasks .internal-task-chip-cancelled {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

body.module-internal-tasks .internal-task-staff-board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}

body.module-internal-tasks .internal-task-staff-card {
  border: 1px solid #e4d2bc;
  border-radius: 14px;
  background: linear-gradient(180deg, #fffdf9 0%, #fff6ec 100%);
  padding: 10px;
  display: grid;
  gap: 8px;
}

body.module-internal-tasks .internal-task-staff-card.is-empty {
  background: linear-gradient(180deg, #f8fafc 0%, #f2f5f9 100%);
  border-color: #d7dee9;
}

body.module-internal-tasks .internal-task-staff-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

body.module-internal-tasks .internal-task-staff-card-user {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

body.module-internal-tasks .internal-task-staff-task-list {
  display: grid;
  gap: 6px;
}

body.module-internal-tasks .internal-task-staff-task-row {
  border-radius: 10px;
  border: 1px solid #eadbc8;
  background: rgba(255, 255, 255, 0.82);
  padding: 6px 8px;
  display: grid;
  gap: 2px;
}

body.module-internal-tasks .internal-task-staff-task-title {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  word-break: break-word;
}

body.module-internal-tasks .internal-task-staff-task-meta {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.2;
}

body.module-internal-tasks .internal-task-actions-grid {
  gap: 8px;
}

body.module-internal-tasks .internal-task-photo-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

body.module-internal-tasks .internal-task-thumb {
  width: 72px;
  height: 72px;
  border-radius: 10px;
}

body.module-internal-tasks .internal-task-archive-link {
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
}

body.module-internal-tasks .internal-task-archive-card {
  border: 1px solid #e5d2be;
  background: #fffdf9;
}

body.module-internal-tasks .internal-task-archive-card h4 {
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

body.module-internal-tasks .internal-task-archive-cards {
  margin-top: 10px;
}

body.module-internal-tasks .internal-task-archive-card .request-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

body.module-internal-tasks .internal-task-archive-card .request-summary-item span {
  white-space: pre-wrap;
  word-break: break-word;
}

body.module-internal-tasks .internal-task-archive-floating {
  position: fixed;
  z-index: 250;
  margin: 0;
  width: min(500px, calc(100vw - 20px));
  max-height: calc(100vh - 20px);
  overflow: auto;
  box-shadow: 0 22px 46px rgba(64, 35, 16, 0.25);
  border-width: 2px;
}

body.module-internal-tasks .machine-floating-window {
  width: min(680px, calc(100vw - 40px));
}

body.module-internal-tasks .internal-task-assignees {
  display: grid;
  gap: 6px;
  position: relative;
}

body.module-internal-tasks .internal-task-field {
  align-content: start;
}

body.module-internal-tasks .internal-task-caption {
  font-size: 11px;
  line-height: 1.2;
  margin-top: 2px;
}

body.module-internal-tasks .internal-task-hint {
  font-size: 10px;
  line-height: 1.2;
}

body.module-internal-tasks .internal-task-assignee-dropdown {
  position: relative;
}

body.module-internal-tasks .internal-task-assignee-trigger {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fffdfb;
  color: var(--text);
  font-weight: 500;
}

body.module-internal-tasks .internal-task-assignee-caret {
  color: var(--muted);
  font-size: 13px;
}

body.module-internal-tasks .internal-task-assignee-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  background: #fffdfb;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 28px rgba(36, 27, 20, 0.12);
  padding: 8px;
}

body.module-internal-tasks .internal-task-assignee-actions {
  display: grid;
  gap: 5px;
  align-items: start;
}

body.module-internal-tasks .internal-task-assignee-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

body.module-internal-tasks .internal-task-assignee-meta {
  font-size: 10px;
  line-height: 1.2;
}

body.module-internal-tasks .internal-task-assignee-actions button {
  padding: 6px 10px;
  border-radius: 10px;
}

body.module-internal-tasks .internal-task-assignee-list {
  display: grid;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 6px;
}

body.module-internal-tasks .internal-task-assignee-item {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 500;
  cursor: pointer;
  padding: 3px 2px;
}

body.module-internal-tasks .internal-task-assignee-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

body.module-internal-tasks .task-create-modal,
body.module-machine .task-create-modal {
  width: min(700px, calc(100vw - 24px));
  border: 1px solid rgba(121, 95, 73, 0.2);
  border-radius: 18px;
  padding: 16px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 24px 60px rgba(36, 27, 20, 0.25);
}

body.module-internal-tasks #driver-task-create-modal.task-create-modal {
  width: min(1320px, calc(100vw - 320px));
  max-width: calc(100vw - 20px);
  height: min(900px, calc(100vh - 24px));
  max-height: calc(100vh - 20px);
  min-width: 860px;
  min-height: 560px;
  margin: 0;
  padding: 16px 18px;
  overflow: hidden;
  resize: both;
}

body.module-internal-tasks #internal-task-create-modal.task-create-modal {
  width: min(1320px, calc(100vw - 320px));
  max-width: calc(100vw - 20px);
  height: min(900px, calc(100vh - 24px));
  max-height: calc(100vh - 20px);
  min-width: 900px;
  min-height: 560px;
  margin: 0;
  padding: 16px 18px;
  overflow: hidden;
  resize: both;
}

body.module-internal-tasks #internal-task-create-modal.task-create-modal:not([open]) {
  display: none !important;
}

body.module-internal-tasks #internal-task-create-modal.task-create-modal[open] {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 12px;
  right: 12px;
  left: auto;
}

body.module-internal-tasks #internal-task-create-modal .task-create-modal__head {
  cursor: move;
  user-select: none;
}

body.module-internal-tasks #internal-task-create-modal .task-create-modal__head button,
body.module-internal-tasks #internal-task-create-modal .task-create-modal__head a {
  cursor: pointer;
}

body.module-internal-tasks #internal-task-create-modal .task-create-form-internal {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  grid-auto-rows: min-content;
  align-content: start;
  flex: 1 1 auto;
  min-height: 0;
  gap: 12px;
  overflow-y: auto;
  padding-right: 6px;
}

body.module-internal-tasks #driver-task-create-modal.task-create-modal:not([open]) {
  display: none !important;
}

body.module-internal-tasks #driver-task-create-modal.task-create-modal[open] {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 12px;
  right: 12px;
  left: auto;
}

body.module-internal-tasks #driver-task-create-modal .task-create-modal__head {
  cursor: move;
  user-select: none;
}

body.module-internal-tasks #driver-task-create-modal .task-create-modal__head button,
body.module-internal-tasks #driver-task-create-modal .task-create-modal__head a {
  cursor: pointer;
}

body.module-internal-tasks #driver-task-create-modal .task-create-form-driver {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  grid-auto-rows: min-content;
  align-content: start;
  flex: 1 1 auto;
  min-height: 0;
  gap: 12px;
  overflow-y: auto;
  padding-right: 6px;
}

@media (max-width: 1180px) {
  body.module-internal-tasks #internal-task-create-modal.task-create-modal {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    height: calc(100vh - 20px);
    max-height: calc(100vh - 20px);
    min-width: 0;
    min-height: 0;
    margin: 10px auto;
    resize: none;
  }
  body.module-internal-tasks #internal-task-create-modal.task-create-modal[open] {
    top: 10px;
    right: 10px;
    left: 10px;
  }
  body.module-internal-tasks #driver-task-create-modal.task-create-modal {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    height: calc(100vh - 20px);
    max-height: calc(100vh - 20px);
    min-width: 0;
    min-height: 0;
    margin: 10px auto;
    resize: none;
  }
  body.module-internal-tasks #driver-task-create-modal.task-create-modal[open] {
    top: 10px;
    right: 10px;
    left: 10px;
  }
}

body.module-internal-tasks .task-create-modal::backdrop,
body.module-machine .task-create-modal::backdrop {
  background: rgba(19, 17, 14, 0.38);
}

body.module-internal-tasks .task-create-modal__head,
body.module-machine .task-create-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 10px;
  padding: 0;
}

body.module-internal-tasks .task-create-form,
body.module-machine .task-create-form {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

body.module-internal-tasks .task-create-form__full,
body.module-machine .task-create-form__full {
  grid-column: 1 / -1;
}

body.module-internal-tasks .task-create-form__actions,
body.module-machine .task-create-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

body.module-internal-tasks .task-created-toast {
  position: fixed;
  right: 18px;
  top: 18px;
  z-index: 420;
  max-width: min(560px, calc(100vw - 24px));
  background: linear-gradient(180deg, #ecfdf5 0%, #d1fae5 100%);
  border: 1px solid #86efac;
  color: #14532d;
  border-radius: 14px;
  box-shadow: 0 16px 26px rgba(20, 83, 45, 0.18);
  padding: 12px 14px;
  opacity: 1;
  transform: translateY(0);
  transition: opacity .8s ease, transform .8s ease;
}

body.module-internal-tasks .task-created-toast.is-hiding {
  opacity: 0;
  transform: translateY(-8px);
}

body.module-internal-tasks .driver-map-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

body.module-internal-tasks .driver-task-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body.module-internal-tasks .driver-task-lines__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

body.module-internal-tasks .driver-task-lines__table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

body.module-internal-tasks .internal-task-lines .driver-task-lines__table-wrap {
  overflow-x: auto;
  overflow-y: visible;
}

body.module-internal-tasks .driver-task-lines__table {
  width: 100%;
  min-width: 0;
  table-layout: auto;
  border-collapse: collapse;
  background: #fff;
}

body.module-internal-tasks .driver-task-lines__table th,
body.module-internal-tasks .driver-task-lines__table td {
  border: 1px solid rgba(121, 95, 73, 0.16);
  padding: 6px;
  vertical-align: top;
  word-break: break-word;
  overflow-wrap: anywhere;
}

body.module-internal-tasks .driver-task-lines__table td input,
body.module-internal-tasks .driver-task-lines__table td textarea {
  margin: 0;
}

body.module-internal-tasks .driver-task-lines__table td button {
  margin-top: 6px;
}

body.module-internal-tasks .driver-task-lines__row-number {
  text-align: center;
  font-weight: 700;
  color: #0f766e;
}

body.module-internal-tasks .driver-task-lines__row-actions {
  text-align: center;
}

body.module-internal-tasks .driver-task-lines__table tr.is-active {
  background: #f0fdfa;
}

body.module-internal-tasks .internal-task-assignee-row-menu {
  position: fixed;
  min-width: 280px;
  right: auto;
  max-height: min(62vh, 420px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  z-index: 10020;
}

body.module-internal-tasks .internal-task-assignee-row-menu.internal-task-assignee-menu-sheet {
  border-radius: 16px;
  box-shadow: 0 24px 44px rgba(24, 17, 12, 0.28);
  border-width: 2px;
}

body.module-internal-tasks .internal-task-assignee-row-menu .internal-task-assignee-list {
  max-height: min(46vh, 280px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

body.module-internal-tasks #internal-task-create-modal.task-create-modal.internal-row-assignee-open {
  overflow: visible;
}

body.module-internal-tasks .internal-task-lines__table td {
  position: relative;
  overflow: visible;
  vertical-align: top;
}

body.module-internal-tasks .internal-task-assignee-dropdown-row {
  position: relative;
  z-index: 220;
}

body.module-internal-tasks .internal-task-lines__table td[data-internal-row-assignee-cell] {
  z-index: 240;
}

body.module-internal-tasks .internal-task-lines__table td[data-internal-row-assignee-cell].is-assignee-open {
  z-index: 1300;
}

body.module-internal-tasks .internal-row-map-modal.task-create-modal {
  width: min(760px, calc(100vw - 40px));
  max-width: calc(100vw - 20px);
  min-height: 520px;
  max-height: calc(100vh - 24px);
  overflow: hidden;
}

body.module-internal-tasks .internal-row-map-modal .task-create-form {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-content: start;
  min-height: 0;
  height: calc(100% - 6px);
}

body.module-internal-tasks .internal-row-map-modal .driver-task-map {
  min-height: 320px;
}

body.module-internal-tasks #driver-task-create-modal .driver-task-lines__table th:nth-child(1),
body.module-internal-tasks #driver-task-create-modal .driver-task-lines__table td:nth-child(1) {
  width: 38px;
}

body.module-internal-tasks #driver-task-create-modal .driver-task-lines__table th:nth-child(8),
body.module-internal-tasks #driver-task-create-modal .driver-task-lines__table td:nth-child(8) {
  width: 84px;
}

body.module-internal-tasks .driver-task-map {
  width: 100%;
  min-height: 280px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #f4f7f8;
}

body.module-users .page-head { border-top: 6px solid var(--module-users); }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.card,
.panel {
  background: var(--panel);
  border: 1px solid rgba(121, 95, 73, 0.12);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card {
  padding: 18px;
}

.card-accent-dashboard { border-top: 4px solid var(--module-dashboard); }
.card-accent-machine { border-top: 4px solid var(--module-machine); }
.card-accent-cutting { border-top: 4px solid var(--module-cutting); }
.card-accent-inventory { border-top: 4px solid var(--module-inventory); }
.card-accent-clients { border-top: 4px solid var(--module-clients); }
.card-accent-expenses { border-top: 4px solid var(--module-expenses); }
.card-accent-internal-tasks { border-top: 4px solid var(--module-internal-tasks); }
.card-accent-users { border-top: 4px solid var(--module-users); }

.card h3,
.panel h3 {
  margin: 0 0 6px;
  font-size: 15px;
}

.metric {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.metric-note {
  color: var(--muted);
  font-size: 13px;
}

.grid-2,
.grid-3,
.grid-main {
  display: grid;
  gap: 16px;
}

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr); }
.client-requests-layout { grid-template-columns: minmax(220px, 0.52fr) minmax(0, 1.88fr); align-items: start; }
.machine-layout { display: grid; gap: 18px; grid-template-columns: minmax(0, 1.75fr) minmax(360px, 0.95fr); align-items: start; }
.machine-layout-single { grid-template-columns: minmax(0, 1fr); }

.panel {
  padding: 18px;
  overflow: hidden;
  position: relative;
}

.panel-section {
  border-width: 2px;
}

.panel-section::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  border-radius: 22px 0 0 22px;
  background: linear-gradient(180deg, rgba(166, 61, 31, 0.9) 0%, rgba(208, 106, 57, 0.7) 100%);
}

.panel-section-clients {
  background: linear-gradient(180deg, #fffefd 0%, #f2fcf9 100%);
  border-color: rgba(15, 118, 110, 0.22);
}

.panel-section-clients::before {
  background: linear-gradient(180deg, #14b8a6 0%, #0f766e 100%);
}

.panel-section-neutral {
  background: linear-gradient(180deg, #fffefa 0%, #fff7ed 100%);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.panel-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.stack {
  display: grid;
  gap: 14px;
}

.quick-forms {
  margin-bottom: 16px;
}

.cutting-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(320px, 0.92fr);
  gap: 16px;
}

.cutting-layout-sidebar,
.cutting-layout-main {
  min-width: 0;
}

.cutting-layout-main {
  order: 1;
}

.cutting-layout-sidebar {
  order: 2;
}

.cutting-alert {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  border-width: 2px;
}

.cutting-alert-error {
  border-color: #f8bbb3;
  background: #fff1ef;
  color: #9f2a1f;
}

.cutting-alert-success {
  border-color: #bce8d0;
  background: #eefcf5;
  color: #14532d;
}

.cutting-inline-actions {
  margin-top: 12px;
  align-items: center;
}

.cutting-result-modal {
  width: min(860px, calc(100vw - 24px));
  border: 1px solid rgba(121, 95, 73, 0.22);
  border-radius: 18px;
  padding: 14px;
  background: #fffdf8;
  color: var(--text);
  box-shadow: 0 28px 64px rgba(36, 27, 20, 0.28);
}

.cutting-result-modal::backdrop {
  background: rgba(19, 17, 14, 0.44);
}

.cutting-result-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.cutting-result-modal-head h3 {
  margin: 0;
}

.cutting-result-modal-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.cutting-result-modal-body {
  max-height: min(72vh, 620px);
}

.cutting-result-table td:last-child {
  font-weight: 700;
}

.cutting-settings-table input {
  border-radius: 10px;
  padding: 8px 10px;
}

.table-wrap {
  overflow: auto;
}

.cutting-materials-card {
  padding: 8px 9px;
}

.cutting-materials-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.cutting-materials-table-head h4 {
  margin: 0;
}

.cutting-materials-table-wrap {
  margin-top: 8px;
  max-height: 620px;
}

.cutting-materials-table th,
.cutting-materials-table td {
  padding: 7px 8px;
  font-size: 12px;
  line-height: 1.25;
}

.cutting-materials-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f6ece0;
}

.cutting-material-group-row td {
  background: #eef6ff;
  border-top: 1px solid #d9e7f8;
  border-bottom: 1px solid #d9e7f8;
}

.cutting-material-group-inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}

.cutting-material-group-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.cutting-material-group-actions form {
  margin: 0;
}

.cutting-material-group-actions button {
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11px;
}

.cutting-speed-summary-row td {
  font-variant-numeric: tabular-nums;
}

.cutting-speed-summary-row:hover td {
  background: #fff8ec;
}

.cutting-open-cell {
  color: #6b7280;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.cutting-open-button,
.cutting-material-button,
.cutting-thickness-button {
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}

.cutting-speed-popup {
  position: fixed;
  z-index: 560;
  width: min(360px, calc(100vw - 24px));
  border: 1px solid #d8c6b2;
  border-radius: 14px;
  padding: 10px;
  background: #fffdf8;
  box-shadow: 0 18px 38px rgba(36, 27, 20, 0.22);
}

.cutting-speed-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.cutting-speed-popup-head strong {
  font-size: 13px;
}

.cutting-speed-popup-close {
  min-width: 32px;
  min-height: 28px;
  padding: 2px 7px;
}

.cutting-speed-popup-form label {
  gap: 4px;
}

.cutting-speed-popup-form input,
.cutting-speed-popup-form select {
  padding: 6px 8px;
  border-radius: 8px;
}

.cutting-speed-popup-actions {
  margin-top: 6px;
  justify-content: space-between;
  gap: 8px;
}

.cutting-speed-popup-actions .danger,
.cutting-speed-popup-actions button {
  box-shadow: none;
}

.cutting-material-edit-row td,
.cutting-speed-create-row td,
.cutting-speed-detail-row td {
  background: #fffefa;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid #eee0d0;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

tr:last-child td {
  border-bottom: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 10px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid transparent;
}

.chip.created { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.chip.in_progress { background: #ffe0be; color: #9a3412; border-color: #fdba74; }
.chip.paused { background: #ede9fe; color: #6d28d9; border-color: #c4b5fd; }
.chip.completed { background: #dcfce7; color: #166534; border-color: #86efac; }
.chip.cancelled { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.chip.request-new,
.chip.request-in_review { background: #dbeafe; color: #1d4ed8; border-color: #93c5fd; }
.chip.request-awaiting_confirmation { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.chip.request-approved { background: #ccfbf1; color: #115e59; border-color: #5eead4; }
.chip.request-completed { background: #dcfce7; color: #166534; border-color: #86efac; }
.chip.request-cancelled,
.chip.request-rejected { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.chip.workflow { background: #e0f2fe; color: #0f766e; border-color: #99f6e4; }

.attention-text {
  color: #b45309;
  font-weight: 700;
  background: #fff4d6;
  padding: 4px 8px;
  border-radius: 10px;
}

.case-card {
  display: grid;
  gap: 12px;
}

.case-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.case-files {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.history-row {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px 10px;
  background: #fffdfb;
  font-size: 11px;
}

.muted { color: var(--muted); }
.small { font-size: 12px; }
.strong { font-weight: 700; }

.alert {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 13px;
  line-height: 1.35;
}

.alert-error {
  border-color: #f8bbb3;
  background: #fff1ef;
  color: #9f2a1f;
}

.alert-ok {
  border-color: #bce8d0;
  background: #eefcf5;
  color: #14532d;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(460px, 100%);
  background: var(--panel);
  border: 1px solid rgba(121, 95, 73, 0.16);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 18px;
  display: grid;
  gap: 12px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-row {
  display: grid;
  gap: 8px;
}

.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

label {
  display: grid;
  gap: 7px;
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 13px;
  background: #fffdfb;
  color: var(--text);
  font: inherit;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.calendar-wrap {
  overflow: auto;
}

.machine-calendar-panel {
  position: relative;
  z-index: 1;
}

.machine-calendar-head {
  align-items: flex-start;
}

.machine-calendar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.machine-calendar-actions-left {
  margin-top: 10px;
  justify-content: flex-start;
}

.machine-filter-trigger {
  padding: 9px 14px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.machine-create-trigger {
  padding: 9px 14px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: 0.01em;
}

body.module-machine .machine-month-nav .machine-create-trigger {
  padding: 11px 18px !important;
  border-radius: 13px !important;
  font-size: 18px !important;
  line-height: 1.15 !important;
  font-weight: 900 !important;
}

body.module-machine .machine-calendar-actions .machine-filter-trigger {
  padding: 10px 16px !important;
  border-radius: 13px !important;
  font-size: 16px !important;
  line-height: 1.15 !important;
  font-weight: 900 !important;
}

.machine-month-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.machine-month-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.machine-month-nav-inline {
  justify-content: flex-start;
  gap: 8px;
}

.machine-month-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 152px;
  padding: 7px 10px;
  border-radius: 12px;
  background: linear-gradient(135deg, #fff4df 0%, #ffe7cb 100%);
  border: 1px solid #e9c9a3;
  font-weight: 700;
  font-size: 13px;
}

.machine-month-link {
  min-width: 36px;
  padding: 7px 10px;
  text-align: center;
}

.machine-calendar-wrap {
  overflow: auto;
  padding-bottom: 4px;
}

.machine-filter-form {
  gap: 14px;
}

.machine-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.machine-filter-group {
  display: grid;
  gap: 8px;
}

.machine-filter-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.machine-filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.machine-filter-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 10px;
  background: #fff7ea;
  border: 1px solid #eadbc8;
  color: var(--text);
  font-size: 11px;
  line-height: 1.2;
  cursor: pointer;
}

.machine-filter-option input {
  margin: 0;
}

.machine-calendar-grid {
  min-width: 1080px;
}

.calendar {
  width: 100%;
  border-collapse: separate;
  border-spacing: 10px;
}

.calendar th {
  border: 0;
  padding: 0 6px 6px;
}

.calendar td {
  width: 14.285%;
  min-width: 150px;
  height: auto;
  border: 1px solid #eadbc8;
  background: linear-gradient(180deg, #fffefa 0%, #fff6ec 100%);
  border-radius: 14px;
  vertical-align: top;
  padding: 9px;
}

.calendar td.empty {
  background: rgba(255, 255, 255, 0.35);
}

.calendar td.today {
  box-shadow: inset 0 0 0 2px rgba(166, 61, 31, 0.28);
}

.calendar td.day-cell-clickable {
  cursor: pointer;
}

.calendar td.day-cell-clickable:hover,
.calendar td.day-cell-clickable:focus-visible {
  background: linear-gradient(180deg, #fff9f1 0%, #ffefdd 100%);
  outline: none;
}

.day-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.day-head-clickable {
  cursor: pointer;
  border-radius: 10px;
  padding: 2px 4px;
  transition: background 0.12s ease;
}

.day-head-clickable:hover,
.day-head-clickable:focus-visible {
  background: rgba(36, 27, 20, 0.08);
  outline: none;
}

.day-num {
  font-size: 18px;
  font-weight: 700;
}

.day-orders {
  display: grid;
  gap: 8px;
}

.calendar-day-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 230;
  display: grid;
  place-items: center;
  padding: 24px;
}

.calendar-day-detail-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(25, 19, 12, 0.56);
}

.calendar-day-detail-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(96vw, 1320px);
  max-height: 88vh;
  border-radius: 18px;
  border: 1px solid #ddc8ae;
  background: linear-gradient(180deg, #fffdf9 0%, #fff6ec 100%);
  box-shadow: 0 24px 44px rgba(74, 45, 19, 0.28);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.calendar-day-detail-modal__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid #eadbc8;
}

.calendar-day-detail-modal__head h3 {
  margin: 0 0 4px;
}

.calendar-day-detail-modal__head p {
  margin: 0;
}

.calendar-day-detail-modal__content {
  padding: 12px 14px 14px;
  overflow: auto;
}

.calendar-day-detail-table-wrap {
  overflow: auto;
}

.calendar-day-detail-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.calendar-day-detail-table th,
.calendar-day-detail-table td {
  border-bottom: 1px solid #eadbc8;
  text-align: left;
  vertical-align: top;
  padding: 8px;
  font-size: 12px;
  line-height: 1.35;
}

.calendar-day-detail-table th {
  position: sticky;
  top: 0;
  background: #fff6eb;
  z-index: 1;
}

.mini-order {
  display: grid;
  gap: 3px;
  border-radius: 12px;
  padding: 8px 9px;
  background: #fff7ed;
  border-left: 6px solid #f59e0b;
  box-shadow: 0 10px 16px rgba(107, 60, 11, 0.06);
}

.mini-order.created { background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%); border-left-color: #2563eb; }
.mini-order.in_progress { background: linear-gradient(180deg, #fff7ed 0%, #fed7aa 100%); border-left-color: #ea580c; }
.mini-order.paused { background: linear-gradient(180deg, #f5f3ff 0%, #ddd6fe 100%); border-left-color: #7c3aed; }
.mini-order.completed { background: linear-gradient(180deg, #ecfdf5 0%, #bbf7d0 100%); border-left-color: #16a34a; }
.mini-order.cancelled { background: linear-gradient(180deg, #fef2f2 0%, #fecaca 100%); border-left-color: #dc2626; }

.order-title {
  font-weight: 700;
  font-size: 13px;
}

.order-meta {
  color: var(--muted);
  font-size: 12px;
}

.order-pill {
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 10px;
  padding: 7px 8px;
  background: transparent;
  box-shadow: none;
  color: inherit;
}

.order-pill:hover,
.order-pill.active {
  background: rgba(36, 27, 20, 0.06);
}

.machine-order-switcher {
  max-height: 170px;
  overflow: auto;
  padding-right: 4px;
  align-content: start;
}

.machine-accordion-trigger {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
}

.machine-accordion-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.machine-accordion-head h4 {
  margin: 0 0 6px;
}

.machine-accordion-caret {
  font-size: 1.1rem;
  color: #8b5e34;
  flex-shrink: 0;
}

.machine-detail-card {
  border-width: 2px;
  background: linear-gradient(180deg, #fffefb 0%, #fff5ea 100%);
}

.machine-order-chip {
  box-shadow: none;
  background: #f3eadf;
  color: var(--text);
  border: 1px solid #e2c8ab;
}

button.machine-order-chip-created,
.machine-order-chip-created {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
}

button.machine-order-chip-in_progress,
.machine-order-chip-in_progress {
  background: #ffe0be;
  color: #9a3412;
  border: 1px solid #fdba74;
}

button.machine-order-chip-paused,
.machine-order-chip-paused {
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #c4b5fd;
}

button.machine-order-chip-completed,
.machine-order-chip-completed {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

button.machine-order-chip-cancelled,
.machine-order-chip-cancelled {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.machine-order-chip.active,
.machine-order-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(72, 42, 18, 0.08);
}

.machine-window-launcher {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.card-button-reset {
  width: 100%;
  text-align: left;
  border: 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.machine-setting-card {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.machine-setting-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(83, 45, 19, 0.12);
}

.machine-window-layer {
  position: relative;
  z-index: 40;
}

.machine-floating-window {
  position: fixed;
  top: 120px;
  left: 80px;
  width: min(760px, calc(100vw - 48px));
  min-width: 320px;
  min-height: 120px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  border: 1px solid #d8b48f;
  border-radius: 24px;
  background: linear-gradient(180deg, #fffefb 0%, #fff4e8 100%);
  box-shadow: 0 24px 60px rgba(83, 45, 19, 0.24);
  overflow: hidden;
  resize: both;
}

.machine-floating-window-small {
  width: min(420px, calc(100vw - 32px));
  min-width: 280px;
  min-height: 0;
}

.machine-floating-window.is-minimized {
  height: auto !important;
  min-height: 0;
  resize: none;
}

.machine-floating-window.is-minimized .machine-floating-window__body {
  display: none;
}

.machine-floating-window__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  cursor: move;
  background: linear-gradient(135deg, #35180d 0%, #7c3f1e 100%);
  color: #fff7ef;
}

.machine-floating-window__title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.machine-floating-window__title strong {
  font-size: 15px;
}

.machine-floating-window__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.machine-floating-window__body {
  padding: 18px;
  overflow: auto;
  max-height: calc(100vh - 120px);
}

.small-btn {
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  font-size: 12px;
  font-weight: 700;
}

.small-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.machine-time-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
  margin-bottom: 10px;
}

.machine-time-item {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(121, 95, 73, 0.12);
}

.machine-time-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.machine-archive-card {
  border-width: 2px;
  background: linear-gradient(180deg, #fffefb 0%, #fef7ee 100%);
}

.machine-settings-panel {
  align-self: start;
  font-size: 0.8em;
}

.machine-settings-panel input,
.machine-settings-panel select,
.machine-settings-panel textarea,
.machine-settings-panel button {
  font-size: 1em;
}

.machine-settings-panel .panel-head p,
.machine-settings-panel .metric-note,
.machine-settings-panel .small {
  font-size: 11px;
}

.list-card {
  border: 1px solid #eedfcb;
  border-radius: 14px;
  padding: 10px 11px;
  background: #fffdf8;
  box-shadow: 0 10px 18px rgba(72, 42, 18, 0.05);
}

.list-card + .list-card {
  margin-top: 2px;
}

.list-card.selectable {
  appearance: none;
  border: 1px solid #eedfcb;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.list-card.selectable:hover {
  border-color: #ddb58c;
  box-shadow: 0 10px 22px rgba(104, 54, 22, 0.08);
  transform: translateY(-1px);
}

.list-card.selectable.active {
  border-color: #c76a38;
  background: linear-gradient(180deg, #fff8ee 0%, #fff2df 100%);
  box-shadow: 0 16px 30px rgba(131, 62, 25, 0.12);
}

.cutting-calculation-link {
  display: block;
}

.cutting-calculations-list {
  max-height: 620px;
  overflow: auto;
  padding-right: 4px;
}

.customer-card {
  border-width: 2px;
  background: linear-gradient(180deg, #fffefa 0%, #fff6eb 100%);
}

.customer-card-compact {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
}

.customer-card-ultra-compact {
  width: 100%;
  text-align: left;
  padding: 6px 7px;
  border-width: 1px;
}

.customer-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.customer-card-stats {
  display: grid;
  justify-items: end;
  gap: 4px;
  min-width: 145px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.customer-card-stats-compact {
  min-width: 58px;
  gap: 1px;
  font-size: 10px;
}

.customer-wing {
  display: grid;
  gap: 10px;
}

.customer-wing-linked {
  padding: 12px;
  border-radius: 20px;
  border: 1px solid #cfe7e3;
  background: linear-gradient(180deg, #f6fffd 0%, #eefbf8 100%);
}

.customer-wing-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
  color: #0f766e;
  font-size: 12px;
}

.customer-wing-stack {
  gap: 10px;
}

.customer-card-ultra-compact .inline-meta {
  gap: 4px;
  font-size: 10px;
}

.client-sidebar-stack {
  gap: 4px;
}

.customer-card-inline-compact {
  gap: 3px 6px;
  font-size: 9.5px;
}

.customer-card-ultra-compact h4 {
  margin-bottom: 2px;
  font-size: 12.5px;
  line-height: 1.2;
}

.customer-group-trigger {
  padding: 5px 6px;
}

.customer-group-stack {
  gap: 2px;
  margin: -2px 0 1px;
  padding-left: 6px;
}

.customer-subcard {
  padding: 4px 5px;
}

.customer-subcard .customer-card-top {
  gap: 6px;
}

.customer-subcard .customer-card-stats-compact {
  min-width: 52px;
  font-size: 9px;
}

.group-summary-card {
  padding: 10px 11px;
  border-style: dashed;
  background: linear-gradient(180deg, #f9fdfa 0%, #f2fcf9 100%);
}

.request-card {
  border-width: 2px;
  padding: 12px;
  background: linear-gradient(180deg, #fffdfa 0%, #fff8f0 100%);
  position: relative;
}

.request-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  border-radius: 14px 0 0 14px;
  background: #2563eb;
}

.request-card-new,
.request-card-in_review {
  border-color: #93c5fd;
  background: linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%);
}

.request-card-new::before,
.request-card-in_review::before {
  background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
}

.request-card-awaiting_confirmation {
  border-color: #fcd34d;
  background: linear-gradient(180deg, #fffdf4 0%, #fff7da 100%);
}

.request-card-awaiting_confirmation::before {
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
}

.request-card-approved {
  border-color: #5eead4;
  background: linear-gradient(180deg, #f2fffd 0%, #dcfdf7 100%);
}

.request-card-approved::before {
  background: linear-gradient(180deg, #2dd4bf 0%, #0f766e 100%);
}

.request-card-completed {
  border-color: #86efac;
  background: linear-gradient(180deg, #f6fff8 0%, #dcfce7 100%);
}

.request-card-completed::before {
  background: linear-gradient(180deg, #4ade80 0%, #16a34a 100%);
}

.request-card-cancelled,
.request-card-rejected {
  border-color: #fca5a5;
  background: linear-gradient(180deg, #fff8f8 0%, #fee2e2 100%);
}

.request-card-cancelled::before,
.request-card-rejected::before {
  background: linear-gradient(180deg, #f87171 0%, #dc2626 100%);
}

.request-card h4,
.customer-card h4 {
  margin-top: 0;
  margin-bottom: 6px;
}

.request-accordion-trigger {
  width: 100%;
  text-align: left;
}

.request-accordion-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.request-accordion-caret {
  font-size: 1.1rem;
  color: #8b5e34;
  flex-shrink: 0;
}

.request-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.request-summary-item {
  padding: 8px 9px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(121, 95, 73, 0.1);
}

.request-summary-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.history-disclosure summary {
  cursor: pointer;
  list-style: none;
}

.history-disclosure summary::-webkit-details-marker {
  display: none;
}

.history-disclosure summary::after {
  content: "Показать";
  margin-left: 10px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
}

.history-disclosure[open] summary::after {
  content: "Скрыть";
}

.history-stack {
  margin-top: 10px;
}

@media (max-width: 1120px) {
  .machine-layout,
  .grid-main,
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .machine-time-grid {
    grid-template-columns: 1fr;
  }

  .machine-calendar-actions {
    justify-content: flex-start;
  }

  .machine-month-nav {
    justify-content: flex-start;
  }

  .machine-month-title-row {
    align-items: flex-start;
  }

  .machine-filter-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .customer-card-top,
  .customer-wing-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .customer-card-stats {
    justify-items: start;
    min-width: 0;
    white-space: normal;
  }

  body.module-internal-tasks .internal-task-filter-form .machine-filter-grid {
    grid-template-columns: 1fr;
  }
}

.is-hidden { display: none !important; }

.consent-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 10px;
  background: #edf8f1;
  color: #1f6b42;
  font-size: 11px;
  font-weight: 700;
}

.consent-badge.revoked {
  background: #f6ece8;
  color: #9a4d2b;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: 10px;
  background: #edf3ff;
  color: #3157a6;
  border: 1px solid #c8d8ff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.chart-card {
  padding: 15px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fffdfa 0%, #fff4e6 100%);
  border: 1px solid #eedfcb;
  box-shadow: 0 14px 30px rgba(124, 75, 33, 0.08);
}

.dashboard-brand-panel {
  padding: 20px 22px;
  background: linear-gradient(135deg, #fffefb 0%, #fff4e7 52%, #f4fbf7 100%);
  border: 1px solid rgba(121, 95, 73, 0.12);
}

.dashboard-brand-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.dashboard-brand-company {
  display: flex;
  gap: 16px;
  align-items: center;
}

.dashboard-brand-company h3 {
  margin: 0;
  font-size: 24px;
}

.dashboard-brand-company p {
  margin: 6px 0 0;
  max-width: 680px;
  color: var(--muted);
}

.dashboard-brand-logo {
  width: 78px;
  height: 78px;
  object-fit: cover;
  border-radius: 22px;
  border: 1px solid rgba(121, 95, 73, 0.12);
  box-shadow: 0 14px 24px rgba(72, 42, 18, 0.08);
  background: #fff;
}

.dashboard-bot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.dashboard-bot-links-panel {
  margin-bottom: 22px;
}

.dashboard-bot-card {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #eadbc8;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 10px 20px rgba(72, 42, 18, 0.05);
}

.dashboard-bot-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.dashboard-bot-card h4 {
  margin: 0 0 6px;
}

.dashboard-bot-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.dashboard-bot-label {
  display: inline-flex;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 10px;
  background: var(--panel-strong);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  word-break: break-word;
}

.dashboard-bot-actions {
  display: flex;
  margin-top: 12px;
}

.dashboard-bot-open {
  appearance: none;
  border: 1px solid #eadbc8;
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--accent);
  padding: 4px 10px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.dashboard-bot-open:hover {
  background: #fff2dc;
}

.dashboard-qr-image {
  width: min(140px, 42vw);
  height: min(140px, 42vw);
  border-radius: 14px;
  border: 1px solid #eadbc8;
  background: #fff;
  display: block;
  margin: 0 auto 8px;
}

.dashboard-qr-direct {
  display: block;
  max-width: min(220px, 76vw);
  margin: 0 auto;
  color: #fff7ed;
  text-align: center;
  font-size: 10px;
  line-height: 1.35;
  word-break: break-word;
}

.panel-head .link-button,
.panel-head .button {
  white-space: nowrap;
}

.chart-stack {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  gap: 6px;
}

.bar-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.bar-track {
  height: 12px;
  border-radius: 999px;
  background: #efe1d0;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #d06a39, #a63d1f);
}
.bar-fill.created,
.bar-fill.new,
.bar-fill.in_review { background: linear-gradient(90deg, #60a5fa, #2563eb); }
.bar-fill.in_progress { background: linear-gradient(90deg, #fb923c, #ea580c); }
.bar-fill.paused { background: linear-gradient(90deg, #a78bfa, #7c3aed); }
.bar-fill.completed,
.bar-fill.completed-request { background: linear-gradient(90deg, #4ade80, #16a34a); }
.bar-fill.cancelled,
.bar-fill.rejected,
.bar-fill.cancelled-request { background: linear-gradient(90deg, #f87171, #dc2626); }
.bar-fill.awaiting_confirmation { background: linear-gradient(90deg, #f59e0b, #d97706); }
.bar-fill.approved { background: linear-gradient(90deg, #2dd4bf, #0f766e); }

.month-bars {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  min-height: 180px;
  padding-top: 12px;
}

.month-bar {
  flex: 1;
  min-width: 40px;
  display: grid;
  gap: 8px;
  justify-items: center;
}

.month-bar .bar {
  width: 100%;
  border-radius: 14px 14px 0 0;
  background: linear-gradient(180deg, #fb923c 0%, #9a3412 100%);
  min-height: 12px;
  box-shadow: 0 14px 22px rgba(154, 52, 18, 0.16);
}

.month-bar .bar.hours {
  background: linear-gradient(180deg, #4a9d70 0%, #256748 100%);
}

.month-bar-label {
  font-size: 12px;
  color: var(--muted);
}

.month-bar-value {
  font-size: 12px;
  font-weight: 700;
}

.detail-drawer {
  position: sticky;
  top: 20px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #f1e7d9;
  font-size: 12px;
}

.list-card h4 {
  margin: 0 0 8px;
  font-size: 16px;
}

.customer-registry-card {
  padding: 9px 10px;
}

.customer-registry-card h4 {
  margin-bottom: 5px;
  font-size: 15px;
  line-height: 1.2;
}

.customer-registry-meta {
  gap: 5px 10px;
  font-size: 12px;
}

.customer-registry-note {
  margin: 6px 0;
  font-size: 11px;
  line-height: 1.35;
}

.customer-registry-divider {
  margin: 7px 0;
}

.inline-meta {
  display: flex;
  gap: 8px 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.photo-thumb {
  width: 112px;
  height: 112px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid #eadbc8;
  display: block;
  box-shadow: 0 10px 18px rgba(90, 54, 22, 0.08);
}

.preview-thumb {
  display: inline-block;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 14px;
  border: 1px solid #e8d8c4;
  background: #fffaf1;
  padding: 8px 10px;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.inventory-item {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid #ebdecf;
  background: #fffdf9;
}

.inventory-item.low {
  background: #fff5ef;
  border-color: #f4c7b6;
}

.inventory-item .placeholder {
  width: 84px;
  height: 84px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: #f3eadf;
  color: var(--muted);
  font-size: 12px;
}

body.module-inventory .inventory-stock-row-odd td {
  background: #fffdf9;
}

body.module-inventory .inventory-stock-row-even td {
  background: #fff7ee;
}

body.module-inventory .inventory-stock-table th,
body.module-inventory .inventory-stock-table td {
  padding: 7px 7px;
  font-size: 12px;
  line-height: 1.15;
}

body.module-inventory .inventory-stock-clickable {
  cursor: pointer;
}

body.module-inventory .inventory-stock-name {
  font-weight: 600;
}

body.module-inventory .inventory-stock-clickable:hover td {
  background: #f0fdf4;
}

body.module-inventory .inventory-stock-clickable.active td {
  background: #dcfce7;
}

body.module-inventory .inventory-stock-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

body.module-inventory .inventory-add-position-btn {
  background: linear-gradient(135deg, #22c55e, #15803d);
  color: #ffffff;
  border: 1px solid #166534;
  box-shadow: 0 10px 20px rgba(21, 128, 61, 0.28);
}

body.module-inventory .inventory-add-position-btn:hover {
  background: linear-gradient(135deg, #16a34a, #166534);
}

.inventory-sheet-head-grid {
  align-items: end;
}

body.module-inventory .inventory-sheet-toggle-inline {
  display: flex;
  align-items: center;
  align-self: end;
  gap: 8px;
  min-height: 44px;
  font-weight: 600;
  cursor: pointer;
}

body.module-inventory .inventory-sheet-toggle-inline input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

body.module-inventory .inventory-sheet-area-field {
  transition: opacity 0.16s ease;
}

body.module-inventory .inventory-sheet-area-field.is-hidden {
  display: none;
  opacity: 0;
}

body.module-inventory .inventory-group-modal {
  position: fixed;
  inset: 0;
  z-index: 225;
  display: grid;
  align-items: start;
  justify-items: center;
  padding: 62px 18px 20px;
}

body.module-inventory .inventory-group-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  margin: 0;
  padding: 0;
  background: rgba(32, 25, 18, 0.48);
  cursor: pointer;
}

body.module-inventory .inventory-group-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  max-height: calc(100vh - 82px);
  overflow: auto;
  border: 2px solid #d9e5f2;
  box-shadow: 0 16px 34px rgba(27, 45, 82, 0.18);
}

body.module-inventory .inventory-group-table {
  display: grid;
  gap: 8px;
}

body.module-inventory .inventory-group-table-head,
body.module-inventory .inventory-group-table-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 110px auto;
  gap: 10px;
  align-items: center;
}

body.module-inventory .inventory-group-table-head {
  padding: 0 10px;
}

body.module-inventory .inventory-group-table-head > div {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body.module-inventory .inventory-group-table-head > div:nth-child(1),
body.module-inventory .inventory-group-table-head > div:nth-child(3) {
  text-align: center;
}

body.module-inventory .inventory-group-table-head > div:last-child {
  text-align: right;
}

body.module-inventory .inventory-group-table-rows {
  display: grid;
  gap: 8px;
}

body.module-inventory .inventory-group-table-row {
  padding: 10px;
  border: 1px dashed #ced9ea;
  border-radius: 14px;
  background: #fcfdff;
}

body.module-inventory .inventory-group-table-row-empty {
  grid-template-columns: minmax(0, 1fr);
}

body.module-inventory .inventory-group-cell-index,
body.module-inventory .inventory-group-cell-count {
  text-align: center;
  font-weight: 700;
  color: #334155;
}

body.module-inventory .inventory-group-row-actions {
  justify-content: flex-end;
  white-space: nowrap;
}

body.module-inventory .inventory-group-add-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

body.module-inventory .inventory-purchase-modal,
body.module-inventory .inventory-create-modal {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  align-items: start;
  justify-items: center;
  padding: 70px 20px 24px;
}

body.module-inventory .inventory-purchase-modal-backdrop,
body.module-inventory .inventory-create-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  margin: 0;
  padding: 0;
  background: rgba(32, 25, 18, 0.52);
  cursor: pointer;
}

body.module-inventory .inventory-purchase-modal-dialog,
body.module-inventory .inventory-create-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  max-height: calc(100vh - 94px);
  overflow: auto;
  border: 2px solid #cfe7d6;
  box-shadow: 0 16px 34px rgba(24, 70, 40, 0.24);
}

body.module-inventory .inventory-create-modal-form {
  display: grid;
  gap: 12px;
}

body.module-inventory .inventory-purchase-modal-form {
  display: grid;
  gap: 12px;
}

body.module-inventory .inventory-purchase-table {
  display: grid;
  gap: 8px;
}

body.module-inventory .inventory-purchase-table-head {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  gap: 10px;
  padding: 0 10px;
}

body.module-inventory .inventory-purchase-table-head > div {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body.module-inventory .inventory-purchase-table-head > div:last-child {
  text-align: right;
}

body.module-inventory .inventory-purchase-rows {
  display: grid;
  gap: 10px;
}

body.module-inventory .inventory-purchase-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px dashed #cddfce;
  border-radius: 14px;
  background: #fffdf7;
}

body.module-inventory .inventory-purchase-row-actions {
  align-items: center;
  justify-content: flex-end;
  white-space: nowrap;
}

.split-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.divider {
  height: 1px;
  background: #ebdecf;
  margin: 8px 0;
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(24, 18, 12, 0.84);
  display: grid;
  place-items: center;
  padding: 28px;
}

.image-modal-inner {
  max-width: min(92vw, 1200px);
  max-height: 88vh;
  display: grid;
  gap: 14px;
}

.image-modal img {
  max-width: 100%;
  max-height: 76vh;
  border-radius: 22px;
  object-fit: contain;
  background: #0b0b0b;
}

.image-modal-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: #fff7ed;
}

.qr-modal-inner {
  width: min(92vw, 280px);
  gap: 8px;
}

.qr-modal-head {
  margin-bottom: 2px;
}

.qr-modal-actions {
  justify-content: center;
  gap: 8px;
}

.qr-modal-actions .link-button {
  padding: 6px 10px;
  font-size: 11px;
}

.image-modal-name {
  font-weight: 700;
}

.image-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
}

.security-monitor-panel {
  max-width: 1240px;
  margin-bottom: 14px;
}

.security-monitor-head {
  align-items: flex-start;
  gap: 12px;
}

.security-monitor-controls {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.security-monitor-controls label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: #475569;
}

.security-monitor-controls select {
  min-width: 100px;
}

.security-monitor-switch {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
  padding: 7px 9px;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  background: #f8fafc;
}

.security-monitor-switch input[type="checkbox"] {
  accent-color: #0f766e;
}

.security-monitor-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.security-monitor-card {
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  background: #ffffff;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.security-monitor-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.security-monitor-card-head h4 {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #64748b;
}

.security-monitor-card-head strong {
  font-size: 18px;
  color: #0f172a;
}

.security-monitor-progress {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.security-monitor-progress > span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  transition: width 180ms ease;
  background: linear-gradient(90deg, #0ea5e9 0%, #2563eb 100%);
}

.security-monitor-card-network .security-monitor-progress > span {
  background: linear-gradient(90deg, #6366f1 0%, #9333ea 100%);
}

.security-monitor-network-lines {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #334155;
}

.security-monitor-chart-stack {
  margin-top: 10px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.security-monitor-chart-panel {
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  background: #ffffff;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.security-monitor-chart-title {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.security-monitor-chart {
  width: 100%;
  height: 190px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
}

.security-monitor-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.security-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid #dbe3ee;
}

.security-legend-item::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #64748b;
}

.security-legend-cpu::before { background: #ef4444; }
.security-legend-memory::before { background: #0ea5e9; }
.security-legend-swap::before { background: #f59e0b; }
.security-legend-disk::before { background: #10b981; }
.security-legend-net-in::before { background: #2563eb; }
.security-legend-net-out::before { background: #9333ea; }

.security-account-panel {
  max-width: 760px;
  margin-top: 4px;
}

.security-password-modal {
  width: min(92vw, 560px);
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  padding: 0;
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.24);
}

.security-password-modal::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.security-password-modal form {
  padding: 16px;
}

.security-password-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.security-password-modal-head h3 {
  margin: 0;
}

.module-monitor-panel {
  max-width: 1240px;
  margin-top: 14px;
}

.module-monitor-tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.module-monitor-tab-btn {
  border: 1px solid #dbe3ee;
  background: #f8fafc;
  color: #334155;
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
}

.module-monitor-tab-btn.active {
  background: #0f766e;
  border-color: #0f766e;
  color: #ffffff;
}

.module-monitor-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.16);
  color: inherit;
  font-size: 11px;
  font-weight: 700;
  margin-left: 8px;
  padding: 0 6px;
}

.module-monitor-tab-btn.active .module-monitor-tab-badge {
  background: rgba(255, 255, 255, 0.24);
}

.module-monitor-tab-content {
  display: none;
}

.module-monitor-tab-content.active {
  display: block;
}

.module-monitor-overview-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.module-monitor-overview-card {
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  background: #ffffff;
  padding: 12px;
}

.module-monitor-overview-card h4 {
  margin: 0 0 8px 0;
  color: #475569;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.module-monitor-overview-card p {
  margin: 0;
  color: #0f172a;
}

.module-monitor-overview-card-clickable {
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.module-monitor-overview-card-clickable:hover {
  border-color: #94a3b8;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.module-monitor-info-modal {
  position: fixed;
  inset: 0;
  z-index: 14000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.module-monitor-info-modal.is-hidden {
  display: none;
}

.module-monitor-info-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
}

.module-monitor-info-modal-dialog {
  position: relative;
  width: min(92vw, 680px);
  max-height: 80vh;
  overflow: auto;
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #dbe3ee;
  box-shadow: 0 24px 52px rgba(15, 23, 42, 0.24);
  padding: 14px;
}

.module-monitor-info-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.module-monitor-info-modal-head h4 {
  margin: 0;
}

.module-monitor-info-modal-body {
  color: #334155;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.module-monitor-info-modal-body p {
  margin: 0 0 10px;
}

.module-monitor-info-modal-body.has-table {
  white-space: normal;
}

.module-monitor-info-modal-body.has-table p {
  white-space: pre-wrap;
}

.module-monitor-action-cell {
  white-space: nowrap;
}

.module-monitor-action-cell .link-button,
.module-monitor-action-cell button {
  white-space: nowrap;
}

.module-monitor-inline-form {
  margin: 0;
}

.ops-center-panel {
  max-width: 1240px;
  margin-top: 14px;
}

.ops-center-top-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}

.ops-center-mini-card {
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  background: #ffffff;
  padding: 10px;
}

.ops-center-mini-card h4 {
  margin: 0 0 8px 0;
  font-size: 13px;
  color: #334155;
}

.ops-center-mini-card p {
  margin: 0 0 6px 0;
  color: #0f172a;
}

.ops-center-block {
  margin-top: 12px;
}

.ops-center-block h4 {
  margin: 0 0 8px 0;
}

.ops-center-db-kpi {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 10px;
}

@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }
  .sidebar {
    position: static;
    height: auto;
    overflow: visible;
  }
  .content {
    height: auto;
    overflow: visible;
  }
  .cutting-layout,
  .grid-main,
  .grid-3,
  .grid-2 { grid-template-columns: 1fr; }
  .security-monitor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .security-monitor-card-network {
    grid-column: span 2;
  }
  .security-monitor-chart-stack {
    grid-template-columns: 1fr;
  }
  .module-monitor-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .content { padding: 18px; }
  .page-head { flex-direction: column; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-bot-head { flex-direction: column; }
  .inventory-item { grid-template-columns: 1fr; }
  .split-actions,
  .form-grid.cols-2,
  .form-grid.cols-3 { grid-template-columns: 1fr; }
  body.module-inventory .inventory-group-modal {
    padding: 54px 12px 16px;
  }
  body.module-inventory .inventory-group-modal-dialog {
    max-height: calc(100vh - 70px);
  }
  body.module-inventory .inventory-group-table-head {
    display: none;
  }
  body.module-inventory .inventory-group-table-row {
    grid-template-columns: 1fr;
  }
  body.module-inventory .inventory-group-cell-index,
  body.module-inventory .inventory-group-cell-count {
    text-align: left;
  }
  body.module-inventory .inventory-group-row-actions {
    justify-content: flex-start;
  }
  body.module-inventory .inventory-group-add-form {
    grid-template-columns: 1fr;
  }
  body.module-inventory .inventory-purchase-modal,
  body.module-inventory .inventory-create-modal {
    padding: 54px 12px 16px;
  }
  body.module-inventory .inventory-purchase-modal-dialog,
  body.module-inventory .inventory-create-modal-dialog {
    max-height: calc(100vh - 70px);
  }
  body.module-inventory .inventory-purchase-table-head {
    display: none;
  }
  body.module-inventory .inventory-purchase-row {
    grid-template-columns: 1fr;
  }
  body.module-inventory .inventory-purchase-row-actions {
    justify-content: flex-start;
  }
  .calendar td { min-width: 120px; height: 144px; }
  .month-bars { overflow-x: auto; justify-items: stretch; }
  .photo-thumb { width: 92px; height: 92px; }
  .image-modal { padding: 16px; }
  .image-modal img { max-height: 68vh; }
  .machine-floating-window {
    left: 12px !important;
    top: 84px !important;
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
  }
  .machine-floating-window__header {
    flex-direction: column;
    align-items: flex-start;
  }
  .machine-floating-window__actions {
    width: 100%;
    justify-content: flex-end;
  }
  .security-monitor-controls {
    width: 100%;
  }
  .security-monitor-controls label {
    width: 100%;
  }
  .security-monitor-controls select,
  .security-monitor-controls button {
    width: 100%;
  }
  .security-monitor-grid {
    grid-template-columns: 1fr;
  }
  .security-monitor-card-network {
    grid-column: span 1;
  }
  .module-monitor-tab-btn {
    width: 100%;
    text-align: left;
  }
  .module-monitor-overview-grid {
    grid-template-columns: 1fr;
  }
  .ops-center-top-grid,
  .ops-center-db-kpi {
    grid-template-columns: 1fr;
  }
  .module-monitor-info-modal {
    padding: 12px;
  }
}
