:root {
  --bg: #0b1220;
  --panel: #121a2b;
  --panel-2: #18233a;
  --text: #e8eefc;
  --muted: #96a6c7;
  --accent: #7cc4ff;
  --border: #26344f;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, system-ui, sans-serif; background: var(--bg); color: var(--text); }
button, input, textarea, select, a { font: inherit; }
button, .button-link { cursor: pointer; background: var(--panel-2); color: var(--text); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
button:hover, .button-link:hover { border-color: var(--accent); }
input, textarea, select { width: 100%; background: #0e1627; color: var(--text); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
textarea { min-height: 120px; resize: vertical; }
label { display: block; margin-bottom: 12px; color: var(--muted); }
.app { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.sidebar { border-right: 1px solid var(--border); padding: 18px; background: #0a1020; }
.sidebar h1 { margin-top: 0; font-size: 1.2rem; }
.nav-btn { display: block; width: 100%; text-align: left; margin-bottom: 10px; }
.nav-btn.active { border-color: var(--accent); color: var(--accent); }
.meta { margin-top: 20px; color: var(--muted); font-size: 0.9rem; word-break: break-word; }
.main { padding: 16px; }
.tab { display: none; }
.tab.active { display: block; }
.panel-grid { display: grid; grid-template-columns: 320px 1fr; gap: 14px; }
.receipts-grid { grid-template-columns: minmax(280px, 360px) 1fr; }
.cron-grid { grid-template-columns: 1fr 1fr 1fr; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 14px; }
.panel-header { display: flex; gap: 10px; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.editor-panel { min-height: 80vh; }
#editor { min-height: 72vh; }
.tree, .list { display: flex; flex-direction: column; gap: 10px; max-height: 78vh; overflow: auto; }
.item { padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: #0e1627; }
.item:hover { border-color: var(--accent); }
.item .small { color: var(--muted); font-size: 0.88rem; margin-top: 4px; word-break: break-word; }
.row { display: flex; gap: 10px; align-items: center; }
.wrap { flex-wrap: wrap; }
.mobile-stack { align-items: stretch; }
.form .inline { display: flex; align-items: center; gap: 8px; }
.form .inline input { width: auto; }
.mobile-form label { margin-bottom: 14px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.tall { min-height: 360px; }
#toast { position: fixed; right: 16px; bottom: 16px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--panel-2); display: none; max-width: 80vw; z-index: 30; }
.auth-screen { position: fixed; inset: 0; background: rgba(5, 10, 20, 0.8); display: grid; place-items: center; z-index: 20; }
.auth-card { width: min(420px, calc(100vw - 32px)); }
.receipts-list-panel { min-height: 70vh; }
.receipt-summary { margin-bottom: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: #0e1627; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filter-btn { min-width: 120px; }
.filter-btn.active { border-color: var(--accent); color: var(--accent); }
.receipt-card { display: grid; grid-template-columns: 92px 1fr; gap: 12px; align-items: start; }
.receipt-thumb { width: 92px; height: 92px; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); background: #0a1020; }
.receipt-thumb-placeholder { display: grid; place-items: center; color: var(--muted); }
.receipt-body strong { display: block; }
@media (max-width: 1100px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--border); }
  .panel-grid, .receipts-grid, .cron-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .main, .sidebar { padding: 12px; }
  .panel { padding: 12px; border-radius: 16px; }
  .panel-header, .mobile-stack { flex-direction: column; align-items: stretch; }
  .row { width: 100%; }
  .row button, .row .button-link { flex: 1; }
  .nav-btn, button, .button-link { min-height: 46px; }
  input, textarea, select { min-height: 46px; }
  #editor { min-height: 45vh; }
  .receipt-card { grid-template-columns: 72px 1fr; }
  .receipt-thumb { width: 72px; height: 72px; }
}
