/* ============================================================
   Kwanza Africa — Admin panel
   ============================================================ */
:root {
    --brown: #46250C;
    --brown-deep: #2E1706;
    --orange: #F15A24;
    --orange-soft: #FDEBE0;
    --red: #DE3831;
    --cream: #FAF4EC;
    --sand: #F3E9DC;
    --line: #EADFCF;
    --ink: #33200F;
    --text: #5C4A3A;
    --shadow-sm: 0 4px 14px rgba(70, 37, 12, 0.08);
    --font-display: "Fraunces", Georgia, serif;
    --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-body); background: var(--cream); color: var(--text); font-size: 15.5px; line-height: 1.6; }
img { max-width: 100%; }
a { color: var(--orange); text-decoration: none; }
a:hover { color: var(--red); }
h1, h2 { font-family: var(--font-display); color: var(--ink); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font: 700 14px var(--font-body); padding: 11px 20px; border-radius: 999px;
    border: 2px solid transparent; cursor: pointer; transition: background .18s, color .18s, transform .18s;
}
.btn:active { transform: scale(.96); }
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--red); color: #fff; }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--orange); color: #fff; }
.btn-brown { background: var(--brown); color: #fff; }
.btn-brown:hover { background: var(--brown-deep); color: #fff; }
.btn-outline { border-color: var(--brown); color: var(--brown); background: none; }
.btn-outline:hover { background: var(--brown); color: #fff; }
.btn-danger { background: #fff; color: var(--red); border-color: #F4C6C1; }
.btn-danger:hover { background: var(--red); border-color: var(--red); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-block { width: 100%; }

/* Shell */
.admin-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.admin-side {
    background: var(--brown-deep); color: #D8C7B5; padding: 22px 14px;
    display: flex; flex-direction: column; gap: 26px; position: sticky; top: 0; height: 100vh;
}
.admin-brand { display: block; background: #fff; border-radius: 12px; padding: 10px 12px; }
.admin-brand img { height: 40px; width: auto; display: block; }
.admin-side nav { display: grid; gap: 4px; flex: 1; align-content: start; }
.admin-side nav a, .admin-side-foot a {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px;
    color: #D8C7B5; font-weight: 600; font-size: 14.5px; transition: background .18s, color .18s;
}
.admin-side nav a svg, .admin-side-foot a svg { width: 20px; height: 20px; flex: 0 0 20px; }
.admin-side nav a:hover, .admin-side-foot a:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-side nav a.active { background: var(--orange); color: #fff; }
.admin-side .pill { margin-left: auto; background: var(--red); color: #fff; font-size: 11.5px; font-weight: 800; border-radius: 999px; padding: 2px 9px; }
.admin-side-foot { display: grid; gap: 4px; border-top: 1px solid rgba(255,255,255,.12); padding-top: 14px; }

.admin-main { padding: 26px clamp(18px, 3vw, 42px) 60px; min-width: 0; }
.admin-top { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 24px; flex-wrap: wrap; }
.admin-top h1 { font-size: 30px; }
.admin-user { font-size: 13.5px; }

/* Panels & tiles */
.panel { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 24px; box-shadow: var(--shadow-sm); margin-bottom: 24px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.panel-head h2 { font-size: 20px; }

.stat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.tile {
    background: var(--orange); color: #fff; border-radius: 18px; padding: 22px;
    display: grid; gap: 2px; transition: transform .2s; box-shadow: var(--shadow-sm);
}
.tile:hover { transform: translateY(-4px); color: #fff; }
.tile strong { font-family: var(--font-display); font-size: 34px; line-height: 1; }
.tile span { font-size: 13.5px; font-weight: 700; opacity: .92; }
.tile-red { background: var(--red); }
.tile-brown { background: var(--brown); }
.tile-sand { background: var(--brown-deep); }

.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.quick-actions form { display: inline; }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--text); padding: 10px 12px; border-bottom: 2px solid var(--line); }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.thumb { width: 70px; height: 48px; object-fit: cover; border-radius: 8px; display: block; }
.thumb-round { width: 52px; height: 52px; border-radius: 50%; object-position: top center; }
.thumb-lg { width: 200px; border-radius: 10px; margin-top: 10px; display: block; }
.td-title { font-weight: 600; color: var(--ink); }
.td-actions { display: flex; gap: 8px; align-items: center; }

.tag { display: inline-block; background: var(--sand); color: var(--brown); font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.tag-red { background: #FDE9E7; color: var(--red); }
.tag-green { background: #E8F5E4; color: #24632B; }
.tag-gray { background: #EEE9E2; color: #7A6A5B; }

.filter-tabs { display: flex; gap: 6px; }
.filter-tabs a { padding: 9px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--ink); border: 1.6px solid var(--line); }
.filter-tabs a.active { background: var(--brown); border-color: var(--brown); color: #fff; }

/* Forms */
.form-grid { display: grid; gap: 16px; }
.form-wide { max-width: 860px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { font-weight: 700; font-size: 13.5px; color: var(--ink); display: block; margin-bottom: 6px; }
label small { font-weight: 500; color: var(--text); }
input[type=text], input[type=email], input[type=password], input[type=datetime-local], select, textarea {
    width: 100%; padding: 12px 14px; border: 1.6px solid var(--line); border-radius: 11px;
    font: 500 15px var(--font-body); color: var(--ink); background: var(--cream);
}
input[type=file] { font: 500 14px var(--font-body); padding: 10px 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); background: #fff; }
textarea { resize: vertical; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14.5px; padding: 12px 0; }
.check input { width: 18px; height: 18px; accent-color: var(--orange); }

.alert { padding: 13px 17px; border-radius: 11px; font-weight: 600; font-size: 14px; margin-bottom: 16px; }
.alert-ok { background: #E8F5E4; color: #24632B; border: 1px solid #BFE3B8; }
.alert-err { background: #FDE9E7; color: #96271F; border: 1px solid #F4C6C1; }

.empty { text-align: center; padding: 40px; color: var(--text); font-weight: 600; border: 1.6px dashed var(--line); border-radius: 14px; }

/* Admin gallery grid */
.admin-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.ag-card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--cream); }
.ag-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.ag-body { padding: 12px 14px; display: grid; gap: 8px; font-size: 13.5px; justify-items: start; }
.ag-body strong { color: var(--ink); }

/* Messages */
.msg-list { display: grid; gap: 14px; }
.msg { border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: var(--cream); }
.msg-unread { border-color: var(--orange); background: var(--orange-soft); }
.msg header { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; font-size: 14px; }
.msg header strong { color: var(--ink); }
.msg time { color: var(--text); font-size: 13px; }
.msg-subject { font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.msg footer { margin-top: 12px; }

/* Login */
.login-body { display: grid; place-items: center; min-height: 100vh; background: var(--brown-deep); padding: 20px; }
.login-card { background: #fff; border-radius: 22px; padding: 40px 36px; width: min(420px, 100%); box-shadow: 0 24px 70px rgba(0,0,0,.3); }
.login-logo { background: #fff; text-align: center; margin-bottom: 20px; }
.login-logo img { height: 52px; width: auto; display: inline-block; }
.login-card h1 { font-size: 26px; text-align: center; }
.login-sub { text-align: center; font-size: 14px; margin: 6px 0 22px; }
.login-foot { text-align: center; margin-top: 18px; font-size: 14px; }

@media (max-width: 900px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
    .admin-side nav { display: flex; flex-wrap: wrap; flex: 1 1 100%; }
    .admin-side-foot { display: flex; border-top: 0; padding-top: 0; }
    .stat-tiles { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }
    .table { display: block; overflow-x: auto; }
}
