@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap');

/* =========================================================
   LIVARO
   REFINED UI SYSTEM
========================================================= */

:root {
  --bg: #f5f7f5;
  --surface: #ffffff;
  --surface-soft: #f8faf8;
  --surface-hover: #f3f7f4;

  --text: #17231e;
  --text-soft: #66746d;
  --text-light: #8a958f;

  --green: #183d2e;
  --green-hover: #214d3b;
  --green-light: #eaf3ed;
  --green-medium: #4f7562;

  --border: #dde5e0;
  --border-soft: #edf1ee;

  --red: #a74438;
  --red-light: #fbecea;

  --orange: #946a20;
  --orange-light: #fff4df;

  --blue: #3f6475;
  --blue-light: #eaf2f5;

  --radius-small: 10px;
  --radius: 14px;
  --radius-large: 18px;

  --shadow:
    0 1px 2px rgba(20, 35, 29, 0.018),
    0 8px 24px rgba(20, 35, 29, 0.03);

  --shadow-hover:
    0 2px 4px rgba(20, 35, 29, 0.025),
    0 10px 28px rgba(20, 35, 29, 0.045);
}

/* =========================================================
   RESET
========================================================= */

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);

  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.6;
}

input,
textarea,
select {
  color: var(--text);
}

#app,
.backend-shell {
  min-height: 100vh;
}

/* =========================================================
   TYPOGRAPHY
========================================================= */

h1,
h2,
h3 {
  font-family: Manrope, sans-serif;
  color: var(--text);
}

