:root {
  --bg: #0d1424;
  --bg-elevated: #0f172a;
  --bg-card: #0b1120;
  --border-subtle: #1f2937;
  --border-strong: rgba(148, 163, 184, 0.35);
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.15);
  --accent-strong: #0ea5e9;
  --accent-stronger: #38bdf8;
  --accent-warm: #fbbf24;
  --accent-warm-soft: rgba(251, 191, 36, 0.18);
  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.15);
  --danger: #f97373;
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --text-dim: #94a3b8;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 140ms;
  --dur-med: 220ms;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-soft: 0 20px 40px rgba(15, 23, 42, 0.7);
  --shadow-subtle: 0 10px 25px rgba(15, 23, 42, 0.6);
  --glass: rgba(15, 23, 42, 0.8);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Open Sans", "Noto Sans", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: radial-gradient(circle at 10% 10%, rgba(251, 191, 36, 0.12), transparent 30%),
    radial-gradient(circle at 85% 5%, rgba(56, 189, 248, 0.18), transparent 32%),
    linear-gradient(135deg, #0b1220 0%, #0f172a 45%, #0a1021 100%);
  color: var(--text);
  line-height: 1.6;
}

img,
video,
canvas {
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 0 0 1rem;
}

/* Layout */

body {
  display: flex;
  flex-direction: column;
}

body.no-scroll {
  overflow: hidden;
}

.skip-link {
  position: fixed;
  left: 0.9rem;
  top: -3rem;
  z-index: 220;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.55);
  background: rgba(2, 6, 23, 0.95);
  color: #e0f2fe;
  text-decoration: none;
  font-weight: 700;
  transition: top var(--dur-fast) var(--ease-out);
}

.skip-link:focus {
  top: 0.7rem;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.5rem;
  background: rgba(11, 17, 32, 0.88);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.35);
  transition:
    padding var(--dur-med) var(--ease-out),
    background var(--dur-med) var(--ease-out),
    box-shadow var(--dur-med) var(--ease-out),
    border-color var(--dur-med) var(--ease-out);
}

.app-header-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.app-header.is-compact {
  padding: 0.45rem 1.25rem;
  background: rgba(2, 6, 23, 0.85);
  border-color: rgba(148, 163, 184, 0.25);
  box-shadow: 0 16px 30px rgba(2, 6, 23, 0.45);
}

.app-header.is-compact .app-title {
  font-size: 1.05rem;
}

.app-header.is-compact .search-input-field {
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}

.app-title {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-strong);
  text-decoration: none;
}

.app-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  column-gap: 0.5rem;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.sync-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.55);
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.sync-chip.is-idle {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.12);
  color: #bbf7d0;
}

.sync-chip.is-syncing {
  border-color: rgba(56, 189, 248, 0.6);
  background: rgba(56, 189, 248, 0.12);
  color: #e0f2fe;
}

.sync-chip.is-offline {
  border-color: rgba(251, 191, 36, 0.55);
  background: rgba(251, 191, 36, 0.14);
  color: #fde68a;
}

.sync-chip.is-error {
  border-color: rgba(248, 113, 113, 0.65);
  background: rgba(248, 113, 113, 0.14);
  color: #fecaca;
}

.header-actions-toggle,
.mobile-nav-toggle {
  min-height: 2.2rem;
  min-width: 2.7rem;
}

.nav-back-btn {
  margin-left: 0.2rem;
}

.user-info {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-right: 0.75rem;
}

.global-search {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  position: relative;
  width: clamp(280px, 32vw, 420px);
}

.search-input-field {
  width: 100%;
  padding: 0.55rem 2.6rem 0.55rem 2.2rem;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(2, 6, 23, 0.65);
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}

.search-input-field:focus {
  outline: none;
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2), 0 0 0 1px rgba(56, 189, 248, 0.6);
}

.search-icon {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--accent-stronger);
  pointer-events: none;
}

.search-icon svg {
  display: block;
  width: 18px;
  height: 18px;
}

.search-shortcut {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: var(--text-muted);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

.search-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.6rem);
  width: min(780px, 92vw);
  background: rgba(8, 14, 28, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  z-index: 20;
  overflow: hidden;
}

.search-panel-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.7);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.search-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.search-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.search-actions-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.search-actions-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.search-action-chips {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.search-action-chip {
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.75);
  color: var(--text);
  font-size: 0.75rem;
  cursor: pointer;
}

.search-action-chip:hover {
  border-color: rgba(56, 189, 248, 0.45);
}

.search-action-chip.is-active {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.12);
  color: #bbf7d0;
}

.search-action-chip.is-primary {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(56, 189, 248, 0.15);
}

.filter-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.8);
  color: var(--text-muted);
  font-size: 0.78rem;
}

.filter-chip.has-value {
  border-color: rgba(56, 189, 248, 0.45);
  color: var(--text);
  background: rgba(56, 189, 248, 0.1);
}

.filter-chip-label {
  font-weight: 600;
  color: var(--text-dim);
}

.filter-chip-control {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 0.78rem;
  outline: none;
}

.filter-chip-control:focus {
  outline: none;
}

.filter-chip input[type="text"] {
  width: 110px;
}

.filter-chip select {
  cursor: pointer;
}

.filter-chip-clear {
  display: none;
  border: none;
  background: rgba(148, 163, 184, 0.2);
  color: var(--text);
  border-radius: 999px;
  width: 18px;
  height: 18px;
  font-size: 0.7rem;
  line-height: 18px;
  cursor: pointer;
}

.filter-chip.has-value .filter-chip-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.filter-chip-toggle {
  cursor: pointer;
}

.filter-chip-toggle input {
  margin: 0;
  accent-color: var(--accent-strong);
}

.filter-chip-range {
  align-items: center;
}

.filter-range-inputs {
  display: none;
  align-items: center;
  gap: 0.35rem;
}

.filter-chip-range.is-custom .filter-range-inputs {
  display: inline-flex;
}

.filter-range-inputs input {
  background: rgba(2, 6, 23, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  color: var(--text);
  padding: 0.2rem 0.35rem;
  font-size: 0.75rem;
}

.range-sep {
  color: var(--text-dim);
}

.search-panel-body {
  display: grid;
  grid-template-columns: 170px 1fr;
  min-height: 220px;
}

.search-groups {
  border-right: 1px solid rgba(148, 163, 184, 0.12);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.search-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 0.85rem;
}

.search-group.active {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
}

.search-group-count {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.search-results {
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.search-results-header {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 340px;
  overflow: auto;
  padding-right: 0.25rem;
}

.search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  background: rgba(15, 23, 42, 0.6);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.search-item:hover {
  border-color: rgba(56, 189, 248, 0.35);
}

.search-item.is-active {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.5);
}

.search-item-title {
  font-weight: 600;
}

.search-item-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.search-item-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.search-item-badge {
  display: inline-flex;
  padding: 0.2rem 0.45rem;
  border-radius: 8px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(148, 163, 184, 0.2);
  color: var(--text);
}

.search-item-badge.active {
  background: rgba(34, 197, 94, 0.2);
  color: #bbf7d0;
}

.search-item-badge.inactive {
  background: rgba(248, 113, 113, 0.2);
  color: #fecaca;
}

.search-empty {
  padding: 1rem;
  border-radius: 12px;
  border: 1px dashed rgba(148, 163, 184, 0.2);
  color: var(--text-muted);
  text-align: center;
  font-size: 0.85rem;
}

.app-main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: stretch;
  padding: 1.5rem;
}

.app-footer {
  padding: 0.75rem 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(15, 23, 42, 0.9);
  background: rgba(2, 6, 23, 0.9);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.footer-company {
  color: var(--text);
}

.footer-version {
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

.footer-contact-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
}

.footer-contact-link:hover {
  color: var(--text);
  text-decoration: underline;
}

.footer-contact-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.35);
  border-radius: 6px;
}

.footer-link {
  color: var(--accent-stronger);
  text-decoration: none;
  font-weight: 600;
}

.footer-link:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.footer-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.35);
  border-radius: 6px;
}

.mobile-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  padding: 0.5rem 0.55rem calc(0.55rem + env(safe-area-inset-bottom));
  background: rgba(2, 6, 23, 0.96);
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.35rem;
}

.mobile-bottom-nav-btn {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.34);
  background: rgba(15, 23, 42, 0.72);
  color: var(--text-muted);
  border-radius: 12px;
  min-height: 2.55rem;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.mobile-bottom-nav-btn.is-active {
  border-color: rgba(56, 189, 248, 0.65);
  background: rgba(56, 189, 248, 0.2);
  color: #e0f2fe;
}

@media (max-width: 980px) {
  .app-header {
    flex-wrap: wrap;
    gap: 0.6rem;
  }

  .app-user {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
    position: relative;
  }

  .user-info {
    order: 1;
    flex: 1 1 auto;
    min-width: 0;
    margin-right: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .global-search {
    order: 2;
    width: 100%;
  }

  .search-input {
    width: 100%;
  }

  .search-panel {
    position: fixed;
    top: 0.6rem;
    left: 0.6rem;
    right: 0.6rem;
    bottom: 0.6rem;
    width: auto;
    border-radius: 18px;
  }

  .search-panel-body {
    grid-template-columns: 1fr;
  }

  .search-groups {
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    overflow-x: auto;
  }

  .search-results-list {
    max-height: 50vh;
  }

  .sync-chip {
    font-size: 0.68rem;
    padding: 0.3rem 0.55rem;
  }
}

/* Login */

.login-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  position: relative;
}

.welcome-rotator {
  position: relative;
  display: block;
  text-align: center;
  font-size: clamp(2.3rem, 6vw, 4.2rem);
  font-weight: 800;
  color: rgba(148, 163, 184, 0.18);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  pointer-events: none;
  user-select: none;
  animation: float 8s ease-in-out infinite;
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 2rem;
  border-radius: 20px;
  background: radial-gradient(circle at top left, #0b1120, #020617 55%);
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(20px);
  position: relative;
}

.login-title {
  margin: 0 0 0.5rem;
  font-size: 2.2rem;
  font-weight: 700;
}

.login-subtitle {
  margin: 0 0 1.2rem;
  font-size: 1rem;
  color: var(--text-muted);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.form-label {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.form-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.8);
  color: var(--text);
  font-size: 1rem;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.4);
}

.form-input.is-invalid,
input.is-invalid,
select.is-invalid,
textarea.is-invalid {
  border-color: rgba(248, 113, 113, 0.9) !important;
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.25) !important;
}

.form-input[readonly] {
  background: rgba(2, 6, 23, 0.9);
  border-color: rgba(148, 163, 184, 0.28);
  color: var(--text-dim);
  cursor: default;
  caret-color: transparent;
}

.form-input[readonly]:focus {
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: none;
}

.form-input[type="file"] {
  padding: 0.45rem 0.6rem;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--text);
  cursor: pointer;
  border-radius: 10px;
}

.form-input[type="file"]::-webkit-file-upload-button,
.form-input[type="file"]::file-selector-button {
  background: var(--accent-strong);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.45rem 0.85rem;
  font-weight: 700;
  margin-right: 0.7rem;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(14, 165, 233, 0.25);
  transition: background 0.12s ease, transform 0.08s ease, box-shadow 0.12s ease;
}

.form-input[type="file"]::-webkit-file-upload-button:hover,
.form-input[type="file"]::file-selector-button:hover {
  background: #0284c7;
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(14, 165, 233, 0.3);
}

.legal-text {
  min-height: 200px;
  resize: vertical;
}

.legal-content {
  min-height: 60vh;
  white-space: pre-wrap;
}

.legal-textarea {
  min-height: 320px;
  white-space: pre-wrap;
  resize: vertical;
}

.legal-content.is-editing {
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: rgba(2, 6, 23, 0.55);
}

.legal-section {
  width: 100%;
}

.legal-section .legal-text {
  width: 100%;
  min-height: 60vh;
}

.first-login-legal {
  margin-top: 1rem;
  display: grid;
  gap: 0.8rem;
}

.legal-accordion {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  padding: 0.4rem 0.6rem;
  background: rgba(15, 23, 42, 0.6);
}

.legal-accordion summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
}

.legal-main-accordion {
  padding: 0.65rem 0.85rem;
  border-color: rgba(148, 163, 184, 0.28);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.72), rgba(15, 23, 42, 0.5));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  transition: border-color 0.16s ease, background 0.16s ease;
}

.legal-main-accordion:hover {
  border-color: rgba(56, 189, 248, 0.35);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.78), rgba(15, 23, 42, 0.56));
}

.legal-main-accordion > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  font-size: 1.04rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.legal-main-accordion > summary::-webkit-details-marker {
  display: none;
}

.legal-main-accordion > summary::after {
  content: "v";
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1;
}

.legal-main-accordion[open] > summary::after {
  content: "^";
}

.legal-main-body {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.legal-main-actions {
  justify-content: flex-end;
  margin-bottom: 0.6rem;
}

.legal-main-body .legal-content {
  min-height: 42vh;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(2, 6, 23, 0.5);
  padding: 0.85rem;
}

.legal-main-body .legal-textarea {
  min-height: 42vh;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(2, 6, 23, 0.5);
  color: var(--text);
  padding: 0.85rem;
}

.legal-acceptance-text {
  max-height: 180px;
  overflow: auto;
  padding: 0.6rem;
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.45);
  margin-top: 0.4rem;
}

.legal-checklist {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.inline-option {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.avv-proofs {
  margin-top: 1.2rem;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  padding-top: 1rem;
}

.avv-proofs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.avv-table td.actions {
  text-align: right;
  white-space: nowrap;
}

.avv-table th.actions {
  text-align: right;
}

.login-consent-note {
  font-size: 12px;
  color: #6b7280;
  margin-top: 6px;
}

.login-privacy-short {
  margin-top: 10px;
}

.login-hint {
  font-size: 0.9rem;
  color: #cbd5e1;
  margin-top: 8px;
  margin-bottom: 6px;
}

.check-green {
  color: #16a34a;
  font-weight: 700;
}

.form-error {
  margin-top: 0.2rem;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  background: rgba(220, 38, 38, 0.12);
  color: #fecaca;
  font-size: 0.8rem;
  border: 1px solid rgba(248, 113, 113, 0.4);
}

.login-btn {
  margin-top: 0.4rem;
}

.login-hint {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.login-hint code {
  background: rgba(15, 23, 42, 0.8);
  padding: 0.1rem 0.3rem;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

/* App */

.app-wrapper {
  width: 100%;
  max-width: none;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.2rem;
  position: relative;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.62);
  backdrop-filter: blur(2px);
  z-index: 70;
}

.sidebar {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: var(--shadow-subtle);
  padding: 1.2rem 0.9rem;
  display: flex;
  flex-direction: column;
}

.sidebar-mobile-head {
  display: none;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  min-height: 0;
}

.nav-section-title {
  margin: 0.6rem 0 0.1rem;
  padding: 0.2rem 0.35rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
}

.nav-section-title:hover {
  color: var(--text);
  background: rgba(56, 189, 248, 0.08);
}

.nav-section-title:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.35);
}

.nav-section-chevron {
  font-size: 0.78rem;
  line-height: 1;
  opacity: 0.9;
  transition: transform var(--dur-fast) var(--ease-out);
}

.nav-section-title.is-collapsed .nav-section-chevron {
  transform: rotate(-90deg);
}

.nav-section-links {
  display: grid;
  gap: 0.35rem;
}

.nav-section-links.is-collapsed {
  display: none;
}

.nav-link {
  display: block;
  padding: 0.6rem 0.9rem;
  padding-left: 1.4rem;
  margin-left: 0.4rem;
  border-radius: 10px;
  border-left: 2px solid rgba(148, 163, 184, 0.25);
  color: var(--text-muted);
  font-size: 1rem;
  text-decoration: none;
}

.nav-link:hover {
  background: rgba(30, 64, 175, 0.2);
  color: var(--text);
}

.nav-link-active {
  background: rgba(56, 189, 248, 0.16);
  color: var(--accent-strong);
}

.nav-sub {
  font-size: 0.95rem;
}

.nav-bottom {
  margin-top: auto;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.nav-bottom .nav-link {
  margin-top: 0.2rem;
}

.content {
  background: rgba(15, 23, 42, 0.95);
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: var(--shadow-subtle);
  padding: 1.5rem;
}

#main-content:focus {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(56, 189, 248, 0.32),
    var(--shadow-subtle);
}

.content-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0 0 0.2rem;
}

