/* TRUSOF Driver, HR Payroll & Impelco Electric Company Exact Physical Sheet Replica Stylesheet */
:root {
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --success: #16a34a;
  --success-hover: #15803d;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --warning: #f59e0b;
  --bg-main: #f1f5f9;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #cbd5e1;
  --accent: #3b82f6;
  --radius: 12px;
  --shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Noto Sans Devanagari', sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
  line-height: 1.4;
  min-height: 100vh;
  padding-bottom: 60px;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

/* App Header & Navigation Bar */
.app-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #fff;
  padding: 12px 18px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1200px;
  margin: 0 auto;
}

.brand-title {
  font-size: 17px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.5px;
}

.brand-badge {
  background: #38bdf8;
  color: #0f172a;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
}

.company-subtext {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

/* Tabs Navigation */
.nav-tabs-wrapper {
  display: flex;
  background: #1e293b;
  border-radius: 10px;
  padding: 4px;
  margin-top: 10px;
  gap: 4px;
  overflow-x: auto;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.nav-tab-btn {
  flex: 1;
  min-width: 110px;
  border: none;
  background: transparent;
  color: #94a3b8;
  padding: 9px 8px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-tab-btn.active {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
}

/* Card */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}

.card-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Filter & Action Toolbars */
.sheet-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.sheet-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-select, .filter-input {
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  background: #f8fafc;
  outline: none;
}

.filter-select:focus, .filter-input:focus {
  border-color: #0284c7;
  background: #fff;
}

.btn-primary {
  background: #0284c7;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s ease;
}

.btn-primary:hover {
  background: #0369a1;
}

.btn-success {
  background: #16a34a;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s ease;
}

.btn-success:hover {
  background: #15803d;
}

.btn-print {
  background: #0f172a;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s ease;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
}

.btn-print:hover {
  background: #1e293b;
}

/* =========================================================================
   SHEET 1: EXACT REPLICA OF IMPELCO LOGBOOK SHEET (Photo 2 & Photo 4)
   ========================================================================= */
.hardcopy-sheet-paper {
  background: #fff;
  border: 2px solid #000;
  padding: 16px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  font-family: Arial, Helvetica, sans-serif;
  color: #000;
  margin-bottom: 20px;
  overflow-x: auto;
}

.hardcopy-sheet-header {
  position: relative;
  text-align: center;
  border-bottom: 1.5px solid #000;
  padding-bottom: 10px;
  margin-bottom: 8px;
}

.impelco-emblem-badge {
  position: absolute;
  right: 10px;
  top: 0px;
  width: 58px;
  height: 58px;
}

.hardcopy-company-title {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #000;
  line-height: 1.2;
}

.hardcopy-company-address {
  font-size: 11.5px;
  font-weight: 700;
  color: #111;
  margin-top: 3px;
}

.hardcopy-company-contact {
  font-size: 11px;
  font-weight: 700;
  color: #111;
  margin-top: 2px;
}

/* Logsheet Meta Rows (Matching Photo 2 & 4 with dotted underlines) */
.hardcopy-meta-block {
  margin-top: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
}

.hardcopy-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 4px;
}

.hardcopy-dotted-field {
  border-bottom: 1px dotted #000;
  display: inline-block;
  min-width: 140px;
  padding: 0 4px;
  color: #000;
  font-weight: 800;
}

/* Exact Table Layout (Photo 2 & Photo 4) */
.hardcopy-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  font-family: Arial, Helvetica, sans-serif;
  color: #000;
  text-align: center;
}

.hardcopy-table th, .hardcopy-table td {
  border: 1px solid #000;
  padding: 5px 3px;
  vertical-align: middle;
}

.hardcopy-table th {
  background: #ffffff;
  color: #000;
  font-weight: 800;
  font-size: 10.5px;
  text-transform: uppercase;
  line-height: 1.2;
}

.hardcopy-table td {
  height: 25px;
  font-weight: 600;
  color: #000;
}

