:root {
  color-scheme: light;
  font-size: clamp(14px, 0.25vw + 12px, 16px);
  --bg: #f4f4f5;
  --surface: #ffffff;
  --surface-soft: #f1f1f2;
  --ink: #171717;
  --muted: #74767a;
  --line: #dedee2;
  --accent: #b5121b;
  --accent-dark: #7d0b12;
  --black: #0b0b0d;
  --steel: #777a7f;
  --good: #1f8b4c;
  --warning: #b7791f;
  --danger: #b5121b;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  overflow-x: hidden;
}

[hidden] {
  display: none !important;
}

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

button {
  cursor: pointer;
}

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

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(11, 11, 13, 0.94), rgba(181, 18, 27, 0.72)),
    var(--bg);
}

.login-panel {
  width: min(430px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-brand {
  margin-bottom: 6px;
}

.login-help {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfd;
}

.login-help small {
  color: var(--muted);
}

.sidebar {
  background: var(--black);
  color: #eef7fb;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-height: 100vh;
  position: sticky;
  top: 0;
  overflow: auto;
}

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

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #ffffff;
  color: var(--accent);
  border: 2px solid var(--accent);
  box-shadow: inset 0 0 0 4px #ffffff, 0 0 0 1px #777a7f;
  font-weight: 800;
}

.brand-muted {
  color: var(--steel);
}

.brand-red {
  color: var(--accent);
}

.brand strong,
.login-card strong {
  display: block;
}

.brand small,
.login-card small {
  display: block;
  margin-top: 4px;
  color: #a9bac8;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  border: 0;
  border-radius: 8px;
  padding: 13px 14px;
  color: #dbe8ef;
  background: transparent;
  text-align: left;
}

.nav-item.active,
.nav-item:hover {
  background: var(--accent);
  color: #ffffff;
}

.login-card {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-left: 4px solid var(--accent);
  display: grid;
  gap: 14px;
}

.login-card span {
  color: #a9bac8;
  font-size: 0.85rem;
}

.login-card select {
  width: 100%;
  margin: 8px 0 2px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: #0f2b3e;
  color: #ffffff;
  min-height: 40px;
  padding: 8px 10px;
}

.password-button {
  width: 100%;
  margin-top: 12px;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(196, 18, 29, 0.18);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

.password-button:hover {
  background: rgba(196, 18, 29, 0.32);
}

.logout-button {
  width: 100%;
  margin-top: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.16);
}

.sidebar-logout {
  margin-top: 0;
}

.main {
  min-width: 0;
  padding: clamp(18px, 1.8vw, 36px);
  overflow: auto;
}

.pdf-export-sheet {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 1200px;
  padding: 28px;
  background: #ffffff;
  color: #111111;
  z-index: -1;
}

.pdf-export-header {
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--accent);
}

.pdf-export-header strong {
  color: var(--accent);
  letter-spacing: 0.12em;
}

.pdf-export-header h1 {
  margin: 8px 0 6px;
}

.pdf-export-body .view {
  display: block;
  opacity: 1;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: clamp(12px, 1.4vw, 24px);
  align-items: flex-start;
  margin-bottom: clamp(18px, 1.6vw, 30px);
  flex-wrap: wrap;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: clamp(1.65rem, 1.2vw + 1.15rem, 2.4rem);
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(0.98rem, 0.4vw + 0.88rem, 1.12rem);
  letter-spacing: 0;
}

p {
  color: var(--muted);
}

.topbar-actions,
.dialog-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.notification-wrap {
  position: relative;
}

.notification-button {
  position: relative;
  min-width: 44px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}

.bell-icon {
  display: inline-grid;
  place-items: center;
  font-size: 1.15rem;
  line-height: 1;
}

.notification-button strong {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 21px;
  min-height: 21px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
}

.notification-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  width: min(380px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(16, 35, 50, 0.22);
  overflow: hidden;
}

.notification-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.notification-list {
  max-height: 380px;
  overflow: auto;
}

