.attachments-section {
  margin-top: 1.5rem;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 1.5rem;
}

.attachments-section h3 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.attachments-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.file-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: background 0.15s ease;
}

.file-card:hover {
  background: var(--panel);
}

.file-card-preview {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.file-card-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.file-card-icon svg {
  width: 100%;
  height: 100%;
}

.file-card-icon-pdf {
  color: oklch(0.72 0.17 25);
}

.file-card-icon-image {
  color: var(--success);
}

.file-card-icon-doc {
  color: var(--accent);
}

.file-card-filename {
  display: none;
}

.file-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  min-width: 0;
}

.file-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}

.file-card-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-card-size {
  font-size: 0.75rem;
  color: var(--fg-faint);
  flex-shrink: 0;
}

.file-card-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.file-btn {
  padding: 0.375rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.file-btn-primary {
  background: linear-gradient(180deg, var(--accent-grad-from) 0%, var(--accent-grad-to) 100%);
  border-color: #B4661F;
  color: #1a0f04;
}

.file-btn-primary:hover {
  filter: brightness(1.06);
}

.file-btn-secondary {
  background: var(--panel);
  border-color: var(--line);
  color: var(--fg-dim);
}

.file-btn-secondary:hover {
  background: var(--panel-2);
  color: var(--fg);
}

.file-preview-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.file-preview-modal.active {
  display: flex;
}

.file-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
}

.file-preview-container {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 90%;
  max-width: 1000px;
  height: 90%;
  margin: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.file-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  color: var(--fg);
}

.file-preview-title {
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-preview-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.file-preview-download,
.file-preview-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--fg-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.file-preview-download:hover,
.file-preview-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--fg);
}

.file-preview-download svg,
.file-preview-close svg {
  width: 1.25rem;
  height: 1.25rem;
}

.file-preview-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2a2826;
  overflow: auto;
}

.file-preview-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.file-preview-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.existing-attachments {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-2);
  border-radius: 10px;
  border: 1px solid var(--line);
}

.attachment-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.attachment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0.75rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.attachment-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0;
}

.attachment-name {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg-dim);
  text-decoration: none;
}

.attachment-name:hover {
  color: var(--accent);
}

.attachment-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.attachment-size {
  font-size: 0.75rem;
  color: var(--fg-muted);
  margin: 0;
}

.attachment-delete {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--fg-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.attachment-delete:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: oklch(0.82 0.13 25);
}

.attachment-delete-icon {
  width: 1rem;
  height: 1rem;
}

.pdf-viewer {
  position: relative;
  width: 100%;
  height: 100%;
}

.pdf-controls {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.625rem;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 1.5rem;
  z-index: 10;
  backdrop-filter: blur(4px);
}

.pdf-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.pdf-nav-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.pdf-page-info {
  color: #fff;
  font-size: 0.75rem;
  min-width: 50px;
  text-align: center;
}

.pdf-canvas-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: auto;
  padding: 1rem;
  background: #2a2826;
}

.pdf-canvas-container canvas {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  background: #fff;
}

.pdf-error {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: oklch(0.82 0.13 25);
  font-size: 1rem;
}


.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.4;
  border: 1px solid var(--card-inner-line);
  color: var(--fg-dim);
  background: var(--neutral-soft);
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.badge-pagada,
.badge-paid,
.badge-completed,
.badge-active,
.badge-deployed {
  background: var(--success-soft);
  color: var(--success);
}

.badge-pendiente,
.badge-pending {
  background: var(--warn-soft);
  color: var(--warn);
}

.badge-overdue,
.badge-expired,
.badge-terminated {
  background: var(--danger-soft);
  color: oklch(0.82 0.13 25);
}

.badge-info,
.badge-filed,
.badge-approved,
.badge-in_warehouse {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge-drafting,
.badge-drafted,
.badge-suspended,
.badge-maintenance {
  background: var(--warn-soft);
  color: var(--warn);
}

.badge-priority-low {
  background: var(--success-soft);
  color: var(--success);
}

.badge-priority-medium {
  background: var(--warn-soft);
  color: var(--warn);
}

.badge-priority-high {
  background: var(--danger-soft);
  color: oklch(0.82 0.13 25);
}

.stat-box-value .badge {
  font-size: 1rem;
  padding: 0.4rem 0.85rem;
}

/* legacy status pills */
.status-pending,
.status-approved,
.status-rejected {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  padding: 0.45rem 0.9rem;
  border-radius: 9999px;
  border: 1px solid var(--card-inner-line);
}

.status-pending {
  color: var(--fg-dim);
  background: var(--neutral-soft);
}

.status-approved {
  color: var(--success);
  background: var(--success-soft);
}

.status-rejected {
  color: oklch(0.82 0.13 25);
  background: var(--danger-soft);
}

.dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex: none;
}

