:root {
  --blue: #123c69;
  --gold: #d6a84f;
  --bg: #f5f7fb;
  --card: #ffffff;
  --line: #d9e2ef;
  --text: #172033;
  --muted: #697386;
  --danger: #c2410c;
  --ok: #13795b;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Pretendard, Apple SD Gothic Neo, Malgun Gothic, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 34px 42px;
  background: linear-gradient(135deg, var(--blue), #0d2540);
  color: white;
}
.hero h1 { margin: 6px 0 8px; font-size: 32px; }
.hero p { margin: 0; color: #dfe8f5; }
.eyebrow { color: var(--gold); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 800; }
.hero-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.install-app-button { background: #22c55e; color: white; }
@media (display-mode: standalone) {
  body { padding-top: env(safe-area-inset-top); }
  .hero { padding-top: calc(28px + env(safe-area-inset-top)); }
}
button {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  background: var(--gold);
  color: #1f2937;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0,0,0,.14);
}
button.secondary { background: white; }

main { padding: 26px 42px 36px; }
.hidden { display: none !important; }
.view-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 18px; }
.view-tab { background: white; border: 1px solid var(--line); box-shadow: none; color: var(--blue); }
.view-tab.active { background: var(--gold); color: #1f2937; box-shadow: 0 8px 18px rgba(0,0,0,.14); }
.access-modal { position: fixed; inset: 0; background: rgba(15,23,42,.56); z-index: 99; display: grid; place-items: center; padding: 18px; }
.access-card { width: min(420px, 100%); background: white; border-radius: 18px; border: 1px solid var(--line); box-shadow: 0 24px 70px rgba(0,0,0,.25); padding: 24px; display: grid; gap: 12px; }
.access-card h2 { margin: 0; }
.access-card input[type="password"], .password-settings input[type="password"] { border: 1px solid var(--line); border-radius: 12px; padding: 12px; font: inherit; }
.access-actions, .password-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.access-error { color: var(--danger); font-weight: 900; margin: 0; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 16px; margin-bottom: 20px; }
.store-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 18px; }
.store-tab { background: white; border: 1px solid var(--line); box-shadow: none; color: var(--blue); display: flex; gap: 10px; align-items: center; }
.store-tab span { color: var(--muted); font-size: 12px; }
.store-tab.active { background: var(--blue); color: white; border-color: var(--blue); box-shadow: 0 8px 18px rgba(18,60,105,.18); }
.store-tab.active span { color: #dfe8f5; }
.card, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(18, 60, 105, .08);
}
.card { padding: 18px; }
.card .num { font-size: 30px; font-weight: 900; margin-top: 6px; }
.card .num.text-num { font-size: 22px; line-height: 1.2; }
.card .label { color: var(--muted); font-size: 13px; }
.panel { padding: 22px; margin-bottom: 20px; }
.panel-title { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-bottom: 14px; }
.panel h2 { margin: 2px 0 0; }
.hint { color: var(--muted); margin: 0; font-size: 13px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; }
.table-toolbar { display: grid; gap: 10px; margin-bottom: 12px; }
.inventory-filter-grid { display: grid; grid-template-columns: minmax(180px, 1.4fr) minmax(150px, .8fr) minmax(150px, .8fr) auto; gap: 10px; align-items: end; }
.inventory-filter-grid label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 900; }
.inventory-filter-grid input, .inventory-filter-grid select { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit; background: white; color: var(--text); }
.inventory-filter-summary { color: var(--muted); font-size: 13px; font-weight: 800; }
.category-toggle { background: transparent; color: var(--blue); box-shadow: none; padding: 4px 0; }
table { width: 100%; border-collapse: collapse; min-width: 860px; }
th, td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; font-size: 14px; }
th { background: #eef3fa; color: #344055; position: sticky; top: 0; z-index: 1; }
tr:last-child td { border-bottom: 0; }
.category-row td { background: #f8fafc; color: var(--blue); font-weight: 900; }
input[type="number"] { width: 78px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; }
.threshold-input { width: 72px; background: #fffdf7; border-color: #d6a84f; font-weight: 800; }
.stock-count-control { display: grid; gap: 7px; min-width: 112px; }
.inventory-check-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--blue); font-weight: 900; }
.inventory-check-label input { width: 16px; height: 16px; accent-color: var(--ok); }
.inventory-check-label span { white-space: nowrap; }
.muted-text { color: var(--muted); }
.status-needed { color: var(--danger); font-weight: 900; }
.status-ok { color: var(--ok); font-weight: 800; }
.status-waiting { display: inline-block; margin-left: 6px; color: #92400e; background: #fef3c7; border-radius: 999px; padding: 2px 7px; font-size: 12px; font-weight: 900; }
.grid-two { display: grid; grid-template-columns: 1.25fr .75fr; gap: 20px; }
.branch-inventory-grid { display: grid; grid-template-columns: repeat(3, minmax(280px, 1fr)); gap: 14px; }
.branch-inventory-card { border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 14px; }
.branch-inventory-card h3 { margin: 0 0 10px; color: var(--blue); }
.branch-inventory-card table { min-width: 760px; }
.expiration-expired { color: #991b1b; font-weight: 900; }
.expiration-soon { color: #c2410c; font-weight: 900; }
.expiration-month { color: #b45309; font-weight: 900; }
.expiration-ok { color: var(--ok); font-weight: 800; }
.expiration-missing { color: var(--muted); }
.expiration-panel { border-left: 6px solid #f59e0b; }
.expiration-alert-panel { display: grid; gap: 12px; }
.expiration-alert-header { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.expiration-alert-header strong { color: var(--blue); font-size: 18px; }
.expiration-alert-counts { display: flex; gap: 8px; flex-wrap: wrap; }
.expiration-alert-counts span { border: 1px solid var(--line); border-radius: 999px; padding: 7px 10px; background: #fff7ed; font-size: 12px; font-weight: 900; }
.expiration-alert-list { display: grid; gap: 8px; padding: 0; margin: 0; list-style: none; }
.expiration-alert-item { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.expiration-alert-expired, .expiration-alert-soon { border-color: #fed7aa; background: #fff7ed; }
.expiration-alert-month { border-color: #fde68a; background: #fffbeb; }
.expiration-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.date-picker-label { display: inline-grid; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 900; }
.date-picker-label span { color: var(--blue); }
.expiration-date-input { min-width: 150px; border-width: 2px; background: #fff; cursor: pointer; }
.expiration-date-input.expiration-expired, .expiration-date-input.expiration-soon { border-color: #fb923c; background: #fff7ed; }
.expiration-date-input.expiration-month { border-color: #f59e0b; background: #fffbeb; }
.compact table { min-width: 620px; }
.transfer-list { display: grid; gap: 10px; }
.transfer-card { border: 1px solid var(--line); border-left: 5px solid var(--gold); border-radius: 14px; padding: 14px; background: #fffdf7; }
.transfer-card strong { display: block; margin-bottom: 4px; }
.analytics-list { display: grid; gap: 10px; }
.analytics-card { border: 1px solid var(--line); border-left: 5px solid var(--blue); border-radius: 14px; padding: 12px 14px; background: #f8fbff; display: grid; gap: 4px; }
.analytics-card strong { color: var(--blue); }
.analytics-card span { color: var(--text); font-size: 14px; }
.empty { color: var(--muted); padding: 18px; background: #f8fafc; border-radius: 12px; }
.purchase-summary { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; }
.purchase-pill { background: #eef3fa; border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; font-size: 13px; font-weight: 800; }
.recommend-badge { color: var(--ok); font-weight: 900; }
.supplier-groups { margin-top: 14px; }
.pending-order-list { margin-top: 14px; }
.order-list-box { border: 1px solid var(--line); border-left: 5px solid var(--gold); border-radius: 14px; padding: 14px; background: #fffdf7; }
.order-list-box h3 { margin: 0; }
.order-list-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.order-list-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.order-list-groups { display: grid; gap: 10px; }
.small-action { padding: 7px 10px; border-radius: 9px; font-size: 12px; box-shadow: none; margin-bottom: 6px; }
.text-button { background: transparent; color: var(--danger); box-shadow: none; padding: 2px 6px; font-size: 12px; }
.supplier-groups h3 { margin: 0 0 10px; font-size: 16px; }
.supplier-grid { display: grid; gap: 10px; }
.supplier-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: #fffdf7; }
.supplier-card ul { margin: 8px 0 12px; padding-left: 18px; }
.admin-supplier-card { background: #f8fbff; }
.admin-supplier-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.store-pill { display: inline-block; margin-right: 6px; padding: 3px 8px; border-radius: 999px; background: #e0f2fe; color: #075985; font-size: 12px; font-weight: 900; }
.shopping-panel { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: #f8fbff; }
.shopping-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.shopping-header p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.criteria-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; font-weight: 800; color: var(--blue); }
.criteria-row span { background: white; border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; color: var(--text); font-size: 12px; }
.shopping-task-grid { display: grid; gap: 10px; }
.shopping-task { display: grid; grid-template-columns: 34px 1fr; gap: 12px; background: white; border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.shopping-task.needs-user-action { border-color: #fed7aa; background: #fff7ed; }
.cart-status-summary { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 12px; }
.cart-status-summary span { background: white; border: 1px solid var(--line); border-radius: 999px; padding: 7px 10px; font-size: 12px; font-weight: 900; }
.cart-status-row { display: grid; grid-template-columns: minmax(150px, 220px) 1fr auto; gap: 8px; align-items: end; margin: 8px 0; }
.cart-status-row label { font-size: 12px; color: var(--muted); }
.cart-status-row input { border: 1px solid var(--line); border-radius: 10px; padding: 10px; font: inherit; }
.shopping-task p { margin: 5px 0; }
.shopping-task a { display: inline-block; margin-top: 6px; color: var(--blue); font-weight: 900; }
.mobile-cart-panel { margin: 12px 0; border: 1px solid #bfdbfe; background: #eff6ff; border-radius: 16px; padding: 12px; }
.mobile-cart-head strong { display: block; color: var(--blue); font-size: 16px; margin-bottom: 4px; }
.mobile-cart-head p { margin: 0 0 10px; color: var(--muted); }
.mobile-cart-list { display: grid; gap: 10px; }
.mobile-cart-card { display: grid; grid-template-columns: 34px 1fr; gap: 10px; background: white; border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.mobile-cart-card.complete { border-color: #bbf7d0; background: #f0fdf4; }
.mobile-cart-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.mobile-cart-actions button, .mobile-cart-actions .button-link { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; }
.task-index { width: 30px; height: 30px; border-radius: 999px; background: var(--gold); display: grid; place-items: center; font-weight: 900; }
.memo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.shopping-import-grid { grid-template-columns: 180px 1fr 240px; align-items: end; }
.shopping-login-grid { grid-template-columns: 180px 260px 1fr; align-items: start; }
.button-link { display: inline-block; border-radius: 12px; padding: 12px 16px; background: var(--gold); color: #1f2937; font-weight: 900; text-decoration: none; }
.auth-message { white-space: pre-wrap; background: #0f172a; color: #e2e8f0; border-radius: 12px; padding: 12px; margin: 12px 0 0; }
.wide-field textarea { min-height: 130px; }
label { font-weight: 800; display: grid; gap: 8px; }
textarea, input[type="date"], select, input[data-field] { border: 1px solid var(--line); border-radius: 12px; padding: 10px; font: inherit; }
.item-manager-grid { display: grid; grid-template-columns: repeat(5, minmax(140px, 1fr)); gap: 12px; align-items: end; margin-bottom: 14px; }
.item-manager-grid input[type="number"] { width: 100%; }
.item-manager-actions { display: grid; gap: 8px; align-content: end; }
.item-manager-table-wrap { margin-top: 12px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; min-height: 42px; color: var(--blue); }
.checkbox-label input { width: 18px; height: 18px; accent-color: var(--ok); }
textarea { min-height: 92px; }
input[type="date"] { min-height: auto; }
.expiration-lots-control { min-width: 250px; display: grid; gap: 6px; }
.expiration-lots-help { font-size: 12px; color: var(--muted); font-weight: 900; }
.expiration-lot-row { display: grid; grid-template-columns: 24px 70px minmax(130px, 1fr); gap: 6px; align-items: center; }
.lot-label { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 999px; background: #e8f0fb; color: var(--blue); font-size: 12px; font-weight: 900; }
.expiration-lot-qty { width: 68px; padding: 7px; border: 1px solid var(--line); border-radius: 9px; font: inherit; }
.photo-list { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.order-item-expiry { display: grid; gap: 6px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.order-item-expiry:last-child { border-bottom: 0; }
.order-item-expiry label { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); font-weight: 800; }
.order-item-expiry input[type="date"] { padding: 6px 8px; border-radius: 8px; min-height: auto; }
.photo-list img { width: 56px; height: 56px; object-fit: cover; border: 1px solid var(--line); border-radius: 10px; }
footer { padding: 24px 42px; color: var(--muted); }
@media (max-width: 980px) {
  .hero, .panel-title { flex-direction: column; align-items: flex-start; }
  .cards, .grid-two, .memo-grid, .branch-inventory-grid, .inventory-filter-grid, .item-manager-grid { grid-template-columns: 1fr; }
  main, .hero, footer { padding-left: 18px; padding-right: 18px; }
}