.notification-item {
  width: 100%;
  border: 0;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.notification-item:hover {
  background: var(--surface-soft);
}

.notification-item.unread {
  background: #fff7ed;
  border-left: 4px solid var(--accent);
}

.notification-item strong,
.notification-item p,
.notification-item small {
  display: block;
}

.notification-item p {
  margin: 5px 0;
  color: var(--ink);
}

.notification-item small {
  color: var(--muted);
}

.empty-state.small {
  padding: 18px;
}

.primary-button,
.secondary-button,
.text-button,
.icon-button,
.row-action {
  border-radius: 8px;
  min-height: 40px;
  border: 1px solid transparent;
}

.primary-button {
  background: var(--accent);
  color: white;
  padding: 0 16px;
}

.primary-button:hover {
  background: var(--accent-dark);
}

.secondary-button {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
  padding: 0 16px;
}

.text-button {
  background: transparent;
  color: var(--accent);
  padding: 0 4px;
}

.icon-button {
  width: 40px;
  background: var(--surface-soft);
  color: var(--ink);
  border: 0;
  font-size: 1.5rem;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.metric,
.panel,
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.role-hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 18px;
  padding: 22px;
  border-radius: 8px;
  background: linear-gradient(135deg, #111111, #2a0609);
  color: #ffffff;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}

.role-hero span {
  display: block;
  color: #ffb9be;
  font-weight: 700;
  margin-bottom: 8px;
}

.role-hero h2 {
  margin-bottom: 8px;
  font-size: 1.45rem;
}

.role-hero p {
  margin-bottom: 0;
  color: #d7d7d9;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.metric {
  padding: 18px;
}

.metric span {
  display: block;
  color: var(--muted);
  margin-bottom: 10px;
}

.metric strong {
  font-size: 2rem;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}

.panel {
  padding: 18px;
}

.panel-header,
.list-toolbar,
.dialog-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.compact-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.compact-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.compact-item small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.84rem;
  background: #eef7f3;
  color: var(--good);
  white-space: nowrap;
}

.status.inativo {
  background: #fff7ed;
  color: var(--warning);
}

.status.prospecto {
  background: #edf4ff;
  color: #22549c;
}

.status.pendente {
  background: #fff7ed;
  color: var(--warning);
}

.status.aprovado,
.status.admin,
.status.rh,
.status.funcionario,
.status.entregue,
.status.concluido {
  background: #eef7f3;
  color: var(--good);
}

.status.falta {
  background: #fff0f0;
  color: #b91c1c;
}

.status.em-producao,
.status.em-analise {
  background: #edf4ff;
  color: #22549c;
}

.status.aguardando-cliente {
  background: #fff7ed;
  color: var(--warning);
}

.status.rejeitado {
  background: #fff1f0;
  color: var(--danger);
}

.policy-strip {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid #d9e9ee;
  border-radius: 8px;
  background: #f0f8fa;
  color: var(--accent-dark);
  flex-wrap: wrap;
}

.policy-strip .policy-body {
  display: block;
  flex: 1 1 100%;
  color: var(--ink);
  line-height: 1.45;
}

.policy-strip p {
  margin: 0 0 8px;
}

.policy-strip p:last-child {
  margin-bottom: 0;
}

.policy-strip ol {
  margin: 0 0 8px 22px;
  padding: 0;
}

.policy-strip li {
  margin-bottom: 4px;
}

.vacation-map-panel {
  padding: 0;
  overflow: hidden;
  margin-bottom: 16px;
}

.vacation-map-dialog {
  width: min(1440px, calc(100vw - 24px));
  max-height: 94vh;
  overflow: auto;
  border: 0;
  padding: 0;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(16, 35, 50, 0.28);
}

.vacation-map-dialog-shell {
  width: max-content;
  min-width: 100%;
  padding: 12px;
  background: #ffffff;
}

.vacation-map-dialog-actions {
  min-width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.vacation-map-dialog-actions strong,
.vacation-map-dialog-actions small {
  display: block;
}

.vacation-map-dialog-actions small {
  color: var(--muted);
}

.vacation-map-card {
  display: grid;
  gap: 0;
  padding: 0;
  background: #ffffff;
}

.vacation-map-header {
  display: flex;
  justify-content: space-between;
  gap: 0;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.vacation-map-header span {
  display: block;
  color: var(--accent);
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.vacation-map-header h2 {
  margin-bottom: 6px;
  font-size: 1.35rem;
}

.vacation-map-header p {
  margin-bottom: 0;
}

.vacation-map-meta {
  width: 100%;
  min-width: 0;
  padding: 6px 0 10px;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
}

.vacation-map-meta strong,
.vacation-map-meta small {
  display: block;
}

.vacation-map-meta small {
  color: var(--muted);
  margin-top: 5px;
  line-height: 1.4;
}

.vacation-excel-legend {
  display: flex;
  align-items: stretch;
  min-width: max-content;
  margin-bottom: 10px;
  border: 0;
  background: #ffffff;
  color: #111111;
  font-family: Calibri, Arial, sans-serif;
  font-size: 12px;
  overflow-x: auto;
}

.vacation-excel-legend-title,
.vacation-excel-legend-code,
.vacation-excel-legend-label {
  min-height: 18px;
  border-right: 1px solid #d9d9d9;
  border-bottom: 1px solid #d9d9d9;
  display: grid;
  align-items: center;
}

.vacation-excel-legend-title {
  width: 76px;
}

.vacation-excel-legend-code {
  width: 28px;
}

.vacation-excel-legend-label {
  width: 148px;
}

.vacation-excel-legend-title {
  align-items: center;
  font-size: 13px;
  font-weight: 700;
}

.vacation-excel-legend-code {
  justify-content: center;
  font-weight: 700;
  text-align: center;
}

.vacation-excel-legend-label {
  justify-content: center;
  text-align: center;
  padding: 0 6px;
}

.vacation-excel-legend-code.national-holiday {
  background: #b8cce4;
}

.vacation-map-edit-hint {
  color: #b5121b;
  font-weight: 700;
}

.vacation-excel-legend-code.municipal-holiday {
  background: #c2d69b;
}

.vacation-excel-legend-code.weekend {
  background: #66ff00;
}

.vacation-excel-legend-code.vacation,
.vacation-map-cell.code-f {
  background: #00b0f0;
  border-color: #0070c0;
}

.vacation-excel-legend-code.blocked-day {
  background: #ff0000;
}

.vacation-excel-legend-code.carnival {
  background: #ccc0d9;
}

.vacation-excel-legend-code.previous-year {
  background: #e36d09;
}

.vacation-excel-legend-code.half-day {
  background: #92cddc;
}

.vacation-map-cell.code-bh,
.vacation-map-cell.code-bg {
  background: rgba(37, 99, 235, 0.16);
  border-color: rgba(37, 99, 235, 0.3);
}

.vacation-map-cell.code-dc {
  background: rgba(22, 163, 74, 0.16);
  border-color: rgba(22, 163, 74, 0.3);
}

.vacation-map-cell.weekend:not(.code-f):not(.code-bh):not(.code-bg):not(.code-dc) {
  background: #66ff00;
  border-color: #2f75b5;
}

.vacation-map-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1.3fr) minmax(220px, 0.8fr) auto;
  width: min(100%, 1080px);
  gap: 12px;
  margin-bottom: 16px;
  align-items: end;
}

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

.vacation-map-summary {
  display: none;
}

.vacation-map-summary article {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.vacation-map-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 6px;
}

.vacation-map-summary strong {
  font-size: 1.25rem;
}

.vacation-map-grid {
  display: grid;
  gap: 10px;
}

.vacation-month-card {
  overflow: hidden;
  border: 1px solid #0070c0;
  border-top: 0;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
}

.vacation-month-card:first-child {
  border-top: 1px solid #0070c0;
}

.vacation-map-scroll {
  overflow: visible;
  -webkit-overflow-scrolling: touch;
}

.vacation-map-table {
  min-width: calc(240px + (var(--vacation-days) * 26px));
}

.vacation-excel-month {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #ffffff;
  color: #000000;
  font-family: Calibri, Arial, sans-serif;
  font-size: 11px;
  line-height: 1;
}

.vacation-excel-month th,
.vacation-excel-month td {
  height: 17px;
  min-height: 17px;
  border: 1px solid #2f75b5;
  padding: 0 3px;
  text-align: center;
  vertical-align: middle;
  font-weight: 700;
  color: #000000;
}

.vacation-excel-month .excel-month-col {
  width: 74px;
}

.vacation-excel-month .excel-person-col {
  width: 194px;
}

.vacation-excel-month .excel-day-col {
  width: 45px;
}

.vacation-excel-month .excel-month-cell {
  background: #dbe5f1;
  font-weight: 400;
  text-transform: uppercase;
}

.vacation-excel-month .excel-workplace-cell {
  border-color: #00b050;
  border-bottom-color: #2f75b5;
  background: #ffffff;
  text-align: left;
  font-weight: 400;
}

.vacation-excel-month .excel-filter-cell {
  position: relative;
  border-color: #00b050;
  border-top-color: #2f75b5;
  background: #f2f2f2;
}

.vacation-excel-month .excel-filter-cell span::after {
  content: "";
  position: absolute;
  right: 5px;
  top: 5px;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid #6aa84f;
}

.vacation-excel-month .excel-weekday,
.vacation-excel-month .excel-day-head,
.vacation-excel-month .excel-day-cell {
  width: 45px;
}

.vacation-excel-month .excel-weekday {
  height: 16px;
  background: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

.vacation-excel-month .excel-day-head {
  background: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

.vacation-excel-month .excel-person-cell {
  color: #c00000;
  background: #ffffff;
  text-align: center;
  font-weight: 400;
}

.vacation-excel-month .excel-day-cell {
  background: #ffffff;
  color: #000000;
  font-size: 12px;
  font-weight: 700;
}

.vacation-excel-month .excel-day-cell.code-f {
  background: #00b0f0;
}

.vacation-excel-month .excel-day-cell.code-bh,
.vacation-excel-month .excel-day-cell.code-bg {
  background: #92cddc;
}

.vacation-excel-month .excel-day-cell.code-dc {
  background: #e36d09;
}

.vacation-excel-month .excel-day-cell.weekend {
  background: #66ff00;
}

.vacation-excel-month .excel-day-cell.national-holiday {
  background: #b8cce4;
}

.vacation-excel-month .excel-day-cell.blocked-day {
  background: #ff0000;
}

.vacation-excel-month .excel-day-cell.carnival {
  background: #ccc0d9;
}

.vacation-excel-month .excel-day-cell.previous-year {
  background: #e36d09;
}

.vacation-excel-month .excel-day-cell.half-day {
  background: #92cddc;
}

.vacation-excel-month .excel-day-cell[data-vacation-map-cell] {
  cursor: pointer;
}

[data-vacation-doc-field],
[data-vacation-legend-index] {
  outline: 1px dashed transparent;
  outline-offset: 2px;
}

[data-vacation-doc-field]:focus,
[data-vacation-legend-index]:focus {
  outline-color: #b5121b;
  background: #fff7ed;
}

.vacation-legend-edit-button {
  width: 34px;
  min-height: 22px;
  border: 1px solid #d9d9d9;
  background: #ffffff;
  color: #b5121b;
  font-size: 18px;
  font-weight: 800;
}

.vacation-legend-editor {
  display: grid;
  gap: 11px;
  min-width: min(720px, 80vw);
}

.vacation-legend-editor-row {
  display: grid;
  grid-template-columns: 74px minmax(220px, 1fr) 58px 34px;
  gap: 8px;
  align-items: center;
}

.vacation-legend-editor-row input {
  width: 100%;
}

.vacation-cell-options {
  display: grid;
  gap: 8px;
  min-width: min(520px, 78vw);
}

.vacation-cell-option {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px;
  background: #ffffff;
  text-align: left;
}

.vacation-cell-option:hover {
  border-color: var(--accent);
}

.vacation-cell-option span {
  min-height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid #d9d9d9;
  font-weight: 800;
}

.field-help-star {
  color: var(--accent);
  font-weight: 800;
  cursor: help;
}

.field-help-text {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

#vacationLegendDialog {
  width: min(860px, calc(100vw - 40px));
  padding: 26px 30px 24px;
  border-radius: 12px;
}

#vacationLegendDialog .dialog-header {
  margin-bottom: 22px;
}

#vacationLegendDialog .dialog-actions {
  gap: 14px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

#vacationLegendDialog .dialog-actions button {
  min-width: 180px;
}

#vacationCellDialog {
  width: min(580px, calc(100vw - 40px));
  padding: 26px 30px 24px;
  border-radius: 12px;
}

.vacation-map-row {
  display: grid;
  grid-template-columns: 240px repeat(var(--vacation-days), minmax(26px, 1fr));
}

.vacation-map-row + .vacation-map-row {
  border-top: 1px solid var(--line);
}

.vacation-map-row-head .vacation-map-day-head {
  background: #151517;
  color: #ffffff;
}

.vacation-map-person {
  position: sticky;
  left: 0;
  z-index: 2;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 8px 0 12px rgba(15, 23, 42, 0.04);
}

.vacation-map-person-head {
  background: #151517;
  color: #ffffff;
  font-weight: 800;
  box-shadow: 8px 0 12px rgba(0, 0, 0, 0.12);
}

.vacation-map-person strong,
.vacation-map-person small {
  display: block;
}

.vacation-map-person small {
  margin-top: 4px;
  color: var(--muted);
}

.vacation-map-person .status {
  margin-top: 8px;
}

.vacation-map-row-head .vacation-map-person-head {
  color: #ffffff;
}

.vacation-map-day-head,
.vacation-map-cell {
  min-height: 38px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 0.78rem;
}

.vacation-map-day-head {
  padding: 6px 2px;
  color: #ffffff;
  background: #2b2d31;
}

.vacation-map-day-head.weekend {
  background: #3b3e44;
}

.vacation-map-day-head span {
  display: block;
  font-weight: 800;
}

.vacation-map-day-head small {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.72);
}

.vacation-map-cell {
  background: #ffffff;
}

.vacation-cell-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 100%;
  min-height: 100%;
  font-size: 0.72rem;
  font-weight: 800;
}

