:root {
  --bg: #f5f7f4;
  --surface: #ffffff;
  --ink: #17211b;
  --muted: #69736d;
  --line: #dfe6df;
  --brand: #176b57;
  --brand-strong: #0d4d40;
  --accent: #d69d36;
  --danger: #b42318;
  --success: #197a43;
  --shadow: 0 18px 50px rgba(23, 33, 27, 0.12);
}

* {
  box-sizing: border-box;
}

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

button,
input,
select,
textarea {
  letter-spacing: 0;
}

a {
  color: inherit;
}

.auth-page {
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    linear-gradient(135deg, rgba(23, 107, 87, 0.94), rgba(23, 33, 27, 0.92)),
    url("data:image/svg+xml,%3Csvg width='180' height='180' viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.12'%3E%3Cpath d='M0 45h180M0 90h180M0 135h180M45 0v180M90 0v180M135 0v180'/%3E%3C/g%3E%3C/svg%3E");
}

.auth-shell {
  display: grid;
  grid-template-columns: 1.1fr 420px;
  gap: 32px;
  align-items: center;
  width: min(1040px, 100%);
}

.auth-brand {
  color: #fff;
  max-width: 560px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: var(--accent);
  color: #182018;
  font-weight: 800;
}

.brand-mark.small {
  width: 40px;
  height: 40px;
  font-size: 0.9rem;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.auth-brand h1 {
  margin: 18px 0 12px;
  font-size: clamp(2.3rem, 6vw, 4.6rem);
  line-height: 0.95;
}

.auth-brand p:last-child {
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.1rem;
  line-height: 1.7;
}

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

.auth-card {
  padding: 30px;
}

.single-card {
  width: min(460px, 100%);
}

.brand-line {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
}

.auth-card__header h1,
.auth-card__header h2 {
  margin: 0 0 8px;
  font-size: 1.65rem;
}

.auth-card__header p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.55;
}

.stacked-form {
  display: grid;
  gap: 16px;
}

label span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

input,
select {
  height: 46px;
}

textarea {
  min-height: 108px;
  padding-top: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  outline: 3px solid rgba(23, 107, 87, 0.14);
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.primary-button {
  background: var(--brand);
  color: #fff;
}

.primary-button:hover {
  background: var(--brand-strong);
}

.ghost-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.button-link {
  text-decoration: none;
}

.muted-link {
  display: inline-flex;
  margin-top: 18px;
  color: var(--brand-strong);
  font-weight: 700;
  text-decoration: none;
}

.alert {
  margin-bottom: 16px;
  border-radius: 8px;
  padding: 12px 14px;
  font-weight: 700;
}

.alert-error {
  background: #fff0ed;
  color: var(--danger);
}

.alert-success {
  background: #eef9f2;
  color: var(--success);
}

.dashboard-page {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  background:
    radial-gradient(circle at top left, rgba(23, 107, 87, 0.08), transparent 34rem),
    var(--bg);
}

.sidebar {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 16px;
  min-width: 0;
  min-height: 100vh;
  border-right: 1px solid var(--line);
  padding: 20px;
  overflow: hidden;
  background: linear-gradient(180deg, #101b17, #13261f);
  color: #fff;
  z-index: 30;
}

.sidebar-nav {
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 5px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.sidebar-nav a {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  height: 42px;
  flex: 0 0 auto;
  min-height: 42px;
  border-radius: 8px;
  padding: 10px 12px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 750;
  text-overflow: ellipsis;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.sidebar-nav a.active,
.sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.sidebar-nav a.active::before {
  content: "";
  position: absolute;
  left: 12px;
  flex: 0 0 4px;
  width: 4px;
  height: 22px;
  border-radius: 999px;
  background: var(--accent);
}

.sidebar-nav a.active {
  padding-left: 28px;
}

.brand-home,
.mobile-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-home span:last-child {
  display: grid;
  gap: 2px;
}

.brand-home small {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.76rem;
  font-weight: 700;
}

.sidebar-close,
.mobile-shellbar,
.sidebar-backdrop {
  display: none;
}

.sidebar-quick-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  background: var(--accent);
  color: #1b1d13;
  font-weight: 900;
  text-decoration: none;
}

.sidebar-footer {
  display: grid;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 14px;
}

.user-menu {
  display: grid;
  gap: 10px;
}

.user-menu summary {
  list-style: none;
  cursor: pointer;
}

.user-menu summary::-webkit-details-marker {
  display: none;
}

.user-chip {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.user-chip > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 900;
}

.user-chip strong,
.user-chip small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.58);
  font-weight: 700;
}

.sidebar-logout {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.user-menu-panel {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.user-menu-panel a {
  display: flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.dashboard-main {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
  border: 1px solid rgba(223, 230, 223, 0.84);
  border-radius: 8px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 14px 36px rgba(23, 33, 27, 0.07);
}

.topbar h1 {
  margin: 0;
  font-size: 1.8rem;
}

.topbar-actions,
.action-row,
.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

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

.metric-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  box-shadow: none;
}

.metric-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

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

.metric-card strong {
  display: block;
  margin: 10px 0;
  font-size: 2rem;
}

.panel {
  margin-top: 18px;
  padding: 24px;
  box-shadow: none;
}

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

.panel p:last-child {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.65;
}

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

.toolbar-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 220px auto;
  gap: 14px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  padding: 18px;
  background: #fbfcfb;
}

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

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 14px;
  text-align: left;
  vertical-align: middle;
  font-size: 0.92rem;
}

th {
  position: sticky;
  top: 0;
  color: var(--muted);
  background: #f9fbf8;
  font-size: 0.78rem;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #fbfdfb;
}

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

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 800;
}

