:root {
  --cream: #f2ebdc;
  --cream-deep: #e6dcc8;
  --ivory: #fffaf0;
  --porcelain: #fffdf7;
  --ink: #2b2118;
  --muted: #756b61;
  --line: rgba(42, 57, 76, 0.12);
  --blue: #0a4d90;
  --blue-2: #1e6cb6;
  --blue-3: #073a6e;
  --blue-soft: #dbeaf7;
  --pearl-button: #d9b8ae;
  --pearl-button-2: #efd8d3;
  --pearl-button-3: #c79c94;
  --pearl-glow: rgba(202, 158, 148, 0.34);
  --orange: #c77926;
  --red: #c64a4a;
  --shadow: 18px 18px 38px rgba(99, 85, 58, 0.17), -13px -13px 30px rgba(255, 255, 255, 0.86);
  --shadow-small: 10px 10px 22px rgba(99, 85, 58, 0.14), -8px -8px 18px rgba(255, 255, 255, 0.82);
  --inset: inset 8px 8px 18px rgba(99, 85, 58, 0.12), inset -8px -8px 18px rgba(255, 255, 255, 0.78);
  --glow: 0 0 0 3px rgba(255, 255, 255, 0.75), 0 0 24px var(--pearl-glow), var(--shadow-small);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 6%, rgba(19, 90, 168, 0.16), transparent 28rem),
    radial-gradient(circle at 92% 12%, rgba(199, 121, 38, 0.11), transparent 24rem),
    linear-gradient(135deg, var(--ivory), var(--cream) 48%, #eee3cf);
  font-family: "Satoshi", "Inter", "Aptos", "Segoe UI Variable Display", "Avenir Next", sans-serif;
  overflow-x: hidden;
}

img {
  max-width: 100%;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.15) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.13) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.5), transparent 72%);
}

a {
  color: inherit;
  text-decoration: none;
}

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

button,
.main-nav a,
.icon-button,
.btn-primary,
.btn-secondary,
.mini-icon,
.side-menu a,
.segmented a,
.segmented button,
.table-actions a {
  border: 0;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, color 160ms ease;
}

button:hover,
.main-nav a:hover,
.icon-button:hover,
.btn-primary:hover,
.btn-secondary:hover,
.mini-icon:hover,
.side-menu a:hover,
.segmented a:hover,
.segmented button:hover,
.table-actions a:hover {
  box-shadow: var(--glow);
}

button:active,
.main-nav a:active,
.icon-button:active,
.btn-primary:active,
.btn-secondary:active,
.mini-icon:active,
.side-menu a:active,
.segmented a:active,
.segmented button:active,
.table-actions a:active {
  transform: translateY(1px);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.82), 0 0 34px rgba(19, 90, 168, 0.42), var(--inset);
}

.desktop-app,
.auth-shell {
  position: relative;
  z-index: 1;
}

.app-header,
.search-row,
.message-stack,
.page-shell {
  width: min(1280px, calc(100vw - 48px));
  margin: 0 auto;
}

.app-header {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) auto auto;
  align-items: center;
  gap: clamp(12px, 1.8vw, 26px);
  padding: 34px 0 20px;
}

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

.brand-logo-shell {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.6vw, 22px);
  width: clamp(390px, 42vw, 580px);
  min-width: 0;
  min-height: 112px;
  padding: 14px clamp(18px, 2vw, 30px) 14px 18px;
  border-radius: 34px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(237, 228, 211, 0.62));
  box-shadow: var(--shadow-small);
}

.brand-logo-shell.large {
  width: 170px;
  min-height: 96px;
}

.brand-logo-shell img {
  width: clamp(160px, 15vw, 215px);
  height: auto;
  display: block;
  object-fit: contain;
}

.brand-pearl {
  flex: 0 0 clamp(12px, 1.2vw, 18px);
  width: clamp(12px, 1.2vw, 18px);
  height: clamp(12px, 1.2vw, 18px);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.1) 30%, transparent 44%),
    radial-gradient(circle at 62% 68%, #c58e96, #ead0cb 58%, #a57178);
  box-shadow: 0 10px 20px rgba(161, 98, 108, 0.28), inset 0 2px 5px rgba(255, 255, 255, 0.65);
}