.vacation-map-cell.weekend:not(.approved):not(.pending) {
  background: #66ff00;
}

.vacation-map-empty {
  padding: 16px;
  color: var(--muted);
  font-style: italic;
}

.list-toolbar {
  margin-bottom: 16px;
}

.search-box {
  display: grid;
  gap: 7px;
  width: min(520px, 100%);
  color: var(--muted);
  font-size: 0.9rem;
}

.search-box input,
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  min-height: 42px;
  padding: 10px 12px;
}

.vacation-period-header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.vacation-period-sort {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: auto;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}

.vacation-period-sort[data-sort-mode="request"] {
  color: rgba(255, 255, 255, 0.72);
}

.vacation-period-sort[data-sort-mode="date"] {
  color: #ffffff;
  text-shadow: 0 0 1px rgba(0, 0, 0, 0.35);
}

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

.table-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

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

th,
td {
  padding: 15px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  background: #151517;
  color: #f2f2f3;
  font-weight: 700;
  font-size: 0.85rem;
}

td strong {
  display: block;
  margin-bottom: 4px;
}

td small {
  color: var(--muted);
}

.vacation-extra-control {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.vacation-extra-control select {
  min-height: 30px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

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

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.row-action {
  min-height: 34px;
  padding: 0 10px;
  background: var(--surface-soft);
  color: var(--ink);
  border-color: transparent;
}

.row-action.delete {
  color: var(--danger);
}

.row-action.approve {
  color: var(--good);
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 34px;
}

.muted-cell {
  color: var(--muted);
  font-size: 0.86rem;
}

dialog {
  width: min(860px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 24px 80px rgba(16, 35, 50, 0.28);
}

.schedule-dialog {
  width: min(94vw, 1480px);
  max-height: 94vh;
  overflow: auto;
}

.schedule-shell {
  background: #e9e9e9;
  padding: clamp(10px, 1.4vw, 14px);
}

.schedule-actions {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
}

.schedule-actions strong,
.schedule-actions small {
  display: block;
}

.schedule-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.schedule-page {
  width: min(100%, 1280px);
  min-height: auto;
  margin: 0 auto;
  background: #fff;
  padding: 18px 16px 20px;
  color: #111;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.18);
  font-family: Arial, Helvetica, sans-serif;
}

.schedule-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #222;
  padding: 8px 0 12px;
  margin-bottom: 28px;
}

.schedule-logo {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.2px;
  color: #555;
}

.schedule-logo span {
  color: var(--accent);
}

.schedule-logo strong {
  font-weight: 800;
}

.schedule-subtitle {
  font-size: 10px;
  color: #666;
  margin-top: 2px;
}

.schedule-title {
  text-align: right;
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 24px;
  line-height: 1.05;
}

.schedule-title small {
  display: block;
  font-size: 12px;
  font-weight: 700;
}

.page-no {
  text-align: right;
  margin-top: 14px;
  font-size: 13px;
}

.schedule-top-grid {
  display: grid;
  grid-template-columns: 1.3fr 1.1fr 0.95fr 0.95fr;
  border: 1px solid #222;
  margin-bottom: 28px;
}

.schedule-top-cell {
  min-height: 92px;
  border-right: 1px solid #222;
  padding: 14px 8px 10px;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.schedule-top-cell:last-child {
  border-right: 0;
}

.schedule-top-empty {
  background: #fff;
  justify-content: flex-start;
}

.schedule-top-empty .schedule-progress-row {
  flex: 0 0 auto;
  margin-top: 6px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: 100%;
}

.schedule-cell-label {
  font-size: 18px;
  line-height: 1.1;
}

.schedule-cell-sub {
  font-size: 11px;
  line-height: 1.1;
  font-weight: 400;
}

.schedule-top-cell input {
  margin-top: 6px;
  font-size: 15px;
  font-weight: 700;
}

.schedule-progress-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  width: 100%;
}

.schedule-progress-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.schedule-progress-input {
  width: 54px !important;
  flex: 0 0 54px;
  text-align: left;
  padding: 5px 6px 5px 4px;
}

.schedule-progress-row span {
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.schedule-page label small,
.schedule-chars small {
  display: block;
  font-size: 11px;
  font-weight: 400;
}

.schedule-page input,
.schedule-page textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #777;
  padding: 5px 3px;
  font-size: 15px;
  background: transparent;
  outline: none;
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.schedule-table th,
.schedule-table td {
  border: 1px solid #222;
  padding: 2px 4px;
  font-size: 12px;
  height: 22px;
}

.schedule-table th {
  background: #c9c9c9;
  color: #111;
  font-weight: 800;
  text-align: center;
}

.schedule-table thead tr:first-child th {
  font-size: 15px;
  line-height: 1;
  height: 28px;
}

.schedule-table thead tr:last-child th {
  height: 20px;
  font-size: 12px;
}

.op-pt,
.op-en {
  background: #bdbdbd;
  font-weight: 700;
}

.resp {
  text-align: center;
  font-family: Georgia, serif;
  font-size: 12px;
}

.order-history-block {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.order-history-header {
  margin-bottom: 10px;
}

.order-history-header span {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}

.order-history-header small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.order-history-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.order-history-check {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0 6px;
}

.order-history-item .order-history-check {
  margin-top: 6px;
}

.order-history-check-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--ink);
  user-select: none;
  font-size: 0.92rem;
}

.order-history-check-option input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--accent);
}