.text-muted {
  color: var(--text-muted);
  margin: 0.15rem 0;
}

.small {
  font-size: 0.82rem;
}

.chip-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  border: 1px solid transparent;
}

.chip-ghost {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.25);
  color: var(--text);
}

.chip-soft {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: rgba(56, 189, 248, 0.35);
}

.chip-success {
  background: var(--success-soft);
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.35);
}

.chip-danger {
  background: rgba(186, 35, 56, 0.12);
  color: #8c1a2b;
  border-color: rgba(186, 35, 56, 0.2);
}

.chip-outline {
  border-color: rgba(56, 189, 248, 0.35);
  color: var(--accent-strong);
}

.grid.two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.card {
  margin-top: 2rem;
  padding: 1.5rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: var(--shadow-subtle);
}

.card + .card {
  margin-top: 3rem;
}

.handbook-grid {
  margin-bottom: 1.5rem;
}

.handbook-content {
  min-height: 180px;
}

.handbook-content.is-editing {
  padding: 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: rgba(2, 6, 23, 0.55);
  outline: none;
}

.handbook-content[contenteditable="true"] a {
  pointer-events: none;
}

.handbook-toc a {
  color: var(--text);
  text-decoration: none;
}

.handbook-toc a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.handbook-block + .handbook-block {
  margin-top: 1.4rem;
}

.handbook-steps {
  padding-left: 1.2rem;
}

.content.is-entering {
  animation: contentEnter var(--dur-med) var(--ease-out) both;
}

@keyframes contentEnter {
  from {
    opacity: 0;
    transform: translateY(6px);
    filter: blur(0.5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .content.is-entering {
    animation: none;
  }
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.stacked-form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.form-actions-tight {
  gap: 0.5rem;
}

.btn-top {
  margin-top: 0.5rem;
}

.doc-edit-form-space {
  margin-top: 1rem;
}

.list-compact {
  margin: 0;
  padding-left: 1rem;
}

.flex-row-tight {
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.no-margin {
  margin: 0;
}

.inline-options {
  display: flex;
  gap: 1rem;
  margin: 0.4rem 0 0.8rem;
}

.modal-form h3 {
  margin: 1.2rem 0 0.4rem;
}

.machine-form-accordion {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.35);
  padding: 0.4rem 0.65rem;
  margin-bottom: 0.7rem;
}

.machine-form-accordion summary {
  cursor: pointer;
  color: #e2e8f0;
  font-weight: 600;
  list-style: none;
  padding: 0.15rem 0;
}

.machine-form-accordion summary::-webkit-details-marker {
  display: none;
}

.machine-form-accordion .form-grid,
.machine-form-accordion .stacked-form,
.machine-form-accordion > .form-label,
.machine-form-accordion > .form-input {
  margin-top: 0.65rem;
}

.form-group-full {
  grid-column: 1 / -1;
}

.machine-nameplate-assistant {
  margin-top: 0.65rem;
  padding: 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.5);
  display: grid;
  gap: 0.6rem;
}

.machine-nameplate-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}

.machine-nameplate-head h4 {
  margin: 0.15rem 0 0;
}

.machine-nameplate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.machine-nameplate-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.machine-nameplate-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.12);
  color: #dbeafe;
  font-size: 0.74rem;
}

.machine-nameplate-chip strong {
  color: #7dd3fc;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity var(--dur-med) var(--ease-out),
    visibility 0s linear var(--dur-med);
}

#confirm-modal {
  z-index: 1000;
}

.modal.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal:not(.hidden) {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition:
    opacity var(--dur-med) var(--ease-out),
    visibility 0s linear 0s;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity var(--dur-med) var(--ease-out);
}

.modal-content {
  position: relative;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  padding: 1.5rem;
  width: min(640px, 90%);
  max-height: 90vh;
  overflow: auto;
  transform: translateY(10px) scale(0.98);
  opacity: 0;
  transition:
    transform var(--dur-med) var(--ease-out),
    opacity var(--dur-med) var(--ease-out);
  will-change: transform, opacity;
}

.modal.is-open .modal-backdrop {
  opacity: 1;
}

.modal.is-open .modal-content {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.modal:not(.hidden) .modal-backdrop {
  opacity: 1;
}

.modal:not(.hidden) .modal-content {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.modal:not(.hidden) .modal-backdrop {
  opacity: 1;
}

.modal:not(.hidden) .modal-content {
  transform: translateY(0) scale(1);
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .modal,
  .modal .modal-backdrop,
  .modal .modal-content {
    transition: none !important;
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.modal-content::-webkit-scrollbar {
  width: 8px;
}
.modal-content::-webkit-scrollbar-track {
  background: rgba(148, 163, 184, 0.12);
  border-radius: 8px;
}
.modal-content::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.8), rgba(14, 165, 233, 0.9));
  border-radius: 8px;
}
.modal-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.9), rgba(14, 165, 233, 1));
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  border: none;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.08s ease, box-shadow 0.15s ease;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.35);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.nav-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.35);
  border-radius: 10px;
}

.btn-primary {
  background: var(--accent-strong);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(14, 165, 233, 0.25);
  border: 1px solid transparent;
}

.btn-primary:hover {
  transform: translateY(-1px);
  background: #0284c7;
  box-shadow: 0 10px 20px rgba(14, 165, 233, 0.3);
}

.btn-outline {
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: var(--text);
}

.btn-outline:hover {
  background: rgba(30, 41, 59, 0.82);
  border-color: rgba(56, 189, 248, 0.45);
  color: #e2e8f0;
}

.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
}

.btn-ghost {
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: var(--text);
}
.btn-secondary {
  background: #e5e7eb;
  color: #111827;
  border: 1px solid #d1d5db;
}
.btn-secondary:hover {
  background: #d1d5db;
  color: #0f172a;
}

.btn-danger {
  background: #ef4444;
  color: #fff;
  border: 1px solid #ef4444;
  box-shadow: 0 6px 14px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
  background: #dc2626;
  color: #fff;
  box-shadow: 0 10px 20px rgba(239, 68, 68, 0.3);
}

.btn-success {
  background: #22c55e;
  color: #fff;
  border: 1px solid #22c55e;
  box-shadow: 0 6px 14px rgba(34, 197, 94, 0.25);
}

.btn-success:hover {
  background: #16a34a;
  color: #fff;
  box-shadow: 0 10px 20px rgba(34, 197, 94, 0.3);
}

.inline-buttons {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.3rem;
}

.inline-buttons .btn-ghost {
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
}

/* Force action buttons to match primary style inside tables */
.table-actions .btn-outline,
.table-actions .btn-primary {
  background: var(--accent-strong);
  color: #fff;
  border: 1px solid transparent;
  box-shadow: 0 6px 14px rgba(14, 165, 233, 0.25);
}

.post-files-dropzone {
  border: 1px dashed rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.06);
  border-radius: 12px;
  padding: 0.65rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.post-files-dropzone.is-dragover {
  border-color: rgba(56, 189, 248, 0.9);
  background: rgba(56, 189, 248, 0.18);
}

.post-attachment-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.post-attachment-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.24);
}

.post-attachment-name {
  font-size: 0.84rem;
  color: var(--text);
  word-break: break-word;
}

.table-actions .btn-outline:hover,
.table-actions .btn-primary:hover {
  background: #0284c7;
  color: #fff;
  box-shadow: 0 10px 20px rgba(14, 165, 233, 0.3);
}

.table-actions .btn-danger {
  background: #ef4444;
  color: #fff;
  border: 1px solid #ef4444;
  box-shadow: 0 6px 14px rgba(239, 68, 68, 0.25);
}

.table-actions .btn-danger:hover {
  background: #dc2626;
  color: #fff;
  box-shadow: 0 10px 20px rgba(239, 68, 68, 0.3);
}

/* Utils */

.hidden {
  display: none !important;
}

.skeleton-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.skeleton-item {
  height: 68px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(148, 163, 184, 0.08);
  overflow: hidden;
  position: relative;
}

.skeleton-item::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.14), transparent);
  animation: shimmer 1.1s linear infinite;
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-item::after {
    animation: none;
  }
}

.post-card {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  background: rgba(2, 6, 23, 0.7);
  margin-bottom: 0.75rem;
  transition: border-color 0.12s ease, transform 0.12s ease;
}

.post-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}

.post-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.post-card-title {
  margin: 0;
  font-size: 1.05rem;
}

.post-card-subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
}

.post-card-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.post-card-body {
  margin: 0.5rem 0 0.75rem;
  color: var(--text);
  white-space: pre-wrap;
}

.post-card-actions {
  display: flex;
  gap: 0.5rem;
}

.post-detail-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.post-detail-meta > div {
  min-width: 0;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.35);
  padding: 0.45rem 0.5rem;
}

.post-detail-meta > div strong {
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#post-detail-attachments {
  margin-top: 0.7rem;
}

.text-dim {
  color: var(--text-dim);
}

.profile-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-top: 0.6rem;
}

.profile-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.profile-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.profile-panel {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  padding: 1.1rem;
  background: rgba(2, 6, 23, 0.55);
  box-shadow: var(--shadow-soft);
}

.profile-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.profile-panel-header h4 {
  margin: 0;
  font-size: 1.05rem;
}

.profile-fields {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.profile-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.profile-input-row .form-input {
  flex: 1;
}

.profile-copy-btn {
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
}

.profile-subsection {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.profile-subsection h5 {
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
}

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

.skeleton-list .skeleton-card {
  display: none;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.7rem;
  margin-bottom: 0.8rem;
}

.metric-card {
  padding: 0.8rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.65);
}

.admin-actions {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 0.6rem;
}

.admin-customers-row .badge {
  display: inline-flex;
  min-width: 64px;
  justify-content: center;
}

/* Workspace */
.workspace-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

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

.workspace-recent {
  margin-bottom: 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.4);
  padding: 0.75rem;
}

.workspace-recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.workspace-recent-head h4 {
  margin: 0;
  font-size: 0.92rem;
}

.workspace-recent-links {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.workspace-recent-link {
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(15, 23, 42, 0.7);
  color: var(--text);
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  font-size: 0.78rem;
  cursor: pointer;
}

.workspace-recent-link:hover {
  border-color: rgba(56, 189, 248, 0.58);
  background: rgba(56, 189, 248, 0.12);
}

.workspace-tool {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(2, 6, 23, 0.7);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition:
    transform var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) ease,
    box-shadow var(--dur-fast) ease;
}

.workspace-tool:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.5);
}

.workspace-tool:focus-visible {
  outline: none;
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.35);
}

.workspace-tool-icon {
  font-size: 1.4rem;
}

.workspace-tool-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.workspace-tool-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.workspace-tool-meta {
  margin-top: auto;
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--text-muted);
}

@media (max-width: 720px) {
  .workspace-hero {
    flex-direction: column;
    align-items: flex-start;
  }

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

/* Monitoring */
.monitoring-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.85rem;
  margin-top: 0.9rem;
}

.monitoring-tool-card {
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(2, 6, 23, 0.65);
}

.monitoring-tool-card h4 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.monitoring-tool-meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.monitoring-tool-links {
  margin-top: 0.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.monitoring-block {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(2, 6, 23, 0.62);
}

.monitoring-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-bottom: 0.7rem;
}

.monitoring-block-header h4 {
  margin: 0;
}

.monitoring-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.monitoring-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.monitoring-kpi-grid-attack {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-bottom: 0;
}

.monitoring-kpi-card {
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.62);
  display: grid;
  gap: 0.3rem;
}

.monitoring-kpi-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.monitoring-kpi-value {
  font-size: 1.3rem;
  line-height: 1.1;
}

.monitoring-health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.7rem;
}

.monitoring-health-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.62);
}

.monitoring-health-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.15);
}

.monitoring-health-dot-neutral {
  background: #94a3b8;
}

.monitoring-health-dot-ok {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.monitoring-health-dot-warn {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.monitoring-health-dot-down {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.monitoring-table-wrap .table td.actions {
  white-space: nowrap;
  text-align: right;
}

.monitoring-alert-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.monitoring-alert-status-open {
  background: rgba(239, 68, 68, 0.16);
  color: #fecaca;
}

.monitoring-alert-status-ack {
  background: rgba(245, 158, 11, 0.16);
  color: #fde68a;
}

.monitoring-alert-status-resolved {
  background: rgba(34, 197, 94, 0.16);
  color: #bbf7d0;
}

.monitoring-incident-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 170px minmax(220px, 1fr) auto;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.monitoring-timeline {
  display: grid;
  gap: 0.6rem;
}

.monitoring-timeline-item {
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.62);
}

.monitoring-timeline-title {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: baseline;
  margin-bottom: 0.2rem;
}

.monitoring-timeline-note {
  color: var(--text-muted);
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .monitoring-incident-form {
    grid-template-columns: 1fr;
  }
}

/* Docs list + preview */
.doc-automation-modal {
  max-width: 860px;
  width: 95%;
}

.doc-automation-preview {
  display: grid;
  gap: 0.6rem;
  padding: 0.6rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(2, 6, 23, 0.5);
}

.doc-automation-preview-body {
  min-height: 160px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(11, 18, 32, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}

.doc-automation-preview-body img {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
}

.doc-automation-preview-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}

.doc-automation-preview-title {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.9rem;
}

.doc-automation-detection {
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.docs-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: start;
}

.docs-layout.is-preview-open {
  grid-template-columns: minmax(0, 1fr) 360px;
}
.docs-list-column {
  min-width: 0;
}

.docs-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.doc-card {
  background: rgba(2, 6, 23, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  padding: 0.45rem 0.6rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: start;
  width: 100%;
  text-align: left;
  cursor: pointer;
  appearance: none;
  font: inherit;
  color: inherit;
}

.doc-card.is-active {
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.12);
}

.doc-card:focus-visible {
  outline: 2px solid var(--accent-stronger);
  outline-offset: 2px;
}

.doc-card-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-card-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.doc-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.7rem;
  color: var(--text-dim);
}

.doc-card-meta-item {
  white-space: nowrap;
}

.doc-card-category {
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
}

.docs-preview {
  position: sticky;
  top: 1rem;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  padding: 0.9rem;
  box-shadow: var(--shadow-subtle);
  max-height: calc(100vh - 6rem);
  overflow: auto;
}

.docs-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.docs-preview-body {
  background: rgba(2, 6, 23, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  padding: 0.6rem;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.docs-preview-body img,
.docs-preview-body iframe {
  width: 100%;
  height: 320px;
  border: 0;
  object-fit: contain;
  background: #0b1120;
}

.docs-preview-placeholder {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

.docs-preview-meta {
  margin-top: 0.6rem;
}

.docs-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.6rem 0;
}

.doc-modal {
  max-width: 960px;
  width: 95%;
}

.doc-modal-body {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
}

.doc-preview {
  background: #0b1120;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.doc-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.doc-preview .doc-icon {
  font-size: 3rem;
  color: #94a3b8;
}

.doc-info p {
  margin: 0.25rem 0;
}

@media (max-width: 800px) {
  .doc-modal-body {
    grid-template-columns: 1fr;
  }
}

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

  .docs-preview {
    position: relative;
    max-height: none;
  }

  .docs-preview-body img,
  .docs-preview-body iframe {
    height: 260px;
  }
}

.table-placeholder {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  overflow: hidden;
}

.duplicate-assistant-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.duplicate-assistant-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.7);
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.duplicate-assistant-row.is-selected {
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.16);
}

