@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;600&display=swap');

/* ══════════════════════════════════════════════════
   PALETTE
══════════════════════════════════════════════════ */
:root {
  --bg:      #080810;
  --bg2:     #0d0d1a;
  --bg3:     #121220;
  --bg4:     #1a1a2e;
  --bg5:     #20203a;
  --border:  #1e1e38;
  --brd2:    #2e2e50;
  --brd3:    #3e3e68;
  --red:     #e11d48;
  --red2:    #9f1239;
  --red3:    #fb2f55;
  --redglow: rgba(225,29,72,.2);
  --redlow:  rgba(225,29,72,.08);
  --orange:  #f97316;
  --gold:    #d97706;
  --text:    #e2e2f0;
  --text2:   #c0c0d8;
  --muted:   #6b6b90;
  --dim:     #3e3e60;
  --green:   #22c55e;
  --yellow:  #eab308;
  --purple:  #8b5cf6;
  --font:    'Inter', system-ui, -apple-system, sans-serif;
  --mono:    'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
}

/* ══════════════════════════════════════════════════
   RESET
══════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--red3); text-decoration: none; transition: color .15s; }
a:hover { color: var(--red); text-decoration: none; }
.orange { color: var(--red3); }
.muted  { color: var(--muted); }

input, select, textarea, button { font-family: var(--font); font-size: 14px; }
input, select, textarea {
  background: var(--bg4);
  border: 1px solid var(--brd2);
  color: var(--text);
  border-radius: 6px;
  padding: 9px 13px;
  width: 100%;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(225,29,72,.15);
}
select option { background: var(--bg4); color: var(--text); }
textarea { resize: vertical; min-height: 80px; }
input[type="color"] { padding: 4px; height: 36px; cursor: pointer; }

/* ══════════════════════════════════════════════════
   NAVBAR
══════════════════════════════════════════════════ */
.navbar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 20px rgba(0,0,0,.5);
}
.nav-brand { display: flex; align-items: center; gap: .75rem; }
.nav-logo {
  width: 32px; height: 32px;
  border: 1.5px solid var(--red2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--red3); font-size: 14px;
  background: var(--redlow);
}
.nav-title {
  font-size: 14px; font-weight: 700;
  letter-spacing: .12em; color: var(--text);
}
.nav-title .orange { color: var(--red3); }
.nav-classified {
  background: var(--red2);
  color: rgba(255,255,255,.9);
  font-size: 8px; font-weight: 700;
  padding: 2px 7px; border-radius: 3px;
  letter-spacing: .2em; font-family: var(--mono);
}
.nav-links { display: flex; align-items: center; gap: .25rem; }
.nav-link {
  color: var(--muted); font-size: 13px; font-weight: 500;
  padding: 6px 12px; border-radius: 6px;
  transition: all .15s;
}
.nav-link:hover { color: var(--text); background: var(--bg4); }
.nav-link.active { color: var(--red3); background: var(--redlow); }
.nav-user {
  display: flex; align-items: center; gap: .5rem;
  color: var(--muted); font-size: 13px;
  padding: 0 .75rem; border-left: 1px solid var(--border);
}
.user-badge { color: var(--red3); font-size: 11px; }
.btn-logout {
  background: transparent; border: 1px solid var(--border);
  color: var(--muted); cursor: pointer; border-radius: 6px;
  padding: 5px 12px; font-size: 12px; font-family: var(--font);
  transition: all .15s;
}
.btn-logout:hover { border-color: var(--red2); color: var(--red3); }

