* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0c0c11;
  --bg-soft: #121218;
  --sidebar-bg: #0f0f15;
  --card-bg: #17171f;
  --card-bg-hover: #1b1b25;
  --border: #24242f;
  --border-soft: #1c1c26;
  --text: #eceef2;
  --text-dim: #9494a3;
  --text-faint: #62626f;
  --accent: #8b6bff;
  --accent-2: #22d3ee;
  --accent-soft: rgba(139, 107, 255, 0.14);
  --danger: #f0546a;
  --danger-soft: rgba(240, 84, 106, 0.12);
  --success: #34d399;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-lg: 0 20px 40px -12px rgba(0, 0, 0, 0.55);
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.app {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* ---------- Sidebar ---------- */

.sidebar {
  width: 250px;
  min-width: 250px;
  background: linear-gradient(180deg, var(--sidebar-bg), #0a0a0f 100%);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 26px 8px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: #0c0c11;
  box-shadow: 0 8px 20px -6px rgba(139, 107, 255, 0.55);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  overflow: hidden;
}

.brand-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  white-space: nowrap;
}

.brand-sub {
  font-size: 11.5px;
  color: var(--text-faint);
  white-space: nowrap;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.sidebar-footer {
  border-top: 1px solid var(--border-soft);
  padding-top: 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item:hover {
  background: var(--bg-soft);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-soft);
  color: #cfc2ff;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ---------- Content ---------- */

.content {
  flex: 1;
  overflow-y: auto;
  padding: 34px 40px 60px;
}

.view { display: none; }
.view.active { display: block; animation: fadein 0.18s ease; }

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

.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 20px;
}

.view-header h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.view-sub {
  color: var(--text-faint);
  font-size: 13px;
  margin-top: 4px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #6f4dff);
  color: #fff;
  box-shadow: 0 8px 20px -8px rgba(139, 107, 255, 0.7);
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }

.btn-ghost {
  background: var(--bg-soft);
  border-color: var(--border);
  color: var(--text-dim);
}
.btn-ghost:hover { color: var(--text); border-color: #33333f; }

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
}
.btn-danger:hover { filter: brightness(1.15); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; margin-top: 14px; }
.btn-icon { padding: 9px; }

/* ---------- Cards / grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px;
}

.item-card {
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.item-card:hover {
  border-color: #322f45;
  background: var(--card-bg-hover);
}

.item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.item-title {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--text);
  overflow-wrap: anywhere;
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #cfc2ff;
  white-space: nowrap;
}

.badge.status-active {
  background: rgba(52, 211, 153, 0.14);
  color: var(--success);
}

.badge.status-inactive {
  background: rgba(240, 84, 106, 0.14);
  color: var(--danger);
}

.item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--text-dim);
}

.item-row .label { color: var(--text-faint); }

.item-row .value {
  color: var(--text);
  font-family: 'Consolas', monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}

.item-link {
  color: var(--accent-2);
  text-decoration: none;
  cursor: pointer;
}
.item-link:hover { text-decoration: underline; }

.item-row .value.phone-value {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: none;
  overflow: visible;
  white-space: nowrap;
}

.phone-timer {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  font-family: inherit;
}
.phone-timer-ok { background: rgba(52, 211, 153, 0.14); color: var(--success); }
.phone-timer-danger { background: rgba(240, 84, 106, 0.16); color: var(--danger); }

.item-notes {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.item-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  border-top: 1px solid var(--border-soft);
  padding-top: 12px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.icon-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.icon-btn:hover { color: var(--text); border-color: #33333f; }
.icon-btn.danger:hover { color: var(--danger); border-color: rgba(240,84,106,0.4); }

.eye-btn {
  background: transparent;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  display: inline-flex;
  padding: 2px;
}
.eye-btn svg { width: 15px; height: 15px; }

.stars { color: #ffb020; letter-spacing: 1px; font-size: 13px; }
.stars .off { color: #3a3a45; }

/* ---------- Empty states ---------- */

.empty-state {
  display: none;
  text-align: center;
  padding: 70px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-faint);
  margin-top: 8px;
}
.empty-state.show { display: block; }
.empty-state p { color: var(--text-dim); font-size: 14px; margin-bottom: 4px; }
.empty-state span { font-size: 12.5px; }

/* ---------- AI / Description view ---------- */

.ai-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text);
}

