:root {
  --admin-primary: #2A5A3B;
  --admin-primary-hover: #1E422B;
  --admin-gold: #D4AF37;
  --sidebar-w: 262px;
  --bs-primary: #2A5A3B;
  --bs-primary-rgb: 42, 90, 59;
}

body { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; background: #F1F3F2; color: #1A231E; }
h1,h2,h3,h4,h5,h6 { font-weight: 700; }

.btn-primary { background: var(--admin-primary); border-color: var(--admin-primary); }
.btn-primary:hover { background: var(--admin-primary-hover); border-color: var(--admin-primary-hover); }
.text-primary { color: var(--admin-primary) !important; }
a { color: var(--admin-primary); }

/* Sidebar */
.admin-sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w); background: #1E422B; color: rgba(255,255,255,.8); overflow-y: auto; z-index: 1040; transition: transform .3s ease; }
.admin-sidebar .brand { display: flex; align-items: center; gap: .6rem; padding: 1.15rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.admin-sidebar .brand img { width: 38px; height: 38px; object-fit: contain; }
.admin-sidebar .brand strong { color: #fff; font-family: 'Playfair Display', serif; font-size: .98rem; line-height: 1.1; }
.admin-sidebar .nav-section { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.4); padding: 1.1rem 1.25rem .35rem; }
.admin-sidebar .nav-link { color: rgba(255,255,255,.78); padding: .6rem 1.25rem; display: flex; align-items: center; gap: .7rem; font-size: .92rem; font-weight: 500; border-left: 3px solid transparent; transition: background .2s ease, color .2s ease; }
.admin-sidebar .nav-link i { width: 18px; text-align: center; }
.admin-sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-sidebar .nav-link.active { background: rgba(0,0,0,.2); color: #fff; border-left-color: var(--admin-gold); }
.admin-sidebar .nav-link .badge { margin-left: auto; }

/* Main area */
.admin-main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.admin-topbar { position: sticky; top: 0; z-index: 1030; background: #fff; height: 62px; border-bottom: 1px solid #e6e9e7; display: flex; align-items: center; padding: 0 1.25rem; gap: 1rem; box-shadow: 0 1px 4px rgba(0,0,0,.03); }
.admin-content { padding: 1.75rem; flex: 1; }
.admin-footer { padding: 1rem 1.75rem; color: #6c757d; font-size: .82rem; border-top: 1px solid #e6e9e7; }

.sidebar-backdrop { display: none; }

/* Stat cards */
.stat-card { border: 1px solid #e6e9e7; border-radius: 12px; background: #fff; padding: 1.25rem; display: flex; align-items: center; gap: 1rem; transition: transform .2s ease, box-shadow .2s ease; }
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,.05); }
.stat-icon { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; color: #fff; flex: 0 0 52px; }
.stat-card .value { font-size: 1.7rem; font-weight: 800; line-height: 1; font-family: 'Playfair Display', serif; }
.stat-card .label { color: #6c757d; font-size: .82rem; }

.card { border: 1px solid #e6e9e7; border-radius: 12px; box-shadow: 0 2px 6px rgba(0,0,0,.02); }
.card-header { background: #fff; border-bottom: 1px solid #eef0ef; font-weight: 700; }

.table thead th { text-transform: uppercase; font-size: .72rem; letter-spacing: .06em; color: #6c757d; border-bottom: 2px solid #eef0ef; }
.table td { vertical-align: middle; }

.badge-status { font-size: .72rem; font-weight: 600; padding: .35rem .65rem; border-radius: 50rem; }

.form-label { font-weight: 600; font-size: .9rem; }
.form-control:focus, .form-select:focus { border-color: var(--admin-primary); box-shadow: 0 0 0 .2rem rgba(42,90,59,.15); }

/* Media grid */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
.media-tile { border: 1px solid #e6e9e7; border-radius: 10px; overflow: hidden; background: #fff; transition: box-shadow .2s ease, border-color .2s ease; }
.media-tile.selectable { cursor: pointer; }
.media-tile.selected { border-color: var(--admin-primary); box-shadow: 0 0 0 3px rgba(42,90,59,.25); }
.media-tile .thumb { aspect-ratio: 1; background: #f4f6f5; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.media-tile .thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-tile .info { padding: .5rem .6rem; }
.media-tile .info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1E422B, #2A5A3B); padding: 1.5rem; }
.login-card { background: #fff; border-radius: 16px; box-shadow: 0 20px 50px rgba(0,0,0,.25); max-width: 420px; width: 100%; padding: 2.5rem; }

@media (max-width: 991px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.show { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .sidebar-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1035; }
}