.duplicate-assistant-row.is-best {
  border-color: rgba(251, 191, 36, 0.6);
  background: rgba(251, 191, 36, 0.08);
}

.duplicate-assistant-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.duplicate-assistant-primary {
  font-weight: 600;
}

.duplicate-assistant-secondary {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.duplicate-assistant-badges {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.duplicate-assistant-status {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(148, 163, 184, 0.2);
  color: var(--text);
}

.duplicate-assistant-status.active {
  background: rgba(34, 197, 94, 0.2);
  color: #bbf7d0;
}

.duplicate-assistant-status.inactive {
  background: rgba(248, 113, 113, 0.2);
  color: #fecaca;
}

.duplicate-assistant-score {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.duplicate-assistant-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.customer-modal .modal-section-title {
  text-align: center;
  padding-bottom: 0.35rem;
  margin: 0 0 0.85rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  letter-spacing: 0.02em;
}

.table-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr 1.4fr 1fr;
  padding: 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  gap: 0.4rem;
}

.admin-customers-row {
  grid-template-columns:
    minmax(180px, 1.2fr)
    minmax(90px, 0.6fr)
    minmax(140px, 1fr)
    minmax(170px, 1.1fr)
    minmax(140px, 0.9fr)
    minmax(180px, 1.2fr)
    minmax(90px, 0.55fr)
    minmax(140px, 0.9fr)
    minmax(120px, 0.8fr)
    minmax(150px, 0.9fr);
  align-items: center;
}

.admin-customers-row .table-actions {
  justify-content: flex-end;
}

#admin-customers-table {
  overflow-x: auto;
}

#admin-customers-table .table-row {
  min-width: 1450px;
}

.table-row.head {
  background: rgba(56, 189, 248, 0.08);
  font-weight: 600;
}

.table-row span {
  display: block;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-actions {
  display: inline-flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
  white-space: normal;
  overflow: visible;
  text-overflow: initial;
}

.table-row.head span {
  display: flex;
  align-items: center;
}

.table-sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  padding: 0;
  cursor: pointer;
}

.table-sort .sort-arrow {
  font-size: 0.85rem;
  opacity: 0.65;
}

.table-sort.active .sort-arrow {
  opacity: 1;
  color: var(--accent-stronger);
}

.table-sort:focus-visible {
  outline: 1px solid var(--accent-stronger);
  outline-offset: 2px;
}

.machine-quick-add-fab {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 999px;
  background: #1d4ed8;
  color: #fff;
  font-size: 34px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(29, 78, 216, 0.35);
  z-index: 1200;
}

.machine-quick-add-fab:hover {
  background: #1e40af;
}

.machine-quick-add-fab:focus-visible {
  outline: 2px solid #bfdbfe;
  outline-offset: 2px;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

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

  .mobile-nav-toggle,
  .header-actions-toggle {
    display: inline-flex;
  }

  .app-main {
    padding-bottom: 4.9rem;
  }

  .sidebar-mobile-head {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.5rem;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, 88vw);
    border-radius: 0;
    border-left: 0;
    border-top: 0;
    border-bottom: 0;
    z-index: 80;
    transform: translateX(-104%);
    transition: transform 180ms ease;
    overflow: auto;
  }

  .app-wrapper.nav-open .sidebar {
    transform: translateX(0);
  }

  .app-wrapper.nav-open .sidebar-backdrop {
    display: block !important;
  }

  .content {
    width: 100%;
    min-width: 0;
  }

  .header-actions {
    position: absolute;
    right: 0.8rem;
    top: calc(100% + 0.4rem);
    background: rgba(8, 14, 28, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    padding: 0.5rem;
    display: none;
    grid-template-columns: 1fr;
    gap: 0.4rem;
    min-width: 150px;
    z-index: 98;
  }

  .header-actions.is-open {
    display: grid;
  }

  .header-actions .btn {
    width: 100%;
    justify-content: flex-start;
  }

  .mobile-bottom-nav {
    display: grid;
  }
}

@media (min-width: 901px) {
  .mobile-nav-toggle,
  .header-actions-toggle,
  .sidebar-backdrop,
  .sidebar-mobile-head,
  .mobile-bottom-nav {
    display: none !important;
  }

  .header-actions {
    display: inline-flex !important;
  }
}

@media (max-width: 600px) {
  .app-main {
    padding: 1rem;
  }

  .login-card {
    padding: 1.4rem;
  }

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

  .content-header {
    flex-direction: column;
  }
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
.perm-block {
  margin-bottom: 1.2rem;
}

.perm-table {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
}

.perm-row {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 0.5rem;
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.perm-row.head {
  background: rgba(56, 189, 248, 0.08);
  font-weight: 700;
}

.perm-row span {
  display: block;
}

.perm-row:last-child {
  border-bottom: none;
}

.perm-yes {
  color: #22c55e;
  font-weight: 700;
}

.perm-no {
  color: #f87171;
  font-weight: 700;
}

/* Kundenverwaltung */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin-top: 0.5rem;
}

.customer-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.customer-table thead {
  background: rgba(15, 23, 42, 0.9);
  color: #cbd5e1;
}

.customer-table th,
.customer-table td {
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  text-align: left;
  white-space: nowrap;
  color: var(--text);
  background: rgba(2, 6, 23, 0.52);
}

.customer-table .customer-select-col,
.customer-table .customer-select-cell {
  width: 34px;
  text-align: center;
}

.customer-table .customer-select-cell input {
  cursor: pointer;
}

.customer-table tbody tr:nth-child(even) td {
  background: rgba(15, 23, 42, 0.62);
}

.customer-table tbody tr:hover td {
  background: rgba(56, 189, 248, 0.14);
}

#customers-manage-section .customer-table th:nth-child(4),
#customers-manage-section .customer-table th:nth-child(5),
#customers-manage-section .customer-table td:nth-child(4),
#customers-manage-section .customer-table td:nth-child(5) {
  text-align: center;
}

#customers-manage-section .customer-table th:nth-child(7),
#customers-manage-section .customer-table td:nth-child(7) {
  width: 90px;
  text-align: center;
}

#customers-manage-section .customer-table tbody tr td:nth-child(2) {
  font-weight: 600;
}

#customers-manage-section .customer-table tbody tr td:nth-child(3),
#customers-manage-section .customer-table tbody tr td:nth-child(4) {
  color: var(--text-muted);
}

.customer-table tbody tr td .badge {
  display: inline-flex;
  min-width: 64px;
  justify-content: center;
}

.customer-table .btn-more {
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
  border-radius: 6px;
}

.customer-email {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  vertical-align: bottom;
}

.customer-table td.is-editable {
  cursor: text;
}

.customer-table td.is-editing {
  background: rgba(30, 41, 59, 0.82);
}

.inline-edit-input {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.5);
  border-radius: 6px;
  padding: 0.2rem 0.35rem;
  font-size: 0.85rem;
  background: rgba(2, 6, 23, 0.72);
  color: var(--text);
}

.customer-bulk-bar {
  margin-top: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(2, 6, 23, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.customer-bulk-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
  font-weight: 600;
  font-size: 0.85rem;
}

.customer-bulk-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.bulk-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.bulk-field-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
}

.bulk-field-inline {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.customer-dossier-header {
  align-items: flex-start;
  gap: 1rem;
}

.customer-dossier-header .chip-row {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dossier-kpi-grid {
  margin-top: 0.8rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.7rem;
}

.dossier-kpi-card {
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.65);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-align: left;
  font: inherit;
}

.dossier-kpi-card.is-clickable {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.dossier-kpi-card.is-clickable:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.35);
}

.dossier-kpi-card.is-clickable:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.35);
}

.dossier-kpi-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.dossier-kpi-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dossier-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.9rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.dossier-tab {
  border: 1px solid transparent;
  background: rgba(15, 23, 42, 0.5);
  color: var(--text);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dossier-tab:hover {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.12);
}

.dossier-tab.is-active {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(56, 189, 248, 0.18);
}

.dossier-panel {
  margin-top: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.dossier-section-card {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(2, 6, 23, 0.35);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.customer-dossier .dossier-section-card:hover {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(15, 23, 42, 0.6);
  transform: translateY(-1px);
}

.dossier-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.dossier-asset-toolbar {
  margin-top: 0.75rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.dossier-asset-filters {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.dossier-asset-filter.is-active {
  border-color: rgba(56, 189, 248, 0.6);
  background: rgba(56, 189, 248, 0.15);
}

.dossier-asset-search {
  min-width: 220px;
  flex: 1;
}

.dossier-asset-search .form-input {
  width: 100%;
}

.dossier-section-header h4 {
  margin: 0;
  font-size: 0.95rem;
}

.dossier-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.dossier-list-item {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  font-size: 0.85rem;
  color: var(--text);
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  transition: background 0.15s ease, transform 0.15s ease;
}

.dossier-list-item:hover {
  background: rgba(56, 189, 248, 0.12);
  transform: translateY(-1px);
}

.dossier-list-item span {
  color: var(--text-muted);
}

.dossier-list-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.dossier-empty {
  color: var(--text-muted);
  font-size: 0.85rem;
}

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

.dossier-asset-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.dossier-asset-table th,
.dossier-asset-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  text-align: left;
}

.dossier-asset-table th {
  color: var(--text-dim);
  font-weight: 600;
}

.dossier-asset-table tbody tr {
  transition: background 0.15s ease;
}

.dossier-asset-table tbody tr:hover {
  background: rgba(56, 189, 248, 0.1);
}

.dossier-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.dossier-timeline-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0.8rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.5);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dossier-timeline-item.is-clickable {
  cursor: pointer;
}

.dossier-timeline-item:hover {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.08);
}

.dossier-timeline-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.dossier-timeline-title {
  font-weight: 600;
  color: var(--text);
}

.dossier-timeline-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.dossier-doc-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 0.4rem;
}

.dossier-form {
  margin-top: 0.7rem;
  display: grid;
  gap: 0.4rem;
}

.dossier-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.3rem;
}

.dossier-section-card.is-full-span {
  grid-column: 1 / -1;
}

.dossier-pricing-form {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dossier-pricing-section {
  padding-top: 0.45rem;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.dossier-pricing-section h5 {
  margin: 0 0 0.45rem;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.dossier-pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.55rem 0.7rem;
}

.dossier-pricing-field {
  min-width: 0;
}

.dossier-pricing-overrides-table {
  width: 100%;
  min-width: 980px;
}

.dossier-pricing-overrides-table th,
.dossier-pricing-overrides-table td {
  font-size: 0.76rem;
  vertical-align: middle;
}

.dossier-pricing-overrides-table .form-input {
  min-width: 88px;
}

.dossier-pricing-footer {
  margin-top: 0.7rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.dossier-month-group {
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(2, 6, 23, 0.35);
  overflow: hidden;
}

.dossier-month-toggle {
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.85rem;
  background: rgba(15, 23, 42, 0.6);
  border: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.86rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.dossier-month-toggle::after {
  content: "+";
  font-weight: 600;
  color: var(--text-muted);
}

.dossier-month-toggle.is-open::after {
  content: "-";
}

.dossier-month-toggle:hover {
  background: rgba(56, 189, 248, 0.12);
}

.dossier-month-toggle.is-open {
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.dossier-month-content {
  padding: 0.6rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.empty-state {
  margin-top: 1.2rem;
  text-align: center;
  color: var(--text-muted);
  padding: 1rem;
  border-radius: 12px;
  border: 1px dashed rgba(148, 163, 184, 0.25);
  background: rgba(2, 6, 23, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.empty-title {
  margin: 0;
  color: var(--text);
  font-weight: 600;
}

.empty-actions {
  margin-top: 0.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.inline-label {
  margin-right: 8px;
}

.doc-preview-frame {
  width: 100%;
  height: 520px;
  border: none;
}

.toast-container {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 120;
}

.global-error-banner {
  position: fixed;
  left: 50%;
  bottom: 1.1rem;
  transform: translateX(-50%);
  width: min(720px, 92vw);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(248, 113, 113, 0.65);
  background: rgba(127, 29, 29, 0.92);
  color: #fecaca;
  font-size: 0.9rem;
  box-shadow: 0 16px 32px rgba(127, 29, 29, 0.35);
  z-index: 140;
  text-align: center;
  word-break: break-word;
  letter-spacing: 0.01em;
}

.toast {
  min-width: 220px;
  max-width: 320px;
  padding: 0.75rem 0.95rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.95);
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.6);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: toastIn var(--dur-med) var(--ease-out) both;
}

.toast-message {
  flex: 1 1 auto;
}

.toast-action {
  flex: 0 0 auto;
  border: 1px solid rgba(56, 189, 248, 0.55);
  background: rgba(56, 189, 248, 0.14);
  color: #e0f2fe;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.24rem 0.5rem;
  cursor: pointer;
}

.toast-action:disabled {
  opacity: 0.65;
  cursor: default;
}

.toast-action:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.4);
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--dur-fast) ease, transform var(--dur-fast) ease;
}

.toast.success {
  border-color: rgba(34, 197, 94, 0.5);
}

.toast.error {
  border-color: rgba(249, 115, 115, 0.6);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.customer-card-container {
  display: none;
  gap: 0.8rem;
  margin-top: 1rem;
}

.customer-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0.9rem;
  color: #0f172a;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.customer-card h4 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.customer-card .customer-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.3rem 0.6rem;
  font-size: 0.9rem;
}

.customer-card .card-actions {
  margin-top: 0.6rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.customer-card .tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: #eef5ff;
  color: #1d4ed8;
  font-weight: 600;
  font-size: 0.85rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  font-size: 0.82rem;
  background: #e5e7eb;
  color: #111827;
}

.badge.success {
  background: #dcfce7;
  color: #166534;
}

.badge.warning {
  background: #fef3c7;
  color: #92400e;
}

.badge.info {
  background: #e0f2fe;
  color: #0369a1;
}

.badge.muted {
  background: #e5e7eb;
  color: #111827;
}

.badge.danger {
  background: rgba(248, 113, 113, 0.2);
  color: #b91c1c;
}

.icon {
  opacity: 0.8;
}

.modal-section {
  margin-bottom: 1rem;
}

.customer-modal .modal-body p {
  margin: 0.15rem 0;
}

.customer-modal .modal-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Switch */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  user-select: none;
}
.switch input {
  display: none;
}
.switch .slider {
  width: 38px;
  height: 20px;
  background: #d1d5db;
  border-radius: 999px;
  position: relative;
  transition: background 0.15s ease;
}
.switch .slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
  transition: transform 0.15s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.switch input:checked + .slider {
  background: #22c55e;
}
.switch input:checked + .slider::before {
  transform: translateX(18px);
}
.switch .switch-text {
  font-size: 0.9rem;
  color: #111827;
}

/* Machine detail view */
.machine-detail-view {
  position: relative;
}

.machine-detail-header {
  align-items: center;
}

.machine-detail-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 1.2rem;
  margin-top: 1rem;
}

.machine-detail-aside {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.machine-detail-main {
  min-width: 0;
}

.machine-info-card {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  padding: 0.9rem;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.machine-detail-view .machine-info-card:hover {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(15, 23, 42, 0.85);
  transform: translateY(-1px);
}

.machine-title-row {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  margin-bottom: 0.7rem;
}

.machine-info-grid {
  display: grid;
  gap: 0.45rem;
}

.machine-info-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--text);
}

.machine-info-label {
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.machine-link {
  color: #38bdf8;
  text-decoration: none;
}

.machine-link.is-muted {
  color: var(--text-muted);
  pointer-events: none;
}

.machine-action-card {
  position: sticky;
  top: 1rem;
}

.machine-action-bar {
  display: grid;
  gap: 0.5rem;
}

.machine-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.machine-action-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.machine-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.machine-tab {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(2, 6, 23, 0.4);
  color: var(--text-muted);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  transition: all 0.15s ease;
}

.machine-tab:hover {
  border-color: rgba(56, 189, 248, 0.45);
  color: var(--text);
}

.machine-tab.is-active {
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  border-color: rgba(148, 163, 184, 0.6);
}

.machine-panel {
  padding-top: 0.6rem;
}

.machine-detail-card + .machine-detail-card {
  margin-top: 0.9rem;
}

.machine-panel-controls {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.machine-profile-groups {
  display: grid;
  gap: 0.65rem;
}

.machine-profile-group {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.38);
  padding: 0.35rem 0.55rem 0.45rem;
}

.machine-profile-group summary {
  cursor: pointer;
  font-weight: 600;
  color: #e2e8f0;
  list-style: none;
}

.machine-profile-group summary::-webkit-details-marker {
  display: none;
}

.machine-profile-table {
  margin-top: 0.5rem;
}

.machine-profile-table th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 500;
  width: 42%;
}

.machine-profile-table td {
  color: var(--text);
}

.machine-history-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.7rem;
}

.machine-top-insights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.machine-history-stat {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.58);
  padding: 0.55rem 0.65rem;
  display: grid;
  gap: 0.25rem;
}