.brand small,
.eyebrow {
  display: block;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand strong {
  display: block;
  margin-top: 3px;
  font-size: clamp(1.35rem, 2.2vw, 1.9rem);
  font-family: "Space Grotesk", "Satoshi", "Inter", sans-serif;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
  padding: 10px;
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.68);
  box-shadow: var(--inset);
}

.main-nav a,
.segmented a,
.segmented button,
.table-actions a,
.side-menu a {
  border-radius: 999px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(235, 226, 210, 0.78));
  box-shadow: var(--shadow-small);
  color: var(--ink);
  font-weight: 650;
}

.main-nav a {
  padding: 13px clamp(14px, 1.5vw, 24px);
  white-space: nowrap;
}

.main-nav a.is-active,
.segmented .is-active,
.table-actions .is-active,
.side-menu a.is-active {
  color: #46342e;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0) 30%),
    linear-gradient(145deg, var(--pearl-button-2), var(--pearl-button-3));
  box-shadow: 0 14px 28px rgba(84, 73, 58, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.42), inset 0 -8px 16px rgba(53, 45, 35, 0.2);
}

.header-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(145deg, #fffdf7, #eadfca);
  box-shadow: var(--shadow-small);
  color: var(--ink);
  font-size: 0;
}

.notification-button::before {
  content: "";
  width: 17px;
  height: 17px;
  border: 2px solid currentColor;
  border-radius: 12px 12px 8px 8px;
  box-shadow: 0 8px 0 -5px currentColor;
  opacity: 0.72;
}

.settings-button::before {
  content: "\2699";
  font-size: 20px;
  line-height: 1;
  opacity: 0.72;
}

.logout-button::before {
  content: "\23FB";
  font-size: 23px;
  line-height: 1;
  opacity: 0.72;
}

.icon-button b {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 2px 5px;
  border-radius: 999px;
  background: var(--red);
  color: white;
  font-size: 0.68rem;
  line-height: 16px;
  box-shadow: var(--shadow-small);
}

.logout-link {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.notification-drawer {
  position: relative;
}

.notification-drawer summary {
  list-style: none;
}

.notification-drawer summary::-webkit-details-marker {
  display: none;
}

.drawer-panel {
  position: absolute;
  right: 0;
  top: 60px;
  width: min(360px, calc(100vw - 48px));
  z-index: 5;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 250, 240, 0.96);
  box-shadow: var(--shadow);
}

.drawer-panel h2 {
  margin: 0 0 8px;
}

.drawer-item {
  display: grid;
  gap: 5px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.drawer-item span,
.drawer-item small,
.muted,
.notice,
.empty-state {
  color: var(--muted);
}

.search-row {
  padding: 4px 0 14px;
}

.global-search {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 12px 16px 12px 22px;
  border-radius: 30px;
  background: rgba(255, 250, 240, 0.74);
  box-shadow: var(--inset);
}

.global-search label {
  color: var(--blue);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 0;
  outline: none;
  color: var(--ink);
  background: rgba(255, 253, 247, 0.68);
}

input,
select {
  min-height: 46px;
  border-radius: 16px;
  padding: 0 16px;
  box-shadow: var(--inset);
}

textarea {
  resize: vertical;
  border-radius: 18px;
  padding: 15px 16px;
  box-shadow: var(--inset);
}

.global-search input {
  background: transparent;
  box-shadow: none;
  font-style: italic;
}

.global-search input::placeholder {
  color: rgba(117, 107, 97, 0.72);
  font-style: italic;
}

.prediction-panel {
  position: absolute;
  z-index: 8;
  left: 92px;
  right: 78px;
  top: calc(100% + 8px);
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 22px;
  background: rgba(241, 230, 216, 0.88);
  box-shadow: var(--shadow-small);
  backdrop-filter: blur(12px);
}

.global-search:focus-within .prediction-panel {
  display: grid;
}

.prediction-panel button {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 253, 247, 0.58);
  box-shadow: var(--inset);
  font-size: 0.76rem;
  font-weight: 500;
  text-align: left;
}

