.daily-page { background: #e9ecef; color: #202a35; }
.daily-toolbar { max-width: 210mm; margin: 20px auto 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px; }
.daily-toolbar button, .daily-toolbar input, .daily-back { min-height: 40px; border: 1px solid #cdd3d9; border-radius: 6px; background: white; color: #202a35; font: inherit; }
.daily-toolbar button, .daily-back { cursor: pointer; padding: 7px 13px; }
.daily-toolbar button:disabled { cursor: default; opacity: .4; }
.daily-toolbar button:focus-visible, .daily-toolbar input:focus-visible, .daily-back:focus-visible { outline: 2px solid #d72132; outline-offset: 3px; }
.daily-back { text-decoration: none; }
.daily-date-controls { display: flex; align-items: center; gap: 6px; }
.daily-date-controls input { padding: 6px 10px; width: 154px; }
.daily-toolbar .daily-print { display: flex; align-items: center; gap: 8px; background: #202a35; color: white; border-color: #202a35; }
.daily-status { text-align: center; padding: 28px; color: #616c78; }
.daily-sheet { width: 210mm; height: 297mm; margin: 0 auto 28px; padding: 12mm; background: white; box-shadow: 0 6px 32px #202a3514; display: grid; grid-template-rows: 72px 96px minmax(0, 1.25fr) minmax(0, 1.4fr) minmax(0, .85fr); gap: 22px; font-variant-numeric: tabular-nums; }
.daily-heading { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.daily-heading img { width: 112px; height: auto; display: block; }
.daily-heading h1 { margin-top: 10px; font-size: 12px; font-weight: 500; color: #687480; letter-spacing: .06em; text-transform: uppercase; }
.daily-heading-right { text-align: right; }
.daily-heading time { display: block; font-size: 26px; font-weight: 700; line-height: 1.15; letter-spacing: -.7px; }
.daily-legend { display: flex; justify-content: flex-end; gap: 18px; margin-top: 12px; font-size: 12px; }
.daily-legend span::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; }
.daily-legend .sherlock::before { background: #d72132; }
.daily-legend .bond::before { background: #344b63; }
.daily-totals { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 2px solid #202a35; border-bottom: 1px solid #dfe4e8; padding: 14px 0; }
.daily-total { padding-left: 18px; border-left: 1px solid #e6e9ec; }
.daily-total:first-child { border: 0; padding-left: 0; }
.daily-total strong { display: block; font-size: 33px; font-weight: 700; letter-spacing: -1px; line-height: 1.15; }
.daily-total:first-child strong { color: #d72132; }
.daily-total span { display: block; margin-top: 6px; font-size: 11px; color: #687480; }
.daily-panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.daily-panel h2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 700; margin: 0 0 12px; }
.daily-panel h2 > span { font-size: 11px; font-weight: 400; color: #687480; }
.daily-chart { flex: 1; min-height: 0; }
.daily-chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.daily-chart text { font-family: 'Avenir LT Std', sans-serif; font-size: 10px; fill: #687480; }
.daily-chart .chart-value { fill: #202a35; font-weight: 700; font-size: 11px; }
.daily-chart .chart-grid { stroke: #e8ecef; stroke-width: 1; }
.daily-chart .machine-name { font-size: 12px; font-weight: 700; fill: #202a35; }
.daily-chart-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; border-top: 1px solid #dfe4e8; padding-top: 20px; }
.daily-activity { border-top: 1px solid #dfe4e8; padding-top: 18px; }
.activity-legend { display: flex; align-items: center; gap: 5px; }
.activity-legend i { display: inline-block; width: 9px; height: 9px; margin-left: 8px; border-radius: 1px; border: 1px solid #c7cfd7; }
.recorded-key { background: #344b63; }
.idle-key { background: #f0f3f5; }
.missing-key { position: relative; background: white; }
.missing-key::after { content: ''; position: absolute; width: 7px; border-top: 1px solid #c7cfd7; transform: rotate(-45deg); top: 3px; left: 0; }
@media screen and (max-width: 820px) {
  .daily-toolbar { margin: 12px 10px; }
  .daily-sheet { width: calc(100% - 20px); height: auto; min-height: 0; margin: 0 10px 20px; padding: 24px; grid-template-rows: 72px 96px 250px 280px 180px; gap: 18px; }
}
@media screen and (max-width: 560px) {
  .daily-sheet { padding: 20px 16px; grid-template-rows: 66px auto 240px auto 200px; }
  .daily-heading img { width: 90px; }
  .daily-heading time { font-size: 21px; }
  .daily-legend { gap: 10px; font-size: 11px; }
  .daily-totals { grid-template-columns: 1fr 1fr; gap: 18px 0; }
  .daily-total:nth-child(3) { border-left: 0; padding-left: 0; }
  .daily-total strong { font-size: 29px; }
  .daily-chart-pair { grid-template-columns: 1fr; gap: 24px; }
  .daily-chart-pair .daily-panel { height: 250px; }
  .daily-activity h2 { align-items: flex-start; flex-direction: column; }
  .daily-hourly .daily-chart, .daily-activity .daily-chart { overflow-x: auto; }
  .daily-hourly svg, .daily-activity svg { min-width: 700px; }
  .activity-legend i:first-child { margin-left: 0; }
  .daily-toolbar .daily-print { font-size: 12px; padding: 8px; }
  .daily-date-controls input { width: 135px; }
  .daily-date-controls button { padding: 7px 10px; }
}
@page { size: A4 portrait; margin: 0; }
@media print {
  html, body.daily-page { width: 210mm; margin: 0 !important; padding: 0 !important; background: white; }
  body.daily-page { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .daily-toolbar, .daily-status, #daily-login { display: none !important; }
  .daily-sheet { width: 210mm; height: 296mm; margin: 0; padding: 12mm; box-shadow: none; break-inside: avoid; }
}
