/* ============================================================
   RESET & BASE
   ============================================================ */

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

body {
  font-family: Arial, sans-serif;
  font-size: 14px;
  color: #222;
  background: #f4f4f4;
}


/* ============================================================
   PAGE WRAPPER
   ============================================================ */

.wrap {
  max-width: 520px;
  margin: 20px auto;
  padding: 12px;
  background: #fff;
  border-radius: 6px;
}


/* ============================================================
   TOP BAR
   ============================================================ */

.top-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.top-bar a {
  font-size: 13px;
  color: #1a6bb5;
  font-style: italic;
  cursor: pointer;
  text-decoration: underline;
}


/* ============================================================
   NAME & DATE SECTION
   ============================================================ */

.name-section {
  padding: 8px 10px;
  margin-bottom: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.field-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.field-row:last-child {
  margin-bottom: 0;
}

.field-row label {
  width: 46px;
  text-align: right;
  font-size: 13px;
}

.field-row input[type="text"] {
  flex: 1;
  padding: 3px 8px;
  font-size: 13px;
  color: #888;
  border: 1px solid #ccc;
  border-radius: 3px;
}


/* ============================================================
   TIME CARD SECTION
   ============================================================ */

.tc-section {
  margin-bottom: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  overflow: hidden;
}

/* Blue header bar */
.tc-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #3d5a99;
  color: #fff;
}

.tc-header span {
  font-size: 15px;
  font-weight: 600;
}

.tc-header input {
  flex: 1;
  padding: 3px 6px;
  font-size: 13px;
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 3px;
}

.tc-header input::placeholder {
  color: rgba(255, 255, 255, 0.65);
}

/* Each day block */
.day-block {
  border-bottom: 1px solid #ddd;
}

.day-block:last-child {
  border-bottom: none;
}

/* Main work-time row */
.day-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  background: #fff;
}

.day-label {
  width: 38px;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.period-hint {
  font-size: 11px;
  color: #888;
  flex-shrink: 0;
}

/* Groups of time input + am/pm select */
.time-group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.time-group input[type="text"] {
  width: 44px;
  padding: 3px 4px;
  font-size: 12px;
  text-align: center;
  border: 1px solid #ccc;
  border-radius: 3px;
}

.time-group select {
  padding: 2px;
  font-size: 12px;
  border: 1px solid #ccc;
  border-radius: 3px;
}

.time-sep {
  padding: 0 2px;
  font-size: 11px;
  color: #888;
}

/* Add break button (per day) */
.add-break-btn {
  padding: 2px 7px;
  font-size: 11px;
  color: #1a6bb5;
  background: #e8f0fb;
  border: 1px solid #1a6bb5;
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.add-break-btn:hover {
  background: #ccdcf5;
}

/* Break rows (added dynamically) */
.break-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  background: #f8f8f8;
  border-top: 1px solid #eee;
}

.break-num {
  width: 34px;
  font-size: 11px;
  color: #888;
  text-align: right;
  flex-shrink: 0;
}

/* Remove break (×) button */
.remove-brk {
  padding: 0 4px;
  font-size: 14px;
  line-height: 1.4;
  color: #999;
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 3px;
  cursor: pointer;
  flex-shrink: 0;
}

.remove-brk:hover {
  color: #c00;
  background: #fdecea;
  border-color: #c00;
}


/* ============================================================
   OPTIONS SECTION
   ============================================================ */

.options-section {
  padding: 8px 12px;
  margin-bottom: 10px;
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.opt-title {
  font-size: 14px;
  font-weight: 600;
}

.opt-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 13px;
}

.opt-row input[type="text"] {
  width: 72px;
  padding: 3px 6px;
  font-size: 13px;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: #fff;
}


/* ============================================================
   MAIN ACTION BUTTONS
   ============================================================ */

/* Calculate & Save — primary blue */
.calc-btn {
  display: block;
  margin: 0 auto 10px;
  padding: 8px 28px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: #3d5a99;
  border: 1px solid #2d4a89;
  border-radius: 4px;
  cursor: pointer;
}

.calc-btn:hover {
  background: #2d4a89;
}

/* Email / Link & Print / PDF — grey */
.btn-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 10px;
}