.order-history-check-option input:checked + span {
  color: var(--good);
}

.order-history-block textarea {
  min-height: 110px;
}

.order-history-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  max-height: 240px;
  overflow: auto;
  padding-right: 4px;
}

.order-history-item {
  border: 1px solid #dde2eb;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
  padding: 10px 14px 12px;
}

.order-history-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.order-history-top strong {
  justify-self: start;
  font-size: 13px;
  font-weight: 800;
  color: #80858f;
}

.order-history-status {
  justify-self: start;
  min-width: 74px;
  justify-content: center;
  padding: 0 12px;
  min-height: 28px;
  font-size: 0.84rem;
}

.order-history-top span:last-child {
  justify-self: end;
  font-size: 13px;
  color: #7e8692;
}

.order-history-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.order-history-summary {
  font-weight: 800;
  font-size: 16px;
  color: #6f7480;
  line-height: 1.25;
  margin-bottom: 0;
}

.order-history-item ul {
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  margin-top: 10px;
}

.order-history-item li {
  margin: 0;
}

.schedule-table input {
  border: 0;
  border-bottom: 0;
  padding: 0;
}

.resp-input,
.week-head-input {
  width: 100%;
  height: 21px;
  min-height: 21px;
  margin: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
  text-align: center;
  font: inherit;
}