.status-active {
  background: #eaf8ef;
  color: #176b42;
}

.status-inactive {
  background: #f1f4f1;
  color: #59645d;
}

.status-archived {
  background: #fff4df;
  color: #8a5a12;
}

.status-uploaded,
.status-waiting_ocr {
  background: #eef5ff;
  color: #215a91;
}

.status-ocr_processed,
.status-needs_review {
  background: #fff4df;
  color: #8a5a12;
}

.status-validated,
.status-exported {
  background: #eaf8ef;
  color: #176b42;
}

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

.status-expired,
.status-cancelled,
.status-overdue {
  background: #fff0ed;
  color: var(--danger);
}

.status-trial {
  background: #fff4df;
  color: #8a5a12;
}

.status-draft,
.status-unpaid {
  background: #eef5ff;
  color: #215a91;
}

.status-paid,
.status-sent {
  background: #eaf8ef;
  color: #176b42;
}

.status-created {
  background: #eaf8ef;
  color: #176b42;
}

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

.status-placeholder {
  background: #fff4df;
  color: #8a5a12;
}

.status-success {
  background: #eaf8ef;
  color: #176b42;
}

.status-skipped {
  background: #fff4df;
  color: #8a5a12;
}

.link-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--brand-strong);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.danger-link {
  color: var(--danger);
}

.pagination {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  color: var(--muted);
  background: #fbfcfb;
}

.pagination a {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-left: 4px;
  text-decoration: none;
}

.pagination a.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.client-form {
  display: grid;
  gap: 24px;
  margin-top: 0;
}

.form-section h2 {
  margin: 0 0 16px;
  font-size: 1.12rem;
}

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

.form-section {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fbfcfb;
}

label:has(input[required]) span::after,
label:has(select[required]) span::after,
label:has(textarea[required]) span::after {
  content: " *";
  color: var(--danger);
}