.global-search button,
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #46342e;
  border-radius: 999px;
  padding: 13px 22px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0) 30%),
    linear-gradient(145deg, var(--pearl-button-2), var(--pearl-button-3));
  box-shadow: 0 16px 30px rgba(84, 73, 58, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.42), inset 0 -10px 18px rgba(53, 45, 35, 0.22);
  font-weight: 750;
}

.global-search > button.search-submit,
.btn-primary.compact {
  min-width: 64px;
  min-height: 46px;
  padding: 12px 18px;
}

.global-search > button.search-submit span {
  display: none;
}

.btn-primary::before,
.global-search > button::before {
  content: "↗";
  color: currentColor;
  opacity: 0.42;
  font-size: 0.95em;
  line-height: 1;
}

.btn-primary.compact::before,
.global-search > button::before {
  content: "⌕";
}

.prediction-panel button {
  color: var(--muted);
  background: rgba(255, 253, 247, 0.58);
  box-shadow: var(--inset);
  font-size: 0.76rem;
  font-weight: 500;
  text-align: left;
}

.btn-primary.compact {
  min-width: 58px;
  padding-inline: 18px;
}

button:disabled,
.btn-primary:disabled {
  cursor: wait;
  opacity: 0.58;
  filter: saturate(0.75);
  box-shadow: var(--inset);
}

@keyframes sync-spin {
  to {
    transform: rotate(360deg);
  }
}

.btn-secondary {
  border-radius: 999px;
  padding: 12px 20px;
  color: var(--ink);
  background: linear-gradient(145deg, #fffdf7, #eadfca);
  box-shadow: var(--shadow-small);
  font-weight: 700;
}

.as-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  text-align: center;
  white-space: normal;
}

.message-stack {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.message {
  margin: 0;
  padding: 14px 18px;
  border-radius: 18px;
  color: var(--ink);
  background: rgba(255, 250, 240, 0.88);
  box-shadow: var(--shadow-small);
}

.message.error {
  color: #7b2626;
  background: #f6d6d6;
}

.message.success {
  color: #234d2c;
  background: #dff2df;
}

.page-shell {
  padding: 26px 0 72px;
}

.hero-card,
.soft-card,
.kpi-card,
.folder-card {
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 32px;
  background: linear-gradient(145deg, rgba(255, 253, 247, 0.9), rgba(235, 226, 210, 0.72));
  box-shadow: var(--shadow);
}

.hero-card,
.soft-card {
  padding: 24px;
}

.dashboard-card {
  display: grid;
  gap: 22px;
}

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

h1 {
  margin-bottom: 10px;
  font-size: clamp(1.85rem, 3.8vw, 3.2rem);
  line-height: 1;
  letter-spacing: -0.045em;
  font-weight: 650;
}

h2 {
  margin-bottom: 10px;
  font-size: 1.25rem;
  letter-spacing: -0.025em;
  font-weight: 650;
}

p {
  line-height: 1.55;
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.compact-header {
  align-items: center;
}

.compact-header h2 {
  margin: 0;
}

.panel-layout,
.settings-layout,
.archive-layout,
.detail-layout {
  display: grid;
  gap: 24px;
}

.panel-layout {
  grid-template-columns: 310px minmax(0, 1fr);
}

.settings-layout,
.archive-layout {
  grid-template-columns: 250px minmax(0, 1fr);
}

.detail-layout {
  grid-template-columns: minmax(0, 1fr) 330px;
  align-items: start;
}

.detail-layout-single {
  grid-template-columns: minmax(0, 1fr);
}

.control-rail,
.side-menu,
.detail-main,
.document-sidebar,
.archive-main,
.dashboard-card,
.table-card {
  min-width: 0;
}

.control-rail,
.side-menu,
.detail-main,
.document-sidebar,
.archive-main {
  display: grid;
  gap: 18px;
  align-content: start;
}

.primary-action h2,
.task-extract h2 {
  font-size: 1.55rem;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.sync-card {
  position: relative;
  display: grid;
  gap: 8px;
}

.sync-card strong {
  font-size: 1.1rem;
  font-weight: 650;
}

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

.sync-live-indicator {
  position: absolute;
  right: 22px;
  top: 22px;
  display: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(217, 184, 174, 0.25);
  box-shadow: var(--inset);
}

.sync-live-indicator span {
  position: absolute;
  inset: 8px;
  border: 3px solid rgba(70, 52, 46, 0.18);
  border-top-color: rgba(70, 52, 46, 0.7);
  border-radius: 50%;
  animation: sync-spin 0.85s linear infinite;
}

.sync-card.is-syncing .sync-live-indicator {
  display: block;
}

.sync-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.sync-progress span {
  padding: 8px;
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 253, 247, 0.58);
  box-shadow: var(--inset);
  font-size: 0.68rem;
}

.sync-progress b {
  color: var(--ink);
}

.segmented,
.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}

.no-wrap-menu {
  flex-wrap: nowrap;
  min-width: 0;
}

.period-menu {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(360px, 100%);
}

.delegation-menu {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.delegation-menu a,
.period-menu a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 8px 8px;
  font-size: 0.66rem;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
}

.segmented a,
.segmented button,
.table-actions a {
  padding: 10px 15px;
}

.segmented button {
  color: var(--ink);
}

.subdued {
  padding: 10px;
  border-radius: 24px;
  background: rgba(255, 250, 240, 0.45);
  box-shadow: var(--inset);
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.kpi-card {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 118px;
  padding: 18px;
  color: var(--ink);
  overflow: hidden;
}

.kpi-card::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 16px;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  color: currentColor;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.56), rgba(230, 218, 200, 0.36));
  box-shadow: var(--shadow-small);
  opacity: 0.24;
  font-size: 2rem;
  font-weight: 500;
}