.dot-primary {
  background: var(--accent);
}

.dot-muted {
  background: var(--fg-faint);
}


@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/geist.woff2") format('woff2');
}

@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/geist-mono.woff2") format('woff2');
}

:root {
  --accent-h: 32;
  --accent: #D57D34;
  --accent-soft: rgba(213, 125, 52, 0.18);
  --accent-dim: #8F5220;
  --accent-grad-from: #E08A44;
  --accent-grad-to: #B4661F;
  --bg: #32312F;
  --bg-2: rgb(36, 36, 34);
  --panel: oklch(0.265 0.005 60);
  --panel-2: oklch(0.295 0.006 60);
  --card: rgb(34, 32, 31);
  --card-inner: #32312F;
  --card-inner-line: rgb(70, 67, 62);
  --line: oklch(0.32 0.008 60);
  --line-soft: oklch(0.28 0.008 60);
  --fg: oklch(0.96 0.005 80);
  --fg-dim: oklch(0.78 0.008 60);
  --fg-muted: oklch(0.58 0.008 60);
  --fg-faint: oklch(0.42 0.008 60);
  --success: oklch(0.75 0.14 150);
  --success-soft: oklch(0.75 0.14 150 / 0.15);
  --warn: oklch(0.78 0.14 75);
  --warn-soft: oklch(0.78 0.14 75 / 0.15);
  --danger: oklch(0.70 0.16 25);
  --danger-soft: oklch(0.70 0.16 25 / 0.15);
  --neutral-soft: oklch(0.55 0.01 60 / 0.2);
  --radius: 14px;
  --radius-inner: 10px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: #32312F;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Geist', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  font-family: inherit;
}

.mono {
  font-family: 'Geist Mono', ui-monospace, Menlo, monospace;
  font-variant-numeric: tabular-nums;
}

.cap {
  font-family: 'Geist Mono', ui-monospace, monospace;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 10.5px;
  color: var(--fg-muted);
  font-weight: 500;
}

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

a:hover {
  text-decoration: none;
}

a:focus {
  outline: none;
}

.hidden {
  display: none;
}

svg {
  display: block;
}

::selection {
  background: var(--accent-soft);
  color: var(--fg);
}

::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

::-webkit-scrollbar-track {
  background: var(--bg-2);
}

::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 6px;
  border: 2px solid var(--bg-2);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--fg-faint);
}


.button-primary,
.btn-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  border: 1px solid #B4661F;
  background: linear-gradient(180deg, #E08A44 0%, #B4661F 100%);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #1a0f04;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s ease, box-shadow 0.15s ease;
}

.button-primary svg,
.btn-primary svg {
  width: 15px;
  height: 15px;
}

.button-primary:hover,
.btn-primary:hover {
  filter: brightness(1.06);
  box-shadow: 0 4px 14px -6px rgba(213, 125, 52, 0.6);
}

.button-primary:active,
.btn-primary:active {
  filter: brightness(0.97);
}

.button-primary:focus,
.btn-primary:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.button-primary:disabled,
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.button-gray {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-dim);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.button-gray:hover {
  background: var(--panel);
  border-color: var(--fg-faint);
  color: var(--fg);
}

.button-gray:active {
  transform: translateY(1px);
}

.button-gray:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--neutral-soft);
}

.button-danger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  background: var(--danger-soft);
  border: 1px solid var(--danger);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: oklch(0.82 0.13 25);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.button-danger:hover {
  background: oklch(0.70 0.16 25 / 0.28);
}

.button-danger:active {
  transform: translateY(1px);
}

.button-danger:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--danger-soft);
}

.button-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.3rem 0.75rem;
  font-size: 0.8125rem;
  border-radius: 8px;
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--fg-dim);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-sm:hover {
  background: var(--panel);
  color: var(--fg);
}

.btn-secondary {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--fg-dim);
}

.btn-secondary:hover {
  background: var(--panel-2);
  color: var(--fg);
}


.card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
}

.card-body {
  padding: 0.875rem 1rem;
}

.card-stat {
  padding: 0.875rem;
}

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

.card-stat-value {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

.card-stat-footer {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line-soft);
}

