:root {
  --ink: #18212f;
  --muted: #687386;
  --line: #e3e8ef;
  --panel: #ffffff;
  --canvas: #f4f6f8;
  --nav: #12261f;
  --accent: #21855f;
  --accent-dark: #176347;
  --accent-soft: #e6f4ee;
  --danger: #b42318;
  --shadow: 0 12px 32px rgba(18, 38, 31, .08);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent-dark); }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 250px; display: flex; flex-direction: column; padding: 24px 16px; color: #eaf4ef; background: var(--nav); z-index: 20; }
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand:hover { color: inherit; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: #0f3c2d; background: #b9efd8; font-weight: 850; letter-spacing: -.04em; }
.brand strong, .brand small, .user-chip strong, .user-chip small { display: block; }
.brand strong { font-size: 15px; letter-spacing: -.02em; }
.brand small { color: #9eb7ad; font-size: 11px; margin-top: 2px; }
.main-nav { margin-top: 36px; display: grid; gap: 5px; }
.main-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; color: #b7c9c2; text-decoration: none; border-radius: 10px; font-size: 14px; font-weight: 600; }
.main-nav a:hover, .main-nav a.active { color: white; background: rgba(255,255,255,.10); }
.main-nav a.active { box-shadow: inset 3px 0 #62d0a4; }
.main-nav a span { width: 20px; text-align: center; font-size: 18px; }
.nav-label { padding: 18px 12px 6px; color: #789288; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.sidebar-footer { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid rgba(255,255,255,.1); }
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #2f745b; font-weight: 800; }
.user-chip strong { font-size: 13px; }
.user-chip small { color: #8ea79d; font-size: 11px; }
.logout-link { padding: 8px 0 0 44px; border: 0; color: #9fb5ac; background: transparent; font-size: 12px; }
.main-content { min-height: 100vh; margin-left: 250px; padding: 34px 42px 56px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.eyebrow { margin: 0 0 5px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.topbar h1 { margin: 0; font-size: clamp(25px, 3vw, 34px); line-height: 1.12; letter-spacing: -.04em; }
.page-subtitle { margin: 7px 0 0; color: var(--muted); font-size: 14px; }
.mobile-bar { display: none; }
.flash-stack { position: relative; z-index: 10; }
.alert { border: 0; border-radius: 11px; box-shadow: 0 8px 20px rgba(0,0,0,.05); }
.btn { border-radius: 9px; font-weight: 700; font-size: 14px; padding: .62rem 1rem; }
.btn-primary { border-color: var(--accent); background: var(--accent); }
.btn-primary:hover, .btn-primary:focus { border-color: var(--accent-dark); background: var(--accent-dark); }
.btn-soft { border: 1px solid #cce6da; color: var(--accent-dark); background: var(--accent-soft); }
.btn-soft:hover { color: #0c4d35; background: #d5eee3; }
.card-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.panel-header h2 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.panel-body { padding: 22px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat-card { position: relative; min-height: 138px; padding: 21px; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; width: 70px; height: 70px; top: -20px; right: -16px; border-radius: 50%; background: var(--accent-soft); }
.stat-label { color: var(--muted); font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; }
.stat-value { display: block; margin-top: 12px; font-size: 30px; font-weight: 800; line-height: 1; letter-spacing: -.05em; }
.stat-note { margin-top: 11px; color: var(--muted); font-size: 12px; }
.quick-grid { display: grid; grid-template-columns: 1.45fr 1fr; gap: 18px; margin-top: 18px; }
.quick-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.action-tile { display: block; padding: 19px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); text-decoration: none; background: #fbfcfd; }
.action-tile:hover { border-color: #b9ddce; color: var(--ink); background: #f4fbf8; transform: translateY(-1px); }
.action-tile span { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 18px; border-radius: 10px; color: var(--accent-dark); background: var(--accent-soft); font-size: 20px; }
.action-tile strong, .action-tile small { display: block; }
.action-tile small { margin-top: 5px; color: var(--muted); }
.table { --bs-table-bg: transparent; margin: 0; }
.table > :not(caption) > * > * { padding: .78rem .8rem; border-bottom-color: var(--line); vertical-align: middle; }
.table thead th { color: #637083; background: #f8fafb; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.table tbody td { font-size: 13px; }
.table-responsive { border-radius: 0 0 16px 16px; }
.badge-soft-success, .badge-soft-danger, .badge-soft-neutral { display: inline-flex; padding: 5px 8px; border-radius: 99px; font-size: 11px; font-weight: 750; }
.badge-soft-success { color: #176347; background: #e1f4eb; }
.badge-soft-danger { color: #9f241a; background: #fee8e6; }
.badge-soft-neutral { color: #566273; background: #edf0f4; }
.form-label { color: #3f4b5d; font-size: 12px; font-weight: 750; }
.form-control, .form-select { min-height: 43px; border-color: #d7dde5; border-radius: 9px; font-size: 14px; }
.form-control:focus, .form-select:focus { border-color: #62b897; box-shadow: 0 0 0 .2rem rgba(33,133,95,.12); }
.form-text { color: #7c8797; font-size: 11px; }
.upload-drop { position: relative; padding: 48px 28px; border: 2px dashed #bad5c9; border-radius: 14px; text-align: center; background: #f7fcfa; transition: .15s ease; }
.upload-drop.dragging { border-color: var(--accent); background: var(--accent-soft); }
.upload-drop input[type=file] { max-width: 460px; margin: 18px auto 0; }
.upload-icon { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; color: var(--accent); background: var(--accent-soft); font-size: 27px; }
.required-list { display: flex; flex-wrap: wrap; gap: 7px; padding: 0; margin: 14px 0 0; list-style: none; }
.required-list li { padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; color: #566273; background: #fff; font-size: 11px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.summary-item { padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: #fafbfc; }
.summary-item small, .summary-item strong { display: block; }
.summary-item small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.summary-item strong { margin-top: 6px; font-size: 16px; }
.filter-bar { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.filter-bar .field { min-width: 180px; flex: 1; }
.empty-state { padding: 56px 24px; color: var(--muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: 5px; color: var(--ink); }
.pagination { margin: 0; }
.page-link { color: var(--accent-dark); }
.page-item.active .page-link { border-color: var(--accent); background: var(--accent); }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.settings-section { padding: 22px; }
.settings-section h2 { margin: 0 0 5px; font-size: 17px; }
.settings-section > p { margin: 0 0 19px; color: var(--muted); font-size: 13px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.switch-row:last-child { border-bottom: 0; }
.switch-row strong, .switch-row small { display: block; }
.switch-row strong { font-size: 13px; }
.switch-row small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.form-check-input:checked { border-color: var(--accent); background-color: var(--accent); }
.auth-shell { min-height: 100vh; background: #edf3f0; }
.auth-content { min-height: 100vh; display: grid; place-items: center; padding: 30px; background-image: radial-gradient(circle at 12% 15%, rgba(80,177,138,.16), transparent 32%), radial-gradient(circle at 90% 90%, rgba(18,38,31,.11), transparent 36%); }
.auth-card { width: min(440px, 100%); padding: 34px; border-radius: 20px; background: #fff; box-shadow: 0 24px 60px rgba(18,38,31,.13); }
.auth-card .brand { color: var(--ink); }
.auth-card h1 { margin: 34px 0 8px; font-size: 28px; letter-spacing: -.04em; }
.auth-card > p { margin-bottom: 25px; color: var(--muted); font-size: 14px; }
.credential-note { padding: 11px 13px; margin-bottom: 20px; border-left: 3px solid #dfa82d; color: #685520; background: #fff9e8; font-size: 12px; }
.dtr-toolbar { display: flex; gap: 9px; flex-wrap: wrap; }
.dtr-screen { padding: 26px; overflow-x: auto; border-radius: 16px; background: #dfe4e8; }
.dtr-sheet { display: grid; grid-template-columns: minmax(600px, 820px); justify-content: center; gap: 14px; }
.dtr-sheet.copies-2 { grid-template-columns: repeat(2, minmax(490px, 1fr)); }
.dtr-copy { padding: 24px; color: #111; background: #fff; box-shadow: 0 3px 14px rgba(0,0,0,.13); font-family: Arial, sans-serif; }
.dtr-heading { text-align: center; }
.dtr-heading .form-no { margin: 0; font-size: 9px; font-style: italic; text-align: left; }
.dtr-heading h2 { margin: 5px 0 2px; font-family: Georgia, serif; font-size: 18px; letter-spacing: .08em; }
.dtr-heading p { margin: 0; font-size: 9px; }
.dtr-info { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 16px; margin: 13px 0 9px; font-size: 10px; }
.dtr-info div { display: flex; gap: 7px; border-bottom: 1px solid #111; }
.dtr-info span { white-space: nowrap; }
.dtr-info strong { width: 100%; text-align: center; }
.dtr-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 8.5px; }
.dtr-table th, .dtr-table td { height: 18px; padding: 2px 3px; border: 1px solid #111; text-align: center; overflow: hidden; }
.dtr-table thead th { font-weight: 700; }
.dtr-table .remarks { width: 25%; text-align: left; }
.dtr-table .day { width: 6%; }
.dtr-table .weekday { width: 8%; }
.dtr-table tr.non-working.red-text td { color: #c1121f; }
.dtr-table tr.exception-row.red-text td { color: #c1121f; }
.dtr-table tr.non-working.light-red td, .dtr-table tr.exception-row.light-red td { color: #8e111b; background: #ffe5e5 !important; }
.dtr-certification { margin-top: 10px; font-size: 8.5px; line-height: 1.35; text-align: justify; }
.signature-stack { width: 62%; margin: 20px auto 0; text-align: center; font-size: 8.5px; }
.signature-block + .signature-block { margin-top: 22px; }
.signature-block strong { display: block; min-height: 12px; text-transform: uppercase; }
.signature-rule { border-top: 1px solid #111; }
.signature-block span { display: block; padding-top: 3px; }
.edit-table input { min-width: 90px; height: 34px; font-size: 12px; }
.edit-table input[name^=remarks] { min-width: 180px; }

@media (max-width: 1050px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-grid { grid-template-columns: 1fr; }
  .dtr-sheet.copies-2 { grid-template-columns: minmax(600px, 820px); }
}

@media (max-width: 760px) {
  .sidebar { transform: translateX(-102%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .mobile-bar { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; height: 62px; padding: 10px 18px; color: #fff; background: var(--nav); }
  .mobile-bar .brand-mark { width: 34px; height: 34px; border-radius: 9px; }
  .mobile-bar button { border: 0; color: #fff; background: transparent; font-size: 24px; }
  .main-content { margin-left: 0; padding: 24px 18px 42px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .stat-grid, .settings-grid { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-actions { grid-template-columns: 1fr; }
}

@media print {
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  body { background: #fff !important; }
  .sidebar, .mobile-bar, .topbar, .flash-stack, .no-print { display: none !important; }
  .main-content { min-height: 0; margin: 0; padding: 0; }
  .dtr-screen { padding: 0; overflow: visible; background: #fff; }
  .dtr-sheet { display: block; }
  .dtr-sheet.copies-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 5mm; }
  .dtr-copy { padding: 4mm; box-shadow: none; break-inside: avoid; }
  .dtr-sheet:not(.copies-2) .dtr-copy { max-width: 185mm; margin: 0 auto; }
  .dtr-sheet.copies-2 .dtr-copy { padding: 3mm; }
  .dtr-sheet.copies-2 .dtr-table { font-size: 6.8px; }
  .dtr-sheet.copies-2 .dtr-table th, .dtr-sheet.copies-2 .dtr-table td { height: 14px; padding: 1px 2px; }
  .dtr-sheet.copies-2 .dtr-info, .dtr-sheet.copies-2 .dtr-certification, .dtr-sheet.copies-2 .signature-stack { font-size: 7px; }
  .dtr-sheet.copies-2 .signature-stack { margin-top: 10px; }
  .dtr-sheet.copies-2 .signature-block + .signature-block { margin-top: 12px; }
  .dtr-sheet.copies-2 .dtr-heading h2 { font-size: 14px; }
}
