:root{
  --bg:#f5f7fb;
  --surface:#ffffff;
  --surface-2:#f8fafc;
  --text:#0f172a;
  --muted:#64748b;
  --line:#e5e7eb;
  --primary:#1d4ed8;
  --primary-2:#2563eb;
  --green:#22c55e;
  --orange:#f59e0b;
  --purple:#7c3aed;
  --shadow:0 8px 24px rgba(15,23,42,.06);
  --radius:18px;
}
[data-theme="dark"]{
  --bg:#0b1220;
  --surface:#111827;
  --surface-2:#0f172a;
  --text:#f8fafc;
  --muted:#94a3b8;
  --line:#1f2937;
  --primary:#2563eb;
  --primary-2:#3b82f6;
  --green:#22c55e;
  --orange:#f59e0b;
  --purple:#8b5cf6;
  --shadow:0 8px 24px rgba(0,0,0,.35);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;font-family:Arial,Helvetica,sans-serif;background:var(--bg);color:var(--text)}
body{min-height:100vh}
a{text-decoration:none;color:inherit}
button,input,textarea,select{font:inherit}
button{cursor:pointer}
img{max-width:100%;display:block}
.hide{display:none!important}

.mobile-shell{
  width:100%;
  max-width:430px;
  min-height:100vh;
  margin:0 auto;
  background:var(--bg);
  position:relative;
  padding-bottom:calc(96px + env(safe-area-inset-bottom));
}
.topbar{
  height:calc(88px + env(safe-area-inset-top));
  padding:calc(18px + env(safe-area-inset-top)) 18px 14px;
  display:flex;align-items:center;justify-content:space-between;
  background:var(--surface);border-bottom:1px solid var(--line);
  position:sticky;top:0;z-index:30;
}
.icon-btn{
  width:42px;height:42px;border-radius:12px;border:1px solid var(--line);
  background:var(--surface);display:flex;align-items:center;justify-content:center;
  color:var(--text)
}
.brand{display:flex;align-items:center;gap:10px;font-weight:800;font-size:18px;letter-spacing:.2px}
.brand-logo{width:42px;height:42px;border-radius:12px;object-fit:contain;background:#fff;padding:4px}
.notification{position:relative}
.badge{position:absolute;top:-3px;right:-1px;background:#ef4444;color:#fff;border-radius:999px;font-size:11px;line-height:1;padding:5px 6px;min-width:20px;text-align:center}
.screen{padding:20px 16px}
.row-inline{display:flex;align-items:center;justify-content:space-between;gap:12px}
.greeting h1{margin:0 0 6px;font-size:22px;font-weight:800}
.greeting p{margin:0;color:var(--muted);font-size:14px}
.online-chip{
  background:rgba(34,197,94,.12);color:#16a34a;padding:10px 16px;border-radius:999px;
  font-weight:700;display:inline-flex;gap:8px;align-items:center;white-space:nowrap
}
.dot{width:10px;height:10px;border-radius:999px;background:#22c55e;display:inline-block}
.summary-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:18px}
.summary-card{background:var(--surface);border:1px solid var(--line);border-radius:20px;padding:16px;box-shadow:var(--shadow)}
.summary-head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
.summary-icon{width:58px;height:58px;border-radius:18px;display:flex;align-items:center;justify-content:center;color:#fff;font-size:26px;font-weight:800;flex:0 0 auto}
.icon-blue{background:linear-gradient(135deg,#2563eb,#3b82f6)}
.icon-green{background:linear-gradient(135deg,#22c55e,#4ade80)}
.icon-orange{background:linear-gradient(135deg,#f59e0b,#fb923c)}
.icon-purple{background:linear-gradient(135deg,#7c3aed,#8b5cf6)}
.summary-title{font-size:14px;color:var(--text);font-weight:700;margin-top:4px}
.summary-number{font-size:22px;font-weight:800;margin-top:8px}
.chev{color:var(--muted);font-size:24px;line-height:1}
.section-header{display:flex;align-items:center;justify-content:space-between;margin:24px 0 14px}
.section-header h2{font-size:18px;margin:0;font-weight:800}
.link-primary{color:var(--primary-2);font-weight:700}
.os-list{background:var(--surface);border:1px solid var(--line);border-radius:22px;overflow:hidden;box-shadow:var(--shadow)}
.os-row{padding:18px 16px;display:grid;grid-template-columns:1fr auto;gap:14px;border-bottom:1px solid var(--line)}
.os-row:last-child{border-bottom:0}
.os-number{font-size:17px;font-weight:800;margin-bottom:6px}
.os-client{font-size:14px;font-weight:700;margin-bottom:8px}
.os-address{font-size:13px;line-height:1.45;color:var(--muted);display:flex;gap:8px;white-space:pre-line}
.os-side{display:flex;flex-direction:column;justify-content:space-between;align-items:flex-end;gap:10px}
.os-tags{display:flex;flex-direction:column;gap:10px;align-items:flex-start}
.tag{display:inline-flex;align-items:center;padding:8px 12px;border-radius:10px;font-size:12px;font-weight:700}
.tag-blue{background:#dbeafe;color:#2563eb}
.tag-green{background:#dcfce7;color:#16a34a}
.tag-orange{background:#ffedd5;color:#ea580c}
.tag-gray{background:#e5e7eb;color:#475569}
.btn-primary{
  background:linear-gradient(135deg,var(--primary),var(--primary-2));
  color:#fff;border:0;border-radius:12px;padding:12px 22px;font-weight:800;min-width:110px
}
.btn-secondary{background:var(--surface);color:var(--text);border:1px solid var(--line);border-radius:12px;padding:11px 16px;font-weight:700}
.btn-danger{background:#fff;color:#dc2626;border:1px solid rgba(220,38,38,.25);border-radius:12px;padding:11px 16px;font-weight:700}
.stats-footer{margin-top:18px;background:var(--surface);border:1px solid var(--line);border-radius:22px;box-shadow:var(--shadow);display:grid;grid-template-columns:repeat(4,1fr);overflow:hidden}
.stat-item{padding:18px 10px;text-align:center;border-right:1px solid var(--line)}
.stat-item:last-child{border-right:0}
.stat-icon{font-size:24px;margin-bottom:8px}
.stat-label{font-size:12px;color:var(--muted);margin-bottom:6px}
.stat-value{font-size:13px;font-weight:800}
.bottom-nav{
  position:fixed;left:50%;transform:translateX(-50%);bottom:0;width:100%;max-width:430px;background:var(--surface);
  border-top:1px solid var(--line);display:grid;grid-template-columns:repeat(5,1fr);
  padding:10px 6px calc(16px + env(safe-area-inset-bottom));z-index:40
}
.nav-item{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;font-size:12px;color:var(--muted);font-weight:600;padding:6px 4px;border-radius:14px}
.nav-item.active{color:var(--primary-2)}
.nav-icon{font-size:24px}
.drawer{position:fixed;inset:0;z-index:60;display:none}
.drawer.open{display:block}
.drawer-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.45)}
.drawer-panel{
  position:absolute;left:0;top:0;bottom:0;width:82%;max-width:320px;background:var(--surface);
  border-right:1px solid var(--line);padding:18px 16px 20px;display:flex;flex-direction:column;gap:18px
}
.drawer-brand{display:flex;align-items:center;gap:12px}
.drawer-brand .brand-logo{width:48px;height:48px}
.drawer-menu{display:flex;flex-direction:column;gap:10px}
.drawer-link{display:flex;align-items:center;gap:12px;padding:14px 14px;border-radius:16px;font-weight:700;color:var(--text);background:transparent;border:1px solid transparent}
.drawer-link.active,.drawer-link:hover{background:var(--surface-2);border-color:var(--line)}
.drawer-footer{margin-top:auto}
.login-page{
  min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px 16px;
  background:linear-gradient(180deg,var(--bg),var(--surface-2))
}
.login-card{width:100%;max-width:420px;background:var(--surface);border:1px solid var(--line);box-shadow:var(--shadow);border-radius:26px;padding:28px 22px}
.login-brand{display:flex;flex-direction:column;align-items:center;gap:12px;margin-bottom:20px}
.login-brand .brand-logo{width:72px;height:72px;border-radius:20px}
.login-brand h1{margin:0;font-size:30px}
.login-brand p{margin:0;color:var(--muted);text-align:center}
.input-wrap{margin-bottom:14px}
.input-label{display:block;margin-bottom:8px;font-size:14px;font-weight:700}
.input{width:100%;padding:14px 14px;border:1px solid var(--line);border-radius:14px;background:var(--surface-2);color:var(--text)}
.login-actions{display:flex;justify-content:space-between;align-items:center;margin:10px 0 18px;font-size:13px;color:var(--muted)}
.login-note{margin-top:14px;font-size:12px;color:var(--muted);text-align:center}
.error-msg{background:#fef2f2;border:1px solid #fecaca;color:#b91c1c;padding:12px;border-radius:12px;margin-bottom:16px}
.form-card{background:var(--surface);border:1px solid var(--line);border-radius:22px;padding:18px;box-shadow:var(--shadow);margin-bottom:16px}
.form-card h3{margin:0 0 14px;font-size:17px}
.toggle-group{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.toggle-btn{display:flex;align-items:center;justify-content:center;gap:8px;padding:14px 12px;border-radius:14px;border:1px solid var(--line);background:var(--surface-2);font-weight:800}
.toggle-btn.active{background:rgba(37,99,235,.12);color:var(--primary-2);border-color:rgba(37,99,235,.25)}
.preview-logo{
  width:100%;height:92px;border:1px dashed var(--line);border-radius:16px;background:var(--surface-2);
  display:flex;align-items:center;justify-content:center;overflow:hidden;margin-top:10px
}
.preview-logo img{width:auto;height:64px;object-fit:contain}
.helper{font-size:12px;color:var(--muted);line-height:1.45}
.version-box{display:flex;justify-content:space-between;align-items:center;font-size:14px}
.status-card{padding:14px;border-radius:16px;background:var(--surface-2);border:1px solid var(--line)}
.report-box{background:var(--surface);border:1px solid var(--line);border-radius:22px;padding:20px;box-shadow:var(--shadow)}
.report-logo{height:56px;object-fit:contain;margin:0 auto 12px}
.report-title{text-align:center;margin:0 0 16px;font-size:24px;font-weight:800}
.report-item{margin-bottom:10px}
.report-label{font-size:12px;color:var(--muted);margin-bottom:4px}
.fotos-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.fotos-grid img{width:100%;border-radius:14px;border:1px solid var(--line)}
@media (max-width:380px){
  .summary-grid{grid-template-columns:1fr}
  .row-inline{flex-direction:column;align-items:flex-start}
  .stats-footer{grid-template-columns:1fr 1fr}
}
@media print{
  body{background:#fff}
  .no-print{display:none!important}
  .mobile-shell{max-width:none;padding-bottom:0}
  .report-box{box-shadow:none;border:0}
}
@media (min-width: 431px){
  body{background:#e2e8f0}
}