.list-item:last-child {
  border-bottom: none;
}

.list-item-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.list-item-right {
  text-align: right;
  flex-shrink: 0;
}

.empty-state {
  text-align: center;
  color: var(--fg-faint);
  font-size: 0.875rem;
  padding: 2rem 1rem;
}

.icon-circle {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-circle svg {
  width: 1rem;
  height: 1rem;
}

.icon-green,
.icon-yellow,
.icon-red,
.icon-blue {
  background: var(--accent-soft);
  color: var(--accent);
}

.icon-box {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--neutral-soft);
  color: var(--fg-dim);
  flex-shrink: 0;
}

.icon-maintenance {
  background: var(--warn-soft);
  color: var(--warn);
}

.icon-transport {
  background: var(--accent-soft);
  color: var(--accent);
}

.icon-salaries {
  background: var(--success-soft);
  color: var(--success);
}

.avatar {
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
}

.avatar-sm {
  width: 2.25rem;
  height: 2.25rem;
  font-size: 0.75rem;
}

.client-detail,
.invoice-detail,
.expense-detail,
.loan-detail,
.contract-detail,
.task-detail,
.route-detail {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.client-stats-row,
.invoice-stats-row,
.expense-stats-row,
.loan-stats-row,
.contract-stats-row,
.task-stats-row,
.route-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stat-box {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stat-box-label {
  font-family: 'Geist Mono', ui-monospace, monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.6875rem;
  color: var(--fg-muted);
  font-weight: 500;
}

.stat-box-value {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
}

.stat-box-value-sm {
  font-size: 1rem;
}

.client-info-grid,
.invoice-info-grid,
.expense-info-grid,
.loan-info-grid,
.contract-info-grid,
.task-info-grid,
.route-info-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

.client-info-card,
.invoice-info-card,
.expense-info-card,
.loan-info-card,
.contract-info-card,
.task-info-card,
.route-info-card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 1.5rem;
}

.client-info-card h3,
.invoice-info-card h3,
.expense-info-card h3,
.loan-info-card h3,
.contract-info-card h3,
.task-info-card h3,
.route-info-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--line-soft);
}

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

.info-label {
  font-size: 0.875rem;
  color: var(--fg-muted);
}

.info-value {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg);
  text-align: right;
}

.client-actions-card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.client-actions-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.5rem;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
  color: var(--fg-dim);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
}

.action-btn:hover {
  background: var(--panel);
  border-color: var(--fg-faint);
  color: var(--fg);
}

.action-btn-primary {
  background: linear-gradient(180deg, var(--accent-grad-from) 0%, var(--accent-grad-to) 100%);
  border-color: #B4661F;
  color: #1a0f04;
  font-weight: 600;
}

.action-btn-primary:hover {
  filter: brightness(1.05);
  background: linear-gradient(180deg, var(--accent-grad-from) 0%, var(--accent-grad-to) 100%);
  border-color: #B4661F;
  color: #1a0f04;
}

.action-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.client-section,
.invoice-section,
.expense-section,
.loan-section,
.contract-section,
.task-section,
.route-section {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 1.5rem;
}

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

.section-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
  margin: 0;
}

.section-link {
  font-size: 0.875rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.section-link:hover {
  color: var(--accent-grad-from);
  text-decoration: underline;
}

.expense-actions,
.loan-actions,
.contract-actions,
.task-actions,
.route-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

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

.text-warning {
  color: var(--warn);
}

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

.client-link-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.client-link-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.client-link-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--fg);
}

.client-link-phone {
  font-size: 0.875rem;
  color: var(--fg-muted);
}

.payment-actions {
  padding: 0.5rem 0;
}

.payment-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.payment-form-row {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
}

.payment-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  flex: 1;
}

.payment-input-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg-dim);
}

.payment-input {
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 1rem;
  width: 100%;
  background: var(--bg-2);
  color: var(--fg);
}

.payment-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.loan-progress-section {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 1.25rem;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg-dim);
}

.progress-percentage {
  font-weight: 600;
  color: var(--accent);
}

.progress-bar {
  height: 0.5rem;
  background: var(--line);
  border-radius: 0.25rem;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-grad-to) 0%, var(--accent-grad-from) 100%);
  border-radius: 0.25rem;
  transition: width 0.3s ease;
}

.contract-description,
.task-description {
  font-size: 0.875rem;
  color: var(--fg-dim);
  line-height: 1.6;
}

