:root {
  --ink: #1d252c;
  --muted: #66717b;
  --line: #d9e0e5;
  --paper: #f6f7f8;
  --panel: #ffffff;
  --accent: #0c6b58;
  --accent-strong: #075344;
  --blue: #2563eb;
  --blue-strong: #1d4ed8;
  --warning: #a75c00;
  --danger: #b42318;
  --ok: #157347;
  --nav: #24313a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #f5f6f8;
  font-family: Arial, Helvetica, sans-serif;
}

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

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.checkbox-label input {
  width: auto;
  min-height: auto;
}

.details-panel {
  display: grid;
  gap: 10px;
}

.details-panel div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.details-panel strong {
  color: var(--muted);
}

button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

button:hover {
  border-color: var(--accent);
}

.small-button {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 13px;
}

.danger-button {
  border-color: #fecaca;
  background: #fff1f0;
  color: var(--danger);
}

.danger-button:hover {
  border-color: var(--danger);
}

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

.table-thumb,
.thumb-placeholder {
  width: 54px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
  background: #eef2f7;
}

.thumb-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.filters-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.primary,
button[type="submit"] {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.primary:hover,
button[type="submit"]:hover {
  background: var(--blue-strong);
}

.ghost {
  background: transparent;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(246, 247, 248, 0.86), rgba(246, 247, 248, 0.86)),
    url("https://www.magnicom.ro/themes/magnicom/img/services/index.jpg") center/cover;
}

.login-panel {
  width: min(460px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(29, 37, 44, 0.14);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 32px;
}

h2 {
  font-size: 26px;
}

h3 {
  font-size: 18px;
}

.stack {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
}

textarea {
  resize: vertical;
}

.error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
}

.hint-grid {
  display: grid;
  gap: 6px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
}

.app {
  min-height: 100vh;
}

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

.mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 2px solid var(--blue);
  border-radius: 10px;
  background: #fff;
  color: var(--blue);
  font-weight: 800;
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.1;
}

.brand small {
  display: block;
  color: var(--muted);
}

.app-header,
.module-nav {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.header-inner,
.nav-inner,
.workspace {
  width: min(1280px, calc(100vw - 32px));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  gap: 16px;
}

.nav-inner {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-color: #8b8b8b #eef0f3;
}

.nav-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 13px 14px;
  color: var(--muted);
  background: transparent;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 700;
}

.nav-button::before {
  content: attr(data-icon);
  color: currentColor;
  font-weight: 800;
}

.nav-button.active,
.nav-button:hover {
  border-bottom-color: var(--blue);
  color: var(--blue);
}

.topbar {
  padding: 26px 0 6px;
}

.view-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-pill {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
}

.view {
  display: none;
  padding: 22px 0;
}

.view.active {
  display: block;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.kpi {
  min-height: 156px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(29, 37, 44, 0.12);
}

.kpi span {
  color: var(--muted);
  font-size: 13px;
}

.kpi strong {
  display: block;
  margin-top: 12px;
  font-size: 30px;
}

.kpi small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.kpi.blue {
  border-color: #bfdbfe;
}

.kpi.orange {
  border-color: #fed7aa;
}

.kpi.red {
  border-color: #fecaca;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 18px;
}

.split > section,
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(29, 37, 44, 0.10);
}

.split .section-head {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

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

.page-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: -52px 0 34px;
}

.dark-button {
  border-color: #4b5563;
  background: #4b5563;
  color: #fff;
}

.dark-button:hover {
  border-color: #374151;
  background: #374151;
}

.period-tabs {
  display: flex;
  gap: 8px;
}

.period-tabs button {
  border: 0;
  background: #e5e7eb;
  color: #4b5563;
}

.period-tabs button.active {
  background: var(--blue);
  color: #fff;
}

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

.inline-filter {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.item {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

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

.detail-shell {
  display: grid;
  gap: 16px;
}

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

.machine-profile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 16px;
}

.machine-hero,
.qr-card,
.detail-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(29, 37, 44, 0.10);
}

.machine-hero {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 18px;
}

.machine-hero img,
.hero-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  object-fit: cover;
  background: #eef2f7;
}

