/* Money Bagh Admin — entry stylesheet */
@import url("css/admin-tokens.css");
@import url("css/admin-components.css");

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background: var(--page-bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.45;
}

[hidden] {
  display: none !important;
}

/* ===== App shell — dark sidebar SaaS ===== */
.admin-app { min-height: 100vh; background: var(--page-bg); }

.admin-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(28, 21, 19, 0.45);
  z-index: 35;
}
.admin-shell.sidebar-open .sidebar-backdrop {
  display: block;
}
@media (min-width: 900px) {
  .admin-shell.sidebar-open .sidebar-backdrop { display: none; }
}

.admin-sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-end) 100%);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  transform: translateX(-100%);
  transition: transform 0.22s var(--ease);
  box-shadow: var(--shadow-lg);
}
.admin-shell.sidebar-open .admin-sidebar { transform: translateX(0); }

@media (min-width: 900px) {
  .admin-sidebar {
    transform: none;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: none;
  }
  .sidebar-toggle { display: none !important; }
}

.sidebar-brand {
  padding: 22px 18px 16px;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}
.sidebar-brand strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 17px;
  color: #fff;
  line-height: 1.2;
}
.sidebar-brand span {
  font-size: 12px;
  opacity: 0.65;
  color: var(--sidebar-text);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 10px;
  flex: 1;
  overflow-y: auto;
}
.nav-group-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.45;
  padding: 12px 12px 6px;
  color: #fff;
}
.nav-group-label:first-child { padding-top: 4px; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--sidebar-text);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  border-left: 3px solid transparent;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.sidebar-link i[data-lucide] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
}
.sidebar-link:hover {
  background: var(--sidebar-hover);
  color: #fff;
}
.sidebar-link.is-active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-text-active);
  border-left-color: var(--sidebar-active);
}
.sidebar-link.is-active i[data-lucide] { opacity: 1; color: var(--accent); }

.sidebar-foot {
  padding: 14px;
  border-top: 1px solid var(--sidebar-border);
}
.sidebar-user {
  font-size: 12px;
  opacity: 0.8;
  margin-bottom: 8px;
  word-break: break-all;
  color: var(--sidebar-text);
}
.sidebar-foot .btn-ghost {
  width: 100%;
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}
.sidebar-foot .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

.admin-main-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--page-bg);
}

.admin-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  min-height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: var(--shadow-sm);
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.page-title {
  font-family: var(--font-heading);
  font-size: 20px;
  color: var(--brown);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.breadcrumb {
  display: none;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
@media (min-width: 640px) {
  .breadcrumb { display: block; }
}
.breadcrumb span { opacity: 0.7; }
.breadcrumb strong { color: var(--brown); font-weight: 600; }

.sidebar-toggle {
  border: 1.5px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  flex-shrink: 0;
}
.sidebar-toggle i[data-lucide] { width: 20px; height: 20px; }

.admin-app .admin-main {
  max-width: var(--content-max);
  width: 100%;
  margin: 0 auto;
  padding: 20px 16px 48px;
}
@media (min-width: 900px) {
  .admin-app .admin-main { padding: 24px 28px 56px; }
}

/* Builder full-bleed */
.admin-main:has(.builder-page) {
  max-width: none;
  padding-left: 12px;
  padding-right: 12px;
}