.task-description {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.contract-description p,
.task-description p {
  margin: 0 0 0.5rem 0;
}

.task-actions form {
  display: flex;
}

.task-actions .action-btn {
  flex: 1;
  justify-content: center;
}

.overdue-badge {
  font-size: 0.75rem;
  color: var(--danger);
  font-weight: 500;
}

.relation-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--line-soft);
}

.relation-item:last-child {
  border-bottom: none;
}

.relation-label {
  font-size: 0.875rem;
  color: var(--fg-muted);
}

.relation-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}

.relation-link:hover {
  color: var(--accent-grad-from);
  text-decoration: underline;
}

@media (max-width: 768px) {
  .client-stats-row,
  .invoice-stats-row,
  .expense-stats-row,
  .loan-stats-row,
  .contract-stats-row,
  .task-stats-row,
  .route-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .client-info-grid,
  .invoice-info-grid,
  .expense-info-grid,
  .loan-info-grid,
  .contract-info-grid,
  .task-info-grid,
  .route-info-grid {
    grid-template-columns: 1fr;
  }
}

.tax-record-detail,
.employee-detail,
.payroll-detail,
.shelf-detail {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.tax-record-stats-row,
.employee-stats-row,
.payroll-stats-row,
.shelf-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.tax-record-info-grid,
.employee-info-grid,
.payroll-info-grid,
.shelf-info-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

.tax-record-info-card,
.tax-record-section,
.employee-info-card,
.employee-section,
.payroll-info-card,
.payroll-section,
.shelf-info-card,
.shelf-section {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 1.5rem;
}

.tax-record-info-card h3,
.employee-info-card h3,
.payroll-info-card h3,
.shelf-info-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.tax-record-actions,
.employee-actions,
.payroll-actions,
.shelf-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (max-width: 768px) {
  .tax-record-stats-row,
  .employee-stats-row,
  .payroll-stats-row,
  .shelf-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .tax-record-info-grid,
  .employee-info-grid,
  .payroll-info-grid,
  .shelf-info-grid {
    grid-template-columns: 1fr;
  }
}

.cctv-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 8px;
  display: block;
  background: #000;
}

.cctv-placeholder {
  aspect-ratio: 16 / 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-align: center;
  padding: 2rem;
  color: var(--fg-muted);
}

.cctv-placeholder svg {
  color: var(--fg-faint);
}

.cctv-placeholder p {
  margin: 0;
  max-width: 420px;
  font-size: 0.875rem;
}


.dashboard {
  margin: 0 auto;
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 0 14px;
  border-bottom: 1px solid var(--line-soft);
}

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

.crumbs .sep {
  margin: 0 8px;
  color: var(--fg-faint);
}

.crumbs .now {
  color: var(--accent);
}

.topbar .spacer {
  flex: 1;
}

.topbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex: none;
  display: grid;
  place-items: center;
  background: conic-gradient(from 210deg, oklch(0.6 0.12 30), oklch(0.45 0.08 20), oklch(0.55 0.1 40), oklch(0.6 0.12 30));
  border: 1px solid var(--line);
  color: #1a1108;
  font-size: 12px;
  font-weight: 700;
  font-family: 'Geist Mono', monospace;
}

/* ---------- Hero ---------- */
.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 18px 0 14px;
  gap: 20px;
  flex-wrap: wrap;
}

.hero h1 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--fg);
}

.hero h1 .wave {
  display: inline-block;
}

.hero-sub {
  font-size: 13px;
  color: var(--fg-muted);
  margin: 6px 0 0;
}

.controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* legacy header (kept themed) */
.dashboard-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .dashboard-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}

/* ---------- KPI row ---------- */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 6px;
}

.kpi {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  position: relative;
  background: rgb(34, 32, 31);
  padding: 2px;
  gap: 0;
}

.kpi .top {
  background: #32312F;
  padding: 14px;
  border: 1px solid rgb(70, 67, 62);
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  height: 78px;
  margin: 0;
}

.kpi .top > div:first-child {
  min-width: 0;
  flex: 1;
}

.kpi .bot {
  padding: 4px 10px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--fg-muted);
  height: 32px;
}

.kpi .num {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: block;
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--fg);
}

.kpi .sub {
  color: var(--fg-muted);
  font-size: 11.5px;
  margin-left: 6px;
  font-weight: 500;
}

.kpi .leading {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--fg-faint);
  background: rgb(30, 28, 27);
  flex: none;
}

.kpi .leading svg {
  width: 13px;
  height: 13px;
}

