/* Receipt Scanner — Warm paper finance theme */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #10B981;
  --primary-dim: rgba(16,185,129,0.12);
  --primary-glow: rgba(16,185,129,0.3);
  --warm: #FEF3CD;
  --warm-dim: rgba(254,243,205,0.08);
  --bg: #1A1410;
  --bg-card: #231E18;
  --bg-input: #151210;
  --border: rgba(16,185,129,0.12);
  --border-warm: rgba(254,243,205,0.1);
  --text: #F5F0E8;
  --text-dim: #B8A98E;
  --text-muted: #6B5D4E;
  --green: #10B981;
  --red: #EF4444;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --transition: 0.2s ease;
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.6; }

.header { border-bottom: 1px solid var(--border); background: rgba(35,30,24,0.95); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 10; }
.header-inner { max-width: 750px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; }
.header-left { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 1.2rem; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; background: var(--primary-dim); border-radius: var(--radius-sm); }
.header h1 { font-size: 1.05rem; font-weight: 700; }
.subtitle { font-size: 0.72rem; color: var(--text-dim); }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; font-family: var(--font); font-size: 0.82rem; font-weight: 600; border: none; border-radius: 6px; cursor: pointer; transition: all var(--transition); }
.btn-primary { background: linear-gradient(135deg, var(--primary), #059669); color: #1A1410; }
.btn-primary:hover { box-shadow: 0 4px 16px var(--primary-glow); transform: translateY(-1px); }
.btn-secondary { background: transparent; border: 1px solid var(--border); color: var(--text-dim); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

.main { max-width: 750px; margin: 0 auto; padding: 20px; }

.dropzone { border: 2px dashed rgba(16,185,129,0.3); border-radius: var(--radius); padding: 40px; text-align: center; cursor: pointer; transition: all var(--transition); margin-bottom: 16px; }
.dropzone:hover, .dropzone.drag-over { border-color: var(--primary); background: var(--primary-dim); }
.drop-icon { font-size: 2rem; display: block; margin-bottom: 8px; }
.drop-label { font-size: 0.88rem; color: var(--text-dim); }
.drop-label .link { color: var(--primary); text-decoration: underline; }
.drop-hint { font-size: 0.68rem; color: var(--text-muted); margin-top: 4px; }

.progress-section { margin-bottom: 16px; text-align: center; }
.progress-bar { height: 4px; background: rgba(16,185,129,0.1); border-radius: 2px; margin-bottom: 6px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 2px; transition: width 0.2s; width: 0%; }
.progress-text { font-size: 0.75rem; color: var(--text-dim); }

.result-grid { display: grid; grid-template-columns: 200px 1fr; gap: 12px; margin-bottom: 12px; }
.receipt-preview, .extracted-card, .raw-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; border-bottom: 1px solid var(--border); }
.panel-label { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.img-wrap { padding: 10px; text-align: center; }
.img-wrap img { max-width: 100%; border-radius: 6px; }

.data-fields { padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; }
.data-row { display: flex; justify-content: space-between; align-items: center; }
.data-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; }
.data-value { font-family: var(--mono); font-size: 0.82rem; color: var(--text); font-weight: 500; }
.data-value.total { color: var(--green); font-size: 1rem; font-weight: 700; }

.raw-card { margin-bottom: 12px; }
.raw-text { padding: 12px 14px; font-family: var(--mono); font-size: 0.72rem; color: var(--text-dim); line-height: 1.5; overflow-x: auto; white-space: pre-wrap; max-height: 250px; overflow-y: auto; }
.btn-copy { background: none; border: 1px solid var(--border); color: var(--text-muted); padding: 2px 8px; border-radius: 4px; cursor: pointer; font-size: 0.68rem; }
.btn-copy:hover { border-color: var(--primary); color: var(--primary); }

.actions { display: flex; gap: 8px; justify-content: center; margin-bottom: 20px; }

.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column-reverse; gap: 8px; }
.toast { padding: 10px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: 0 4px 24px rgba(0,0,0,0.5); font-size: 0.82rem; animation: toastIn 0.3s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

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