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

:root {
  --bg-deep: #0a0b0f;
  --bg-surface: #12131a;
  --bg-card: #1a1b25;
  --bg-card-hover: #22232f;
  --border: #2a2b38;
  --border-subtle: #1e1f2a;
  --text-primary: #e8e6f0;
  --text-secondary: #8b8a97;
  --text-muted: #555460;
  --accent: #f0a050;
  --accent-dim: rgba(240, 160, 80, 0.12);
  --accent-glow: rgba(240, 160, 80, 0.25);
  --green: #5cd6a0;
  --green-dim: rgba(92, 214, 160, 0.12);
  --red: #f06070;
  --red-dim: rgba(240, 96, 112, 0.12);
  --blue: #60a0f0;
  --blue-dim: rgba(96, 160, 240, 0.12);
  --purple: #a080f0;
  --font-body: 'IBM Plex Sans KR', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(240, 160, 80, 0.03) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(96, 160, 240, 0.02) 0%, transparent 60%);
  pointer-events: none;
}

.app { position: relative; max-width: 1200px; margin: 0 auto; padding: 28px 24px 64px; }

/* Header */
.header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--accent), #f07050);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 13px; color: var(--bg-deep);
}
.brand-name { font-size: 12px; font-weight: 500; color: var(--text-muted); letter-spacing: 2px; text-transform: uppercase; }

/* Store tabs */
.store-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.store-tab {
  padding: 7px 16px; border-radius: 20px;
  font-size: 13px; font-weight: 500;
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  color: var(--text-secondary); cursor: pointer; transition: all 0.2s;
}
.store-tab:hover { border-color: var(--border); color: var(--text-primary); }
.store-tab.active {
  background: var(--accent-dim); border-color: var(--accent);
  color: var(--accent); font-weight: 600;
}

/* Date picker bar */
.date-bar {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius); padding: 14px 20px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.date-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.date-preset {
  padding: 6px 14px; border-radius: 6px;
  font-size: 12px; font-weight: 500;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  color: var(--text-secondary); cursor: pointer; transition: all 0.15s;
}
.date-preset:hover { border-color: var(--border); color: var(--text-primary); }
.date-preset.active {
  background: var(--accent-dim); border-color: var(--accent);
  color: var(--accent); font-weight: 600;
}
.date-sep { color: var(--text-muted); font-size: 13px; margin: 0 2px; }
.date-input {
  font-family: var(--font-mono); font-size: 13px;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  color: var(--text-primary); border-radius: 6px; padding: 6px 10px;
  outline: none; width: 148px;
}
.date-input:focus { border-color: var(--accent); }
.date-input::-webkit-calendar-picker-indicator { filter: invert(0.6); cursor: pointer; }

/* Correction warning */
.correction-warning {
  background: var(--red-dim);
  border: 1px solid rgba(240, 96, 112, 0.3);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--red);
  line-height: 1.6;
}
.correction-warning-title {
  font-weight: 600;
  margin-bottom: 4px;
}
.correction-warning-item {
  font-size: 12px;
  color: var(--text-secondary);
  padding-left: 20px;
}

/* Summary cards */
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.summary-card {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius); padding: 18px; position: relative; overflow: hidden;
}
.summary-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
}
.summary-card:nth-child(1)::before { background: var(--accent); }
.summary-card:nth-child(2)::before { background: var(--blue); }
.summary-card:nth-child(3)::before { background: var(--green); }
.summary-card:nth-child(4)::before { background: var(--purple); }
.summary-label { font-size: 11px; font-weight: 500; color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 6px; }
.summary-value {
  font-family: var(--font-mono); font-size: 22px; font-weight: 700; letter-spacing: -0.5px;
}
.summary-card:nth-child(1) .summary-value { color: var(--accent); }
.summary-card:nth-child(2) .summary-value { color: var(--blue); }
.summary-card:nth-child(3) .summary-value { color: var(--green); }
.summary-card:nth-child(4) .summary-value { color: var(--purple); }
.summary-sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; font-family: var(--font-mono); }

