/* ============================================================
   ForwardWay Timesheet - Francis Exclusive Readonly Portal
   周助理 2026年11月考勤工时与核算表 (Francis 专属核对看板)
   ============================================================ */

:root {
  --bg-main: #070b14;
  --bg-card: #0d1424;
  --bg-card-sub: #131c33;
  --border-card: #1f2d4d;
  --border-light: rgba(255, 255, 255, 0.08);
  --border-focus: #38bdf8;
  
  --color-text-pri: #f8fafc;
  --color-text-sec: #94a3b8;
  --color-text-muted: #64748b;
  
  --accent-cyan: #38bdf8;
  --accent-emerald: #10b981;
  --accent-emerald-light: #34d399;
  --accent-amber: #f59e0b;
  --accent-amber-light: #fbbf24;
  --accent-purple: #a855f7;
  
  --font-sans: 'Outfit', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body.zhou-readonly-body {
  background-color: var(--bg-main);
  color: var(--color-text-pri);
  font-family: var(--font-sans);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  user-select: text !important;
  -webkit-user-select: text !important;
}

/* All selectable text assurance */
.statement-card, .master-ledger-table, .master-matrix-table,
th, td, span, strong, div, p {
  user-select: text !important;
  -webkit-user-select: text !important;
}

.zhou-app-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 12px 18px;
  max-width: 1720px;
  margin: 0 auto;
}

/* ============================================================
   1. Top Action & Navigation Bar
   ============================================================ */
.zhou-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: rgba(13, 20, 36, 0.85);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  margin-bottom: 12px;
  gap: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.bar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  font-size: 22px;
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.5));
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.system-title {
  font-size: 13px;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.5px;
}

.sub-label {
  font-size: 11px;
  color: var(--color-text-muted);
}

.divider-v {
  width: 1px;
  height: 28px;
  background: var(--border-card);
}

.francis-badge {
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 4px 10px;
  border-radius: 8px;
}

.avatar-f {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
}

.francis-meta {
  display: flex;
  flex-direction: column;
}

.francis-meta .name {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-emerald-light);
}

.francis-meta .mode-tag {
  font-size: 10px;
  color: #a7f3d0;
}

/* Center: Month Selector */
.bar-center {
  display: flex;
  align-items: center;
}

.month-pill-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-card);
  padding: 4px 8px;
  border-radius: 30px;
}

.btn-month-nav {
  background: transparent;
  border: none;
  color: #94a3b8;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.15s ease;
}

.btn-month-nav:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

.month-label-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
}

.cal-icon {
  font-size: 14px;
}

.current-month-text {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
}

.tag-default-nov {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 10px;
  font-weight: 600;
}

.btn-reset-nov {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s ease;
}

.btn-reset-nov:hover {
  background: rgba(245, 158, 11, 0.28);
  border-color: #fbbf24;
}

/* Right: View & Action Tools */
.bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-tool {
  background: rgba(30, 41, 59, 0.8);
  color: #cbd5e1;
  border: 1px solid var(--border-card);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-tool:hover {
  background: rgba(51, 65, 85, 0.9);
  color: #ffffff;
  border-color: #475569;
  transform: translateY(-1px);
}

.btn-capture-mode {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
}

.btn-capture-mode:hover {
  background: rgba(14, 165, 233, 0.28);
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

.btn-capture-mode.active {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: #ffffff !important;
  border-color: #34d399 !important;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.45) !important;
}

.btn-export-jpg {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.3));
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.5);
  font-weight: 700;
}

.btn-export-jpg:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.32), rgba(217, 119, 6, 0.5));
  border-color: #fbbf24;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.45);
}

.view-switcher-group {
  display: flex;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 2px;
}