/* ══════════════════════════════════════════════════
   FLASH
══════════════════════════════════════════════════ */
.flash {
  padding: .75rem 1.5rem; font-size: 13px; font-weight: 500;
  border-left: 3px solid; display: flex; align-items: center; gap: .5rem;
}
.flash-success { background: rgba(34,197,94,.08); border-color: var(--green); color: #4ade80; }
.flash-error   { background: rgba(225,29,72,.08); border-color: var(--red); color: var(--red3); }

/* ══════════════════════════════════════════════════
   PAGE WRAP
══════════════════════════════════════════════════ */
.page-wrap {
  max-width: 1240px; margin: 0 auto;
  padding: 2rem 1.5rem; flex: 1; position: relative;
}
.page-wrap::before {
  content: '忍';
  position: fixed; right: 2%; top: 50%;
  transform: translateY(-50%);
  font-size: 400px; color: rgba(225,29,72,.02);
  pointer-events: none; z-index: 0;
  font-family: serif;
}
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 2rem; gap: 1rem; flex-wrap: wrap; position: relative; z-index: 1;
}
.page-title {
  font-size: 22px; font-weight: 800; letter-spacing: -.01em; color: var(--text);
}
.page-title .orange { color: var(--red3); }
.page-sub { color: var(--muted); font-size: 13px; margin-top: .25rem; }
.breadcrumb { color: var(--muted); font-size: 12px; margin-bottom: 1rem; position: relative; z-index: 1; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--text); }
.section-title {
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 1rem;
  border-bottom: 1px solid var(--border); padding-bottom: .5rem;
}