.kpi .delta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi .delta.down {
  color: oklch(0.7 0.15 25);
}

.kpi .delta.pos {
  color: oklch(0.8 0.16 150);
}

/* mini bars */
.mini-bars {
  display: flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 38px;
  flex: none;
}

.mini-bars .col {
  width: 3px;
  border-radius: 1.5px;
  background: rgb(78, 74, 68);
}

.mini-bars .col.hot {
  background: #D57D34;
}

/* ---------- Panels ---------- */
.panel {
  background: rgb(34, 32, 31);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 2px;
  display: flex;
  flex-direction: column;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px 8px;
}

.panel-head .title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-inner {
  background: #32312F;
  border: 1px solid rgb(70, 67, 62);
  border-radius: 10px;
  padding: 12px 14px 14px;
  flex: 1;
}

.panel-inner > .tot {
  font-size: 13px;
  color: var(--fg-muted);
  margin-bottom: 8px;
}

.panel-inner > .tot b {
  color: var(--fg);
  font-weight: 600;
  margin-left: 6px;
  font-size: 15px;
  font-family: 'Geist Mono', ui-monospace, monospace;
}

.panel-inner > .legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 0 0 8px;
}

.panel-link {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  transition: color 0.15s ease;
}

.panel-link:hover {
  color: var(--accent-grad-from);
}

.info {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--fg-faint);
  display: inline-grid;
  place-items: center;
  color: var(--fg-faint);
  font-size: 9px;
}

/* ---------- Tabs ---------- */
.tabs {
  display: inline-flex;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: #2A2827;
  gap: 0;
}

.tabs button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--fg-muted);
  padding: 6px 16px;
  border-radius: 999px;
  font-family: 'Geist', sans-serif;
  font-size: 12px;
  cursor: pointer;
  margin: -1px;
}

.tabs button.on {
  background: #3B3A3A;
  color: var(--fg);
  border: 1px solid rgb(70, 67, 62);
}

/* ---------- Chart blocks ---------- */
.dash-charts {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.dash-charts .chart-block {
  margin-top: 0;
  min-width: 0;
}

.dash-charts .chart-block > .panel {
  height: 100%;
}

@media (max-width: 1100px) {
  .dash-charts {
    grid-template-columns: 1fr;
  }
}

.chart-block {
  margin-top: 12px;
}

.chart-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 2px 0 10px;
}

.chart-meta .tot {
  font-size: 13px;
  color: var(--fg-muted);
}

.chart-meta .tot b {
  color: var(--fg);
  font-weight: 600;
  margin-left: 6px;
  font-size: 15px;
}

.legend {
  display: flex;
  gap: 14px;
  margin-left: auto;
}

.legend .it {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--fg-dim);
}

.legend .sw {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--fg-muted);
}

.legend .sw.hot {
  background: var(--accent);
}

.chart-canvas {
  margin-top: 4px;
}

/* ---------- Recent panels grid ---------- */
.panels-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}

@media (max-width: 1024px) {
  .kpis {
    grid-template-columns: repeat(2, 1fr);
  }

  .panels-3 {
    grid-template-columns: 1fr;
  }
}

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


.dropdown {
  position: relative;
}

.dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 8px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-dim);
  cursor: pointer;
  transition: all 0.15s ease;
}

.dropdown-toggle svg {
  color: var(--fg-faint);
}

.dropdown-toggle:hover {
  border-color: var(--line);
  color: var(--fg);
}

.dropdown-toggle.pill {
  border-radius: 10px;
  border-color: var(--line-soft);
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 50px -16px rgba(0, 0, 0, 0.8);
  min-width: 200px;
  z-index: 1000;
  overflow: hidden;
}

.dropdown-menu.active {
  display: block;
}

.dropdown-menu-lg {
  min-width: 280px;
}

.dropdown-section {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}

.dropdown-section:last-child {
  border-bottom: none;
}

.dropdown-section-title {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.625rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.5rem 1rem;
}

.dropdown-item {
  display: block;
  padding: 0.55rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg-dim);
  transition: background 0.15s, color 0.15s;
}

.dropdown-item:hover {
  background: var(--panel);
  color: var(--fg);
}

.dropdown-item.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.dropdown-form {
  padding: 0 1rem 0.75rem;
}

.quick-select-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.quick-select-btn {
  padding: 0.5rem 0.75rem;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--fg-dim);
  cursor: pointer;
  transition: all 0.15s;
}

