* { box-sizing: border-box; }
html, body { margin:0; padding:0; }
:root {
    --primary:#16324f;
    --secondary:#16a6a6;
    --bg:#f4f7f9;
    --text:#17212b;
    --muted:#65727e;
    --border:#d6dee5;
}
body {
    font-family: Arial, Helvetica, sans-serif;
    background:var(--bg);
    color:var(--text);
    font-size:15px;
}
.app-shell { width:100%; max-width:900px; margin:0 auto; padding:22px 16px 35px; }
.form-page {
    max-width:500px; margin:8px auto 0; background:#fff; border-radius:16px;
    box-shadow:0 8px 28px rgba(22,50,79,.12); overflow:hidden;
}
.form-page::before { content:""; display:block; height:7px; background:linear-gradient(90deg,var(--primary) 0 50%,var(--secondary) 50% 100%); }
.form-inner { padding:24px 24px 26px; }
.form-topbar { display:flex; justify-content:flex-start; margin:-4px 0 8px; }
.exit-btn { display:inline-flex; align-items:center; gap:5px; padding:7px 12px; border-radius:8px; background:var(--secondary); color:#fff; text-decoration:none; font-size:12px; font-weight:700; box-shadow:0 3px 8px rgba(22,166,166,.16); transition:.18s ease; }
.exit-btn:hover { background:var(--primary); transform:translateY(-1px); }
.exit-btn:focus { outline:3px solid rgba(22,166,166,.18); outline-offset:2px; }
.page-title { text-align:center; font-size:21px; color:var(--primary); font-weight:700; margin:0 0 7px; }
.page-subtitle { text-align:center; color:var(--muted); font-size:13px; margin:0 0 22px; }
.area-badge {
    display:block; width:max-content; margin:0 auto 20px; padding:6px 14px; border-radius:999px;
    background:var(--secondary); color:#fff; font-size:13px; font-weight:700;
}
.form-grid { display:grid; grid-template-columns:130px minmax(0,1fr); column-gap:14px; row-gap:14px; align-items:center; }
.form-grid label { color:var(--primary); font-weight:600; line-height:1.25; }
input, select, textarea {
    width:100%; border:1px solid var(--border); border-radius:9px; background:#fff;
    padding:10px 11px; font:inherit; color:var(--text); outline:none; transition:.18s ease;
}
input:focus, select:focus, textarea:focus { border-color:var(--secondary); box-shadow:0 0 0 3px rgba(22,166,166,.13); }
input[type=date], input[type=time] { min-height:42px; }
select { min-height:42px; cursor:pointer; }
textarea { min-height:92px; resize:vertical; }
.field-with-action { display:flex; gap:7px; align-items:center; }
.field-with-action input { min-width:0; flex:1; }
.quick-btn {
    flex:0 0 auto; border:1px solid var(--secondary); border-radius:8px; background:#fff;
    color:var(--secondary); padding:9px 10px; font-size:12px; font-weight:700; cursor:pointer;
}
.quick-btn:hover { background:var(--secondary); color:#fff; }
.time-help { grid-column:2; margin-top:-7px; color:var(--muted); font-size:11px; }
.duration-box {
    grid-column:2; margin-top:-3px; padding:9px 11px; border-left:4px solid var(--secondary);
    background:#eefafa; color:var(--primary); border-radius:6px; font-size:13px; font-weight:600;
}
.form-actions { text-align:center; margin-top:24px; }
button[type=submit], .btn {
    display:inline-block; border:0; border-radius:9px; background:var(--primary); color:#fff;
    padding:11px 25px; font:inherit; font-weight:700; cursor:pointer; text-decoration:none; box-shadow:0 4px 10px rgba(22,50,79,.16);
}
button[type=submit]:hover, .btn:hover { background:var(--secondary); }
.message { margin:0 0 18px; padding:11px 12px; background:#fff5f5; color:#8a2323; border:1px solid #efc4c4; border-radius:8px; }
.home { max-width:500px; margin:25px auto; text-align:center; }
.home-menu { display:flex; flex-direction:column; gap:12px; align-items:center; }
.home-menu > a, .report-menu summary {
    width:100%; padding:15px 18px; border-radius:12px; text-decoration:none; color:#fff;
    background:var(--primary); font-size:16px; font-weight:700; box-shadow:0 4px 12px rgba(22,50,79,.12);
}
.home-menu > a:nth-child(2) { background:var(--secondary); }
.home-menu > a.machine-cleaning-main { background:linear-gradient(135deg,var(--primary),var(--secondary)); }
.home-menu > a.machine-cleaning-main span { font-size:13px; font-weight:600; opacity:.9; }
.home-menu > a:hover, .report-menu summary:hover { opacity:.9; }
.report-menu { width:100%; }
.report-menu summary { list-style:none; cursor:pointer; }
.report-menu summary::-webkit-details-marker { display:none; }
.report-menu summary:after { content:' ▾'; font-size:12px; }
.report-links { margin:8px 0 0; display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.report-links a { padding:11px; background:#e9f4f4; color:var(--primary); border:1px solid #c8e5e5; border-radius:9px; text-decoration:none; font-weight:600; }
.report-links a:hover { background:var(--secondary); color:#fff; }
.report-filter { max-width:680px; margin:0 auto 18px; }
.filter-grid { display:grid; grid-template-columns:100px 1fr 100px 1fr auto; gap:8px; align-items:center; }
.report-title { text-align:center; margin:5px 0 16px; font-size:18px; }
.report-period { text-align:center; margin-bottom:18px; }
.report-group { margin:0 0 24px; page-break-inside:avoid; }
.report-group h3 { font-size:15px; font-weight:400; margin:0 0 7px; }
.report-table-wrap { overflow-x:auto; }
table { width:100%; border-collapse:collapse; font-size:12px; }
th, td { border:1px solid #aaa; padding:6px; text-align:left; vertical-align:top; }
th { background:#f2f2f2; font-weight:400; white-space:nowrap; }
.no-data { text-align:center; padding:25px; border:1px solid #ccc; }
.topbar { display:flex; justify-content:space-between; align-items:center; margin-bottom:18px; }
.topbar a { color:var(--primary); text-decoration:none; }
.topbar a:hover { color:var(--secondary); }
.print-btn { background:#555; }
@media (max-width:600px) {
    .app-shell { padding:12px 10px 25px; }
    .form-page { max-width:430px; margin-top:3px; border-radius:14px; }
    .form-inner { padding:20px 16px 22px; }
    .page-title { font-size:19px; }
    .form-grid { grid-template-columns:1fr; gap:7px; }
    .form-grid label { font-size:13px; margin-top:7px; }
    .time-help, .duration-box { grid-column:1; }
    .time-help { margin-top:0; }
    .duration-box { margin-top:5px; }
    input, select, textarea { padding:11px; }
    .quick-btn { padding:10px 9px; }
    .home { max-width:430px; margin-top:18px; }
    .filter-grid { grid-template-columns:1fr 1fr; }
    .filter-grid label { font-size:13px; }
    .filter-grid .filter-submit { grid-column:1 / -1; text-align:center; }
    .report-links { grid-template-columns:1fr; }
}
@media print {
    .no-print { display:none !important; }
    body { font-size:12px; background:#fff; }
    .app-shell { max-width:none; padding:0; }
    .form-page { box-shadow:none; }
}

/* Reports */
.report-page { max-width:1100px; margin:0 auto; }
.report-topbar { display:flex; justify-content:space-between; align-items:center; gap:14px; margin:4px 0 16px; }
.back-link { color:var(--primary); text-decoration:none; font-weight:700; }
.report-actions { display:flex; gap:8px; flex-wrap:wrap; }
.action-btn { border:0; border-radius:9px; padding:10px 15px; color:#fff; font:inherit; font-weight:700; cursor:pointer; box-shadow:0 4px 10px rgba(22,50,79,.14); }
.excel-btn { background:#168a68; }
.pdf-btn { background:var(--primary); }
.action-btn:hover { opacity:.9; transform:translateY(-1px); }
.report-hero { display:flex; justify-content:space-between; align-items:center; gap:20px; padding:24px 26px; border-radius:18px; color:#fff; background:linear-gradient(120deg,var(--primary),#214b70); box-shadow:0 10px 25px rgba(22,50,79,.16); margin-bottom:18px; position:relative; overflow:hidden; }
.report-hero:after { content:""; position:absolute; width:190px; height:190px; border-radius:50%; right:-65px; top:-85px; background:rgba(22,166,166,.35); }
.maintenance-hero { background:linear-gradient(120deg,#16a6a6,#087a7a); }
.report-kicker { font-size:11px; letter-spacing:1.5px; font-weight:800; opacity:.85; margin-bottom:5px; }
.report-hero h1 { margin:0 0 5px; font-size:25px; }
.report-hero p { margin:0; opacity:.88; font-size:13px; }
.report-icon { position:relative; z-index:1; min-width:62px; height:62px; border-radius:16px; display:grid; place-items:center; background:rgba(255,255,255,.16); border:1px solid rgba(255,255,255,.28); font-weight:800; font-size:20px; }
.report-filter-card { background:#fff; border:1px solid var(--border); border-radius:14px; padding:17px 18px; box-shadow:0 6px 20px rgba(22,50,79,.07); margin-bottom:20px; }
.filter-heading { color:var(--primary); font-weight:800; margin-bottom:12px; }
.filter-grid-new { display:grid; grid-template-columns:1fr 1fr auto; gap:12px; align-items:end; }
.filter-field label { display:block; color:var(--muted); font-size:12px; font-weight:700; margin-bottom:5px; }
.filter-field input { min-height:42px; }
.generate-btn { min-height:42px; border:0; border-radius:9px; padding:0 18px; background:var(--secondary); color:#fff; font:inherit; font-weight:800; cursor:pointer; }
.generate-btn:hover { background:var(--primary); }
.report-heading-block { text-align:center; margin:5px 0 18px; }
.report-heading-block h2 { color:var(--primary); margin:0 0 7px; font-size:20px; }
.report-period-pill { display:inline-block; background:#eaf7f7; border:1px solid #cce8e8; color:#31545d; border-radius:999px; padding:7px 13px; font-size:12px; }
.report-group { background:#fff; border:1px solid var(--border); border-radius:14px; overflow:hidden; margin:0 0 17px; box-shadow:0 5px 16px rgba(22,50,79,.06); page-break-inside:avoid; }
.person-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:12px 15px; background:linear-gradient(90deg,#edf6fa,#eefafa); color:var(--primary); font-size:14px; }
.person-tag { font-size:11px; font-weight:800; color:var(--secondary); background:#fff; border:1px solid #c9e6e6; border-radius:999px; padding:5px 9px; }
.report-table-wrap { overflow-x:auto; }
.report-table { width:100%; border-collapse:collapse; font-size:12px; }
.report-table th { background:var(--primary); color:#fff; border:0; padding:9px 8px; text-align:left; font-weight:700; white-space:nowrap; }
.report-table td { border-bottom:1px solid #e5eaee; padding:9px 8px; text-align:left; vertical-align:top; }
.report-table tr:last-child td { border-bottom:0; }
.report-table tbody tr:nth-child(even) { background:#fafcfd; }
.area-chip, .duration-chip { display:inline-block; border-radius:999px; padding:4px 8px; font-size:11px; font-weight:800; }
.area-chip.en { background:#e5f7f2; color:#137052; }
.area-chip.sn { background:#e9effa; color:#315a9b; }
.duration-chip { background:#edf4f8; color:var(--primary); white-space:nowrap; }
.detail-text { color:var(--muted); font-size:11px; }
.report-summary { display:flex; justify-content:center; gap:10px; flex-wrap:wrap; margin:20px 0 10px; }
.report-summary div { min-width:130px; text-align:center; background:#fff; border:1px solid var(--border); border-radius:12px; padding:10px 15px; }
.report-summary span { display:block; color:var(--muted); font-size:11px; }
.report-summary strong { display:block; color:var(--primary); font-size:18px; margin-top:3px; }
@media (max-width:700px) {
    .report-topbar { align-items:flex-start; flex-direction:column; }
    .report-actions { width:100%; }
    .action-btn { flex:1; }
    .report-hero { padding:20px 18px; }
    .report-hero h1 { font-size:21px; }
    .filter-grid-new { grid-template-columns:1fr; }
    .generate-btn { width:100%; }
    .report-heading-block h2 { font-size:18px; }
    .report-table { min-width:760px; }
    .report-table-wrap { -webkit-overflow-scrolling:touch; }
}
@media print {
    @page { size:A4 landscape; margin:10mm; }
    body { background:#fff; font-size:10px; }
    .app-shell, .report-page { max-width:none; padding:0; }
    .no-print { display:none !important; }
    .report-hero { border-radius:0; box-shadow:none; padding:10px 12px; margin-bottom:8px; }
    .report-hero h1 { font-size:18px; }
    .report-hero p { font-size:9px; }
    .report-icon { display:none; }
    .report-heading-block { margin:7px 0 10px; }
    .report-heading-block h2 { font-size:14px; }
    .report-period-pill { padding:4px 8px; }
    .report-group { box-shadow:none; margin-bottom:9px; border-radius:0; }
    .person-heading { padding:6px 8px; }
    .report-table { font-size:9px; }
    .report-table th, .report-table td { padding:5px 4px; }
    .report-summary { margin-top:10px; }
    .report-summary div { padding:5px 10px; min-width:100px; }
    .report-summary strong { font-size:13px; }
}

.user-entry { display: grid; gap: 8px; }
.new-user-box { padding: 12px; border-radius: 12px; background: #e8f7f5; border: 1px solid #9ad8d0; }
.new-user-box[hidden] { display: none; }
.new-user-box input { width: 100%; box-sizing: border-box; }
.user-help { margin-top: 6px; font-size: .82rem; color: #456; }