.form-grid .wide {
  grid-column: span 3;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.detail-panel {
  margin-top: 0;
}

.detail-panel dl {
  display: grid;
  gap: 12px;
  margin: 0;
}

.detail-panel dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-panel dd {
  margin: -8px 0 4px;
  line-height: 1.5;
  word-break: break-word;
}

.document-toolbar {
  grid-template-columns: minmax(180px, 1fr) 190px 170px 110px 120px 150px auto;
}

.ocr-toolbar {
  grid-template-columns: minmax(220px, 1fr) 180px 120px 130px auto;
}

.accounting-toolbar {
  grid-template-columns: minmax(220px, 1fr) 180px 120px 130px 170px auto;
}

.vat-toolbar {
  grid-template-columns: minmax(240px, 1fr) 140px 140px auto;
  border-bottom: 0;
  padding: 0;
}

.bank-toolbar {
  grid-template-columns: minmax(220px, 1fr) 170px 110px 130px 140px auto;
}

.export-center {
  margin-top: 0;
}

.export-form {
  display: grid;
  gap: 20px;
}

.export-help-grid {
  margin-top: 18px;
}

.report-metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.report-filter-panel {
  margin-top: 18px;
}

.report-toolbar {
  grid-template-columns: minmax(220px, 1fr) 140px 140px auto;
  border-bottom: 0;
  padding: 0;
}

.compact-report-toolbar {
  grid-template-columns: 160px 160px auto;
}

.report-export-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 18px;
}

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

.section-heading h2 {
  margin: 0;
}

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

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

.insight-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #f9fbf8;
}

.insight-card strong {
  font-size: 1.7rem;
}

.insight-card span {
  font-weight: 800;
}

.insight-card small {
  color: var(--muted);
  line-height: 1.5;
}

.insight-warning {
  border-color: #ecd19c;
  background: #fff8eb;
}

.insight-danger {
  border-color: #efb5ad;
  background: #fff3f1;
}

.report-two-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.75fr);
  gap: 18px;
}

.mini-chart,
.task-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.chart-row,
.task-item {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(140px, 2fr) 54px;
  gap: 12px;
  align-items: center;
}

.task-item {
  grid-template-columns: minmax(0, 1fr) 54px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.chart-row span,
.task-item span {
  color: var(--muted);
  font-weight: 700;
}

.chart-row strong,
.task-item strong {
  text-align: right;
}

.chart-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7eee8;
}

.chart-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.client-summary-table {
  min-width: 1180px;
}

.users-toolbar {
  grid-template-columns: minmax(220px, 1fr) 190px 160px auto;
}

.users-table {
  min-width: 1240px;
}

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