.machine-history-stat-label {
  color: var(--text-dim);
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.machine-ticket-table {
  margin-top: 0.45rem;
}

.machine-control {
  min-width: 160px;
}

.form-input.form-input-sm {
  padding: 0.35rem 0.55rem;
  font-size: 0.8rem;
}

.machine-timeline {
  display: grid;
  gap: 0.8rem;
}

.machine-timeline-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 0.8rem;
  align-items: start;
  background: rgba(2, 6, 23, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  padding: 0.75rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.machine-detail-view .machine-timeline-item:hover {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(15, 23, 42, 0.7);
}

.machine-timeline-item.is-link {
  cursor: pointer;
  transition: border-color var(--dur-fast) ease, transform var(--dur-fast) ease;
}

.machine-timeline-item.is-link:hover,
.machine-timeline-item.is-link:focus-visible {
  border-color: rgba(168, 85, 247, 0.55);
  transform: translateY(-1px);
  outline: none;
}

.machine-timeline-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #334155;
}

.machine-timeline-icon[data-type="post"] {
  background: #0ea5e9;
}

.machine-timeline-icon[data-type="work"] {
  background: #22c55e;
}

.machine-timeline-icon[data-type="status"] {
  background: #f59e0b;
}

.machine-timeline-icon[data-type="order"] {
  background: #a855f7;
}

.machine-timeline-title {
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.machine-timeline-text {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 0.3rem;
}

.machine-timeline-meta {
  color: var(--text-dim);
  font-size: 0.75rem;
}

.machine-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.machine-filter-chip {
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(2, 6, 23, 0.4);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.75rem;
}

.machine-filter-chip.is-active {
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  border-color: rgba(148, 163, 184, 0.6);
}

.machine-doc-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.machine-documents-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1rem;
  align-items: start;
}

.machine-documents-column {
  min-width: 0;
}

.machine-documents-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.machine-doc-card {
  background: rgba(2, 6, 23, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  padding: 0.45rem 0.6rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
  text-align: left;
  cursor: pointer;
  appearance: none;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.machine-detail-view .machine-doc-card:hover {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(15, 23, 42, 0.75);
  transform: translateY(-1px);
}

.machine-doc-card.is-active {
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.12);
}

.machine-doc-card:focus-visible {
  outline: 2px solid var(--accent-stronger);
  outline-offset: 2px;
}

.machine-doc-title {
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.machine-doc-category {
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
}

.machine-doc-subtitle {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.machine-doc-meta {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.machine-doc-actions {
  margin-top: 0.25rem;
}

.machine-doc-preview {
  position: sticky;
  top: 1rem;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  padding: 0.9rem;
  box-shadow: var(--shadow-subtle);
  max-height: calc(100vh - 6rem);
  overflow: auto;
}

.machine-doc-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.machine-doc-preview-body {
  background: rgba(2, 6, 23, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  padding: 0.6rem;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.machine-doc-preview-body img,
.machine-doc-preview-body iframe {
  width: 100%;
  height: 320px;
  border: 0;
  object-fit: contain;
  background: #0b1120;
}

.machine-doc-preview-placeholder {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

.machine-doc-preview-meta {
  margin-top: 0.6rem;
}

.machine-doc-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.6rem 0;
}

.machine-loading {
  padding: 0.6rem;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

@media (max-width: 980px) {
  .machine-detail-layout {
    grid-template-columns: 1fr;
  }

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

  .machine-action-card {
    position: sticky;
    bottom: 0;
    z-index: 2;
    background: rgba(2, 6, 23, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.2);
  }

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

  .machine-doc-preview {
    position: relative;
    max-height: none;
  }

  .machine-doc-preview-body img,
  .machine-doc-preview-body iframe {
    height: 260px;
  }
}

@media (max-width: 960px) {
  #customers-manage-section .table-wrapper {
    display: none;
  }

  .customer-card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
}

/* Reports */
.report-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 1rem;
}

.report-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.report-card {
  border-radius: 14px;
  padding: 1rem;
  background: rgba(2, 6, 23, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.report-card h4 {
  margin: 0 0 0.6rem;
}

.report-template-builder {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.report-template-builder h5,
.report-template-builder h6 {
  margin: 0;
}

.protocol-builder-grid {
  display: grid;
  gap: 0.7rem;
}

.protocol-builder-block {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  padding: 0.65rem;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.protocol-builder-options {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.report-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 420px;
  overflow: auto;
}

.report-list-item {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  cursor: pointer;
}

.report-list-item.is-active {
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.12);
}

.report-list-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.report-list-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.report-editor {
  background: rgba(15, 23, 42, 0.75);
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.report-editor-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Statistics */
.stats-filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) minmax(220px, 1.2fr) auto;
  gap: 0.75rem;
  padding: 0.8rem;
  border-radius: 16px;
  background: rgba(148, 163, 184, 0.08);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.12);
  align-items: end;
  margin-bottom: 0.8rem;
  position: sticky;
  top: 0.8rem;
  z-index: 4;
  backdrop-filter: blur(12px);
}

.stats-filter-bar .form-input,
.stats-filter-bar .stats-select-input {
  min-height: 40px;
}

.stats-filter {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.stats-filter-actions {
  align-items: flex-end;
  justify-self: end;
}

.stats-filter-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.stats-filter-buttons .btn {
  min-width: 130px;
}

.stats-filter-advanced-wrap {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 0.75rem;
}

.form-hint {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.stats-select {
  position: relative;
}

.stats-select-input {
  background: rgba(15, 23, 42, 0.6);
}

.stats-select-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: rgba(8, 14, 28, 0.98);
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: var(--shadow-subtle);
  max-height: 220px;
  overflow-y: auto;
  z-index: 30;
}

.stats-select-option {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 0.5rem 0.7rem;
  cursor: pointer;
}

.stats-select-option:hover,
.stats-select-option.is-active {
  background: rgba(56, 189, 248, 0.12);
}

.stats-select-option.is-active {
  color: var(--accent-stronger);
}

.stats-range-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.stats-priority-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.stats-priority-chip {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  color: #111111;
  opacity: 0.45;
  transition: transform var(--dur-fast) ease, opacity var(--dur-fast) ease;
}

.stats-priority-chip.is-active {
  opacity: 1;
  border-color: rgba(17, 24, 39, 0.35);
}

.stats-priority-chip:hover {
  transform: translateY(-1px);
}

.stats-priority-chip.priority-low {
  background: #fef3c7;
}

.stats-priority-chip.priority-medium {
  background: #fed7aa;
}

.stats-priority-chip.priority-high {
  background: #fecaca;
}

.stats-filter-hint {
  margin-top: 0.2rem;
}

.stats-filter-bar + .stats-section {
  margin-top: 0.8rem;
}

.stats-filter-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin: 0.2rem 0 0.9rem;
}

.stats-filter-summary-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stats-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.stats-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.25);
  font-size: 0.75rem;
  color: var(--text);
}

.stats-filter-chip button {
  border: none;
  background: rgba(148, 163, 184, 0.2);
  color: var(--text);
  width: 18px;
  height: 18px;
  border-radius: 999px;
  cursor: pointer;
  line-height: 18px;
  font-size: 0.7rem;
}

@media (max-width: 1100px) {
  .stats-filter-bar {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .stats-filter-actions {
    grid-column: span 2;
    justify-self: stretch;
  }

  .stats-filter-advanced-wrap {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

.stats-section {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.stats-kpi-section {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.stats-section + .stats-section {
  margin-top: 1.8rem;
}

.stats-section-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.stats-section-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.stats-reporting-save {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex-wrap: wrap;
}

.stats-reporting-save .form-input {
  min-width: 180px;
}

.stats-section-note {
  margin-top: 0.4rem;
}

.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.8rem;
  margin-top: 0.8rem;
}

.stats-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 86px;
  transition: border-color var(--dur-fast) ease, transform var(--dur-fast) ease;
}

.stats-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-1px);
}

.stats-card-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stats-card-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.stats-card-meta {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.stats-grid-two {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
}

.stats-panel {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
}

.stats-panel h5 {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}

.stats-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.stats-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.86rem;
  color: var(--text);
}

.stats-list-item span {
  color: var(--text-muted);
}

.stats-list-actions {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  color: var(--text);
}

.stats-strategy-insight {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(2, 6, 23, 0.5);
}

.stats-strategy-insight strong {
  font-size: 0.83rem;
}

.stats-strategy-insight span {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.stats-decision-panel {
  margin-top: 1rem;
}

.stats-decision-disclaimer {
  margin: 0.35rem 0 0.85rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.stats-decision-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.7rem;
}

.stats-decision-card {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.45);
  padding: 0.65rem 0.75rem;
}

.stats-decision-top {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.stats-decision-severity {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.12rem 0.45rem;
  color: #0f172a;
}

.decision-severity-high {
  background: #fca5a5;
}

.decision-severity-medium {
  background: #fde68a;
}

.decision-severity-low {
  background: #86efac;
}

.stats-decision-detail,
.stats-decision-basis,
.stats-decision-rec,
.stats-decision-confidence {
  margin: 0.45rem 0 0;
  font-size: 0.79rem;
}

.stats-decision-basis,
.stats-decision-confidence {
  color: var(--text-muted);
}

.stats-strategy-score {
  display: inline-flex;
  min-width: 44px;
  justify-content: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #0f172a;
}

.strategy-score-high {
  background: #86efac;
}

.strategy-score-medium {
  background: #fde68a;
}

.strategy-score-low {
  background: #fca5a5;
}

.stats-charts {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.stats-chart {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.stats-loading .stats-card-value,
.stats-loading .stats-list-item strong,
.stats-loading .stats-list-item span {
  color: transparent;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.18), rgba(148, 163, 184, 0.05), rgba(148, 163, 184, 0.18));
  background-size: 200% 100%;
  border-radius: 8px;
  animation: statsShimmer 1.2s linear infinite;
}

.stats-loading .stats-card-value {
  min-height: 20px;
}

.stats-loading .stats-chart canvas {
  opacity: 0.5;
}

@keyframes statsShimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.stats-chart-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stats-chart canvas {
  width: 100%;
  height: 200px;
}

.stats-table-wrap {
  margin-top: 1rem;
  overflow-x: auto;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.stats-table th,
.stats-table td {
  text-align: left;
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.stats-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stats-table tbody tr:hover {
  background: rgba(56, 189, 248, 0.06);
}

.stats-table th.cell-num,
.stats-table td.cell-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.stats-table th.cell-center,
.stats-table td.cell-center {
  text-align: center;
}

.orders-header {
  align-items: flex-start;
}

.orders-header-actions {
  align-items: flex-start;
  justify-content: flex-end;
}

.orders-mode-switch-row {
  display: flex;
  justify-content: flex-start;
  margin: 4px 0 14px;
}

.orders-mode-switch {
  display: inline-flex;
  gap: 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.orders-mode-switch .btn {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.1;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(148, 163, 184, 0.1);
}

.orders-mode-switch .btn.is-active {
  border-color: rgba(56, 189, 248, 0.55);
  color: #e0f2fe;
  background: rgba(56, 189, 248, 0.18);
}

.orders-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 0.7rem;
  margin-bottom: 0.85rem;
}

.orders-kpi {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.7);
  padding: 0.6rem 0.75rem;
}

.orders-kpi-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.orders-kpi strong {
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}

.orders-quick-bar {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.orders-quick-chips {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.orders-quick-chip {
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(2, 6, 23, 0.42);
  color: var(--text-muted);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.76rem;
}

.orders-quick-chip.is-active {
  border-color: rgba(56, 189, 248, 0.55);
  color: #e0f2fe;
  background: rgba(56, 189, 248, 0.18);
}

.orders-quick-chip[data-quick="archived"] {
  border-color: rgba(148, 163, 184, 0.48);
  color: #d1d5db;
  background: rgba(15, 23, 42, 0.66);
}

.orders-quick-chip[data-quick="archived"].is-active {
  border-color: rgba(251, 191, 36, 0.62);
  color: #fef3c7;
  background: rgba(245, 158, 11, 0.2);
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.16);
}

.orders-quick-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.orders-toolbar {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.orders-filter {
  flex: 1 1 220px;
  min-width: 200px;
}

.orders-filter-actions {
  display: flex;
  align-items: flex-end;
}

.orders-filter-buttons {
  display: flex;
  gap: 0.5rem;
}

.orders-filter-advanced {
  flex: 1 1 100%;
  max-width: 420px;
}

.orders-bulk-bar {
  margin-bottom: 0.8rem;
  border: 1px solid rgba(56, 189, 248, 0.28);
  background: rgba(14, 165, 233, 0.09);
  border-radius: 12px;
  padding: 0.55rem 0.7rem;
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  flex-wrap: wrap;
  align-items: center;
}

.orders-bulk-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.orders-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.orders-layout {
  display: grid;
  grid-template-columns: minmax(320px, var(--orders-split-left, 54%)) 10px minmax(320px, 1fr);
  gap: 0.9rem;
}

.split-resizer {
  width: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  cursor: col-resize;
  align-self: stretch;
  transition: background var(--dur-fast) ease;
}

.split-resizer:hover,
.split-resizer:focus-visible {
  background: rgba(56, 189, 248, 0.42);
}

#orders-layout.is-list-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

#orders-layout.is-list-collapsed > section:first-child,
#orders-layout.is-list-collapsed > .split-resizer {
  display: none;
}

#orders-layout.is-editor-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

#orders-layout.is-editor-collapsed > aside,
#orders-layout.is-editor-collapsed > .split-resizer {
  display: none;
}

.orders-container {
  min-width: 0;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.56);
  padding: 12px;
}

.orders-loading-skeleton {
  display: grid;
  gap: 0.55rem;
}

.orders-skeleton-row {
  height: 3.1rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background:
    linear-gradient(
      90deg,
      rgba(148, 163, 184, 0.14) 0%,
      rgba(148, 163, 184, 0.26) 42%,
      rgba(148, 163, 184, 0.14) 100%
    );
  background-size: 220% 100%;
  animation: ordersSkeletonPulse 1.25s ease-in-out infinite;
}

@keyframes ordersSkeletonPulse {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

.orders-cards {
  display: grid;
  gap: 0.65rem;
}

.orders-card {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.74);
  padding: 0.72rem;
  display: grid;
  gap: 0.55rem;
}

.orders-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.55rem;
}

.orders-card-title {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.35;
}

.orders-card-meta {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.orders-card-select {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.orders-card-select input {
  inline-size: 1rem;
  block-size: 1rem;
}

.orders-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 0.55rem;
}

.orders-card-cell {
  display: grid;
  gap: 0.14rem;
}

.orders-card-cell span {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.orders-card-cell strong {
  font-size: 0.86rem;
  font-weight: 600;
}

.orders-card-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.orders-table-shell {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.82);
  overflow: auto;
  content-visibility: auto;
  contain-intrinsic-size: 360px;
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1120px;
  font-size: 0.88rem;
}

.orders-table th,
.orders-table td {
  text-align: left;
  padding: 0.58rem 0.6rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  vertical-align: middle;
  white-space: nowrap;
}

.orders-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(9, 16, 30, 0.96);
}

.orders-sort-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
  cursor: pointer;
}

.orders-table td.actions {
  white-space: nowrap;
  text-align: right;
}

.orders-table td.actions .table-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.orders-table tbody tr:hover {
  background: rgba(56, 189, 248, 0.08);
}

.orders-table tbody tr.is-selected {
  background: rgba(56, 189, 248, 0.14);
}

.orders-table tbody tr.is-active {
  box-shadow: inset 3px 0 0 rgba(56, 189, 248, 0.8);
}

.orders-table .cell-center {
  text-align: center;
}

.orders-table th:nth-child(1),
.orders-table td:nth-child(1) {
  width: 42px;
}

.orders-table th:nth-child(2),
.orders-table td:nth-child(2) {
  width: 120px;
  font-variant-numeric: tabular-nums;
}

.orders-table th:nth-child(3),
.orders-table td:nth-child(3) {
  width: 180px;
}

.orders-table th:nth-child(6),
.orders-table td:nth-child(6) {
  width: 120px;
  text-align: center;
}

.orders-table th:nth-child(7),
.orders-table td:nth-child(7),
.orders-table th:nth-child(8),
.orders-table td:nth-child(8) {
  width: 132px;
  font-variant-numeric: tabular-nums;
}

.orders-table th:nth-child(9),
.orders-table td:nth-child(9) {
  width: 210px;
}

.orders-table td:nth-child(6) .badge {
  min-width: 86px;
  display: inline-flex;
  justify-content: center;
}

.orders-detail-panel {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.8);
  padding: 0.75rem;
  position: sticky;
  top: 0.8rem;
  max-height: calc(100vh - 5.6rem);
  overflow: auto;
}

.orders-detail-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin: 0.6rem 0;
}

.orders-detail-meta-list {
  display: grid;
  gap: 0.45rem;
  margin: 0.7rem 0;
}

.orders-detail-meta-list div {
  display: grid;
  gap: 0.1rem;
}

.orders-detail-meta-list span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.orders-detail-efforts {
  margin: 0.7rem 0;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.36);
  padding: 0.6rem;
}

.orders-detail-efforts-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.45rem;
}

.orders-detail-efforts-head span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.orders-detail-efforts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
}