/* ══════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════ */
.btn-primary {
  background: var(--red);
  color: #fff; border: none; border-radius: 6px;
  padding: 9px 20px; cursor: pointer; font-weight: 600;
  font-size: 13px; transition: all .15s; display: inline-block;
  box-shadow: 0 1px 10px rgba(225,29,72,.3);
}
.btn-primary:hover { background: var(--red3); color: #fff; box-shadow: 0 2px 16px rgba(225,29,72,.4); text-decoration: none; }

.btn-secondary {
  background: var(--bg4); color: var(--text2);
  border: 1px solid var(--brd2); border-radius: 6px;
  padding: 9px 18px; cursor: pointer; font-size: 13px;
  display: inline-block; transition: all .15s;
}
.btn-secondary:hover { border-color: var(--brd3); color: var(--text); text-decoration: none; }

.btn-sm {
  background: var(--bg4); color: var(--text2);
  border: 1px solid var(--border); border-radius: 5px;
  padding: 4px 10px; cursor: pointer; font-size: 12px;
  display: inline-block; transition: all .15s;
}
.btn-sm:hover  { border-color: var(--red); color: var(--red3); text-decoration: none; }
.btn-danger    { border-color: transparent; background: rgba(225,29,72,.1); color: var(--red3); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-edit {
  background: var(--bg4); color: var(--text2);
  border: 1px solid var(--brd2); border-radius: 6px;
  padding: 8px 16px; display: block; text-align: center;
  font-weight: 500; font-size: 13px; cursor: pointer; transition: all .15s;
}
.btn-edit:hover { background: var(--bg5); border-color: var(--red); color: var(--red3); text-decoration: none; }
.btn-delete {
  background: rgba(225,29,72,.08); color: var(--red3);
  border: 1px solid rgba(225,29,72,.25); border-radius: 6px;
  padding: 8px 16px; display: block; text-align: center;
  font-size: 13px; cursor: pointer; width: 100%; transition: all .15s;
}
.btn-delete:hover { background: var(--red); color: #fff; border-color: transparent; }
.btn-search {
  background: var(--red); color: #fff; border: none; border-radius: 6px;
  padding: 9px 18px; cursor: pointer; font-weight: 600;
  white-space: nowrap; font-size: 13px;
}
.btn-search:hover { background: var(--red3); }
.btn-reset {
  background: var(--bg4); color: var(--muted);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 9px 12px; cursor: pointer; font-size: 13px;
}
.btn-sm-pad { padding: 7px 14px !important; font-size: 12px; }

/* ══════════════════════════════════════════════════
   LOGIN
══════════════════════════════════════════════════ */
.login-page {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(225,29,72,.08) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(139,92,246,.04) 0%, transparent 50%);
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; position: relative;
}
.login-page::before {
  content: '忍'; position: absolute;
  font-size: 500px; color: rgba(225,29,72,.025);
  pointer-events: none; font-family: serif;
  top: 50%; left: 50%; transform: translate(-50%,-50%);
}
.login-wrap { width: 100%; max-width: 390px; padding: 1rem; position: relative; z-index: 1; }
.login-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,.03), 0 20px 60px rgba(0,0,0,.6);
}
.login-inner { padding: 2.5rem 2rem 2rem; }
.login-header { text-align: center; margin-bottom: 2rem; }
.login-logo {
  width: 64px; height: 64px;
  border: 2px solid var(--red2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: var(--red3);
  margin: 0 auto 1rem;
  background: var(--redlow);
  box-shadow: 0 0 24px rgba(225,29,72,.2);
}
.login-header h1 {
  font-size: 20px; font-weight: 800; letter-spacing: .05em; color: var(--text);
}
.login-header h1 .orange { color: var(--red3); }
.login-subtitle { color: var(--muted); font-size: 12px; margin-top: .4rem; }
.login-divider {
  display: flex; align-items: center; gap: .6rem;
  margin: 1rem 0; color: var(--dim); font-size: 11px;
  font-family: var(--mono); letter-spacing: .1em;
}
.login-divider::before, .login-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.login-stamp {
  display: inline-block; margin-top: .5rem;
  border: 1.5px solid var(--red2); color: var(--red2);
  font-size: 13px; font-weight: 700; padding: 3px 14px;
  letter-spacing: .25em; transform: rotate(-3deg); opacity: .7;
  font-family: var(--mono);
}
.login-error {
  background: rgba(225,29,72,.08); border: 1px solid rgba(225,29,72,.3);
  color: var(--red3); padding: .75rem 1rem; border-radius: 6px;
  margin-bottom: 1.5rem; font-size: 13px;
}
.login-form .field { margin-bottom: 1.1rem; }
.login-form label {
  display: block; font-size: 11px; font-weight: 600;
  color: var(--muted); letter-spacing: .08em; margin-bottom: .4rem; text-transform: uppercase;
}
.btn-login {
  width: 100%; padding: 11px;
  background: var(--red); color: #fff; border: none; border-radius: 8px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  letter-spacing: .05em; margin-top: .5rem; transition: all .15s;
  box-shadow: 0 2px 16px rgba(225,29,72,.3);
}
.btn-login:hover { background: var(--red3); box-shadow: 0 4px 24px rgba(225,29,72,.4); }
.login-warning {
  color: var(--dim); font-size: 11px; text-align: center;
  margin-top: 1.5rem; line-height: 1.7;
  border-top: 1px solid var(--border); padding-top: 1rem;
}

/* ══════════════════════════════════════════════════
   SEARCH BAR
══════════════════════════════════════════════════ */
.search-bar {
  display: flex; gap: .5rem; flex-wrap: wrap;
  margin-bottom: 2rem; align-items: center;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 8px; padding: .75rem 1rem; position: relative; z-index: 1;
}
.search-input  { flex: 2; min-width: 180px; }
.search-select { flex: 1; min-width: 130px; }

/* ══════════════════════════════════════════════════
   DOSSIER GRID
══════════════════════════════════════════════════ */
.dossiers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem; position: relative; z-index: 1;
}
.dossier-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; display: block; cursor: pointer;
  transition: border-color .2s, transform .15s, box-shadow .2s;
  box-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.dossier-card:hover {
  border-color: var(--red2); transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,0,0,.4), 0 0 0 1px rgba(225,29,72,.15);
  text-decoration: none;
}
.dc-photo { position: relative; height: 170px; background: var(--bg4); overflow: hidden; }
.dc-photo img { width: 100%; height: 100%; object-fit: cover; transition: filter .2s; }
.dossier-card:hover .dc-photo img { filter: brightness(1.05); }
.dc-no-photo {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--dim); font-size: 36px;
  background: linear-gradient(135deg, var(--bg3) 0%, var(--bg4) 100%);
}
.dc-menace {
  position: absolute; top: 8px; right: 8px;
  font-size: 9px; font-weight: 700; padding: 3px 8px;
  border-radius: 4px; letter-spacing: .08em; border: 1px solid;
  font-family: var(--mono); backdrop-filter: blur(4px);
}
.dc-info { padding: .875rem .875rem .75rem; }
.dc-nom { font-weight: 700; color: var(--text); font-size: 14px; margin-bottom: .5rem; letter-spacing: -.01em; }
.dc-meta { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .35rem; }
.dc-rang, .dc-statut { font-size: 11px; font-weight: 600; font-family: var(--mono); }
.dc-clan, .dc-village { font-size: 11px; color: var(--muted); }