.check-card,
.permission-group label {
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.check-card input,
.permission-group input {
  width: 18px;
  height: 18px;
}

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

.permission-group {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.permission-group legend {
  padding: 0 6px;
  font-weight: 900;
}

.readonly-permissions input {
  cursor: default;
}

.settings-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.settings-tabs a {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

.settings-tabs a.active,
.settings-tabs a:hover {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.settings-form {
  display: grid;
  gap: 20px;
  margin-top: 0;
}

.settings-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: #f9fbf8;
  color: var(--muted);
  line-height: 1.5;
}

.toggle-line {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding-top: 23px;
}

.toggle-line input {
  width: 18px;
  height: 18px;
}

.notification-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.notification-bell span,
.mobile-bell span {
  display: inline-block;
}

.skeleton {
  position: relative;
  overflow: hidden;
  min-height: 18px;
  border-radius: 8px;
  background: #e8eee9;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  animation: skeleton-loading 1.4s infinite;
}

@keyframes skeleton-loading {
  to {
    transform: translateX(100%);
  }
}

.notification-bell strong {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  margin-left: 8px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.78rem;
}

.notifications-toolbar {
  grid-template-columns: 210px minmax(210px, 1fr) 160px 150px auto;
}

.tasks-toolbar {
  grid-template-columns: minmax(190px, 1fr) minmax(190px, 1fr) 150px 150px 160px auto;
}

.tasks-table {
  min-width: 1180px;
}

.unread-row {
  background: #fbf8ef;
}

.priority-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 800;
}

.priority-low {
  background: #f1f4f1;
  color: #59645d;
}

.priority-medium {
  background: #eef5ff;
  color: #215a91;
}

.priority-high {
  background: #fff4df;
  color: #8a5a12;
}

.priority-urgent {
  background: #fff0ed;
  color: var(--danger);
}

.status-pending,
.status-in_progress {
  background: #eef5ff;
  color: #215a91;
}

.status-completed {
  background: #eaf8ef;
  color: #176b42;
}

.status-cancelled {
  background: #f1f4f1;
  color: #59645d;
}

.activity-toolbar {
  grid-template-columns: minmax(210px, 1fr) 190px 190px 160px 150px 160px auto;
}

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

.activity-timeline {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.activity-item {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 16px;
  border-left: 3px solid var(--brand);
  padding: 10px 0 10px 14px;
}

.activity-item time {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

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

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

.activity-table {
  min-width: 1180px;
}

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

.billing-plan-card {
  display: grid;
  align-content: start;
  gap: 12px;
}

.billing-limits {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.file-thumb {
  display: block;
  width: 54px;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: #f7f9f7;
}

.file-icon {
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid #e8d7b7;
  border-radius: 8px;
  background: #fff7e8;
  color: #8a5a12;
  font-size: 0.78rem;
  font-weight: 900;
}

.muted-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.upload-zone {
  display: grid;
  place-items: center;
  min-height: 210px;
  border: 2px dashed #b8c9bf;
  border-radius: 8px;
  padding: 28px;
  background: #f9fbf8;
  cursor: pointer;
  text-align: center;
}

.upload-zone.is-dragging,
.upload-zone:hover {
  border-color: var(--brand);
  background: #f0f8f4;
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-zone__title {
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 900;
}

.upload-zone__hint,
.upload-zone__name {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.upload-zone__name {
  color: var(--brand-strong);
  font-weight: 800;
}

.document-view-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
}

.preview-panel {
  display: grid;
  place-items: center;
  min-height: 520px;
  margin-top: 0;
  overflow: hidden;
  background: #f9fbf8;
}

.preview-panel img {
  display: block;
  max-width: 100%;
  max-height: 760px;
  border-radius: 8px;
  object-fit: contain;
}

.pdf-preview {
  display: grid;
  gap: 14px;
  justify-items: center;
  color: var(--muted);
  text-align: center;
}

.pdf-preview strong {
  color: var(--ink);
  font-size: 1.4rem;
}

.document-bottom-grid {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
}

.notes-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.timeline {
  display: grid;
  gap: 14px;
}

.timeline-item {
  border-left: 3px solid var(--brand);
  padding-left: 12px;
}

.timeline-item strong,
.timeline-item span,
.timeline-item small {
  display: block;
}

.timeline-item span,
.timeline-item small {
  margin-top: 4px;
  color: var(--muted);
}

.timeline-item small {
  font-size: 0.85rem;
}

.ocr-review-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.9fr);
  gap: 18px;
}

.extraction-form {
  display: grid;
  align-content: start;
  gap: 20px;
  margin-top: 0;
}

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

.accounting-summary {
  margin-bottom: 18px;
}

.accounting-form {
  display: grid;
  gap: 20px;
  margin-top: 0;
}

.accounting-lines-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
}

.accounting-lines {
  min-width: 760px;
}

.accounting-lines input {
  min-width: 130px;
}

.vat-metrics {
  margin-top: 18px;
}

.compact-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
}

.metric-status {
  font-size: 1.4rem;
}

.vat-actions-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.bank-transactions-table {
  min-width: 1280px;
}

.bank-transactions-table select,
.bank-transactions-table input {
  min-width: 150px;
}

@media (max-width: 860px) {
  .auth-shell,
  .dashboard-page {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    display: none;
  }

  .dashboard-page {
    padding-top: 68px;
  }

  .mobile-shellbar {
    position: fixed;
    inset: 0 0 auto;
    z-index: 45;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-height: 68px;
    border-bottom: 1px solid var(--line);
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
  }

  .mobile-brand {
    min-width: 0;
    color: var(--ink);
  }

  .mobile-brand strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-menu-button,
  .mobile-bell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 12px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-weight: 800;
    text-decoration: none;
  }

  .mobile-bell {
    position: relative;
    width: 42px;
    padding: 0;
  }

  .mobile-bell span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .mobile-bell::before {
    content: "N";
  }

  .mobile-bell strong {
    position: absolute;
    top: -6px;
    right: -6px;
    display: grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 0.7rem;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(326px, calc(100vw - 36px));
    min-height: 100vh;
    transform: translateX(-104%);
    transition: transform 0.22s ease;
    box-shadow: 20px 0 60px rgba(23, 33, 27, 0.24);
  }

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

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 25;
    display: block;
    pointer-events: none;
    background: rgba(13, 25, 20, 0);
    transition: background 0.22s ease;
  }

  .sidebar-open .sidebar-backdrop {
    pointer-events: auto;
    background: rgba(13, 25, 20, 0.46);
  }

  .sidebar-close {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    padding: 0 10px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
  }

  .brand-line {
    justify-content: space-between;
  }

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

  .toolbar-form,
  .document-toolbar,
  .ocr-toolbar,
  .accounting-toolbar,
  .vat-toolbar,
  .bank-toolbar,
  .report-toolbar,
  .compact-report-toolbar,
  .users-toolbar,
  .notifications-toolbar,
  .tasks-toolbar,
  .activity-toolbar,
  .form-grid,
  .form-grid.two-cols,
  .checkbox-grid,
  .permission-groups,
  .profile-grid,
  .document-view-grid,
  .document-bottom-grid,
  .ocr-review-grid,
    .report-two-columns,
    .activity-item,
    .billing-plan-grid,
    .chart-row {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    border-top: 1px solid var(--line);
  }

  table {
    min-width: 860px;
  }

  .compact-metrics,
  .insight-grid {
    grid-template-columns: 1fr;
  }

  .vat-actions-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .form-grid .wide {
    grid-column: auto;
  }
}

