@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Colors - Main (Notion Palette) */
  --color-white: #FFFFFF;
  --color-background-primary: #FFFFFF;
  --color-background-secondary: #F7F6F3;
  --color-text-primary: #37352F;
  --color-text-secondary: #73726E;
  --color-text-tertiary: #9B9A97;
  --color-border-primary: #E8E8E6;
  --color-border-secondary: #DFDFDE;
  --color-border-tertiary: #EEEEEE;

  /* Colors - Point */
  --color-point: #E8400C;
  --color-point-light: rgba(232, 64, 12, 0.1);

  /* Colors - Status */
  --color-danger-bg: #FFE2DD;
  --color-danger-text: #A32D2D;
  --color-warning-bg: #FFF3CD;
  --color-warning-text: #854F0B;
  --color-safe-bg: #DBEDDB;
  --color-safe-text: #27500A;
  --color-info-bg: #E6F1FB;
  --color-info-text: #185FA5;

  /* Dimensions */
  --max-width: 480px;
  --bottom-bar-height: 70px;
  --border-radius-sm: 4px;
  --border-radius-md: 8px;
  --border-radius-lg: 12px;
  --border-radius-xl: 20px;
}

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--color-text-primary);
  background-color: var(--color-background-secondary);
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* PC Responsive Container */
.app-container {
  max-width: var(--max-width);
  margin: 0 auto;
  background-color: var(--color-background-primary);
  min-height: 100vh;
  position: relative;
  box-shadow: 0 0 40px rgba(0,0,0,0.03);
  padding-bottom: calc(var(--bottom-bar-height) + 20px);
}

/* Typography */
h1 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 14px; font-weight: 600; }
.text-sub { font-size: 12px; color: var(--color-text-tertiary); }
.text-secondary { font-size: 13px; color: var(--color-text-secondary); }

/* Buttons */
button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.btn-primary, .cta-btn {
  background-color: var(--color-point);
  color: var(--color-white);
  border-radius: var(--border-radius-md);
  padding: 14px 20px;
  font-weight: 600;
  width: 100%;
  text-align: center;
  font-size: 15px;
}
.btn-primary:active, .cta-btn:active { transform: scale(0.98); opacity: 0.9; }

.btn-secondary, .cta-btn.secondary {
  border: 1px solid var(--color-point);
  color: var(--color-point);
  background-color: var(--color-white);
  border-radius: var(--border-radius-md);
  padding: 13px 20px;
  font-weight: 600;
  width: 100%;
}

.btn-ghost, .cta-btn.ghost {
  border: 1px solid var(--color-border-primary);
  color: var(--color-text-secondary);
  background-color: var(--color-white);
  border-radius: var(--border-radius-md);
  padding: 13px 20px;
  font-weight: 500;
}

/* Common Components */
.card {
  background-color: var(--color-white);
  border: 1px solid var(--color-border-primary);
  border-radius: var(--border-radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  transition: transform 0.2s ease;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

/* Progress & Steps */
.nav-steps { display: flex; gap: 6px; padding: 12px 0; }
.nav-dot { flex: 1; height: 4px; border-radius: 2px; background: var(--color-border-tertiary); }
.nav-dot.active { background: var(--color-point); }
.nav-dot.done { background: var(--color-point); opacity: 0.35; }

/* Status Boxes */
.info-box { background: var(--color-info-bg); color: var(--color-info-text); padding: 12px; border-radius: var(--border-radius-md); font-size: 12px; line-height: 1.6; margin-bottom: 12px; }
.warn-box { background: var(--color-warning-bg); color: var(--color-warning-text); padding: 12px; border-radius: var(--border-radius-md); font-size: 12px; line-height: 1.6; margin-bottom: 12px; display: flex; gap: 8px; }

/* OCR UI Elements */
.camera-view { background: #1A1A1A; border-radius: var(--border-radius-lg); height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; overflow: hidden; margin-bottom: 16px; }
.camera-frame { width: 220px; height: 110px; border: 1.5px solid rgba(255,255,255,0.3); border-radius: 8px; position: relative; }
.camera-corner { position: absolute; width: 16px; height: 16px; border-color: var(--color-point); border-style: solid; border-width: 0; }
.camera-corner.tl { top: -2px; left: -2px; border-top-width: 3px; border-left-width: 3px; border-radius: 4px 0 0 0; }
.camera-corner.tr { top: -2px; right: -2px; border-top-width: 3px; border-right-width: 3px; border-radius: 0 4px 0 0; }
.camera-corner.bl { bottom: -2px; left: -2px; border-bottom-width: 3px; border-left-width: 3px; border-radius: 0 0 0 4px; }
.camera-corner.br { bottom: -2px; right: -2px; border-bottom-width: 3px; border-right-width: 3px; border-radius: 0 0 4px 0; }

.ocr-result-box { background: var(--color-background-secondary); border-radius: var(--border-radius-lg); padding: 12px 14px; margin-bottom: 12px; }
.ocr-label { font-size: 11px; color: var(--color-text-tertiary); margin-bottom: 4px; }
.ocr-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ocr-value { font-size: 15px; font-weight: 600; color: var(--color-text-primary); }

.ocr-confidence { font-size: 10px; padding: 2px 8px; border-radius: 12px; font-weight: 600; }
.ocr-confidence.high { background: var(--color-safe-bg); color: var(--color-safe-text); }
.ocr-confidence.mid { background: var(--color-warning-bg); color: var(--color-warning-text); }
.ocr-confidence.low { background: var(--color-danger-bg); color: var(--color-danger-text); }

/* Checkboxes */
.filter-check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--color-border-secondary); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; }
.filter-check.checked { background: var(--color-point); border-color: var(--color-point); }
.filter-check.checked::after { content: ''; width: 6px; height: 9px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); margin-top: -2px; }

/* Navigation & Header */
.app-header {
  padding: 20px 16px 12px;
  background-color: var(--color-background-primary);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--color-border-tertiary);
}

/* Tabbar - Premium Navigation from Reference */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-width);
  display: flex;
  border-top: 0.5px solid var(--color-border-tertiary);
  padding: 10px 0 calc(env(safe-area-inset-bottom) + 12px);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
}

.tab {
  flex: 1;
  text-align: center;
  font-size: 11px;
  color: var(--color-text-tertiary);
  text-decoration: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.tab.active {
  color: var(--color-point);
  font-weight: 700;
}

.tab-icon {
  font-size: 18px;
  display: block;
}

.tab:active {
  transform: scale(0.92);
  opacity: 0.8;
}

/* Admin Dashboard Styles */
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.metric-card { background: var(--color-white); border: 1px solid var(--color-border-primary); border-radius: var(--border-radius-lg); padding: 16px; }
.metric-value { font-size: 24px; font-weight: 700; margin: 4px 0; }
.metric-sub.up { color: var(--color-safe-text); font-size: 11px; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 12px 8px; color: var(--color-text-tertiary); font-weight: 500; border-bottom: 1px solid var(--color-border-primary); }
.data-table td { padding: 12px 8px; border-bottom: 1px solid var(--color-border-tertiary); }

/* Utilities */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.p-4 { padding: 16px; }
.text-center { text-align: center; }

/* Status Colors */
.bg-danger { background-color: var(--color-danger-bg); }
.bg-warning { background-color: var(--color-warning-bg); }
.bg-safe { background-color: var(--color-safe-bg); }
.text-danger { color: var(--color-danger-text); }
.text-warning { color: var(--color-warning-text); }
.text-safe { color: var(--color-safe-text); }