.hero-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
}

.machine-hero h3 {
  margin-top: 10px;
  font-size: 28px;
}

.qr-card {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 10px;
  padding: 18px;
  text-align: center;
}

.qr-card img {
  width: 180px;
  height: 180px;
}

.qr-card a {
  max-width: 100%;
  color: var(--blue-strong);
  font-size: 12px;
  overflow-wrap: anywhere;
}

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

.detail-card {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
}

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

.mini-kpis .kpi {
  min-height: auto;
  padding: 14px;
  box-shadow: none;
}

.mini-kpis .kpi strong {
  font-size: 22px;
}

.compact-list {
  display: grid;
  gap: 8px;
}

.compact-list article {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.compact-list small {
  color: var(--muted);
}

.machine-mini {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.machine-mini img,
.machine-mini .thumb-placeholder {
  width: 74px;
  height: 56px;
}

.machine-mini strong,
.machine-mini small {
  display: block;
}

.status {
  display: inline-flex;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--blue-strong);
  font-size: 12px;
  font-weight: 700;
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(320px, 1fr));
  gap: 14px;
}

.segmented-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 22px;
}

.segmented-tabs button {
  min-width: 82px;
  border-color: #d1d5db;
  background: #fff;
  color: #4b5563;
  font-weight: 700;
}

.segmented-tabs button.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.calendar-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(29, 37, 44, 0.04);
}

.calendar-toolbar,
.calendar-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(92px, 1fr));
  gap: 6px;
}

.calendar-weekdays span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}

.calendar-day {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 96px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  background: #fff;
}

.calendar-day.empty {
  background: #f2f4f6;
  cursor: default;
}

.calendar-day.has-items {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.calendar-day.has-open {
  border-color: #fed7aa;
  background: #fff7ed;
}

.calendar-day.selected {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.calendar-day strong {
  color: var(--blue-strong);
  font-size: 13px;
}

.calendar-grid.period-day {
  grid-template-columns: minmax(220px, 420px);
}

.calendar-grid.period-year {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.calendar-month {
  display: grid;
  gap: 8px;
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  background: #fff;
}

.calendar-month.has-items {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.calendar-month.selected {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.calendar-month strong {
  text-transform: capitalize;
}

.day-number {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.calendar-details {
  display: grid;
  gap: 10px;
  min-height: 48px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.calendar-detail-list {
  display: grid;
  gap: 8px;
}

.calendar-detail-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.person-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 180px;
  padding: 24px 22px;
  border: 1px solid var(--line);
  border-left: 4px solid #22c55e;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(29, 37, 44, 0.10);
}

.person-card.external {
  border-left-color: #f59e0b;
}

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

.person-card strong {
  font-size: 16px;
}

.person-card small {
  color: var(--muted);
}

.person-card-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

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

.icon-button {
  display: inline-grid;
  width: 34px;
  min-height: 34px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  font-size: 14px;
}

.icon-button.view {
  background: #dbeafe;
  color: #2563eb;
}

.icon-button.edit {
  background: #ffedd5;
  color: #f97316;
}

.icon-button.active-toggle {
  background: #dcfce7;
  color: #16a34a;
}

.icon-button.delete {
  background: #fee2e2;
  color: #dc2626;
}

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

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

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

.asset-list {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.asset-list a {
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  border: 1px solid #dbeafe;
  border-radius: 6px;
  color: var(--blue-strong);
  background: #eff6ff;
  text-decoration: none;
  max-width: 100%;
}

.asset-list span {
  display: block;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-list a:hover {
  border-color: var(--blue);
  background: #dbeafe;
}

.asset-list small,
td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.table-wrap.flat {
  border: 0;
  border-radius: 0;
}

.table-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.table-pager div {
  display: flex;
  gap: 8px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
  table-layout: auto;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
  overflow-wrap: anywhere;
}

th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  color: #33414a;
  font-size: 12px;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

td select.compact {
  min-width: 130px;
}

#machinesTable th:nth-child(1),
#machinesTable td:nth-child(1) {
  min-width: 72px;
  width: 72px;
}

#machinesTable th:nth-child(2),
#machinesTable td:nth-child(2) {
  min-width: 72px;
  width: 72px;
}

#machinesTable th:nth-child(3),
#machinesTable td:nth-child(3) {
  min-width: 130px;
  width: 130px;
}

#machinesTable th:nth-child(4),
#machinesTable td:nth-child(4) {
  min-width: 90px;
  width: 90px;
}

#machinesTable th:nth-child(5),
#machinesTable td:nth-child(5),
#machinesTable th:nth-child(6),
#machinesTable td:nth-child(6),
#machinesTable th:nth-child(7),
#machinesTable td:nth-child(7) {
  min-width: 120px;
}

#machinesTable th:nth-child(8),
#machinesTable td:nth-child(8) {
  min-width: 125px;
  width: 125px;
}

#machinesTable th:nth-child(9),
#machinesTable td:nth-child(9) {
  min-width: 130px;
}

#machinesTable th:nth-child(10),
#machinesTable td:nth-child(10) {
  min-width: 210px;
  width: 210px;
}