@media (max-width: 560px) {
  .auth-page,
  .dashboard-main {
    padding: 18px;
  }

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

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .topbar h1 {
    font-size: 1.45rem;
  }

  .panel,
  .auth-card {
    padding: 18px;
  }

  .toolbar-form {
    padding: 14px;
  }

  .primary-button,
  .ghost-button,
  .button-link {
    width: 100%;
  }

  .topbar-actions,
  .action-row,
  .form-actions {
    width: 100%;
  }

  .topbar-actions > *,
  .form-actions > * {
    flex: 1 1 100%;
  }

  .notification-bell {
    width: 100%;
    justify-content: center;
  }

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

  .upload-zone {
    min-height: 170px;
    padding: 20px;
  }
}

.demo-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid rgba(214, 157, 54, 0.42);
  border-radius: 999px;
  padding: 0 10px;
  background: rgba(214, 157, 54, 0.16);
  color: #ffe1a3;
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.demo-badge.large {
  min-height: 34px;
  color: var(--brand-strong);
  background: #fff5dc;
}

.topbar-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 720px;
}

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

.demo-hero {
  align-items: flex-end;
  background:
    linear-gradient(135deg, rgba(23, 107, 87, 0.94), rgba(18, 38, 31, 0.95)),
    var(--surface);
  color: #fff;
}

.demo-hero p:not(.eyebrow) {
  max-width: 760px;
  color: rgba(255, 255, 255, 0.82);
}

.demo-kpi-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 18px;
}

.demo-tva-card,
.demo-ai-card {
  display: grid;
  gap: 18px;
  align-content: start;
}

.demo-tva-card h2 {
  margin: 0;
  font-size: 2rem;
}

.compact-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.compact-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.compact-list dt {
  color: var(--muted);
  font-weight: 700;
}

.compact-list dd {
  margin: 0;
  font-weight: 900;
}

.insight-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.insight-list li {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fbfcfb;
}

@media (max-width: 860px) {
  .demo-kpi-grid {
    grid-template-columns: 1fr;
  }
}
