:root {
  --charcoal: #3e3e3d;
  --charcoal-dark: #252625;
  --charcoal-soft: #545452;
  --red: #d50b00;
  --red-dark: #b10003;
  --red-soft: #fce9e7;
  --blue: #4778bd;
  --blue-soft: #eaf1fb;
  --bg: #f4f3f1;
  --surface: #ffffff;
  --surface-soft: #faf9f7;
  --text: #292b2a;
  --muted: #6f7472;
  --line: #e2e1de;
  --green: #237a55;
  --amber: #ad6b14;
  --shadow: 0 8px 26px rgba(45, 46, 45, .065);
  --shadow-strong: 0 18px 55px rgba(21, 22, 21, .18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  font: 14px/1.55 "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }

:focus-visible {
  outline: 3px solid rgba(213, 11, 0, .25);
  outline-offset: 2px;
}

.has-sidebar { display: flex; min-height: 100vh; }
.sidebar {
  width: 272px;
  min-height: 100vh;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex: none;
  flex-direction: column;
  overflow-y: auto;
  color: #f4f4f2;
  background:
    linear-gradient(160deg, rgba(255,255,255,.035), transparent 36%),
    var(--charcoal-dark);
  border-right: 4px solid var(--red);
}
.brand {
  display: block;
  padding: 22px 20px 27px;
  border-bottom: 1px solid rgba(255,255,255,.09);
}
.brand-logo {
  display: flex;
  align-items: center;
  min-height: 78px;
  padding: 11px 13px;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,.16);
}
.brand-logo img { width: 100%; height: auto; }
.brand-context {
  display: block;
  margin-top: 12px;
  color: #b7b9b6;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 2px;
  text-align: center;
}
.nav-caption {
  padding: 25px 25px 10px;
  color: #898d89;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.7px;
}
.nav { display: grid; gap: 4px; padding: 0 12px; }
.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 6px;
  color: #c5c8c4;
  font-size: 13px;
  font-weight: 650;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.nav a:hover { color: #fff; background: rgba(255,255,255,.07); transform: translateX(2px); }
.nav a[aria-current] {
  color: #fff;
  background: var(--red);
  box-shadow: 0 7px 18px rgba(177, 0, 3, .27);
}
.nav a[aria-current]::after {
  content: "";
  position: absolute;
  right: -16px;
  width: 4px;
  height: 22px;
  border-radius: 4px 0 0 4px;
  background: #fff;
}
.nav-icon {
  width: 22px;
  color: #a9adaa;
  font-size: 19px;
  line-height: 1;
  text-align: center;
}
.nav a[aria-current] .nav-icon { color: #fff; }
.sidebar-bottom {
  margin-top: auto;
  padding: 17px 18px 20px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.workspace-status {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 14px;
  color: #8f938f;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}
.workspace-status span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #53b37b;
  box-shadow: 0 0 0 4px rgba(83,179,123,.12);
}
.identity { display: flex; align-items: center; gap: 10px; }
.avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: none;
  place-items: center;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 50%;
  color: #fff;
  background: var(--red);
  font-weight: 850;
}
.identity strong {
  display: block;
  max-width: 155px;
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.identity small { color: #9da19d; font-size: 11px; }
.account-link {
  display: block;
  margin-top: 13px;
  padding: 7px 1px;
  color: #c8cac7;
  font-size: 12px;
  font-weight: 650;
}
.account-link:hover { color: #fff; }
.logout {
  width: 100%;
  margin-top: 7px;
  padding: 9px 11px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 5px;
  color: #d7d9d5;
  background: transparent;
  font-size: 12px;
  text-align: left;
}
.logout span { float: right; color: #fff; }
.logout:hover { color: #fff; background: rgba(255,255,255,.07); }

.main {
  min-width: 0;
  flex: 1;
  background:
    linear-gradient(rgba(62,62,61,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(62,62,61,.018) 1px, transparent 1px),
    var(--bg);
  background-size: 34px 34px;
}
.page { max-width: 1540px; margin: auto; padding: 39px 44px 72px; }
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 27px;
  padding-bottom: 20px;
  border-bottom: 1px solid #dcdad6;
}
.eyebrow {
  margin-bottom: 6px;
  color: var(--red);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 1.65px;
}
.page-header h1 {
  margin: 0;
  color: var(--charcoal);
  font-size: 31px;
  font-weight: 800;
  letter-spacing: -.8px;
  line-height: 1.15;
}
.subtitle { max-width: 680px; margin: 7px 0 0; color: var(--muted); }
.header-date {
  padding: 7px 10px 7px 12px;
  border-left: 3px solid var(--red);
  color: #717572;
  font-size: 11px;
  font-weight: 650;
  text-transform: capitalize;
  white-space: nowrap;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 13px;
  margin: 0 0 19px;
}
.dashboard-toolbar {
  margin-bottom: 21px;
  padding: 16px 18px;
  border: 1px solid #dfddd9;
  border-left: 4px solid var(--red);
  border-radius: 7px;
  background: rgba(255,255,255,.62);
}
.welcome-copy { display: grid; gap: 2px; }
.welcome-kicker {
  color: var(--red);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 1.35px;
}
.toolbar-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.table-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.table-actions > span { white-space: nowrap; }
.btn {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  color: #fff;
  background: var(--red);
  box-shadow: 0 6px 14px rgba(177,0,3,.18);
}
.btn-primary:hover { background: var(--red-dark); box-shadow: 0 8px 18px rgba(177,0,3,.23); }
.btn-secondary { color: var(--charcoal); border-color: #cfceca; background: #fff; }
.btn-secondary:hover { border-color: #aaa9a5; background: #f8f7f5; }
.btn-plain { color: #666a67; background: #eeece9; }
.btn-plain:hover { background: #e5e2de; }
.btn-small { min-height: 31px; padding: 6px 10px; font-size: 11px; }
.btn-danger { color: #a91b18; border-color: #ecc5c2; background: #fff0ee; }
.btn-danger:hover { border-color: #dfa39e; background: #ffe8e5; }
.project-status-form { display: flex; align-items: center; gap: 7px; }
.project-status-form label { display: flex; align-items: center; gap: 8px; color: #666b67; font-size: 11px; font-weight: 750; }
.project-status-form select { min-width: 105px; min-height: 33px; padding: 5px 28px 5px 8px; border: 1px solid #cfceca; border-radius: 4px; color: var(--charcoal); background: #fff; font-size: 11px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); gap: 16px; margin: 0 0 22px; }
.stat {
  position: relative;
  min-height: 137px;
  overflow: hidden;
  padding: 20px 20px 17px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--red);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.stat::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -36px;
  width: 90px;
  height: 90px;
  border: 15px solid rgba(213,11,0,.035);
  border-radius: 50%;
}
.stat.warning { border-top-color: var(--amber); }
.stat.good { border-top-color: var(--blue); }
.stat-label { color: #747875; font-size: 11px; font-weight: 700; }
.stat-value {
  margin-top: 8px;
  color: var(--charcoal);
  font-size: 34px;
  font-weight: 850;
  letter-spacing: -1.2px;
  line-height: 1.2;
}
.stat-foot { margin-top: 5px; color: #949793; font-size: 10px; }
.stat-icon {
  position: absolute;
  top: 17px;
  right: 17px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: var(--red);
  background: var(--red-soft);
  font-size: 18px;
  font-weight: 800;
}
.stat.warning .stat-icon { color: var(--amber); background: #fff1dc; }
.stat.good .stat-icon { color: var(--blue); background: var(--blue-soft); }
.stat-link { display: block; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.stat-link:hover { transform: translateY(-2px); border-color: #cbc9c5; box-shadow: 0 13px 32px rgba(45,46,45,.11); }
.stat-link .stat-foot span { margin-left: 3px; color: var(--red); font-weight: 900; }
.dashboard-week { display: grid; grid-template-columns: repeat(7,minmax(125px,1fr)); gap: 8px; padding: 14px; overflow-x: auto; }
.dashboard-day { min-height: 142px; padding: 10px; border: 1px solid #e2e1de; border-radius: 5px; background: #faf9f7; }
.dashboard-day.is-today { border-color: #e2aaa7; box-shadow: inset 0 3px 0 var(--red); background: #fffafa; }
.dashboard-day > header { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin-bottom: 8px; padding-bottom: 7px; border-bottom: 1px solid #e8e6e3; }
.dashboard-day > header span { color: #3e4340; font-size: 10px; font-weight: 850; }
.dashboard-day > header strong { color: #858985; font-size: 9px; }
.dashboard-plan-item { display: grid; gap: 2px; margin-bottom: 7px; padding: 7px; border-left: 3px solid var(--blue); border-radius: 3px; background: #eef4fb; }
.dashboard-plan-item:last-child { margin-bottom: 0; }
.dashboard-plan-item strong { color: #2f568d; font-size: 10px; }
.dashboard-plan-item span { color: #4e5550; font-size: 10px; font-weight: 700; }
.dashboard-plan-item small { color: #747b76; font-size: 9px; }
.dashboard-plan-item .btn { width: 100%; min-height: 28px; margin-top: 4px; padding: 5px 6px; font-size: 9px; }
.dashboard-day-empty { padding: 24px 2px; color: #a5a8a4; font-size: 9px; text-align: center; }
.two-col { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(300px,1fr); gap: 17px; }
.dashboard-panels > .panel:only-child { grid-column: 1 / -1; }

.panel {
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  min-height: 57px;
  padding: 16px 20px;
  border-bottom: 1px solid #e8e6e3;
  background: linear-gradient(180deg, #fff, #fbfaf8);
}
.panel-heading h2 {
  position: relative;
  margin: 0;
  padding-left: 13px;
  color: var(--charcoal);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -.1px;
}
.panel-heading h2::before {
  content: "";
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  width: 3px;
  border-radius: 2px;
  background: var(--red);
}
.panel-heading a { color: var(--red); font-size: 11px; font-weight: 800; }
.panel-heading a:hover { text-decoration: underline; }
.panel-heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.panel-heading-actions .btn { color: var(--charcoal); }
.panel-heading-actions .btn:hover { text-decoration: none; }
.feed-list { display: grid; }
.feed-item { padding: 20px; border-top: 1px solid #eceae7; background: #fff; }
.feed-item:first-child { border-top: 0; }
.feed-item.important { padding-left: 17px; border-left: 3px solid var(--red); background: linear-gradient(90deg,#fff5f3,#fff 38%); }
.feed-item-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 9px; }
.feed-item-header > div { min-width: 0; }
.feed-item-header .tag { margin-bottom: 6px; }
.feed-item h3 { margin: 0; color: var(--charcoal); font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.feed-meta { flex: none; color: #8a8e8a; font-size: 10px; white-space: nowrap; }
.feed-body { color: #585e5a; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.feed-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid #eceae7; }
.feed-list-compact .feed-item { padding: 15px 18px; }
.feed-list-compact .feed-item.important { padding-left: 15px; }
.feed-list-compact .feed-body { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.profile-selector { max-width: 520px; margin-bottom: 18px; }
.table-wrap { max-width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
thead { background: #f6f5f3; }
th {
  padding: 12px 18px;
  color: #777b77;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
}
td {
  padding: 14px 18px;
  border-top: 1px solid #eceae7;
  color: #5c615e;
  font-size: 12px;
  vertical-align: middle;
}
td strong { color: #343735; font-size: 12px; font-weight: 750; }
td .secondary { display: block; margin-top: 2px; color: #949995; font-size: 10px; }
td a:not(.btn) { color: var(--red-dark); font-weight: 800; }
td a:not(.btn):hover { text-decoration: underline; }
tr:hover td { background: #fff9f8; }

.tag {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.tag.green { color: #1f704f; background: #e7f4ec; }
.tag.red { color: #a91b18; background: #fff0ee; }
.tag.gray { color: #696d6a; background: #ececea; }
.tag.blue { color: #345e96; background: var(--blue-soft); }
.tag.amber { color: #946116; background: #fff0d6; }
.tag.purple { color: #6e4c83; background: #f0e8f4; }
.movement-type { font-weight: 800; white-space: nowrap; }
.movement-type.in { color: var(--green); }
.movement-type.out { color: var(--red-dark); }
.stock-low { color: var(--red-dark); font-weight: 850; }
.stock-ok { color: var(--green); font-weight: 850; }
.empty { padding: 38px 22px; color: #858a86; text-align: center; }
.empty-icon { color: #c7c8c5; font-size: 30px; }

.alert {
  margin-bottom: 19px;
  padding: 12px 15px;
  border: 1px solid #b9dfcb;
  border-left: 4px solid var(--green);
  border-radius: 5px;
  color: #246947;
  background: #edf8f1;
  font-weight: 650;
}
.alert.error { color: #9d2722; border-color: #f0bdb9; border-left-color: var(--red); background: #fff0ee; }
.form-panel { max-width: 880px; overflow: visible; }
.form-inner { padding: 23px; }
.material-action-panel { max-width: 880px; overflow: visible; border-top: 3px solid var(--red); }
.material-action-inner { padding: 20px 23px; }
.material-action-inner .field { max-width: 440px; }
[data-material-action-panel][hidden] { display: none; }
.fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 17px 20px; }
.fields .wide { grid-column: 1 / -1; }
.material-batch { display: grid; gap: 12px; margin-top: 3px; }
.material-batch-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-bottom: 9px; border-bottom: 1px solid #dedcd8; }
.material-batch-head > div { display: grid; gap: 3px; }
.material-batch-head strong { color: #373b38; font-size: 13px; }
.material-batch-head span { color: #858985; font-size: 10px; }
.material-batch-head > span { flex: none; color: var(--red-dark); font-weight: 800; }
.material-item-list { display: grid; gap: 12px; }
.material-item { padding: 15px; border: 1px solid #dedcd8; border-radius: 6px; background: #faf9f7; }
.material-item-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.material-item-head strong { color: var(--charcoal); font-size: 11px; letter-spacing: .3px; text-transform: uppercase; }
.material-item-remove { padding: 4px 0; border: 0; color: var(--red-dark); background: transparent; font-size: 10px; font-weight: 800; cursor: pointer; }
.material-item-remove:hover { text-decoration: underline; }
.material-item-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px 17px; }
.material-item-grid .wide { grid-column: 1 / -1; }
.material-add { justify-self: start; }
.panel-note { color: #858985; font-size: 10px; font-weight: 700; }
.scan-box {
  padding: 16px;
  border: 1px solid #e2d5d2;
  border-left: 4px solid var(--red);
  border-radius: 5px;
  background: #fdfaf9;
}
.scan-box-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.scan-box-head strong { color: #3d413e; font-size: 12px; }
.scan-box-head span { color: #858985; font-size: 10px; }
.barcode-control { min-width: 0; }
.barcode-row { display: flex; align-items: stretch; gap: 8px; }
.barcode-row input { min-width: 0; flex: 1; font-family: Consolas, "Courier New", monospace; letter-spacing: .5px; }
.barcode-row .btn { flex: none; }
.scan-status { min-height: 17px; margin-top: 6px; color: #858985; font-size: 10px; font-weight: 500; }
.scan-status.busy { color: var(--blue); }
.scan-status.success { color: var(--green); font-weight: 750; }
.scan-status.error { color: var(--red-dark); font-weight: 700; }
.barcode-code { color: #4e5450; font: 11px/1.4 Consolas, "Courier New", monospace; }
.photo-upload { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px 18px; align-items: center; padding: 15px 16px; border: 1px solid #d9d7d3; border-radius: 6px; background: #f8f8f6; }
.photo-upload-copy { display: grid; gap: 3px; }
.photo-upload-copy strong { color: #3d413e; font-size: 12px; }
.photo-upload-copy span { color: #7d827e; font-size: 10px; line-height: 1.45; }
.photo-upload-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.photo-file-input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.photo-preview { grid-column: 1 / -1; overflow: hidden; max-width: 260px; border: 1px solid #d4d1cc; border-radius: 6px; background: #fff; }
.photo-preview img { display: block; width: 100%; max-height: 210px; object-fit: cover; }
.photo-status { grid-column: 1 / -1; color: #858985; font-size: 10px; }
.photo-status.busy { color: var(--blue); }
.photo-status.success { color: var(--green); font-weight: 750; }
.photo-status.error { color: var(--red-dark); font-weight: 700; }
.material-photos { display: flex; gap: 7px; flex-wrap: wrap; min-width: 84px; }
.material-photos a { display: grid; gap: 3px; color: #646a66; font-size: 8px; font-weight: 750; text-align: center; text-decoration: none; }
.material-photos img { width: 52px; height: 42px; object-fit: cover; border: 1px solid #d4d1cc; border-radius: 4px; background: #eee; }
.material-photos a:hover img { border-color: var(--red); }
.material-entry { max-width: none; }
.notice-box,
.planning-summary {
  padding: 12px 14px;
  border: 1px solid #d9d7d3;
  border-left: 4px solid var(--blue);
  border-radius: 5px;
  color: #56605b;
  background: #f4f7fb;
  font-size: 11px;
  line-height: 1.55;
}
.permission-list { display: grid; gap: 10px; margin-top: 20px; }
.permission-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid #dfddd9;
  border-radius: 5px;
  background: #faf9f7;
  cursor: pointer;
}
.permission-option:hover { border-color: #c8c5c0; background: #fff; }
.permission-option input { width: 19px; height: 19px; min-height: 0; flex: none; margin: 1px 0 0; accent-color: var(--red); }
.permission-option span { display: grid; gap: 3px; }
.permission-option strong { color: #383d39; font-size: 12px; }
.permission-option small { color: #7f8580; font-size: 10px; line-height: 1.45; }
.employee-picker,
.calendar-picker { min-width: 0; margin: 0; padding: 0; border: 0; }
.employee-picker legend,
.calendar-picker legend { margin-bottom: 7px; padding: 0; color: #454a47; font-size: 11px; font-weight: 750; }
.multi-picker { position: relative; }
.multi-picker summary {
  display: flex;
  min-height: 43px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border: 1px solid #d2d1ce;
  border-radius: 4px;
  color: #303330;
  background: #fff;
  cursor: pointer;
  list-style: none;
}
.multi-picker summary::-webkit-details-marker { display: none; }
.multi-picker summary::after { content: "⌄"; color: var(--red); font-size: 17px; }
.multi-picker[open] summary { border-color: var(--red); border-radius: 4px 4px 0 0; box-shadow: 0 0 0 3px rgba(213,11,0,.1); }
.multi-picker.has-selection summary strong { color: var(--green); }
.multi-picker summary strong { color: #858985; font-size: 11px; }
.employee-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.multi-picker .employee-options {
  position: absolute;
  z-index: 12;
  top: 100%;
  right: 0;
  left: 0;
  max-height: 280px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid #d2d1ce;
  border-top: 0;
  border-radius: 0 0 5px 5px;
  background: #fff;
  box-shadow: 0 14px 28px rgba(31,33,31,.16);
}
.employee-options label {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid #dfddd9;
  border-radius: 5px;
  background: #faf9f7;
  cursor: pointer;
}
.employee-options label:hover { border-color: #c8c5c0; background: #fff; }
.employee-options input,
.payment-check input { width: 18px; height: 18px; min-height: 0; flex: none; margin: 0; padding: 0; accent-color: var(--red); }
.employee-options span { overflow: hidden; color: #383d39; font-size: 12px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.planning-calendar { overflow: hidden; border: 1px solid #d6d5d1; border-radius: 7px; background: #fff; }
.calendar-toolbar { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 9px; padding: 11px; border-bottom: 1px solid #e4e2de; background: #faf9f7; }
.calendar-toolbar > strong { color: var(--charcoal); font-size: 13px; text-align: center; }
.calendar-toolbar-actions { display: flex; align-items: center; gap: 7px; }
.calendar-nav,
.calendar-today { min-height: 34px; padding: 6px 10px; border: 1px solid #d2d1ce; border-radius: 4px; color: var(--charcoal); background: #fff; font-size: 11px; font-weight: 800; }
.calendar-nav { width: 38px; padding: 0; color: var(--red-dark); font-size: 17px; }
.calendar-nav:hover,
.calendar-today:hover { border-color: #aaa9a5; background: #f4f3f1; }
.calendar-weekdays,
.calendar-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 4px; }
.calendar-weekdays { padding: 11px 12px 4px; }
.calendar-weekdays span { color: #858985; font-size: 9px; font-weight: 850; text-align: center; text-transform: uppercase; }
.calendar-grid { padding: 4px 12px 12px; }
.calendar-day,
.calendar-day-empty { min-height: 40px; border-radius: 5px; }
.calendar-day { border: 1px solid transparent; color: #3d423f; background: #f7f6f4; font-size: 11px; font-weight: 750; }
.calendar-day:hover { border-color: #d0ceca; background: #fff; }
.calendar-day.is-today { border-color: var(--blue); color: #2f568d; }
.calendar-day.is-selected { border-color: var(--red); color: #fff; background: var(--red); box-shadow: 0 4px 10px rgba(177,0,3,.18); }
.calendar-selection { display: grid; gap: 8px; padding: 12px; border-top: 1px solid #e4e2de; background: #faf9f7; }
.calendar-selection-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.calendar-selection-head strong { color: #484d49; font-size: 10px; }
.calendar-selection-head span { color: var(--green); font-size: 10px; font-weight: 800; }
.calendar-selected-list { display: flex; gap: 6px; flex-wrap: wrap; }
.calendar-date-chip { display: inline-flex; min-height: 30px; align-items: center; gap: 7px; padding: 5px 8px; border: 1px solid #d8d5d1; border-radius: 999px; color: #4b504c; background: #fff; font-size: 10px; }
.calendar-date-chip:hover { border-color: #e0aaa6; color: var(--red-dark); background: #fff5f4; }
.calendar-date-chip b { color: var(--red); font-size: 14px; line-height: 1; }
.calendar-selection-empty { color: #999d99; font-size: 10px; }
.calendar-status { margin: 0; padding: 0 12px 12px; }
.calendar-status.error { color: var(--red-dark); font-weight: 750; }
.payment-form { flex-direction: column; align-items: flex-start; gap: 4px; }
.payment-check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; color: #4a4f4b; font-size: 11px; font-weight: 800; white-space: nowrap; }
.payment-check:has(input:checked) { color: var(--green); }
.mail-status { max-width: 880px; margin: 0 0 18px; padding: 12px 14px; border: 1px solid #d9d7d3; border-left: 4px solid var(--blue); border-radius: 5px; background: #f4f7fb; line-height: 1.6; }
.week-nav { display: flex; align-items: center; gap: 10px; }
.week-nav strong { min-width: 155px; color: #4c514e; font-size: 11px; text-align: center; }
.planning-grid table { min-width: 1180px; table-layout: fixed; }
.planning-grid thead th:first-child { width: 160px; }
.planning-grid thead th:not(:first-child) { width: 145px; text-align: center; }
.planning-grid thead th span { display: block; color: #3f4440; font-size: 11px; }
.planning-grid tbody th { position: sticky; left: 0; z-index: 2; width: 160px; padding: 13px; border-top: 1px solid #eceae7; color: #343735; background: #fbfaf8; font-size: 11px; vertical-align: top; }
.planning-day { height: 112px; padding: 7px; vertical-align: top; background: #fff; }
.planning-slot { display: grid; gap: 3px; margin-bottom: 6px; padding: 8px; border: 1px solid #dce3ec; border-left: 3px solid var(--blue); border-radius: 4px; background: #f5f8fc; }
.planning-slot-draggable { cursor: grab; }
.planning-slot-draggable:active { cursor: grabbing; }
.planning-slot.is-dragging { opacity: .38; }
.planning-day.is-drop-target { outline: 2px dashed var(--red); outline-offset: -4px; background: #fff5f5; }
.planning-slot:last-child { margin-bottom: 0; }
.planning-slot-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.planning-slot strong { color: #2f568d; font-size: 11px; }
.planning-slot span { overflow: hidden; color: #4e5550; font-size: 10px; font-weight: 700; text-overflow: ellipsis; }
.planning-slot small { color: #777d78; font-size: 9px; line-height: 1.35; }
.planning-slot .planning-lock { margin-top: 3px; color: #9b5d1b; font-weight: 750; }
.planning-slot-action { margin-top: 4px; }
.planning-slot-action .btn { width: 100%; min-height: 28px; padding: 5px 7px; font-size: 9px; }
.planning-remove { width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; color: #a91b18; background: #fde9e7; font-weight: 900; line-height: 1; }
.planning-remove:hover { color: #fff; background: var(--red); }
.planning-empty { display: block; padding-top: 28px; color: #c0c2bf; text-align: center; }
.planning-inline-status { margin: 10px 12px 0; padding: 9px 12px; border: 1px solid #b9ddc7; border-radius: 5px; color: #23673f; background: #effaf3; font-size: 11px; font-weight: 750; }
.planning-inline-status:empty { display: none; }
.planning-mail-list { display: grid; }
.planning-mail-row { display: grid; grid-template-columns: minmax(220px,1fr) minmax(150px,auto) auto; align-items: center; gap: 18px; padding: 13px 16px; border-top: 1px solid #eceae7; }
.planning-mail-row:first-child { border-top: 0; }
.planning-mail-person { display: grid; gap: 2px; min-width: 0; }
.planning-mail-person strong { color: #353a36; font-size: 12px; }
.planning-mail-person small { overflow: hidden; color: #747a75; font-size: 10px; text-overflow: ellipsis; }
.planning-mail-person span { color: #929692; font-size: 9px; font-weight: 750; }
.planning-mail-state { display: grid; justify-items: start; gap: 4px; }
.planning-mail-state small { color: #858985; font-size: 9px; }
.planning-mail-action { min-width: 105px; text-align: right; }
.planning-mail-unavailable { color: #929692; font-size: 10px; font-weight: 750; }
.planning-mobile { display: none; }
.owner-settings { max-width: 980px; }
.offline-mail-test { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px; }
.offline-mail-test > div:first-child { max-width: 650px; }
.offline-mail-test strong { color: var(--charcoal); font-size: 13px; }
.offline-mail-test p { margin: 5px 0 0; color: #6f746f; font-size: 11px; line-height: 1.65; }
.offline-mail-test .toolbar-actions { flex: none; }
.mail-preview-panel { max-width: 820px; }
.mail-preview-frame { display: block; width: 100%; min-height: 560px; border: 0; background: #f3f2ef; }
.time-pair > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stock-option { padding: 12px 14px; border: 1px solid #dfddd9; border-radius: 5px; background: #f7f6f4; }
.stock-option label { display: flex; align-items: flex-start; gap: 11px; cursor: pointer; }
.stock-option input { width: 18px; height: 18px; min-height: 0; flex: none; margin: 2px 0 0; accent-color: var(--red); }
.stock-option input:disabled { cursor: not-allowed; opacity: .45; }
.stock-option span { display: grid; gap: 2px; color: #4a4f4b; font-size: 11px; }
.stock-option small { color: #858985; font-size: 10px; font-weight: 400; }
.field { display: flex; flex-direction: column; gap: 6px; color: #454a47; font-size: 11px; font-weight: 750; }
.field > span { letter-spacing: .1px; }
.field b { color: var(--red); }
input, select, textarea {
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  border: 1px solid #d2d1ce;
  border-radius: 4px;
  outline: 0;
  color: #303330;
  background: #fff;
  transition: border .15s ease, box-shadow .15s ease, background .15s ease;
}
input::placeholder, textarea::placeholder { color: #a3a6a2; }
input:hover, select:hover, textarea:hover { border-color: #b6b5b1; }
input:focus, select:focus, textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(213,11,0,.1);
  background: #fffdfd;
}
textarea { resize: vertical; }
.field-help { color: #858985; font-size: 10px; font-weight: 400; }
.form-footer { display: flex; gap: 10px; margin-top: 23px; padding-top: 20px; border-top: 1px solid #e9e7e4; }
.search { display: flex; align-items: center; gap: 8px; }
.search input { min-width: 210px; max-width: 340px; }
.hint { color: #737874; font-size: 12px; }
.hint strong { color: #3d413e; }
.inline-form { display: inline-flex; }
.details-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 19px; padding: 23px; }
.detail-item .key { color: #848884; font-size: 9px; font-weight: 850; letter-spacing: .85px; text-transform: uppercase; }
.detail-item .value { margin-top: 5px; color: #343735; font-size: 14px; font-weight: 750; }
.description-block { padding: 9px 23px 24px; color: #4c514e; line-height: 1.75; white-space: pre-wrap; }
.detail-title { padding: 16px 23px 0; color: #383b39; font-weight: 800; }
.notice { color: #777c78; font-size: 11px; }
.workorder-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.workorder-print-header { display: none; }
.sign-line { display: flex; gap: 30px; margin: 42px 23px 20px; }
.sign-line > div { flex: 1; padding-top: 13px; border-top: 1px solid #b9bab7; color: #666b67; font-size: 10px; }
.error-code { color: var(--red); font-size: 58px; font-weight: 900; letter-spacing: -2px; }
.mobile-top { display: none; }

.scan-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20,21,20,.78);
  backdrop-filter: blur(3px);
}
.scan-dialog { width: min(520px,100%); overflow: hidden; border-radius: 8px; background: #fff; box-shadow: 0 24px 70px rgba(0,0,0,.35); }
.scan-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; color: #fff; background: var(--charcoal-dark); }
.scan-dialog-head button { width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.3); border-radius: 4px; color: #fff; background: transparent; font-size: 23px; line-height: 1; }
.scan-video-wrap { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #101110; }
.scan-video-wrap video { width: 100%; height: 100%; object-fit: cover; }
.scan-video-wrap span { position: absolute; inset: 23% 9%; border: 2px solid var(--red); border-radius: 5px; box-shadow: 0 0 0 999px rgba(0,0,0,.2); }
.scan-video-wrap span::after { content: ""; position: absolute; top: 50%; right: 6%; left: 6%; height: 2px; background: var(--red); box-shadow: 0 0 8px rgba(213,11,0,.8); }
.scan-dialog p { margin: 0; padding: 13px 18px 16px; color: #737874; font-size: 11px; }

.auth-main {
  display: flex;
  width: 100%;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 10% 18%, rgba(213,11,0,.27), transparent 29%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.018) 0 1px, transparent 1px 28px),
    #272928;
}
.auth-page { width: 100%; max-width: 1020px; padding: 34px; }
.login-shell {
  display: grid;
  grid-template-columns: minmax(0,1.08fr) minmax(360px,.92fr);
  overflow: hidden;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-strong);
}
.login-intro {
  position: relative;
  display: flex;
  min-height: 575px;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: 55px 58px;
  border-right: 1px solid #e2e0dc;
  background:
    linear-gradient(120deg, rgba(255,255,255,.94), rgba(249,248,245,.88)),
    #f4f2ef;
}
.login-intro::before,
.login-intro::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.login-intro::before {
  right: -110px;
  bottom: -120px;
  width: 300px;
  height: 300px;
  border: 36px solid rgba(213,11,0,.055);
}
.login-intro::after {
  right: -65px;
  bottom: -74px;
  width: 165px;
  height: 165px;
  border: 28px solid rgba(71,120,189,.06);
}
.login-brand { position: relative; z-index: 1; width: 325px; margin-bottom: 45px; }
.login-kicker { color: var(--red); font-size: 9px; font-weight: 900; letter-spacing: 2px; }
.login-intro h1 {
  max-width: 420px;
  margin: 8px 0 12px;
  color: var(--charcoal);
  font-size: 38px;
  font-weight: 850;
  letter-spacing: -1.1px;
  line-height: 1.08;
}
.login-intro > p { max-width: 420px; margin: 0; color: #727672; font-size: 14px; }
.login-features { display: grid; gap: 9px; margin-top: 33px; }
.login-features span { display: flex; align-items: center; gap: 11px; color: #565a57; font-size: 12px; font-weight: 700; }
.login-features b {
  display: grid;
  width: 28px;
  height: 24px;
  place-items: center;
  border-radius: 3px;
  color: #fff;
  background: var(--charcoal);
  font-size: 9px;
  letter-spacing: .5px;
}
.login-since { position: absolute; bottom: 27px; left: 58px; color: #9a9d99; font-size: 9px; font-weight: 850; letter-spacing: 1.6px; }
.login-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 54px 48px;
  background: #fff;
}
.login-logo {
  display: grid;
  width: 45px;
  height: 45px;
  margin-bottom: 23px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--red);
  box-shadow: -8px 0 0 var(--blue), 8px 0 0 var(--charcoal);
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 900;
}
.login-card-head > span { color: var(--red); font-size: 9px; font-weight: 900; letter-spacing: 1.7px; }
.login-card h2 { margin: 6px 0 4px; color: var(--charcoal); font-size: 28px; font-weight: 850; letter-spacing: -.6px; }
.login-card-head p { margin: 0 0 27px; color: #818581; }
.login-card .field { margin-bottom: 17px; }
.login-card .btn { width: 100%; margin-top: 6px; padding: 12px; }
.login-card .alert { font-size: 11px; }
.login-footer { padding: 17px 0 0; color: #a8aaa7; font-size: 10px; font-weight: 650; letter-spacing: .4px; text-align: center; }

@media (max-width: 1200px) {
  .sidebar { width: 246px; }
  .page { padding: 34px 25px 65px; }
  .stats { gap: 11px; }
  .dashboard-week { grid-template-columns: repeat(4,minmax(145px,1fr)); }
  .stat { padding: 17px 16px; }
  .stat-value { font-size: 29px; }
  td, th { padding-right: 13px; padding-left: 13px; }
}

@media (max-width: 940px) {
  .two-col { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2,1fr); }
  .dashboard-week { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .login-intro { padding: 44px 38px; }
  .login-since { left: 38px; }
  .login-card { padding: 46px 36px; }
}

@media (max-width: 720px) {
  .has-sidebar { display: block; }
  .sidebar {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    width: min(286px, 88vw);
    height: calc(100vh - 64px);
    min-height: 0;
    box-shadow: 18px 20px 45px rgba(0,0,0,.28);
  }
  .menu-open .sidebar { display: flex; }
  .brand { padding-top: 15px; padding-bottom: 17px; }
  .brand-logo { min-height: 64px; }
  .brand-context { display: none; }
  .nav-caption { padding-top: 18px; }
  .mobile-top {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    height: 64px;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    color: #fff;
    background: var(--charcoal-dark);
    border-bottom: 3px solid var(--red);
  }
  .mobile-brand { display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 850; letter-spacing: .8px; }
  .mobile-brand small { display: block; color: #aeb1ad; font-size: 8px; font-weight: 650; letter-spacing: .2px; text-transform: none; }
  .mobile-brand-mark {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--red);
    font-family: Georgia, serif;
    font-size: 18px;
  }
  .menu-toggle {
    min-width: 42px;
    min-height: 39px;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 4px;
    color: #fff;
    background: transparent;
    font-size: 20px;
  }
  .page { padding: 24px 15px 48px; }
  .page-header { align-items: flex-start; margin-bottom: 22px; padding-bottom: 16px; }
  .page-header h1 { font-size: 26px; }
  .header-date { display: none; }
  .dashboard-toolbar { align-items: flex-start; }
  .stats { gap: 10px; }
  .stat { min-height: 122px; padding: 14px; }
  .stat-value { font-size: 27px; }
  .stat-icon { top: 12px; right: 12px; width: 29px; height: 29px; }
  .fields { grid-template-columns: 1fr; }
  .fields .wide { grid-column: auto; }
  .material-batch { grid-column: auto; }
  .material-batch-head { align-items: flex-start; flex-direction: column; gap: 5px; }
  .material-item { padding: 13px; }
  .material-item-grid { grid-template-columns: 1fr; }
  .material-item-grid .wide { grid-column: auto; }
  .material-add { width: 100%; }
  .employee-options { grid-template-columns: 1fr; }
  .calendar-toolbar { grid-template-columns: 36px 1fr 36px; padding: 9px; }
  .calendar-toolbar-actions { display: contents; }
  .calendar-today { display: none; }
  .calendar-nav { width: 36px; }
  .calendar-weekdays { padding: 9px 8px 3px; }
  .calendar-grid { gap: 3px; padding: 3px 8px 9px; }
  .calendar-day, .calendar-day-empty { min-height: 36px; }
  .calendar-selection { padding: 10px; }
  .calendar-selection-head { align-items: flex-start; flex-direction: column; gap: 2px; }
  .form-inner { padding: 16px; }
  .panel-heading { padding: 14px 15px; }
  .panel-heading { align-items: flex-start; }
  .panel-heading-actions { align-items: flex-end; flex-direction: column; gap: 5px; }
  .feed-item, .feed-list-compact .feed-item { padding: 15px; }
  .feed-item.important, .feed-list-compact .feed-item.important { padding-left: 12px; }
  .feed-item-header { flex-direction: column; gap: 5px; }
  .feed-meta { white-space: normal; }
  .details-grid { grid-template-columns: repeat(2,1fr); padding: 17px; }
  .search { width: 100%; }
  .search input { min-width: 0; flex: 1; }
  .toolbar-actions { width: 100%; }
  .offline-mail-test { align-items: flex-start; flex-direction: column; gap: 15px; padding: 16px; }
  .offline-mail-test .toolbar-actions { width: 100%; }
  .offline-mail-test .btn { flex: 1; }
  .mail-preview-frame { min-height: 680px; }
  .week-nav { width: 100%; justify-content: space-between; }
  .planning-mail-row { grid-template-columns: 1fr auto; gap: 10px; padding: 13px; }
  .planning-mail-state { grid-column: 1; }
  .planning-mail-action { grid-column: 2; grid-row: 1 / span 2; min-width: 0; }
  .planning-mail-action .btn { min-height: 38px; }
  .planning-grid { display: none; }
  .planning-mobile { display: grid; gap: 11px; padding: 12px; }
  .planning-mobile-day { overflow: hidden; border: 1px solid #e1dfdc; border-radius: 6px; background: #fff; }
  .planning-mobile-day > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px; color: #fff; background: var(--charcoal); }
  .planning-mobile-day > header div { display: flex; align-items: baseline; gap: 8px; }
  .planning-mobile-day > header strong { font-size: 12px; }
  .planning-mobile-day > header span { color: #d4d6d3; font-size: 9px; font-weight: 700; }
  .planning-mobile-items { display: grid; gap: 9px; padding: 10px; }
  .planning-mobile-item { display: grid; gap: 8px; padding: 12px; border-left: 4px solid var(--blue); border-radius: 4px; background: #f5f8fc; }
  .planning-mobile-person { color: var(--red-dark); font-size: 10px; font-weight: 850; }
  .planning-mobile-item > div { display: grid; gap: 1px; }
  .planning-mobile-item > div strong { color: #2f568d; font-size: 12px; }
  .planning-mobile-item > div span { color: #4e5550; font-size: 11px; font-weight: 700; }
  .planning-mobile-item dl { display: grid; gap: 5px; margin: 0; }
  .planning-mobile-item dl div { display: grid; grid-template-columns: 75px 1fr; gap: 8px; }
  .planning-mobile-item dt { color: #858985; font-size: 9px; font-weight: 850; text-transform: uppercase; }
  .planning-mobile-item dd { margin: 0; color: #5d645f; font-size: 10px; }
  .planning-mobile-item footer { display: flex; gap: 7px; flex-wrap: wrap; padding-top: 3px; }
  .planning-mobile-item footer .btn { min-height: 36px; flex: 1; }
  .planning-mobile-move { width: 100%; }
  .planning-mobile-move > summary { display: flex; align-items: center; justify-content: center; list-style: none; cursor: pointer; }
  .planning-mobile-move > summary::-webkit-details-marker { display: none; }
  .planning-mobile-move[open] > summary { margin-bottom: 8px; }
  .planning-mobile-move form { display: grid; gap: 8px; padding: 10px; border: 1px solid #d9d7d3; border-radius: 5px; background: #fff; }
  .planning-mobile-move label { display: grid; gap: 4px; color: #6d726e; font-size: 9px; font-weight: 800; text-transform: uppercase; }
  .planning-mobile-move select { min-height: 38px; font-size: 11px; text-transform: none; }
  .planning-mobile-empty { padding: 16px; color: #929692; font-size: 10px; text-align: center; }
  .dashboard-week { grid-template-columns: 1fr; padding: 11px; }
  .dashboard-day { min-height: 0; }
  .dashboard-day.is-empty { display: none; }
  .scan-box-head { align-items: flex-start; flex-direction: column; gap: 3px; }
  .barcode-row { flex-wrap: wrap; }
  .barcode-row input { flex-basis: 100%; }
  .barcode-row .btn { flex: 1; }
  .photo-upload { grid-template-columns: 1fr; }
  .photo-upload-actions { width: 100%; }
  .photo-upload-actions .btn { flex: 1; }
  .photo-preview, .photo-status { grid-column: auto; }
  .photo-preview { max-width: none; }
  .auth-page { padding: 17px; }
  .login-shell { grid-template-columns: 1fr; }
  .login-intro { min-height: 0; padding: 28px 27px 34px; border-right: 0; border-bottom: 1px solid #e2e0dc; }
  .login-brand { width: 235px; margin-bottom: 24px; }
  .login-intro h1 { max-width: 360px; font-size: 29px; }
  .login-features, .login-since { display: none; }
  .login-card { padding: 33px 27px; }
}

@media (max-width: 470px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat-label { max-width: 95px; }
  .toolbar-actions .btn { flex: 1; }
  .week-nav { flex-wrap: wrap; }
  .week-nav strong { width: 100%; order: -1; }
  .week-nav .btn { flex: 1; }
  .planning-mail-row { grid-template-columns: 1fr; }
  .planning-mail-action { grid-column: 1; grid-row: auto; width: 100%; }
  .planning-mail-action form, .planning-mail-action .btn { width: 100%; }
  .form-footer { flex-direction: column; }
  .form-footer .btn { width: 100%; }
  .details-grid { grid-template-columns: 1fr; }
  .search { align-items: stretch; flex-direction: column; }
  .search input { max-width: none; }
  .sign-line { flex-direction: column; }
}

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

@media print {
  @page { size: A4; margin: 12mm; }
  body, html { color: #000; background: #fff !important; }
  .sidebar, .mobile-top, .page-header, .toolbar, .workorder-actions, .btn, .alert, .nav, .notice, .sidebar-bottom, .no-print { display: none !important; }
  .main, .page { max-width: none !important; margin: 0 !important; padding: 0 !important; background: #fff !important; }
  .workorder-print-header {
    display: grid;
    grid-template-columns: minmax(220px,1.35fr) minmax(170px,.9fr) auto;
    align-items: end;
    gap: 20px;
    margin: 0 0 18px;
    padding: 0 0 15px;
    border-bottom: 3px solid #d50b00;
    break-inside: avoid;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .workorder-print-logo { display: block; width: 245px; max-width: 100%; height: auto; }
  .workorder-print-company { display: grid; gap: 1px; margin: 0; color: #343735; font-size: 9px; font-style: normal; line-height: 1.45; }
  .workorder-print-company strong { margin-bottom: 2px; font-size: 10px; }
  .workorder-print-company small { margin-top: 2px; color: #5f625f; font-size: 8px; }
  .workorder-print-meta { display: grid; justify-items: end; align-self: stretch; align-content: end; min-width: 92px; text-align: right; }
  .workorder-print-meta span { color: #777; font-size: 8px; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase; }
  .workorder-print-meta strong { margin: 2px 0; color: #d50b00; font-size: 19px; }
  .workorder-print-meta small { color: #555; font-size: 9px; }
  .panel { break-inside: avoid; border: 1px solid #aaa; box-shadow: none; }
  .panel-heading { border-color: #bbb; background: #fff; }
  .panel-heading h2, td, th, a { color: #000 !important; }
}
