/* ── Variables ──────────────────────────────────────────────── */
:root {
  --sidebar-w:   240px;
  --clr-sidebar: #2d1414;
  --clr-sb-hover:#3d1e1e;
  --clr-accent:  #8b3030;
  --clr-acc-hov: #6d2424;
  --clr-bg:      #f5f3f0;
  --clr-white:   #fff;
  --clr-text:    #1a1a1a;
  --clr-muted:   #6b6b6b;
  --clr-border:  #e0dbd4;
  --clr-danger:  #c0392b;
  --clr-success: #27ae60;
  --radius:      6px;
  --shadow:      0 1px 4px rgba(0,0,0,.10);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Open Sans', system-ui, sans-serif;
  background: var(--clr-bg);
  color: var(--clr-text);
  font-size: 14px;
  line-height: 1.5;
}

/* ── Login ──────────────────────────────────────────────────── */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--clr-sidebar);
}
.login-box {
  background: var(--clr-white);
  border-radius: var(--radius);
  padding: 2.5rem;
  width: 360px;
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
}
.login-box h1 {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  color: var(--clr-sidebar);
}

/* ── Layout ─────────────────────────────────────────────────── */
.admin-wrap { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--clr-sidebar);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}
.sidebar-brand {
  padding: 1.2rem 1.5rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #c4a882;
  border-bottom: 1px solid rgba(255,255,255,.08);
  white-space: nowrap;
}
.sidebar-nav { flex: 1; padding: .5rem 0; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem 1.5rem;
  color: rgba(255,255,255,.7);
  text-decoration: none;
  font-size: .875rem;
  transition: background .15s, color .15s;
}
.sidebar-nav a:hover { background: var(--clr-sb-hover); color: #fff; }
.sidebar-nav a.active { background: var(--clr-accent); color: #fff; }
.sidebar-nav a svg { flex-shrink: 0; opacity: .7; }
.sidebar-nav a.active svg,
.sidebar-nav a:hover svg { opacity: 1; }
.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.sidebar-footer a {
  color: rgba(255,255,255,.45);
  text-decoration: none;
  font-size: .8rem;
}
.sidebar-footer a:hover { color: #fff; }
.sidebar-user {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar-user-name {
  font-size: .82rem;
  font-weight: 600;
  color: rgba(255,255,255,.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  display: inline-block;
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .05em;
  padding: .1rem .45rem;
  border-radius: 10px;
  width: fit-content;
}
.role-super { background: rgba(196,168,130,.2); color: #c4a882; }
.role-admin { background: rgba(255,255,255,.1);  color: rgba(255,255,255,.55); }

.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar {
  background: var(--clr-white);
  border-bottom: 1px solid var(--clr-border);
  padding: .9rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar h1 { font-size: 1rem; font-weight: 600; }
.page-body { padding: 1.75rem; flex: 1; }

/* ── Stat cards ─────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--clr-white);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  display: block;
  transition: box-shadow .15s;
}
.stat-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,.15); }
.stat-card .num   { font-size: 2rem; font-weight: 700; color: var(--clr-accent); }
.stat-card .label { font-size: .8rem; color: var(--clr-muted); margin-top: .2rem; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .9rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: .85rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  transition: background .15s;
  white-space: nowrap;
}
.btn-primary   { background: var(--clr-accent); color: #fff; }
.btn-primary:hover { background: var(--clr-acc-hov); }
.btn-secondary { background: #e8e3de; color: var(--clr-text); }
.btn-secondary:hover { background: #d8d0c8; }
.btn-danger    { background: var(--clr-danger); color: #fff; }
.btn-danger:hover { background: #a93226; }
.btn-sm { padding: .3rem .65rem; font-size: .8rem; }

/* ── Table ──────────────────────────────────────────────────── */
.table-wrap {
  background: var(--clr-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
table { width: 100%; border-collapse: collapse; }
th {
  background: #f9f7f4;
  padding: .65rem 1rem;
  text-align: left;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--clr-muted);
  font-weight: 700;
  border-bottom: 1px solid var(--clr-border);
}
td {
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--clr-border);
  vertical-align: middle;
  font-size: .875rem;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #faf8f5; }
td .btn + .btn, td form + .btn, td .btn + form { margin-left: .35rem; }

.thumb {
  width: 48px;
  height: 60px;
  object-fit: cover;
  border-radius: 3px;
  background: #e8e3de;
  display: block;
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 50px;
  font-size: .72rem;
  font-weight: 700;
  background: #e8e3de;
  color: var(--clr-muted);
}
.badge-active    { background: #d4edda; color: #155724; }
.badge-inactive  { background: #f5e6e6; color: #721c24; }
.badge-president { background: #fff3cd; color: #856404; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-card {
  background: var(--clr-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem;
  max-width: 720px;
}
.form-row { margin-bottom: 1.1rem; }
.toggle-label {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 400;
  cursor: pointer;
}
.toggle-label input[type=checkbox] { width: 1rem; height: 1rem; cursor: pointer; }
.toggle-text { font-size: .85rem; color: #555; }
label {
  display: block;
  font-size: .83rem;
  font-weight: 600;
  margin-bottom: .35rem;
}
input[type=text],
input[type=email],
input[type=number],
input[type=url],
input[type=date],
input[type=password],
select,
textarea {
  width: 100%;
  padding: .5rem .75rem;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  font-size: .875rem;
  font-family: inherit;
  background: var(--clr-white);
  color: var(--clr-text);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--clr-accent);
  box-shadow: 0 0 0 3px rgba(139,48,48,.1);
}
textarea { resize: vertical; min-height: 100px; }
.form-check { display: flex; align-items: center; gap: .5rem; cursor: pointer; }
.form-check input[type=checkbox] { width: auto; cursor: pointer; }
.form-hint { font-size: .78rem; color: var(--clr-muted); margin-top: .3rem; }

.img-preview      { width: 80px; height: 100px; object-fit: cover; border-radius: var(--radius); margin-top: .5rem; border: 1px solid var(--clr-border); display: block; }
.img-preview-wide { width: 180px; height: 110px; object-fit: cover; border-radius: var(--radius); margin-top: .5rem; border: 1px solid var(--clr-border); display: block; }

/* ── Alerts ─────────────────────────────────────────────────── */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: .875rem;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* ── Toolbar ────────────────────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}
.toolbar span { color: var(--clr-muted); font-size: .85rem; }

/* ── Form actions ───────────────────────────────────────────── */
.form-actions {
  display: flex;
  gap: .75rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--clr-border);
}

/* ── Misc ───────────────────────────────────────────────────── */
code {
  background: #f0ece6;
  padding: .1rem .4rem;
  border-radius: 3px;
  font-size: .8rem;
}
h2.section-heading {
  font-size: .95rem;
  margin-bottom: 1rem;
  color: var(--clr-muted);
  font-weight: 600;
}