.btn-row button {
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 500;
  color: #333;
  background: #e8e8e8;
  border: 1px solid #bbb;
  border-radius: 4px;
  cursor: pointer;
}

.btn-row button:hover {
  background: #d4d4d4;
}

/* Clear Time Card — white with red accent */
.clear-btn {
  display: block;
  margin: 0 auto;
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 500;
  color: #c00;
  background: #fff3f3;
  border: 1px solid #e0a0a0;
  border-radius: 4px;
  cursor: pointer;
}

.clear-btn:hover {
  background: #fdecea;
  border-color: #c00;
}


/* ============================================================
   REPORT SECTION
   ============================================================ */

.report-section {
  margin-bottom: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  overflow: hidden;
}

.report-header {
  padding: 6px 12px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: #666;
}

/* Daily breakdown table */
.report-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.report-table th,
.report-table td {
  padding: 4px 8px;
  font-size: 13px;
  border: 1px solid #ddd;
}

.report-table th {
  font-weight: 600;
  text-align: center;
  background: #f0f0f0;
}

.report-table td:not(:first-child) {
  text-align: center;
}

/* Footnote superscript */
.note-ref {
  font-size: 10px;
  color: #1a6bb5;
}

/* Weekly totals header */
.weekly-title {
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid #ddd;
  border-top: none;
}

/* Column labels (REG / OT / = / Total) */
.weekly-sub {
  display: grid;
  grid-template-columns: 120px 1fr 1fr 16px 1fr;
  padding: 4px 10px;
  font-size: 12px;
  color: #777;
  text-align: center;
  border: 1px solid #ddd;
  border-top: none;
}

.weekly-sub span:first-child {
  text-align: left;
}

/* Data rows */
.weekly-row {
  display: grid;
  grid-template-columns: 120px 1fr 1fr 16px 1fr;
  align-items: center;
  padding: 4px 10px;
  font-size: 13px;
  text-align: center;
  border: 1px solid #ddd;
  border-top: none;
}

.weekly-row label {
  text-align: left;
}

.weekly-row.yellow {
  background: #f9f7dc;
}

.weekly-row.blue {
  background: #e8f0fb;
}

/* Footnotes */
.footnotes {
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #ddd;
  border-top: none;
}

.footnotes p {
  font-size: 11px;
  font-style: italic;
  line-height: 1.5;
  color: #666;
  margin-bottom: 6px;
}

.footnotes p:last-child {
  margin-bottom: 0;
}


/* ============================================================
   SETTINGS OVERLAY & PANEL
   ============================================================ */

/* Full-screen dimmed backdrop */
.settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px 12px;
  overflow-y: auto;
}

.settings-overlay.hidden {
  display: none;
}

/* White card */
.settings-panel {
  background: #fff;
  border-radius: 6px;
  padding: 16px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

/* Update Settings button — same blue as Calculate */
.update-settings-btn {
  display: block;
  margin: 0 auto 18px;
  padding: 8px 28px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: #3d5a99;
  border: 1px solid #2d4a89;
  border-radius: 4px;
  cursor: pointer;
}

.update-settings-btn:hover {
  background: #2d4a89;
}

/* Individual setting rows */
.setting-group {
  margin-bottom: 14px;
}

.setting-label {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.setting-group select,
.setting-group input[type="text"] {
  width: 100%;
  padding: 5px 8px;
  font-size: 13px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #f0f0f0;
}

/* Inline rows (select + input + text side by side) */
.inline-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-row select {
  width: auto;
  padding: 5px 8px;
  font-size: 13px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #f0f0f0;
}

.inline-row input[type="text"] {
  width: 60px !important;
  padding: 5px 8px;
  font-size: 13px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #f0f0f0;
}

.inline-row span {
  font-size: 13px;
  color: #444;
}

/* Pay & Overtime fieldset */
.pay-fieldset {
  border: 1px solid #aaa;
  border-radius: 4px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.pay-fieldset legend {
  font-size: 13px;
  color: #555;
  padding: 0 6px;
}

/* Indented sub-settings */
.sub-setting {
  margin-left: 12px;
}

/* Help links */
.help-link {
  font-size: 12px;
  font-weight: normal;
  font-style: italic;
  color: #1a6bb5;
  margin-left: 4px;
}