/* ══════════════════════════════════════════════════
   DOSSIER DETAIL
══════════════════════════════════════════════════ */
.dossier-detail { display: grid; grid-template-columns: 220px 1fr; gap: 2rem; position: relative; z-index: 1; }
.dd-sidebar { display: flex; flex-direction: column; gap: .875rem; }
.dd-photo-wrap {
  border: 1px solid var(--brd2); border-radius: 8px; overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
}
.dd-photo { width: 100%; display: block; }
.dd-no-photo {
  width: 100%; height: 280px;
  background: linear-gradient(135deg, var(--bg3) 0%, var(--bg4) 100%);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 12px; text-align: center; letter-spacing: .1em;
}
.dd-stamp {
  text-align: center; font-size: 12px; font-weight: 700;
  padding: 8px; letter-spacing: .2em; border: 1.5px solid;
  border-radius: 6px; font-family: var(--mono);
  background: rgba(255,255,255,.03);
}
.dd-actions { display: flex; flex-direction: column; gap: .5rem; }
.dd-content {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 10px; padding: 2rem;
  box-shadow: 0 2px 12px rgba(0,0,0,.2);
}
.dd-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border); padding-bottom: 1.25rem;
}
.dd-nom { font-size: 26px; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.dd-menace { font-size: 11px; font-weight: 700; padding: 5px 14px; border-radius: 5px; letter-spacing: .08em; border: 1px solid; font-family: var(--mono); }
.dd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .875rem; margin-bottom: 1.5rem; }
.dd-field {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; padding: .875rem 1rem;
}
.dd-label { display: block; font-size: 10px; font-weight: 600; color: var(--muted); letter-spacing: .1em; margin-bottom: .3rem; text-transform: uppercase; }
.dd-value { font-size: 14px; font-weight: 600; color: var(--text); }
.dd-section { margin-bottom: 1.5rem; }
.dd-section-title { font-size: 10px; font-weight: 700; color: var(--muted); letter-spacing: .15em; margin-bottom: .75rem; text-transform: uppercase; }
.dd-description {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; padding: 1.25rem; line-height: 1.8;
  color: var(--text2); white-space: pre-wrap; font-size: 14px;
}