.hardcopy-table td.col-left {
  text-align: left;
  padding-left: 6px;
}

.hardcopy-table tr:hover td {
  background-color: #f8fafc;
}

.sig-handwritten {
  font-family: 'Brush Script MT', 'Segoe Script', cursive, sans-serif;
  font-size: 13px;
  font-weight: bold;
  color: #0f172a;
}

/* =========================================================================
   SHEET 2: EXACT REPLICA OF DAY / NIGHT ATTENDANCE REGISTER (Photo 1)
   ========================================================================= */
.attendance-sheet-paper {
  background: #fff;
  border: 2px solid #000;
  padding: 16px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  font-family: Arial, Helvetica, sans-serif;
  color: #000;
  max-width: 820px;
  margin: 0 auto 20px auto;
}

.attendance-month-header {
  text-align: center;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 2px;
  padding: 6px 0 10px 0;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.attendance-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  color: #000;
  text-align: center;
}

.attendance-table th, .attendance-table td {
  border: 1px solid #000;
  padding: 4px 4px;
  height: 24px;
}

.attendance-table th {
  font-weight: 900;
  font-size: 12px;
  text-transform: uppercase;
}

.attendance-table th.th-night {
  background: #475569;
  color: #ffffff;
}

.attendance-table td.td-sno {
  font-weight: 800;
  width: 50px;
}

.attendance-inline-input {
  width: 100%;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #000;
  outline: none;
}

.attendance-inline-input:focus {
  background: #fef08a;
}

/* =========================================================================
   SHEET 3: EXACT REPLICA OF CHAUFFEUR FEEDBACK FORM (Photo 3 & Photo 5)
   ========================================================================= */
.feedback-sheet-paper {
  background: #fff;
  border: 2px solid #000;
  padding: 20px 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  font-family: Arial, Helvetica, sans-serif;
  color: #000;
  max-width: 780px;
  margin: 0 auto 20px auto;
}

.feedback-header-box {
  position: relative;
  text-align: center;
  border-bottom: 1.5px solid #000;
  padding-bottom: 8px;
  margin-bottom: 14px;
}

.feedback-title-text {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 1px;
  text-decoration: underline;
  margin-top: 10px;
  text-transform: uppercase;
}

.feedback-line-row {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 800;
}

.feedback-underline-input {
  border: none;
  border-bottom: 1px solid #000;
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  color: #000;
  padding: 2px 4px;
  outline: none;
  width: calc(100% - 150px);
}

.feedback-evaluation-box {
  border: 1.5px solid #000;
  margin: 16px 0;
  padding: 12px 14px;
}

.feedback-eval-section-title {
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.feedback-eval-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed #cbd5e1;
  font-size: 13px;
  font-weight: 800;
}

.feedback-eval-row:last-child {
  border-bottom: none;
}

.feedback-options-group {
  display: flex;
  align-items: center;
  gap: 24px;
}

.feedback-option-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
}

.feedback-option-label input[type="radio"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #000;
}

.feedback-km-metrics-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  font-weight: 800;
  margin: 14px 0;
  flex-wrap: wrap;
  gap: 8px;
}

.feedback-km-box-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.feedback-km-dotted-input {
  border: none;
  border-bottom: 1px dotted #000;
  width: 70px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  outline: none;
}

.feedback-suggestion-block {
  margin-top: 14px;
  font-size: 13px;
  font-weight: 800;
}

.feedback-suggestion-textarea {
  width: 100%;
  border: none;
  border-bottom: 1px dotted #000;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.8;
  outline: none;
  background: transparent;
  resize: vertical;
}

.feedback-signature-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
  text-align: center;
}

.feedback-signature-line {
  min-width: 180px;
  border-top: 1px solid #000;
  padding-top: 4px;
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
}

/* =========================================================================
   FORM INPUTS, MODALS & DIALOGS
   ========================================================================= */
.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

