/* FireWatcher management page — the APK's dark palette. */
:root {
  --bg:      #1C2833;
  --bar:     #2C3E50;
  --card:    #22313F;
  --line:    #34495E;
  --text:    #ECF0F1;
  --muted:   #95A5A6;
  --accent:  #E67E22;
  --ok:      #1E8449;
  --warn:    #F39C12;
  --bad:     #922B21;
  --radius:  10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: "Segoe UI", Arial, "Noto Sans Hebrew", sans-serif; font-size: 15px;
  direction: rtl;
}
a { color: var(--accent); }
button, input, select, textarea { font: inherit; }
button {
  background: var(--accent); color: #fff; border: 0; border-radius: 8px;
  padding: 8px 16px; cursor: pointer;
}
button.secondary { background: var(--line); }
button.danger { background: var(--bad); }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea {
  background: #17202A; color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; width: 100%;
}
label { display: block; color: var(--muted); font-size: 13px; margin: 10px 0 4px; }
.hidden { display: none !important; }

/* login */
#login { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; width: 100%; max-width: 380px;
}
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.brand .flame { font-size: 26px; }
.brand h1 { font-size: 20px; margin: 0; }
.brand small { color: var(--muted); display: block; }
.error { color: #F5B7B1; background: rgba(146,43,33,.25); border-radius: 8px; padding: 8px 10px; margin-top: 10px; }

/* shell */
#shell { display: grid; grid-template-rows: 52px 1fr; min-height: 100%; }
header {
  background: var(--bar); display: flex; align-items: center; gap: 14px; padding: 0 16px;
}
header .who { margin-inline-start: auto; color: var(--muted); font-size: 13px; }
header .scope { background: var(--line); border-radius: 999px; padding: 2px 10px; font-size: 12px; }
nav { display: flex; gap: 4px; }
nav a {
  color: var(--text); text-decoration: none; padding: 6px 12px; border-radius: 8px; font-size: 14px;
}
nav a.active, nav a:hover { background: rgba(255,255,255,.08); }
main { padding: 16px; max-width: 1200px; width: 100%; margin: 0 auto; }
h2 { font-size: 18px; margin: 4px 0 14px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar input, .toolbar select { width: auto; min-width: 160px; }
table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: right; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
tr:hover td { background: rgba(255,255,255,.03); }
.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; }
.pill.ok { background: var(--ok); } .pill.bad { background: var(--bad); } .pill.warn { background: var(--warn); color: #000; }
.pill.muted { background: var(--line); }
.muted { color: var(--muted); }
.placeholder { color: var(--muted); padding: 40px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }
@media (max-width: 720px) {
  header { flex-wrap: wrap; height: auto; padding: 8px 12px; }
  #shell { grid-template-rows: auto 1fr; }
  nav { overflow-x: auto; width: 100%; }
}

/* modals, toasts, forms (items 4-7) */
dialog.modal {
  background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; width: min(560px, 94vw); direction: rtl;
}
dialog.modal::backdrop { background: rgba(0,0,0,.55); }
dialog.modal h3 { margin: 0 0 8px; font-size: 17px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-start; margin-top: 14px; }
.field { margin-bottom: 6px; }
.check { display: inline-flex; align-items: center; gap: 6px; margin: 4px 12px 4px 0; color: var(--text); font-size: 14px; }
.check input { width: auto; }
.perm-grid, .panel-grid { display: flex; flex-wrap: wrap; gap: 2px 8px; margin-bottom: 6px; }
.panel-grid { max-height: 180px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.small { font-size: 12px; }
#toast-host { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; z-index: 50; }
.toast { background: var(--ok); color: #fff; padding: 8px 14px; border-radius: 999px; font-size: 14px; box-shadow: 0 4px 16px rgba(0,0,0,.4); }
.toast.bad { background: var(--bad); }

/* dashboard cards, panel rows */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.card.stat { max-width: none; }
.card.stat h3 { margin: 0 0 8px; font-size: 16px; }
.card.total { border-color: var(--accent); }
.stat-row { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.stat-row:last-child { border-bottom: 0; }
.panel-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); }

/* events */
tr.row-fire td { background: rgba(146,43,33,.25); }
tr.row-active td { background: rgba(243,156,18,.10); }
tr.row-cleared td { color: var(--muted); }
