/* ============================================================
   BIBLIOTHèSE — Feuille de styles principale
   ============================================================ */

/* ── Variables ─────────────────────────────────────────── */
:root {
  --navy:      #0f1b4c;
  --navy-dark: #0a1235;
  --navy-mid:  #1a2d6b;
  --gold:      #e8c96a;
  --gold-dark: #c9a83c;
  --white:     #ffffff;
  --bg:        #f8f7f2;
  --bg2:       #f0ede4;
  --border:    #e2dfd6;
  --text:      #1a1a2e;
  --text2:     #4a4a6a;
  --text3:     #7a7a9a;
  --green:     #0f6e56;
  --green-bg:  #e1f5ee;
  --amber:     #856404;
  --amber-bg:  #faeeda;
  --red:       #c53030;
  --red-bg:    #fff5f5;
  --blue:      #185fa5;
  --blue-bg:   #e6f1fb;
  --radius:    8px;
  --radius-lg: 12px;
  --shadow:    0 2px 12px rgba(15,27,76,.08);
  --shadow-md: 0 4px 24px rgba(15,27,76,.12);
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }
textarea { resize: vertical; }

/* ── Layout ────────────────────────────────────────────── */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.site-main { flex: 1; padding-bottom: 4rem; }

/* ── HEADER ────────────────────────────────────────────── */
.site-header {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 1rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-icon { font-size: 26px; }
.logo-name {
  display: block;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: .5px;
  line-height: 1.2;
}
.logo-sub {
  display: block;
  font-size: 10px;
  color: #8899bb;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.main-nav {
  display: flex;
  gap: 4px;
}
.nav-link {
  color: #aabbcc;
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  transition: all .2s;
}
.nav-link:hover, .nav-link.active {
  background: rgba(232,201,106,.12);
  color: var(--gold);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.user-name { font-size: 13px; color: #aabbcc; }

/* ── FOOTER ────────────────────────────────────────────── */
.site-footer {
  background: var(--navy-dark);
  color: #6677aa;
  font-size: 12px;
  padding: 1rem 0;
  margin-top: auto;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
}

/* ── FLASH ─────────────────────────────────────────────── */
.flash {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 999;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  animation: slideIn .3s ease;
}
.flash-success { background: var(--green-bg); color: var(--green); border: 1px solid #9ae6b4; }
.flash-error   { background: var(--red-bg);   color: var(--red);   border: 1px solid #feb2b2; }
@keyframes slideIn { from { transform: translateX(1rem); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── BUTTONS ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .2s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary    { background: var(--navy);  color: var(--gold);  }
.btn-primary:hover { background: var(--navy-mid); }
.btn-outline    { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
.btn-outline:hover { background: var(--navy); color: var(--gold); }
.btn-ghost      { background: transparent; color: var(--text3); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg2); }
.btn-gold       { background: var(--gold); color: var(--navy); font-weight: 700; }
.btn-gold:hover { background: var(--gold-dark); }
.btn-gold-sm    { background: var(--gold); color: var(--navy); font-weight: 700; padding: 5px 14px; font-size: 12px; border-radius: var(--radius); border: none; cursor: pointer; }
.btn-block      { width: 100%; justify-content: center; }
.btn-primary-sm { background: var(--gold); color: var(--navy); border: none; padding: 7px 16px; border-radius: var(--radius); font-size: 13px; font-weight: 700; cursor: pointer; transition: background .2s; }
.btn-primary-sm:hover { background: var(--gold-dark); }
.btn-outline-sm { background: transparent; color: #aabbcc; border: 1px solid #445566; padding: 6px 14px; border-radius: var(--radius); font-size: 12px; cursor: pointer; transition: all .2s; }
.btn-outline-sm:hover { background: rgba(255,255,255,.05); color: #fff; }

/* ── BADGES ────────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  line-height: 1.5;
}
.badge-type.badge-thèse,
.badge-type.badge-th-se   { background: #fff3cd; color: #856404; }
.badge-type.badge-mémoire,
.badge-type.badge-m-moire { background: #d4edda; color: #155724; }
.badge-domaine  { background: #e6f1fb; color: #185fa5; }
.badge-statut   { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.badge-valide   { background: var(--green-bg); color: var(--green); }
.badge-ok       { background: var(--green-bg); color: var(--green); font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; }
.badge-no       { background: var(--red-bg);   color: var(--red);   font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; }
.badge-jury     { background: var(--bg2); color: var(--text2); font-size: 11px; padding: 2px 8px; border-radius: 20px; }
.statut-validé       { background: var(--green-bg); color: var(--green); }
.statut-en_attente   { background: var(--amber-bg); color: var(--amber); }
.statut-refusé       { background: var(--red-bg);   color: var(--red); }

/* ── ROLE BADGES ───────────────────────────────────────── */
.role-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}
.role-admin      { background: #ede9fe; color: #7c3aed; }
.role-enseignant { background: var(--green-bg); color: var(--green); }
.role-etudiant   { background: var(--blue-bg);  color: var(--blue); }

/* ── HERO ──────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  padding: 3rem 0 2.5rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(232,201,106,.08) 0%, transparent 70%);
  border-radius: 50%;
}
.hero-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 32px;
  color: var(--gold);
  margin-bottom: .5rem;
}
.hero-sub { font-size: 15px; color: #8899bb; margin-bottom: 1.5rem; }
.stats-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.stat-card {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-lg);
  padding: 12px 24px;
  text-align: center;
}
.stat-num { display: block; font-size: 28px; font-weight: 700; color: var(--gold); line-height: 1; }
.stat-lbl { display: block; font-size: 11px; color: #8899bb; text-transform: uppercase; letter-spacing: 1px; margin-top: 2px; }

/* ── SEARCH BAR ────────────────────────────────────────── */
.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 1.25rem;
}
.input-search {
  flex: 1;
  min-width: 220px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 14px;
  font-size: 14px;
  background: var(--white);
  outline: none;
  transition: border-color .2s;
}
.input-search:focus { border-color: var(--navy); }
.select-filter {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 13px;
  background: var(--white);
  cursor: pointer;
  outline: none;
  transition: border-color .2s;
}
.select-filter:focus { border-color: var(--navy); }
.result-count { font-size: 13px; color: var(--text3); margin-bottom: 1rem; }

/* ── DOCUMENT CARDS ────────────────────────────────────── */
.doc-list { display: flex; flex-direction: column; gap: .75rem; }
.doc-card {
  display: block;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  transition: all .2s;
  position: relative;
  overflow: hidden;
}
.doc-card:hover {
  border-color: var(--navy);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.doc-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.doc-annee { font-size: 12px; color: var(--text3); margin-left: auto; font-weight: 500; }
.doc-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
  line-height: 1.4;
}
.doc-meta { font-size: 13px; color: var(--text2); margin-bottom: 6px; line-height: 1.5; }
.keywords { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.kw {
  background: var(--blue-bg);
  color: var(--blue);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 500;
  transition: background .15s;
}
a.kw:hover { background: #c7ddf7; }
.doc-arrow {
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--border);
  transition: color .2s, transform .2s;
}
.doc-card:hover .doc-arrow { color: var(--navy); transform: translateY(-50%) translateX(3px); }

/* ── PAGINATION ────────────────────────────────────────── */
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 2rem; }
.pag-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  background: var(--white);
  transition: all .2s;
}
.pag-btn:hover { border-color: var(--navy); color: var(--navy); }
.pag-btn.active { background: var(--navy); border-color: var(--navy); color: var(--gold); }

/* ── CTA BANNER ────────────────────────────────────────── */
.cta-banner {
  margin-top: 2rem;
  background: var(--navy);
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.cta-banner strong { color: var(--gold); display: block; margin-bottom: 4px; font-size: 15px; }
.cta-banner p { color: #8899bb; font-size: 13px; }

/* ── EMPTY STATE ───────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text3);
}
.empty-icon { font-size: 48px; display: block; margin-bottom: 1rem; }
.empty-state p { font-size: 15px; margin-bottom: 1.5rem; }

/* ── DOCUMENT DETAIL ───────────────────────────────────── */
.doc-detail { padding-top: 2rem; }
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text3);
  margin-bottom: 1.5rem;
}
.breadcrumb a:hover { color: var(--navy); text-decoration: underline; }
.detail-header { margin-bottom: 2rem; }
.detail-badges { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.detail-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 26px;
  color: var(--navy);
  line-height: 1.35;
  margin-bottom: 8px;
}
.detail-date { font-size: 13px; color: var(--text3); }
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2rem;
  align-items: start;
}
.detail-section { margin-bottom: 1.75rem; }
.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text3);
  margin-bottom: .75rem;
}
.detail-resume { font-size: 15px; color: var(--text2); line-height: 1.8; font-style: italic; }
.jury-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.jury-table th { background: var(--bg2); padding: 8px 12px; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text3); border-bottom: 1.5px solid var(--border); }
.jury-table td { padding: 10px 12px; border-bottom: 1px solid var(--bg2); color: var(--text2); }
.download-btns { display: flex; flex-direction: column; gap: 10px; }
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--navy);
  color: var(--gold);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  transition: background .2s;
  border: none;
  cursor: pointer;
  max-width: 360px;
}
.btn-download:hover { background: var(--navy-mid); }
.btn-download.disabled { background: var(--bg2); color: var(--text3); cursor: default; }
.lock-msg {
  background: var(--amber-bg);
  border: 1px solid #f6c752;
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 13px;
  color: var(--amber);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.aside-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.info-list { font-size: 13px; }
.info-list dt { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--text3); font-weight: 700; margin-top: 14px; margin-bottom: 2px; }
.info-list dt:first-child { margin-top: 0; }
.info-list dd { color: var(--text); font-size: 14px; }
.aside-link { display: block; font-size: 13px; color: var(--blue); padding: 8px 12px; border: 1px solid var(--blue-bg); border-radius: var(--radius); background: var(--blue-bg); transition: background .2s; }
.aside-link:hover { background: #c7ddf7; }

/* ── LOGIN ─────────────────────────────────────────────── */
.login-wrap { max-width: 440px; margin: 0 auto; padding-top: 3rem; padding-bottom: 3rem; }
.login-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
}
.login-logo { text-align: center; margin-bottom: 1.75rem; }
.login-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px; height: 60px;
  background: var(--navy);
  border-radius: 16px;
  font-size: 28px;
  margin-bottom: 1rem;
}
.login-logo h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  color: var(--navy);
  margin-bottom: 4px;
}
.login-logo p { font-size: 13px; color: var(--text3); }
.login-form label { display: block; font-size: 13px; font-weight: 600; color: var(--text2); margin-bottom: 6px; margin-top: 16px; }
.login-form label:first-of-type { margin-top: 0; }
.login-form input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
}
.login-form input:focus { border-color: var(--navy); }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 44px; }
.toggle-pwd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 0 4px;
  color: var(--text3);
}
.login-form .btn { margin-top: 1.5rem; }
.back-link { text-align: center; margin-top: 1.25rem; font-size: 13px; color: var(--text3); }
.back-link a { color: var(--blue); }
.demo-accounts { margin-top: 1.5rem; border-top: 1px solid var(--border); padding-top: 1.25rem; }
.demo-title { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--text3); margin-bottom: 10px; font-weight: 600; }
.demo-grid { display: flex; gap: 8px; }
.demo-btn {
  flex: 1;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  transition: all .2s;
  color: var(--text2);
}
.demo-btn:hover { background: var(--navy); color: var(--gold); border-color: var(--navy); }