#machinesTable th:nth-child(11),
#machinesTable td:nth-child(11) {
  min-width: 96px;
  width: 96px;
}

.machines-wrap {
  overflow-x: hidden;
}

#machinesTable {
  table-layout: fixed;
  width: 100%;
}

#machinesTable th,
#machinesTable td {
  min-width: 0 !important;
  width: auto !important;
  padding: 9px 8px;
  font-size: 12px;
  line-height: 1.25;
}

#machinesTable th:nth-child(1),
#machinesTable td:nth-child(1) {
  width: 8% !important;
}

#machinesTable th:nth-child(2),
#machinesTable td:nth-child(2) {
  width: 8% !important;
}

#machinesTable th:nth-child(3),
#machinesTable td:nth-child(3) {
  width: 24% !important;
}

#machinesTable th:nth-child(4),
#machinesTable td:nth-child(4) {
  width: 18% !important;
}

#machinesTable th:nth-child(5),
#machinesTable td:nth-child(5) {
  width: 13% !important;
}

#machinesTable th:nth-child(6),
#machinesTable td:nth-child(6) {
  width: 17% !important;
}

#machinesTable th:nth-child(7),
#machinesTable td:nth-child(7) {
  width: 12% !important;
}

#machinesTable .asset-list a,
#machinesTable .asset-list span,
#machinesTable .row-actions,
#machinesTable .small-button,
#machinesTable select.compact {
  max-width: 100%;
  min-width: 0;
}

#machinesTable .asset-list span {
  white-space: normal;
}

#machinesTable select.compact {
  width: 100%;
}

#machinesTable .row-actions {
  display: grid;
}

#partsTable th:nth-child(2),
#partsTable td:nth-child(2) {
  width: 72px;
}

#interventionsTable th,
#interventionsTable td,
#partsTable th,
#partsTable td,
#timeReportTable th,
#timeReportTable td {
  font-size: 13px;
}

#interventionsTable th {
  white-space: nowrap;
  overflow-wrap: normal;
}

dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 28px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

#machineDialog {
  width: min(1230px, calc(100vw - 28px));
  max-width: calc(100vw - 28px);
}

#reportDialog {
  width: min(980px, calc(100vw - 28px));
  max-width: calc(100vw - 28px);
}

dialog::backdrop {
  background: rgba(29, 37, 44, 0.42);
}

.dialog-form {
  display: grid;
  gap: 13px;
  padding: 20px;
  max-width: 100%;
  overflow-x: hidden;
}

.dialog-form.wide {
  width: min(720px, 100%);
}

.report-modal {
  display: grid;
  gap: 0;
  background: #eef2f7;
}

.report-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.report-page {
  width: min(794px, calc(100vw - 56px));
  min-height: 1123px;
  margin: 18px auto;
  padding: 38px;
  background: #fff;
  color: #111827;
  box-shadow: 0 12px 35px rgba(29, 37, 44, 0.18);
}

.report-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 2px solid #111827;
}

.report-head p,
.report-head h1,
.report-head span {
  margin: 0;
}