.quick-select-btn:hover {
  background: var(--panel);
  border-color: var(--fg-faint);
  color: var(--fg);
}

@media (max-width: 768px) {
  .dropdown-menu {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    margin-top: 0;
    border-radius: 1rem 1rem 0 0;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1001;
  }
}


.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  color: var(--fg-dim);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.375rem;
}

.form-control,
input.form-control,
select.form-control,
textarea.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="tel"],
input[type="url"],
select,
textarea {
  display: block;
  width: 100% !important;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
  color: var(--fg);
  box-shadow: none;
  padding: 0.55rem 0.8rem;
  font-size: 0.875rem;
  line-height: 1.5;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  box-sizing: border-box;
}

input::placeholder,
textarea::placeholder {
  color: var(--fg-faint);
}

.form-control:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="datetime-local"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-control:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  background-color: var(--panel);
  color: var(--fg-muted);
  cursor: not-allowed;
}

select.form-control,
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%238f8b85' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

textarea.form-control,
textarea {
  min-height: 6rem;
  resize: vertical;
}

.form-error {
  color: oklch(0.82 0.13 25);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.form-hint {
  color: var(--fg-muted);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.form-error-notification {
  background: var(--danger-soft);
  border: 1px solid var(--danger);
  border-left: 4px solid var(--danger);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.form-error-notification-content {
  display: flex;
  align-items: flex-start;
}

.form-error-notification-icon {
  flex-shrink: 0;
}

.form-error-notification-icon svg {
  height: 1.25rem;
  width: 1.25rem;
  color: oklch(0.82 0.13 25);
}

.form-error-notification-message {
  margin-left: 0.75rem;
  flex: 1;
}

.form-error-notification-heading {
  font-size: 0.875rem;
  font-weight: 600;
  color: oklch(0.85 0.12 25);
}

.form-error-notification-list {
  margin-top: 0.5rem;
}

.form-error-notification-list ul {
  list-style-type: disc;
  padding-left: 1.25rem;
  font-size: 0.875rem;
  color: oklch(0.82 0.13 25);
}

.form-error-notification-list li {
  margin-top: 0.25rem;
}

input[type="checkbox"],
input[type="radio"] {
  width: 1rem;
  height: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.25rem;
  background: var(--bg-2);
  cursor: pointer;
  accent-color: var(--accent);
}

input[type="radio"] {
  border-radius: 50%;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
  background-color: var(--accent);
  border-color: var(--accent);
}

input[type="checkbox"]:focus,
input[type="radio"]:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-group-sm {
  margin-bottom: 0.75rem;
}

.form-group-sm label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--fg-muted);
  margin-bottom: 0.375rem;
}

.form-group-sm input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
  color: var(--fg);
  font-size: 0.875rem;
}

.form-group-sm input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-field-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg-dim);
}

.form-field-input {
  appearance: none;
  display: block;
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
  color: var(--fg);
  box-shadow: none;
  font-size: 0.875rem;
}

.form-field-input::placeholder {
  color: var(--fg-faint);
}

.form-field-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
  border-color: var(--accent);
}

.payment-context {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}


.page-container {
  min-height: 100%;
  background: var(--bg);
}

.main-content {
  min-height: 100vh;
  padding-top: 1rem;
  padding-bottom: 1rem;
  overflow: visible;
  background: var(--bg);
}

.content-wrapper {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  padding-top: 0.75rem;
  padding-bottom: 1.5rem;
  min-height: calc(100vh - 2rem);
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--line-soft);
}

.page-title {
  font-size: 1.625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
  flex-grow: 1;
  margin: 0;
}

.resource-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--line-soft);
}

.resource-actions {
  display: flex;
  align-items: center;
  column-gap: 0.5rem;
}

.resource-title {
  font-size: 1.625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
  flex-grow: 1;
  margin: 0;
}

.resource-new-container {
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.resource-new-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--line-soft);
}

.resource-new-title {
  font-size: 1.625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
}

.details-toggle-btn {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  font-family: 'Geist Mono', ui-monospace, monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.6875rem;
  color: var(--fg-muted);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color 0.15s ease;
}

.details-toggle-btn:hover {
  color: var(--accent);
}

.details-container {
  margin-top: 2rem;
}

@media (min-width: 769px) {
  .main-content {
    margin-left: 240px;
    transition: margin-left 0.3s ease;
  }

  .main-content.sidebar-collapsed {
    margin-left: 0;
  }
}