/* ── ALERTS ────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 14px; font-weight: 500; margin-bottom: 1.25rem; }
.alert-error   { background: var(--red-bg);   color: var(--red);   border: 1px solid #feb2b2; }
.alert-success { background: var(--green-bg); color: var(--green); border: 1px solid #9ae6b4; }

/* ── ADMIN LAYOUT ──────────────────────────────────────── */
.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2rem;
  padding-top: 2rem;
  padding-bottom: 3rem;
  align-items: start;
}
.admin-sidebar {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  position: sticky;
  top: 80px;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-link {
  display: block;
  padding: 9px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  transition: all .15s;
}
.sidebar-link:hover { background: var(--bg2); color: var(--navy); }
.sidebar-link.active { background: var(--navy); color: var(--gold); font-weight: 600; }
.sidebar-sep { border: none; border-top: 1px solid var(--border); margin: 8px 0; }

.admin-content { min-width: 0; }
.admin-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 24px;
  color: var(--navy);
  margin-bottom: 1.5rem;
}
.admin-sub { font-size: 13px; color: var(--blue); margin-top: -1rem; margin-bottom: 1.5rem; }
.admin-page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; }
.admin-page-head .admin-title { margin-bottom: 0; }

/* ── KPI CARDS ─────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.kpi-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: center;
}
.kpi-card.kpi-green { border-top: 3px solid var(--green); }
.kpi-card.kpi-amber { border-top: 3px solid #f6c752; }
.kpi-card.kpi-blue  { border-top: 3px solid var(--blue); }
.kpi-num { display: block; font-size: 32px; font-weight: 700; color: var(--navy); line-height: 1; margin-bottom: 4px; }
.kpi-lbl { font-size: 12px; color: var(--text3); text-transform: uppercase; letter-spacing: .5px; }

/* ── DASHBOARD ─────────────────────────────────────────── */
.dash-row { display: grid; grid-template-columns: 1fr 2fr; gap: 1.25rem; margin-bottom: 1.5rem; }
.card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.card-title { font-size: 15px; font-weight: 700; color: var(--navy); }
.card-link { font-size: 12px; color: var(--blue); }
.bar-chart { display: flex; flex-direction: column; gap: 10px; }
.bar-item { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text2); }
.bar-item span:first-child { min-width: 65px; }
.bar-item span:last-child { min-width: 24px; text-align: right; font-weight: 600; }
.bar-outer { flex: 1; background: var(--bg2); border-radius: 99px; height: 8px; overflow: hidden; }
.bar-inner { height: 100%; border-radius: 99px; transition: width .5s ease; }
.bar-these   { background: #f6c752; }
.bar-memoire { background: #6bcf9a; }
.bar-blue    { background: #5ba3e0; }
.bar-green   { background: #6bcf9a; }
.bar-amber   { background: #f6c752; }

.shortcut-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; }
.shortcut-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 1.25rem;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  text-align: center;
  transition: all .2s;
}
.shortcut-card:hover { border-color: var(--navy); color: var(--navy); box-shadow: var(--shadow); }
.sc-icon { font-size: 28px; }

/* ── ADMIN FILTERS ─────────────────────────────────────── */
.admin-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1.25rem;
}
.input-filter {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 13px;
  background: var(--white);
  outline: none;
  flex: 1;
  min-width: 180px;
  transition: border-color .2s;
}
.input-filter:focus { border-color: var(--navy); }

/* ── TABLES ────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1.5px solid var(--border); border-radius: var(--radius-lg); background: var(--white); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th {
  background: var(--bg2);
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text3);
  border-bottom: 1.5px solid var(--border);
  font-weight: 700;
  white-space: nowrap;
}
.admin-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--bg2);
  color: var(--text);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg); }
.td-title a { color: var(--navy); font-weight: 500; }
.td-title a:hover { text-decoration: underline; }
.td-actions { white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.btn-xs {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .15s;
}
.btn-edit   { background: var(--blue-bg);  color: var(--blue); border-color: #b8d4ee; }
.btn-edit:hover { background: #c7ddf7; }
.btn-delete { background: var(--red-bg);   color: var(--red);  border-color: #feb2b2; }
.btn-delete:hover { background: #fed7d7; }

/* ── FORMS ─────────────────────────────────────────────── */
.doc-form { display: flex; flex-direction: column; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--text2); }
.form-group input,
.form-group select,
.form-group textarea {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 14px;
  background: var(--white);
  outline: none;
  transition: border-color .2s;
  width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--navy); }
