*,*:before,*:after{box-sizing:border-box}html,body{height:100%;overflow:hidden;-webkit-overflow-scrolling:touch}body{margin:0;font-family:Segoe UI,Arial,sans-serif;font-size:14px;background:#f4f6f9;color:#222}a{color:inherit;text-decoration:none}button{cursor:pointer}.layout{display:flex;flex-direction:column;height:100vh;overflow:hidden}.nav{background:#1a2340;display:flex;align-items:center;gap:4px;padding:0 16px;height:48px}.nav-title{color:#fff;font-weight:700;font-size:16px;margin-right:24px;letter-spacing:.5px}.nav a{color:#a0aacc;padding:12px 16px;border-bottom:3px solid transparent;font-size:14px;transition:color .15s}.nav a:hover{color:#fff}.nav a.active{color:#fff;border-bottom-color:#4d8ef0}.page{padding:20px 24px;flex:1;overflow-y:auto;min-height:0;-webkit-overflow-scrolling:touch;padding-bottom:env(safe-area-inset-bottom,20px)}.summary-bar{font-size:18px;font-weight:700;margin-bottom:20px;color:#1a2340}.summary-bar span{color:#4d8ef0}.dept-list{display:flex;flex-direction:column;gap:8px;padding-bottom:40px}.dept-header{display:flex;align-items:center;justify-content:space-between;background:#fff;border:1px solid #dde3f0;border-radius:6px;padding:10px 16px;cursor:pointer;-webkit-user-select:none;user-select:none;transition:background .1s}.dept-header:hover{background:#f0f4ff}.dept-header-left{display:flex;align-items:center;gap:12px}.dept-name{font-weight:600;font-size:15px}.dept-count{color:#666;font-size:13px}.dept-chevron{color:#888;font-size:12px;transition:transform .2s}.dept-chevron.open{transform:rotate(90deg)}.dept-total{color:#888;font-size:13px}.dept-badge{display:inline-flex;align-items:center;padding:1px 8px;border-radius:10px;font-size:12px;font-weight:600;white-space:nowrap}.dept-badge.present{background:#e6f7ee;color:#1a8a42}.dept-badge.absent{background:#fde9e9;color:#c0392b}.dept-badge.noshow{background:#f0f1f4;color:#888}.emp-table-wrap{background:#fff;border:1px solid #dde3f0;border-top:none;border-radius:0 0 6px 6px;overflow-x:auto;margin-bottom:8px}table.emp-table{width:100%;border-collapse:collapse;font-size:13px}.emp-table th{background:#f7f9fc;color:#555;font-weight:600;text-align:left;padding:8px 12px;border-bottom:1px solid #dde3f0;white-space:nowrap}.emp-table td{padding:7px 12px;border-bottom:1px solid #eef1f7;white-space:nowrap}.emp-table tr:last-child td{border-bottom:none}.emp-table tr:hover td{background:#f7f9ff}.status-badge{display:inline-flex;align-items:center;gap:5px;padding:2px 8px;border-radius:12px;font-size:12px;font-weight:600}.status-badge.present{background:#e6f7ee;color:#1a8a42}.status-badge.absent{background:#fde9e9;color:#c0392b}.status-badge.noshow{background:#f0f1f4;color:#888}.status-dot{width:7px;height:7px;border-radius:50%;display:inline-block}.status-badge.present .status-dot{background:#27ae60}.status-badge.absent .status-dot{background:#e74c3c}.status-badge.noshow .status-dot{background:#aaa}.status-exit-time{margin-left:4px;font-weight:400;opacity:.8}.dept-settings{max-width:700px}.dept-settings h1{font-size:20px;margin-bottom:16px}.dept-check-list{display:flex;flex-direction:column;gap:6px}.dept-check-item{display:flex;align-items:center;gap:10px;background:#fff;border:1px solid #dde3f0;border-radius:6px;padding:9px 14px;cursor:pointer}.dept-check-item:hover{background:#f0f4ff}.dept-check-item input[type=checkbox]{width:16px;height:16px;cursor:pointer}.dept-check-item label{cursor:pointer;flex:1;font-size:14px}.dept-accgroup-select{border:1px solid #ccd3e8;border-radius:4px;padding:3px 6px;font-size:12px;background:#f7f9fc;color:#555;max-width:180px;cursor:pointer}.dept-accgroup-select:focus{border-color:#4d8ef0;outline:none}.save-btn{margin-top:16px;padding:10px 28px;background:#4d8ef0;color:#fff;border:none;border-radius:6px;font-size:15px;font-weight:600;transition:background .15s}.save-btn:hover{background:#3a7de0}.save-btn:disabled{background:#a0bce0;cursor:not-allowed}.toast{position:fixed;bottom:24px;right:24px;background:#1a8a42;color:#fff;padding:12px 20px;border-radius:8px;font-size:14px;font-weight:600;box-shadow:0 4px 16px #00000026;animation:fadeIn .2s ease;z-index:1000}@keyframes fadeIn{0%{opacity:0;transform:translateY(8px)}to{opacity:1}}.absent-link{color:#4d8ef0;text-decoration:underline;text-decoration-style:dotted;cursor:pointer}.modal-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#00000073;z-index:2000;display:flex;align-items:center;justify-content:center}.modal{background:#fff;border-radius:10px;padding:28px 28px 20px;max-width:420px;width:90%;box-shadow:0 8px 32px #0000002e}.modal h2{margin:0 0 20px;font-size:17px;font-weight:700;color:#1a2340}.modal-field{display:flex;flex-direction:column;gap:4px;margin-bottom:14px}.modal-field label{font-size:12px;color:#555;font-weight:600}.modal-field input,.modal-field select{border:1px solid #ccd3e8;border-radius:5px;padding:7px 10px;font-size:14px;background:#f7f9fc;color:#222;outline:none}.modal-field input:focus,.modal-field select:focus{border-color:#4d8ef0;background:#fff}.nfc-hint{font-size:11px;color:#7a8fb5;margin-top:4px}.card-info-result{margin:12px 0;border:1px solid #2a3556;border-radius:6px;overflow:hidden}.card-info-row{display:flex;justify-content:space-between;gap:12px;padding:7px 12px;font-size:13px;border-bottom:1px solid #1e2a46}.card-info-row:last-child{border-bottom:none}.card-info-row>span:first-child{color:#7a8fb5;white-space:nowrap}.card-info-row>span:last-child{text-align:right}.modal-error{color:#c0392b;font-size:13px;margin-bottom:12px}.modal-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:20px}.emp-row:hover td{background:#f7f9ff}@keyframes emp-highlight-fade{0%{background:#fff3a3}to{background:transparent}}.emp-row.highlight td{animation:emp-highlight-fade 2.5s ease-out forwards}.emp-events-wrap{background:#f7f9fc;border-top:1px solid #dde3f0;padding:8px 16px 10px}.emp-events-loading{color:#888;font-size:13px;padding:4px 0;display:block}.emp-events-table{border-collapse:collapse;font-size:12px;width:auto;min-width:360px}.emp-events-table th{background:#eef1f7;color:#555;font-weight:600;padding:4px 10px;text-align:left;border-bottom:1px solid #dde3f0;white-space:nowrap}.emp-events-table td{padding:3px 10px;border-bottom:1px solid #eef1f7;white-space:nowrap}.emp-events-table tr:last-child td{border-bottom:none}.error-msg{color:#c0392b;padding:20px 0}.loading{color:#888;padding:20px 0}.report-tabs{display:flex;gap:4px;margin-bottom:20px;border-bottom:2px solid #dde3f0;padding-bottom:0}.report-tab{background:none;border:none;border-bottom:3px solid transparent;margin-bottom:-2px;padding:8px 20px;font-size:14px;font-weight:600;color:#666;cursor:pointer;transition:color .15s}.report-tab:hover{color:#1a2340}.report-tab.active{color:#4d8ef0;border-bottom-color:#4d8ef0}.report-section{padding-top:4px}.report-form{display:flex;flex-direction:column;gap:10px;margin-bottom:20px;background:#fff;border:1px solid #dde3f0;border-radius:8px;padding:16px 20px}.report-form-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.report-form-row label{font-size:13px;color:#555;white-space:nowrap}.report-form .save-btn{margin-top:0;padding:7px 22px;font-size:14px}.report-form .print-btn{padding:6px 22px}.report-form-row select,.report-form-row input[type=date]{border:1px solid #ccd3e8;border-radius:5px;padding:5px 10px;font-size:13px;background:#f7f9fc;color:#222}.report-form-row select{min-width:220px;max-width:400px}.search-select{position:relative;min-width:320px;max-width:500px;flex:1}.search-select-input{width:100%;border:1px solid #ccd3e8;border-radius:5px;padding:5px 10px;font-size:13px;background:#f7f9fc;color:#222}.search-select-input::placeholder{color:#333}.search-select-dropdown{position:absolute;top:100%;left:0;right:0;max-height:240px;overflow-y:auto;background:#fff;border:1px solid #ccd3e8;border-top:none;border-radius:0 0 5px 5px;box-shadow:0 4px 12px #0000001a;z-index:100}.search-select-item{padding:6px 10px;font-size:13px;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.search-select-item:hover{background:#f0f4ff}.search-select-item.selected{background:#e6edff;font-weight:600}.search-select-item.active{background:#d6e4ff}.search-select-dept{color:#888}.search-select-empty{padding:8px 10px;color:#888;font-size:13px}.print-btn{padding:9px 22px;background:#fff;color:#4d8ef0;border:1px solid #4d8ef0;border-radius:6px;font-size:14px;font-weight:600;transition:background .15s,color .15s}.print-btn:hover{background:#4d8ef0;color:#fff}.reports-page,.report-section{display:flex;flex-direction:column;flex:1;min-height:0}.report-emp-wrap{overflow:auto;flex:1;min-height:0}.report-emp-header{font-size:15px;margin-bottom:10px;color:#1a2340}.report-table{width:100%;border-collapse:collapse;font-size:13px;background:#fff;border:1px solid #dde3f0;border-radius:6px;overflow:hidden}.report-table th{background:#f7f9fc;color:#555;font-weight:600;padding:8px 14px;text-align:left;border-bottom:2px solid #dde3f0;white-space:nowrap;position:sticky;top:0;z-index:1}.report-table td{padding:6px 14px;border-bottom:1px solid #eef1f7;white-space:nowrap}.report-table tr:last-child td{border-bottom:none}.report-table tbody tr:hover td{background:#f7f9ff}.report-row-empty td{color:#bbb}.report-totals td{background:#f0f4ff!important;border-top:2px solid #dde3f0}.report-day-off,.report-day-off td{background-color:#e8f5e9!important}.report-monthly-wrap{display:flex;flex-direction:column;gap:28px}.report-dept-title{font-size:15px;font-weight:700;color:#1a2340;margin-bottom:8px}.report-monthly-scroll{overflow-x:auto}.report-monthly-table{width:100%;table-layout:fixed;border-collapse:collapse;font-size:11px;background:#fff;border:1px solid #dde3f0}.report-monthly-table th{background:#f7f9fc;color:#555;font-weight:600;padding:3px 1px;text-align:center;border:1px solid #dde3f0;white-space:nowrap;overflow:hidden}.report-monthly-table td{border:1px solid #eef1f7;text-align:center;vertical-align:middle;padding:2px 1px;white-space:nowrap;overflow:hidden}.report-monthly-name-col{text-align:left!important;padding:3px 6px!important;width:150px;font-weight:600;overflow:hidden;text-overflow:ellipsis}.report-monthly-total-col{width:50px;font-weight:700}.report-monthly-dow{font-weight:400;color:#888;font-size:10px}.report-monthly-row1 td{border-bottom:none}.report-monthly-row2 td{border-top:none;font-size:10px;color:#555}.report-monthly-day-cell{line-height:1.3}.report-monthly-work-cell{color:#555}.report-time-arr{color:#27ae60;font-size:9px}.report-time-dep{color:#c0392b;font-size:9px}.report-time-empty{color:#ccc;font-size:9px}.report-yearly-wrap{overflow:auto;flex:1;min-height:0}.report-yearly-table{width:100%;table-layout:fixed;border-collapse:collapse;font-size:13px;background:#fff;border:1px solid #dde3f0}.report-yearly-table th{background:#f7f9fc;color:#555;font-weight:600;padding:8px 4px;text-align:center;border:1px solid #dde3f0;white-space:nowrap}.report-yearly-table td{padding:7px 4px;border:1px solid #eef1f7;text-align:center;white-space:nowrap}.report-yearly-label-col{text-align:left!important;padding:7px 12px!important;width:220px;font-weight:500}.report-yearly-total-col{font-weight:700;background:#f0f4ff;width:52px}.report-yearly-zero{color:#bbb}.report-yearly-table tbody tr:hover td{background:#f7f9ff}.report-yearly-table tbody tr:hover td.report-yearly-total-col{background:#e6edff}.report-row-clickable:hover,.report-cell-clickable:hover{background:#eef3ff}.report-events-row td{padding:0!important;background:#f8f9fc}.report-events-table{width:auto;margin:6px 16px;border-collapse:collapse;font-size:12px}.report-events-table th{background:#e8ecf4;padding:4px 12px;text-align:left;font-weight:600;font-size:11px;color:#555}.report-events-table td{padding:3px 12px;border-bottom:1px solid #eee}.report-events-loading,.report-events-empty{padding:8px 16px;color:#888;font-size:12px}.print-modal-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#00000059;z-index:1000;display:flex;align-items:center;justify-content:center}.print-modal{background:#fff;border-radius:8px;padding:24px 28px;min-width:340px;max-height:80vh;overflow-y:auto;box-shadow:0 4px 24px #0000002e;display:flex;flex-direction:column;gap:16px}.print-modal-title{font-size:16px;font-weight:600}.print-modal-actions{display:flex;gap:12px}.print-modal-list{display:flex;flex-direction:column;gap:8px}.print-modal-item{display:flex;align-items:center;gap:8px;cursor:pointer;font-size:14px;-webkit-user-select:none;user-select:none}.print-modal-item input[type=checkbox]{width:15px;height:15px;cursor:pointer}.print-modal-footer{display:flex;gap:10px;padding-top:4px}.link-btn{background:none;border:none;color:#4a6fa5;cursor:pointer;font-size:13px;padding:0;text-decoration:underline}.link-btn:hover{color:#2d4f80}.cancel-btn{padding:7px 18px;border-radius:6px;border:1px solid #d0d7e3;background:#f5f7fb;cursor:pointer;font-size:14px}.cancel-btn:hover{background:#e8ecf4}@media print{.no-print,.print-hidden,.nav{display:none!important}html,body,.layout{height:auto!important;overflow:visible!important}.page{padding:8px!important;overflow:visible!important;height:auto!important}.report-section,.report-monthly-wrap{overflow:visible!important}.report-table{font-size:11px}.report-table th,.report-table td{padding:4px 8px}.report-dept-block{page-break-after:always}.report-dept-block:last-child{page-break-after:avoid}.report-monthly-scroll{overflow-x:visible}.report-monthly-table{font-size:9px}.report-monthly-name-col{min-width:100px;max-width:130px;font-size:9px}.report-monthly-day-col{min-width:30px}.report-yearly-wrap{overflow:visible}.report-yearly-table{font-size:10px}.report-yearly-label-col{width:160px!important;font-size:10px}}@media (max-width: 640px){.page{padding:12px}.nav{padding:0 8px;gap:0}.nav-title{font-size:14px;margin-right:8px}.nav a{padding:12px 10px;font-size:13px}.summary-bar{font-size:15px;margin-bottom:12px}.dept-header{padding:8px 12px;flex-wrap:wrap;gap:4px}.dept-header-left{flex-wrap:wrap;gap:4px}.dept-name{font-size:14px}.dept-badge{font-size:11px;padding:1px 6px}.emp-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}.emp-table{font-size:12px;min-width:480px}.emp-table th,.emp-table td{padding:5px 8px}.dept-settings{max-width:100%}.dept-check-item{padding:8px 10px}.save-btn{width:100%}}
