:root {
  --blue: #003b7a;
  --blue-2: #0057b8;
  --light: #f4f7fb;
  --card: #ffffff;
  --ink: #1d2633;
  --muted: #617084;
  --line: #d8e0ea;
  --good: #0f7b42;
  --warn: #a96b00;
  --danger: #b42318;
  --shadow: 0 8px 24px rgba(0, 27, 68, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--light);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  padding-bottom: 84px;
}

.app-header {
  background: #fff;
  padding: 12px 14px 10px;
  border-bottom: 5px solid var(--blue);
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.logo {
  width: 108px;
  height: auto;
  object-fit: contain;
  flex: 0 0 auto;
}

h1 {
  font-size: 1.12rem;
  line-height: 1.1;
  margin: 0 0 4px;
}

h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

h3 {
  margin: 16px 0 8px;
  font-size: 1.05rem;
  color: var(--blue);
}

p {
  line-height: 1.42;
}

.small {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 0;
}

.status-strip {
  display: grid;
  grid-template-columns: 0.85fr 1.4fr 0.85fr;
  gap: 8px;
  padding: 10px 12px;
  background: var(--blue);
  color: white;
}

.status-strip div {
  background: rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 8px 10px;
}

.label {
  display: block;
  font-size: 0.72rem;
  opacity: 0.8;
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-strip strong {
  display: block;
  font-size: 0.95rem;
}

main {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 12px;
}

.card {
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 16px;
  border: 1px solid var(--line);
}

.view {
  display: none;
}

.active-view {
  display: block;
}

.bottom-nav {
  position: fixed;
  z-index: 20;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ffffff;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  padding: 8px 6px max(8px, env(safe-area-inset-bottom));
  box-shadow: 0 -8px 24px rgba(0, 27, 68, 0.12);
}

button {
  border: 0;
  border-radius: 12px;
  background: var(--blue-2);
  color: #fff;
  font-weight: 700;
  min-height: 44px;
  padding: 10px 12px;
  cursor: pointer;
  touch-action: manipulation;
}

button:active {
  transform: scale(0.99);
}

.bottom-nav button {
  font-size: 0.74rem;
  padding: 8px 4px;
  min-height: 48px;
}

.bottom-nav button.active,
.shift-tab.active {
  background: var(--blue);
}

.shift-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.shift-tab {
  background: #dbe8f8;
  color: var(--blue);
}

.timeline-item {
  border: 1px solid var(--line);
  border-left: 6px solid var(--blue-2);
  border-radius: 14px;
  padding: 12px;
  margin: 10px 0;
  background: #fbfdff;
}

.timeline-item.current {
  border-left-color: var(--good);
  background: #f0fff6;
}

.time {
  font-weight: 800;
  color: var(--blue);
  margin-bottom: 5px;
}

.focus {
  font-weight: 800;
  margin-bottom: 6px;
}

.timeline-item ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.timeline-item li {
  margin: 6px 0;
  line-height: 1.35;
}

.task-group {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

label {
  display: block;
  margin: 10px 0;
  line-height: 1.35;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #c8d3df;
  border-radius: 12px;
  padding: 12px;
  margin-top: 6px;
  font: inherit;
  background: #fff;
}

input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin: 0 8px 0 0;
  vertical-align: middle;
  accent-color: var(--blue);
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
}

.stack {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.employee-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fbfdff;
}

.employee-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.employee-head strong {
  font-size: 1.05rem;
}

.remove-small {
  background: #eef2f6;
  color: var(--danger);
  min-height: 34px;
  padding: 6px 10px;
}

.break-checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.break-checks label {
  background: #eef5ff;
  border-radius: 12px;
  padding: 10px;
  margin: 0;
}

.danger-button {
  background: #f2e7e6;
  color: var(--danger);
  margin-top: 12px;
  width: 100%;
}

.output-box {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.output-box button {
  width: 100%;
  margin-top: 8px;
}

textarea[readonly] {
  background: #f8fafc;
}

@media (max-width: 480px) {
  .app-header {
    align-items: center;
  }

  .logo {
    width: 96px;
  }

  h1 {
    font-size: 1rem;
  }

  #todayLine {
    font-size: 0.78rem;
    margin: 0;
  }

  .status-strip {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 14px;
    border-radius: 16px;
  }

  .shift-tabs {
    gap: 6px;
  }

  .shift-tab {
    font-size: 0.78rem;
    padding: 8px 5px;
  }
}


.huddle-script {
  background: #f3f8ff;
  border: 1px solid var(--line);
  border-left: 6px solid var(--blue-2);
  border-radius: 14px;
  padding: 12px;
  margin: 12px 0;
}

.huddle-script ol {
  margin: 8px 0 0;
  padding-left: 22px;
}

.huddle-script li {
  margin: 7px 0;
  line-height: 1.35;
}

.two-button-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

@media (min-width: 560px) {
  .two-button-row {
    grid-template-columns: 1fr 1fr;
  }
}


.export-tile button {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  background: #ffffff;
  color: var(--blue);
}

#printArea {
  display: none;
}

.report-page {
  background: #fff;
  color: #111;
  font-family: Arial, Helvetica, sans-serif;
}

.report-header {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 2px solid #003b7a;
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.report-logo {
  width: 190px;
  height: auto;
  object-fit: contain;
}

.report-title h1 {
  margin: 0;
  font-size: 17px;
  color: #003b7a;
}

.report-title p {
  margin: 2px 0;
  font-size: 10px;
  line-height: 1.2;
}

.report-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.report-section {
  border: 1px solid #b8c3d1;
  border-radius: 6px;
  padding: 6px;
  page-break-inside: avoid;
}

.report-section.full {
  grid-column: 1 / -1;
}

.report-section h2 {
  font-size: 12px;
  line-height: 1.1;
  margin: 0 0 4px;
  color: #003b7a;
  border-bottom: 1px solid #d7dfe9;
  padding-bottom: 3px;
}

.report-section p,
.report-section li {
  font-size: 9px;
  line-height: 1.18;
  margin: 2px 0;
}

.report-section ul {
  margin: 3px 0 0;
  padding-left: 13px;
}

.report-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 8.5px;
}

.report-mini-table th,
.report-mini-table td {
  border: 1px solid #d7dfe9;
  padding: 2px 3px;
  text-align: left;
  vertical-align: top;
}

.report-footer {
  margin-top: 6px;
  font-size: 8.5px;
  color: #333;
  border-top: 1px solid #b8c3d1;
  padding-top: 4px;
}

@media (max-width: 480px) {
  .export-tile {
    grid-column: 1 / -1;
  }
}

@media print {
  @page {
    size: letter portrait;
    margin: 0.32in;
  }

  html,
  body {
    background: #fff !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  body * {
    visibility: hidden !important;
  }

  #printArea,
  #printArea * {
    visibility: visible !important;
  }

  #printArea {
    display: block !important;
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
  }

  .report-page {
    width: 100%;
    max-height: 10.35in;
    overflow: hidden;
  }

  .report-header {
    margin-bottom: 5px;
    padding-bottom: 4px;
  }

  .report-logo {
    width: 170px;
  }

  .report-grid {
    gap: 5px;
  }

  .report-section {
    padding: 5px;
  }

  .report-section h2 {
    font-size: 11px;
  }

  .report-section p,
  .report-section li {
    font-size: 8.3px;
    line-height: 1.12;
  }

  .report-mini-table {
    font-size: 8px;
  }
}