.kpi-icon-euro::before {
  content: "€";
}

.kpi-icon-checklist::before {
  content: "✓";
}

.kpi-icon-report::before {
  content: "□";
}

.kpi-icon-certificate::before {
  content: "◇";
}

.kpi-icon-upload::before {
  content: "↑";
}

.kpi-icon-client::before {
  content: "○";
}

.kpi-card span {
  margin-left: 66px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.detail-kpi-row .kpi-card {
  place-items: center;
  text-align: center;
}

.detail-kpi-row .kpi-card::before {
  opacity: 0.12;
}

.detail-kpi-row .kpi-card span,
.detail-kpi-row .kpi-card strong {
  margin-left: 0;
}

.kpi-card strong {
  margin-left: 66px;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  line-height: 1;
  letter-spacing: -0.06em;
  font-weight: 650;
}

.kpi-compare {
  align-self: end;
  justify-self: end;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.2;
  text-align: right;
}

.kpi-compare b {
  color: #398346;
  font-weight: 700;
  margin-right: 5px;
}

.panel-card-compact {
  gap: 14px;
  padding: 20px;
}

.panel-card-compact h1 {
  font-size: clamp(1.55rem, 2.8vw, 2.25rem);
  margin-bottom: 5px;
}

.panel-card-compact p {
  margin-bottom: 0;
  font-size: 0.86rem;
}

.compact-kpi-row {
  gap: 12px;
}

.compact-kpi-row .kpi-card {
  min-height: 86px;
  padding: 14px 16px;
  border-radius: 24px;
}

.compact-kpi-row .kpi-card,
.compact-kpi-row .kpi-card span,
.compact-kpi-row .kpi-card strong {
  text-align: center;
}

.compact-kpi-row .kpi-card::before {
  width: 42px;
  height: 42px;
  font-size: 1.45rem;
}

.compact-kpi-row .kpi-card span {
  margin-left: 52px;
  font-size: 0.62rem;
}

.compact-kpi-row .kpi-card strong {
  margin-left: 52px;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
}

.compact-kpi-row .kpi-compare {
  font-size: 0.58rem;
}

.primary-action,
.task-extract {
  position: relative;
  overflow: hidden;
}

.primary-action::before,
.task-extract::before {
  position: absolute;
  right: 18px;
  top: 18px;
  color: currentColor;
  opacity: 0.14;
  font-size: 2.2rem;
  line-height: 1;
  pointer-events: none;
}

.primary-action::before {
  content: "↻";
}

.task-extract::before {
  content: "⌕";
}

.compact-activity-grid {
  gap: 12px;
}

.activity-card {
  padding: 14px;
  border-radius: 24px;
}

.activity-card h2 {
  font-size: 0.94rem;
}

.activity-card .status-pill,
.activity-card a {
  font-size: 0.62rem;
}

.activity-card .timeline-row {
  padding: 7px 0;
  gap: 2px;
  font-size: 0.72rem;
}

.activity-card .timeline-row strong {
  font-size: 0.69rem;
  font-weight: 650;
}

.activity-card .timeline-row span,
.activity-card .timeline-row small {
  font-size: 0.68rem;
  line-height: 1.25;
}

.accent-warm strong {
  color: var(--orange);
}

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

.inset-card {
  box-shadow: var(--inset);
  background: rgba(255, 250, 240, 0.54);
}

.timeline-row,
.document-row {
  display: grid;
  gap: 5px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.timeline-row span,
.timeline-row small,
.document-row span {
  color: var(--muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 30px;
  padding: 7px 13px;
  border-radius: 999px;
  color: #44677f;
  background: var(--blue-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-pill.danger {
  color: #953535;
  background: #f4d5d5;
}

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

.folder-only-layout {
  grid-template-columns: minmax(190px, 230px) minmax(0, 1fr);
}

.folder-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.folder-toolbar h1 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 3.2vw, 2.8rem);
}

.folder-rail {
  gap: 8px;
  padding: 16px;
}

.folder-rail span {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255, 250, 240, 0.46);
  font-size: 0.82rem;
  font-weight: 500;
}

.folder-rail span.is-active {
  color: white;
  background: linear-gradient(145deg, var(--pearl-button-2), var(--pearl-button-3));
  box-shadow: var(--shadow-small);
}

.windows-folder-grid {
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 22px;
}

.windows-folder-card {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  align-items: center;
  gap: 22px;
  min-height: 118px;
  padding: 24px;
  border-radius: 26px;
}

.windows-folder-card::before {
  display: none;
}

.windows-folder-card strong {
  margin-top: 0;
  font-size: 1.06rem;
  font-weight: 700;
}

.folder-icon {
  position: relative;
  width: 74px;
  height: 58px;
  border-radius: 12px 16px 14px 14px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.75), rgba(230, 218, 200, 0.55));
  box-shadow: var(--inset), 0 8px 20px rgba(99, 85, 58, 0.1);
}