.btn-view-toggle {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-view-toggle.active {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.tab-label-short {
  display: none;
}
.tab-label-full {
  display: inline;
}

.quick-btn-group {
  display: flex;
  gap: 6px;
}

/* ============================================================
   2. Master Statement Card ("Like an Image")
   ============================================================ */
.zhou-statement-container {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.statement-card {
  background: radial-gradient(circle at 10% 10%, #111b33 0%, #0a1122 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 24px rgba(56, 189, 248, 0.1);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.statement-header {
  border-bottom: 2px solid rgba(56, 189, 248, 0.3);
  padding-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.header-main-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.title-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.company-sub {
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.statement-title {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.3px;
  margin: 1px 0 3px 0;
}

.statement-subtitle {
  font-size: 12.5px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.statement-subtitle strong {
  color: #f1f5f9;
}

.statement-subtitle .sep {
  color: #475569;
}

.statement-subtitle .highlight-mono {
  font-family: var(--font-mono);
  color: #fbbf24;
}

/* Francis Highlight Summary Box */
.francis-summary-box {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(6, 78, 59, 0.35) 100%);
  border: 1px solid rgba(52, 211, 153, 0.5);
  border-radius: 12px;
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.25);
  min-width: 260px;
  flex-shrink: 0;
}

.box-tag {
  font-size: 11.5px;
  font-weight: 700;
  color: #a7f3d0;
  letter-spacing: 0.3px;
}

.box-metric {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin: 1px 0;
}

.box-currency {
  font-family: var(--font-mono);
  font-size: 15px;
  color: #34d399;
  font-weight: 700;
}

.box-amount {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(16, 185, 129, 0.5);
}

.box-hours-breakdown {
  font-size: 11.5px;
  color: #cbd5e1;
}

.box-hours-breakdown strong {
  font-family: var(--font-mono);
  color: #34d399;
}

.box-hours-breakdown .dot {
  color: #059669;
  margin: 0 3px;
}

/* Overall Dual-Employer Summary Strip */
.summary-metric-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.strip-item {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 6px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.strip-label {
  font-size: 11px;
  color: #94a3b8;
}

.strip-val {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 700;
  color: #f1f5f9;
}

.strip-val.grand {
  color: #38bdf8;
}

.franc-strip {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
}
.franc-strip .strip-label { color: #6ee7b7; font-weight: 600; }
.franc-strip .strip-val { color: #34d399; }

.pat-strip {
  border-color: rgba(56, 189, 248, 0.3);
  background: rgba(56, 189, 248, 0.06);
}
.pat-strip .strip-label { color: #7dd3fc; }
.pat-strip .strip-val { color: #38bdf8; }

/* ============================================================
   3. Master Ledger Table (Days as Rows - View 1)
   ============================================================ */
.table-frame-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border-card);
  background: #0b1120;
}

.master-ledger-table, .master-matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  text-align: center;
  color: #f1f5f9;
}

.master-ledger-table th, .master-matrix-table th {
  background: #111a30;
  color: #cbd5e1;
  font-weight: 700;
  padding: 8px 6px;
  border: 1px solid #1e2c4d;
  font-size: 12px;
  letter-spacing: 0.2px;
}

.master-ledger-table th.col-francis,
.master-ledger-table td.col-francis {
  background: rgba(16, 185, 129, 0.08);
  border-left: 2px solid rgba(16, 185, 129, 0.4);
  border-right: 2px solid rgba(16, 185, 129, 0.4);
}

.master-ledger-table th.col-francis {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
}

.master-ledger-table th.col-pat,
.master-ledger-table td.col-pat {
  background: rgba(56, 189, 248, 0.05);
}

.master-ledger-table th.col-pat {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
}

.master-ledger-table td, .master-matrix-table td {
  padding: 6px 6px;
  border: 1px solid #17233e;
  font-family: var(--font-sans);
}

.master-ledger-table tr.weekend-row {
  background: rgba(30, 41, 59, 0.35);
}

.master-ledger-table tr.holiday-row {
  background: rgba(245, 158, 11, 0.08);
}

.master-ledger-table tr:hover {
  background: rgba(56, 189, 248, 0.08);
}

/* Cell Value Styling (pure selectable text) */
.cell-date {
  font-family: var(--font-mono);
  font-weight: 600;
  color: #f1f5f9;
}

.cell-weekday {
  font-weight: 600;
  color: #94a3b8;
}

.cell-weekday.sat { color: #38bdf8; }
.cell-weekday.sun { color: #f43f5e; }

.badge-day-type {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
}
.badge-day-type.workday { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; }
.badge-day-type.weekend { background: rgba(56, 189, 248, 0.15); color: #7dd3fc; }
.badge-day-type.holiday { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }

.val-num {
  font-family: var(--font-mono);
  font-weight: 700;
  display: inline-block;
  padding: 1px 4px;
}

.val-num.normal { color: #34d399; }
.val-num.overtime { color: #fb923c; }
.val-num.total { color: #38bdf8; }
.val-num.pay { color: #facc15; }

.val-empty {
  font-family: var(--font-mono);
  color: #475569;
}

.cell-note {
  text-align: left;
  font-size: 11.5px;
  color: #cbd5e1;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Table Footer / Summary Row */
.master-ledger-table tfoot tr, .master-matrix-table tfoot tr {
  background: #0f1d38;
  font-weight: 800;
  border-top: 2px solid #38bdf8;
}

.master-ledger-table tfoot td, .master-matrix-table tfoot td {
  padding: 8px 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  border-top: 2px solid #38bdf8;
}

.tfoot-label {
  font-family: var(--font-sans);
  color: #ffffff;
  font-weight: 800;
  text-align: left;
  padding-left: 12px !important;
}

/* ============================================================
   4. Statement Master Footer
   ============================================================ */
.statement-footer {
  border-top: 1px solid var(--border-card);
  padding-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--color-text-muted);
}

.footer-dot {
  margin: 0 4px;
  color: #475569;
}

/* Floating Toast */
.zhou-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid #10b981;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  z-index: 99999;
  animation: toastFadeIn 0.25s ease-out;
}

@keyframes toastFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   5. 一屏截屏模式 (Single Browser Viewport Mode)
   压缩字号与间距，完整展示整月所有日期（30天），无滚动条，便于截屏
   ============================================================ */
body.viewport-capture-mode {
  height: 100vh !important;
  max-height: 100vh !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
}

body.viewport-capture-mode .zhou-app-wrapper {
  height: 100vh !important;
  max-height: 100vh !important;
  padding: 4px 10px !important;
  gap: 4px !important;
  justify-content: flex-start !important;
}

body.viewport-capture-mode .zhou-top-bar {
  padding: 3px 12px !important;
  margin-bottom: 2px !important;
  min-height: 32px !important;
  height: 32px !important;
  border-radius: 8px !important;
  flex-shrink: 0 !important;
}

body.viewport-capture-mode .brand-logo { font-size: 16px !important; }
body.viewport-capture-mode .system-title { font-size: 11.5px !important; }
body.viewport-capture-mode .sub-label { display: none !important; }
body.viewport-capture-mode .avatar-f { width: 18px !important; height: 18px !important; font-size: 10px !important; }
body.viewport-capture-mode .francis-meta .name { font-size: 11px !important; }
body.viewport-capture-mode .francis-meta .mode-tag { display: none !important; }

body.viewport-capture-mode .month-pill-group {
  padding: 2px 6px !important;
}
body.viewport-capture-mode .current-month-text { font-size: 12px !important; }
body.viewport-capture-mode .tag-default-nov { display: none !important; }
body.viewport-capture-mode .btn-reset-nov { font-size: 10px !important; padding: 1px 6px !important; }

body.viewport-capture-mode .btn-tool {
  padding: 3px 8px !important;
  font-size: 11px !important;
}

body.viewport-capture-mode .btn-view-toggle {
  padding: 2px 6px !important;
  font-size: 10.5px !important;
}

/* Shrunk Statement Card */
body.viewport-capture-mode .statement-card {
  padding: 6px 10px !important;
  gap: 4px !important;
  flex: 1 !important;
  overflow: hidden !important;
  border-radius: 8px !important;
}

body.viewport-capture-mode .statement-header {
  padding-bottom: 4px !important;
  gap: 3px !important;
  flex-shrink: 0 !important;
}

body.viewport-capture-mode .company-sub { font-size: 9.5px !important; letter-spacing: 0.8px !important; }
body.viewport-capture-mode .statement-title { font-size: 15px !important; margin: 0 !important; }
body.viewport-capture-mode .statement-subtitle { font-size: 10.5px !important; gap: 4px !important; }

body.viewport-capture-mode .francis-summary-box {
  padding: 4px 10px !important;
  min-width: 200px !important;
  border-radius: 8px !important;
}
body.viewport-capture-mode .box-tag { font-size: 10px !important; }
body.viewport-capture-mode .box-currency { font-size: 12px !important; }
body.viewport-capture-mode .box-amount { font-size: 18px !important; }
body.viewport-capture-mode .box-hours-breakdown { font-size: 10px !important; }

body.viewport-capture-mode .summary-metric-strip {
  gap: 4px !important;
}
body.viewport-capture-mode .strip-item {
  padding: 2px 6px !important;
  border-radius: 6px !important;
}
body.viewport-capture-mode .strip-label { font-size: 9.5px !important; }
body.viewport-capture-mode .strip-val { font-size: 11.5px !important; }

/* Shrunk Master Table in Capture Mode (All 30 days fit inside viewport) */
body.viewport-capture-mode .table-frame-wrap {
  flex: 1 !important;
  overflow: hidden !important;
  max-height: calc(100vh - 170px) !important;
  border-radius: 6px !important;
}

body.viewport-capture-mode .master-ledger-table {
  font-size: 9.5px !important;
  height: 100% !important;
  table-layout: fixed !important;
}

body.viewport-capture-mode .master-ledger-table th {
  padding: 2px 2px !important;
  font-size: 9.5px !important;
  line-height: 1.1 !important;
}

body.viewport-capture-mode .master-ledger-table td {
  padding: 1px 2px !important;
  font-size: 9px !important;
  line-height: 1.05 !important;
}

body.viewport-capture-mode .badge-day-type {
  font-size: 8.5px !important;
  padding: 0 3px !important;
}

body.viewport-capture-mode .val-num {
  font-size: 9.5px !important;
  padding: 0 1px !important;
}

body.viewport-capture-mode .cell-note {
  font-size: 8.5px !important;
  max-width: 140px !important;
}

body.viewport-capture-mode .master-ledger-table tfoot td {
  padding: 2px 2px !important;
  font-size: 10px !important;
}

body.viewport-capture-mode .statement-footer {
  padding-top: 2px !important;
  font-size: 9.5px !important;
  flex-shrink: 0 !important;
}

/* ============================================================
   6. Print Styles
   ============================================================ */
@media print {
  body.zhou-readonly-body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .zhou-top-bar, .btn-tool, .quick-btn-group, .zhou-toast {
    display: none !important;
  }
  .statement-card {
    background: #ffffff !important;
    color: #000000 !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
  .statement-title, .title-block, .statement-subtitle strong {
    color: #000000 !important;
  }
  .master-ledger-table th, .master-matrix-table th {
    background: #f1f5f9 !important;
    color: #000000 !important;
    border: 1px solid #000000 !important;
  }
  .master-ledger-table td, .master-matrix-table td {
    color: #000000 !important;
    border: 1px solid #cccccc !important;
  }
  .master-ledger-table th.col-francis,
  .master-ledger-table td.col-francis {
    background: #e6fcf5 !important;
  }
}

/* Note Pill & Matrix Note Button */
.note-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.35);
  color: #fde047;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.note-pill:hover {
  background: rgba(234, 179, 8, 0.25);
  border-color: #fde047;
  color: #fff;
}

.btn-matrix-note {
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.4);
  color: #fde047;
  border-radius: 4px;
  font-size: 11px;
  padding: 2px 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-matrix-note:hover {
  background: rgba(234, 179, 8, 0.3);
  color: #fff;
  transform: scale(1.1);
}

/* Francis Note Modal */
.zhou-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.zhou-modal-card {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 12px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.zhou-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #1e293b;
  background: #111e38;
}

.zhou-modal-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.zhou-modal-body {
  padding: 18px;
}

.zhou-note-content {
  background: #090e1a;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.6;
  color: #f8fafc;
  white-space: pre-wrap;
  word-break: break-word;
}

.zhou-modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 12px 18px;
  border-top: 1px solid #1e293b;
  background: #0b1325;
}

/* ============================================================
   6. Francis All-Employees Accounting Dashboard Tab
   ============================================================ */
#btnViewAccounting.active {
  background: rgba(16, 185, 129, 0.22) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.5) !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

.statement-card-francis-accounting {
  animation: fadeIn 0.2s ease-in-out;
}

.kpi-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 16px;
}

.kpi-card {
  background: #0d1527;
  border: 1px solid #1e2d4d;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: #334b77;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.kpi-card .kpi-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kpi-card .kpi-icon {
  font-size: 16px;
}

.kpi-card .kpi-label {
  font-size: 11.5px;
  color: #94a3b8;
  font-weight: 600;
}

.kpi-card .kpi-body {
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.kpi-card .kpi-cur {
  font-size: 16px;
  font-weight: 700;
  color: #34d399;
  font-family: var(--font-mono);
}

.kpi-card .kpi-num {
  font-size: 26px;
  font-weight: 800;
  color: #f8fafc;
  font-family: var(--font-mono);
  letter-spacing: -0.5px;
}

.highlight-emerald {
  color: #34d399 !important;
  text-shadow: 0 0 16px rgba(16, 185, 129, 0.35);
}

.kpi-card .kpi-unit {
  font-size: 12px;
  color: #64748b;
  margin-left: 2px;
}

.kpi-card .kpi-sub {
  font-size: 11px;
  color: #64748b;
  line-height: 1.4;
}

.kpi-employer-splits {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.split-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
}

.split-name {
  color: #94a3b8;
}

.split-val {
  font-weight: 700;
  font-family: var(--font-mono);
  color: #f8fafc;
}

.split-hrs {
  font-size: 10px;
  color: #64748b;
  font-family: var(--font-mono);
}

/* Empty / No Data Banner */
.nodata-banner {
  margin-top: 16px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px dashed rgba(16, 185, 129, 0.4);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.nodata-icon {
  font-size: 20px;
}

.nodata-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
}

.nodata-text strong {
  color: #34d399;
}

.nodata-text span {
  color: #94a3b8;
}

/* Francis Accounting Table */
.francis-accounting-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.francis-accounting-table th,
.francis-accounting-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #1f2d4d;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.francis-accounting-table th:last-child,
.francis-accounting-table td:last-child {
  border-right: none;
}

.francis-accounting-table thead th {
  background: #0f182c;
  color: #cbd5e1;
  font-weight: 700;
  font-size: 11.5px;
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px solid #2d3f66;
  letter-spacing: 0.2px;
}

.francis-accounting-table thead .col-group-hours {
  background: #14213d !important;
  color: #93c5fd !important;
  border-left: 1px solid #2d3f66;
  border-right: 1px solid #2d3f66;
}

.col-wage-francis {
  background: rgba(16, 185, 129, 0.08) !important;
  color: #34d399 !important;
}

.francis-accounting-table tbody tr {
  background: #0d1424;
  transition: background 0.12s ease;
}

.francis-accounting-table tbody tr:nth-child(even) {
  background: rgba(15, 24, 44, 0.45);
}

.francis-accounting-table tbody tr:hover {
  background: #15223c !important;
}

.francis-accounting-table .col-num {
  text-align: center !important;
  color: #64748b;
  font-family: var(--font-mono);
  width: 44px;
}

.francis-accounting-table .col-name {
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.francis-accounting-table .col-account {
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
}

.francis-accounting-table .col-mode {
  text-align: center !important;
  white-space: nowrap;
}

.francis-accounting-table .badge-mode {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.francis-accounting-table .col-rate {
  font-family: var(--font-mono);
  color: #94a3b8;
  text-align: right !important;
  white-space: nowrap;
}

.francis-accounting-table .col-days {
  text-align: center !important;
  font-family: var(--font-mono);
  font-weight: 600;
}

.francis-accounting-table .col-sub-h,
.francis-accounting-table .col-hours-val {
  text-align: right !important;
  font-family: var(--font-mono);
  font-size: 12px;
}

.francis-accounting-table .col-hours-val.total-h {
  font-weight: 700;
  color: #34d399;
  background: rgba(16, 185, 129, 0.05);
}

.francis-accounting-table .col-wage-val {
  text-align: right !important;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 13px;
  color: #34d399;
  background: rgba(16, 185, 129, 0.1);
  white-space: nowrap;
}

.francis-accounting-table .col-status {
  text-align: center !important;
  white-space: nowrap;
}

.francis-accounting-table .badge-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10.5px;
  font-weight: 600;
}

.francis-accounting-table .badge-status.active {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.francis-accounting-table .badge-status.empty {
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.francis-accounting-table tfoot tr {
  background: #0f1a30;
  border-top: 2px solid #2d3f66;
  font-weight: 700;
}

.francis-accounting-table tfoot td {
  padding: 12px 14px;
}

.francis-accounting-table .tfoot-label {
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}

.francis-accounting-table .tfoot-val {
  text-align: right !important;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #f8fafc;
}

.francis-accounting-table .tfoot-val.grand-wage {
  color: #34d399;
  font-size: 15px;
  font-weight: 800;
  background: rgba(16, 185, 129, 0.12);
}

/* Compact capture mode adjustments for accounting view */
body.viewport-capture-mode .statement-card-francis-accounting .kpi-card {
  padding: 8px 10px;
}

body.viewport-capture-mode .statement-card-francis-accounting .kpi-num {
  font-size: 18px;
}

body.viewport-capture-mode .statement-card-francis-accounting .francis-accounting-table th,
body.viewport-capture-mode .statement-card-francis-accounting .francis-accounting-table td {
  padding: 4px 6px;
  font-size: 10.5px;
}

/* ============================================================
   7. Francis Help & Navigation Guide Tab
   ============================================================ */
#btnViewHelp.active {
  background: rgba(168, 85, 247, 0.22) !important;
  color: #c084fc !important;
  border: 1px solid rgba(168, 85, 247, 0.5) !important;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.25);
}

.statement-card-francis-help {
  animation: fadeIn 0.2s ease-in-out;
  padding: 0;
}

.statement-card-francis-help .statement-header {
  border-bottom: 1px solid #1e293b;
  padding: 22px 24px;
}

.help-welcome-banner {
  margin-top: 18px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.12), rgba(56, 189, 248, 0.08));
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.help-welcome-banner .welcome-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.help-welcome-banner .welcome-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.help-welcome-banner .welcome-text strong {
  color: #f8fafc;
  font-size: 14px;
}

.help-welcome-banner .welcome-text span {
  color: #cbd5e1;
  font-size: 12.5px;
  line-height: 1.6;
}

.help-content-section {
  padding: 24px;
  border-bottom: 1px solid #1a2744;
}

.help-content-section:last-of-type {
  border-bottom: none;
}

.help-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.sec-badge {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 6px;
}

.sec-title {
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
}

.sec-sub {
  font-size: 12px;
  color: #94a3b8;
  margin-left: auto;
}

/* Links Grid */
.help-links-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 1024px) {
  .help-links-grid {
    grid-template-columns: 1fr;
  }
}

.help-link-card {
  background: #0f182c;
  border: 1px solid #1f2d4d;
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.help-link-card:hover {
  transform: translateY(-2px);
  border-color: #3b82f6;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.link-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.link-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.link-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.link-name {
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
}

.link-url-text {
  font-size: 11px;
  font-family: var(--font-mono);
  color: #64748b;
  display: block;
  margin-top: 2px;
  word-break: break-all;
}

.link-tag {
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.tag-cyan {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.tag-purple {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.tag-emerald {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.tag-amber {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.tag-red {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.link-card-body {
  font-size: 12.5px;
  color: #cbd5e1;
  line-height: 1.6;
}

.link-features-list {
  list-style: none;
  padding-left: 0;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.link-features-list li {
  position: relative;
  padding-left: 14px;
}

.link-features-list li::before {
  content: '▪';
  position: absolute;
  left: 0;
  color: #94a3b8;
}

.link-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Formula Grid */
.help-formula-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.formula-card-wide {
  grid-column: 1 / -1;
}

.formula-card {
  background: #0f182c;
  border: 1px solid #1f2d4d;
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.formula-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.formula-icon {
  font-size: 20px;
}

.formula-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #f8fafc;
}

.formula-math {
  background: #080d19;
  border: 1px solid #1c2a47;
  border-radius: 8px;
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: #93c5fd;
  text-align: center;
}

.formula-math.formula-math-master {
  font-size: 13.5px;
  color: #34d399;
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.3);
  font-weight: 600;
}

.formula-math .highlight-val {
  color: #34d399;
  font-weight: 800;
}

.formula-desc {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.6;
}

.formula-tiers {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tier-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #090f1d;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #17243c;
  font-family: var(--font-mono);
  font-size: 12px;
}

.tier-calc {
  color: #94a3b8;
}

.tier-val strong {
  color: #f8fafc;
}

/* Tools Grid */
.help-tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 1200px) {
  .help-tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .help-tools-grid {
    grid-template-columns: 1fr;
  }
}

.tool-card {
  background: #0f182c;
  border: 1px solid #1f2d4d;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tool-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-icon {
  font-size: 18px;
}

.tool-name {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
}

.tool-desc {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.6;
}

.tool-desc code {
  background: #17223b;
  color: #38bdf8;
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
}

/* Security Grid */
.help-security-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

@media (max-width: 1024px) {
  .help-security-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .help-security-grid {
    grid-template-columns: 1fr;
  }
}

.security-card {
  background: #0f182c;
  border: 1px solid #1f2d4d;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.sec-icon {
  font-size: 24px;
}

.sec-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #f8fafc;
}

.sec-text {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.5;
}

/* Compact capture mode adjustments for help view */
body.viewport-capture-mode .statement-card-francis-help .help-welcome-banner {
  padding: 8px 12px;
  margin-top: 8px;
}

body.viewport-capture-mode .statement-card-francis-help .help-content-section {
  padding: 12px 16px;
}

body.viewport-capture-mode .statement-card-francis-help .help-link-card,
body.viewport-capture-mode .statement-card-francis-help .formula-card,
body.viewport-capture-mode .statement-card-francis-help .tool-card,
body.viewport-capture-mode .statement-card-francis-help .security-card {
  padding: 10px;
}

/* ============================================================
   8. Mobile Phone Portrait Responsiveness (<= 768px and <= 480px)
   ============================================================ */
@media (max-width: 768px) {
  /* Container layout */
  .zhou-app-wrapper {
    padding: 8px 8px 24px 8px;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* 1. Top Action & Navigation Bar */
  .zhou-top-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 10px 12px;
    gap: 10px;
    border-radius: 12px;
  }

  .bar-left {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 8px;
  }

  .brand-badge {
    gap: 8px;
  }

  .brand-logo {
    font-size: 20px;
  }

  .system-title {
    font-size: 12.5px;
    white-space: nowrap;
  }

  .sub-label {
    display: none;
  }

  .divider-v {
    display: none;
  }

  .francis-badge {
    padding: 3px 8px;
  }

  .francis-meta .name {
    font-size: 11px;
    white-space: nowrap;
  }

  .francis-meta .mode-tag {
    display: none;
  }

  .bar-center {
    width: 100%;
    justify-content: center;
  }

  .month-pill-group {
    width: 100%;
    justify-content: space-between;
    padding: 4px 8px;
  }

  .current-month-text {
    font-size: 13px;
    white-space: nowrap;
  }

  .tag-default-nov {
    display: none !important;
  }

  .btn-reset-nov {
    font-size: 10.5px;
    padding: 2px 7px;
    white-space: nowrap;
  }

  .bar-right {
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }

  /* 2x2 Grid View Switcher on mobile - all 4 tabs fully visible */
  .view-switcher-group {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 3px;
    border-radius: 8px;
    overflow-x: visible;
  }

  .btn-view-toggle {
    width: 100%;
    text-align: center;
    white-space: nowrap;
    padding: 8px 4px;
    font-size: 11.5px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: unset;
  }

  .tab-label-full {
    display: none !important;
  }
  .tab-label-short {
    display: inline !important;
  }

  .quick-btn-group {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 6px;
  }

  .quick-btn-group .btn-tool {
    justify-content: center;
    padding: 6px 8px;
    font-size: 11px;
    white-space: nowrap;
  }

  .btn-capture-mode {
    width: 100%;
    justify-content: center;
    padding: 6px 10px;
    font-size: 11.5px;
  }

  /* 2. Master Statement Card */
  .statement-card {
    padding: 12px 12px;
    border-radius: 12px;
    gap: 12px;
  }

  .header-main-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .title-block {
    gap: 4px;
  }

  .company-sub {
    font-size: 10px;
    letter-spacing: 1px;
  }

  .statement-title {
    font-size: 17px;
    line-height: 1.35;
    word-break: break-word;
  }

  .statement-subtitle {
    font-size: 11px;
    line-height: 1.6;
    gap: 4px;
  }

  .statement-subtitle .sep {
    display: none;
  }

  .statement-subtitle > span {
    display: inline-block;
    background: rgba(15, 23, 42, 0.6);
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 4px;
    margin-bottom: 4px;
  }

  .francis-summary-box {
    width: 100%;
    min-width: 0;
    align-items: flex-start;
    padding: 10px 14px;
  }

  .box-amount {
    font-size: 24px;
  }

  .summary-metric-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .strip-item {
    padding: 6px 8px;
  }

  .strip-label {
    font-size: 10px;
  }

  .strip-val {
    font-size: 12px;
    white-space: nowrap;
  }

  /* 3. Tables on Mobile (Prevent 1-letter vertical wrapping) */
  .table-frame-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    border-radius: 8px;
  }

  .master-ledger-table,
  .francis-accounting-table {
    min-width: 680px; /* Ensures ledger and accounting tables scroll cleanly */
  }

  .master-matrix-table {
    min-width: 1280px; /* Full 31-day matrix columns remain legible on touch scroll */
  }

  .master-ledger-table th,
  .master-ledger-table td,
  .master-matrix-table th,
  .master-matrix-table td,
  .francis-accounting-table th,
  .francis-accounting-table td {
    white-space: nowrap !important;
    padding: 6px 8px !important;
    font-size: 11px !important;
  }

  /* 4. Francis Accounting Card */
  .statement-card-francis-accounting .kpi-cards-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .statement-card-francis-accounting .kpi-card {
    padding: 12px 14px;
  }

  .statement-card-francis-accounting .header-stamp {
    align-self: flex-start;
  }

  /* 5. Francis Help Card */
  .statement-card-francis-help .statement-header {
    padding: 14px 14px;
  }

  .statement-card-francis-help .header-main-row {
    flex-direction: column;
    gap: 10px;
  }

  .statement-card-francis-help .header-stamp {
    align-self: flex-start;
  }

  .help-welcome-banner {
    padding: 10px 12px;
    margin-top: 10px;
    gap: 10px;
  }

  .help-content-section {
    padding: 14px 12px;
  }

  .help-links-grid,
  .help-formula-grid,
  .help-tools-grid,
  .help-security-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .formula-card-wide {
    grid-column: 1 !important;
  }

  .formula-math {
    font-size: 11.5px !important;
    padding: 8px 10px !important;
    word-break: break-all;
  }

  .formula-math.formula-math-master {
    font-size: 11.5px !important;
  }

  .tier-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .help-section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 12px;
  }

  .sec-sub {
    margin-left: 0;
    font-size: 11px;
  }

  /* Footer */
  .statement-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 10px 12px;
    font-size: 10.5px;
  }

  .footer-dot {
    display: none;
  }
}