/* One-page PDF export layout */
.report-page.one-row-report {
  width: 100%;
  min-height: 100%;
}

.one-row-report .report-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
  align-items: stretch;
}

.one-row-report .report-section {
  min-width: 0;
  overflow: hidden;
}

.one-row-report .report-section h2 {
  white-space: nowrap;
}

@media print {
  @page {
    size: letter landscape;
    margin: 0.22in;
  }

  .report-page.one-row-report {
    height: 7.95in;
    max-height: 7.95in;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .one-row-report .report-header {
    flex: 0 0 auto;
  }

  .one-row-report .report-grid {
    flex: 1 1 auto;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
    min-height: 0;
  }

  .one-row-report .report-section {
    height: 100%;
    max-height: 100%;
    padding: 4px;
    overflow: hidden;
    border-radius: 5px;
  }

  .one-row-report .report-section h2 {
    font-size: 9px;
    margin-bottom: 3px;
    padding-bottom: 2px;
  }

  .one-row-report .report-section p,
  .one-row-report .report-section li {
    font-size: 6.6px;
    line-height: 1.05;
    margin: 1px 0;
  }

  .one-row-report .report-section ul {
    padding-left: 9px;
    margin: 2px 0 0;
  }

  .one-row-report .report-mini-table {
    font-size: 6.4px;
  }

  .one-row-report .report-mini-table th,
  .one-row-report .report-mini-table td {
    padding: 1px 2px;
  }

  .one-row-report .report-logo {
    width: 155px;
  }

  .one-row-report .report-title h1 {
    font-size: 14px;
  }

  .one-row-report .report-title p {
    font-size: 7.2px;
  }

  .one-row-report .report-footer {
    flex: 0 0 auto;
    font-size: 6.7px;
    margin-top: 4px;
    padding-top: 3px;
  }
}


/* Clean one-page summarized PDF export */
.summary-report {
  width: 100%;
  background: #fff;
  color: #111;
  font-family: Arial, Helvetica, sans-serif;
}

.summary-report .report-header {
  display: grid;
  grid-template-columns: 205px 1fr;
  gap: 12px;
  align-items: center;
  border-bottom: 3px solid #003b7a;
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.summary-report .report-logo {
  width: 205px;
  height: auto;
  object-fit: contain;
}

.summary-report .report-title h1 {
  color: #003b7a;
  font-size: 20px;
  margin: 0 0 4px;
}

.summary-report .report-title p {
  font-size: 10px;
  line-height: 1.22;
  margin: 2px 0;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.85fr;
  gap: 7px;
}

.summary-grid .report-section {
  border: 1px solid #b9c6d6;
  border-radius: 8px;
  padding: 7px;
  overflow: hidden;
  background: #fff;
}

.summary-grid .huddle-summary {
  grid-column: 1 / -1;
}

.summary-grid .report-section h2 {
  color: #003b7a;
  font-size: 12px;
  line-height: 1.1;
  margin: 0 0 4px;
  border-bottom: 1px solid #d8e0ea;
  padding-bottom: 3px;
}

.summary-grid .report-section p,
.summary-grid .report-section li {
  font-size: 9px;
  line-height: 1.18;
  margin: 2px 0;
}

.summary-grid .report-section ul {
  margin: 2px 0 0;
  padding-left: 13px;
}

.summary-grid .report-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 8.5px;
}

.summary-grid .report-mini-table th,
.summary-grid .report-mini-table td {
  border: 1px solid #d8e0ea;
  padding: 2px 3px;
  text-align: left;
}

.summary-report .report-footer {
  margin-top: 7px;
  padding-top: 5px;
  border-top: 1px solid #b9c6d6;
  font-size: 8px;
  line-height: 1.2;
  color: #333;
}

@media print {
  @page {
    size: letter portrait;
    margin: 0.28in;
  }

  .report-page.summary-report {
    width: 100%;
    height: 10.4in;
    max-height: 10.4in;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .summary-report .report-header {
    flex: 0 0 auto;
    grid-template-columns: 190px 1fr;
    margin-bottom: 6px;
    padding-bottom: 6px;
  }

  .summary-report .report-logo {
    width: 190px;
  }

  .summary-report .report-title h1 {
    font-size: 18px;
  }

  .summary-report .report-title p {
    font-size: 8.5px;
  }

  .summary-grid {
    flex: 1 1 auto;
    min-height: 0;
    grid-template-columns: 1.22fr 0.88fr;
    gap: 5px;
  }

  .summary-grid .report-section {
    padding: 5px;
    border-radius: 6px;
    min-height: 0;
    max-height: 100%;
  }

  .summary-grid .report-section h2 {
    font-size: 10px;
    margin-bottom: 3px;
    padding-bottom: 2px;
  }

  .summary-grid .report-section p,
  .summary-grid .report-section li {
    font-size: 7.5px;
    line-height: 1.1;
  }

  .summary-grid .report-mini-table {
    font-size: 7.2px;
  }

  .summary-grid .report-mini-table th,
  .summary-grid .report-mini-table td {
    padding: 1px 2px;
  }

  .summary-report .report-footer {
    flex: 0 0 auto;
    font-size: 7px;
    margin-top: 5px;
    padding-top: 4px;
  }
}