.folder-icon::before {
  content: "";
  position: absolute;
  left: 7px;
  top: -8px;
  width: 36px;
  height: 18px;
  border-radius: 12px 12px 0 0;
  background: inherit;
  box-shadow: inherit;
}

.folder-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.folder-copy small {
  color: var(--muted);
  font-size: 0.84rem;
}

.folder-copy em {
  width: fit-content;
  margin-top: 5px;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 750;
}

.folder-card {
  position: relative;
  display: grid;
  align-content: space-between;
  min-height: 170px;
  padding: 26px;
  overflow: hidden;
}

.folder-card::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 24px;
  width: 78px;
  height: 18px;
  border-radius: 14px 14px 0 0;
  background: rgba(19, 90, 168, 0.14);
}

.folder-card strong {
  position: relative;
  margin-top: 26px;
  font-size: 1.18rem;
  font-weight: 650;
}

.folder-card small {
  color: var(--muted);
  line-height: 1.45;
}

.side-menu {
  position: sticky;
  top: 18px;
}

.side-menu a {
  padding: 14px 16px;
}

.settings-side {
  gap: 12px;
}

.settings-menu {
  display: grid;
  gap: 7px;
}

.settings-menu a {
  width: 100%;
  min-height: 0;
  padding: 9px 11px;
  border-radius: 14px;
  font-size: 0.78rem;
  line-height: 1.18;
  white-space: normal;
}

.table-card {
  overflow-x: auto;
  scrollbar-width: thin;
}

.table-card > table {
  min-width: 760px;
}

.table-actions {
  margin-bottom: 14px;
}

table {
  width: 100%;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0 10px;
  table-layout: fixed;
}

th,
td {
  padding: 13px 14px;
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
  word-break: normal;
  white-space: normal;
}