.input-big {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  background: #f8fafc;
  outline: none;
  transition: all 0.2s ease;
}

.input-big:focus {
  border-color: #0284c7;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.chip-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.chip-btn.selected, .chip-btn:hover {
  background: #0284c7;
  color: #fff;
  border-color: #0284c7;
}

.btn-action-big {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-start-duty {
  background: #16a34a;
  color: #fff;
}

.btn-start-duty:hover {
  background: #15803d;
}

.btn-end-duty {
  background: #dc2626;
  color: #fff;
}

.btn-end-duty:hover {
  background: #b91c1c;
}

/* Modal Popup */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: #fff;
  border-radius: 16px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
  padding: 24px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #64748b;
}

.toast-msg {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #fff;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.3);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.toast-msg.show {
  opacity: 1;
}

/* =========================================================================
   EXACT HARD COPY PRINT MEDIA STYLES (DITTO MATCH)
   ========================================================================= */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Hide entire application navigation & UI */
  .app-header,
  .nav-tabs-wrapper,
  .sheet-toolbar,
  .stats-grid,
  .no-print,
  .btn-print,
  .btn-primary,
  .btn-success,
  .modal-overlay,
  .toast-msg,
  #driverPortalView,
  #liveTrackingView,
  #hrPayrollView {
    display: none !important;
  }

  .container {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Logbook Sheet Print Formatting (Landscape) */
  body.print-mode-logbook #logbookSheetView {
    display: block !important;
  }
  body.print-mode-logbook #attendanceRegisterView,
  body.print-mode-logbook #feedbackFormView {
    display: none !important;
  }

  /* Attendance Register Print Formatting (Portrait) */
  body.print-mode-attendance #attendanceRegisterView {
    display: block !important;
  }
  body.print-mode-attendance #logbookSheetView,
  body.print-mode-attendance #feedbackFormView {
    display: none !important;
  }

  /* Feedback Form Print Formatting (Portrait) */
  body.print-mode-feedback #feedbackFormView {
    display: block !important;
  }
  body.print-mode-feedback #logbookSheetView,
  body.print-mode-feedback #attendanceRegisterView {
    display: none !important;
  }

  .hardcopy-sheet-paper,
  .attendance-sheet-paper,
  .feedback-sheet-paper {
    border: 2px solid #000000 !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 10px 14px !important;
    page-break-after: avoid !important;
    page-break-inside: avoid !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .hardcopy-table th, .hardcopy-table td,
  .attendance-table th, .attendance-table td {
    border: 1px solid #000000 !important;
    color: #000000 !important;
  }

  .attendance-table th.th-night {
    background: #555555 !important;
    color: #ffffff !important;
  }

  .feedback-evaluation-box {
    border: 1.5px solid #000000 !important;
  }
}

/* ========================================================================== */
/* RHN DUTY ROSTER, TEAM DEPLOYMENT & GOOGLE SHEET INTEGRATION STYLES         */
/* ========================================================================== */

/* Main Roster Container (Strict No-Overflow) */
#rhnRosterView {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Header Info Card */
.rhn-header-card {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #fff;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
  width: 100%;
  box-sizing: border-box;
}

.rhn-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.rhn-title-box h2 {
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.5px;
}