.resp-input {
  font-family: Georgia, serif;
  font-size: 11px;
}

.week-head-input {
  appearance: textfield;
  -moz-appearance: textfield;
  font-size: 11px;
}

.week-head-input::-webkit-inner-spin-button,
.week-head-input::-webkit-outer-spin-button {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
}

.week-cell,
.week-head-cell,
.evol {
  padding: 0 !important;
  text-align: center;
}

.evol input {
  appearance: none;
  width: 100%;
  height: 21px;
  border: 0;
  margin: 0;
  cursor: pointer;
  display: block;
}

.week-split {
  display: grid;
  grid-template-rows: 1fr 1fr;
  width: 100%;
  height: 21px;
}

.week-split label {
  position: relative;
  display: block;
  height: 10.5px;
  cursor: pointer;
}

.week-split label:first-child {
  border-bottom: 1px solid transparent;
}

.week-split input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.week-half {
  display: block;
  width: 100%;
  height: 100%;
  background: transparent;
}

.week-split input:checked + .week-half.planned {
  background: #111;
}

.week-split input:checked + .week-half.done {
  background: #f4c430;
}

.evol input:checked {
  background: #169b62;
}

.schedule-legend {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  align-items: center;
  margin: 8px 0 0;
  font-size: 11px;
  font-weight: 800;
  flex-wrap: wrap;
}

.schedule-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-box {
  width: 18px;
  height: 12px;
  border: 1px solid #222;
  display: inline-block;
}

.legend-box.planned {
  background: #111;
}

.legend-box.done {
  background: #f4c430;
}

.schedule-section-title {
  background: #c9c9c9;
  border: 1px solid #222;
  padding: 2px 14px 3px;
  margin-top: 30px;
  font-weight: 800;
  font-size: 16px;
  line-height: 1.05;
}

.schedule-section-title strong,
.remarks-title strong {
  display: block;
}

.schedule-section-title small,
.remarks-title small {
  display: block;
  font-size: 11px;
  font-weight: 700;
}

.schedule-chars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  border-left: 1px solid #222;
  border-right: 1px solid #222;
}

.schedule-chars div {
  border-bottom: 1px solid #222;
  border-right: 1px solid #222;
  min-height: 50px;
  padding: 7px 8px 6px;
  font-family: Georgia, serif;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.schedule-chars div:nth-child(3n) {
  border-right: 0;
}

.schedule-chars span {
  font-size: 14px;
  line-height: 1.05;
}

.schedule-chars small {
  font-size: 10px;
  line-height: 1.05;
  margin-top: 1px;
  margin-bottom: 3px;
}

.schedule-remarks {
  border: 1px solid #222;
  border-top: 0;
}

.remarks-title {
  font-family: Georgia, serif;
  font-size: 16px;
  font-weight: 800;
  padding: 0 8px 0;
  background: #c9c9c9;
  border-bottom: 1px solid #222;
}

.schedule-page textarea {
  resize: vertical;
  min-height: 116px;
  border-bottom: 0;
  padding: 8px;
  line-height: 1.35;
}

.signatures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-top: 36px;
  border: 1px solid #222;
}

.sig {
  min-height: 112px;
  border-right: 1px solid #222;
  text-align: center;
}

.sig:last-child {
  border-right: 0;
}

.sig-title {
  background: #c9c9c9;
  border-bottom: 1px solid #222;
  font-family: Georgia, serif;
  font-size: 17px;
  padding: 3px;
  font-weight: 700;
}

.line {
  width: 58%;
  border-bottom: 2px solid #bbb;
  margin: 44px auto 8px;
}

.date-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  font-family: Georgia, serif;
  font-size: 12px;
}

.date-row input {
  width: 32px;
  text-align: center;
  border-bottom: 1px solid #777;
  padding: 0;
}

.schedule-footer {
  border-top: 1px solid #222;
  margin-top: 58px;
  padding-top: 12px;
  text-align: right;
  font-weight: 700;
  font-size: 13px;
}

.planning-dialog {
  width: min(94vw, 1520px);
  max-height: 94vh;
  overflow: auto;
}

.planning-shell {
  background: #eef2f6;
  padding: clamp(10px, 1.4vw, 14px);
}

.planning-actions {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
}

.planning-actions strong,
.planning-actions small {
  display: block;
}

.planning-page {
  width: min(100%, 1520px);
  max-width: 100%;
  margin: 0 auto;
  color: #1f2937;
  font-family: Arial, Helvetica, sans-serif;
}

.planning-header {
  background: #111827;
  color: #fff;
  padding: 18px 24px;
  border-radius: 8px 8px 0 0;
}

.planning-header h2 {
  margin: 0;
  font-size: 20px;
}

.planning-header p {
  margin: 4px 0 0;
  color: #cbd5e1;
  font-size: 13px;
}

.planning-card {
  background: #fff;
  border: 1px solid #d7dde5;
  border-radius: 8px;
  padding: clamp(10px, 1.4vw, 14px);
  margin: 14px 0;
  box-shadow: 0 3px 12px rgba(15, 23, 42, 0.06);
}

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

.planning-page label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.planning-page input,
.planning-page select,
.planning-page textarea {
  width: 100%;
  border: 1px solid #d7dde5;
  border-radius: 7px;
  padding: 8px;
  font-size: 13px;
  background: #fff;
  color: #111827;
}

.planning-page textarea {
  min-height: 70px;
  resize: vertical;
  margin-top: 5px;
}

.planning-note {
  color: #64748b;
  font-size: 12px;
  margin: 8px 0 0;
}

.planning-table-box {
  overflow: auto;
  background: #fff;
  border: 1px solid #d7dde5;
  border-radius: 8px;
}

.planning-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1040px;
}

.planning-table th,
.planning-table td {
  border: 1px solid #d7dde5;
  padding: 6px;
  font-size: 12px;
  vertical-align: middle;
}

.planning-table th {
  background: #e5e7eb;
  color: #111827;
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: nowrap;
}

.planning-table td input,
.planning-table td select {
  border: 0;
  border-radius: 0;
  padding: 5px;
  background: transparent;
}