th {
  color: #416d8d;
  background: rgba(219, 234, 247, 0.78);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-right: 1px solid rgba(65, 109, 141, 0.12);
  overflow-wrap: normal;
  word-break: normal;
}

td {
  background: rgba(255, 253, 247, 0.72);
  border-top: 1px solid rgba(42, 57, 76, 0.08);
  border-bottom: 1px solid rgba(42, 57, 76, 0.08);
  border-right: 1px solid rgba(42, 57, 76, 0.08);
}

th:first-child,
td:first-child {
  border-top-left-radius: 15px;
  border-bottom-left-radius: 15px;
}

th:last-child,
td:last-child {
  border-top-right-radius: 15px;
  border-bottom-right-radius: 15px;
  border-right: 0;
}

.link-strong {
  color: var(--blue);
  font-weight: 650;
}

.breadcrumb-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-weight: 600;
}

.breadcrumb-bar a {
  color: var(--blue);
}

.breadcrumb-bar span::before,
.breadcrumb-bar strong::before,
.breadcrumb-bar a + a::before {
  content: "/";
  margin-right: 9px;
  color: var(--muted);
}

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

.info-grid div {
  display: grid;
  gap: 5px;
  min-height: 88px;
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 253, 247, 0.72);
  box-shadow: var(--inset);
}

.info-grid span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.info-grid strong {
  overflow-wrap: anywhere;
}

.document-sidebar {
  position: sticky;
  top: 18px;
  min-width: 0;
}

.document-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
}

.discount-card {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(42, 57, 76, 0.1);
}

.discount-card h3 {
  margin: 0;
  font-size: 1.15rem;
}

.discount-form {
  display: grid;
  gap: 12px;
}

.discount-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 650;
}

.discount-form input {
  width: 100%;
  min-height: 44px;
}

.document-row > div,
.document-row span,
.document-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.document-row.static {
  grid-template-columns: 1fr;
}

.pdf-preview-card {
  display: grid;
  gap: 16px;
}

.pdf-preview-frame {
  width: 100%;
  min-height: min(78vh, 820px);
  border: 0;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--inset);
}

.icon-cluster {
  display: flex;
  gap: 8px;
}

.mini-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 14px;
  color: var(--blue);
  background: linear-gradient(145deg, #fffdf7, #eadfca);
  box-shadow: var(--shadow-small);
  font-size: 0.78rem;
  font-weight: 700;
}

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

.attachment-card {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 253, 247, 0.72);
  box-shadow: var(--inset);
}

.attachment-thumb {
  display: block;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow-small);
}

.attachment-card img {
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  display: block;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.68);
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  padding: 24px;
}

.image-lightbox:target {
  display: grid;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(38, 30, 25, 0.64);
  backdrop-filter: blur(8px);
}

.image-lightbox figure {
  position: relative;
  z-index: 1;
  width: min(980px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  margin: 0;
  padding: 18px;
  border-radius: 30px;
  background: rgba(255, 250, 240, 0.96);
  box-shadow: var(--shadow);
}

.image-lightbox figure img {
  width: 100%;
  max-height: calc(100vh - 150px);
  object-fit: contain;
  border-radius: 20px;
  background: white;
}

.image-lightbox figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-weight: 650;
  overflow-wrap: anywhere;
}

.lightbox-close {
  position: absolute;
  right: 22px;
  top: 22px;
  padding: 9px 12px;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 253, 247, 0.86);
  box-shadow: var(--shadow-small);
  font-size: 0.78rem;
  font-weight: 750;
}

.attachment-card span,
.attachment-card small {
  color: var(--muted);
}

.settings-form,
.document-editor {
  display: grid;
  gap: 18px;
}

.settings-form label,
.document-editor label,
.form-card label,
.task-extract label,
.admin-gate label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 650;
}

fieldset {
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 0;
  border: 0;
}

fieldset:disabled {
  opacity: 0.58;
}

.settings-main {
  min-width: 0;
}

.settings-empty {
  min-height: 520px;
  align-content: start;
}

.price-grid,
.log-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 16px;
}

.price-card,
.terms-card,
.recipient-card {
  min-width: 0;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 253, 247, 0.68);
  box-shadow: var(--inset);
}