.summary-breakdown {
  display: flex; gap: 16px; margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}
.summary-breakdown-item { font-size: 11px; color: var(--text-muted); }
.summary-breakdown-item span { color: var(--text-secondary); font-family: var(--font-mono); }

/* Section */
.section { margin-bottom: 24px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.section-title .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.section-hint { font-size: 11px; color: var(--text-muted); }

.chart-box {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius); padding: 20px;
}
.chart-box canvas { max-height: 280px; }

/* Bills accordion */
.bills-container { padding: 0; overflow: hidden; max-height: 480px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.bills-empty { padding: 40px; text-align: center; color: var(--text-muted); font-size: 13px; }

.bills-day-group { border-bottom: 1px solid var(--border-subtle); }
.bills-day-group:last-child { border-bottom: none; }
.bills-day-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; cursor: pointer;
  font-size: 13px; font-weight: 600;
  background: var(--bg-surface); transition: background 0.1s;
}
.bills-day-header:hover { background: var(--bg-card-hover); }
.bills-expand-icon { font-size: 9px; color: var(--text-muted); transition: transform 0.15s; display: inline-block; }
.bills-expand-icon.open { transform: rotate(90deg); }
.bills-day-label { color: var(--text-primary); }
.bills-day-summary { color: var(--text-muted); font-family: var(--font-mono); font-size: 12px; margin-left: auto; }
.bills-day-content { }

.bills-store-group { border-bottom: 1px solid var(--border-subtle); }
.bills-store-group:last-child { border-bottom: none; }
.bills-store-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; cursor: pointer;
  font-size: 14px; font-weight: 600;
  background: var(--bg-surface); transition: background 0.1s;
}
.bills-store-header:hover { background: var(--bg-card-hover); }
.bills-store-name { color: var(--text-primary); }
.bills-store-group .bills-day-group { border-left: 3px solid var(--border-subtle); margin-left: 8px; }
.bills-store-group .bills-day-header { padding: 10px 16px; font-size: 12px; }

.bill-item { border-bottom: 1px solid var(--border-subtle); }
.bill-item:last-child { border-bottom: none; }
.bill-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; cursor: pointer;
  font-size: 13px; transition: background 0.1s;
}
.bill-row:hover { background: var(--bg-card-hover); }
.bill-time { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); min-width: 40px; }
.bill-store { font-size: 11px; color: var(--text-muted); background: var(--bg-surface); padding: 2px 8px; border-radius: 4px; }
.bill-amount { font-family: var(--font-mono); font-weight: 600; color: var(--text-primary); min-width: 80px; text-align: right; }
.bill-amount.bill-cancel { color: var(--red); }
.bill-payment { font-size: 11px; color: var(--text-muted); min-width: 40px; }
.bill-cancel-tag {
  font-size: 10px; font-weight: 600; color: var(--red);
  background: var(--red-dim); padding: 2px 6px; border-radius: 4px;
}
.bill-mismatch-tag {
  font-size: 10px; font-weight: 600; color: var(--accent);
  background: var(--accent-dim); padding: 2px 6px; border-radius: 4px;
}
.bill-detail-toggle {
  font-size: 11px; color: var(--blue); margin-left: auto; opacity: 0.6;
  transition: opacity 0.1s;
}
.bill-row:hover .bill-detail-toggle { opacity: 1; }

.bill-detail {
  padding: 0 16px; background: var(--bg-surface);
}
.bill-detail-loading { padding: 12px; text-align: center; }
.bill-detail-empty { padding: 12px; color: var(--text-muted); font-size: 12px; }
.bill-detail-table {
  width: 100%; border-collapse: collapse; font-size: 12px; margin: 0;
}
.bill-detail-table th {
  padding: 8px 12px; text-align: left; font-size: 10px; font-weight: 600;
  color: var(--text-muted); letter-spacing: 0.5px; text-transform: uppercase;
  border-bottom: 1px solid var(--border-subtle);
}
.bill-detail-table th:last-child { text-align: right; }
.bill-detail-table td {
  padding: 6px 12px; color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}