.orders-detail-efforts-grid div {
  display: grid;
  gap: 0.1rem;
}

.orders-detail-efforts-grid span {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.orders-detail-efforts-grid strong {
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.orders-detail-booking {
  margin-top: 0.65rem;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  padding-top: 0.6rem;
}

.orders-detail-booking h5 {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.orders-detail-booking-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.orders-booking-note,
.orders-booking-actions {
  grid-column: 1 / -1;
}

.orders-booking-actions {
  display: flex;
  justify-content: flex-end;
}

#orders-booking-help {
  margin: 0.45rem 0 0;
}

#orders-detail-materials-section .chip-row {
  margin-top: 0.4rem;
  gap: 0.35rem;
  flex-wrap: wrap;
}

#orders-detail-materials-section .actions .form-input.form-input-sm {
  min-width: 120px;
}

#orders-detail-materials-purchase-requests {
  margin-top: 0.5rem;
}

.order-times-routes-wrap {
  margin-top: 0.65rem;
}

.orders-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.orders-filter-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.56);
  backdrop-filter: blur(2px);
  z-index: 109;
}

.orders-pagination {
  margin-top: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

#orders-section.orders-compact .orders-table th,
#orders-section.orders-compact .orders-table td {
  padding: 0.38rem 0.46rem;
  font-size: 0.8rem;
}

#orders-section.orders-compact .orders-kpi {
  padding: 0.45rem 0.62rem;
}

@media (max-width: 1180px) {
  .orders-layout {
    grid-template-columns: 1fr;
  }

  .orders-layout > .split-resizer {
    display: none;
  }

  .orders-detail-panel {
    position: relative;
    top: 0;
    max-height: none;
  }
}

@media (max-width: 560px) {
  .post-detail-meta {
    grid-template-columns: 1fr;
  }

  .orders-detail-booking-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .orders-kpi-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .orders-header {
    gap: 0.75rem;
  }

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

  .orders-quick-bar {
    position: sticky;
    top: 0.2rem;
    z-index: 4;
    padding: 0.25rem 0 0.55rem;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.97), rgba(15, 23, 42, 0.86));
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  }

  .orders-toolbar {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    margin: 0;
    padding: 0.95rem 0.85rem calc(0.85rem + env(safe-area-inset-bottom));
    background: rgba(2, 6, 23, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 16px;
    box-shadow: 0 24px 40px rgba(2, 6, 23, 0.56);
    transform: translateY(112%);
    opacity: 0;
    pointer-events: none;
    transition: transform 180ms ease, opacity 180ms ease;
    max-height: calc(100vh - 8rem);
    overflow: auto;
    z-index: 112;
  }

  .orders-toolbar.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .orders-filter {
    min-width: 0;
    flex-basis: 100%;
  }

  .orders-filter-actions {
    align-items: stretch;
  }

  .orders-filter-buttons {
    width: 100%;
  }

  .orders-filter-buttons .btn {
    flex: 1;
  }

  .orders-quick-actions {
    width: 100%;
  }

  .orders-quick-actions .btn {
    flex: 1;
    min-width: 0;
  }

  .orders-table-shell {
    display: none;
  }

  .orders-card .table-actions {
    width: 100%;
  }

  .orders-card .table-actions .btn {
    flex: 1;
    min-width: 0;
  }
}

.intern-toolbar {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.intern-filter {
  flex: 1 1 180px;
  min-width: 160px;
}

.intern-filter-fill {
  flex: 2 1 240px;
}

#intern-filter-advanced-wrap {
  min-width: 220px;
}

.intern-filter-actions {
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
}

.intern-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.45rem;
  margin-bottom: 0.8rem;
}

.intern-tabs-intro {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem 0.8rem;
  margin-bottom: 0.5rem;
}

.intern-tabs-label {
  margin: 0;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.intern-tabs-help {
  margin: 0;
}

.intern-tab-btn {
  width: 100%;
  justify-content: flex-start;
  gap: 0.4rem;
  min-height: 2.1rem;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.55);
}

.intern-tab-btn:hover {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(15, 23, 42, 0.82);
}

.intern-tab-btn.is-active {
  border-color: rgba(56, 189, 248, 0.7);
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.38), rgba(15, 23, 42, 0.92));
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.18);
}

.intern-tab-btn[data-view="monthly"] {
  border-style: dashed;
}

.intern-tab-btn[data-view="monthly"].is-active {
  border-color: rgba(251, 191, 36, 0.65);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(15, 23, 42, 0.92));
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.2);
}

.intern-panel {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.5);
  padding: 0.8rem;
}

.intern-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 0.55rem;
}

.intern-kpi {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.38);
  padding: 0.55rem;
}

.intern-kpi span {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.intern-kpi strong {
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.intern-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 0.75rem;
}

.intern-overview-card {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.28);
  padding: 0.6rem;
}

.intern-overview-daily-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 0.75rem;
}

.intern-overview-card-wide {
  grid-column: 1 / -1;
}

.stats-table tbody tr.intern-overview-group-week td {
  background: rgba(56, 189, 248, 0.14);
  color: #bae6fd;
  font-weight: 700;
}

.stats-table tbody tr.intern-overview-group-day td {
  background: rgba(15, 23, 42, 0.62);
  color: var(--text-muted);
  font-weight: 600;
}

.intern-entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.intern-form-actions {
  display: flex;
  align-items: flex-end;
}

.intern-timer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 10px;
  background: rgba(14, 165, 233, 0.08);
  margin-bottom: 0.7rem;
}

#intern-timer-state {
  margin-left: auto;
}

#intern-routes-warnings {
  margin-top: 0.55rem;
}

#intern-status {
  margin-bottom: 0.5rem;
}

.intern-skeleton-row td {
  height: 1.9rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  background:
    linear-gradient(
      90deg,
      rgba(148, 163, 184, 0.1) 0%,
      rgba(148, 163, 184, 0.2) 46%,
      rgba(148, 163, 184, 0.1) 100%
    );
  background-size: 220% 100%;
  animation: ordersSkeletonPulse 1.2s ease-in-out infinite;
}

#intern-overview-warnings {
  display: grid;
  gap: 0.4rem;
}

.intern-warning-action {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(56, 189, 248, 0.28);
  background: rgba(15, 23, 42, 0.58);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  cursor: pointer;
}

.intern-warning-action:hover {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(56, 189, 248, 0.12);
}

.stats-table tbody tr.intern-row-highlight td {
  background: rgba(56, 189, 248, 0.14);
}

.intern-monthly-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}

.intern-monthly-team-wrap {
  margin-top: 0.75rem;
}

#intern-monthly-comment.is-readonly {
  opacity: 0.75;
}

#articles-section .articles-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(460px, 1.2fr);
  gap: 14px;
  align-items: start;
}

#articles-section .articles-grid.is-editor-hidden {
  grid-template-columns: 1fr;
}

#articles-section .articles-list-panel,
#articles-section .articles-editor {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.56);
  padding: 12px;
}

#articles-section .articles-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

#articles-section .articles-list-head h4,
#articles-section .articles-editor h4 {
  margin: 0;
  color: #f8fafc;
}

#articles-section .articles-editor > h4 {
  margin-bottom: 0.65rem;
}

#articles-section .articles-toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
  margin-bottom: 0.7rem;
}

#articles-section .articles-filter {
  min-width: 0;
}

#articles-section .articles-list-shell {
  margin-top: 0;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  overflow: auto;
  max-height: 560px;
}

#articles-section .articles-list-shell .stats-table {
  min-width: 720px;
}

#articles-section .articles-list-shell tbody tr {
  cursor: pointer;
}

#articles-section .stats-table tbody tr.is-selected td {
  background: rgba(56, 189, 248, 0.16);
}

#articles-section .articles-editor {
  margin-bottom: 0;
}

#articles-section .articles-actions {
  display: flex;
  gap: 0.45rem;
}

#articles-section .articles-divider {
  margin: 1rem 0;
  border: 0;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

#articles-section .articles-package-editor {
  margin-top: 0.25rem;
}

#articles-section .articles-package-add-wrap {
  display: flex;
  align-items: flex-end;
}

#articles-section .articles-package-items-shell {
  margin-top: 0.6rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  max-height: 280px;
}

#articles-section .articles-package-items-shell .stats-table {
  min-width: 680px;
}

#articles-section .article-no-input {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr);
  gap: 0.45rem;
  align-items: center;
}

#articles-section .article-no-prefix {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.25rem;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 10px;
  color: rgba(148, 163, 184, 0.9);
  background: rgba(2, 6, 23, 0.32);
  font-weight: 700;
}

#articles-section .article-no-digits {
  letter-spacing: 0.06em;
}

@media (max-width: 1080px) {
  #articles-section .articles-grid {
    grid-template-columns: 1fr;
  }

  #articles-section .articles-list-shell {
    max-height: none;
  }

  #articles-section .articles-package-items-shell {
    max-height: none;
  }
}

@media (max-width: 1000px) {
  .intern-kpi-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .intern-overview-grid {
    grid-template-columns: 1fr;
  }

  .intern-overview-daily-grid {
    grid-template-columns: 1fr;
  }

  .intern-overview-card-wide {
    grid-column: auto;
  }

  .intern-tabs {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

@media (max-width: 760px) {
  .stats-table.is-mobile-cards thead {
    display: none;
  }

  .stats-table.is-mobile-cards tbody,
  .stats-table.is-mobile-cards tr,
  .stats-table.is-mobile-cards td {
    display: block;
    width: 100%;
  }

  .stats-table.is-mobile-cards tbody tr {
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 10px;
    background: rgba(2, 6, 23, 0.35);
    margin-bottom: 0.55rem;
    padding: 0.25rem 0;
  }

  .stats-table.is-mobile-cards tbody tr.intern-overview-group-week,
  .stats-table.is-mobile-cards tbody tr.intern-overview-group-day {
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 0;
    background: transparent;
  }

  .stats-table.is-mobile-cards tbody tr.intern-overview-group-week td::before,
  .stats-table.is-mobile-cards tbody tr.intern-overview-group-day td::before {
    content: "";
  }

  .stats-table.is-mobile-cards td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    white-space: normal;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.2);
  }

  .stats-table.is-mobile-cards td:last-child {
    border-bottom: none;
  }

  .stats-table.is-mobile-cards td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-size: 0.76rem;
    min-width: 40%;
    margin-right: 0.4rem;
  }
}

@media (max-width: 700px) {
  .intern-tabs {
    grid-template-columns: 1fr;
  }

  #articles-section .articles-toolbar {
    grid-template-columns: 1fr;
  }
}

.orders-items-header {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.order-items-layout {
  margin-top: 0.75rem;
  display: block;
}

.order-items-main {
  min-width: 0;
}

#order-modal .order-items-main .table-wrapper {
  max-height: clamp(320px, 48vh, 620px);
  overflow-y: auto;
  overflow-x: hidden;
}

.order-suggestions-drawer {
  margin-top: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.35);
  padding: 0.35rem 0.6rem;
}

.order-suggestions-drawer > summary {
  cursor: pointer;
  list-style: none;
  font-weight: 600;
}

.order-suggestions-drawer > summary::-webkit-details-marker {
  display: none;
}

.order-suggestions-panel {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.45);
  padding: 0.75rem;
  margin-top: 0.55rem;
}

.order-suggestions-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.order-suggestions-tabs {
  margin-top: 0.55rem;
  gap: 0.35rem;
}

.order-suggestions-tabs .btn {
  padding-left: 0.55rem;
  padding-right: 0.55rem;
}

.order-suggestions-tabs .btn.is-active {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(56, 189, 248, 0.18);
  color: #e0f2fe;
}

.order-suggestions-list {
  margin-top: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 360px;
  overflow: auto;
  padding-right: 0.15rem;
}

.order-suggestion-card {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.65);
  padding: 0.6rem;
}

.order-suggestion-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.order-suggestion-title {
  margin: 0.35rem 0;
  font-weight: 600;
  line-height: 1.35;
}

.order-suggestion-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.orders-items-table .form-input {
  width: 100%;
}

.orders-items-table .order-item-price,
.orders-items-table .order-item-total {
  text-align: right;
}

.orders-items-table {
  table-layout: fixed;
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
  width: 100%;
}

.orders-items-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(9, 16, 30, 0.96);
}

.orders-items-table th,
.orders-items-table td {
  vertical-align: middle;
  padding: 0.55rem 0.45rem;
}

.orders-items-table td {
  white-space: normal;
}

.orders-items-table th:nth-child(1),
.orders-items-table td:nth-child(1) {
  width: 6%;
  text-align: center;
}

.orders-items-table th:nth-child(2),
.orders-items-table td:nth-child(2) {
  width: 14%;
}

.orders-items-table th:nth-child(3),
.orders-items-table td:nth-child(3) {
  width: 31%;
  white-space: normal;
  line-height: 1.35;
}