.rhn-title-box .rhn-sub {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

/* Google Sheet Connection Pill */
.sheet-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.sheet-pill.connected {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
  color: #4ade80;
}

.sheet-pill.pending {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.sheet-dot-online {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
}

.sheet-dot-offline {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
}

.sheet-link-btn {
  color: #38bdf8;
  text-decoration: underline;
  margin-left: 4px;
}

.btn-copy-sa {
  background: #f59e0b;
  color: #000;
  border: none;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

/* Date & Meta Controls Bar */
.rhn-meta-grid {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
}

@media (max-width: 640px) {
  .rhn-meta-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.rhn-date-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.08);
  padding: 4px;
  border-radius: 8px;
}

.rhn-date-nav input[type="date"] {
  background: transparent;
  border: none;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 4px;
  outline: none;
  width: 100%;
}

.rhn-date-nav button {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: none;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.rhn-shift-select {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  outline: none;
}
.rhn-shift-select option {
  background: #0f172a;
  color: #fff;
}

/* Stats Counter Grid */
.rhn-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
  width: 100%;
}

@media (max-width: 500px) {
  .rhn-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.rhn-stat-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.rhn-stat-val {
  font-size: 22px;
  font-weight: 900;
  line-height: 1.1;
}

.rhn-stat-lbl {
  font-size: 11px;
  color: #64748b;
  font-weight: 700;
  margin-top: 4px;
}

.stat-card-total .rhn-stat-val { color: #0284c7; }
.stat-card-pres .rhn-stat-val { color: #16a34a; }
.stat-card-late .rhn-stat-val { color: #d97706; }
.stat-card-abs .rhn-stat-val { color: #dc2626; }

/* Category Pills Breakdown */
.rhn-breakdown-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
  padding: 2px 0 8px 0;
  margin-bottom: 12px;
  -webkit-overflow-scrolling: touch;
}
.rhn-pill {
  background: #e2e8f0;
  color: #334155;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
  flex-shrink: 0;
}
.rhn-pill strong {
  color: #0f172a;
  font-weight: 800;
}

/* Sub-Navigation Tabs */
.rhn-subtabs-nav {
  display: flex;
  gap: 6px;
  background: #e2e8f0;
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 14px;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}

.rhn-subtab-btn {
  background: transparent;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.rhn-subtab-btn.active {
  background: #ffffff;
  color: #0284c7;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

/* Action Toolbar */
.rhn-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.btn-rhn-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  transition: transform 0.1s;
}
.btn-rhn-action:active { transform: scale(0.97); }

.btn-save-roster { background: #16a34a; color: #fff; }
.btn-sync-gsheet { background: #0284c7; color: #fff; }
.btn-whatsapp-rep { background: #25d366; color: #000; font-weight: 800; }
.btn-export-csv { background: #475569; color: #fff; }
.btn-print-rep { background: #0f172a; color: #fff; }
.btn-add-worker { background: #f1f5f9; color: #0f172a; border: 1.5px dashed #94a3b8; }

/* Filter Chips */
.rhn-filter-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0 10px 0;
  margin-bottom: 10px;
}

.rhn-filter-chip {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.rhn-filter-chip.active {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
}

/* Worker Cards (STRICT MOBILE OPTIMIZED - ZERO OVERFLOW) */
.rhn-worker-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  width: 100%;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.rhn-worker-card.card-present {
  border-color: #22c55e;
  background: #f0fdf4;
}

.rhn-worker-card.card-late {
  border-color: #f59e0b;
  background: #fffbeb;
}

.rhn-worker-card.card-absent {
  border-color: #e2e8f0;
  background: #ffffff;
}

.rhn-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.rhn-role-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}
.role-sup { background: #e0e7ff; color: #3730a3; }
.role-lineman { background: #fef3c7; color: #92400e; }
.role-mi { background: #e0f2fe; color: #075985; }
.role-helper { background: #f1f5f9; color: #334155; }
.role-driver { background: #dcfce7; color: #166534; }

.badge-present {
  background: #dcfce7;
  color: #15803d;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 12px;
}

.badge-late {
  background: #fef3c7;
  color: #b45309;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 12px;
}

.badge-absent {
  background: #fee2e2;
  color: #b91c1c;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 12px;
}

.btn-icon-del {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
}
.btn-icon-del:hover { color: #dc2626; }

.rhn-input-row {
  margin-bottom: 8px;
}

.rhn-input-lbl {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 3px;
}

.rhn-text-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  background: #ffffff;
  color: #0f172a;
}
.rhn-name-input {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

/* Quick Attendance 1-Tap Toggle Buttons */
.rhn-att-toggles {
  display: flex;
  gap: 6px;
  margin: 10px 0;
}

.btn-att-toggle {
  flex: 1;
  min-height: 44px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  touch-action: manipulation;
  transition: all 0.15s ease;
}

.btn-att-toggle:active {
  transform: scale(0.96);
}

.btn-toggle-pres.active {
  background: #16a34a;
  border-color: #16a34a;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.3);
}

.btn-toggle-late.active {
  background: #d97706;
  border-color: #d97706;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.3);
}

.btn-toggle-abs.active {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
}

.circle-l-icon, .paper-circle-l {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  font-size: 11px;
  font-weight: 900;
}

.circle-a-icon, .paper-circle-a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  font-size: 11px;
  font-weight: 900;
}

.paper-tick {
  color: #16a34a;
  font-weight: 900;
  font-size: 15px;
}

/* Timing Grid */
.rhn-time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
}

.btn-time-now {
  background: #e2e8f0;
  border: none;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
}

/* Deployment Table (Scrollable within container without body scroll) */
.rhn-table-scroll-wrapper {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.rhn-deploy-table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
  font-size: 12px;
}

.rhn-deploy-table th {
  background: #f1f5f9;
  color: #334155;
  font-weight: 800;
  padding: 8px 6px;
  border-bottom: 2px solid #cbd5e1;
  text-align: left;
}

.rhn-deploy-table td {
  padding: 6px;
  border-bottom: 1px solid #e2e8f0;
}

.rhn-cell-input {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
}

.rhn-cell-input.bold-van {
  font-weight: 800;
  color: #0284c7;
}

.rhn-cell-input.bold-driver {
  font-weight: 800;
  color: #16a34a;
}

/* Back Office Cards */
.rhn-bo-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
}
.rhn-bo-card.bo-present { border-left: 5px solid #16a34a; }
.rhn-bo-card.bo-absent { border-left: 5px solid #dc2626; }

/* Physical Paper Sheet Replica (Print / PDF / Visual Copy) */
.physical-paper-container {
  background: #ffffff;
  border: 2px solid #000000;
  padding: 14px;
  margin: 0 auto;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  font-family: Arial, sans-serif;
  color: #000000;
  width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
}

.paper-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.paper-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.paper-table th, .paper-table td {
  border: 1px solid #000000;
  padding: 4px 6px;
  vertical-align: middle;
}

.paper-table th {
  background: #f1f5f9;
  font-weight: 900;
  text-align: center;
  font-size: 10.5px;
}

.paper-table td.td-center {
  text-align: center;
  font-weight: 800;
}

.paper-table td.td-van {
  font-weight: 800;
  font-size: 10.5px;
  white-space: nowrap;
}

/* Google Sheet Info Card */
.rhn-gsheet-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 18px;
  margin-top: 10px;
}

.rhn-gsheet-card h3 {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 10px;
}

.rhn-code-box {
  background: #0f172a;
  color: #38bdf8;
  padding: 10px 14px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0;
  word-break: break-all;
}

/* PRINT MEDIA QUERIES FOR PHYSICAL PAPER REPLICA */
@media print {
  .app-header,
  .rhn-header-card,
  .rhn-stats-grid,
  .rhn-breakdown-bar,
  .rhn-subtabs-nav,
  .rhn-toolbar,
  .rhn-filter-chips,
  #rhnAttendanceCardsView,
  #rhnDeploymentTableView,
  #rhnBackOfficeView,
  #rhnGoogleSheetInfoView,
  .no-print {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  #rhnPaperSheetView {
    display: block !important;
  }

  .physical-paper-container {
    border: 2px solid #000000 !important;
    box-shadow: none !important;
    padding: 6px !important;
    width: 100% !important;
  }

  .paper-table th, .paper-table td {
    border: 1px solid #000000 !important;
    color: #000000 !important;
    font-size: 9.5px !important;
    padding: 3px 4px !important;
  }
}