@media (max-width: 768px) {
  .main-content {
    margin-top: 3.5rem;
  }

  .content-wrapper {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}


body.login-page {
  overflow: hidden;
  background:
    radial-gradient(1100px 520px at 50% -10%, rgba(213, 125, 52, 0.16), transparent 60%),
    radial-gradient(800px 400px at 50% 120%, rgba(213, 125, 52, 0.08), transparent 55%),
    var(--bg);
}

body.login-page .main-content {
  padding: 0;
  margin-left: 0;
  margin-top: 0;
  background: transparent;
}

body.login-page .content-wrapper {
  padding: 0;
}

.login-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
}

@media (min-width: 1024px) {
  .login-container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.login-header {
  width: 100%;
  max-width: 24rem;
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo {
  display: block;
  margin-left: auto;
  margin-right: auto;
  height: 4rem;
  width: 4rem;
}

.login-form-container {
  width: 100%;
  max-width: 24rem;
}

.login-form-inner {
  background: var(--card);
  border: 1px solid var(--line-soft);
  padding: 2rem 1.5rem;
  border-radius: 16px;
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.8);
}

@media (min-width: 640px) {
  .login-form-inner {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
  }
}

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

.login-submit-btn {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.7rem 1rem;
  border: 1px solid #B4661F;
  border-radius: 10px;
  box-shadow: 0 6px 18px -8px rgba(213, 125, 52, 0.6);
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1a0f04;
  background: linear-gradient(180deg, var(--accent-grad-from) 0%, var(--accent-grad-to) 100%);
  cursor: pointer;
  transition: filter 0.15s ease;
}

.login-submit-btn:hover {
  filter: brightness(1.06);
}

.login-submit-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}


.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.125rem;
  margin: 1.5rem 0;
}

.pagination .page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  font-size: 0.875rem;
  color: var(--fg-muted);
  border: 1px solid transparent;
  border-radius: 8px;
  transition: all 0.15s;
}

.pagination a.page:hover {
  background: var(--panel);
  color: var(--fg);
}

.pagination .page.current {
  background: linear-gradient(180deg, var(--accent-grad-from) 0%, var(--accent-grad-to) 100%);
  border-color: #B4661F;
  color: #1a0f04;
  font-weight: 600;
}

.pagination .page.prev,
.pagination .page.next {
  font-size: 1.125rem;
  color: var(--fg-dim);
}

.pagination .page.disabled {
  color: var(--fg-faint);
  cursor: default;
}

.pagination .page.gap {
  color: var(--fg-faint);
  min-width: auto;
  padding: 0 0.25rem;
}