.bill-detail-table td:last-child { text-align: right; font-family: var(--font-mono); }
.bill-detail-table tr:last-child td { border-bottom: none; }

/* Product table */
.product-table { width: 100%; border-collapse: collapse; }
.product-table th {
  padding: 10px 14px; text-align: left;
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  letter-spacing: 1px; text-transform: uppercase;
  background: var(--bg-surface); border-bottom: 1px solid var(--border);
}
.product-table th:not(:first-child):not(:nth-child(2)) { text-align: right; }
.product-table td {
  padding: 12px 14px; font-size: 13px; color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}
.product-table td:not(:first-child):not(:nth-child(2)) { text-align: right; font-family: var(--font-mono); }
.product-table td:first-child { color: var(--text-muted); font-family: var(--font-mono); font-size: 12px; }
.product-table tr:hover td { background: var(--bg-card-hover); color: var(--text-primary); }
.product-table td.highlight { color: var(--accent); font-weight: 500; }

/* Product layout */
.product-layout { display: flex; gap: 12px; }
.product-donut-box { width: 280px; min-width: 280px; display: flex; align-items: center; justify-content: center; }
.product-donut-box canvas { max-height: 240px; }

/* Loading */
.placeholder { display: flex; align-items: center; justify-content: center; height: 180px; color: var(--text-muted); font-size: 13px; }
.loading-spinner { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; margin-right: 8px; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Loading overlay for sections */
.loading-overlay {
  position: absolute; inset: 0;
  background: rgba(10, 11, 15, 0.7);
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius); z-index: 10;
  backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity 0.15s;
}
.loading-overlay.active { opacity: 1; pointer-events: auto; }
.section, .summary-grid { position: relative; }

/* Weather - top current */
.weather-current {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius); padding: 12px 20px;
  margin-bottom: 24px; font-size: 13px;
}
.weather-emoji { font-size: 24px; }
.weather-temp { font-family: var(--font-mono); font-size: 20px; font-weight: 700; color: var(--accent); }
.weather-desc { color: var(--text-secondary); }
.weather-wind { color: var(--text-muted); font-family: var(--font-mono); font-size: 12px; }
.weather-range { color: var(--text-muted); font-family: var(--font-mono); font-size: 12px; }
.weather-loc { color: var(--text-muted); font-size: 11px; margin-left: auto; }

/* Weather - cards */
.weather-cards-row {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.weather-card {
  flex: 0 0 auto; min-width: 64px;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm); padding: 10px 8px;
  text-align: center; font-size: 11px;
}
.weather-card-time { color: var(--text-muted); font-family: var(--font-mono); font-size: 11px; margin-bottom: 4px; }
.weather-card-icon { font-size: 20px; margin: 4px 0; }
.weather-card-temp { color: var(--text-primary); font-family: var(--font-mono); font-weight: 600; font-size: 13px; }
.weather-card-range { color: var(--text-muted); font-family: var(--font-mono); font-size: 10px; margin-top: 2px; }
.weather-card-wind { color: var(--text-muted); font-size: 10px; margin-top: 2px; }

