/* styles.css - ParkPatrol Ultimate (GitHub Pages friendly) */
:root{
  --bg:#0b0f1a;
  --panel:#10172a;
  --panel2:#0f1526;
  --card:#111a30;
  --text:#e9eefc;
  --muted:#a9b2d4;
  --line:rgba(233,238,252,.10);
  --accent:#23d18b;
  --danger:#ff4d6d;
  --warn:#ffcc66;
  --shadow: 0 10px 40px rgba(0,0,0,.35);
  --radius: 18px;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color:var(--text);
  background:
    radial-gradient(1200px 700px at 20% -10%, rgba(35,209,139,.18), transparent 60%),
    radial-gradient(1000px 700px at 95% 5%, rgba(95,140,255,.18), transparent 60%),
    radial-gradient(900px 500px at 50% 105%, rgba(255,77,109,.10), transparent 60%),
    var(--bg);
}
a{color:inherit}
#app{min-height:100%; padding: 18px 16px 96px; max-width: 980px; margin: 0 auto;}
.topbar{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; margin: 6px 0 16px;
  flex-wrap:wrap;
}
.brand{
  display:flex; align-items:center; gap:10px;
  min-width:0;
  flex:1;
}
.brand .logo{
  width:38px; height:38px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(35,209,139,.18), rgba(95,140,255,.18));
  border:1px solid var(--line);
  box-shadow: var(--shadow);
  display:flex; align-items:center; justify-content:center;
  font-weight: 800;
  user-select: none;
  -webkit-user-select: none;
}
.brand h1{font-size:18px; margin:0}
.chip{
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 10px; border-radius: 999px;
  border:1px solid var(--line);
  background: rgba(16,23,42,.55);
  color: var(--muted);
  font-size: 12px;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.chip-highlight{
  color: var(--text);
}
.btn{
  appearance:none; border:0; cursor:pointer;
  color:var(--text);
  background: rgba(255,255,255,.08);
  border:1px solid var(--line);
  padding: 12px 14px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.btn:hover{filter:brightness(1.05)}
.btn:disabled{opacity:.55; cursor:not-allowed}
.btn.primary{
  background: linear-gradient(135deg, rgba(35,209,139,.95), rgba(20,160,120,.95));
  border-color: rgba(35,209,139,.35);
  color:#07110d;
  font-weight: 800;
}
.btn.ghost{background: transparent}
.btn.danger{
  background: rgba(255,77,109,.12);
  border-color: rgba(255,77,109,.35);
}
.btn.success{
  background: rgba(35,209,139,.12);
  border-color: rgba(35,209,139,.35);
  color: var(--accent);
  font-weight: 600;
}
.btn.large{
  padding: 18px 24px;
  font-size: 18px;
  font-weight: 700;
}
.grid{
  display:grid; gap:14px;
}
@media (min-width: 880px){
  .grid.cols-2{grid-template-columns: 1fr 1fr}
  .grid.cols-3{grid-template-columns: 1fr 1fr 1fr}
}
.card{
  background: rgba(17,26,48,.62);
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  backdrop-filter: blur(10px);
}
.card h2{margin:0 0 10px; font-size: 16px}
.card p{margin:0; color: var(--muted); line-height:1.45}
.kpis{
  display:flex; gap:10px; flex-wrap:wrap;
}
.kpi{
  flex: 1 1 160px;
  padding: 12px;
  border-radius: 16px;
  border:1px solid var(--line);
  background: rgba(16,23,42,.55);
}
.kpi.clickable{
  cursor: pointer;
  transition: transform 0.1s ease, background 0.2s ease;
}
.kpi.clickable:hover{
  background: rgba(16,23,42,.75);
  transform: translateY(-2px);
}
.kpi.clickable:active{
  transform: translateY(0);
}
.kpi .num{font-size:22px; font-weight:900}
.kpi .lbl{color:var(--muted); font-size:12px}
.input{
  width:100%;
  padding: 12px 12px;
  border-radius: 14px;
  border:1px solid var(--line);
  background: rgba(15,21,38,.70);
  color: var(--text);
  outline: none;
}
.input::placeholder{color: rgba(169,178,212,.75)}
.label{font-size: 12px; color: var(--muted); margin: 12px 0 6px;}
.row{display:flex; gap:10px; align-items:center;flex-wrap:wrap}
.row > * {flex:1}
hr.sep{border:0; border-top:1px solid var(--line); margin: 14px 0}
.notice{
  padding: 12px; border-radius: 14px;
  border:1px solid var(--line);
  background: rgba(16,23,42,.55);
  color: var(--muted);
}
.notice.ok{border-color: rgba(35,209,139,.40); background: rgba(35,209,139,.10)}
.notice.err{border-color: rgba(255,77,109,.40); background: rgba(255,77,109,.10); color: #ffd7df}
.navbar{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 12px;
  width: min(980px, calc(100% - 24px));
  padding: 10px;
  border-radius: 22px;
  background: rgba(11,15,26,.65);
  border:1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  display:flex;
  gap: 10px;
  justify-content: flex-start;
  z-index: 50;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}
.navbar::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Edge */
}
.tab{
  flex: 0 0 auto;
  min-width: 110px; /* Ensure tabs don't shrink below this width for readability */
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  padding: 12px 10px;
  border-radius: 18px;
  border:1px solid transparent;
  color: var(--muted);
  cursor:pointer;
  user-select:none;
}
.tab.active{
  background: rgba(255,255,255,.08);
  border-color: var(--line);
  color: var(--text);
}
.badge{
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.list{
  display:flex; flex-direction:column; gap:10px;
}
.item{
  display:flex; align-items:flex-start; justify-content:space-between;
  gap:10px;
  padding: 12px;
  border-radius: 16px;
  border:1px solid var(--line);
  background: rgba(16,23,42,.52);
}
.item.clickable{
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.item .meta{color: var(--muted); font-size: 12px; margin-top: 4px}
.pill{
  display:inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.06);
  font-size: 12px;
  color: var(--muted);
}
.footerSpace{height: 90px;}

/* Modal Dialog */
.modal-overlay{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11,15,26,.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}
.modal-content{
  background: rgba(17,26,48,.98);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  padding: 24px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease-out;
}
.modal-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-header h2{
  margin: 0;
  font-size: 20px;
}
.modal-close{
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover{
  color: var(--text);
}
@keyframes fadeIn{
  from{opacity: 0}
  to{opacity: 1}
}
@keyframes slideUp{
  from{transform: translateY(20px); opacity: 0}
  to{transform: translateY(0); opacity: 1}
}

/* Collapsible details */
.collapsible-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  user-select: none;
  -webkit-user-select: none;
}
.collapsible-summary h2 {
  margin: 0;
}
.collapsible-summary::-webkit-details-marker {
  display: none;
}
.collapsible-summary:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 8px;
}
.collapse-arrow {
  display: inline-block;
  color: var(--muted);
  font-size: 18px;
  transition: transform 0.2s ease;
}
details[open] .collapse-arrow {
  transform: rotate(180deg);
}

/* Button utilities */
.btn-full-width {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.btn-icon-large {
  font-size: 24px;
}