.orders-items-table th:nth-child(4),
.orders-items-table td:nth-child(4) {
  width: 15%;
}

.orders-items-table th:nth-child(5),
.orders-items-table td:nth-child(5) {
  width: 11%;
  text-align: right;
}

.orders-items-table th:nth-child(6),
.orders-items-table td:nth-child(6) {
  width: 7%;
  text-align: center;
}

.orders-items-table th:nth-child(7),
.orders-items-table td:nth-child(7) {
  width: 10%;
  text-align: right;
}

.orders-items-table th:nth-child(8),
.orders-items-table td:nth-child(8) {
  width: 6%;
  text-align: center;
}

.orders-items-table .repeatable-actions {
  justify-content: center;
  margin-top: 0;
}

.orders-items-table .order-item-qty-unit {
  display: grid;
  grid-template-columns: minmax(58px, 0.8fr) minmax(70px, 1fr);
  gap: 0.35rem;
}

.orders-items-table .order-item-qty-unit > * {
  min-width: 0;
}

.orders-items-table .order-item-text {
  min-height: 2.45rem;
  line-height: 1.3;
  resize: vertical;
}

.order-totals {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-end;
  font-variant-numeric: tabular-nums;
}

.order-totals-row,
.order-tax-breakdown {
  width: 320px;
}

.order-discount-details {
  width: 320px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  padding: 0.45rem 0.6rem;
  background: rgba(15, 23, 42, 0.55);
}

.order-discount-details summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.order-discount-details summary::-webkit-details-marker {
  display: none;
}

.order-discount-fields {
  margin-top: 0.55rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}

.order-totals-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.order-totals-row strong {
  font-size: 0.95rem;
}

.order-totals-row-total strong {
  font-size: 1.05rem;
}

.order-tax-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.order-disclaimer {
  margin-top: 0.6rem;
}

.order-modal {
  width: min(1280px, 96vw);
  max-width: 1280px;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#order-modal .modal-body {
  overflow: auto;
  padding-right: 0.2rem;
}

#commercial-editor-modal .modal-content.commercial-editor-modal-content {
  width: min(1280px, 96vw) !important;
  max-width: 1280px !important;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#commercial-editor-modal #commercial-editor-modal-body {
  overflow: auto;
  padding-right: 0.2rem;
}

#commercial-editor-modal #commercial-editor-modal-body .commercial-detail,
#commercial-editor-modal #commercial-editor-modal-body .commercial-contract-editor {
  width: 100%;
  max-width: none;
}

#suppliers-detail-modal .modal-content.suppliers-modal {
  width: min(1280px, 96vw);
  max-width: 1280px;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#suppliers-detail-modal #suppliers-detail-modal-body {
  overflow: auto;
  padding-right: 0.2rem;
}

#orders-section #order-modal.order-modal-inline {
  position: static;
  inset: auto;
  display: block;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: auto;
  margin-top: 0;
  transition: none;
}

#orders-section #order-modal.order-modal-inline .modal-backdrop {
  display: none;
}

#orders-section #order-modal.order-modal-inline .modal-content {
  width: 100%;
  max-width: none;
  max-height: none;
  transform: none;
  opacity: 1;
}

#orders-section #order-modal.order-modal-inline .modal-content.order-modal {
  width: 100%;
  max-width: none;
  max-height: none;
  overflow: visible;
}

#orders-section #order-modal.order-modal-inline #order-form {
  overflow: visible;
}

.order-section-card {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.75);
  margin-bottom: 0.9rem;
}

.order-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.order-section-header h4 {
  margin: 0;
  font-size: 1rem;
}

.order-inline-field {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.order-inline-field .form-input {
  flex: 1;
}

.order-status-badge {
  white-space: nowrap;
}

.order-notes-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.order-tooltip {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}

@media (max-width: 1180px) {
  .order-suggestions-list {
    max-height: 340px;
  }
}

.report-machine-hint {
  margin-top: 0.35rem;
}

.order-auto-banner {
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.08);
  color: var(--text-main);
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  margin-bottom: 0.9rem;
  font-size: 0.85rem;
}

.order-form-pattern-banner {
  border: 1px dashed rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.45);
  color: #cbd5e1;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  margin-bottom: 0.9rem;
  font-size: 0.78rem;
}

.order-create-wizard {
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  background: rgba(14, 165, 233, 0.12);
  margin-bottom: 0.75rem;
  display: grid;
  gap: 0.55rem;
}

.order-create-wizard .chip-row {
  gap: 0.35rem;
}

.order-create-wizard .chip.is-active {
  border-color: rgba(56, 189, 248, 0.65);
  background: rgba(56, 189, 248, 0.22);
  color: #e0f2fe;
}

.priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #111111;
}

.priority-low {
  background: #fef3c7;
}

.priority-medium {
  background: #fed7aa;
}

.priority-high {
  background: #fecaca;
}

.priority-muted {
  background: #e2e8f0;
  color: #475569;
}

@media (max-width: 720px) {
  .stats-filter-bar {
    grid-template-columns: 1fr;
  }

  .stats-filter-actions {
    align-items: stretch;
    justify-self: stretch;
  }

  .stats-filter-buttons {
    flex-direction: column;
  }

  .stats-filter-advanced-wrap {
    grid-template-columns: 1fr;
  }

  .stats-section {
    padding: 0.85rem;
  }

  .stats-card-value {
    font-size: 1.3rem;
  }

  .stats-chart canvas {
    height: 180px;
  }
}

.report-editor-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.report-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.report-step-btn {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(2, 6, 23, 0.4);
  color: var(--text-muted);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  cursor: pointer;
}

.report-step-btn.is-active {
  background: rgba(56, 189, 248, 0.18);
  color: #fff;
  border-color: rgba(56, 189, 248, 0.55);
}

.report-step-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.report-section {
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(2, 6, 23, 0.55);
  padding: 0.75rem 0.9rem;
}

.report-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.report-section-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.report-section-actions .checklist-toggle {
  align-items: center;
}

.report-section-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
}

.report-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.7rem 0.9rem;
  margin-top: 0.6rem;
}

.report-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.report-field .form-input {
  width: 100%;
}

.report-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.checklist {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.checklist-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.65);
}

.checklist-label {
  font-size: 0.85rem;
}

.checklist-toggle {
  display: inline-flex;
  gap: 0.35rem;
}

.check-toggle {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(2, 6, 23, 0.4);
  color: var(--text-muted);
  padding: 0.25rem 0.6rem;
  border-radius: 8px;
  font-size: 0.75rem;
  cursor: pointer;
}

.check-toggle.is-active {
  background: rgba(34, 197, 94, 0.2);
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.5);
}

.check-toggle.is-warning {
  background: rgba(249, 115, 115, 0.15);
  border-color: rgba(249, 115, 115, 0.5);
  color: #fecaca;
}

.repeatable-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.6rem;
}

.repeatable-table th,
.repeatable-table td {
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding: 0.4rem 0.3rem;
  font-size: 0.8rem;
}

.repeatable-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.fem-table-wrapper {
  overflow: auto;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.fem-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.fem-table th,
.fem-table td {
  padding: 0.45rem 0.4rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.fem-table thead th {
  position: sticky;
  top: 0;
  background: rgba(15, 23, 42, 0.95);
  color: #f8fafc;
  z-index: 1;
}

.fem-group-row {
  background: rgba(56, 189, 248, 0.08);
  font-weight: 600;
}

.fem-group-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.fem-group-actions {
  display: flex;
  gap: 0.4rem;
}

.fem-group-actions .btn {
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
}

.fem-table input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: #0ea5e9;
}

.report-step-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
}

.report-step-status {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  align-items: center;
  text-align: center;
}

.report-pdf-preview {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.5);
  padding: 0.6rem;
}

.report-pdf-preview iframe {
  width: 100%;
  height: 360px;
  border: none;
  background: #0b1120;
}

/* Report editor - paper style */
.report-editor {
  background: #ffffff;
  color: #111111;
  border: 1px solid #111111;
  border-radius: 6px;
  padding: 1.2rem 1.4rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.report-editor .btn {
  color: #111111;
  border: 1px solid #111111;
}

.report-editor .btn:disabled,
.report-editor .btn[disabled] {
  opacity: 1;
}

.report-editor .text-muted,
.report-editor .text-dim {
  color: #444444;
}

.report-editor .report-steps {
  gap: 0.35rem;
}

.report-editor .report-step-btn {
  border-color: #111111;
  background: #ffffff;
  color: #111111;
}

.report-editor .report-step-btn.is-active {
  background: #111111;
  color: #ffffff;
  border-color: #111111;
}

.report-step {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.report-step-body > .report-step {
  width: 100%;
}

.report-step-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem 1rem;
}

.report-step-header {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem 1.6rem;
}

.report-step-header .report-section {
  border: none;
  padding: 0;
  background: transparent;
}

.report-step-header .report-section-header {
  background: none;
  border: none;
  padding: 0;
  font-weight: 600;
}

.report-section {
  border: 1px solid #111111;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.report-section-header {
  background: #e5e7eb;
  color: #111111;
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid #111111;
  font-size: 0.85rem;
}

.report-section-toggle {
  color: #555555;
}

.report-section-body {
  padding: 0.45rem 0.6rem;
}

.report-section-checklist .report-section-body {
  padding: 0;
}

.report-section-checklist .checklist.checklist-table {
  border: none;
}

.report-fields {
  grid-template-columns: 1fr;
  gap: 0.45rem;
  margin-top: 0.4rem;
}

.report-field {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 0.6rem;
  align-items: end;
}

.report-field label {
  font-size: 0.8rem;
  color: #111111;
}

.report-field.is-textarea {
  grid-template-columns: 1fr;
}

.report-field.is-textarea label {
  margin-bottom: 0.2rem;
}

.report-editor .report-field .form-input {
  border: none;
  border-bottom: 1px solid #111111;
  border-radius: 0;
  background: transparent;
  color: #111111;
  padding: 0.15rem 0.1rem;
}

.report-editor .report-field textarea.form-input {
  border: 1px solid #111111;
  min-height: 90px;
  padding: 0.4rem 0.5rem;
}

.report-editor .report-field .form-input:focus {
  outline: none;
  box-shadow: none;
}

.report-editor .inline-options.form-input {
  border: none;
  padding: 0;
}

.report-editor .inline-options input[type="radio"] {
  appearance: none;
  width: 14px;
  height: 14px;
  border: 1px solid #111111;
  border-radius: 2px;
  margin-right: 6px;
  position: relative;
}

.report-editor .inline-options input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  inset: 2px;
  background: #111111;
}

.report-editor .inline-options input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin-right: 6px;
  accent-color: #111111;
}

.checklist.checklist-table {
  border: 1px solid #111111;
}

.checklist-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 0;
  padding: 0;
  border: none;
  border-top: 1px solid #111111;
  border-radius: 0;
  background: transparent;
}

.checklist-row.checklist-header {
  background: #e5e7eb;
  font-weight: 600;
  border-top: none;
}

.checklist-cell {
  padding: 0.35rem 0.5rem;
  font-size: 0.78rem;
  color: #111111;
}

.checklist-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem;
}

.report-editor .check-toggle {
  border: 1px solid #111111;
  background: #ffffff;
  color: #111111;
  border-radius: 2px;
  min-width: 34px;
  padding: 0.1rem 0.2rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.report-editor .check-toggle.is-active {
  background: #111111;
  color: #ffffff;
  border-color: #111111;
}

.report-step-footer {
  border-top: 1px solid #111111;
}

.report-master-page {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.report-master-header {
  border: 1px solid #111111;
  padding: 0.6rem 0.7rem;
  --report-accent: #111111;
}

.report-master-header-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.9fr;
  gap: 0.8rem;
  align-items: start;
}

.report-master-company {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 0.6rem;
  align-items: start;
}

.report-master-logo {
  border: 1px solid #111111;
  height: 48px;
  width: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
}

.report-master-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.report-master-company-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.report-master-company-line {
  font-size: 0.75rem;
  color: #333333;
}

.report-master-protocol {
  text-align: center;
}

.report-master-title {
  font-weight: 700;
  font-size: 1.05rem;
}

.report-master-protocol-meta {
  font-size: 0.8rem;
}

.report-master-protocol-norm {
  font-size: 0.72rem;
  color: #333333;
}

.report-master-meta {
  display: grid;
  gap: 0.25rem;
}

.report-line-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.4rem;
  align-items: end;
}

.report-line-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #444444;
}

.report-line-value {
  border-bottom: 1px solid #111111;
  min-height: 16px;
  font-size: 0.8rem;
}

.report-master-accent {
  height: 8px;
  background: var(--report-accent);
  margin-top: 0.5rem;
}

.report-master-divider {
  height: 1px;
  background: #111111;
  margin-top: 0.4rem;
}

.report-master-info {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.report-info-card {
  border: 1px solid #111111;
  padding: 0.5rem;
}

.report-info-title {
  background: #e5e7eb;
  border-bottom: 1px solid #111111;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.3rem 0.4rem;
  margin: -0.5rem -0.5rem 0.4rem;
}

.report-info-card .report-line-row {
  grid-template-columns: 110px 1fr;
}

.report-befund-legend {
  font-size: 0.72rem;
  color: #444444;
  border: 1px dashed #111111;
  padding: 0.35rem 0.5rem;
}

.report-result-blocks {
  display: grid;
  gap: 0.8rem;
}

.report-result-box {
  border: 2px solid #111111;
  padding: 0.6rem;
}

.report-result-title {
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.report-result-options {
  display: grid;
  gap: 0.4rem;
}

.report-result-option {
  border: 1px solid #111111;
  background: #ffffff;
  padding: 0.4rem 0.5rem;
  font-size: 0.82rem;
  cursor: pointer;
}

.report-result-option.is-active {
  background: #111111;
  color: #ffffff;
}

.report-block-title {
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.report-issues-block {
  display: grid;
  gap: 0.5rem;
}

.report-issues-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.report-issues-table th,
.report-issues-table td {
  border: 1px solid #111111;
  padding: 0.35rem 0.4rem;
  vertical-align: top;
}

.report-issues-table th {
  background: #e5e7eb;
  font-weight: 600;
}

.report-issues-table td[data-priority="gering"] {
  background: #fef3c7;
}

.report-issues-table td[data-priority="mittel"] {
  background: #fed7aa;
}

.report-issues-table td[data-priority="hoch"] {
  background: #fecaca;
}

.report-issues-table td[data-priority] {
  color: #111111;
}

.report-issues-table td[data-priority] .form-input {
  background: transparent;
  color: #111111;
}

.report-remarks-block textarea.form-input {
  border: 1px solid #111111;
  border-radius: 0;
  padding: 0.4rem 0.5rem;
  background: #ffffff;
  color: #111111;
}

.report-signature-blocks {
  display: grid;
  gap: 0.6rem;
}

.report-signature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.report-signature-grid .form-input[readonly] {
  background: #f3f4f6;
  color: #111111;
}

.report-master-footer {
  border-top: 1px solid #111111;
  padding-top: 0.35rem;
  font-size: 0.7rem;
  text-align: center;
}

.report-issues {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.report-issue-card {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  padding: 0.6rem;
  background: rgba(15, 23, 42, 0.65);
}

.pdf-preview {
  margin-top: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pdf-settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.pdf-settings-toggle-row .text-muted {
  margin: 0;
}

#settings-report-branding .form-label,
#settings-report-branding [data-role="pdf-settings-root"] .text-muted,
#settings-report-branding [data-role="pdf-settings-root"] .text-dim,
#settings-report-branding .pdf-file-name {
  color: #f8fafc;
}

#permissions-section .settings-inline-action {
  margin-top: 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

#permissions-section .settings-inline-action .text-muted.small {
  margin: 0;
}

#settings-integrations-section .settings-integrations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  align-items: start;
}

#settings-integrations-section .settings-highlight-toggle {
  margin: 0.2rem 0 0.75rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.5);
}

