:root {
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-soft: #f8f9fa;
  --surface-dark: #20242b;
  --surface-dark-2: #292e36;
  --text: #242830;
  --muted: #69717d;
  --line: #e1e5e9;
  --line-strong: #ccd2d8;
  --red: #b5262b;
  --red-dark: #8f1d21;
  --red-soft: #fff0f1;
  --gold: #d1a34c;
  --gold-soft: #fbf4e7;
  --green: #2f8a5d;
  --green-soft: #eaf7f0;
  --orange: #c7781b;
  --orange-soft: #fff5e8;
  --blue: #2d6fa8;
  --blue-soft: #edf5fb;
  --purple: #7858a6;
  --purple-soft: #f4effa;
  --shadow-sm: 0 1px 2px rgba(20, 29, 38, .06), 0 4px 12px rgba(20, 29, 38, .04);
  --shadow-md: 0 12px 38px rgba(20, 29, 38, .14);
  --shadow-lg: 0 24px 70px rgba(20, 29, 38, .22);
  --radius-sm: 8px;
  --radius: 13px;
  --radius-lg: 20px;
  --sidebar-width: 250px;
  --topbar-height: 82px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.hidden { display: none !important; }
.full-width { width: 100%; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell { min-height: 100vh; display: flex; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--surface-dark) 0%, #181b20 100%);
  color: #fff;
  z-index: 40;
  display: flex;
  flex-direction: column;
  box-shadow: 10px 0 40px rgba(16, 20, 25, .08);
}
.brand {
  min-height: 96px;
  padding: 21px 19px;
  display: flex;
  align-items: center;
  gap: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
}
.brand-mark {
  width: 42px;
  height: 42px;
  border: 3px solid var(--red);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  border-radius: 6px;
  background: rgba(255,255,255,.02);
  flex: 0 0 auto;
}
.brand-mark span { background: rgba(255,255,255,.92); border-radius: 1px; }
.brand-kicker { color: var(--gold); font-size: 9px; font-weight: 800; letter-spacing: .18em; line-height: 1; }
.brand-name { font-size: 18px; font-weight: 800; line-height: 1.05; letter-spacing: -.02em; }
.brand-claim { color: rgba(255,255,255,.52); font-size: 10px; margin-top: 4px; letter-spacing: .04em; }
.nav-list { flex: 1; padding: 16px 12px; overflow-y: auto; }
.nav-section-label {
  padding: 14px 12px 6px;
  color: rgba(255,255,255,.36);
  text-transform: uppercase;
  letter-spacing: .11em;
  font-size: 9px;
  font-weight: 800;
}
.nav-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.72);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  margin: 2px 0;
  border-radius: 9px;
  text-align: left;
  transition: .16s ease;
  position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: rgba(181,38,43,.22); color: #fff; }
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -12px;
  width: 3px;
  height: 22px;
  border-radius: 0 4px 4px 0;
  background: var(--red);
}
.nav-icon { width: 22px; text-align: center; font-size: 16px; }
.nav-label { flex: 1; font-weight: 620; }
.nav-badge {
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sidebar-foot { padding: 15px 14px 18px; border-top: 1px solid rgba(255,255,255,.09); }
.sync-state { display: flex; gap: 8px; align-items: center; color: rgba(255,255,255,.5); font-size: 11px; padding: 0 4px 12px; }
.sync-dot { width: 7px; height: 7px; background: #56c28b; border-radius: 50%; box-shadow: 0 0 0 4px rgba(86,194,139,.08); }

.page-column { width: calc(100% - var(--sidebar-width)); margin-left: var(--sidebar-width); min-width: 0; }
.topbar {
  min-height: var(--topbar-height);
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  padding: 13px 25px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.page-heading { flex: 1; min-width: 0; }
.page-heading h1 { margin: 0; font-size: 22px; line-height: 1.2; letter-spacing: -.025em; }
.page-heading p { margin: 3px 0 0; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.persona-picker {
  min-width: 176px;
  padding: 6px 9px 6px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  display: flex;
  flex-direction: column;
  gap: 0;
}
.persona-picker span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; font-weight: 750; }
.persona-picker select { border: 0; padding: 0; background: transparent; color: var(--text); font-weight: 700; outline: none; }
.mobile-menu { display: none !important; }
.hamburger, .hamburger::before, .hamburger::after { width: 18px; height: 2px; background: currentColor; display: block; border-radius: 3px; }
.hamburger { position: relative; }
.hamburger::before, .hamburger::after { content: ""; position: absolute; left: 0; }
.hamburger::before { top: -6px; }
.hamburger::after { top: 6px; }
.content { padding: 24px 25px 50px; max-width: 1800px; margin: 0 auto; }

.button {
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 9px 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: .15s ease;
  white-space: nowrap;
}
.button:disabled { opacity: .45; cursor: not-allowed; }
.button-primary { background: var(--red); color: #fff; box-shadow: 0 4px 12px rgba(181,38,43,.18); }
.button-primary:hover { background: var(--red-dark); transform: translateY(-1px); }
.button-secondary { background: var(--surface-dark); color: #fff; }
.button-secondary:hover { background: #111419; }
.button-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.sidebar .button-ghost { border-color: rgba(255,255,255,.15); color: rgba(255,255,255,.72); }
.button-ghost:hover { background: rgba(93,104,115,.07); }
.button-soft { background: var(--surface-soft); border-color: var(--line); color: var(--text); }
.button-soft:hover { border-color: var(--line-strong); background: #f0f2f4; }
.button-danger { background: var(--red-soft); color: var(--red-dark); border-color: #f4c8ca; }
.button-success { background: var(--green-soft); color: #216d49; border-color: #bfe4d0; }
.button-small { padding: 7px 10px; font-size: 12px; border-radius: 8px; }
.button-large { padding: 13px 18px; font-size: 15px; border-radius: 11px; }
.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  position: relative;
}
.icon-button:hover { background: var(--surface-soft); }
.notification-count {
  position: absolute;
  top: -6px;
  right: -5px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
}

.notification-wrap { position: relative; }
.notification-panel {
  position: absolute;
  top: 48px;
  right: 0;
  width: min(390px, calc(100vw - 24px));
  max-height: 580px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 70;
}
.notification-panel-head { position: sticky; top: 0; z-index: 2; background: #fff; padding: 15px 16px 10px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.notification-panel-head h3 { margin: 0; font-size: 15px; }
.notification-item { padding: 13px 16px; border-bottom: 1px solid var(--line); cursor: pointer; display: grid; grid-template-columns: 10px 1fr; gap: 10px; }
.notification-item:hover { background: var(--surface-soft); }
.notification-item.unread { background: #fffafb; }
.notification-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: transparent; }
.notification-item.unread .notification-dot { background: var(--red); }
.notification-title { font-weight: 800; font-size: 12px; }
.notification-body { color: var(--muted); font-size: 12px; margin-top: 2px; }
.notification-time { color: #9298a0; font-size: 10px; margin-top: 5px; }
.empty-notifications { padding: 32px 18px; text-align: center; color: var(--muted); }

.grid { display: grid; gap: 16px; }
.grid-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-two { grid-template-columns: minmax(0, 1.5fr) minmax(310px, .8fr); }
.grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-0 { margin-bottom: 0 !important; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 17px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 17px 12px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { margin: 0; }
.card-head h2 { font-size: 16px; }
.card-head h3 { font-size: 14px; }
.card-head p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.card-body { padding: 16px 17px; }
.kpi-card { padding: 16px; min-height: 116px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.kpi-card::after { content: ""; position: absolute; width: 72px; height: 72px; border-radius: 50%; right: -24px; top: -24px; background: currentColor; opacity: .055; }
.kpi-label { color: var(--muted); font-size: 11px; font-weight: 700; }
.kpi-value { font-size: 29px; line-height: 1; font-weight: 850; margin: 10px 0 7px; letter-spacing: -.04em; }
.kpi-foot { color: var(--muted); font-size: 10px; margin-top: auto; }
.kpi-icon { position: absolute; top: 15px; right: 15px; font-size: 18px; }
.kpi-card.danger { color: var(--red-dark); }
.kpi-card.warning { color: var(--orange); }
.kpi-card.success { color: var(--green); }
.kpi-card.info { color: var(--blue); }
.kpi-card.neutral { color: var(--purple); }

.section-title { margin: 0 0 12px; font-size: 17px; letter-spacing: -.02em; }
.section-subtitle { margin: -7px 0 14px; color: var(--muted); font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 11px; }
.tiny { font-size: 10px; }
.strong { font-weight: 800; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

.badge, .status-badge, .priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1.2;
  font-weight: 800;
  white-space: nowrap;
}
.badge-neutral, .status-open, .status-not_planned { color: #626b75; background: #eef0f2; }
.status-in_progress, .status-partial, .status-checking, .status-question, .status-preparing, .status-scheduled, .priority-high { color: #975811; background: var(--orange-soft); }
.status-done, .status-complete, .status-delivered, .status-resolved, .status-accepted { color: #226e4a; background: var(--green-soft); }
.status-sent, .status-ordered, .status-planned, .status-on_way, .status-seen { color: #255f8f; background: var(--blue-soft); }
.status-won, .status-restwork, .status-appointment { color: #66478f; background: var(--purple-soft); }
.status-critical, .priority-critical, .status-blocked, .status-overdue { color: var(--red-dark); background: var(--red-soft); }
.priority-normal { color: #5e6770; background: #eef0f2; }
.badge-gold { color: #765517; background: var(--gold-soft); }

.alert-list { display: flex; flex-direction: column; }
.alert-row { display: grid; grid-template-columns: 5px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.alert-row:last-child { border-bottom: 0; }
.alert-row:hover .alert-title { color: var(--red); }
.alert-bar { align-self: stretch; border-radius: 6px; background: var(--orange); }
.alert-row.critical .alert-bar { background: var(--red); }
.alert-row.normal .alert-bar { background: var(--blue); }
.alert-title { font-weight: 800; font-size: 12px; }
.alert-body { color: var(--muted); font-size: 11px; margin-top: 2px; }
.alert-meta { text-align: right; }

.progress-list { display: flex; flex-direction: column; gap: 13px; }
.progress-row { display: grid; grid-template-columns: 115px 1fr 34px; align-items: center; gap: 10px; }
.progress-label { font-size: 11px; color: var(--muted); }
.progress-track { height: 8px; border-radius: 99px; background: #eceff1; overflow: hidden; }
.progress-fill { height: 100%; border-radius: inherit; background: var(--red); }
.progress-value { font-size: 10px; font-weight: 800; text-align: right; }

.activity-list { display: flex; flex-direction: column; }
.activity-item { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.activity-item:last-child { border-bottom: 0; }
.activity-avatar { width: 32px; height: 32px; border-radius: 9px; background: var(--surface-dark); color: #fff; display: grid; place-items: center; font-weight: 850; font-size: 10px; }
.activity-text { font-size: 11px; }
.activity-text strong { font-size: 12px; }
.activity-time { color: #9298a0; font-size: 10px; margin-top: 3px; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.searchbox { position: relative; min-width: 270px; flex: 1; }
.searchbox input { padding-left: 36px; }
.searchbox::before { content: "⌕"; position: absolute; left: 12px; top: 8px; color: var(--muted); font-size: 17px; }
.input, input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="time"], input[type="number"], select, textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  padding: 9px 10px;
  outline: none;
  transition: .15s ease;
}
textarea { min-height: 98px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(181,38,43,.1); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label, .field-label { font-size: 11px; color: #4f5660; font-weight: 750; }
.required::after { content: " *"; color: var(--red); }
.form-hint { color: var(--muted); font-size: 10px; }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; padding: 3px; background: var(--surface-soft); }
.segmented button { border: 0; background: transparent; padding: 6px 10px; border-radius: 6px; color: var(--muted); font-weight: 700; font-size: 11px; }
.segmented button.active { background: #fff; color: var(--text); box-shadow: 0 1px 5px rgba(24,32,40,.1); }
.checkbox-row { display: flex; align-items: flex-start; gap: 8px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; }
.checkbox-row input { margin-top: 3px; width: auto; }
.radio-card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.radio-card { position: relative; }
.radio-card input { position: absolute; opacity: 0; }
.radio-card label { border: 1px solid var(--line); border-radius: 9px; padding: 10px; display: block; min-height: 68px; cursor: pointer; }
.radio-card label strong { display: block; font-size: 11px; }
.radio-card label span { color: var(--muted); font-size: 9px; }
.radio-card input:checked + label { border-color: var(--red); background: var(--red-soft); box-shadow: 0 0 0 2px rgba(181,38,43,.08); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 10px 12px; background: var(--surface-soft); color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .055em; white-space: nowrap; border-bottom: 1px solid var(--line); }
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 11px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: #fcfcfd; }
.customer-cell strong { display: block; font-size: 12px; }
.customer-cell span { color: var(--muted); font-size: 10px; }
.commission { font-weight: 850; color: var(--red-dark); }
.mobile-order-list { display: none; }

.week-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.week-title { display: flex; align-items: center; gap: 10px; }
.week-title h2 { margin: 0; font-size: 19px; }
.week-title span { color: var(--muted); font-size: 11px; }
.schedule-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); }
.schedule-grid { min-width: 1020px; display: grid; grid-template-columns: 170px repeat(5, minmax(160px, 1fr)); }
.schedule-corner, .schedule-day-head { position: sticky; top: 0; z-index: 4; background: var(--surface-dark); color: #fff; min-height: 63px; padding: 11px; border-right: 1px solid rgba(255,255,255,.08); }
.schedule-corner { left: 0; z-index: 6; display: flex; align-items: center; font-weight: 800; }
.schedule-day-head { text-align: center; }
.schedule-day-head strong { display: block; font-size: 12px; }
.schedule-day-head span { color: rgba(255,255,255,.55); font-size: 10px; }
.schedule-day-head.today { background: #3b2225; box-shadow: inset 0 -3px var(--red); }
.team-cell { position: sticky; left: 0; z-index: 3; padding: 13px 12px; min-height: 154px; background: #f7f8f9; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.team-cell strong { display: block; font-size: 12px; }
.team-members { color: var(--muted); font-size: 10px; margin: 3px 0 8px; }
.team-vehicle { display: inline-flex; padding: 3px 7px; border-radius: 6px; background: #eceff1; color: #5d6570; font-size: 9px; font-weight: 700; }
.schedule-cell { min-height: 154px; padding: 7px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; transition: .15s ease; }
.schedule-cell.today { background: #fffbfb; }
.schedule-cell.drag-over { background: var(--red-soft); box-shadow: inset 0 0 0 2px var(--red); }
.schedule-card { padding: 9px; border: 1px solid #d9dde1; border-left: 4px solid var(--blue); border-radius: 9px; background: #fff; box-shadow: 0 2px 7px rgba(29,38,47,.07); cursor: grab; margin-bottom: 7px; position: relative; }
.schedule-card:active { cursor: grabbing; }
.schedule-card.has-critical { border-left-color: var(--red); background: #fff9f9; }
.schedule-card.has-warning { border-left-color: var(--orange); }
.schedule-card.ready { border-left-color: var(--green); }
.schedule-card-title { font-weight: 850; font-size: 11px; line-height: 1.25; padding-right: 16px; }
.schedule-card-meta { color: var(--muted); font-size: 9px; margin-top: 4px; }
.schedule-card-icons { display: flex; gap: 4px; align-items: center; margin-top: 7px; flex-wrap: wrap; }
.schedule-mini-badge { padding: 2px 5px; background: var(--surface-soft); border-radius: 5px; color: #5c646e; font-size: 8px; font-weight: 800; }
.schedule-alert-dot { position: absolute; right: 7px; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.unplanned-panel { margin-top: 16px; }
.unplanned-list { display: flex; gap: 10px; overflow-x: auto; padding: 2px 1px 8px; }
.unplanned-card { min-width: 220px; max-width: 250px; border: 1px dashed var(--line-strong); background: #fff; border-radius: 10px; padding: 11px; cursor: grab; }
.unplanned-card:hover { border-color: var(--red); }

.issue-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.issue-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.issue-card { padding: 14px; cursor: pointer; transition: .16s ease; position: relative; overflow: hidden; }
.issue-card:hover { transform: translateY(-2px); box-shadow: 0 9px 24px rgba(24,32,40,.1); }
.issue-card::before { content: ""; position: absolute; top: 0; left: 0; bottom: 0; width: 4px; background: var(--blue); }
.issue-card.priority-critical::before { background: var(--red); }
.issue-card.priority-high::before { background: var(--orange); }
.issue-card-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.issue-card h3 { margin: 8px 0 5px; font-size: 13px; line-height: 1.3; }
.issue-card p { color: var(--muted); font-size: 11px; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.issue-card-foot { display: flex; justify-content: space-between; gap: 8px; align-items: center; border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; color: var(--muted); font-size: 9px; }
.assignee { display: flex; align-items: center; gap: 5px; }
.mini-avatar { width: 20px; height: 20px; border-radius: 6px; background: var(--surface-dark); color: #fff; display: grid; place-items: center; font-size: 8px; font-weight: 850; }

.material-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.material-column { background: #eef1f3; border-radius: 13px; padding: 10px; min-height: 250px; }
.material-column-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 3px 10px; }
.material-column-head h3 { margin: 0; font-size: 12px; }
.material-column-head span { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 99px; background: #fff; font-size: 10px; font-weight: 850; }
.material-ticket { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 11px; margin-bottom: 9px; box-shadow: 0 2px 7px rgba(29,38,47,.05); }
.material-ticket.critical { border-top: 3px solid var(--red); }
.material-ticket h4 { margin: 6px 0 3px; font-size: 12px; }
.material-ticket .address { color: var(--muted); font-size: 9px; }
.material-items { padding: 8px 0; margin: 8px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.material-item { display: flex; justify-content: space-between; gap: 8px; font-size: 10px; padding: 3px 0; }
.material-actions { display: flex; gap: 5px; flex-wrap: wrap; }

.hero-card { padding: 20px; background: linear-gradient(120deg, #20242b 0%, #313741 100%); color: #fff; border-radius: 17px; box-shadow: var(--shadow-md); position: relative; overflow: hidden; }
.hero-card::after { content: ""; width: 180px; height: 180px; border: 28px solid rgba(255,255,255,.035); position: absolute; right: -70px; top: -75px; border-radius: 50%; }
.hero-eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: .08em; font-size: 9px; font-weight: 850; }
.hero-card h2 { margin: 6px 0 5px; font-size: 24px; letter-spacing: -.035em; }
.hero-card p { color: rgba(255,255,255,.66); margin: 0; }
.hero-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 13px; }
.hero-pill { padding: 6px 9px; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.1); border-radius: 7px; font-size: 10px; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; position: relative; z-index: 1; }
.hero-actions .button-ghost { color: #fff; border-color: rgba(255,255,255,.22); }
.hero-actions .button-ghost:hover { background: rgba(255,255,255,.08); }
.big-action-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.big-action { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 15px; text-align: left; min-height: 105px; transition: .15s ease; }
.big-action:hover { border-color: var(--red); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.big-action-icon { font-size: 21px; }
.big-action strong { display: block; margin: 8px 0 2px; }
.big-action span { color: var(--muted); font-size: 10px; }
.week-mobile-list { display: flex; flex-direction: column; gap: 9px; }
.week-mobile-day { display: grid; grid-template-columns: 80px 1fr; gap: 9px; align-items: stretch; }
.week-mobile-date { background: var(--surface-soft); border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.week-mobile-date strong { font-size: 15px; }
.week-mobile-date span { font-size: 9px; color: var(--muted); }
.week-mobile-date.today { background: var(--red); color: #fff; border-color: var(--red); }
.week-mobile-date.today span { color: rgba(255,255,255,.7); }
.week-mobile-job { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 11px; cursor: pointer; }
.week-mobile-job.empty { display: grid; place-items: center; color: var(--muted); background: transparent; border-style: dashed; }

.detail-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; }
.info-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.info-item { padding: 10px; background: var(--surface-soft); border-radius: 9px; }
.info-item label { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .05em; font-weight: 800; }
.info-item div { margin-top: 3px; font-weight: 700; font-size: 11px; }
.note-list { display: flex; flex-direction: column; gap: 8px; }
.note-item { display: grid; grid-template-columns: 24px 1fr; gap: 8px; padding: 9px 10px; border-radius: 9px; background: var(--gold-soft); color: #5f4a21; font-size: 11px; }
.note-item.warning { background: var(--red-soft); color: var(--red-dark); }
.material-readiness { display: flex; flex-direction: column; gap: 8px; }
.readiness-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.readiness-row:last-child { border-bottom: 0; }
.readiness-row strong { font-size: 11px; }

.modal-root:empty { display: none; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(10,14,18,.58); backdrop-filter: blur(5px); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop.closing { opacity: 0; }
.modal { width: min(830px, 100%); max-height: calc(100vh - 40px); background: #fff; border-radius: 17px; box-shadow: var(--shadow-lg); overflow: hidden; position: relative; animation: modalIn .18s ease-out; }
.modal.modal-wide { width: min(1080px, 100%); }
.modal.modal-narrow { width: min(590px, 100%); }
.modal.modal-tall .modal-content { max-height: calc(100vh - 40px); overflow-y: auto; }
@keyframes modalIn { from { transform: translateY(10px) scale(.985); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-close { position: absolute; top: 12px; right: 13px; width: 32px; height: 32px; border: 0; border-radius: 8px; background: rgba(30,35,42,.08); color: #4e5660; font-size: 21px; line-height: 1; z-index: 5; }
.modal-close:hover { background: rgba(30,35,42,.13); }
.modal-content { max-height: calc(100vh - 40px); overflow-y: auto; }
.modal-header { padding: 20px 52px 16px 20px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; font-size: 19px; letter-spacing: -.025em; }
.modal-header p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.modal-body { padding: 18px 20px; }
.modal-footer { position: sticky; bottom: 0; padding: 13px 20px; background: rgba(255,255,255,.96); backdrop-filter: blur(12px); border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: flex-end; gap: 8px; z-index: 3; }
.modal-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 18px; overflow-x: auto; }
.modal-tab { border: 0; background: transparent; padding: 11px 10px; color: var(--muted); font-weight: 700; font-size: 11px; border-bottom: 2px solid transparent; white-space: nowrap; }
.modal-tab.active { color: var(--red); border-bottom-color: var(--red); }

.issue-detail-head { padding: 20px 52px 15px 20px; background: var(--surface-soft); border-bottom: 1px solid var(--line); }
.issue-detail-head h2 { margin: 8px 0 4px; font-size: 20px; }
.issue-detail-head p { margin: 0; color: var(--muted); }
.issue-meta-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 13px; }
.issue-meta-box { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.issue-meta-box label { display: block; color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .05em; }
.issue-meta-box strong { display: block; font-size: 10px; margin-top: 2px; }
.chat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; min-height: 420px; }
.chat-main { padding: 15px 18px; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.chat-stream { flex: 1; display: flex; flex-direction: column; gap: 10px; padding-bottom: 15px; }
.chat-message { display: grid; grid-template-columns: 30px minmax(0,1fr); gap: 8px; }
.chat-bubble { background: var(--surface-soft); border: 1px solid var(--line); border-radius: 2px 10px 10px 10px; padding: 8px 10px; }
.chat-bubble.system { background: var(--blue-soft); border-color: #d2e4f1; }
.chat-message.mine .chat-bubble { background: var(--red-soft); border-color: #f1d0d2; }
.chat-message-head { display: flex; justify-content: space-between; gap: 8px; font-size: 9px; color: var(--muted); }
.chat-message-head strong { color: var(--text); }
.chat-bubble p { margin: 4px 0 0; font-size: 11px; white-space: pre-wrap; }
.chat-compose { border-top: 1px solid var(--line); padding-top: 11px; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.chat-compose textarea { min-height: 42px; height: 42px; }
.issue-side { padding: 14px; background: #fbfcfc; }
.issue-side h3 { margin: 0 0 9px; font-size: 12px; }
.side-section { padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.side-section:last-child { border-bottom: 0; }
.attachment-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.attachment { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; min-height: 64px; display: grid; place-items: center; position: relative; }
.attachment img { width: 100%; height: 78px; object-fit: cover; }
.attachment-file { padding: 8px; text-align: center; font-size: 9px; color: var(--muted); word-break: break-all; }
.material-edit-row { display: grid; grid-template-columns: 1fr 94px; gap: 6px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.material-edit-row:last-child { border-bottom: 0; }
.material-edit-row strong { font-size: 10px; }
.material-edit-row span { display: block; color: var(--muted); font-size: 9px; }
.material-edit-row select { padding: 5px 6px; font-size: 9px; }

.material-form-row { display: grid; grid-template-columns: minmax(0,1.5fr) 110px 38px; gap: 8px; align-items: end; margin-bottom: 8px; }
.remove-row { width: 38px; height: 38px; border: 1px solid var(--line); background: #fff; border-radius: 8px; color: var(--red); font-size: 17px; }
.file-drop { border: 1px dashed var(--line-strong); border-radius: 10px; padding: 13px; background: var(--surface-soft); }
.file-drop input { border: 0; padding: 0; background: transparent; }

.empty-state { text-align: center; padding: 42px 20px; color: var(--muted); }
.empty-state-icon { font-size: 32px; opacity: .55; }
.empty-state h3 { color: var(--text); margin: 10px 0 4px; }
.empty-state p { margin: 0 auto 14px; max-width: 430px; font-size: 11px; }

.toast-container { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 9px; width: min(360px, calc(100vw - 28px)); pointer-events: none; }
.toast { pointer-events: auto; background: #20242b; color: #fff; border-radius: 11px; box-shadow: var(--shadow-md); padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 10px; animation: toastIn .22s ease-out; }
.toast.success { border-left: 4px solid #56c28b; }
.toast.warning { border-left: 4px solid var(--orange); }
.toast.danger { border-left: 4px solid #e14d53; }
.toast-title { font-weight: 800; font-size: 12px; }
.toast-body { color: rgba(255,255,255,.68); font-size: 10px; margin-top: 2px; }
.toast-close { border: 0; background: transparent; color: rgba(255,255,255,.6); font-size: 17px; }
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.settings-card { border: 1px solid var(--line); border-radius: 11px; padding: 14px; }
.settings-card h3 { margin: 0 0 5px; font-size: 13px; }
.settings-card p { color: var(--muted); font-size: 10px; margin: 0 0 12px; }
.demo-note { padding: 12px 13px; border: 1px solid #d7e5ef; background: var(--blue-soft); border-radius: 10px; color: #2d587a; font-size: 11px; }
.demo-note strong { color: #244762; }

.sidebar-backdrop { position: fixed; inset: 0; z-index: 35; background: rgba(10,14,18,.52); }

@media (max-width: 1280px) {
  .grid-kpis { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .issue-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .material-board { grid-template-columns: 1fr 1fr; }
  .grid-two { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  :root { --sidebar-width: 235px; }
  .quick-create { display: none; }
  .persona-picker { min-width: 145px; }
  .persona-picker span { display: none; }
  .grid-kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-three, .big-action-grid { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-main { border-right: 0; border-bottom: 1px solid var(--line); }
  .issue-side { background: #fff; }
}

@media (max-width: 760px) {
  :root { --topbar-height: 72px; }
  body { font-size: 13px; }
  .sidebar { transform: translateX(-102%); transition: transform .2s ease; width: min(290px, 85vw); }
  .sidebar.open { transform: translateX(0); }
  .page-column { width: 100%; margin-left: 0; }
  .mobile-menu { display: inline-flex !important; }
  .topbar { padding: 10px 12px; gap: 9px; }
  .page-heading h1 { font-size: 17px; }
  .page-heading p { display: none; }
  .content { padding: 15px 12px 36px; }
  .topbar-actions { gap: 6px; }
  .persona-picker { min-width: 118px; max-width: 135px; padding: 7px; }
  .persona-picker select { font-size: 11px; text-overflow: ellipsis; }
  .notification-button { width: 38px; height: 38px; }
  .grid-kpis { grid-template-columns: 1fr 1fr; gap: 9px; }
  .kpi-card { min-height: 104px; padding: 13px; }
  .kpi-value { font-size: 25px; }
  .issue-grid, .material-board, .grid-three, .big-action-grid, .settings-grid { grid-template-columns: 1fr; }
  .card-pad { padding: 14px; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .form-group.full { grid-column: auto; }
  .radio-card-grid { grid-template-columns: 1fr; }
  .searchbox { min-width: 100%; }
  .desktop-table { display: none; }
  .mobile-order-list { display: flex; flex-direction: column; gap: 9px; }
  .mobile-order-card { padding: 13px; cursor: pointer; }
  .mobile-order-card h3 { margin: 0 0 3px; font-size: 13px; }
  .mobile-order-card .address { color: var(--muted); font-size: 10px; }
  .mobile-order-status { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 10px; }
  .mobile-order-status > div { background: var(--surface-soft); padding: 7px; border-radius: 7px; }
  .mobile-order-status label { display: block; color: var(--muted); font-size: 8px; text-transform: uppercase; }
  .mobile-order-status span { margin-top: 3px; }
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal, .modal.modal-wide, .modal.modal-narrow { width: 100%; max-height: 96vh; border-radius: 18px 18px 0 0; }
  .modal-content { max-height: 96vh; }
  .modal-header { padding: 18px 48px 14px 15px; }
  .modal-body { padding: 15px; }
  .modal-footer { padding: 11px 15px calc(11px + env(safe-area-inset-bottom)); }
  .issue-detail-head { padding: 17px 45px 14px 15px; }
  .issue-meta-grid { grid-template-columns: 1fr 1fr; }
  .info-list { grid-template-columns: 1fr; }
  .chat-main { padding: 13px; }
  .issue-side { padding: 13px; }
  .material-form-row { grid-template-columns: 1fr 86px 38px; }
  .week-mobile-day { grid-template-columns: 67px 1fr; }
  .hero-card h2 { font-size: 21px; }
  .notification-panel { position: fixed; top: 70px; right: 8px; left: 8px; width: auto; max-height: calc(100vh - 84px); }
}

@media (max-width: 430px) {
  .grid-kpis { grid-template-columns: 1fr; }
  .kpi-card { min-height: 92px; }
  .kpi-value { margin: 7px 0 5px; }
  .page-heading { max-width: 105px; }
  .persona-picker { min-width: 108px; max-width: 110px; }
  .hero-actions .button { flex: 1; }
}

@media print {
  .sidebar, .topbar, .button, .notification-panel { display: none !important; }
  .page-column { margin: 0; width: 100%; }
  .content { padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* Produktive Web-App-Erweiterungen */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
body.modal-open { overflow: hidden; }
.login-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(360px, 44%) 1fr;
  background: var(--surface-dark);
}
.login-panel {
  background: #fff;
  padding: clamp(28px, 5vw, 72px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.login-card { width: min(440px, 100%); margin: 0 auto; }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 42px; }
.login-brand .brand-mark { background: var(--surface-dark); }
.login-brand .brand-name { color: var(--text); font-size: 24px; }
.login-brand .brand-kicker { font-size: 10px; }
.login-card h1 { font-size: clamp(28px, 4vw, 40px); margin: 0 0 10px; letter-spacing: -.04em; }
.login-card > p { color: var(--muted); margin: 0 0 28px; font-size: 15px; }
.login-form { display: grid; gap: 16px; }
.login-form .button { min-height: 48px; }
.login-error { padding: 11px 13px; border-radius: 9px; background: var(--red-soft); color: var(--red-dark); border: 1px solid #f2c6c8; }
.login-demo { margin-top: 24px; padding: 13px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 10px; font-size: 12px; color: var(--muted); }
.login-visual {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: clamp(32px, 6vw, 80px);
  color: #fff;
  background:
    radial-gradient(circle at 75% 18%, rgba(209,163,76,.32), transparent 32%),
    linear-gradient(145deg, #2c323b 0%, #15181d 70%);
}
.login-visual::before, .login-visual::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.08); transform: rotate(12deg); }
.login-visual::before { width: 58vw; height: 58vw; right: -18vw; top: -26vw; }
.login-visual::after { width: 35vw; height: 35vw; right: 5vw; top: 5vw; border-color: rgba(181,38,43,.45); }
.login-visual-content { position: relative; z-index: 1; max-width: 620px; }
.login-visual h2 { font-size: clamp(31px, 5vw, 62px); line-height: 1.04; letter-spacing: -.05em; margin: 0 0 18px; }
.login-visual p { color: rgba(255,255,255,.68); font-size: clamp(15px, 1.5vw, 20px); max-width: 560px; }
.login-feature-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 28px; }
.login-feature-row span { padding: 8px 11px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.05); border-radius: 99px; font-size: 12px; }

.loading-shell { min-height: 100vh; display: grid; place-items: center; background: var(--surface-dark); color: #fff; text-align: center; }
.loading-mark { margin: 0 auto 18px; }
.spinner { width: 28px; height: 28px; border: 3px solid rgba(255,255,255,.2); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }

.install-banner { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--gold-soft); border: 1px solid #ead6aa; border-radius: 11px; margin-bottom: 16px; }
.install-banner .install-copy { flex: 1; min-width: 0; }
.install-banner strong { display: block; }
.install-banner span { color: var(--muted); font-size: 12px; }
.online-state.offline .sync-dot { background: var(--orange); box-shadow: 0 0 0 4px rgba(199,120,27,.1); }
.online-state.error .sync-dot { background: var(--red); box-shadow: 0 0 0 4px rgba(181,38,43,.1); }
.user-menu-button { min-width: 178px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); padding: 7px 10px; display: flex; align-items: center; gap: 9px; text-align: left; }
.user-menu-button:hover { background: #f0f2f4; }
.user-avatar { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-dark); color: #fff; font-weight: 800; flex: 0 0 auto; }
.user-menu-copy { min-width: 0; flex: 1; }
.user-menu-copy strong, .user-menu-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-copy span { font-size: 10px; color: var(--muted); }
.user-dropdown { position: absolute; top: calc(100% + 8px); right: 0; width: 260px; z-index: 90; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-md); padding: 8px; }
.user-dropdown button { width: 100%; border: 0; background: transparent; padding: 10px 11px; text-align: left; border-radius: 8px; }
.user-dropdown button:hover { background: var(--surface-soft); }
.user-dropdown .danger { color: var(--red-dark); }
.user-menu-wrap { position: relative; }

.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 13px 15px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.toolbar .search-box { flex: 1; min-width: 220px; }
.search-box { position: relative; }
.search-box input { padding-left: 37px; }
.search-box::before { content: "⌕"; position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 18px; }

.data-table td.actions { width: 1%; white-space: nowrap; }
.table-scroll { overflow: auto; -webkit-overflow-scrolling: touch; }
.clickable-row { cursor: pointer; }
.clickable-row:hover td { background: var(--surface-soft); }
.status-grid-compact { display: flex; flex-wrap: wrap; gap: 5px; }
.address-line { color: var(--muted); font-size: 12px; }
.commission { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 800; color: var(--red-dark); }

.detail-tabs { display: flex; overflow-x: auto; gap: 4px; padding: 0 22px; border-bottom: 1px solid var(--line); }
.detail-tab { border: 0; background: transparent; padding: 13px 12px 11px; color: var(--muted); font-weight: 700; border-bottom: 2px solid transparent; white-space: nowrap; }
.detail-tab.active { color: var(--red-dark); border-bottom-color: var(--red); }
.detail-section { padding: 20px 22px; }
.status-edit-grid { display: grid; grid-template-columns: repeat(5, minmax(140px, 1fr)); gap: 10px; }
.status-edit-card { background: var(--surface-soft); border: 1px solid var(--line); border-radius: 11px; padding: 11px; }
.status-edit-card label { display: block; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 800; margin-bottom: 7px; }
.status-edit-card select { width: 100%; }
.note-row, .material-row { display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.note-row:last-child, .material-row:last-child { border-bottom: 0; }
.warning-symbol { color: var(--red); font-size: 16px; }
.note-meta { color: var(--muted); font-size: 11px; margin-top: 3px; }
.inline-form { display: grid; grid-template-columns: minmax(160px,1fr) minmax(110px,.5fr) minmax(140px,.7fr) auto; gap: 8px; align-items: end; }
.inline-form.note-form { grid-template-columns: 1fr auto auto; }

.schedule-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.schedule-title { font-size: 18px; font-weight: 800; }
.schedule-board { min-width: 1050px; }
.schedule-cell { min-height: 116px; }
.schedule-card[draggable="true"] { cursor: grab; }
.schedule-card.dragging { opacity: .45; }
.schedule-dropzone.drag-over { outline: 2px dashed var(--red); outline-offset: -4px; background: var(--red-soft); }
.schedule-unplanned { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px; background: var(--surface-soft); border: 1px dashed var(--line-strong); border-radius: 11px; }
.unplanned-card { padding: 8px 10px; border: 1px solid var(--line); background: #fff; border-radius: 9px; cursor: grab; }

.issue-list-card { display: grid; grid-template-columns: 6px minmax(0,1fr) auto; gap: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; cursor: pointer; }
.issue-list-card:hover { box-shadow: var(--shadow-sm); border-color: var(--line-strong); }
.issue-list-card .priority-strip { background: var(--blue); }
.issue-list-card.high .priority-strip { background: var(--orange); }
.issue-list-card.critical .priority-strip { background: var(--red); }
.issue-list-main { padding: 14px 0; min-width: 0; }
.issue-list-main h3 { margin: 0 0 5px; font-size: 15px; }
.issue-list-main p { margin: 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.issue-list-meta { padding: 13px 14px 13px 0; text-align: right; }
.issue-number { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); font-size: 11px; }

.admin-tabs { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }
.admin-tab { border: 1px solid var(--line); background: #fff; padding: 8px 11px; border-radius: 9px; font-weight: 700; }
.admin-tab.active { background: var(--surface-dark); color: #fff; border-color: var(--surface-dark); }
.permission-groups { display: grid; gap: 14px; }
.permission-group { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.permission-group h4 { margin: 0; padding: 10px 12px; background: var(--surface-soft); border-bottom: 1px solid var(--line); }
.permission-row { display: grid; grid-template-columns: 1fr 150px; gap: 12px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.permission-row:last-child { border-bottom: 0; }
.permission-row p { margin: 2px 0 0; font-size: 11px; color: var(--muted); }
.permission-state { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; background: var(--surface-soft); border: 1px solid var(--line); padding: 3px; border-radius: 8px; }
.permission-state label { position: relative; }
.permission-state input { position: absolute; opacity: 0; }
.permission-state span { display: block; text-align: center; padding: 6px 3px; border-radius: 6px; font-size: 10px; font-weight: 800; cursor: pointer; }
.permission-state input:checked + span { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.permission-state .allow input:checked + span { color: var(--green); }
.permission-state .deny input:checked + span { color: var(--red); }
.audit-json { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; white-space: pre-wrap; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 8px; padding: 9px; max-height: 220px; overflow: auto; }

.offline-chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; padding: 5px 8px; font-size: 10px; font-weight: 800; background: var(--orange-soft); color: #8a4f0b; }
.queue-panel { display: grid; gap: 8px; }
.queue-item { border: 1px solid var(--line); border-radius: 9px; padding: 10px; display: flex; gap: 10px; align-items: center; }
.queue-item > div { flex: 1; min-width: 0; }

.pwa-only { display: none; }
@media (display-mode: standalone) { .browser-only { display: none !important; } .pwa-only { display: initial; } }

@media (max-width: 920px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .status-edit-grid { grid-template-columns: 1fr 1fr; }
  .inline-form { grid-template-columns: 1fr 1fr; }
  .inline-form > .button { grid-column: 1 / -1; }
  .user-menu-button { min-width: 42px; width: 42px; padding: 4px; border: 0; background: transparent; }
  .user-menu-copy, .user-menu-button > span:last-child { display: none; }
}
@media (max-width: 680px) {
  .login-panel { padding: 26px 18px; }
  .login-brand { margin-bottom: 28px; }
  .status-edit-grid { grid-template-columns: 1fr; }
  .inline-form, .inline-form.note-form { grid-template-columns: 1fr; }
  .detail-section { padding: 15px; }
  .detail-tabs { padding: 0 12px; }
  .permission-row { grid-template-columns: 1fr; }
  .topbar-actions .quick-create { width: 40px; padding-inline: 0; font-size: 0; }
  .topbar-actions .quick-create::before { content: "+"; font-size: 21px; }
  .install-banner { align-items: flex-start; }
}
