/* ── ParkingSpot Supervisor — app.css ── */
:root {
    --primary:      #1b4842;
    --accent:       #2aa88c;
    --header-bg:    #f8cda6;
    --header-text:  #6b4423;
    --brand-red:    #e8533f;
    --success:      #22c55e;
    --danger:       #e74c3c;
    --bg:           #f1f5f4;
    --surface:      #ffffff;
    --border:       #e2e8e6;
    --text:         #0f1f1d;
    --text-muted:   #647571;
    --radius:       10px;
    --shadow:       0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-lg:    0 4px 24px rgba(0,0,0,.10);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, sans-serif; font-size: 14px; color: var(--text); background: var(--bg); line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar { width: 230px; min-width: 230px; background: var(--primary); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar-brand { padding: 20px 16px 16px; border-bottom: 1px solid rgba(255,255,255,.1); border-left: 3px solid var(--brand-red); }
.brand-name { font-size: 15px; font-weight: 800; color: #fff; letter-spacing: .4px; text-transform: uppercase; }
.brand-tagline { font-size: 10px; color: var(--brand-red); font-style: italic; font-weight: 600; margin-top: 1px; }
.brand-sub { font-size: 11px; color: rgba(255,255,255,.5); margin-top: 5px; }
.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 10px 16px; color: rgba(255,255,255,.7); font-size: 13px; font-weight: 500; transition: background .15s, color .15s; }
.nav-item .icon { width: 18px; text-align: center; }
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.nav-item.active { background: var(--header-bg); color: var(--header-text); font-weight: 600; }
.sidebar-footer { padding: 12px 16px; font-size: 11px; color: rgba(255,255,255,.3); border-top: 1px solid rgba(255,255,255,.08); }
.role-badge { display: inline-block; margin-top: 8px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; padding: 2px 8px; border-radius: 100px; background: rgba(255,255,255,.15); color: #fff; }

.admin-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.admin-topbar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 24px; height: 56px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; }
.admin-topbar h1 { font-size: 16px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.admin-main { flex: 1; padding: 24px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 13px 18px; background: var(--header-bg); border-bottom: 1px solid rgba(0,0,0,.05); }
.card-header h2 { font-size: 14px; font-weight: 700; color: var(--header-text); }
.card-body { padding: 18px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat-value { font-size: 28px; font-weight: 700; color: var(--primary); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.btn { display: inline-flex; align-items: center; gap: 5px; padding: 7px 14px; border-radius: 7px; font-size: 13px; font-weight: 500; cursor: pointer; border: 1px solid transparent; transition: opacity .15s, background .15s; text-decoration: none; }
.btn:hover { opacity: .88; text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-accent  { background: var(--accent);  color: #fff; }
.btn-danger  { background: var(--danger);  color: #fff; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 11px 22px; font-size: 15px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .04em; }
.form-control { width: 100%; padding: 8px 11px; border: 1px solid var(--border); border-radius: 7px; font-size: 13px; background: var(--surface); color: var(--text); }
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(42,168,140,.12); }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.mono { font-family: 'Courier New', monospace; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { background: #1e293b; color: #e2e8f0; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 9px 12px; text-align: left; white-space: nowrap; }
tbody tr { border-bottom: 1px solid var(--border); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }
tbody td { padding: 9px 12px; vertical-align: middle; }

.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 100px; font-size: 11px; font-weight: 600; }
.badge-active   { background: #dcfce7; color: #15803d; }
.badge-inactive { background: #f1f5f9; color: #64748b; }
.badge-blue     { background: #dbeafe; color: #1d4ed8; }

.flash { padding: 11px 16px; border-radius: 8px; font-size: 13px; font-weight: 500; margin-bottom: 16px; }
.flash-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.flash-error   { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }

.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-icon { font-size: 36px; margin-bottom: 12px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 768px) { .grid-2 { grid-template-columns: 1fr; } .admin-sidebar { display: none; } }

/* Login */
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 20px; }
.login-card { background: var(--surface); border-radius: 14px; padding: 36px 32px; width: 100%; max-width: 380px; box-shadow: var(--shadow-lg); }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .logo-icon { font-size: 36px; display: block; margin-bottom: 8px; }
.login-logo h1 { font-size: 19px; font-weight: 700; color: var(--primary); }
.login-logo p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* Lang dropdown */
.lang-dd { position: relative; display: inline-block; }
.lang-dd summary { list-style: none; }
.lang-dd summary::-webkit-details-marker { display: none; }
.lang-dd summary svg { transition: transform .2s; opacity: .6; }
.lang-dd[open] summary svg { transform: rotate(180deg); }
.lang-dd-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 160px; z-index: 100; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; box-shadow: var(--shadow-lg); overflow: hidden; padding: 4px; }
.lang-dd-menu button { display: block; width: 100%; text-align: left; padding: 8px 12px; border: none; background: none; font-size: 13px; cursor: pointer; border-radius: 6px; color: var(--text); }
.lang-dd-menu button:hover { background: var(--bg); }
.lang-dd-menu button.active { background: var(--primary); color: #fff; font-weight: 600; }

/* Installation cards */
.install-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; background: var(--surface); }
.install-info { min-width: 0; }
.install-name { font-weight: 700; font-size: 14px; }
.install-url { font-size: 12px; color: var(--accent); word-break: break-all; }
.install-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.install-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* Toolbar + tegel-raster */
.hidden { display: none !important; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.tile { display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s; }
.tile:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.tile .tile-head { padding: 14px 16px 10px; border-bottom: 1px solid var(--border); }
.tile .tile-title { font-size: 15px; font-weight: 700; color: var(--primary); }
.tile .tile-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.tile .tile-body { padding: 8px 16px 12px; flex: 1; }
.tile .tile-foot { padding: 10px 16px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ep-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 0; border-top: 1px dashed var(--border); }
.ep-line:first-child { border-top: none; }
.ep-line .ep-name { font-size: 13px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-line .ep-open { font-size: 12px; color: var(--accent); white-space: nowrap; }
.ep-empty { font-size: 12px; color: var(--text-muted); padding: 6px 0; }
.tile-count { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-muted); }
