:root {
  --font-sans: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

  /* Admin palette (Plesk-ish) */
  --sidebar-bg: #1f2937;   /* slate-800 */
  --sidebar-bg-2: #111827; /* slate-900 */
  --sidebar-text: #e5e7eb; /* gray-200 */
  --sidebar-muted: rgba(229, 231, 235, .7);

  --content-bg: #f9fafb;   /* gray-50 */
  --card-border: #e5e7eb;  /* gray-200 */
}

html, body { height: 100%; }

body {
  font-family: var(--font-sans);
  background: var(--content-bg);
}

/* App layout */
.app {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
  color: var(--sidebar-text);
  border-right: 1px solid rgba(255, 255, 255, .06);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.sidebar__brand {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
}

.brand__mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, .18);
  border: 1px solid rgba(59, 130, 246, .35);
  color: #fff;
  font-weight: 800;
}

.brand__text {
  font-weight: 800;
  letter-spacing: .2px;
}

.sidebar__section {
  padding: 14px 12px;
  overflow: auto;
}

.sidebar__title {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--sidebar-muted);
  padding: 8px 10px;
}

.sidebar__nav .sidebar__link {
  display: flex;
  align-items: center;
  padding: 10px 10px;
  border-radius: 10px;
  color: var(--sidebar-text);
  text-decoration: none;
  margin: 2px 0;
}

.sidebar__nav .sidebar__link:hover {
  background: rgba(255, 255, 255, .06);
}

.sidebar__nav .sidebar__link.active {
  background: rgba(59, 130, 246, .18);
  border: 1px solid rgba(59, 130, 246, .28);
}

.sidebar__footer {
  margin-top: auto;
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
}

/* Content */
.content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 56px;
  background: #fff;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.btn-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--card-border);
  background: #fff;
  border-radius: 10px;
}

.btn-icon:hover { background: #f3f4f6; }

.topbar__search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--card-border);
  background: #fff;
  border-radius: 10px;
  padding: 6px 10px;
  width: 320px;
}

.topbar__search input {
  outline: none !important;
  box-shadow: none !important;
  padding: 0;
}

.topbar__search .dropdown-menu {
  top: calc(100% + 6px); /* distanza sotto l'input */
}

.breadcrumb-mini { font-size: .92rem; }
.breadcrumb-mini .fw-semibold {
  color: #111;
}

/* Main */
.main { padding: 18px; }

.page-title {
  font-size: 1.35rem;
  font-weight: 800;
}

/* Cards */
.card-soft {
  border: 1px solid var(--card-border);
  border-radius: 14px;
}

.icon-pill {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.kpi-label {
  color: #6b7280;
  font-size: .85rem;
}

.kpi-value {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -.02em;
}

.kpi-sub {
  font-size: .85rem;
  margin-top: 2px;
}

/* Activity list */
.list-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

/* Offcanvas sidebar */
.sidebar-offcanvas {
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
  color: var(--sidebar-text);
  width: 280px;
}

.sidebar-offcanvas .offcanvas-header {
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.sidebar-offcanvas .sidebar__title,
.sidebar-offcanvas .sidebar__link {
  color: var(--sidebar-text);
}

/* 🔧 Fix utile se l’offcanvas finisce dietro altri layer */
.offcanvas { z-index: 2000; }
.offcanvas-backdrop { z-index: 1990; }

/* Responsive */
@media (max-width: 991.98px) {
  .app { grid-template-columns: 1fr; }
  .topbar__search { width: 220px; }
}
