/* ============================================================
   Restaurant CMS - Admin Panel styles (Bootstrap 5 + custom)
   Light/Dark aware via [data-bs-theme].
   ============================================================ */

:root {
  --cms-sidebar-w: 260px;
  --cms-brand: #e11d48;
  --cms-brand-2: #f43f5e;
  --cms-radius: 14px;
}

* { -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bs-body-bg);
}

/* ---------- Layout ---------- */
.cms-wrapper { display: flex; min-height: 100vh; }

.cms-sidebar {
  width: var(--cms-sidebar-w);
  position: fixed; inset: 0 auto 0 0;
  background: linear-gradient(180deg, #1e293b, #0f172a);
  color: #cbd5e1;
  display: flex; flex-direction: column;
  z-index: 1040;
  transition: transform .25s ease;
  overflow-y: auto;
}
.cms-sidebar .brand {
  padding: 1.15rem 1.25rem;
  font-weight: 700; font-size: 1.15rem; color: #fff;
  display: flex; align-items: center; gap: .6rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.cms-sidebar .brand .dot {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--cms-brand), var(--cms-brand-2));
  display: grid; place-items: center; color: #fff; font-size: 1rem;
}
.cms-nav { padding: .75rem .6rem; list-style: none; margin: 0; flex: 1; }
.cms-nav .nav-label {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .08em;
  color: #64748b; padding: .9rem .75rem .35rem; font-weight: 600;
}
.cms-nav a {
  display: flex; align-items: center; gap: .7rem;
  padding: .6rem .75rem; margin: .12rem 0;
  color: #cbd5e1; text-decoration: none; border-radius: 10px;
  font-size: .92rem; font-weight: 500; transition: all .15s;
}
.cms-nav a i { width: 20px; text-align: center; font-size: 1rem; }
.cms-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.cms-nav a.active {
  background: linear-gradient(135deg, var(--cms-brand), var(--cms-brand-2));
  color: #fff; box-shadow: 0 6px 16px -6px rgba(225,29,72,.6);
}

.cms-main {
  flex: 1; margin-left: var(--cms-sidebar-w);
  display: flex; flex-direction: column; min-width: 0;
}
.cms-topbar {
  height: 64px; position: sticky; top: 0; z-index: 1030;
  background: var(--bs-body-bg);
  border-bottom: 1px solid var(--bs-border-color);
  display: flex; align-items: center; gap: 1rem;
  padding: 0 1.25rem;
}
.cms-content { padding: 1.5rem; flex: 1; }

/* ---------- Cards ---------- */
.card { border: 1px solid var(--bs-border-color); border-radius: var(--cms-radius); }
.stat-card { overflow: hidden; position: relative; }
.stat-card .icon {
  width: 52px; height: 52px; border-radius: 13px;
  display: grid; place-items: center; font-size: 1.35rem; color: #fff;
}
.stat-card .value { font-size: 1.75rem; font-weight: 700; line-height: 1; }
.stat-card .label { color: var(--bs-secondary-color); font-size: .82rem; }

.bg-grad-1 { background: linear-gradient(135deg,#6366f1,#8b5cf6); }
.bg-grad-2 { background: linear-gradient(135deg,#e11d48,#f43f5e); }
.bg-grad-3 { background: linear-gradient(135deg,#0ea5e9,#22d3ee); }
.bg-grad-4 { background: linear-gradient(135deg,#f59e0b,#f97316); }
.bg-grad-5 { background: linear-gradient(135deg,#10b981,#34d399); }

/* ---------- Menu section cards ---------- */
.menu-section-card .thumb {
  height: 150px; border-radius: 10px; object-fit: cover; width: 100%;
  background: var(--bs-tertiary-bg);
}
.dropzone {
  border: 2px dashed var(--bs-border-color); border-radius: 12px;
  padding: 1.75rem; text-align: center; cursor: pointer;
  transition: all .2s; background: var(--bs-tertiary-bg);
}
.dropzone.dragover { border-color: var(--cms-brand); background: rgba(225,29,72,.05); }

/* ---------- Gallery ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(180px,1fr)); gap: 1rem; }
.gallery-item {
  border: 1px solid var(--bs-border-color); border-radius: 12px; overflow: hidden;
  position: relative; background: var(--bs-body-bg);
}
.gallery-item img { width: 100%; height: 160px; object-fit: cover; display: block; }
.gallery-item .meta { padding: .55rem .7rem; }
.gallery-item .actions {
  position: absolute; top: .5rem; right: .5rem; display: flex; gap: .3rem;
  opacity: 0; transition: opacity .2s;
}
.gallery-item:hover .actions { opacity: 1; }
.gallery-item .form-check { position: absolute; top: .5rem; left: .5rem; }
.gallery-item.sortable-ghost { opacity: .4; }

/* ---------- Login ---------- */
.auth-page {
  min-height: 100vh; display: grid; place-items: center;
  background: linear-gradient(135deg,#1e293b,#0f172a); padding: 1rem;
}
.auth-card { width: 100%; max-width: 420px; border-radius: 18px; }
.auth-brand-dot {
  width: 56px; height: 56px; border-radius: 15px; margin: 0 auto;
  background: linear-gradient(135deg,var(--cms-brand),var(--cms-brand-2));
  display: grid; place-items: center; color: #fff; font-size: 1.5rem;
}

/* ---------- Misc ---------- */
.table > :not(caption) > * > * { padding: .75rem .9rem; }
.avatar-sm { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.cursor-pointer { cursor: pointer; }
.spinner-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 2000;
  display: none; place-items: center;
}
.spinner-overlay.show { display: grid; }

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