/* Responsive */
@media (max-width: 768px) {
  .app { padding: 16px 14px 48px; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .summary-value { font-size: 18px; }
  .date-bar { padding: 12px 14px; }
  .product-layout { flex-direction: column; }
  .product-donut-box { width: 100%; min-width: auto; }
  .weather-current { flex-wrap: wrap; }
  .weather-loc { margin-left: 0; }
  .weather-card { min-width: 56px; }
}
@media (max-width: 480px) {
  .summary-grid { grid-template-columns: 1fr; }
}

/* Settings modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-box {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; width: 520px; max-width: 94vw;
  max-height: 85vh; overflow-y: auto;
}
.modal-title { font-size: 16px; font-weight: 600; margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 20px; cursor: pointer; padding: 4px 8px; }
.modal-close:hover { color: var(--text-primary); }
.modal-section { margin-bottom: 20px; }
.modal-label { font-size: 12px; font-weight: 600; color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 8px; }
.day-toggles { display: flex; gap: 6px; }
.day-toggle {
  padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: 500;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  color: var(--text-secondary); cursor: pointer; transition: all 0.15s;
}
.day-toggle.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.cost-row { display: flex; gap: 8px; margin-bottom: 6px; align-items: center; }
.cost-name-input {
  flex: 1; padding: 8px 12px; border-radius: 6px; font-size: 13px;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  color: var(--text-primary); font-family: var(--font-body); outline: none;
}
.cost-amount-input {
  width: 120px; padding: 8px 12px; border-radius: 6px; font-size: 13px;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  color: var(--text-primary); font-family: var(--font-mono); outline: none; text-align: right;
}
.cost-name-input:focus, .cost-amount-input:focus { border-color: var(--accent); }
.cost-remove { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 16px; padding: 4px 8px; }
.cost-remove:hover { color: var(--red); }
.cost-add-btn {
  padding: 6px 14px; border-radius: 6px; font-size: 12px; font-weight: 500;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  color: var(--text-secondary); cursor: pointer; margin-top: 4px;
}
.cost-add-btn:hover { border-color: var(--accent); color: var(--accent); }
.labor-input {
  width: 160px; padding: 8px 12px; border-radius: 6px; font-size: 13px;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  color: var(--text-primary); font-family: var(--font-mono); outline: none; text-align: right;
}
.labor-input:focus { border-color: var(--accent); }
.computed-info {
  font-size: 12px; color: var(--text-muted); margin-top: 12px; padding: 10px 14px;
  background: var(--bg-surface); border-radius: 6px; font-family: var(--font-mono);
}
.settings-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border-subtle); margin-bottom: 20px; }
.settings-tab {
  padding: 10px 20px; font-size: 13px; font-weight: 500; cursor: pointer;
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text-muted); transition: all 0.15s;
}
.settings-tab:hover { color: var(--text-primary); }
.settings-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.settings-tab-content { display: none; }
.settings-tab-content.active { display: block; }
.product-costs-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.product-costs-table th {
  text-align: left; padding: 8px 10px; font-weight: 600; color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle); font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase;
}
.product-costs-table td { padding: 7px 10px; border-bottom: 1px solid var(--border-subtle); color: var(--text-secondary); }
.product-costs-table tr:last-child td { border-bottom: none; }
.airtable-fetch-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.airtable-fetch-btn {
  padding: 8px 16px; border-radius: 6px; font-size: 12px; font-weight: 500;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  color: var(--text-secondary); cursor: pointer; transition: all 0.15s;
}
.airtable-fetch-btn:hover { border-color: var(--accent); color: var(--accent); }
.last-synced { font-size: 11px; color: var(--text-muted); }
.modal-save-btn {
  width: 100%; padding: 12px; border-radius: var(--radius-sm); border: none;
  background: linear-gradient(135deg, var(--accent), #f07050);
  color: var(--bg-deep); font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: var(--font-body); transition: opacity 0.2s; margin-top: 8px;
}
.modal-save-btn:hover { opacity: 0.9; }
.settings-btn {
  background: none; border: 1px solid var(--border-subtle); border-radius: 8px;
  color: var(--text-muted); cursor: pointer; padding: 6px 10px; font-size: 16px;
  transition: all 0.15s;
}
.settings-btn:hover { border-color: var(--accent); color: var(--accent); }
.store-select-for-settings {
  display: flex; gap: 6px; margin-bottom: 16px;
}
.store-select-btn {
  padding: 6px 14px; border-radius: 6px; font-size: 12px; font-weight: 500;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  color: var(--text-secondary); cursor: pointer; transition: all 0.15s;
}
.store-select-btn.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

/* P&L section */
.pnl-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; }
.pnl-card {
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius); padding: 16px; position: relative; overflow: hidden;
}
.pnl-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; }
.pnl-card:nth-child(1)::before { background: var(--accent); }
.pnl-card:nth-child(2)::before { background: var(--red); }
.pnl-card:nth-child(3)::before { background: var(--blue); }
.pnl-card:nth-child(4)::before { background: var(--green); }
.pnl-card .summary-label { font-size: 11px; font-weight: 500; color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 4px; }
.pnl-card .summary-value { font-family: var(--font-mono); font-size: 20px; font-weight: 700; letter-spacing: -0.5px; }
.pnl-card:nth-child(1) .summary-value { color: var(--accent); }
.pnl-card:nth-child(2) .summary-value { color: var(--red); }
.pnl-card:nth-child(3) .summary-value { color: var(--blue); }
.pnl-profit-positive { color: var(--green) !important; }
.pnl-profit-negative { color: var(--red) !important; }
.pnl-margin { font-size: 12px; font-family: var(--font-mono); margin-top: 4px; }
.pnl-unmatched {
  margin-top: 12px; padding: 12px 16px; background: var(--red-dim);
  border: 1px solid rgba(240, 96, 112, 0.2); border-radius: var(--radius-sm);
  font-size: 12px; color: var(--red);
}
.pnl-unmatched summary { cursor: pointer; font-weight: 500; }
.pnl-unmatched ul { margin-top: 6px; padding-left: 18px; color: var(--text-secondary); }
.pnl-detail-row td { padding: 0 !important; border-bottom: none !important; }
.pnl-detail-row .pnl-detail-inner {
  padding: 8px 16px 10px; font-size: 11px; color: var(--text-muted);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}
