/* ============ InfOccitanie — admin ============ */
:root {
  --brand: #CD0000; --brand-dark: #a30000; --accent: #FEBD01;
  --bg: #eef0f4; --surface: #fff; --surface-2: #f4f6f9; --text: #1a1d24;
  --text-soft: #687082; --border: #e0e3ea; --radius: 10px;
  --shadow: 0 1px 3px rgba(20,24,35,.08);
  --font: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; }

/* Google Material Symbols */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined'; font-weight: normal; font-style: normal;
  font-size: 20px; line-height: 1; letter-spacing: normal; text-transform: none;
  display: inline-block; vertical-align: middle; white-space: nowrap; direction: ltr;
  font-feature-settings: 'liga'; -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}
a { color: inherit; text-decoration: none; }
.layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar { width: 230px; background: #16181d; color: #cfd3db; flex: 0 0 230px;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { padding: 18px 20px; border-bottom: 1px solid #262a33; display: flex; align-items: center; gap: 10px; }
.sidebar .brand img { height: 30px; }
.sidebar .brand b { color: #fff; font-size: 16px; }
.sidebar nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar nav a { padding: 11px 14px; border-radius: 8px; color: #cfd3db; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; gap: 10px; }
.sidebar nav a .material-symbols-outlined { font-size: 22px; opacity: .9; flex: 0 0 22px; }
.sidebar nav a:hover { background: #21252e; color: #fff; }
.sidebar nav a.active { background: var(--brand); color: #fff; }
.sidebar .bottom { padding: 12px; border-top: 1px solid #262a33; }
.sidebar .bottom a { font-size: 13px; color: #9aa1ad; padding: 8px 12px; display: flex; align-items: center; gap: 8px; }
.sidebar .bottom a .material-symbols-outlined { font-size: 18px; }
.sidebar .bottom a:hover { color: #fff; }

/* Main */
.content { flex: 1; min-width: 0; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 14px 26px;
  display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10; }
.topbar h1 { font-size: 19px; margin: 0; }
.inner { padding: 26px; max-width: none; width: 100%; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); padding: 9px 16px; border-radius: 8px;
  font-weight: 700; font-size: 14px; cursor: pointer; }
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-danger { color: #c00; border-color: #f0c4c4; background: #fff5f5; }
.btn-danger:hover { background: #c00; color: #fff; border-color: #c00; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-icon { padding: 7px 9px; min-width: 36px; justify-content: center; }
.btn-icon .material-symbols-outlined { font-size: 20px; }
.row-actions { display: inline-flex; align-items: center; gap: 6px; }

/* Cards / stats */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 24px; }
@media (max-width: 1000px) { .stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 800px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); }
.stat .n { font-size: 30px; font-weight: 800; }
.stat .l { color: var(--text-soft); font-size: 13px; text-transform: uppercase; letter-spacing: .03em; }
.stat.accent { border-top: 3px solid var(--brand); }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; margin-bottom: 22px; }
.panel-head { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex;
  justify-content: space-between; align-items: center; }
.panel-head h2 { margin: 0; font-size: 16px; }
.panel-body { padding: 18px 20px; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .03em;
  color: var(--text-soft); padding: 10px 16px; border-bottom: 1px solid var(--border); }
td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-2); }
.thumb-xs { width: 54px; height: 36px; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.pill { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.pill.pub { background: #e3f6e9; color: #1a7d3c; }
.pill.draft { background: #fdf0d5; color: #946200; }
.pill.scheduled { background: #e8f0fe; color: #1a56b8; }
.pill.role-admin { background: rgba(205,0,0,.1); color: var(--brand); }
.pill.role-journo { background: #eef0f4; color: #555c6b; }

/* User avatars */
.avatar-xs { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; display: block; background: var(--surface-2); }
.avatar-xs.initial { display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--brand); font-size: 15px; }
.avatar-lg { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; margin: 0 auto; display: block; background: var(--surface-2); }
.avatar-lg.initial { display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--brand); font-size: 38px; }

/* Media library — grille */
.media-toolbar { align-items: stretch; }
.media-search { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 240px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 6px 12px;
  box-shadow: var(--shadow); }
.media-search .material-symbols-outlined { color: var(--text-soft); font-size: 22px; flex: 0 0 auto; }
.media-search input { flex: 1; min-width: 0; border: none; background: transparent; padding: 6px 0;
  font-family: inherit; font-size: 14px; outline: none; }
.media-search input::placeholder { color: var(--text-soft); }
.media-search .btn { flex-shrink: 0; }
.media-empty .panel-body { text-align: center; padding: 48px 24px; color: var(--text-soft); }
.media-empty .material-symbols-outlined { font-size: 56px; opacity: .35; display: block; margin-bottom: 12px; }
.media-empty p { margin: 0 0 8px; font-weight: 700; color: var(--text); font-size: 16px; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.media-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: border-color .2s, box-shadow .2s, transform .2s; color: inherit; text-decoration: none; }
.media-card:hover { border-color: var(--brand); box-shadow: 0 8px 24px rgba(20,24,35,.12); transform: translateY(-3px); }
.media-thumb { position: relative; aspect-ratio: 4/3; background: var(--surface-2); overflow: hidden; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.media-card:hover .media-thumb img { transform: scale(1.04); }
.media-card-overlay { position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(22,24,29,.45); opacity: 0; transition: opacity .2s; }
.media-card:hover .media-card-overlay { opacity: 1; }
.media-card-overlay .material-symbols-outlined { font-size: 32px; color: #fff;
  background: var(--brand); width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.media-badge { position: absolute; bottom: 8px; right: 8px; font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 6px; background: rgba(22,24,29,.72); color: #fff;
  backdrop-filter: blur(4px); letter-spacing: .02em; }
.media-meta { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.media-title { font-weight: 800; font-size: 13.5px; line-height: 1.35; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.media-sub { display: flex; flex-wrap: wrap; gap: 5px; min-height: 22px; }
.media-tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-soft); max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-tag-ok { background: #e3f6e9; color: #1a7d3c; }
.media-tag-credit { background: rgba(205,0,0,.08); color: var(--brand); }
.media-dim { color: var(--text-soft); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 520px) {
  .media-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .media-meta { padding: 10px; }
}

.media-list { display: flex; flex-direction: column; gap: 10px; }
.media-row { display: grid; grid-template-columns: 140px 1fr; gap: 14px; align-items: start;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px;
  box-shadow: var(--shadow); transition: .15s; color: inherit; text-decoration: none; }
.media-row:hover { border-color: var(--brand); }
.media-row-thumb { aspect-ratio: 16/9; background: var(--surface-2); border-radius: 6px; overflow: hidden; display: block; }
.media-row-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-row-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.media-row-title { font-weight: 800; font-size: 15px; line-height: 1.3; }
.media-row-field { font-size: 13px; line-height: 1.45; color: var(--text); word-break: break-word; }
.media-row-field strong { color: var(--text-soft); font-weight: 700; margin-right: 4px; }
.media-row-dim { color: var(--text-soft); font-size: 12px; margin-top: 2px; }
@media (max-width: 600px) {
  .media-row { grid-template-columns: 96px 1fr; gap: 10px; }
}

/* Focal point picker */
.focal-pick { position: relative; cursor: crosshair; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--border); max-width: 640px; }
.focal-pick img { width: 100%; display: block; }
.focal-dot { position: absolute; width: 22px; height: 22px; border-radius: 50%; border: 3px solid #fff;
  background: rgba(205,0,0,.85); box-shadow: 0 0 0 2px rgba(0,0,0,.4); transform: translate(-50%, -50%);
  pointer-events: none; transition: left .08s, top .08s; }

/* Generated crop formats */
.crop-formats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 700px) { .crop-formats { grid-template-columns: 1fr; } }
.crop-frame { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.crop-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.crop-fmt-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.crop-fmt-foot span { font-weight: 800; font-size: 13px; }

/* Forms */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.field input[type=text], .field input[type=url], .field input[type=password],
.field textarea, .field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: var(--font); background: var(--surface); color: var(--text); }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--brand); }
.field textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.field .hint { color: var(--text-soft); font-size: 12.5px; margin-top: 4px; }
.editor { display: grid; grid-template-columns: 1fr 300px; gap: 22px; }
@media (max-width: 860px) { .editor { grid-template-columns: 1fr; } }
.checks { display: flex; flex-direction: column; gap: 7px; max-height: 280px; overflow: auto;
  border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.checks label { display: flex; gap: 8px; align-items: center; font-weight: 700; font-size: 14px; }
.toolbar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.toolbar button { font-size: 13px; padding: 5px 10px; }

.notice { background: #e3f6e9; color: #1a7d3c; border: 1px solid #b6e6c5; padding: 11px 16px;
  border-radius: 8px; margin-bottom: 18px; font-weight: 700; font-size: 14px; }
.alert { background: #fdeaea; color: #b00; border: 1px solid #f3c3c3; padding: 11px 16px;
  border-radius: 8px; margin-bottom: 18px; font-size: 14px; }

.filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.filters input, .filters select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font-size: 14px; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: linear-gradient(135deg, #CD0000, #7a0000); }
.login-card { background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.3);
  width: 100%; max-width: 380px; padding: 34px 32px; }
.login-card .logo { text-align: center; margin-bottom: 22px; }
.login-card .logo img { height: 44px; }
.login-card h1 { font-size: 19px; text-align: center; margin: 0 0 20px; }
.login-card .btn-primary { width: 100%; justify-content: center; padding: 12px; }
.pagination-admin { display: flex; gap: 6px; justify-content: center; margin-top: 18px; }
.pagination-admin a, .pagination-admin span { padding: 7px 12px; border: 1px solid var(--border);
  border-radius: 7px; font-size: 13px; font-weight: 700; }
.pagination-admin .current { background: var(--brand); color: #fff; border-color: var(--brand); }