.price-card strong,
.recipient-card strong {
  color: var(--blue);
  overflow-wrap: anywhere;
}

.price-card .section-header {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.price-card input,
.price-card textarea,
.price-card select,
.terms-card textarea,
.recipient-card input,
.recipient-card select {
  min-width: 0;
}

.price-card span,
.terms-card small,
.recipient-card small,
.settings-form small {
  color: var(--muted);
}

.compact-grid {
  display: grid;
  grid-template-columns: 1.618fr 1fr;
  gap: 12px;
}

.report-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.recipient-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.recipient-list.full {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.admin-table-card {
  max-width: 100%;
  overflow-x: auto;
}

.admin-price-table,
.report-recipient-table {
  table-layout: fixed;
}

.admin-price-table textarea,
.admin-price-table input,
.report-recipient-table input,
.report-recipient-table select {
  width: 100%;
}

.admin-price-table td,
.report-recipient-table td {
  font-size: 0.78rem;
}

.admin-price-table small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.62rem;
}

.dense-textarea {
  min-height: 54px;
  font-size: 0.7rem;
  line-height: 1.2;
  resize: vertical;
}

.price-name-col {
  width: 22%;
}

.price-text-col {
  width: 42%;
}

.price-current-col {
  width: 110px;
}

.price-number-col {
  width: 110px;
}

.price-unit-col {
  width: 74px;
}

.price-active-col,
.recipient-active-col {
  width: 74px;
}

.recipient-index-col {
  width: 50px;
}

.recipient-filter-col {
  width: 150px;
}

.recipient-delegation-col {
  width: 220px;
}

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

.price-current {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  padding: 0 12px;
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 253, 247, 0.58);
  box-shadow: var(--inset);
  font-weight: 700;
}

.pdf-editor-shell {
  display: grid;
  gap: 22px;
}

.pdf-editor-card {
  display: grid;
  gap: 16px;
}

.pdf-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.pdf-toolbar .btn-secondary.is-active {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0) 30%),
    linear-gradient(145deg, var(--pearl-button-2), var(--pearl-button-3));
  box-shadow: var(--glow);
}

.pdf-editor-status {
  padding: 12px 16px;
  border-radius: 18px;
  color: var(--muted);
  background: rgba(255, 253, 247, 0.7);
  box-shadow: var(--inset);
  font-size: 0.88rem;
}

.pdf-workbench {
  max-width: 100%;
  max-height: 78vh;
  overflow: auto;
  padding: 24px;
  border-radius: 28px;
  background: rgba(219, 207, 187, 0.42);
  box-shadow: var(--inset);
}

.pdf-page-stage {
  position: relative;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 18px 40px rgba(41, 35, 27, 0.22);
}

.pdf-page-stage canvas {
  display: block;
}

.pdf-overlay-layer {
  position: absolute;
  inset: 0;
  cursor: crosshair;
}

.pdf-overlay-item {
  position: absolute;
  min-width: 36px;
  min-height: 20px;
  padding: 2px 4px;
  border: 1px dashed rgba(10, 77, 144, 0.28);
  border-radius: 4px;
  background: rgba(255, 250, 240, 0.08);
  cursor: move;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.pdf-overlay-item:focus,
.pdf-overlay-item.is-selected {
  outline: 2px solid rgba(10, 77, 144, 0.38);
  background: rgba(255, 250, 240, 0.35);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.5);
}

