:root {
  --primary: #06B6D4;
  --highlight: #2563EB;
  --secondary: #1E3A8A;
  --background: #F8FAFC;
  --text: #0F172A;
  --success: #10B981;
  --surface: #FFFFFF;
  --muted: #475569;
  --border: #E2E8F0;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background: var(--background);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
header {
  min-height: 108px;
  background: var(--secondary);
  border-bottom: 4px solid var(--primary);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px 5vw;
  color: white;
}
.brand { display: flex; align-items: center; gap: 22px; text-decoration: none; margin-right: auto; flex-shrink: 0; }
.brand img { display: block; width: 250px; height: auto; }
.brand small { font-size: 9px; letter-spacing: 2px; color: white; padding-left: 22px; border-left: 1px solid var(--primary); }
#identity { font-size: 13px; overflow-wrap: anywhere; }
#logout { color: white; border-color: var(--primary); background: transparent; }
#logout:hover:not(:disabled) { color: var(--text); background: var(--primary); }
main { max-width: 1320px; margin: 48px auto; padding: 0 32px; }
.eyebrow { font-size: 11px; letter-spacing: 2px; font-weight: 800; color: var(--secondary); border-left: 3px solid var(--primary); padding-left: 10px; }
h1 { font-size: 38px; letter-spacing: -1.4px; margin: 12px 0; }
h2 { font-size: 20px; }
p, small { color: var(--muted); line-height: 1.6; }
label { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 600; }
input, select, textarea { font: inherit; width: 100%; border: 1px solid #CBD5E1; border-radius: 9px; padding: 12px; background: var(--surface); color: var(--text); }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--highlight); outline-offset: 3px; }
header a:focus-visible, header button:focus-visible { outline-color: var(--primary); }
button { border: 1px solid #CBD5E1; border-radius: 8px; padding: 11px 18px; background: var(--surface); color: var(--secondary); cursor: pointer; font: inherit; font-size: 13px; font-weight: 650; transition: background .15s, color .15s, border-color .15s; }
button:disabled { opacity: .45; cursor: default; }
button:hover:not(:disabled) { border-color: var(--highlight); background: #EFF6FF; color: var(--highlight); }
.primary { background: var(--primary); color: var(--text); border-color: var(--primary); font-weight: 750; }
.primary:hover:not(:disabled) { background: var(--highlight); color: white; border-color: var(--highlight); }
#login { max-width: 850px; margin: 70px auto; }
#login h1 { font-size: 54px; }
#login-form { background: var(--surface); padding: 30px; max-width: 430px; border: 1px solid var(--border); border-top: 4px solid var(--primary); border-radius: 16px; display: grid; gap: 19px; margin-top: 28px; box-shadow: 0 12px 36px #1E3A8A08; }
#filters { display: flex; align-items: end; gap: 16px; background: var(--surface); padding: 22px; border: 1px solid var(--border); border-radius: 12px; margin: 32px 0; }
.search { flex: 1; }
.table-head, .pagination { display: flex; align-items: center; gap: 12px; }
.table-head h2, .pagination span { margin-right: auto; }
#total { font-size: 13px; color: var(--highlight); margin-left: 9px; }
.table-wrap { overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
th, td { padding: 18px; border-bottom: 1px solid var(--border); font-size: 13px; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--secondary); background: #EFF6FF; }
td small { display: block; }
.badge { background: #ECFDF5; color: #065F46; border: 1px solid var(--success); padding: 6px 10px; border-radius: 20px; }
.pagination { margin-top: 18px; }
.actions { display: flex; gap: 8px; justify-content: flex-end; }
td button { padding: 8px; margin-right: 5px; }
dialog { color: var(--text); background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--primary); border-radius: 16px; padding: 30px; width: min(560px, 94vw); max-height: 90vh; box-shadow: 0 20px 100px #0F172A30; }
dialog::backdrop { background: #0F172A80; }
dialog form { display: grid; gap: 16px; }
dialog h2, dialog p { margin: 0; }
.notice { font-size: 12px; background: #EFF6FF; color: var(--secondary); padding: 12px; border-radius: 8px; }
#edit-error { color: #B91C1C; }
#message:not(:empty) { padding: 14px 18px; color: var(--secondary); background: #EFF6FF; border-left: 4px solid var(--highlight); margin-bottom: 24px; border-radius: 9px; }
#message[data-kind="success"]:not(:empty) { background: #ECFDF5; color: #065F46; border-left-color: var(--success); }
#history-items article { padding: 20px 0; border-bottom: 1px solid var(--border); }
#close-history { margin-top: 20px; }
[hidden] { display: none !important; }
@media (max-width: 900px) { .brand small { display: none; } }
@media (max-width: 700px) {
  main { padding: 0 16px; margin-top: 30px; }
  header { padding: 10px 16px 14px; gap: 8px 12px; flex-wrap: wrap; }
  .brand img { width: 215px; }
  #identity { font-size: 12px; order: 3; width: 100%; }
  #identity:empty { display: none; }
  #filters { flex-direction: column; align-items: stretch; }
  h1 { font-size: 30px; }
  #login h1 { font-size: 40px; }
  dialog { padding: 22px; }
}
.admin-tabs { display:flex; gap:8px; border-bottom:1px solid var(--border); padding-bottom:14px; margin-bottom:28px; flex-wrap:wrap; }
.admin-tabs button[aria-pressed="true"] { background:var(--secondary); color:white; border-color:var(--secondary); }
#deleted-filters { display:flex; align-items:end; gap:16px; padding:22px; background:var(--surface); border:1px solid var(--border); border-radius:12px; margin:28px 0; }
#deleted-filters label { flex:1; }
#deleted-total { color:var(--highlight); font-size:13px; margin-left:9px; }
.deleted-reason { white-space:normal; min-width:200px; max-width:360px; overflow-wrap:anywhere; }
#restore-error { color:#b91c1c; }
@media(max-width:700px){#deleted-filters{flex-direction:column;align-items:stretch}}