.planning-table td input:focus,
.planning-table td select:focus {
  outline: 2px solid rgba(185, 28, 28, 0.22);
  background: #fff;
}

.planning-id {
  width: 55px;
}

.planning-name {
  min-width: 360px;
}

.planning-duration {
  width: 120px;
}

.planning-date {
  width: 145px;
}

.planning-status {
  width: 220px;
}

.planning-save-button {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.planning-save-button:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.planning-percent-control {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  width: 100%;
  white-space: nowrap;
  justify-content: flex-start;
}

.planning-percent-control input {
  flex: 0 0 68px;
  width: 68px;
  min-width: 56px;
  text-align: right;
  padding: 5px 2px 5px 4px;
  box-sizing: border-box;
  font-variant-numeric: tabular-nums;
}

.planning-percent-control span {
  flex: 0 0 auto;
  color: #111827;
  font-weight: 800;
  user-select: none;
  margin-left: 0;
}

.planning-extra {
  min-width: 160px;
}

.planning-actions-col {
  width: 80px;
}

.planning-summary input,
.planning-summary select,
.planning-project input,
.planning-project select {
  font-weight: 800;
}

.planning-inactive {
  opacity: 0.58;
}

.planning-mini {
  border: 0;
  border-radius: 999px;
  padding: 5px 8px;
  background: #111827;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
}

.planning-mini.red {
  background: #b91c1c;
}

.planning-footer {
  margin: 18px 0 0;
  padding: 12px 0 0;
  border-top: 1px solid #d7dde5;
  text-align: right;
  font-weight: 800;
}

.mold-photos {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid #d7dde5;
  background: #fff;
}

.schedule-page .mold-photos {
  border-color: #222;
}

.mold-photos-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.mold-photos-copy {
  display: grid;
  gap: 2px;
}

.mold-photos h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
}

.mold-photos-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.15;
}

.photo-empty {
  color: var(--muted);
}

.photo-upload-button {
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--accent);
  color: #ffffff !important;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mold-photo-folders {
  display: grid;
  gap: 14px;
}

.mold-photo-folder {
  border: 1px solid #d7dde5;
  background: #fbfcfe;
  padding: 12px;
  border-radius: 8px;
}

.mold-photo-folder-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.mold-photo-folder-title {
  display: grid;
  gap: 6px;
  min-width: min(360px, 100%);
}

.mold-photo-folder-title span {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mold-photo-folder-title strong {
  font-size: 18px;
  color: #101828;
}

.mold-photo-folder-title input {
  width: min(360px, 100%);
  border: 1px solid #d7dde5;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 15px;
  font-weight: 800;
  background: #fff;
}

.mold-photo-folder-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

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

.mold-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 220px));
  justify-content: start;
  gap: 12px;
}

@media (min-width: 1320px) {
  .mold-photo-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 220px));
  }
}

.mold-photo-card {
  position: relative;
  border: 1px solid #d7dde5;
  padding: 8px;
  background: #fff;
  display: grid;
  gap: 8px;
}

.mold-photo-preview {
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
}

.mold-photo-preview:disabled {
  cursor: default;
}

.mold-photo-preview img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  border: 1px solid #d7dde5;
}

.mold-photo-archive {
  width: 100%;
  min-height: 140px;
  display: grid;
  align-items: center;
  justify-items: center;
  gap: 8px;
  border: 1px dashed #d7dde5;
  background: linear-gradient(180deg, #f8fafc, #eef2f7);
  color: #263238;
  padding: 12px;
  text-align: center;
}

.mold-photo-archive strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.mold-photo-archive span {
  font-size: 12px;
  font-weight: 700;
  word-break: break-word;
}

.mold-photo-card label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.mold-photo-card input,
.mold-photo-card textarea {
  width: 100%;
  border: 1px solid #d7dde5;
  border-radius: 6px;
  padding: 7px;
  background: #fff;
}

.mold-photo-card input {
  min-height: 38px;
}

.mold-photo-card textarea {
  min-height: 58px;
  resize: vertical;
}

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

.mold-photo-card .planning-mini {
  min-width: 40px;
}

dialog::backdrop {
  background: rgba(16, 35, 50, 0.42);
}

#recordForm {
  padding: 22px;
}

.dialog-header {
  margin-bottom: 18px;
}

