*{box-sizing:border-box;margin:0;padding:0;}
body{background:#f0f4f8;font-family:'Segoe UI',sans-serif;}
#root{max-width:480px;margin:0 auto;min-height:100vh;display:flex;flex-direction:column;}
input:focus,select:focus,button:focus-visible{border-color:#0d5c3a!important;outline:none;}
a{color:#2980b9;}
.link-inline{color:#2980b9;font-size:12px;}

.header{background:linear-gradient(135deg,#1a3a2a,#0d5c3a,#1a7a4a);padding:12px 14px;display:flex;align-items:center;gap:10px;box-shadow:0 2px 12px rgba(0,0,0,.3);}
.header-inner{flex:1;}
.h-title{color:#fff;font-size:14px;font-weight:700;}
.h-sub{color:#a8d8b8;font-size:11px;margin-top:2px;}
.status-dot{width:10px;height:10px;border-radius:50%;background:#4caf50;flex-shrink:0;}
.btn-logout{color:#fff;font-size:12px;text-decoration:none;padding:6px 10px;border:1px solid rgba(255,255,255,.4);border-radius:8px;}

.tab-bar{display:flex;background:#fff;border-bottom:3px solid #e0e8e4;}
.tab{flex:1;padding:12px 8px;text-align:center;font-size:13px;font-weight:600;color:#666;}
.tab-on{color:#0d5c3a;border-bottom:3px solid #0d5c3a;margin-bottom:-3px;padding-bottom:9px;background:#f0f9f4;}
.tab-link{text-decoration:none;color:#666;border-bottom:3px solid transparent;margin-bottom:-3px;padding-bottom:9px;}
.tab-link:hover{color:#0d5c3a;}

.gps-banner{background:#fff3cd;border-bottom:2px solid #f0a500;padding:10px 14px;font-size:13px;color:#7a4f00;line-height:1.5;}

.main{flex:1;padding:13px 11px;overflow-y:auto;}
.footer{text-align:center;padding:9px;font-size:10px;color:#aaa;background:#fff;border-top:1px solid #eee;}

.card{background:#fff;border-radius:14px;padding:17px 13px;margin-bottom:13px;box-shadow:0 2px 10px rgba(0,0,0,.07);border:1px solid #e8f0ec;}
.card-center{text-align:center;padding-top:32px;}
.card-title{font-size:15px;font-weight:700;color:#1a3a2a;margin-bottom:3px;}
.card-sub{font-size:12px;color:#888;margin-bottom:13px;}
.emoji-big{font-size:52px;margin-bottom:8px;}
.emoji-huge{font-size:64px;}
.hint{margin-top:16px;font-size:13px;}

.fld{margin-bottom:14px;}
.lbl{display:block;font-size:13px;font-weight:600;color:#3a5a4a;margin-bottom:4px;}
.inp{width:100%;padding:10px 12px;border-radius:8px;border:1.5px solid #d0ddd6;font-size:14px;color:#222;background:#fcfffe;}
.err{color:#e74c3c;font-size:12px;margin-top:4px;}
.stack{display:flex;flex-direction:column;gap:12px;margin-top:16px;}

.rel{position:relative;}
.dropdown{position:absolute;top:100%;left:0;right:0;background:#fff;border:1.5px solid #c0d4c8;border-radius:8px;z-index:100;box-shadow:0 4px 16px rgba(0,0,0,.12);max-height:230px;overflow-y:auto;}
.dd-item{display:flex;align-items:center;gap:8px;padding:9px 12px;cursor:pointer;border-bottom:1px solid #f0f5f2;font-size:13px;}
.dd-badge{background:#0d5c3a;color:#fff;border-radius:5px;padding:1px 7px;font-size:11px;font-weight:700;flex-shrink:0;}
.dd-name{flex:1;}
.dd-tehsil{font-size:11px;color:#888;}

.tehsil-chip{margin-top:6px;display:inline-block;background:#e8f0ec;color:#3a6a4a;border-radius:6px;padding:3px 10px;font-size:12px;font-weight:600;}

.office-info{background:#f0f4f8;border:1px solid #d0dde8;border-radius:8px;padding:8px 12px;font-size:12px;color:#3a4a6a;margin-bottom:8px;}

.action-btn{width:100%;padding:12px;border-radius:8px;border:1.5px dashed #0d5c3a;background:#f0faf4;color:#0d5c3a;font-size:14px;font-weight:600;cursor:pointer;display:flex;align-items:center;justify-content:center;margin-top:8px;}
.action-ok{border-style:solid;background:#e8f8ef;border-color:#27ae60;color:#1a7a3a;}
.action-err{border-style:solid;background:#fff0f0;border-color:#e74c3c;color:#c0392b;}
.action-warn{border-style:solid;background:#fffbf0;border-color:#e67e22;color:#9a5f0a;}
.action-busy{border-style:dashed;background:#fffbf0;border-color:#f39c12;color:#e67e22;}
.photo-label{cursor:pointer;margin-top:0;}
.photo-wrap{margin-top:10px;}
.photo-img{width:100%;max-height:200px;object-fit:cover;border-radius:10px;border:2px solid #27ae60;}
.retake-btn{margin-top:6px;padding:5px 14px;border-radius:7px;background:#fff;border:1px solid #ccc;color:#666;font-size:12px;cursor:pointer;}

.geo-box{border-radius:10px;padding:12px 14px;margin-top:8px;font-size:13px;line-height:1.6;border:1.5px solid;}
.geo-warn{border-color:#f39c12;background:#fffbf0;}
.geo-ok{border-color:#27ae60;background:#f0faf4;}
.geo-bad{border-color:#e74c3c;background:#fff8f8;}
.geo-title{font-weight:700;margin-bottom:4px;}
.geo-detail{font-size:12px;color:#444;}

.submit-btn{width:100%;padding:13px;border-radius:10px;background:linear-gradient(135deg,#0d5c3a,#1a7a4a);color:#fff;font-size:15px;font-weight:700;border:none;cursor:pointer;box-shadow:0 4px 14px rgba(13,92,58,.3);margin-top:4px;}
.submit-btn:disabled{opacity:.7;cursor:not-allowed;}
.btn-secondary{padding:10px 16px;border-radius:8px;border:1.5px solid #0d5c3a;background:#fff;color:#0d5c3a;font-weight:600;cursor:pointer;font-size:13px;}
.btn-clear-filters{display:inline-block;padding:10px 16px;border-radius:8px;border:1.5px solid #cfd8dc;background:#fff;color:#546e7a;font-weight:600;font-size:13px;font-family:inherit;cursor:pointer;}
.btn-clear-filters:hover{background:#f5f7f8;}
.btn-export{display:inline-block;padding:10px 14px;border-radius:8px;background:linear-gradient(135deg,#1a5276,#2980b9);color:#fff;font-size:13px;font-weight:700;text-decoration:none;border:none;cursor:pointer;font:inherit;}
.filter-grid{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:8px;}
.filter-grid .fld{flex:1;min-width:105px;margin-bottom:0;}
/* Full-width row so buttons are not squeezed beside the "To" field; one line on mobile. */
.filter-grid .fld-actions{flex:1 1 100%;width:100%;min-width:0;margin-top:2px;display:flex;flex-direction:row;flex-wrap:nowrap;align-items:stretch;gap:6px;}
.filter-grid .fld-actions .btn-secondary,
.filter-grid .fld-actions .btn-clear-filters,
.filter-grid .fld-actions .btn-export{flex:1 1 0;min-width:0;padding:8px 6px;font-size:11px;line-height:1.25;border-radius:7px;white-space:nowrap;}
.fld-actions{display:flex;align-items:flex-end;gap:8px;flex-wrap:wrap;}

/* [hidden] must win over .success-box flex, or both panels stay visible on every load */
.success-box[hidden]{display:none!important;}
.success-box{text-align:center;padding:60px 20px;display:flex;flex-direction:column;align-items:center;gap:12px;}
.suc-title{font-size:22px;font-weight:700;color:#1a7a3a;}
.err-title{color:#c0392b;}
.suc-sub{font-size:14px;color:#666;max-width:280px;text-align:center;}

.stats-row{display:flex;gap:7px;margin-bottom:12px;}
.stat-card{flex:1;background:#fff;border-radius:11px;padding:9px 4px;text-align:center;box-shadow:0 2px 8px rgba(0,0,0,.06);border:1px solid #e8f0ec;}
.stat-ic{font-size:18px;display:block;}
.stat-n{font-size:20px;font-weight:800;color:#0d5c3a;display:block;}
.stat-l{font-size:10px;color:#888;}


.rec-list{display:flex;flex-direction:column;gap:9px;}
.rec-card{border:1.5px solid #e0ede7;border-radius:10px;padding:11px 12px;background:#fcfffe;}
.rec-top{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:6px;flex-wrap:wrap;gap:4px;}
.rec-head{display:flex;align-items:center;gap:6px;flex-wrap:wrap;}
.uc-badge{background:#0d5c3a;color:#fff;border-radius:6px;padding:2px 8px;font-size:11px;font-weight:700;}
.rec-name{font-size:13px;font-weight:600;color:#1a3a2a;}
.t-badge{background:#e8f0ec;color:#3a6a4a;border-radius:5px;padding:1px 7px;font-size:11px;}
.rec-time{font-size:11px;color:#888;cursor:help;text-decoration:underline dotted;text-underline-offset:2px;}
.rec-body{display:flex;align-items:center;gap:10px;font-size:13px;color:#444;flex-wrap:wrap;}
.dist{font-size:11px;color:#27ae60;font-weight:600;}
.link{font-weight:600;font-size:12px;text-decoration:none;color:#2980b9;}

.empty{text-align:center;padding:28px 0;color:#aaa;font-size:14px;}

.rec-range{font-size:11px;color:#888;font-weight:600;}
.pager{display:flex;align-items:center;justify-content:center;gap:12px;margin-top:14px;padding-top:12px;border-top:1px solid #e8f0ec;flex-wrap:wrap;}
.pager-btn{display:inline-block;padding:8px 14px;border-radius:8px;border:1.5px solid #0d5c3a;background:#fff;color:#0d5c3a;font-size:13px;font-weight:600;text-decoration:none;cursor:pointer;}
a.pager-btn:hover{background:#f0faf4;}
.pager-btn.pager-disabled{opacity:.45;cursor:default;border-color:#c8d4ce;color:#888;background:#f5f7f6;}
.pager-info{font-size:13px;font-weight:700;color:#3a5a4a;}

@keyframes pulse{0%,100%{opacity:1}50%{opacity:.5}}
.pulsing{animation:pulse 1.4s infinite;}
