* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, sans-serif; background: #0f172a; color: #1f2937; }
.topbar { background: transparent; color: white; padding: 24px 40px; display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.topbar h1 { margin: 0 0 6px; }
.topbar p { margin: 0; color: #d1d5db; }
.top-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.top-actions form { margin: 0; }
.user-chip { text-align: right; color: white; }
.user-chip strong, .user-chip span { display: block; }
.user-chip span { color: #d1d5db; font-size: 13px; margin-top: 2px; }
.tabs { background: rgba(255, 255, 255, .08); border-top: 1px solid rgba(255, 255, 255, .12); border-bottom: 1px solid rgba(255, 255, 255, .12); padding: 0 40px; display: flex; gap: 8px; flex-wrap: wrap; }
.tabs a { color: #e5e7eb; text-decoration: none; padding: 14px 12px; border-bottom: 3px solid transparent; font-weight: 700; }
.tabs a:hover { border-color: #34d399; color: white; }
.container { max-width: 1280px; margin: 30px auto; padding: 0 20px; }
.card { background: white; padding: 24px; border-radius: 16px; box-shadow: 0 8px 24px rgba(15, 23, 42, .08); margin-bottom: 22px; overflow-x: auto; }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.full { grid-column: 1 / -1; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.action-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.title-row, .filter-row { display: flex; gap: 16px; align-items: end; justify-content: space-between; flex-wrap: wrap; }
label { display: block; margin: 12px 0; font-weight: 600; }
input, textarea, select { width: 100%; padding: 10px; border: 1px solid #d1d5db; border-radius: 10px; margin-top: 6px; background: white; }
.daily-report-form input[type="number"]::-webkit-outer-spin-button,
.daily-report-form input[type="number"]::-webkit-inner-spin-button,
.monthly-expenses-form input[type="number"]::-webkit-outer-spin-button,
.monthly-expenses-form input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.daily-report-form input[type="number"],
.monthly-expenses-form input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; border-bottom: 1px solid #e5e7eb; text-align: left; }
.number-cell { text-align: right; }
.number-cell input { text-align: right; }
.report-ledger-table { font-size: 13px; }
.report-ledger-table th, .report-ledger-table td { padding: 8px 6px; white-space: nowrap; }
.btn, button { display: inline-block; border: 0; border-radius: 10px; padding: 11px 16px; background: #2563eb; color: white; text-decoration: none; cursor: pointer; font-weight: 700; }
.primary { background: #16a34a; }
.secondary { background: #4b5563; color: white; margin-top: 24px; }
.compact-button { margin-top: 0; }
.danger { background: #dc2626; }
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; }
.alert.success { background: #dcfce7; color: #166534; }
.alert.error { background: #fee2e2; color: #991b1b; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 18px; }
.summary-grid div { background: #f9fafb; border-radius: 12px; padding: 16px; }
.summary-grid span { display: block; color: #6b7280; font-size: 14px; }
.summary-grid strong { display: block; margin-top: 8px; font-size: 22px; }
.good { color: #16a34a; }
.over { color: #2563eb; }
.bad { color: #dc2626; }
.muted { color: #6b7280; }
.formula { background: #f9fafb; border-left: 5px solid #2563eb; padding: 14px; border-radius: 10px; font-weight: 700; }
.daily-entry-layout { display: grid; grid-template-columns: minmax(360px, .9fr) minmax(440px, 1.1fr); gap: 22px; align-items: start; }
.daily-entry-main { display: grid; gap: 22px; }
.daily-entry-main .card { margin-bottom: 0; }
.daily-entry-side { display: grid; gap: 22px; }
.daily-entry-side .card { margin-bottom: 0; }
.report-detail-layout { display: grid; grid-template-columns: minmax(520px, 1.2fr) minmax(360px, .8fr); gap: 22px; align-items: start; }
.report-detail-main, .report-detail-side { display: grid; gap: 22px; }
.report-detail-main .card, .report-detail-side .card { margin-bottom: 0; }
.report-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; margin-bottom: 22px; }
.report-detail-grid .card { margin-bottom: 0; }
.store-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-top: 18px; }
.store-option { margin: 0; display: grid; gap: 8px; }
.store-option form { margin: 0; }
.store-option .btn { width: 100%; }
.compact-entry-card { max-width: none; }
.compact-entry-list { display: grid; gap: 6px; margin-top: 10px; }
.compact-entry-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 0; padding: 6px 0; border-bottom: 1px solid #f3f4f6; }
.compact-entry-row span { flex: 1; text-align: left; }
.gas-sale-row > span { font-weight: 600; }
.compact-entry-row .compact-money-input { flex: 0 0 112px; width: 112px; margin-top: 0; text-align: right; }
.gas-sale-row label { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 12px; color: #6b7280; }
.gas-sale-row label .compact-money-input { flex-basis: 96px; width: 96px; }
.row-3 { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 12px; align-items: end; }
.row-4 { display: grid; grid-template-columns: 1.2fr 1fr 1.4fr auto; gap: 12px; align-items: end; }
.row-6 { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr 1fr auto; gap: 12px; align-items: end; }
.dynamic-row { padding: 14px; margin: 12px 0; background: #f9fafb; border-radius: 12px; }
.inline-check { display: flex; align-items: center; gap: 8px; margin: 0; }
.inline-check input { width: auto; margin: 0; }
.login-page { min-height: 100vh; display: grid; place-items: center; background: #0f172a; padding: 24px; }
.login-shell { width: min(960px, 100%); display: grid; grid-template-columns: 1.1fr .9fr; background: white; border-radius: 18px; overflow: hidden; box-shadow: 0 24px 80px rgba(0, 0, 0, .35); }
.login-brand { background: linear-gradient(135deg, #111827 0%, #1f2937 58%, #0f766e 100%); color: white; padding: 48px; display: flex; flex-direction: column; justify-content: center; }
.login-brand h1 { margin: 0 0 14px; font-size: 36px; line-height: 1.05; }
.login-brand p { color: #d1fae5; margin: 0; font-size: 16px; }
.login-kicker { color: #a7f3d0 !important; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 16px !important; }
.login-card { padding: 44px; display: flex; flex-direction: column; justify-content: center; }
.login-card h2 { margin-top: 0; }
.login-submit { width: 100%; margin-top: 12px; }
.plotly-chart { width: 100%; min-height: 420px; }
.plotly-chart.compact { min-height: 360px; }
.report-period-row { align-items: center; }
.report-period-row .muted { margin: 0; font-weight: 600; }
.report-period-actions { margin-top: 10px; }
@media (max-width: 900px) { .grid-form, .split, .daily-entry-layout, .report-detail-layout, .summary-grid, .row-3, .row-4, .row-6, .login-shell { grid-template-columns: 1fr; } .topbar { flex-direction: column; align-items: flex-start; } .top-actions { justify-content: flex-start; } .user-chip { text-align: left; } .tabs { padding: 0 20px; } .login-brand, .login-card { padding: 30px; } }
@media print {
  @page { margin: .25in; }
  * { box-shadow: none !important; }
  body { background: white; color: #111827; font-size: 9px; line-height: 1.2; }
  .topbar, .tabs, .alert, .no-print { display: none !important; }
  .container { max-width: none; margin: 0; padding: 0; }
  .card { border: 1px solid #d1d5db; border-radius: 0; padding: 7px; margin-bottom: 6px; overflow: visible; break-inside: avoid; page-break-inside: avoid; }
  .split, .summary-grid, .report-detail-layout, .report-detail-main, .report-detail-side { gap: 5px; }
  .summary-grid { grid-template-columns: repeat(5, 1fr); }
  .summary-grid div { border: 1px solid #e5e7eb; border-radius: 0; padding: 4px 5px; background: white; }
  .summary-grid span { font-size: 8px; line-height: 1.1; }
  .summary-grid strong { font-size: 11px; margin-top: 2px; }
  h2, h3 { margin: 0 0 5px; }
  h2 { font-size: 15px; }
  h3 { font-size: 11px; }
  p { margin: 3px 0; }
  table { font-size: 8.5px; }
  th, td { padding: 3px 4px; }
  .plotly-chart { width: 100% !important; max-width: 100% !important; overflow: visible; }
  #departmentSalesChart { min-height: 390px; height: 390px !important; }
  #dailyTrendChart { min-height: 290px; height: 290px !important; }
  .plotly-chart .js-plotly-plot, .plotly-chart .plot-container, .plotly-chart .svg-container { width: 100% !important; max-width: 100% !important; overflow: visible !important; }
  #departmentSalesChart .js-plotly-plot, #departmentSalesChart .plot-container, #departmentSalesChart .svg-container, #departmentSalesChart .main-svg { min-height: 390px !important; height: 390px !important; }
  #dailyTrendChart .js-plotly-plot, #dailyTrendChart .plot-container, #dailyTrendChart .svg-container, #dailyTrendChart .main-svg { min-height: 290px !important; height: 290px !important; }
  .plotly-chart .main-svg { width: 100% !important; max-width: 100% !important; overflow: visible !important; }
  .report-ledger-table { font-size: 7px; }
  .report-ledger-table th, .report-ledger-table td { padding: 2px 3px; }
  .split { grid-template-columns: 1fr 1fr; }
  .report-detail-layout { grid-template-columns: 1.15fr .85fr; }
  a { color: inherit; text-decoration: none; }
}