.dropzone {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 30px 16px;
  text-align: center;
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dropzone svg { width: 26px; height: 26px; margin-bottom: 10px; color: var(--text-faint); }
.dropzone p { font-size: 13px; color: var(--text-dim); }
.dz-hint { font-size: 11.5px; color: var(--text-faint); display: block; margin-top: 4px; }

.thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.thumb {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .remove {
  position: absolute;
  top: 2px; right: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgba(12,12,17,0.8);
  color: #fff;
  border: none;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

.instructions-box {
  margin-top: 18px;
  border-top: 1px solid var(--border-soft);
  padding-top: 14px;
}
.instructions-box summary {
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text-dim);
  user-select: none;
}
.instructions-box textarea {
  width: 100%;
  margin-top: 10px;
  resize: vertical;
}
.instructions-box .btn { margin-top: 10px; }

.check-row {
  display: flex;
  gap: 18px;
  margin: 16px 0 4px;
}
.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}
.check-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

textarea, input[type="text"], input[type="password"], select {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s ease;
}
textarea:focus, input:focus, select:focus { border-color: var(--accent); }
textarea { line-height: 1.6; }

#ai-result { width: 100%; height: 100%; min-height: 380px; }

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.result-header .card-title { margin-bottom: 0; }
.result-actions { display: flex; gap: 8px; }

/* ---------- Accounting ---------- */

.acc-dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.acc-dash-card { }

.acc-dash-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.acc-dash-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-dim);
  padding: 6px 0;
}

.acc-dash-profit {
  border-top: 1px solid var(--border-soft);
  margin-top: 4px;
  padding-top: 10px;
  font-weight: 600;
  color: var(--text);
}

.acc-dash-value { font-weight: 600; }
.acc-dash-value.positive { color: var(--success); }
.acc-dash-value.negative { color: var(--danger); }

.acc-progress-track {
  height: 10px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  overflow: hidden;
  margin: 10px 0 8px;
}
.acc-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  width: 0%;
  transition: width 0.2s ease;
}
.acc-progress-fill.warning { background: linear-gradient(90deg, #f0b429, #f0546a); }
.acc-progress-fill.exceeded { background: var(--danger); }

.acc-section-card { margin-bottom: 20px; }
.acc-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.acc-section-header .card-title { margin-bottom: 0; }

.acc-filter-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.acc-filter-row select { min-width: 130px; }

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

.acc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.acc-table th {
  text-align: left;
  color: var(--text-faint);
  font-weight: 600;
  font-size: 11.5px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}
.acc-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-dim);
  white-space: nowrap;
}
.acc-table tr:last-child td { border-bottom: none; }
.acc-table .cell-strong { color: var(--text); font-weight: 600; }
.acc-table .cell-link { color: var(--accent-2); cursor: pointer; }
.acc-table .cell-link:hover { text-decoration: underline; }
.acc-table .cell-actions { display: flex; gap: 6px; }

/* ---------- Bookkeeping ---------- */

.bk-toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.bk-rate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

#bk-rate-value {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  font-family: 'Consolas', monospace;
}

#bk-rate-updated {
  display: block;
  margin-top: 8px;
}

.bk-tariff-row {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.bk-tariff-row .form-row { margin-bottom: 0; }
.bk-tariff-card .btn { margin-top: 12px; }

.bk-total-row {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.bk-total-row .value {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-2);
  max-width: none;
}

@media (max-width: 900px) {
  .bk-toolbar { grid-template-columns: 1fr; }
  .acc-dash-grid { grid-template-columns: 1fr; }
}

/* ---------- Character ---------- */

.char-create-card { margin-bottom: 20px; }
.char-create-card textarea { width: 100%; margin: 4px 0 14px; }

.char-ref-upload { max-width: 260px; margin-top: 4px; margin-bottom: 6px; }

.char-ratio-options {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  padding: 6px 0 2px;
}

.char-ratio-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  font-family: inherit;
}
.char-ratio-btn:hover { background: var(--bg-soft); }

