:root{--bg:#f5f7fb;--panel:#fff;--text:#1f2937;--muted:#6b7280;--primary:#2563eb;--danger:#dc2626;--success:#16a34a;--border:#e5e7eb;--shadow:0 10px 25px rgba(15,23,42,.08)}*{box-sizing:border-box}body{margin:0;font-family:Arial,Helvetica,sans-serif;color:var(--text);background:var(--bg)}a{color:var(--primary);text-decoration:none}.topbar{display:flex;align-items:center;gap:18px;padding:14px 22px;background:#111827;color:#fff;flex-wrap:wrap}.brand a{color:#fff;font-weight:800;font-size:20px}.nav{display:flex;gap:12px;flex-wrap:wrap}.nav a{color:#dbeafe;font-weight:600}.userbox{margin-left:auto}.userbox span{color:#bfdbfe}.container{width:min(1180px,calc(100% - 28px));margin:28px auto}.footer{text-align:center;color:var(--muted);padding:24px}.card{background:var(--panel);border:1px solid var(--border);border-radius:14px;padding:20px;box-shadow:var(--shadow);margin-bottom:18px}.grid{display:grid;gap:18px}.grid-3{grid-template-columns:repeat(3,1fr)}.grid-2{grid-template-columns:repeat(2,1fr)}.stat{font-size:34px;font-weight:800;color:var(--primary)}.label,.help{color:var(--muted);font-size:13px}.table-wrap{overflow-x:auto;background:#fff;border-radius:14px;box-shadow:var(--shadow);border:1px solid var(--border)}table{width:100%;border-collapse:collapse}th,td{padding:12px 14px;border-bottom:1px solid var(--border);text-align:left;vertical-align:top}th{background:#f9fafb;font-size:13px;text-transform:uppercase}.actions{display:flex;gap:8px;flex-wrap:wrap}.btn,button{display:inline-block;border:none;background:var(--primary);color:#fff;padding:9px 12px;border-radius:9px;font-weight:700;cursor:pointer}.btn-secondary{background:#4b5563}.btn-danger,button.btn-danger{background:var(--danger)}.btn-success{background:var(--success)}form.inline{display:inline}.form-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}.form-row{margin-bottom:14px}label{display:block;font-weight:700;margin-bottom:6px}input,select,textarea{width:100%;padding:10px 11px;border:1px solid #d1d5db;border-radius:9px;font-size:15px;background:#fff}textarea{min-height:95px}.alert{padding:12px 14px;border-radius:10px;margin-bottom:16px}.alert-success{background:#dcfce7;color:#14532d}.alert-danger{background:#fee2e2;color:#7f1d1d}.badge{display:inline-block;padding:5px 9px;border-radius:999px;font-size:12px;font-weight:800}.badge-success{background:#dcfce7;color:#166534}.badge-danger{background:#fee2e2;color:#991b1b}.badge-muted{background:#e5e7eb;color:#374151}.badge-warning{background:#fef3c7;color:#92400e}.searchbar{display:flex;gap:10px;margin-bottom:16px;align-items:end}.detail-list{display:grid;grid-template-columns:220px 1fr;gap:10px 16px}.detail-list dd{margin:0}.photo-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:14px}.photo-card{border:1px solid var(--border);border-radius:12px;padding:10px;background:#fafafa}.photo-card img{display:block;width:100%;height:150px;object-fit:cover;border-radius:10px}.empty-photo{height:150px;border-radius:10px;background:#e5e7eb;color:#6b7280;display:flex;align-items:center;justify-content:center}.login-page{min-height:100vh;display:grid;place-items:center;padding:20px}.login-card{width:min(430px,100%)}.pagination{margin-top:16px;display:flex;gap:8px;flex-wrap:wrap}.pagination a,.pagination span{padding:8px 11px;border:1px solid var(--border);border-radius:8px;background:#fff}.pagination .active{background:var(--primary);color:#fff}@media(max-width:760px){.grid-3,.grid-2,.form-grid{grid-template-columns:1fr}.userbox{margin-left:0;width:100%}.detail-list{grid-template-columns:1fr}.searchbar{flex-direction:column;align-items:stretch}}
.thumb{width:70px;height:70px;object-fit:cover;border-radius:10px;background:#e5e7eb;display:block}.photo-large{display:block;width:100%;height:150px;object-fit:cover;border-radius:10px;background:#e5e7eb}.missing-photo{width:160px;min-height:70px;border:1px dashed #dc2626;border-radius:10px;background:#fee2e2;color:#7f1d1d;padding:8px;display:flex;flex-direction:column;gap:4px;justify-content:center;font-size:12px}.photo-card .missing-photo{width:100%;min-height:150px;text-align:center;align-items:center}.missing-photo small{display:block;word-break:break-all}.dashboard-search{align-items:end}.dashboard-search>div{min-width:180px;flex:1}.table-wrap th a{color:#111827;font-weight:800}
.btn-map{background:#059669}.btn-map:hover{background:#047857}.map-card{overflow:hidden}.map-meta{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:12px;color:#374151}.map-frame{width:100%;height:380px;border:0;border-radius:12px;background:#e5e7eb}.table-wrap td .btn-map{padding:7px 10px;font-size:13px}
.login-logo-wrap{display:flex;justify-content:center;align-items:center;margin-bottom:14px}.login-logo{max-width:150px;max-height:150px;width:auto;height:auto;object-fit:contain}.header-logo{width:58px;height:58px;object-fit:contain;border-radius:50%;margin-left:8px;background:#fff;padding:4px;box-shadow:0 4px 12px rgba(0,0,0,.18)}@media(max-width:760px){.header-logo{margin-left:0;width:48px;height:48px}.login-logo{max-width:125px;max-height:125px}}


/* Thumbnail styles */
.thumb {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 10px;
  background: #e5e7eb;
  display: block;
}

.photo-large {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 10px;
  background: #e5e7eb;
}

.missing-photo {
  width: 160px;
  min-height: 70px;
  border: 1px dashed #dc2626;
  border-radius: 10px;
  background: #fee2e2;
  color: #7f1d1d;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
  font-size: 12px;
}

.photo-card .missing-photo {
  width: 100%;
  min-height: 150px;
  text-align: center;
  align-items: center;
}

.missing-photo small {
  display: block;
  word-break: break-all;
}

.dashboard-search {
  align-items: end;
}

.dashboard-search > div {
  min-width: 180px;
  flex: 1;
}

/* Map button and frame */
.btn-map {
  background: #059669;
}

.btn-map:hover {
  background: #047857;
}

.map-card {
  overflow: hidden;
}

.map-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  color: #374151;
}

.map-frame {
  width: 100%;
  height: 380px;
  border: 0;
  border-radius: 12px;
  background: #e5e7eb;
}

.table-wrap td .btn-map {
  padding: 7px 10px;
  font-size: 13px;
}

/* Logo styles */
.login-logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 14px;
}

.login-logo {
  max-width: 150px;
  max-height: 150px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.header-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 50%;
  margin-left: 8px;
  background: #fff;
  padding: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

@media (max-width: 760px) {
  .header-logo {
    margin-left: 0;
    width: 48px;
    height: 48px;
  }
  .login-logo {
    max-width: 125px;
    max-height: 125px;
  }
}

/* Login page enhancements */
.login-subtitle {
  margin: 0 0 14px;
  text-align: center;
  color: #111827;
  font-weight: 800;
  font-size: 18px;
}

.login-heading {
  text-align: center;
  margin: 8px 0 8px;
  font-size: 24px;
}

.login-card h1 {
  text-align: center;
  margin: 6px 0 4px;
}

/* Chart grid layout */
.chart-grid {
  display: grid;
  gap: 18px;
  align-items: start;
}

.chart-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chart-grid-4 {
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 1600px) {
  .chart-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .chart-grid-2,
  .chart-grid-4 {
    grid-template-columns: 1fr;
  }
}

.chart-card h2 {
  margin-top: 0;
}

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) minmax(180px, 2fr) 58px;
  gap: 12px;
  align-items: center;
}

.bar-label {
  font-weight: 700;
  color: #374151;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 24px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #16a34a);
  border-radius: 999px;
  min-width: 8px;
}

.bar-value {
  font-weight: 800;
  color: #111827;
  text-align: right;
}

.text-compact {
  max-width: 260px;
  min-width: 180px;
  white-space: normal;
  word-break: break-word;
}

.table-wrap th a {
  color: #111827;
  font-weight: 800;
  white-space: nowrap;
}

@media (max-width: 920px) {
  .chart-grid-2,
  .chart-grid-4 {
    grid-template-columns: 1fr;
  }
  .bar-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .bar-value {
    text-align: left;
  }
  .bar-label {
    white-space: normal;
  }
}