/* ══════════════════════════════════════════════════
   BADGES NATURES
══════════════════════════════════════════════════ */
.nature-badge {
  display: inline-flex; align-items: center; gap: .35rem;
  border: 1px solid; border-radius: 20px;
  padding: 4px 11px; font-size: 12px; font-weight: 600;
  background: rgba(255,255,255,.04);
}
.nature-kanji { font-size: 16px; font-family: serif; }
.natures-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.kekkei-badge {
  display: inline-block;
  background: rgba(139,92,246,.08); border: 1px solid rgba(139,92,246,.3);
  border-radius: 6px; padding: 7px 13px; margin: .25rem;
}
.kekkei-name { color: #a78bfa; font-weight: 700; font-size: 13px; }
.kekkei-natures { color: var(--muted); font-size: 11px; display: block; margin-top: 2px; font-family: var(--mono); }
.kekkei-list { display: flex; flex-wrap: wrap; }
.kekkei-inline { color: #a78bfa; font-size: 13px; }
.kekkei-inline small { color: var(--muted); }

/* ══════════════════════════════════════════════════
   RANG / STATUT / MENACE
══════════════════════════════════════════════════ */
.rang-genin              { color: #4ade80; font-weight: 600; }
.rang-geninconfirme      { color: #22c55e; font-weight: 600; }
.rang-chunin             { color: #facc15; font-weight: 600; }
.rang-kakunin            { color: #fb923c; font-weight: 600; }
.rang-tokubetsujonin     { color: #f97316; font-weight: 600; }
.rang-jonin              { color: var(--red3); font-weight: 700; }
.rang-commandantjonin    { color: #e11d48; font-weight: 700; }
.rang-sannin             { color: #c084fc; font-weight: 700; }
.rang-kage               { color: #fbbf24; font-weight: 800; }
.rang-forcesspeciale     { color: #818cf8; font-weight: 700; }
.rang-missingnin         { color: #ef4444; font-weight: 700; text-decoration: line-through; text-decoration-color: rgba(239,68,68,.5); }
.rang-civil              { color: var(--muted); }
.rang-inconnu            { color: var(--muted); font-style: italic; }

.statut-actif      { color: #4ade80; font-weight: 600; }
.statut-decede     { color: var(--muted); text-decoration: line-through; }
.statut-disparu    { color: #facc15; font-weight: 600; }
.statut-inconnu    { color: var(--muted); font-style: italic; }
.statut-neutralise { color: var(--red3); font-weight: 600; }

.menace-faible   { background: rgba(74,222,128,.1); color: #4ade80; border-color: rgba(74,222,128,.3); }
.menace-modere   { background: rgba(250,204,21,.1); color: #facc15; border-color: rgba(250,204,21,.3); }
.menace-eleve    { background: rgba(251,146,60,.1); color: #fb923c; border-color: rgba(251,146,60,.3); }
.menace-critique { background: rgba(225,29,72,.12); color: var(--red3); border-color: rgba(225,29,72,.3); }
.menace-extreme  { background: rgba(225,29,72,.18); color: #ff2d5a; border-color: rgba(225,29,72,.5); font-weight: 800; }

.stamp-actif      { border-color: #4ade80; color: #4ade80; background: rgba(74,222,128,.05); }
.stamp-decede     { border-color: var(--muted); color: var(--muted); }
.stamp-disparu    { border-color: #facc15; color: #facc15; background: rgba(250,204,21,.05); }
.stamp-inconnu    { border-color: var(--muted); color: var(--muted); }
.stamp-neutralise { border-color: var(--red); color: var(--red3); background: var(--redlow); }

/* ══════════════════════════════════════════════════
   TABLE
══════════════════════════════════════════════════ */
.table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; position: relative; z-index: 1; }
.table th {
  background: var(--bg3); color: var(--muted);
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  padding: .7rem 1rem; text-align: left; border-bottom: 1px solid var(--border);
}
.table td {
  padding: .8rem 1rem; border-bottom: 1px solid var(--border);
  vertical-align: middle; color: var(--text2); background: var(--bg2);
}
.table tr:hover td { background: var(--bg3); }
.table .actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.table td form { display: contents; }
.table td form button { display: inline-flex; align-items: center; }
.empty { text-align: center; color: var(--muted); padding: 2rem !important; font-style: italic; background: var(--bg2); }
.empty-state { grid-column: 1/-1; text-align: center; color: var(--muted); padding: 3rem; font-style: italic; }
.table-wrap { overflow-x: auto; }
.text-sm { font-size: 12px; }

/* ══════════════════════════════════════════════════
   ADMIN — STATS & NAV
══════════════════════════════════════════════════ */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 2rem; position: relative; z-index: 1; }
.stat-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 10px;
  padding: 1.5rem; text-align: center;
  transition: border-color .2s;
}
.stat-card:hover { border-color: var(--brd2); }
.stat-n { font-size: 42px; font-weight: 800; color: var(--red3); letter-spacing: -.02em; }
.stat-l { font-size: 11px; color: var(--muted); letter-spacing: .1em; font-weight: 600; margin-top: .35rem; text-transform: uppercase; }

.admin-nav { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 2rem; position: relative; z-index: 1; }
.admin-nav-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 10px;
  padding: 1.25rem; display: flex; flex-direction: column; gap: .4rem;
  transition: all .15s; cursor: pointer;
}
.admin-nav-card:hover { border-color: var(--red2); background: var(--bg3); transform: translateY(-2px); text-decoration: none; }
.anc-icon  { font-size: 24px; }
.anc-title { font-weight: 700; color: var(--text); font-size: 14px; }
.anc-sub   { color: var(--muted); font-size: 12px; }
.recent-section { margin-top: 2rem; position: relative; z-index: 1; }

.role-badge { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 4px; border: 1px solid; font-family: var(--mono); }
.role-admin  { background: rgba(225,29,72,.1); color: var(--red3); border-color: rgba(225,29,72,.3); }
.role-writer { background: rgba(217,119,6,.1); color: #fbbf24; border-color: rgba(217,119,6,.3); }
.role-viewer { background: rgba(107,107,144,.1); color: var(--muted); border-color: rgba(107,107,144,.2); }

/* ══════════════════════════════════════════════════
   USER MANAGEMENT
══════════════════════════════════════════════════ */
.you-badge {
  font-size: 10px; font-family: var(--mono); color: var(--muted);
  background: var(--bg4); border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 3px; margin-left: 5px;
}
.inline-form-row td { background: var(--bg3) !important; }
.inline-form { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .5rem 0; }
.inline-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.inline-select { flex: 1; min-width: 220px; }
.inline-input  { flex: 1; min-width: 200px; }
.role-legend { margin-top: 1rem; }
.legend-item { display: flex; align-items: flex-start; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid var(--border); }
.legend-item:last-child { border-bottom: none; }
.legend-desc { font-size: 12px; color: var(--muted); padding-top: 3px; }

/* ══════════════════════════════════════════════════
   FORMS
══════════════════════════════════════════════════ */
.form-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 10px; padding: 1.75rem; margin-bottom: 1.5rem;
  position: relative; z-index: 1;
}
.form-sm   { max-width: 100%; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin-bottom: .4rem; }
.form-actions {
  display: flex; gap: .75rem; justify-content: flex-end;
  margin-top: 1.25rem; border-top: 1px solid var(--border); padding-top: 1rem;
}
.checkbox-grid { display: flex; flex-wrap: wrap; gap: .5rem; }
.checkbox-item { display: flex; align-items: center; gap: .4rem; cursor: pointer; }
.checkbox-item input[type=checkbox] { width: auto; accent-color: var(--red); cursor: pointer; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; position: relative; z-index: 1; }

/* ══════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════ */
.footer {
  background: var(--bg2); border-top: 1px solid var(--border);
  padding: .75rem 1.5rem; display: flex; justify-content: space-between;
  color: var(--dim); font-size: 11px; letter-spacing: .05em;
  margin-top: auto; font-family: var(--mono);
}
.footer-id { color: var(--border); }

/* ══════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .dossier-detail { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .dd-grid   { grid-template-columns: 1fr; }
  .navbar { padding: 0 1rem; height: auto; min-height: 52px; flex-wrap: wrap; gap: .4rem; padding-top: .5rem; padding-bottom: .5rem; }
  .nav-links { gap: .2rem; flex-wrap: wrap; }
  .nav-user  { padding: 0 .5rem; border-left: none; }
  .page-wrap { padding: 1.25rem .875rem; }
  .page-title { font-size: 18px; }
  .dossiers-grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: .875rem; }
  .admin-nav { grid-template-columns: repeat(2, 1fr); }
  .dd-content { padding: 1.25rem 1rem; }
  .table th, .table td { padding: .6rem .75rem; font-size: 12px; }
  .inline-form { flex-direction: column; align-items: stretch; }
  .inline-select, .inline-input { min-width: 100%; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .dossiers-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-classified { display: none; }
  .stat-n { font-size: 36px; }
  .login-inner { padding: 2rem 1.25rem 1.5rem; }
}