.commercial-filters {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(180px, 1.2fr) minmax(160px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin: 4px 0 12px;
}

.commercial-filters label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.toggle-line {
  display: flex !important;
  grid-template-columns: none !important;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 18px;
  background: rgba(255, 250, 240, 0.6);
  box-shadow: var(--inset);
}

.toggle-line input[type="checkbox"] {
  width: 46px;
  min-height: 24px;
  accent-color: var(--blue);
  box-shadow: none;
}

.large-toggle {
  min-height: 62px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.auth-shell {
  width: min(1120px, calc(100vw - 48px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  align-content: center;
  padding: 42px 0;
}

.auth-messages {
  width: 100%;
  margin-bottom: 18px;
}

.login-panel {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 26px;
  align-items: stretch;
}

.login-hero {
  min-height: 560px;
  display: grid;
  align-content: center;
  gap: 18px;
}

.login-hero h1 {
  max-width: 650px;
}

.login-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.login-proof span {
  padding: 10px 13px;
  border-radius: 999px;
  color: var(--blue);
  background: var(--blue-soft);
  font-weight: 650;
}

.form-card {
  display: grid;
  gap: 18px;
  align-content: center;
}

.mobile-status-only {
  display: none;
  padding: 24px;
}

@media (max-width: 1280px) {
  .app-header,
  .search-row,
  .message-stack,
  .page-shell {
    width: min(1180px, calc(100vw - 40px));
  }

  .brand-logo-shell {
    width: clamp(390px, 42vw, 540px);
  }

  .panel-layout {
    grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  }

  .windows-folder-grid {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }
}

@media (max-width: 1040px) {
  .app-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }

  .brand-logo-shell {
    width: min(100%, 430px);
    min-height: 90px;
    padding: 10px 16px;
  }

  .brand-logo-shell img {
    width: clamp(130px, 17vw, 175px);
  }

  .brand strong {
    font-size: clamp(1.1rem, 2vw, 1.45rem);
  }

  .main-nav {
    grid-column: 1 / -1;
    justify-self: stretch;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    padding: 7px;
  }

  .main-nav a {
    padding: 10px 12px;
    font-size: 0.82rem;
  }

  .header-actions {
    justify-self: end;
  }

  .panel-layout,
  .settings-layout,
  .archive-layout,
  .detail-layout,
  .login-panel {
    grid-template-columns: 1fr;
  }

  .document-sidebar,
  .side-menu {
    position: static;
  }

  .kpi-row,
  .split-grid,
  .info-grid,
  .recipient-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .delegation-menu a {
    font-size: 0.56rem;
    padding-inline: 4px;
  }

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

  .folder-only-layout {
    grid-template-columns: 1fr;
  }

  .folder-rail {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

  .app-header,
  .search-row,
  .message-stack,
  .page-shell {
    width: min(100% - 32px, 720px);
  }

  .global-search {
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 12px;
  }

  .global-search label {
    grid-column: 1 / -1;
  }

  .main-nav,
  .header-actions {
    justify-self: start;
  }

  .prediction-panel {
    left: 10px;
    right: 10px;
  }

  .kpi-row,
  .split-grid,
  .info-grid,
  .recipient-list,
  .commercial-filters,
  .windows-folder-grid {
    grid-template-columns: 1fr;
  }

  .section-header {
    display: grid;
    gap: 14px;
  }

  .period-menu {
    width: 100%;
  }

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

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

  .icon-cluster {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

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

  .windows-folder-card {
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 16px;
    min-height: 104px;
  }
}

@media (max-width: 430px) {
  .app-header,
  .search-row,
  .message-stack,
  .page-shell {
    width: min(100% - 24px, 406px);
  }

  .hero-card,
  .soft-card {
    padding: 18px;
    border-radius: 26px;
  }

  .brand-logo-shell {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    width: 100%;
    min-height: 88px;
    gap: 8px;
  }

  .brand-logo-shell img {
    width: 140px;
  }

  .brand strong {
    font-size: 1.08rem;
    white-space: normal;
    line-height: 1.05;
  }

  .header-actions {
    justify-self: stretch;
    justify-content: center;
  }

  .main-nav a {
    padding: 10px 7px;
    font-size: 0.78rem;
  }

  .global-search {
    border-radius: 24px;
  }

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

  h1 {
    font-size: clamp(1.65rem, 12vw, 2.4rem);
  }

  .folder-rail {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 390px) {
  .app-header,
  .search-row,
  .message-stack,
  .page-shell {
    width: min(100% - 20px, 370px);
  }

  .brand-logo-shell img {
    width: 124px;
  }

  .brand-pearl {
    width: 11px;
    height: 11px;
  }

  .main-nav {
    gap: 4px;
  }

  .main-nav a {
    font-size: 0.72rem;
    padding-inline: 5px;
  }

  .global-search > button.search-submit,
  .btn-primary.compact {
    min-width: 52px;
    padding-inline: 13px;
  }
}