h1 {
  margin: 6px 0 10px;
  font-size: clamp(36px, 4vw, 54px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

h2 {
  margin: 4px 0 8px;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

h3 {
  letter-spacing: -0.015em;
}

p {
  line-height: 1.6;
}

.muted {
  color: var(--text-soft);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green-medium);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* =========================================================
   TOP BAR
========================================================= */

.topbar {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(24px, 5vw, 72px);
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.brand-button {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--text);
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--green);
  color: white;
  font-family: Manrope, sans-serif;
  font-weight: 800;
}

.brand-copy {
  display: grid;
  gap: 1px;
  text-align: left;
}

.brand-copy strong {
  font-family: Manrope, sans-serif;
  font-size: 15px;
  letter-spacing: 0.1em;
}

.brand-copy small {
  color: var(--text-light);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

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

.security-indicator {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
}

.security-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4c9168;
  box-shadow: 0 0 0 4px #e8f3ec;
}

/* =========================================================
   BUTTONS
========================================================= */

.primary,
.ghost,
.back-button {
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  padding: 9px 14px;
  font-weight: 700;

  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.primary {
  background: var(--green);
  color: white;
  box-shadow: 0 3px 10px rgba(24, 61, 46, 0.1);
}

.primary:hover:not(:disabled) {
  background: var(--green-hover);
  transform: translateY(-1px);
}

.ghost {
  background: var(--green-light);
  color: var(--green);
}

.ghost:hover:not(:disabled) {
  background: #deebe3;
}

.compact {
  min-height: 35px;
  padding: 7px 11px;
  font-size: 11px;
}

.full {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.button-plus {
  margin-right: 5px;
  font-size: 18px;
  font-weight: 400;
}

/* =========================================================
   LOGIN / ERROR
========================================================= */

.login-page,
.error-page {
  min-height: calc(100vh - 66px);
  display: grid;
  place-items: center;
  padding: 40px 20px;
}

.auth-card {
  width: min(500px, 100%);
  padding: 38px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.auth-logo {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  border-radius: 13px;
  background: var(--green);
  color: white;
  font-family: Manrope, sans-serif;
  font-size: 20px;
  font-weight: 800;
}

.auth-card h1 {
  font-size: clamp(34px, 5vw, 48px);
}

.auth-description {
  margin-bottom: 28px;
}

.auth-card form {
  display: grid;
  gap: 17px;
}

.auth-card label {
  display: grid;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
}

.auth-card input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #ccd5cf;
  border-radius: 10px;
  background: white;
  outline: none;
}

.auth-card input:focus {
  border-color: #759582;
  box-shadow: 0 0 0 3px rgba(79, 117, 98, 0.09);
}

.auth-security {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
  color: var(--text-light);
  font-size: 10px;
}

.auth-security span {
  margin-right: 5px;
  color: #4c9168;
}

.error-symbol {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 12px;
  background: var(--red-light);
  color: var(--red);
  font-weight: 800;
}

/* =========================================================
   MAIN DASHBOARD
========================================================= */

.dash {
  width: min(1240px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 48px 0 80px;
}

.dashboard-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 26px;
}

.dashboard-heading h1 {
  font-size: clamp(36px, 4vw, 50px);
}

.dashboard-heading .muted {
  margin: 0;
  font-size: 14px;
}

.upload-shortcut {
  flex: 0 0 auto;
  margin-bottom: 4px;
}

/* =========================================================
   NOTICE / ERRORS
========================================================= */

.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  padding: 11px 14px;
  background: var(--green-light);
  color: #295840;
  border: 1px solid #d8e6dc;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.notice-icon {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: 11px;
}

.notice > span:nth-child(2) {
  flex: 1;
}

.notice button {
  border: 0;
  background: transparent;
  color: var(--green-medium);
  font-size: 19px;
}

.error {
  margin-top: 10px;
  color: var(--red);
  font-size: 12px;
}

.error-notice {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 20px;
  padding: 15px 17px;
  background: var(--red-light);
  color: var(--red);
  border: 1px solid #f1d7d2;
  border-radius: 12px;
  font-size: 12px;
}

/* =========================================================
   STAT CARDS
========================================================= */

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

.stat {
  min-height: 116px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 17px;
  text-align: left;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);

  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.stat:hover {
  transform: translateY(-1px);
  border-color: #cbd8d0;
  box-shadow: var(--shadow-hover);
}

.stat-label {
  margin-bottom: 10px;
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 700;
}

.stat strong {
  margin-bottom: 7px;
  font-family: Manrope, sans-serif;
  font-size: 29px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.stat small {
  color: var(--text-light);
  font-size: 9px;
}

.stat-review strong {
  color: var(--orange);
}

.stat-confirmed strong {
  color: #387253;
}

.stat-failed strong {
  color: var(--red);
}

.stat-processing strong {
  color: var(--blue);
}

/* =========================================================
   PANELS
========================================================= */

.panel {
  padding: 22px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.panel-heading h2 {
  margin-bottom: 0;
}

.panel-badge {
  flex: 0 0 auto;
  padding: 5px 8px;
  background: var(--surface-soft);
  color: var(--text-light);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
}

/* =========================================================
   ACTION OVERVIEW
========================================================= */

.action-overview-panel {
  margin-bottom: 20px;
  border-color: #e6dfcf;
  background: linear-gradient(135deg, #ffffff 0%, #fffdf8 100%);
}

.action-overview-list {
  display: grid;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  overflow: hidden;
}

.action-overview-item {
  width: 100%;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 14px;
  background: white;
  color: var(--text);
  border: 0;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  transition: background 0.15s ease;
}

.action-overview-item:last-child {
  border-bottom: 0;
}

.action-overview-item:hover {
  background: var(--surface-hover);
}

.action-overview-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.action-overview-main strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-overview-main span {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.now-panel {
  margin-bottom: 22px;
  border-color: #d7c7a4;
}

.now-panel h2 {
  font-size: 1.7rem;
}

.now-group + .now-group {
  margin-top: 16px;
}

.now-origin {
  display: block;
  margin-top: 2px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
}

.now-calendar {
  margin-top: 14px;
}

.now-calendar .muted {
  margin: 0;
}

.reminder-setting {
  margin-top: 16px;
}

.reminder-setting label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 600;
}

.reminder-setting .muted {
  margin-top: 6px;
}

.action-date-badge {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  width: fit-content;
  padding: 5px 8px;
  background: #eef1ef;
  color: var(--text-soft);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.action-date-overdue {
  background: var(--red-light);
  color: var(--red);
}

.action-date-today {
  background: #fff0e8;
  color: #a64f25;
}

.action-date-urgent,
.action-date-soon {
  background: var(--orange-light);
  color: var(--orange);
}

.action-date-upcoming {
  background: #f5f0e5;
  color: #816529;
}

.action-date-future {
  background: var(--green-light);
  color: var(--green-medium);
}

.deadline-overview-panel .deadline-group + .deadline-group {
  margin-top: 16px;
}

/* =========================================================
   UPLOAD / WORKSPACE
========================================================= */

.workspace-grid {
  display: grid;
  grid-template-columns:
    minmax(0, 1.45fr)
    minmax(300px, 0.55fr);
  gap: 20px;
  margin-bottom: 20px;
}

.drop {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 25px;
  background: var(--surface-soft);
  border: 1.5px dashed #9caf9f;
  border-radius: 13px;
  text-align: center;
  cursor: pointer;

  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}

.drop:hover {
  background: #f1f6f2;
  border-color: var(--green-medium);
}

.drop.drag {
  background: var(--green-light);
  border-color: var(--green);
  transform: scale(1.002);
}

.drop input {
  display: none;
}

.upload-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  border-radius: 12px;
  background: var(--green-light);
  color: var(--green);
  font-size: 21px;
}

.drop strong {
  font-size: 13px;
}

.drop span {
  color: var(--text-soft);
  font-size: 11px;
}

.drop small {
  margin-top: 7px;
  color: var(--text-light);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.upload-status {
  min-height: 18px;
  margin-top: 12px;
  color: var(--text-soft);
  font-size: 11px;
}

.loading-dot {
  width: 7px;
  height: 7px;
  display: inline-block;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.3;
  }

  50% {
    opacity: 1;
  }
}

/* =========================================================
   SYSTEM STATUS
========================================================= */

.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--green-light);
  color: #387253;
  font-size: 9px;
  font-weight: 700;
}

.live-badge span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4b9469;
}

.system-list {
  display: grid;
}

.system-list > div {
  min-height: 47px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border-bottom: 1px solid var(--border-soft);
}

.system-list > div:last-child {
  border-bottom: 0;
}

.system-list span {
  color: var(--text-soft);
  font-size: 11px;
}

.system-list strong {
  font-size: 11px;
}

.mono {
  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;

  font-weight: 600 !important;
}/* =========================================================
   DOCUMENT SECTION
========================================================= */

.documents-panel {
  padding: 0;
  overflow: hidden;
}

.documents-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 24px 17px;
}

.documents-header .muted {
  margin: 4px 0 0;
  font-size: 11px;
}

/* =========================================================
   SEARCH / FILTER
========================================================= */

.document-toolbar {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 200px 210px;
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 0 24px 17px;
}

.searchbox {
  height: 46px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.searchbox span {
  color: var(--text-light);
  font-size: 17px;
}

.searchbox input {
  width: 100%;
  height: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12px;
}

.document-filters {
  display: contents;
}

.document-toolbar select,
.document-filters select {
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 0 12px;
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  font-size: 12px;
  cursor: pointer;
}

.searchbox:focus-within,
.document-toolbar select:focus {
  border-color: #7d9a89;
  box-shadow: 0 0 0 3px rgba(79, 117, 98, 0.08);
}

/* =========================================================
   DOCUMENT TABLE
========================================================= */

.document-table {
  border-top: 1px solid var(--border-soft);
}

.document-table-head {
  display: grid;
  grid-template-columns:
    minmax(300px, 1.8fr)
    minmax(110px, 0.6fr)
    minmax(100px, 0.55fr)
    minmax(110px, 0.6fr)
    22px;
  gap: 18px;
  padding: 10px 24px;
  background: var(--surface-soft);
  color: var(--text-light);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.document-rows {
  display: grid;
}

.document-row {
  width: 100%;
  min-height: 70px;
  display: grid;
  grid-template-columns:
    minmax(300px, 1.8fr)
    minmax(110px, 0.6fr)
    minmax(100px, 0.55fr)
    minmax(110px, 0.6fr)
    22px;
  align-items: center;
  gap: 18px;
  padding: 11px 24px;
  background: white;
  color: var(--text);
  border: 0;
  border-top: 1px solid var(--border-soft);
  text-align: left;

  transition:
    background 0.13s ease,
    box-shadow 0.13s ease;
}

.document-row:first-child {
  border-top: 0;
}

.document-row:hover {
  background: var(--surface-hover);
}

.document-row:focus-visible {
  position: relative;
  outline: 2px solid #759582;
  outline-offset: -2px;
}

.document-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.document-main > div {
  min-width: 0;
}

.document-type-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--green-light);
  color: var(--green);
  font-family: Manrope, sans-serif;
  font-size: 12px;
  font-weight: 800;
}

.document-main strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-main small {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-cell {
  font-size: 11px;
}

.amount-cell {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.cell-muted {
  color: var(--text-light);
}

.document-arrow {
  color: #a0aaa4;
  font-size: 20px;
}

/* =========================================================
   DOCUMENT ACTION HINT
========================================================= */

.document-action-hint {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 6px;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--orange-light);
  color: var(--orange);
  font-size: 8px;
  font-weight: 700;
  white-space: nowrap;
}

.document-action-hint.action-overdue {
  background: var(--red-light);
  color: var(--red);
}

.document-action-hint.action-today {
  background: #fff0e8;
  color: #a64f25;
}

.document-action-hint.action-urgent,
.document-action-hint.action-soon {
  background: var(--orange-light);
  color: var(--orange);
}

.document-action-hint.action-upcoming {
  background: #f5f0e5;
  color: #816529;
}

.document-action-hint.action-future {
  background: var(--green-light);
  color: var(--green-medium);
}

/* =========================================================
   STATUS PILLS
========================================================= */

.status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.status-confirmed {
  background: #e8f4ec;
  color: #377251;
}

.status-review {
  background: var(--orange-light);
  color: var(--orange);
}

.status-processing {
  background: var(--blue-light);
  color: var(--blue);
}

.status-uploaded,
.status-default {
  background: #eef1ef;
  color: #65726b;
}

.status-failed {
  background: var(--red-light);
  color: var(--red);
}

/* =========================================================
   EMPTY STATE
========================================================= */

.empty-state {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 35px;
  text-align: center;
}

.empty-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--text-light);
  font-size: 21px;
}

.empty-state h3 {
  margin: 5px 0;
  font-size: 14px;
}

.empty-state p {
  max-width: 390px;
  margin: 0;
  color: var(--text-soft);
  font-size: 11px;
}

/* =========================================================
   DETAIL PAGE
========================================================= */

.detail-page {
  max-width: 1240px;
  padding-top: 34px;
}

.detail-nav {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.back-button {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding-left: 0;
  background: transparent;
  color: var(--green);
}

.back-button:hover {
  color: var(--green-hover);
}

/* =========================================================
   DETAIL HEADER
========================================================= */

.detail-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.detail-heading > div:last-child {
  min-width: 0;
}

.detail-heading h1 {
  max-width: 900px;
  margin: 2px 0 3px;
  overflow: hidden;
  font-size: clamp(30px, 3.2vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-heading .eyebrow {
  margin-bottom: 5px;
}

.detail-heading .muted {
  margin: 0;
  color: var(--text-light);
  font-size: 10px;
}

.detail-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 14px;
  background: var(--green);
  color: white;
  font-family: Manrope, sans-serif;
  font-size: 17px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(24, 61, 46, 0.08);
}

/* =========================================================
   DETAIL LAYOUT
========================================================= */

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}

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

.detail-sidebar {
  display: grid;
  gap: 12px;
  position: sticky;
  top: 84px;
}

/* =========================================================
   ACTION BANNER
========================================================= */

.action-banner {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #fffdf9 0%, #fffaf0 100%);
  border: 1px solid #eadfc8;
  border-radius: 13px;
  box-shadow: none;
}

.action-banner-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--orange-light);
  color: var(--orange);
  font-family: Manrope, sans-serif;
  font-size: 14px;
  font-weight: 800;
}

