/* ================= Admin Panel Styles ================= */
:root {
  --admin-primary: #7a1d2c;
  --admin-dark: #241416;
  --admin-bg: #f4f5f7;
  --admin-border: #e3e3e8;
  --admin-text: #2b2b2b;
  --admin-muted: #7a7a85;
  --radius: 8px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Segoe UI', Arial, sans-serif; background: var(--admin-bg); color: var(--admin-text); font-size: 14.5px; }
a { color: var(--admin-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ---- Login page ---- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #7a1d2c, #241416); }
.login-box { background: #fff; padding: 40px; border-radius: 12px; width: 100%; max-width: 380px; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.login-logo { height: 60px; margin: 0 auto 14px; }
.login-box h1 { font-size: 19px; margin: 0 0 4px; color: var(--admin-primary); }
.login-sub { color: var(--admin-muted); margin: 0 0 22px; font-size: 13px; }
.login-back { margin-top: 18px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---- Layout ---- */
.admin-wrap { display: flex; min-height: 100vh; }
.sidebar { width: 250px; background: var(--admin-dark); color: #eee; flex-shrink: 0; }
.sidebar-brand { padding: 20px; font-weight: 700; font-size: 16px; border-bottom: 1px solid rgba(255,255,255,.08); color: #fff; }
.sidebar-brand span { display: block; font-size: 11.5px; font-weight: 400; color: #c9a; opacity: .8; margin-top: 3px; }
.sidebar nav { padding: 10px 0; }
.sidebar .group-label { padding: 16px 20px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: #a89; }
.sidebar a.nav-link { display: block; padding: 10px 20px; color: #ddd; font-size: 14px; border-left: 3px solid transparent; }
.sidebar a.nav-link:hover, .sidebar a.nav-link.active { background: rgba(255,255,255,.08); color: #fff; border-left-color: var(--admin-secondary, #f5a623); text-decoration: none; }

.main-col { flex: 1; min-width: 0; }
.admin-topbar { background: #fff; border-bottom: 1px solid var(--admin-border); padding: 14px 26px; display: flex; justify-content: space-between; align-items: center; }
.admin-topbar h1 { font-size: 18px; margin: 0; }
.admin-user { font-size: 13.5px; color: var(--admin-muted); display: flex; align-items: center; gap: 14px; }
.badge-role { background: var(--admin-primary); color: #fff; padding: 2px 10px; border-radius: 20px; font-size: 11px; text-transform: uppercase; }
.admin-content { padding: 26px; }

/* ---- Cards / panels ---- */
.card { background: #fff; border: 1px solid var(--admin-border); border-radius: var(--radius); padding: 22px; margin-bottom: 22px; }
.card h2 { font-size: 16px; margin: 0 0 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2,1fr); } .grid-2 { grid-template-columns: 1fr; } }

.stat-card { background: #fff; border: 1px solid var(--admin-border); border-radius: var(--radius); padding: 20px; }
.stat-card .num { font-size: 28px; font-weight: 700; color: var(--admin-primary); }
.stat-card .lbl { color: var(--admin-muted); font-size: 13px; }

/* ---- Buttons ---- */
.btn { display: inline-block; background: var(--admin-primary); color: #fff; border: none; padding: 9px 18px; border-radius: 5px; cursor: pointer; font-size: 13.5px; font-weight: 500; }
.btn:hover { background: #5c1420; text-decoration: none; color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 12.5px; }
.btn-secondary { background: #6c6c76; }
.btn-secondary:hover { background: #52525a; }
.btn-danger { background: #c0392b; }
.btn-danger:hover { background: #922019; }
.btn-outline { background: #fff; color: var(--admin-primary); border: 1px solid var(--admin-primary); }
.btn-outline:hover { background: var(--admin-primary); color: #fff; }

/* ---- Forms ---- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 13.5px; }
.form-group .hint { color: var(--admin-muted); font-size: 12px; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=color], input[type=file], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--admin-border); border-radius: 5px; font-size: 14px; font-family: inherit;
}
textarea { min-height: 120px; resize: vertical; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }

/* ---- Tables ---- */
table.admin-table { width: 100%; border-collapse: collapse; background: #fff; }
table.admin-table th, table.admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--admin-border); text-align: left; font-size: 13.8px; vertical-align: middle; }
table.admin-table th { background: #faf7f5; font-weight: 600; }
table.admin-table img.thumb { width: 60px; height: 44px; object-fit: cover; border-radius: 4px; }
.actions-cell { display: flex; gap: 8px; white-space: nowrap; }
.status-pill { padding: 2px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.status-active { background: #e3f7e6; color: #1c7a34; }
.status-inactive { background: #f5e3e3; color: #a02020; }

/* ---- Alerts ---- */
.alert { padding: 12px 18px; border-radius: 6px; margin-bottom: 18px; font-size: 14px; }
.alert-success { background: #e6f7ea; color: #146c2e; border: 1px solid #b7e3c4; }
.alert-error { background: #fdecec; color: #a02020; border: 1px solid #f3b9b9; }
.alert-info { background: #eaf2fb; color: #1a4f8a; border: 1px solid #b9d4f3; }

.top-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
.color-swatch { display: inline-block; width: 22px; height: 22px; border-radius: 4px; vertical-align: middle; margin-right: 8px; border: 1px solid #ddd; }
.tree-item { margin-bottom: 4px; }
.tree-child { margin-left: 26px; border-left: 2px dashed var(--admin-border); padding-left: 14px; }

/* ---- Custom Quill toolbar buttons (Attach File / Insert Button / Insert Table) ---- */
.ql-toolbar button:not([class]) { border: 1px solid #ccc; border-radius: 3px; background: #fff; cursor: pointer; margin: 2px; height: 28px; width: 32px; font-size: 14px; }
.ql-toolbar button:not([class]):hover { background: #f0f0f0; }