.sidebar {
  width: 240px;
  min-width: 240px;
  height: 100vh;
  background: var(--bg-2);
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

html.sidebar-collapsed-initial .sidebar {
  transform: translateX(-100%);
  transition: none;
}

html.sidebar-collapsed-initial .sidebar-open-btn {
  display: flex;
  align-items: center;
  justify-content: center;
}

html.sidebar-collapsed-initial .main-content {
  margin-left: 0;
}

.sidebar.collapsed {
  transform: translateX(-100%);
}

/* ---------- Workspace pill ---------- */
.workspace {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: #32312F;
}

.ws-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  flex: none;
  background: transparent;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.ws-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.ws-meta {
  flex: 1;
  min-width: 0;
}

.ws-meta .k {
  font-family: 'Geist Mono', monospace;
  font-size: 10.5px;
  color: var(--fg-muted);
  letter-spacing: 0.04em;
}

.ws-meta .v {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-caret {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  background: none;
  border: none;
  border-radius: 7px;
  color: var(--fg-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.ws-caret:hover {
  background: var(--panel);
  color: var(--fg);
}

/* ---------- Nav ---------- */
.sidebar-nav {
  flex: 1;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

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

.nav-section + .nav-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.nav-label {
  font-family: 'Geist Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: oklch(0.88 0.005 80);
  font-size: 10px;
  margin: 0 10px 6px;
  font-weight: 500;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-dim);
  cursor: pointer;
  user-select: none;
  margin-bottom: 1px;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item:hover {
  background: var(--panel);
}

.nav-item .ico {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--fg-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-item .ico svg {
  width: 16px;
  height: 16px;
}

.nav-item:hover .ico {
  color: var(--fg-dim);
}

.nav-item.active {
  background: #32312F;
  color: var(--accent);
  border: 1px solid var(--line);
  position: relative;
}

.nav-item.active .ico {
  color: var(--accent);
}

/* ---------- User pill ---------- */
.user-pill {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--panel);
}

.user-pill .avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex: none;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, oklch(0.6 0.12 40), oklch(0.45 0.08 30));
  border: 1px solid var(--line);
  color: #1a1108;
  font-size: 12px;
  font-weight: 700;
  font-family: 'Geist Mono', monospace;
}

.user-pill .avatar.rounded {
  border-radius: 50%;
}

.user-meta {
  flex: 1;
  min-width: 0;
}

.user-pill .name {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-pill .plan {
  font-size: 11px;
  color: var(--fg-muted);
}

.user-pill form {
  display: flex;
  margin: 0;
}

.user-logout {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--fg-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.user-logout:hover {
  color: var(--danger);
  border-color: var(--line);
  background: var(--danger-soft);
}

.user-logout svg {
  width: 15px;
  height: 15px;
}

/* ---------- Floating open button (desktop collapsed) ---------- */
.sidebar-open-btn {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 90;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px -6px rgba(0, 0, 0, 0.7);
  color: var(--fg-dim);
}

.sidebar-open-btn:hover {
  background: var(--panel);
  color: var(--fg);
}

.sidebar-open-btn.visible {
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-open-btn img {
  width: 1.1rem;
  height: 1.1rem;
  filter: invert(82%) sepia(6%) saturate(180%) hue-rotate(10deg) brightness(95%);
}

/* ---------- Mobile header ---------- */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5rem;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line-soft);
  z-index: 90;
  padding: 0 1rem;
  align-items: center;
  justify-content: space-between;
}

.mobile-menu-btn {
  background: none;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  cursor: pointer;
  padding: 0.45rem;
  color: var(--fg-dim);
  display: flex;
  transition: all 0.2s ease;
}

.mobile-menu-btn:hover {
  color: var(--fg);
  border-color: var(--line);
}

.mobile-menu-btn img {
  width: 1.35rem;
  height: 1.35rem;
  filter: invert(82%) sepia(6%) saturate(180%) hue-rotate(10deg) brightness(95%);
}

.mobile-logo {
  height: 1.5rem;
  width: auto;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* ---------- Visibility helpers ---------- */
.desktop-only {
  display: grid;
}

.mobile-only {
  display: none;
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .sidebar.collapsed {
    transform: translateX(-100%);
  }

  .mobile-header {
    display: flex;
  }

  .sidebar-open-btn {
    display: none !important;
  }

  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: grid !important;
  }
}


.table-primary {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  overflow: hidden;
}

.table-primary thead {
  background: var(--bg-2);
}

.table-primary thead th {
  padding: 0.65rem 0.85rem;
  text-align: left;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 0.625rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.table-primary tbody td {
  white-space: nowrap;
  padding: 0.7rem 0.85rem;
  font-size: 0.8125rem;
  color: var(--fg-dim);
}

.table-primary tbody tr {
  transition: background-color 0.15s ease-in-out;
  border-bottom: 1px solid var(--line-soft);
}

.table-primary tbody tr:last-child {
  border-bottom: none;
}

.table-primary tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.table-primary tbody tr.clickable-row {
  cursor: pointer;
}

.table-primary tbody tr.bg-danger {
  background: var(--danger-soft);
}

.table-primary tbody tr.bg-danger:hover {
  background: oklch(0.70 0.16 25 / 0.24);
}

.table-primary tbody tr.bg-warning {
  background: var(--warn-soft);
}

.table-primary tbody tr.bg-warning:hover {
  background: oklch(0.78 0.14 75 / 0.24);
}

.table-container {
  margin-top: 1rem;
  overflow-x: auto;
  border-radius: 14px;
}

.table-wrapper {
  min-width: 100%;
}

.table-inner {
  min-width: 100%;
}


.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-6 { margin-top: 1.5rem; }

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.uppercase { text-transform: uppercase; }
.text-right { text-align: right; }
.text-center { text-align: center; }

.text-muted { color: var(--fg-muted); }
.text-primary { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger { color: oklch(0.82 0.13 25); }
.text-warning { color: var(--warn); }

.text-green-500 { color: var(--success); }
.text-green-600 { color: var(--success); }
.text-red-500 { color: oklch(0.82 0.13 25); }
.text-red-600 { color: oklch(0.82 0.13 25); }
.text-gray-400 { color: var(--fg-faint); }
.text-gray-500 { color: var(--fg-muted); }
.text-gray-600 { color: var(--fg-muted); }
.text-gray-700 { color: var(--fg-dim); }

.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