.char-ratio-shape {
  border: 1.5px solid var(--border);
  border-radius: 4px;
  background: var(--bg-soft);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.char-ratio-text {
  font-size: 10.5px;
  color: var(--text-dim);
  white-space: nowrap;
}

.char-ratio-btn.active .char-ratio-shape {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.char-ratio-btn.active .char-ratio-text {
  color: var(--text);
  font-weight: 600;
}

.char-thumb {
  width: 100%;
  height: 320px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 12px;
  background: var(--bg-soft);
  cursor: zoom-in;
}
.char-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }

.char-fit-card { max-width: 640px; }
.char-section-card { margin-top: 20px; }

.char-fit-photos {
  display: flex;
  gap: 12px;
  margin: 6px 0 16px;
}

.char-fit-photos-sm { margin: 6px 0 0; }
.char-upload-sm { height: 84px; max-width: 200px; }
.char-upload-sm .char-upload-inner { font-size: 11.5px; gap: 5px; }
.char-upload-sm .char-upload-inner svg { width: 17px; height: 17px; }

.char-upload {
  flex: 1;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  overflow: hidden;
  position: relative;
  height: 140px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.char-upload:hover, .char-upload.dragover { border-color: var(--accent); background: var(--accent-soft); }
.char-upload-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 8px;
  color: var(--text-dim);
  font-size: 12.5px;
  text-align: center;
  padding: 8px;
}
.char-upload-inner svg { width: 22px; height: 22px; color: var(--text-faint); }
.char-upload img { width: 100%; height: 100%; object-fit: cover; display: block; }

.char-result-wrap {
  position: relative;
  margin-top: 16px;
}

.char-result {
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 12.5px;
  overflow: hidden;
  background: var(--bg-soft);
  padding: 12px;
  text-align: center;
}
.char-result img { max-width: 100%; max-height: 440px; display: block; border-radius: var(--radius-sm); cursor: zoom-in; }

.char-result-clear {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(12, 12, 17, 0.75);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.char-result-clear:hover { background: rgba(240, 84, 106, 0.85); border-color: transparent; }

.char-result-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.lightbox-overlay {
  cursor: zoom-out;
}
.lightbox-img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
}

@media (max-width: 780px) {
  .char-fit-photos { flex-direction: column; }
}

/* ---------- Settings ---------- */

.settings-card { max-width: 560px; }
.field-label {
  display: block;
  font-size: 12.5px;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.input-with-btn {
  display: flex;
  gap: 8px;
}
.input-with-btn input { flex: 1; }
.settings-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.hint {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.6;
}

/* ---------- Modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 6, 9, 0.6);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  animation: fadein 0.15s ease;
}

.modal {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 440px;
  max-width: 92vw;
  max-height: 86vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow-lg);
}

.modal h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 18px;
}

.form-row { margin-bottom: 14px; }
.form-row label {
  display: block;
  font-size: 12.5px;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.form-row input, .form-row select, .form-row textarea { width: 100%; }

.form-row-inline {
  display: flex;
  gap: 10px;
}
.form-row-inline .form-row { flex: 1; }

.star-picker { display: flex; gap: 4px; }
.star-picker button {
  background: none; border: none; cursor: pointer;
  font-size: 20px; color: #3a3a45; padding: 0;
}
.star-picker button.active { color: #ffb020; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* ---------- Toast ---------- */

.toast-root {
  position: fixed;
  bottom: 22px;
  right: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
}

.toast {
  background: #1c1c26;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  animation: fadein 0.15s ease;
  max-width: 340px;
}
.toast.error { border-color: rgba(240,84,106,0.5); color: #ffb3bd; }
.toast.success { border-color: rgba(52,211,153,0.4); color: #a9f0d3; }

/* ---------- Scrollbar ---------- */

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #26262f; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #33333f; }

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

/* ---------- Mobile off-canvas navigation (web/PWA only) ---------- */

html, body { touch-action: manipulation; overscroll-behavior-y: none; }

.mobile-nav-toggle {
  display: none;
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 44px);
  left: 14px;
  z-index: 60;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.mobile-nav-toggle:active { background: var(--card-bg-hover); }
.mobile-nav-toggle svg { width: 22px; height: 22px; pointer-events: none; }

.mobile-nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.5);
}
.mobile-nav-backdrop.open { display: block; }

@media (max-width: 860px) {
  .mobile-nav-toggle { display: flex; }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }

  .content {
    padding: calc(env(safe-area-inset-top, 0px) + 100px) 16px 40px;
    min-width: 0;
    width: 100%;
  }

  .app { width: 100vw; }

  .view-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .form-row-inline { flex-direction: column; }
  .ai-layout { grid-template-columns: 1fr; }

  table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ---------- Native-app touch feel ---------- */

button, .nav-item, .btn, a { -webkit-tap-highlight-color: transparent; }