#settings-integrations-section .settings-highlight-toggle .switch-text {
  color: #f8fafc;
  font-weight: 600;
}

#settings-integrations-section .settings-highlight-toggle .text-muted.small {
  margin: 0.45rem 0 0;
}

#settings-integrations-section .settings-integrations-card {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  padding: 0.9rem;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.64), rgba(15, 23, 42, 0.52));
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  box-shadow: 0 4px 18px rgba(2, 6, 23, 0.24);
}

#settings-integrations-section .settings-integrations-card h4 {
  margin: 0 0 0.3rem;
  color: #f8fafc;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
}

#settings-integrations-section .settings-integrations-card .form-group {
  margin-bottom: 0;
}

#settings-integrations-section .settings-integrations-card .form-label {
  color: #f8fafc;
}

#settings-integrations-section .settings-integrations-card .switch .switch-text {
  color: #f8fafc;
}

#settings-integrations-section .settings-checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

#settings-integrations-section .settings-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #f8fafc;
  font-size: 0.85rem;
}

#settings-integrations-section .settings-checkbox input[type="checkbox"] {
  margin: 0;
}

#settings-compliance-card .input-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

#settings-compliance-card #settings-compliance-rule-list {
  min-width: 220px;
  flex: 1 1 220px;
}

#settings-compliance-card #settings-compliance-versions,
#settings-compliance-card #settings-compliance-audit {
  max-height: 180px;
  overflow: auto;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.35);
  padding: 0.45rem 0.5rem;
}

#permissions-section .settings-page-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

#permissions-section .settings-page-nav {
  position: sticky;
  top: 0.8rem;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.56);
  padding: 0.8rem;
  box-shadow: 0 6px 20px rgba(2, 6, 23, 0.28);
}

#permissions-section .settings-page-nav h4 {
  margin: 0 0 0.55rem;
  color: #f8fafc;
  font-size: 0.92rem;
}

#permissions-section .settings-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

#permissions-section .settings-nav-item {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.45);
  color: #e2e8f0;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.86rem;
  font-weight: 600;
  padding: 0.52rem 0.62rem;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

#permissions-section .settings-nav-label {
  min-width: 0;
}

#permissions-section .settings-nav-state {
  margin-left: auto;
  border-radius: 999px;
  padding: 0.12rem 0.42rem;
  border: 1px solid rgba(148, 163, 184, 0.36);
  background: rgba(51, 65, 85, 0.45);
  color: #cbd5e1;
  font-size: 0.66rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

#permissions-section .settings-nav-state.is-ok {
  border-color: rgba(134, 239, 172, 0.5);
  background: rgba(34, 197, 94, 0.16);
  color: #bbf7d0;
}

#permissions-section .settings-nav-state.is-dirty {
  border-color: rgba(251, 191, 36, 0.6);
  background: rgba(251, 191, 36, 0.16);
  color: #fde68a;
}

#permissions-section .settings-nav-state.is-warning {
  border-color: rgba(248, 113, 113, 0.62);
  background: rgba(248, 113, 113, 0.16);
  color: #fecaca;
}

#permissions-section .settings-nav-item:hover {
  border-color: rgba(148, 163, 184, 0.42);
  background: rgba(51, 65, 85, 0.36);
  transform: translateX(1px);
}

#permissions-section .settings-nav-item:focus-visible {
  outline: 2px solid rgba(45, 212, 191, 0.7);
  outline-offset: 1px;
}

#permissions-section .settings-nav-item.is-active {
  border-color: rgba(45, 212, 191, 0.7);
  background: rgba(15, 118, 110, 0.25);
  color: #f8fafc;
}

#permissions-section .settings-page-main {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
}

#permissions-section .settings-sticky-header {
  position: sticky;
  top: 0.5rem;
  z-index: 6;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.9);
  backdrop-filter: blur(6px);
  padding: 0.7rem 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  box-shadow: 0 8px 20px rgba(2, 6, 23, 0.34);
}

#permissions-section .settings-sticky-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

#permissions-section .settings-dirty-indicator {
  color: #86efac;
}

#permissions-section .settings-dirty-indicator.is-dirty {
  color: #fca5a5;
}

#permissions-section .settings-sticky-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

#permissions-section #settings-sticky-save,
#permissions-section #settings-sticky-reset {
  min-width: 122px;
}

#permissions-section .settings-more-wrap {
  position: relative;
}

#permissions-section .settings-more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 210px;
  background: rgba(2, 6, 23, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 10px;
  padding: 0.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.45);
}

#permissions-section .settings-more-menu button {
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #e2e8f0;
  text-align: left;
  padding: 0.42rem 0.54rem;
  cursor: pointer;
  font-size: 0.82rem;
}

#permissions-section .settings-more-menu button:hover {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(51, 65, 85, 0.35);
}

#permissions-section .settings-toolbar {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.5);
  padding: 0.72rem 0.85rem;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 0.65rem;
  align-items: end;
}

#permissions-section .settings-page-panels {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

#permissions-section .settings-panel-card {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  padding: 0.95rem;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.66), rgba(15, 23, 42, 0.54));
  box-shadow: 0 4px 18px rgba(2, 6, 23, 0.2);
}

#permissions-section .settings-page-panels > .card,
#permissions-section .settings-page-panels > .settings-panel-card {
  scroll-margin-top: 120px;
  animation: settingsPanelFadeIn 220ms ease;
}

#permissions-section .settings-page-panels > .card .card-header h3,
#permissions-section .settings-page-panels > .settings-panel-card h3 {
  letter-spacing: 0.01em;
}

#permissions-section .settings-page-panels .form-label {
  font-weight: 600;
}

#permissions-section .settings-page-panels .form-group + .form-group {
  margin-top: 0.1rem;
}

#permissions-section .settings-filter-hidden {
  display: none !important;
}

#permissions-section .settings-advanced-block {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 10px;
  padding: 0.52rem 0.62rem;
  background: rgba(2, 6, 23, 0.35);
}

#permissions-section .settings-advanced-block summary {
  cursor: pointer;
  color: #e2e8f0;
  font-weight: 600;
  font-size: 0.84rem;
}

#permissions-section .settings-advanced-block[open] summary {
  margin-bottom: 0.45rem;
}

#permissions-section .settings-preview-line {
  margin-top: 0.34rem;
  padding: 0.3rem 0.45rem;
  border-left: 2px solid rgba(45, 212, 191, 0.55);
  background: rgba(15, 118, 110, 0.08);
  border-radius: 0 8px 8px 0;
}

#permissions-section .settings-role-badge {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0.3rem;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #cbd5e1;
  background: rgba(51, 65, 85, 0.35);
}

#permissions-section .settings-card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

#permissions-section .settings-card-actions .btn {
  min-width: 168px;
}

#permissions-section .settings-field-error {
  margin-top: 0.22rem;
  font-size: 0.76rem;
  color: #fda4af;
  line-height: 1.3;
}

#permissions-section .form-input.is-invalid {
  border-color: rgba(248, 113, 113, 0.9);
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.25);
}

@keyframes settingsPanelFadeIn {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#commercial-offer-margin-warning {
  margin-top: 0.45rem;
}

/* Commercial */
#commercial-section .commercial-tabs,
#orders-section .commercial-tabs {
  display: flex;
  gap: 10px;
  margin: 4px 0 14px;
  flex-wrap: wrap;
}

#commercial-section .commercial-panel,
#orders-section .commercial-panel {
  margin-bottom: 14px;
}

#commercial-section .commercial-toolbar,
#orders-section .commercial-toolbar {
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
  margin-bottom: 0.9rem;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  transform: none;
  opacity: 1;
  pointer-events: auto;
  max-height: none;
  overflow: visible;
  z-index: auto;
}

#commercial-section .commercial-grid,
#orders-section .commercial-grid {
  display: grid;
  grid-template-columns: minmax(300px, var(--commercial-split-left, 36%)) 10px minmax(520px, 1fr);
  gap: 14px;
}

#commercial-section .commercial-grid.is-list-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

#commercial-section .commercial-grid.is-list-collapsed > .commercial-list,
#commercial-section .commercial-grid.is-list-collapsed > .split-resizer {
  display: none;
}

#commercial-section .commercial-grid.is-editor-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

#commercial-section .commercial-grid.is-editor-collapsed > .commercial-detail,
#commercial-section .commercial-grid.is-editor-collapsed > .commercial-contract-editor,
#commercial-section .commercial-grid.is-editor-collapsed > .split-resizer {
  display: none;
}

#commercial-section .commercial-list,
#commercial-section .commercial-detail,
#orders-section .commercial-list,
#orders-section .commercial-detail {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.56);
  padding: 12px;
}

#commercial-section .commercial-list-head,
#orders-section .commercial-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.editor-context-header {
  position: sticky;
  top: 0;
  z-index: 4;
  margin: -0.2rem -0.2rem 0.7rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.84);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.editor-context-main {
  min-width: 0;
  display: grid;
  gap: 0.3rem;
}

.editor-context-topline {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.editor-context-subline {
  display: flex;
  gap: 0.4rem 0.8rem;
  flex-wrap: wrap;
  color: #cbd5e1;
  font-size: 0.78rem;
}

.editor-context-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.editor-save-state {
  font-size: 0.72rem;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
}

.editor-save-state.is-dirty {
  border-color: rgba(251, 191, 36, 0.5);
  background: rgba(251, 191, 36, 0.16);
  color: #fde68a;
}

.editor-save-state.is-saving {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(56, 189, 248, 0.15);
  color: #bae6fd;
}

.editor-save-state.is-saved {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.14);
  color: #bbf7d0;
}

.context-more-menu {
  position: relative;
}

.context-more-menu > summary {
  list-style: none;
}

.context-more-menu > summary::-webkit-details-marker {
  display: none;
}

.context-more-list {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  min-width: 190px;
  display: grid;
  gap: 0.25rem;
  padding: 0.4rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.98);
  box-shadow: 0 14px 28px rgba(2, 6, 23, 0.5);
}

.editor-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}

.editor-tabs .btn.is-active {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(56, 189, 248, 0.14);
  color: #e0f2fe;
}

.orders-detail-tab-panel {
  display: grid;
  gap: 0.65rem;
}

.orders-detail-tab-panel.hidden {
  display: none;
}

.row-action-menu {
  position: relative;
}

.row-action-menu > summary {
  list-style: none;
  padding: 0.05rem 0.35rem;
  min-width: 2.1rem;
}

.row-action-menu > summary::-webkit-details-marker {
  display: none;
}

.row-action-list {
  position: absolute;
  right: 0;
  top: calc(100% + 0.25rem);
  z-index: 6;
  min-width: 170px;
  display: grid;
  gap: 0.22rem;
  padding: 0.35rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(2, 6, 23, 0.98);
}

.editor-block-title {
  margin: 0.3rem 0 0.35rem;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #94a3b8;
}

.commercial-secondary-actions {
  margin: 0.35rem 0 0.6rem;
}

.commercial-sticky-totals {
  position: sticky;
  top: 0.4rem;
}

#commercial-section .commercial-positions-card .table-wrapper,
#orders-section .commercial-positions-card .table-wrapper {
  max-height: clamp(320px, 46vh, 580px);
  overflow: auto;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  margin-top: 0.45rem;
}

#commercial-section .commercial-positions-card .repeatable-table,
#orders-section .commercial-positions-card .repeatable-table {
  margin-top: 0;
  min-width: 1140px;
  table-layout: fixed;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

#commercial-section .commercial-positions-card .repeatable-table thead th,
#orders-section .commercial-positions-card .repeatable-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(9, 16, 30, 0.96);
}

#commercial-section .commercial-positions-card .repeatable-table th,
#commercial-section .commercial-positions-card .repeatable-table td,
#orders-section .commercial-positions-card .repeatable-table th,
#orders-section .commercial-positions-card .repeatable-table td {
  padding: 0.55rem 0.45rem;
}

#commercial-section .commercial-positions-card .repeatable-table td {
  white-space: nowrap;
}

#orders-section .commercial-positions-card .repeatable-table td {
  white-space: nowrap;
}

#commercial-section .commercial-positions-card .repeatable-table th:nth-child(1),
#commercial-section .commercial-positions-card .repeatable-table td:nth-child(1),
#orders-section .commercial-positions-card .repeatable-table th:nth-child(1),
#orders-section .commercial-positions-card .repeatable-table td:nth-child(1) {
  width: 5%;
  text-align: center;
}

#commercial-section .commercial-positions-card .repeatable-table th:nth-child(2),
#commercial-section .commercial-positions-card .repeatable-table td:nth-child(2),
#orders-section .commercial-positions-card .repeatable-table th:nth-child(2),
#orders-section .commercial-positions-card .repeatable-table td:nth-child(2) {
  width: 11%;
}

#commercial-section .commercial-positions-card .repeatable-table th:nth-child(3),
#commercial-section .commercial-positions-card .repeatable-table td:nth-child(3),
#orders-section .commercial-positions-card .repeatable-table th:nth-child(3),
#orders-section .commercial-positions-card .repeatable-table td:nth-child(3) {
  width: 30%;
  white-space: normal;
  line-height: 1.35;
}

#commercial-section .commercial-positions-card .repeatable-table th:nth-child(4),
#commercial-section .commercial-positions-card .repeatable-table td:nth-child(4),
#orders-section .commercial-positions-card .repeatable-table th:nth-child(4),
#orders-section .commercial-positions-card .repeatable-table td:nth-child(4) {
  width: 8%;
  text-align: right;
}

#commercial-section .commercial-positions-card .repeatable-table th:nth-child(5),
#commercial-section .commercial-positions-card .repeatable-table td:nth-child(5),
#orders-section .commercial-positions-card .repeatable-table th:nth-child(5),
#orders-section .commercial-positions-card .repeatable-table td:nth-child(5) {
  width: 7%;
  text-align: center;
}

#commercial-section .commercial-positions-card .repeatable-table th:nth-child(6),
#commercial-section .commercial-positions-card .repeatable-table td:nth-child(6),
#orders-section .commercial-positions-card .repeatable-table th:nth-child(6),
#orders-section .commercial-positions-card .repeatable-table td:nth-child(6) {
  width: 12%;
  text-align: right;
}

#commercial-section .commercial-positions-card .repeatable-table th:nth-child(7),
#commercial-section .commercial-positions-card .repeatable-table td:nth-child(7),
#orders-section .commercial-positions-card .repeatable-table th:nth-child(7),
#orders-section .commercial-positions-card .repeatable-table td:nth-child(7) {
  width: 7%;
  text-align: center;
}

#commercial-section .commercial-positions-card .repeatable-table th:nth-child(8),
#commercial-section .commercial-positions-card .repeatable-table td:nth-child(8),
#orders-section .commercial-positions-card .repeatable-table th:nth-child(8),
#orders-section .commercial-positions-card .repeatable-table td:nth-child(8) {
  width: 12%;
  text-align: right;
}

#commercial-section .commercial-positions-card .repeatable-table th:nth-child(9),
#commercial-section .commercial-positions-card .repeatable-table td:nth-child(9),
#orders-section .commercial-positions-card .repeatable-table th:nth-child(9),
#orders-section .commercial-positions-card .repeatable-table td:nth-child(9) {
  width: 8%;
  text-align: center;
}

.post-form-section {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.45);
  padding: 0.35rem 0.75rem 0.75rem;
}

.post-form-section[open] {
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(56, 189, 248, 0.28);
}

.post-form-section > summary {
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  color: var(--text);
  padding: 0.35rem 0;
}

.post-form-section > summary::-webkit-details-marker {
  display: none;
}