.profile-layout {
  display: grid;
  gap: 18px;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px;
  border-radius: 8px;
  background: linear-gradient(120deg, #101010, #2b0609);
  color: #ffffff;
  flex-wrap: wrap;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: #ffffff;
  color: var(--accent);
  font-size: 2rem;
  font-weight: 900;
}

.profile-card span,
.profile-card p {
  color: #dbe8ef;
}

.profile-card h2 {
  margin: 4px 0;
}

.profile-card-actions {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.profile-card-actions .secondary-button {
  white-space: nowrap;
}

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

.profile-info-item {
  display: grid;
  gap: 6px;
  min-height: 84px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.profile-info-item span {
  color: var(--muted);
  font-size: 0.85rem;
}

.profile-info-item strong {
  overflow-wrap: anywhere;
}

.dialog-header p {
  margin-bottom: 0;
}

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

.field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
}

.field.full {
  grid-column: 1 / -1;
}

.field-hint {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.vacation-day-hint {
  grid-column: 1 / -1;
  min-height: 0;
  padding: 10px 12px;
  border: 1px solid #e2edf2;
  border-radius: 8px;
  background: #f8fbfc;
}

.vacation-day-hint.warning {
  border-color: #ffd6a8;
  background: #fff7ed;
  color: #9a4f00;
  font-weight: 700;
}

.field input[readonly] {
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 800;
}

.record-attachments {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafbfc;
}

.record-attachments-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.record-attachments-header span {
  display: block;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 800;
}

.record-attachments-header small {
  color: var(--muted);
}

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

.record-attachment-card {
  position: relative;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}

.record-attachment-thumb {
  width: 100%;
  min-height: 110px;
  border: 1px solid var(--line);
  border-radius: 10px;
  object-fit: cover;
  display: grid;
  place-items: center;
  background: #f5f7fa;
  color: var(--accent-dark);
  font-weight: 900;
}

.record-attachment-file {
  padding: 14px;
  text-align: center;
}

.record-attachment-meta {
  display: grid;
  gap: 4px;
  padding-right: 28px;
}

.record-attachment-meta strong {
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.2;
  word-break: break-word;
}

.record-attachment-meta small {
  color: var(--muted);
  font-size: 0.78rem;
  word-break: break-word;
}

.record-attachment-card .planning-mini {
  position: absolute;
  top: 10px;
  right: 10px;
}

.form-alert {
  min-height: 22px;
  margin: 14px 0 0;
  color: var(--danger);
  font-weight: 700;
}

.dialog-actions {
  justify-content: flex-end;
  margin-top: 22px;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    top: auto;
    z-index: 3;
    padding: 16px;
    min-height: auto;
  }

  .nav {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .metrics,
  .content-grid,
  .quick-actions,
  .profile-info-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .schedule-dialog,
  .planning-dialog {
    width: min(calc(100vw - 16px), 100%);
  }

  .schedule-page,
  .planning-page {
    width: 100%;
  }
}

@media (min-width: 1281px) {
  .metrics,
  .content-grid,
  .quick-actions,
  .profile-info-grid,
  .form-grid,
  .planning-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .topbar {
    align-items: center;
  }
}

@media (max-width: 1280px) and (min-width: 701px) {
  .main {
    padding: 20px;
  }

  .topbar {
    align-items: center;
  }

  .topbar-actions {
    margin-left: auto;
    justify-content: flex-end;
  }

  .metrics,
  .content-grid,
  .quick-actions,
  .profile-info-grid,
  .form-grid,
  .planning-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .schedule-dialog,
  .planning-dialog {
    width: min(96vw, 1360px);
  }

  .schedule-page {
    width: min(100%, 1180px);
  }

  .planning-page {
    width: min(100%, 1400px);
  }
}

@media (max-width: 700px) {
  .main {
    padding: 20px 14px;
  }

  .topbar,
  .list-toolbar,
  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .dialog-actions {
    width: 100%;
  }

  .topbar-actions > *,
  .dialog-actions > *,
  .list-toolbar > button {
    flex: 1;
  }

  .topbar-actions {
    width: 100%;
  }

  .metrics,
  .content-grid,
  .quick-actions,
  .profile-info-grid,
  .form-grid,
  .planning-grid {
    grid-template-columns: 1fr;
  }

  .role-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-card-actions {
    margin-left: 0;
    width: 100%;
    flex-direction: column;
  }

  .profile-card .secondary-button {
    width: 100%;
  }

  .table-wrap {
    overflow-x: auto;
  }

  table {
    min-width: 860px;
  }

  .policy-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .schedule-page,
  .planning-page {
    width: 100%;
    padding: 16px;
  }

  .schedule-header,
  .schedule-actions,
  .planning-actions {
    gap: 10px;
  }

  .schedule-top-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .schedule-top-cell {
    min-height: 64px;
    font-size: 14px;
  }

  .schedule-legend {
    justify-content: flex-start;
  }

  .signatures {
    grid-template-columns: 1fr;
  }

  .sig {
    border-right: 0;
    border-bottom: 1px solid #222;
  }

  .sig:last-child {
    border-bottom: 0;
  }

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

  .schedule-progress-input {
    width: 42px !important;
    flex-basis: 42px;
  }

  .record-attachments-header {
    align-items: flex-start;
  }

  .order-history-top,
  .order-history-body {
    align-items: flex-start;
    grid-template-columns: 1fr;
    flex-direction: column;
    gap: 8px;
  }

  .order-history-top span:last-child,
  .order-history-status {
    justify-self: start;
  }
}

@media print {
  @page schedulePage {
    size: A4 portrait;
    margin: 8mm;
  }

  @page planningPage {
    size: A4 landscape;
    margin: 6mm;
  }

  @page vacationMapPage {
    size: A4 landscape;
    margin: 6mm;
  }

  html,
  body {
    width: 100%;
    min-width: 0;
    background: #fff;
    overflow: visible;
  }

  *,
  *::before,
  *::after {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body * {
    visibility: hidden;
  }

  body.printing-schedule #scheduleDialog,
  body.printing-schedule #scheduleDialog *,
  body.printing-planning #planningDialog,
  body.printing-planning #planningDialog * {
    visibility: visible;
  }

  body.printing-schedule #planningDialog,
  body.printing-planning #scheduleDialog {
    display: none !important;
  }

  body.printing-vacation-map #vacationMapDialog,
  body.printing-vacation-map #vacationMapDialog * {
    visibility: visible;
  }

  body.printing-vacation-map #vacationMapDialog {
    position: absolute;
    inset: 0;
    width: 100%;
    max-width: none;
    max-height: none;
    overflow: visible;
    box-shadow: none;
    border-radius: 0;
  }

  body.printing-vacation-map #vacationMapDialog {
    page: vacationMapPage;
  }

  body.printing-vacation-map .vacation-map-dialog-actions,
  body.printing-vacation-map .vacation-map-toolbar {
    display: none !important;
  }

  body.printing-vacation-map .vacation-map-dialog-shell,
  body.printing-vacation-map .vacation-map-card {
    padding: 0;
    background: #ffffff;
  }

  body.printing-vacation-map .vacation-map-dialog-shell {
    width: 100%;
  }

  body.printing-vacation-map .vacation-map-scroll {
    overflow: visible;
  }

  body.printing-vacation-map .vacation-map-meta {
    padding-top: 0;
  }

  body.printing-vacation-map .vacation-month-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.printing-schedule #scheduleDialog,
  body.printing-planning #planningDialog {
    position: absolute;
    inset: 0;
    width: 100%;
    max-width: none;
    max-height: none;
    overflow: visible;
    box-shadow: none;
    border-radius: 0;
  }

  .schedule-actions,
  .planning-actions {
    display: none;
  }

  .schedule-shell,
  .planning-shell {
    padding: 0;
    background: #fff;
  }

  .schedule-page,
  .planning-page {
    box-shadow: none;
    margin: 0;
    width: 100%;
    max-width: none;
    min-height: auto;
    padding: 0;
  }

  .schedule-page {
    page: schedulePage;
  }

  .planning-page {
    page: planningPage;
  }

  .schedule-header {
    margin-bottom: 9mm;
    padding-bottom: 5mm;
  }

  .schedule-top-grid {
    margin-bottom: 8mm;
  }

  .schedule-table {
    table-layout: fixed;
    width: 100%;
  }

  .schedule-table th,
  .schedule-table td {
    font-size: 8.5px;
    height: 18px;
    padding: 1.5px;
    border-color: #111 !important;
  }

  .schedule-table th {
    background: #c9c9c9 !important;
    color: #111 !important;
  }

  .op-pt,
  .op-en {
    background: #bdbdbd !important;
    color: #111 !important;
  }

  .schedule-page input,
  .schedule-page textarea {
    font-size: 9px;
    padding: 1px 2px;
  }

  .order-history-inputs {
    grid-template-columns: 1fr;
  }

  .order-history-check {
    gap: 8px;
  }

  .order-history-block textarea {
    min-height: 90px;
  }

  .schedule-table input {
    border: 0 !important;
    border-bottom: 0 !important;
    padding: 0 !important;
  }

  .resp-input,
  .week-head-input {
    height: 16px;
    min-height: 16px;
    font-size: 7px !important;
    text-align: center;
  }

  .evol input {
    appearance: none !important;
    -webkit-appearance: none !important;
    forced-color-adjust: none !important;
    height: 15px;
    background: #fff !important;
    border: 0 !important;
    box-shadow: none !important;
    opacity: 1 !important;
  }

  .week-split,
  .week-split {
    height: 16px;
  }

  .week-split label {
    height: 8px;
  }

  .week-split label:first-child {
    border-bottom-color: transparent !important;
  }

  .week-half {
    forced-color-adjust: none !important;
  }

  .week-split input:checked + .week-half.planned {
    background: #111 !important;
    box-shadow: inset 0 0 0 999px #111 !important;
    outline: 1px solid #111 !important;
  }

  .week-split input:checked + .week-half.done {
    background: #f4c430 !important;
    box-shadow: inset 0 0 0 999px #f4c430 !important;
    outline: 1px solid #f4c430 !important;
  }

  .evol input:checked {
    background: #169b62 !important;
    box-shadow: inset 0 0 0 999px #169b62 !important;
    outline: 1px solid #169b62 !important;
  }

  .evol input:checked::before {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    background: #169b62 !important;
  }

  .schedule-section-title {
    margin-top: 8mm;
    background: #c9c9c9 !important;
    color: #111 !important;
  }

  .schedule-legend {
    margin-top: 3mm;
    font-size: 9px;
    break-inside: avoid;
  }

  .legend-box.planned {
    background: #111 !important;
    box-shadow: inset 0 0 0 999px #111 !important;
  }

  .legend-box.done {
    background: #f4c430 !important;
    box-shadow: inset 0 0 0 999px #f4c430 !important;
  }

  .schedule-chars div {
    min-height: 34px;
    padding: 4px;
    font-size: 10px;
  }

  .schedule-page textarea {
    min-height: 45px;
  }

  .signatures {
    margin-top: 10mm;
  }

  .sig {
    min-height: 72px;
  }

  .sig-title {
    background: #c9c9c9 !important;
    color: #111 !important;
  }

  .line {
    margin: 24px auto 6px;
  }

  .schedule-footer {
    margin-top: 8mm;
  }

  .photo-upload-button {
    display: none !important;
  }

  .mold-photo-folder-toolbar,
  .mold-photo-card-actions {
    display: none !important;
  }

  .mold-photos {
    margin-top: 6mm;
    padding: 4mm;
    break-inside: avoid;
    border-color: #222 !important;
    background: #fff !important;
  }

  .mold-photos-header {
    margin-bottom: 3mm;
  }

  .mold-photos h3 {
    font-size: 12px;
  }

  .mold-photos-copy p {
    font-size: 8px;
    line-height: 1.1;
  }

  .mold-photo-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 4mm;
  }

  .mold-photo-card {
    break-inside: avoid;
    padding: 2mm;
    border-color: #222 !important;
  }

  .mold-photo-card img {
    max-height: 55mm;
    object-fit: contain;
    border-color: #222 !important;
  }

  .mold-photo-card label,
  .mold-photo-card textarea {
    font-size: 8px;
  }

  .planning-header {
    background: #111827 !important;
    color: #fff !important;
    border-radius: 0;
    padding: 8px 12px;
  }

  .planning-header h2 {
    font-size: 14px;
  }

  .planning-header p,
  .planning-note {
    font-size: 9px;
  }

  .planning-card {
    background: #fff !important;
    box-shadow: none;
    border-radius: 0;
    padding: 6px;
    margin: 6px 0;
    break-inside: avoid;
  }

  .planning-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
  }

  .planning-page label {
    font-size: 9px;
  }

  .planning-table-box {
    background: #fff !important;
    border-radius: 0;
    overflow: visible;
  }

  .planning-table {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
    page-break-inside: auto;
  }

  .planning-table th,
  .planning-table td,
  .planning-page input,
  .planning-page select {
    font-size: 6.7px;
    line-height: 1.15;
  }

  .planning-table th,
  .planning-table td {
    padding: 1.5px;
  }

  .planning-table th {
    background: #e5e7eb !important;
    color: #111827 !important;
    position: static;
    white-space: normal;
  }

  .planning-summary input,
  .planning-summary select,
  .planning-project input,
  .planning-project select {
    font-weight: 800 !important;
  }

  .planning-inactive {
    opacity: 0.72;
  }

  .planning-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .planning-table td input,
  .planning-table td select {
    padding: 1px;
  }

  .planning-id {
    width: 28px;
  }

  .planning-name {
    width: 32%;
    min-width: 0;
  }

  .planning-duration {
    width: 52px;
  }

  .planning-date {
    width: 62px;
  }

  .planning-status {
    width: 84px;
  }

  .planning-extra {
    min-width: 0;
    width: 70px;
  }

  .planning-actions-col,
  .planning-mini,
  body.printing-planning .planning-table th:last-child,
  body.printing-planning .planning-table td:last-child {
    display: none !important;
  }

  .planning-page textarea {
    min-height: 34px;
    font-size: 8px;
    padding: 3px;
  }

  .planning-footer {
    margin-top: 6px;
    padding-top: 5px;
    font-size: 10px;
  }
}