.report-head p {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.report-head h1 {
  margin-top: 4px;
  font-size: 24px;
}

.report-head span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.report-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.report-kpis article {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.report-kpis span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.report-kpis strong {
  display: block;
  margin-top: 3px;
  font-size: 18px;
}

.report-section {
  margin-top: 18px;
}

.report-section h2 {
  margin: 0 0 10px;
  font-size: 15px;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5px;
}

.report-table th,
.report-table td {
  padding: 6px;
  border: 1px solid #d1d5db;
  text-align: left;
  vertical-align: top;
}

.report-table th {
  background: #f3f4f6;
  font-weight: 800;
}

.machine-form {
  display: grid;
  gap: 18px;
  padding: 22px;
  max-width: 100%;
  overflow-x: hidden;
}

.form-grid.two-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 18px 16px;
}

.docs-section {
  display: grid;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.docs-section h4 {
  margin: 0;
  color: #1f2937;
  font-size: 18px;
}

.docs-list {
  display: grid;
  gap: 8px;
}

.doc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 6px;
  background: #f8fafc;
}

.doc-row div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.doc-row a {
  color: var(--blue);
  font-size: 12px;
  text-decoration: none;
}

.icon-danger {
  min-height: 28px;
  border: 0;
  color: #dc2626;
  background: transparent;
  font-size: 12px;
}

.empty-docs {
  padding: 12px;
  border-radius: 6px;
  color: var(--muted);
  background: #f8fafc;
  font-size: 13px;
}

.docs-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 48px;
  align-items: end;
  gap: 12px;
}

.add-doc-button {
  min-height: 38px;
  border: 0;
  background: #d1d5db;
  color: #fff;
  font-size: 24px;
  font-weight: 700;
}

menu {
  display: flex;
  justify-content: end;
  gap: 8px;
  margin: 6px 0 0;
  padding: 0;
}

@media (max-width: 920px) {
  .kpi-grid,
  .split,
  .machine-profile,
  .detail-grid,
  .people-grid,
  .filters-panel {
    grid-template-columns: 1fr;
  }

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

  .calendar-weekdays,
  .calendar-grid {
    grid-template-columns: repeat(7, minmax(72px, 1fr));
    overflow-x: auto;
  }

  .calendar-panel {
    overflow-x: auto;
  }

  .form-grid.two-cols {
    grid-template-columns: 1fr;
  }

  .header-inner {
    align-items: start;
    flex-direction: column;
    padding: 14px 0;
  }

  .page-actions {
    justify-content: flex-start;
    margin: 12px 0 18px;
  }
}

@media (max-width: 560px) {
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
    justify-content: space-between;
  }

  .calendar-toolbar,
  .calendar-detail-head,
  .calendar-detail-item,
  .machine-mini {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .form-grid.two-cols,
  .docs-add-row {
    grid-template-columns: 1fr;
  }
}

@media print {
  @page {
    size: A4;
    margin: 12mm;
  }

  body {
    background: #fff;
  }

  body.report-printing > *:not(#reportDialog) {
    display: none !important;
  }

  body.report-printing #reportDialog {
    position: static;
    display: block !important;
    width: auto;
    max-width: none;
    max-height: none;
    border: 0;
    padding: 0;
    overflow: visible;
  }

  body.report-printing #reportDialog::backdrop,
  body.report-printing .report-toolbar {
    display: none !important;
  }

  body.report-printing .report-modal {
    display: block;
    background: #fff;
  }

  body.report-printing .report-page {
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    box-shadow: none;
  }

  .app-header,
  .module-nav,
  .top-actions,
  .page-actions,
  .action-maintenance,
  .row-actions,
  .small-button,
  .danger-button,
  .icon-button,
  body:not(.report-printing) dialog {
    display: none !important;
  }

  .workspace {
    width: 100%;
    margin: 0;
  }

  .view {
    display: none !important;
  }

  .view.active {
    display: block !important;
  }

  .kpi,
  .split > section,
  .table-wrap,
  .calendar-panel {
    box-shadow: none;
    break-inside: avoid;
  }

  .table-wrap {
    overflow: visible;
  }

  table {
    table-layout: auto;
    font-size: 11px;
  }
}