.action-banner-content {
  min-width: 0;
  flex: 1;
}

.action-banner-content .eyebrow {
  margin-bottom: 3px;
}

.action-banner-content h2 {
  margin: 0 0 3px;
  font-size: 15px;
  line-height: 1.3;
}

.action-banner-content p:not(.eyebrow) {
  max-width: 760px;
  margin: 0;
  color: var(--text-soft);
  font-size: 10px;
  line-height: 1.5;
}

.action-banner .action-date-badge {
  margin-top: 7px;
}

.action-complete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  margin-top: 8px;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  border: 1px solid rgba(24, 61, 46, 0.12);
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;

  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.action-complete-btn:hover {
  background: white;
  border-color: rgba(24, 61, 46, 0.22);
}

/* =========================================================
   ACTION BANNER STATES
========================================================= */

.action-banner-overdue {
  background: linear-gradient(135deg, #fffafa 0%, #fff5f3 100%);
  border-color: #efd6d1;
}

.action-banner-overdue .action-banner-icon {
  background: var(--red-light);
  color: var(--red);
}

.action-banner-overdue .eyebrow {
  color: var(--red);
}

.action-banner-today {
  background: linear-gradient(135deg, #fffdf9 0%, #fff5ee 100%);
  border-color: #edd9cb;
}

.action-banner-today .action-banner-icon {
  background: #fff0e8;
  color: #a64f25;
}

.action-banner-urgent,
.action-banner-soon {
  border-color: #eadfc8;
}

.action-banner-upcoming {
  background: linear-gradient(135deg, #ffffff 0%, #faf8f2 100%);
}

.action-banner-future {
  background: linear-gradient(135deg, #ffffff 0%, #f7faf8 100%);
  border-color: #dce7df;
}

.action-banner-future .action-banner-icon {
  background: var(--green-light);
  color: var(--green);
}

/* =========================================================
   COMPLETED / NO ACTION BANNER
========================================================= */

.no-action-banner {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 16px;
  padding: 12px 15px;
  background: #f7faf8;
  border: 1px solid #dce8e0;
  border-radius: 12px;
}

.no-action-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 9px;
  background: var(--green-light);
  color: #387253;
  font-size: 13px;
  font-weight: 800;
}

.no-action-banner .eyebrow {
  margin-bottom: 2px;
  color: #387253;
  font-size: 8px;
}

.no-action-banner p:not(.eyebrow) {
  margin: 0;
  color: var(--text-soft);
  font-size: 10px;
  line-height: 1.45;
}

/* =========================================================
   FACTS
========================================================= */

.facts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 16px;
  border: 1px solid var(--border-soft);
  border-radius: 11px;
  overflow: hidden;
}

.fact {
  min-height: 76px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 14px 16px;
  border-right: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}

.fact:nth-child(2n) {
  border-right: 0;
}

.fact:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.fact span {
  margin-bottom: 6px;
  color: var(--text-light);
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.fact strong {
  overflow-wrap: anywhere;
  font-size: 11px;
  line-height: 1.45;
}

/* =========================================================
   ANALYSIS
========================================================= */

.analysis-panel {
  background: linear-gradient(135deg, #ffffff 0%, #f9fbfa 100%);
}

.analysis-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.ai-chip {
  padding: 5px 8px;
  background: var(--green-light);
  color: var(--green);
  border-radius: 999px;
  font-size: 8px;
  font-weight: 800;
}

.summary-text {
  margin: 15px 0 0;
  color: #3d4b44;
  font-size: 12px;
  line-height: 1.7;
}
.related-documents-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.related-document-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 14px 16px;
  background: #f7f9f7;
  border: 1px solid #e2e8e4;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.related-document-item:hover {
  background: #f0f5f1;
  border-color: #cdd9d1;
}

.document-timeline {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.document-timeline-step.is-current {
  border-color: var(--green);
  background: var(--green-light);
}

.timeline-current-mark {
  flex: none;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.chain-summary {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e2e8e4;
}

.chain-summary-label {
  margin: 12px 0 0;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.related-document-info {
  min-width: 0;
}

.related-document-title {
  display: block;
  color: #18231f;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.related-document-reason {
  display: block;
  margin-top: 3px;
  color: #7b8983;
  font-size: 12px;
  line-height: 1.4;
}

.related-document-arrow {
  flex-shrink: 0;
  color: #9caaa4;
  font-size: 20px;
  line-height: 1;
}
/* =========================================================
   IMPORTANT NOTES
========================================================= */

.important-notes {
  display: grid;
  gap: 7px;
  margin-top: 11px;
}

.important-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 11px;
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: 9px;
}

.important-note > span {
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green-light);
  color: var(--green);
  font-family: Manrope, sans-serif;
  font-size: 9px;
  font-weight: 800;
}

.important-note p {
  margin: 0;
  color: var(--text-soft);
  font-size: 10px;
  line-height: 1.55;
}/* =========================================================
   SIDEBAR CARDS
========================================================= */

.amount-card,
.deadline-card,
.review-card,
.original-card {
  padding: 19px;
}

/* =========================================================
   AMOUNT CARD
========================================================= */

.big-amount {
  display: block;
  margin: 9px 0 5px;
  font-family: Manrope, sans-serif;
  font-size: 31px;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.amount-card > span {
  color: var(--text-light);
  font-size: 9px;
}

/* =========================================================
   DEADLINE CARD
========================================================= */

.deadline-card {
  background: linear-gradient(135deg, #ffffff 0%, #fafbf9 100%);
}

.deadline-date {
  display: block;
  margin: 9px 0 7px;
  font-family: Manrope, sans-serif;
  font-size: 21px;
  line-height: 1;
  letter-spacing: -0.03em;
}

.deadline-card > span {
  display: inline-flex;
  width: fit-content;
  padding: 4px 7px;
  border-radius: 999px;
  background: #eef1ef;
  color: var(--text-soft);
  font-size: 8px;
  font-weight: 700;
}

.deadline-overdue {
  border-color: #efd6d1;
  background: linear-gradient(135deg, #ffffff 0%, #fff6f4 100%);
}

.deadline-overdue .deadline-date {
  color: var(--red);
}

.deadline-overdue > span {
  background: var(--red-light);
  color: var(--red);
}

.deadline-today {
  border-color: #edd9cb;
}

.deadline-today .deadline-date {
  color: #a64f25;
}

.deadline-today > span {
  background: #fff0e8;
  color: #a64f25;
}

.deadline-urgent,
.deadline-soon {
  border-color: #eadfc8;
}

.deadline-urgent .deadline-date,
.deadline-soon .deadline-date {
  color: var(--orange);
}

.deadline-urgent > span,
.deadline-soon > span {
  background: var(--orange-light);
  color: var(--orange);
}

.deadline-upcoming > span {
  background: #f5f0e5;
  color: #816529;
}

.deadline-future > span {
  background: var(--green-light);
  color: var(--green-medium);
}

/* =========================================================
   REVIEW CARD
========================================================= */

.review-symbol {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-bottom: 13px;
  border-radius: 10px;
  background: var(--orange-light);
  color: var(--orange);
  font-weight: 800;
}

.review-symbol.confirmed {
  background: var(--green-light);
  color: #387253;
}

.review-card h2 {
  font-size: 16px;
}

.review-card .muted {
  margin-bottom: 15px;
  font-size: 9px;
}

.review-card button + button {
  margin-top: 8px;
}

.confirmed-card {
  border-color: #d9e8de;
}

.original-card .file-name {
  overflow-wrap: anywhere;
  color: var(--text-soft);
  font-size: 9px;
}

/* =========================================================
   ITEMS
========================================================= */

.items-list {
  display: grid;
  margin-top: 13px;
}

.item-row {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 11px 0;
  border-top: 1px solid var(--border-soft);
}

.item-row:first-child {
  border-top: 0;
}

.item-row strong {
  font-size: 11px;
}

.item-row small {
  display: block;
  margin-top: 4px;
  color: var(--text-light);
  font-size: 9px;
}

/* =========================================================
   EDIT PAGE
========================================================= */

.edit-page {
  max-width: 980px;
}

.edit-heading {
  margin-bottom: 24px;
}

.edit-heading h1 {
  margin: 4px 0 7px;
  font-size: clamp(32px, 4vw, 46px);
}

.edit-heading .muted {
  margin: 0;
  font-size: 11px;
}

.edit-panel {
  padding: 26px;
}

/* =========================================================
   FORM
========================================================= */

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

.form-grid label,
.summary-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 700;
}

.form-grid input,
.form-grid select,
.summary-field textarea {
  width: 100%;
  padding: 11px 12px;
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  font: inherit;
  font-size: 11px;

  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.form-grid input,
.form-grid select {
  min-height: 42px;
}

.form-grid input:focus,
.form-grid select:focus,
.summary-field textarea:focus {
  border-color: #7d9a89;
  box-shadow: 0 0 0 3px rgba(79, 117, 98, 0.08);
}

.form-grid input:hover,
.form-grid select:hover,
.summary-field textarea:hover {
  border-color: #c7d0ca;
}

.summary-field {
  margin-top: 20px;
}

.summary-field textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.6;
}

.field-help {
  color: var(--text-light);
  font-size: 9px;
  font-weight: 400;
}

/* =========================================================
   AMOUNT INPUT
========================================================= */

.amount-input {
  position: relative;
}

.amount-input input {
  padding-right: 54px;
}

.amount-input span {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 10px;
  font-weight: 700;
  pointer-events: none;
}

/* =========================================================
   FORM ACTIONS
========================================================= */

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
}

/* =========================================================
   ERROR PAGE
========================================================= */

.error-page {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.error-page .error-symbol {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 12px;
  background: var(--red-light);
  color: var(--red);
  font-family: Manrope, sans-serif;
  font-size: 18px;
  font-weight: 800;
}

.error-page .auth-card {
  text-align: center;
}

.error-page .error {
  margin: 14px 0;
  text-align: center;
}

/* =========================================================
   DISABLED STATES
========================================================= */

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.primary:disabled {
  background: #83948b;
  transform: none;
  box-shadow: none;
}

/* =========================================================
   FOCUS STATES
========================================================= */

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(79, 117, 98, 0.65);
  outline-offset: 2px;
}

/* =========================================================
   SCROLLBAR
========================================================= */

* {
  scrollbar-width: thin;
  scrollbar-color: #cbd3ce transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: #cbd3ce;
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: #aebbb3;
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* =========================================================
   SELECTION
========================================================= */

::selection {
  background: #dce9e1;
  color: var(--green);
}

/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1050px) {
  .dash {
    padding-left: 28px;
    padding-right: 28px;
  }

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

  .workspace-grid {
    grid-template-columns:
      minmax(0, 1.4fr)
      minmax(260px, 0.8fr);
  }

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

  .detail-sidebar {
    position: static;
  }

  .document-table-head,
  .document-row {
    grid-template-columns:
      minmax(250px, 1.6fr)
      minmax(100px, 0.6fr)
      minmax(90px, 0.5fr)
      minmax(100px, 0.6fr)
      20px;

    gap: 12px;
  }
}

/* =========================================================
   SMALL TABLET
========================================================= */

@media (max-width: 820px) {
  .topbar {
    padding-left: 20px;
    padding-right: 20px;
  }

  .dash {
    padding: 30px 20px 60px;
  }

  .dashboard-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .upload-shortcut {
    width: 100%;
  }

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

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

  .review-card,
  .original-card {
    grid-column: span 2;
  }

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

  .fact {
    border-right: 0;
    border-bottom: 1px solid var(--border-soft);
  }

  .fact:nth-child(2n) {
    border-right: 0;
  }

  .fact:nth-last-child(-n + 2) {
    border-bottom: 1px solid var(--border-soft);
  }

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

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

  .document-toolbar .searchbox {
    grid-column: 1 / -1;
  }

  .document-filters {
    display: contents;
  }

  .document-table-head {
    display: none;
  }

  .document-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 16px;
    padding: 16px 20px;
  }

  .document-main {
    grid-column: 1;
    grid-row: 1;
  }

  .document-arrow {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
  }

  .document-cell {
    display: flex;
    align-items: center;
    gap: 5px;
    grid-column: 1 / -1;
    padding-left: 50px;
    font-size: 10px;
  }

  .document-cell::before {
    content: attr(data-label) ":";
    color: var(--text-light);
    font-size: 9px;
    font-weight: 700;
  }

  .document-cell .status-pill {
    margin-left: 2px;
  }

  .amount-cell {
    font-weight: 700;
  }

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

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 600px) {
  body {
    background: #f7f8f7;
  }

  .topbar {
    height: 58px;
    min-height: 58px;
    padding: 0 16px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 12px;
  }

  .brand-copy strong {
    font-size: 11px;
  }

  .brand-copy small {
    font-size: 7px;
  }

  .security-indicator {
    display: none;
  }

  .top-actions {
    gap: 5px;
  }

  .top-actions .ghost {
    min-height: 32px;
    padding: 0 10px;
    font-size: 9px;
  }

  .dash {
    width: 100%;
    padding: 22px 14px 50px;
  }

  .dashboard-heading {
    margin-bottom: 22px;
  }

  .dashboard-heading h1 {
    font-size: 32px;
  }

  .dashboard-heading .muted {
    font-size: 10px;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 18px;
  }

  .stat {
    min-height: 108px;
    padding: 15px;
  }

  .stat strong {
    margin: 6px 0 4px;
    font-size: 27px;
  }

  .stat small {
    font-size: 8px;
  }

  .panel {
    border-radius: 13px;
  }

  .upload-panel,
  .system-panel,
  .analysis-panel,
  .edit-panel {
    padding: 18px;
  }

  .panel-heading h2,
  .analysis-heading h2 {
    font-size: 16px;
  }

  .drop {
    min-height: 180px;
    padding: 24px 15px;
  }

  .documents-header {
    flex-direction: column;
    padding: 18px 18px 14px;
  }

  .documents-header .ghost {
    width: 100%;
  }

  .document-toolbar {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 0 18px 14px;
  }

  .document-toolbar .searchbox {
    grid-column: auto;
  }

  .document-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .searchbox,
  .document-toolbar select,
  .document-filters select {
    width: 100%;
    min-width: 0;
  }

  .document-row {
    padding: 15px 18px;
  }

  .document-cell {
    padding-left: 50px;
  }

  .document-main small {
    max-width: 240px;
  }

  .action-overview-panel {
    margin-bottom: 18px;
  }

  .action-overview-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .action-date-badge {
    margin-left: 0;
  }

  /* DETAIL */

  .detail-page {
    padding-top: 20px;
  }

  .detail-nav {
    margin-bottom: 17px;
  }

  .detail-heading {
    align-items: center;
    gap: 11px;
    margin-bottom: 18px;
  }

  .detail-heading h1 {
    max-width: calc(100vw - 100px);
    font-size: 27px;
    white-space: normal;
  }

  .detail-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 14px;
  }

  .action-banner {
    align-items: flex-start;
    padding: 13px;
    border-radius: 12px;
  }

  .action-banner-icon {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .action-banner-content h2 {
    font-size: 15px;
  }

  .no-action-banner {
    align-items: flex-start;
    padding: 12px;
  }

  .detail-main,
  .detail-sidebar {
    gap: 12px;
  }

  .detail-sidebar {
    grid-template-columns: 1fr;
  }

  .review-card,
  .original-card {
    grid-column: auto;
  }

  .amount-card,
  .deadline-card,
  .review-card,
  .original-card {
    padding: 17px;
  }

  .big-amount {
    font-size: 29px;
  }

  .summary-text {
    font-size: 11px;
  }

  .facts-grid {
    margin-top: 14px;
  }

  .fact {
    min-height: 70px;
    padding: 13px 14px;
  }

  .item-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .edit-heading h1 {
    font-size: 30px;
  }

  .edit-panel {
    padding: 18px;
  }

  .form-grid {
    gap: 14px;
  }

  .form-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .form-actions button {
    width: 100%;
  }

  .notice {
    align-items: flex-start;
    padding: 12px 14px;
  }
}

/* =========================================================
   VERY SMALL MOBILE
========================================================= */

@media (max-width: 390px) {
  .stats {
    grid-template-columns: 1fr;
  }

  .stat {
    min-height: 96px;
  }

  .dashboard-heading h1,
  .detail-heading h1,
  .edit-heading h1 {
    font-size: 26px;
  }

  .document-main small {
    max-width: 190px;
  }

  .document-cell {
    padding-left: 0;
  }

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

/* =========================================================
   ACCESSIBILITY
========================================================= */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* =========================================================
   PRINT
========================================================= */
/* =========================================================
   COMPACT WORKSPACE
========================================================= */

.workspace-grid {
  grid-template-columns:
    minmax(0, 1.65fr)
    minmax(280px, 0.55fr);
  gap: 16px;
  align-items: stretch;
}

.workspace-grid > .panel {
  height: 100%;
}

/* Upload kompakter */

.upload-panel {
  padding: 20px 22px;
}

.upload-panel .panel-heading {
  margin-bottom: 12px;
}

.drop {
  min-height: 145px;
  padding: 18px 24px;
}

.upload-icon {
  width: 38px;
  height: 38px;
  margin-bottom: 2px;
  border-radius: 11px;
  font-size: 19px;
}

.drop strong {
  font-size: 12px;
}

.drop span {
  font-size: 10px;
}

.drop small {
  margin-top: 5px;
  font-size: 8px;
}

.upload-status {
  min-height: 14px;
  margin-top: 8px;
}

/* Systemkarte kompakter */

.system-panel {
  padding: 20px;
}

.system-panel .panel-heading {
  margin-bottom: 8px;
}

.system-list > div {
  min-height: 41px;
}

.system-list span,
.system-list strong {
  font-size: 10px;
}
@media print {
  body {
    background: white;
  }

  .topbar,
  .detail-nav,
  .review-card,
  .original-card,
  .upload-panel,
  .document-toolbar,
  button {
    display: none !important;
  }

  .dash {
    max-width: none;
    padding: 0;
  }

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

  .detail-sidebar {
    position: static;
    grid-template-columns: repeat(2, 1fr);
  }

  .panel,
  .action-banner,
  .no-action-banner {
    break-inside: avoid;
    box-shadow: none;
  }
}
/* =========================================================
   CATEGORY OVERVIEW
========================================================= */

.category-overview-panel {
  margin-bottom: 20px;
}

.category-overview-panel .panel-heading {
  margin-bottom: 20px;
}

.category-overview-panel .panel-heading .muted {
  margin: 5px 0 0;
  font-size: 11px;
}

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

/* CATEGORY CARD */

.category-card {
  width: 100%;
  min-width: 0;
  min-height: 92px;

  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;

  padding: 15px;

  background: #ffffff;
  color: var(--text);

  border: 1px solid var(--border);
  border-radius: 12px;

  text-align: left;

  box-shadow:
    0 1px 2px rgba(20, 35, 29, 0.015);

  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.category-card:hover {
  background: var(--surface-hover);
  border-color: #cbd8d0;

  box-shadow:
    0 2px 4px rgba(20, 35, 29, 0.02),
    0 7px 18px rgba(20, 35, 29, 0.025);

  transform: translateY(-1px);
}

/* ICON */

.category-card-icon {
  width: 38px;
  height: 38px;

  display: grid;
  place-items: center;

  flex: 0 0 auto;

  border-radius: 10px;

  background: var(--green-light);
  color: var(--green);

  font-family: Manrope, sans-serif;
  font-size: 13px;
  font-weight: 800;
}

/* CONTENT */

.category-card-content {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.category-card-content strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);

  font-family: Inter, sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;

  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.category-card-content span {
  color: var(--text-light);

  font-size: 9px;
  font-weight: 500;
}

/* ARROW */

.category-card-arrow {
  display: grid;
  place-items: center;

  color: #a2ada7;

  font-size: 17px;
  line-height: 1;

  transition:
    color 0.15s ease,
    transform 0.15s ease;
}

.category-card:hover .category-card-arrow {
  color: var(--green);
  transform: translateX(2px);
}

/* UNCATEGORIZED */

.category-card-muted {
  background: var(--surface-soft);
}

.category-card-muted .category-card-icon {
  background: #eef1ef;
  color: var(--text-soft);
}

/* =========================================================
   CATEGORY RESPONSIVE
========================================================= */

@media (max-width: 1050px) {
  .category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .category-overview-panel {
    padding: 18px;
  }

  .category-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .category-card {
    min-height: 76px;
    padding: 12px;
  }
}
/* =========================================================
   CATEGORY ICONS
========================================================= */

.category-card-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;

  border-radius: 12px;
  background: var(--green-light);
  color: var(--green);
}

.category-card-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.category-card:hover .category-card-icon {
  background: #deebe3;
}
/* =========================================================
   PAYMENT DETAILS
========================================================= */

.payment-details-fact {
  align-items: flex-start;
}

.payment-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
  width: 100%;
}

.payment-detail-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.payment-detail-row span {
  font-size: 11px;
  font-weight: 600;
  color: #8a9690;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.payment-detail-row strong {
  font-size: 14px;
  font-weight: 600;
  color: #17221d;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.payment-detail-row .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0.02em;
}
.payment-value-with-action {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.copy-payment-button {
  border: 1px solid #d8e1dc;
  background: #ffffff;
  border-radius: 7px;
  padding: 5px 9px;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  color: #52635b;
  cursor: pointer;
  transition: 0.15s ease;
}

.copy-payment-button:hover {
  background: #f3f7f5;
  border-color: #bccbc3;
}
/* Reliable cases: accessible controls and responsive timeline. */
.case-detail-page .panel { padding: 24px; }
.case-detail-page .detail-main { display: grid; gap: 20px; align-content: start; }
.case-detail-page .detail-sidebar { display: grid; gap: 20px; align-content: start; }
.case-overview-list, .case-document-list { display: grid; gap: 12px; }
.case-overview-item, .case-document-item { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; text-align: left; color: var(--text); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 12px; }
.case-overview-main, .case-overview-meta { display: grid; gap: 6px; }
.case-overview-main span { color: var(--text-soft); font-size: 12px; }
.case-document-content { min-width: 0; overflow-wrap: anywhere; }
.case-document-row { padding-bottom: 12px; border-bottom: 1px solid var(--border-soft); }
.case-next-action { display: grid; gap: 16px; margin: 20px 0; padding: 18px; background: var(--green-light); border-radius: 12px; }
.case-next-action div { display: grid; gap: 6px; }
.case-next-action span { color: var(--text-soft); font-size: 12px; }
.secondary-button { display: inline-flex; align-items: center; justify-content: center; padding: 11px 16px; border: 1px solid var(--border); border-radius: 10px; background: white; color: var(--text); margin: 6px 6px 6px 0; }
.case-detail-page select { width: 100%; margin: 10px 0; min-height: 44px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: white; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--green-medium); outline-offset: 3px; }
.livaro-update { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 1000; max-width: calc(100vw - 32px); padding: 14px 20px; background: var(--green); color: white; border: 1px solid white; border-radius: 12px; box-shadow: var(--shadow-hover); }
@media (max-width: 600px) { .case-detail-page .panel { padding: 18px; } .case-overview-item { align-items: flex-start; } }

/* Compact groups entry and upload modal */
.case-entry { display:flex; align-items:center; justify-content:space-between; gap:24px; }
.case-entry h2 { margin:0 0 8px; }
.case-entry p { margin:0; }
.upload-dialog { width:min(640px,calc(100vw - 32px)); max-height:90dvh; overflow:auto; border:1px solid #dbe5df; border-radius:24px; padding:28px; color:#19271f; background:#fff; }
.upload-dialog::backdrop { background:rgba(15,30,23,.5); }
.upload-dialog .panel-heading { align-items:center; gap:16px; }
.upload-dialog .drop { margin-top:20px; }
@media(max-width:640px) { .case-entry { align-items:stretch; flex-direction:column; } .upload-dialog { padding:20px; } }