.pnl-sub-table {
  width: 100%; border-collapse: collapse; font-size: 11px;
  font-family: var(--font-mono); margin-bottom: 6px;
}
.pnl-sub-table th {
  text-align: left; padding: 4px 8px; font-size: 10px; font-weight: 600;
  color: var(--text-muted); border-bottom: 1px solid var(--border-subtle);
  letter-spacing: 0.3px;
}
.pnl-sub-table th:last-child { text-align: right; }
.pnl-sub-table td {
  padding: 3px 8px; color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}
.pnl-sub-table td:last-child { text-align: right; }
.pnl-sub-table tr:last-child td { border-bottom: none; }
.pnl-sub-table .pnl-sub-summary td {
  font-weight: 600; color: var(--text-primary);
  border-top: 1px solid var(--border); border-bottom: none;
  padding-top: 5px;
}
.pnl-sub-calc {
  font-size: 10px; color: var(--text-muted); font-family: var(--font-mono);
  padding: 4px 8px;
}
.pnl-expandable { cursor: pointer; user-select: none; }
.pnl-expandable:hover { background: var(--bg-surface); }
.pnl-expand-icon { display: inline-block; font-size: 10px; margin-right: 4px; transition: transform 0.15s; }
.pnl-expandable.open .pnl-expand-icon { transform: rotate(90deg); }
.airtable-sync-btn {
  padding: 5px 12px; border-radius: 6px; font-size: 11px; font-weight: 500;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  color: var(--text-secondary); cursor: pointer; transition: all 0.15s;
}
.airtable-sync-btn:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 768px) {
  .pnl-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .modal-box { padding: 20px; }
  .day-toggles { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .pnl-summary-grid { grid-template-columns: 1fr; }
}

/* Labor schedule */
.labor-week-nav {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.labor-nav-btn {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  color: var(--text-secondary); cursor: pointer; padding: 6px 10px;
  border-radius: 6px; font-size: 12px; transition: all 0.15s;
}
.labor-nav-btn:hover { border-color: var(--accent); color: var(--accent); }
.labor-week-label {
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  color: var(--text-primary); flex: 1; text-align: center;
}
.labor-copy-btn {
  padding: 5px 10px; border-radius: 6px; font-size: 11px; font-weight: 500;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  color: var(--text-muted); cursor: pointer; transition: all 0.15s; margin-left: auto;
}
.labor-copy-btn:hover { border-color: var(--blue); color: var(--blue); }

.labor-week-grid {
  display: flex; flex-direction: column; gap: 4px;
  margin-bottom: 16px;
}
.labor-day {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm); padding: 10px 12px;
  display: flex; align-items: flex-start; gap: 10px;
}
.labor-day-today { border-color: var(--accent); }
.labor-day-sunday .labor-day-label { color: var(--red); }
.labor-day-saturday .labor-day-label { color: var(--blue); }

.labor-day-header {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  min-width: 44px; padding-top: 2px; flex-shrink: 0;
}
.labor-day-name { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.labor-day-date { font-size: 10px; color: var(--text-muted); font-family: var(--font-mono); }

.labor-day-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }

.labor-workers { display: flex; flex-direction: column; gap: 4px; }
.labor-worker-row { display: flex; align-items: center; gap: 6px; }
.labor-worker-name {
  width: 80px; flex-shrink: 0; padding: 5px 8px; border-radius: 4px; font-size: 12px;
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  color: var(--text-primary); font-family: var(--font-body); outline: none;
}
.labor-worker-hours {
  width: 48px; padding: 5px 6px; border-radius: 4px; font-size: 12px;
  background: var(--bg-card); border: 1px solid var(--border-subtle);
  color: var(--text-primary); font-family: var(--font-mono); outline: none;
  text-align: center;
}
.labor-worker-name:focus, .labor-worker-hours:focus { border-color: var(--accent); }
.labor-h-label { font-size: 10px; color: var(--text-muted); }
.labor-worker-row .cost-remove { padding: 2px 4px; font-size: 14px; }

.labor-add-worker {
  padding: 4px 10px; border-radius: 4px; font-size: 11px; font-weight: 500;
  background: none; border: 1px dashed var(--border-subtle);
  color: var(--text-muted); cursor: pointer; transition: all 0.15s;
  align-self: flex-start;
}
.labor-add-worker:hover { border-color: var(--accent); color: var(--accent); }

.labor-day-right {
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
  min-width: 70px; flex-shrink: 0; padding-top: 2px;
}
.labor-day-cost {
  font-size: 12px; color: var(--accent); font-family: var(--font-mono);
  font-weight: 600;
}
.labor-day-summary {
  font-size: 10px; color: var(--text-muted); font-family: var(--font-mono);
}

/* Footer */
.footer {
  text-align: center; padding: 32px 0 0;
  font-size: 11px; color: var(--text-muted);
  font-family: var(--font-mono);
}
/* Login overlay */
.login-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg-deep);
  display: flex; align-items: center; justify-content: center;
}
.login-overlay.hidden { display: none; }
.login-box {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 40px 36px; width: 340px;
  text-align: center;
}
.login-box .brand-mark {
  width: 48px; height: 48px; margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--accent), #f07050);
  border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 20px; color: var(--bg-deep);
}
.login-box h2 { font-size: 16px; font-weight: 600; margin-bottom: 24px; color: var(--text-secondary); }
.login-input {
  width: 100%; padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  color: var(--text-primary); font-size: 14px; font-family: var(--font-body);
  outline: none; margin-bottom: 12px;
}
.login-input:focus { border-color: var(--accent); }
.login-btn {
  width: 100%; padding: 12px; border-radius: var(--radius-sm); border: none;
  background: linear-gradient(135deg, var(--accent), #f07050);
  color: var(--bg-deep); font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: var(--font-body); transition: opacity 0.2s;
}
.login-btn:hover { opacity: 0.9; }
.login-error { color: var(--red); font-size: 12px; margin-top: 8px; min-height: 18px; }
