@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --sidebar-bg: #111111;
  --sidebar-hover: #1c1c1c;
  --sidebar-active-bg: rgba(204,0,0,.12);
  --sidebar-active-border: #cc0000;
  --sidebar-width: 260px;
  --topbar-h: 64px;
  --primary: #cc0000;
  --primary-dark: #a80000;
  --bg: #f0f2f5;
  --card-bg: #ffffff;
  --border: #e4e6ea;
  --text: #1c1c1e;
  --text-muted: #6b6b6b;
  --shadow-sm: 0 1px 4px rgba(0,0,0,.07);
  --shadow: 0 2px 14px rgba(0,0,0,.1);
  --radius: 10px;
  --radius-sm: 6px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }

/* ── SIDEBAR ─────────────────────────────── */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-width); height: 100vh;
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  z-index: 1000; overflow-y: auto; overflow-x: hidden;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 2px; }

.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.sidebar-brand img { width: 40px; height: 40px; border-radius: 8px; object-fit: contain; background: #fff; padding: 2px; flex-shrink: 0; }
.sidebar-brand-name { color: #fff; font-size: 15px; font-weight: 700; line-height: 1.2; }
.sidebar-brand-sub { color: #666; font-size: 11px; margin-top: 2px; }

.sidebar-nav { flex: 1; padding: 10px 0; }

.nav-section-title {
  color: #444; font-size: 10px; font-weight: 600;
  letter-spacing: 1.2px; text-transform: uppercase;
  padding: 16px 20px 5px;
}

.sidebar-link {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 20px;
  color: #999; text-decoration: none; font-size: 13.5px; font-weight: 400;
  border-left: 3px solid transparent;
  transition: all .15s;
}
.sidebar-link:hover { color: #eee; background: var(--sidebar-hover); border-left-color: rgba(204,0,0,.3); }
.sidebar-link.active { color: #fff; background: var(--sidebar-active-bg); border-left-color: var(--sidebar-active-border); font-weight: 500; }
.sidebar-link i { width: 18px; text-align: center; font-size: 14px; flex-shrink: 0; }

.sidebar-footer { padding: 14px 20px; border-top: 1px solid rgba(255,255,255,.07); flex-shrink: 0; }
.sidebar-logout { display: flex; align-items: center; gap: 10px; color: #666; text-decoration: none; font-size: 13px; transition: color .15s; }
.sidebar-logout:hover { color: #e55; }

/* ── TOPBAR ────────────────────────────── */
.topbar {
  position: fixed; top: 0; left: var(--sidebar-width); right: 0;
  height: var(--topbar-h);
  background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; z-index: 999;
}
.topbar-title { font-size: 16px; font-weight: 600; color: var(--text); }
.topbar-breadcrumb { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.topbar-avatar { width: 36px; height: 36px; background: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.topbar-user-name { font-size: 13px; font-weight: 600; text-align: right; }
.topbar-user-role { font-size: 11px; color: var(--text-muted); text-align: right; }

/* ── MAIN ──────────────────────────────── */
.admin-main { margin-left: var(--sidebar-width); padding-top: var(--topbar-h); min-height: 100vh; }
.content-wrap { padding: 28px; }

/* ── CARDS ─────────────────────────────── */
.card-admin { background: var(--card-bg); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow-sm); margin-bottom: 24px; }
.card-admin-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.card-admin-title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-admin-title i { color: var(--primary); font-size: 15px; }
.card-admin-body { padding: 22px; }

/* ── STAT CARDS ─────────────────────────── */
.stat-cards { display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; margin-bottom: 24px; }
.stat-card { background: var(--card-bg); border-radius: var(--radius); border: 1px solid var(--border); padding: 18px 22px; display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow-sm); }
.stat-icon { width: 46px; height: 46px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 19px; flex-shrink: 0; }
.stat-icon.red { background: rgba(204,0,0,.1); color: var(--primary); }
.stat-icon.dark { background: rgba(0,0,0,.06); color: #333; }
.stat-icon.green { background: rgba(34,197,94,.1); color: #22c55e; }
.stat-icon.blue { background: rgba(59,130,246,.1); color: #3b82f6; }
.stat-value { font-size: 22px; font-weight: 700; line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 11px; color: var(--text-muted); font-weight: 500; }

/* ── QUICK LINKS ────────────────────────── */
.quick-links { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.quick-link-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 16px; text-align: center; text-decoration: none; color: var(--text); transition: box-shadow .15s, border-color .15s, transform .15s; display: block; }
.quick-link-card:hover { box-shadow: var(--shadow); border-color: #ccc; color: var(--text); transform: translateY(-2px); }
.quick-link-card i { font-size: 26px; color: var(--primary); display: block; margin-bottom: 10px; }
.quick-link-card span { font-size: 13px; font-weight: 500; display: block; margin-bottom: 3px; }
.quick-link-card small { font-size: 11px; color: var(--text-muted); }

/* ── FORMS ─────────────────────────────── */
.form-row { display: grid; gap: 18px; margin-bottom: 18px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-group { display: flex; flex-direction: column; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .4px; }
.form-input, .form-textarea, .form-select {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13.5px; color: var(--text); background: #fff;
  font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(204,0,0,.1);
}
.form-textarea { resize: vertical; min-height: 88px; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 5px; }

/* ── IMAGE UPLOAD ────────────────────────── */
.img-upload-wrap { position: relative; display: inline-block; cursor: pointer; border-radius: var(--radius-sm); overflow: hidden; }
.img-upload-wrap:hover .img-overlay { opacity: 1; }
.img-preview { display: block; object-fit: cover; background: #f5f5f5; width: 100%; }
.img-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.55); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; opacity: 0; transition: opacity .2s; color: #fff; font-size: 12px; font-weight: 500; }
.img-overlay i { font-size: 22px; }

.img-drop-zone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 30px 16px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.img-drop-zone:hover { border-color: var(--primary); background: rgba(204,0,0,.03); }
.img-drop-zone i { font-size: 30px; color: #ccc; display: block; margin-bottom: 8px; }
.img-drop-zone .drop-text { font-size: 13px; color: var(--text-muted); }
.img-drop-zone small { font-size: 11px; color: #bbb; display: block; margin-top: 4px; }

/* ── BUTTONS ─────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 500; cursor: pointer; border: none; font-family: inherit; transition: all .15s; text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-outline:hover { border-color: #999; color: var(--text); }
.btn-danger { background: transparent; color: #dc2626; border: 1px solid #fecaca; }
.btn-danger:hover { background: #fef2f2; border-color: #f87171; }
.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { padding: 7px 10px; }

/* ── SAVE BAR ────────────────────────────── */
.save-bar { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--border); padding: 14px 28px; display: flex; align-items: center; justify-content: space-between; margin: 0 -28px -28px; box-shadow: 0 -4px 14px rgba(0,0,0,.07); z-index: 100; }
.save-bar-hint { font-size: 12px; color: var(--text-muted); }

/* ── TABS ────────────────────────────────── */
.tabs-nav { display: flex; gap: 2px; border-bottom: 2px solid var(--border); margin-bottom: 24px; }
.tab-btn { padding: 10px 18px; font-size: 13.5px; font-weight: 500; color: var(--text-muted); cursor: pointer; border: none; background: none; border-bottom: 2px solid transparent; margin-bottom: -2px; font-family: inherit; transition: color .15s, border-color .15s; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── ACCORDION ────────────────────────────── */
.accordion-item { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.accordion-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: #fafafa; cursor: pointer; user-select: none; gap: 12px; }
.accordion-header:hover { background: #f4f4f4; }
.accordion-left { display: flex; align-items: center; gap: 12px; }
.accordion-num { width: 26px; height: 26px; background: var(--primary); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.accordion-title { font-size: 13.5px; font-weight: 600; }
.accordion-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.accordion-arrow { color: var(--text-muted); transition: transform .2s; font-size: 13px; }
.accordion-arrow.open { transform: rotate(180deg); }
.accordion-body { padding: 20px; border-top: 1px solid var(--border); display: none; }
.accordion-body.open { display: block; }

/* ── ITEM LIST (services, testimonials…) ─── */
.item-list { display: flex; flex-direction: column; gap: 14px; }
.item-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.item-card-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: #fafafa; border-bottom: 1px solid var(--border); }
.item-card-name { font-size: 13.5px; font-weight: 600; }
.item-card-body { padding: 18px; }
.item-actions { display: flex; gap: 6px; }

/* ── BADGE ────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge-active { background: rgba(34,197,94,.12); color: #16a34a; }
.badge-inactive { background: rgba(239,68,68,.1); color: #dc2626; }

/* ── TOGGLE ───────────────────────────────── */
.toggle-row { display: flex; align-items: center; gap: 10px; }
.toggle { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track { position: absolute; inset: 0; background: #ccc; border-radius: 22px; cursor: pointer; transition: background .15s; }
.toggle-track::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; }
.toggle input:checked ~ .toggle-track { background: var(--primary); }
.toggle input:checked ~ .toggle-track::before { transform: translateX(18px); }
.toggle-label { font-size: 13.5px; color: var(--text); }

/* ── DIVIDER ──────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.section-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── LOGIN ────────────────────────────────── */
.login-body { background: #111; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { background: #fff; border-radius: 16px; padding: 38px 36px; width: 100%; max-width: 400px; box-shadow: 0 24px 64px rgba(0,0,0,.5); }
.login-header { text-align: center; margin-bottom: 30px; }
.login-header img { width: 52px; border-radius: 10px; margin-bottom: 12px; }
.login-header h1 { font-size: 20px; font-weight: 700; }
.login-header p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.login-form .form-group { margin-bottom: 16px; }

/* ── ICON PICKER ──────────────────────────── */
.icon-preview-wrap { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.icon-preview-box { width: 44px; height: 44px; border: 1px solid var(--border); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--primary); background: #fafafa; }

/* ── UTILITY ──────────────────────────────── */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.fw-600 { font-weight: 600; }
.w-full { width: 100%; }

/* ── FLASH ALERT ──────────────────────────── */
.flash { display:flex; align-items:center; gap:10px; padding:12px 18px; border-radius:var(--radius-sm); font-size:13.5px; margin-bottom:20px; }
.flash-success { background:#f0fdf4; color:#16a34a; border:1px solid #bbf7d0; }
.flash-error   { background:#fef2f2; color:#dc2626; border:1px solid #fecaca; }

/* ── TOAST NOTIFICATIONS ─────────────────── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999; display: flex; flex-direction: column;
  gap: 10px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border-radius: var(--radius);
  font-size: 13.5px; font-weight: 500;
  min-width: 280px; max-width: 420px;
  box-shadow: 0 4px 20px rgba(0,0,0,.18);
  pointer-events: all;
  transform: translateX(120%); opacity: 0;
  transition: transform .3s ease, opacity .3s ease;
}
.toast.toast-show { transform: translateX(0); opacity: 1; }
.toast.toast-hide { transform: translateX(120%); opacity: 0; }
.toast-success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.toast-error   { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.toast-warning { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.toast-info    { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.toast i:first-child { font-size: 15px; flex-shrink: 0; }
.toast-msg { flex: 1; line-height: 1.4; }
.toast-close { background: none; border: none; cursor: pointer; padding: 2px 4px; color: inherit; opacity: .55; font-size: 11px; flex-shrink: 0; transition: opacity .15s; }
.toast-close:hover { opacity: 1; }

/* ── PAGE PROGRESS BAR ───────────────────── */
#page-progress {
  position: fixed; top: 0; left: 0;
  height: 3px; width: 0%;
  background: var(--primary);
  z-index: 99999;
  transition: width .25s ease, opacity .4s ease;
  opacity: 0;
  border-radius: 0 2px 2px 0;
}
#page-progress.active { opacity: 1; }
#page-progress.progress-error { background: #dc2626; }

/* ── FORM SUBMIT SPINNER ─────────────────── */
@keyframes admin-spin { to { transform: rotate(360deg); } }
.fa-spin-admin { display: inline-block; animation: admin-spin .7s linear infinite; }

/* ── RESPONSIVE ───────────────────────────── */
@media (max-width: 1200px) { .stat-cards, .quick-links { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 768px) { .form-row.cols-2, .form-row.cols-3 { grid-template-columns: 1fr; } }