.post-form-section > .form-label:first-of-type,
.post-form-section > .form-grid:first-of-type {
  margin-top: 0.2rem;
}

.post-form-section + .post-form-section {
  margin-top: 0.55rem;
}

#commercial-section .commercial-list .orders-table-shell {
  max-height: calc(100vh - 19rem);
}

.side-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.66);
  backdrop-filter: blur(2px);
  z-index: 140;
}

.side-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(480px, 100vw);
  height: 100vh;
  z-index: 141;
  border-left: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 0;
  background: rgba(2, 6, 23, 0.98);
  padding: 0.9rem;
  overflow: auto;
  box-shadow: -20px 0 40px rgba(2, 6, 23, 0.52);
}

.side-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

#commercial-section .commercial-pricing {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.56);
  padding: 12px;
}

#commercial-section tr.is-selected td {
  background: rgba(56, 189, 248, 0.16);
}

#commercial-section .form-grid {
  margin-bottom: 8px;
}

#commercial-section .commercial-list h4,
#commercial-section .commercial-detail h4,
#commercial-section .commercial-pricing h4,
#orders-section .commercial-list h4,
#orders-section .commercial-detail h4 {
  margin: 0;
  color: #f8fafc;
}

#commercial-section .form-label,
#commercial-section .text-muted {
  color: #cbd5e1;
}

#commercial-section .orders-table-shell,
#orders-section .orders-table-shell {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  overflow: auto;
}

#commercial-section .orders-table thead th,
#orders-section .orders-table thead th {
  color: #cbd5e1;
}

#commercial-section .orders-table tbody td,
#orders-section .orders-table tbody td {
  color: #f8fafc;
}

#commercial-section .orders-table tbody tr:hover td,
#orders-section .orders-table tbody tr:hover td {
  background: rgba(56, 189, 248, 0.08);
}

#commercial-section .commercial-header .eyebrow,
#orders-section .commercial-header .eyebrow {
  letter-spacing: 0.08em;
}

#commercial-section .commercial-header .orders-header-actions,
#orders-section .commercial-header .orders-header-actions {
  align-items: center;
}

#orders-section .orders-layout {
  align-items: start;
  grid-template-columns: minmax(0, 1fr);
}

#orders-section #orders-layout > .split-resizer {
  display: none;
}

#orders-section .orders-table {
  min-width: 760px;
}

#orders-section .orders-table th:nth-child(1),
#orders-section .orders-table td:nth-child(1),
#orders-section .orders-table th:nth-child(2),
#orders-section .orders-table td:nth-child(2),
#orders-section .orders-table th:nth-child(3),
#orders-section .orders-table td:nth-child(3),
#orders-section .orders-table th:nth-child(4),
#orders-section .orders-table td:nth-child(4) {
  width: auto;
  text-align: left;
}

#orders-section .orders-table tbody tr.is-active {
  box-shadow: none;
}

#commercial-section .commercial-contract-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#commercial-section .commercial-contract-summary {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  padding: 10px;
  background: rgba(2, 6, 23, 0.45);
  position: sticky;
  top: 72px;
  z-index: 2;
}

#commercial-section .commercial-contract-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#commercial-section .commercial-contract-summary-head strong {
  color: #f8fafc;
}

#commercial-section .commercial-contract-tabbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  background: rgba(2, 6, 23, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  padding: 8px;
  padding-bottom: 8px;
  position: sticky;
  top: 216px;
  z-index: 1;
}

#commercial-section .commercial-service-plan {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  padding: 10px;
  background: rgba(2, 6, 23, 0.45);
}

#commercial-section .commercial-service-plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

#commercial-section .commercial-service-plan-head h5 {
  margin: 0;
  color: #f8fafc;
}

#commercial-section .commercial-service-plan-kpis {
  margin-top: 8px;
}

#commercial-section .commercial-service-plan-kpis .chip {
  border-color: rgba(148, 163, 184, 0.24);
}

#commercial-section .commercial-service-plan-table-wrap {
  max-height: 280px;
  margin-top: 8px;
}

#commercial-section .commercial-service-plan-table-wrap .orders-table {
  min-width: 640px;
}

#order-service-package {
  min-width: 220px;
}

#order-service-package-status {
  margin-top: 6px;
}

#commercial-section .commercial-contract-tabs .btn.is-active {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.35);
}

#commercial-section .contract-advanced-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #cbd5e1;
  font-size: 0.85rem;
}

#commercial-section .contract-advanced-toggle input[type="checkbox"] {
  margin: 0;
}

#commercial-section .contract-tab-panel {
  display: block;
}

#commercial-section .contract-tab-panels {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#commercial-section #commercial-contract-editor-body .form-grid {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

#commercial-section #commercial-contract-editor-body .contract-head-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

#commercial-section .contract-tab-panel.hidden {
  display: none;
}

#commercial-section .contract-accordion {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.42);
  padding: 0.35rem 0.6rem;
  margin-bottom: 8px;
}

#commercial-section .contract-accordion summary {
  cursor: pointer;
  color: #e2e8f0;
  font-weight: 600;
  list-style: none;
}

#commercial-section .contract-accordion summary::-webkit-details-marker {
  display: none;
}

#commercial-section .contract-accordion > div,
#commercial-section .contract-accordion > .form-grid {
  margin-top: 8px;
}

#commercial-section .contract-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.65);
  color: #e2e8f0;
  font-size: 0.82rem;
}

#commercial-section .contract-chip button {
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

#commercial-section .contract-inline-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

#commercial-section .contract-list-editor {
  margin-bottom: 10px;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.35);
}

#commercial-section .contract-list-editor .form-input {
  min-width: 120px;
}

#commercial-section .contract-type-hidden {
  display: none !important;
}

#orders-section .orders-container {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

#orders-section .orders-detail-panel {
  position: relative;
  top: 0;
  max-height: none;
  overflow: auto;
}

#orders-section .orders-toolbar {
  margin-bottom: 0.9rem;
}

@media (max-width: 1080px) {
  #commercial-section .commercial-grid,
  #orders-section .commercial-grid {
    grid-template-columns: 1fr;
  }

  #commercial-section .commercial-grid > .split-resizer {
    display: none;
  }
}

@media (max-width: 900px) {
  #commercial-section .commercial-toolbar,
  #orders-section .commercial-toolbar {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    padding: 0;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 860px) {
  #commercial-section .commercial-contract-summary {
    position: static;
  }

  #commercial-section .commercial-contract-tabbar {
    position: static;
    top: auto;
  }

  #commercial-section #commercial-contract-editor-body .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .editor-context-header {
    position: static;
  }

  .editor-context-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .side-panel {
    width: 100vw;
  }

  #permissions-section .settings-page-shell {
    grid-template-columns: 1fr;
  }

  #permissions-section .settings-page-nav {
    position: static;
    padding: 0.5rem;
  }

  #permissions-section .settings-nav-list {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 0.2rem;
  }

  #permissions-section .settings-nav-item {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  #permissions-section .settings-sticky-header {
    position: static;
    flex-direction: column;
    align-items: stretch;
  }

  #permissions-section .settings-sticky-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  #permissions-section .settings-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  #permissions-section #settings-sticky-save,
  #permissions-section #settings-sticky-reset {
    min-width: 0;
  }

  #permissions-section .settings-card-actions .btn {
    min-width: 0;
    width: 100%;
  }
}

#settings-report-branding .form-input,
#report-branding-card .form-input {
  color: #f8fafc;
}

#settings-report-branding .form-input::placeholder,
#report-branding-card .form-input::placeholder {
  color: rgba(226, 232, 240, 0.7);
}

#report-branding-card .form-label,
#report-branding-card [data-role="pdf-settings-root"] .text-muted,
#report-branding-card [data-role="pdf-settings-root"] .text-dim,
#report-branding-card .pdf-file-name {
  color: #e2e8f0;
}

.pdf-file-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.2rem;
}

.pdf-file-name {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pdf-export-btn {
  color: #0f172a;
}

.pdf-export-btn:hover {
  color: #0f172a;
}

.pdf-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.pdf-preview-canvas {
  position: relative;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #f8fafc;
  border-radius: 10px;
  overflow: hidden;
}

.pdf-preview-safe {
  position: absolute;
  inset: 8%;
  border: 1px dashed rgba(14, 165, 233, 0.5);
  border-radius: 8px;
}

.pdf-preview-logo {
  position: absolute;
  object-fit: contain;
}

@media (max-width: 980px) {
  .report-layout {
    grid-template-columns: 1fr;
  }
  .report-step-grid,
  .report-step-header {
    grid-template-columns: 1fr;
  }
  .report-master-header-top,
  .report-master-info,
  .report-signature-grid {
    grid-template-columns: 1fr;
  }
  .report-step-footer {
    position: sticky;
    bottom: 0;
    background: #ffffff;
    border-radius: 6px;
    padding: 0.6rem;
  }
  .report-fields {
    grid-template-columns: 1fr;
  }
  .check-toggle {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }
}

/* Termine */
.machine-detail-header-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.6rem;
}

.machine-due-meta {
  margin-top: 0.6rem;
}

.due-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.8rem;
  margin-top: 0.8rem;
}

.due-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--dur-fast) ease, transform var(--dur-fast) ease;
}

.due-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-1px);
}

.due-card.is-active {
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.2);
}

.due-card-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.due-card-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.due-filter-bar {
  display: grid;
  grid-template-columns: minmax(240px, 1.7fr) auto;
  gap: 0.75rem;
  padding: 0.8rem;
  border-radius: 16px;
  background: rgba(148, 163, 184, 0.08);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.12);
  align-items: end;
  margin-top: 0.8rem;
}

.due-filter {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.due-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
  align-items: center;
}

.due-filter-advanced-wrap {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(170px, 1fr));
  gap: 0.75rem;
}

.due-view-bar {
  margin-top: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.due-view-toggle {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.due-view-actions {
  display: flex;
  align-items: flex-end;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.due-view-select {
  min-width: 170px;
}

.due-view-toggle .btn.is-active {
  border-color: rgba(56, 189, 248, 0.6);
  background: rgba(56, 189, 248, 0.15);
  color: var(--text);
}

.due-calendar-connect {
  margin-top: 0.8rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(2, 6, 23, 0.55);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.due-calendar-connect-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.due-calendar-connect-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.input-row .form-input {
  flex: 1;
}

.due-calendar {
  margin-top: 0.8rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(2, 6, 23, 0.55);
}

.due-calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.due-calendar-title {
  font-weight: 600;
}

.due-calendar-nav {
  display: flex;
  gap: 0.35rem;
}

.due-calendar-legend {
  display: flex;
  align-items: center;
  gap: 0.4rem 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.due-calendar-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.73rem;
  color: var(--text-muted);
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.55);
}

.due-calendar-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.due-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 0.6rem;
}

.due-calendar-weekday {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  padding: 0 0.2rem;
}

.due-calendar-day {
  min-height: 120px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.5);
  padding: 0.5rem 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.due-calendar-day.is-outside {
  opacity: 0.45;
}

.due-calendar-day.is-today {
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.2);
}

.due-calendar-date {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
}

.due-calendar-events {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.due-calendar-event {
  font-size: 0.72rem;
  border-radius: 8px;
  padding: 0.25rem 0.4rem;
  border-left: 3px solid var(--event-color, rgba(56, 189, 248, 0.6));
  color: var(--text);
  cursor: pointer;
  transition: transform 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.due-calendar-event:hover {
  transform: translateY(-1px);
}

.due-calendar-more {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.due-list {
  margin-top: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.due-table {
  display: grid;
  gap: 0.35rem;
}

.due-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) minmax(120px, 0.9fr) minmax(140px, 0.9fr) minmax(120px, 0.6fr) auto;
  gap: 0.6rem;
  align-items: center;
  background: rgba(2, 6, 23, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.due-row:hover {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(15, 23, 42, 0.75);
  transform: translateY(-1px);
}

.due-row-head {
  background: transparent;
  border: 1px dashed rgba(148, 163, 184, 0.25);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
  color: var(--text-dim);
  cursor: default;
}

.due-row-head:hover {
  transform: none;
  background: transparent;
  border-color: rgba(148, 163, 184, 0.25);
}

.due-col {
  font-size: 0.86rem;
  color: var(--text);
}

.due-col-title {
  font-weight: 600;
}

.due-col-date {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-start;
}

.due-date-value {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.due-col-actions {
  display: flex;
  justify-content: flex-end;
}

.due-item {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(180px, 0.6fr) auto;
  gap: 0.8rem;
  align-items: center;
  background: rgba(2, 6, 23, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
}

.due-item-title {
  font-weight: 600;
}

.due-item-meta {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 0.2rem;
}

.due-item-details {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-start;
}

.due-item-date {
  font-size: 0.85rem;
  font-weight: 600;
}

.due-item-source {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.due-item-actions {
  display: flex;
  align-items: center;
}

.due-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.due-badge.overdue {
  background: #fecaca;
  color: #7f1d1d;
}

.due-badge.soon {
  background: #fed7aa;
  color: #9a3412;
}

.due-badge.planned {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text);
}

@media (max-width: 1100px) {
  .due-filter-bar {
    grid-template-columns: 1fr;
  }

  .due-filter-actions {
    justify-content: flex-start;
  }

  .due-filter-advanced-wrap {
    grid-template-columns: 1fr;
  }

  .due-row {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .due-row-head {
    display: none;
  }

  .due-item {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .due-col-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .due-item-actions {
    width: 100%;
    justify-content: flex-start;
  }

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

  .due-calendar-grid {
    min-width: 720px;
  }
}

@media (max-width: 720px) {
  .due-calendar-grid {
    min-width: 640px;
  }

  .due-calendar-day {
    min-height: 100px;
  }
}

/* Responsive base settings */
@media (max-width: 1100px) {
  .app-main {
    padding: 1.25rem;
  }

  .app-wrapper {
    gap: 1rem;
  }

  .content {
    padding: 1.25rem;
  }

  .sidebar {
    padding: 1rem 0.8rem;
  }
}

@media (max-width: 900px) {
  .app-header {
    padding: 0.6rem 1rem;
  }

  .app-main {
    padding-bottom: calc(4.9rem + env(safe-area-inset-bottom));
  }

  .app-title {
    font-size: 1.05rem;
  }

  .nav-link {
    font-size: 0.95rem;
  }

  .nav-section-title {
    font-size: 0.72rem;
  }
}

@media (max-width: 720px) {
  .user-info {
    font-size: 0.85rem;
    margin-right: 0.4rem;
  }

  .search-input-field {
    min-height: 2.65rem;
    font-size: 0.94rem;
  }

  .search-shortcut {
    display: none;
  }

  .card {
    padding: 1rem;
  }

  .btn-sm,
  .orders-quick-chip,
  .nav-link {
    min-height: 2.5rem;
  }

  .sidebar,
  .content {
    border-radius: 12px;
  }

  .modal-content {
    width: calc(100% - 1.2rem);
    max-height: calc(100vh - 1.2rem);
    padding: 1rem;
    border-radius: 12px;
  }

  .app-footer {
    flex-direction: column;
    text-align: center;
    gap: 0.3rem;
  }

  input,
  select,
  textarea,
  button {
    font-size: 16px;
  }

  .machine-nameplate-actions .btn {
    flex: 1 1 100%;
  }
}

@media (max-width: 480px) {
  .app-main {
    padding: 0.8rem;
    padding-bottom: calc(4.9rem + env(safe-area-inset-bottom));
  }

  .content {
    padding: 0.9rem;
  }

  .nav-link {
    padding: 0.5rem 0.7rem;
    margin-left: 0.2rem;
  }

  .mobile-bottom-nav-btn {
    font-size: 0.7rem;
  }

  .nav-section-title {
    margin-top: 0.4rem;
  }

  .modal-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}
