:root {
  --brand: #e6212e;
  --dark: #1b1b23;
  --bg: #f4f5f8;
  --border: #e1e3e8;
}
* { box-sizing: border-box; }
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  margin: 0;
  color: #2b2b33;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.admin-wrap { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 230px;
  background: var(--dark);
  color: #fff;
  flex-shrink: 0;
  padding: 20px 0;
}
.admin-sidebar .brand {
  padding: 0 20px 20px;
  font-size: 18px;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: 10px;
}
.admin-sidebar .brand span { color: var(--brand); }
.admin-sidebar nav a {
  display: block;
  padding: 12px 20px;
  color: #cfcfd6;
  font-size: 14px;
}
.admin-sidebar nav a:hover, .admin-sidebar nav a.active {
  background: rgba(230,33,46,.15);
  color: #fff;
  text-decoration: none;
  border-left: 3px solid var(--brand);
}

.admin-main { flex: 1; min-width: 0; }
.admin-topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 14px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.admin-content { padding: 30px; }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.btn {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 5px;
  border: none;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
}
.btn:hover { background: #c81c28; text-decoration: none; color: #fff; }
.btn-secondary { background: #6c757d; }
.btn-secondary:hover { background: #565e64; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-danger { background: #b91c2b; }

table { width: 100%; border-collapse: collapse; }
table th, table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 14px;
  vertical-align: middle;
}
table th { background: #fafafc; font-weight: 600; }
table img.thumb { width: 60px; height: 45px; object-fit: cover; border-radius: 4px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 13px; }
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 14px;
}
textarea.form-control { min-height: 110px; }
.row-flex { display: flex; gap: 20px; flex-wrap: wrap; }
.row-flex .form-group { flex: 1; min-width: 220px; }

.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 18px; font-size: 14px; }
.alert-success { background: #d4edda; color: #155724; }
.alert-danger { background: #f8d7da; color: #721c24; }

.stat-cards { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 10px; }
.stat-card {
  flex: 1; min-width: 180px;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: 20px;
}
.stat-card .num { font-size: 28px; font-weight: 700; color: var(--brand); }
.stat-card .label { color: #666; font-size: 13px; margin-top: 4px; }

.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1b1b23, #2c2c38);
}
.login-box {
  background: #fff; padding: 40px; border-radius: 10px; width: 100%; max-width: 380px;
  box-shadow: 0 20px 50px rgba(0,0,0,.3);
}
.login-box h1 { font-size: 20px; margin: 0 0 4px; }
.login-box p.sub { color: #777; margin: 0 0 24px; font-size: 13px; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-published { background: #d4edda; color: #155724; }
.badge-draft { background: #eee; color: #555; }
.badge-unread { background: #fff3cd; color: #856404; }

/* Franchise application statuses */
.badge-new { background: #fff3cd; color: #856404; }
.badge-under_review { background: #dbe9ff; color: #2456a1; }
.badge-approved { background: #d4edda; color: #155724; }
.badge-rejected { background: #f8d7da; color: #721c24; }
.badge-on_hold { background: #eee; color: #555; }
.badge-converted { background: #1f272b; color: #fff; }

/* Centre statuses */
.badge-active { background: #d4edda; color: #155724; }
.badge-pending { background: #fff3cd; color: #856404; }
.badge-under-review { background: #dbe9ff; color: #2456a1; }
.badge-renewal-due { background: #ffe5cc; color: #a15c00; }
.badge-suspended { background: #f8d7da; color: #721c24; }
.badge-closed { background: #eee; color: #555; }

.remarks-log { border: 1px solid #eee; border-radius: 8px; padding: 14px 16px; margin-bottom: 16px; max-height: 260px; overflow-y: auto; }
.remarks-log .remark-item { padding: 8px 0; border-bottom: 1px solid #f2f2f2; font-size: 13.5px; }
.remarks-log .remark-item:last-child { border-bottom: none; }
.remarks-log .remark-meta { color: #999; font-size: 11.5px; margin-top: 3px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 24px; margin-bottom: 16px; }
.detail-grid .dl-item { padding: 6px 0; border-bottom: 1px solid #f2f2f2; font-size: 13.5px; }
.detail-grid .dl-item strong { display: block; font-size: 11px; text-transform: uppercase; color: #999; letter-spacing: .4px; margin-bottom: 2px; }
.file-link { display: inline-block; margin-right: 12px; font-size: 13px; }
.status-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.status-actions form { display: inline; }

.actions a { margin-right: 10px; }

/* Centre profile page */
.profile-header { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; }
.profile-header .profile-photo {
  width: 96px; height: 96px; border-radius: 10px; object-fit: cover;
  border: 1px solid var(--border); flex-shrink: 0;
}
.profile-header .profile-main { flex: 1; min-width: 220px; }
.profile-header h2 { margin: 0 0 6px; font-size: 22px; }
.profile-header .profile-meta { color: #666; font-size: 13.5px; margin: 4px 0; }
.profile-header .profile-meta i { width: 16px; text-align: center; margin-right: 6px; color: var(--brand); }
.profile-header .profile-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.profile-header .profile-badges { margin: 6px 0; display: flex; gap: 8px; flex-wrap: wrap; }

.section-title {
  font-size: 15px; font-weight: 700; margin: 0 0 14px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.profile-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
@media (max-width: 900px) { .profile-grid { grid-template-columns: 1fr; } }

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tag-list li {
  background: #f4f5f8; border: 1px solid var(--border); border-radius: 20px;
  padding: 4px 12px; font-size: 12.5px; color: #444;
}
.empty-note { color: #999; font-size: 13.5px; }