.form-group input.input-error,
.form-group select.input-error,
.form-group textarea.input-error { border-color: var(--red); }
.input-disabled { background: var(--bg2) !important; color: var(--text3); cursor: not-allowed; }
.input-file { border-style: dashed !important; background: var(--bg) !important; cursor: pointer; }
.input-file:hover { border-color: var(--navy) !important; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.form-actions { display: flex; gap: 10px; padding-top: .5rem; }
.field-error { font-size: 12px; color: var(--red); margin-top: 2px; }
.req { color: var(--red); }
small { font-size: 11px; color: var(--text3); display: block; margin-top: 3px; }

/* ── ROLE RADIO GROUP ──────────────────────────────────── */
.role-radio-group { display: flex; gap: 8px; flex-wrap: wrap; }
.role-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
  background: var(--white);
}
.role-radio input { display: none; }
.role-radio:hover { border-color: var(--navy); }
.role-radio.selected { border-color: var(--navy); background: var(--navy); color: var(--gold); }

/* ── EXISTING FILE ─────────────────────────────────────── */
.existing-file {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  padding: 8px 12px;
  background: var(--green-bg);
  border-radius: var(--radius);
  margin-bottom: 8px;
  color: var(--green);
}
.existing-file a { color: var(--blue); font-weight: 600; }
.check-delete { display: flex; align-items: center; gap: 4px; cursor: pointer; color: var(--red); margin-left: auto; }
.check-delete input { cursor: pointer; }
.check-label { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }

/* ── SECTION (public page wrapper) ────────────────────── */
.section-main {
  padding-top: 0;
}

/* ── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 900px) {
  .admin-layout  { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; }
  .detail-grid   { grid-template-columns: 1fr; }
  .kpi-grid      { grid-template-columns: repeat(2,1fr); }
  .dash-row      { grid-template-columns: 1fr; }
  .shortcut-grid { grid-template-columns: repeat(2,1fr); }
  .form-row-2,
  .form-row-3    { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .hero-title    { font-size: 22px; }
  .main-nav      { display: none; }
  .user-name     { display: none; }
  .header-inner  { height: 56px; }
  .logo-name     { font-size: 15px; }
  .kpi-grid      { grid-template-columns: repeat(2,1fr); }
  .shortcut-grid { grid-template-columns: 1fr 1fr; }
  .stats-row     { gap: .75rem; }
  .stat-card     { padding: 10px 16px; }
}
