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

:root {
  --theme-accent: #33aaee;
  --theme-accent-hover: #268ecb;
  --theme-accent-soft: rgba(51, 170, 238, 0.06);
  --theme-bg: #f8fafc;
  --theme-surface: #ffffff;
  --theme-surface-hover: #f1f5f9;
  --theme-text: #0f172a;
  --theme-muted: #64748b;
  --theme-border: #e2e8f0;
  --theme-danger: #ef4444;
  --theme-danger-soft: rgba(239, 68, 68, 0.08);
  --theme-ok: #10b981;
  --theme-ok-soft: rgba(16, 185, 129, 0.08);
  --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 28px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 22px 50px rgba(15, 23, 42, 0.08);
  --radius-xl: 16px;
  --radius-lg: 13px;
  --radius-md: 10px;
  --radius-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --admin-page-pad-x: 42px;
  --admin-sidebar-width: 234px;
  --admin-shell-gap: 36px;
}

*, *::before, *::after { box-sizing: border-box; }

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  background: var(--theme-bg);
  overflow-x: clip;
}

html {
  font-size: 90%;
}

body {
  font-family: var(--font);
  color: var(--theme-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body[data-page="admin"] {
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--theme-border);
  border-radius: var(--radius-md);
  background: var(--theme-surface);
  color: var(--theme-text);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--theme-accent);
  box-shadow: 0 0 0 3px var(--theme-accent-soft);
}

textarea {
  resize: vertical;
}

.hidden {
  display: none !important;
}

.glass-card {
  background: var(--theme-surface);
  border: 1px solid var(--theme-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.eyebrow {
  margin: 0 0 6px;
  letter-spacing: .07em;
  text-transform: uppercase;
  font-size: .76rem;
  font-weight: 700;
  color: var(--theme-muted);
}

.muted {
  color: var(--theme-muted) !important;
}

.small-label {
  font-size: .8rem;
  font-weight: 500;
  color: var(--theme-muted);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.12;
  color: var(--theme-text);
  font-weight: 600;
}

p {
  margin: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
  transition: all .2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--theme-accent);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--theme-accent-hover);
}

.btn-soft,
.btn-secondary {
  background: var(--theme-surface);
  color: var(--theme-text);
  border-color: var(--theme-border);
}

.btn-soft:hover,
.btn-secondary:hover {
  background: var(--theme-accent);
  border-color: var(--theme-accent);
  color: #ffffff;
}

.btn-block {
  width: 100%;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  font-size: .9rem;
  font-weight: 500;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.helper {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--theme-border);
  background: var(--theme-surface-hover);
  color: var(--theme-muted);
  line-height: 1.55;
}

body[data-page="admin"] .admin-shell {
  width: 100%;
  height: 100vh;
  padding: 95px var(--admin-page-pad-x) 14px var(--admin-page-pad-x);
  display: grid;
  grid-template-columns: var(--admin-sidebar-width) minmax(0, 1fr);
  gap: var(--admin-shell-gap);
  align-items: stretch;
  overflow: hidden;
}

body[data-page="admin"] .sidebar {
  position: relative;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 8px 0 0;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(100% - 20px);
  overflow-y: auto;
  overflow-x: clip;
}

.sidebar-nav {
  display: grid;
  gap: 6px;
  margin: 0 0 24px;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: none;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--theme-muted);
  font-weight: 500;
  font-size: .96rem;
  text-align: left;
  cursor: pointer;
  transition: all .2s ease;
}

.nav-item:hover {
  background: var(--theme-surface-hover);
  color: var(--theme-text);
}

.nav-item.is-active {
  background: var(--theme-accent-soft);
  color: var(--theme-accent);
  font-weight: 700;
}

.nav-item i {
  width: 18px;
  text-align: center;
}

.sidebar-actions {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.bc-sidebar-panel {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.bc-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 8px 12px;
  border: 1px solid var(--theme-border);
  border-radius: 999px;
  background: var(--theme-surface);
  font-weight: 600;
}

.bc-user-email {
  line-height: 1.45;
  word-break: break-word;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--theme-border);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sidebar-credit {
  font-size: .78rem;
  line-height: 1.45;
  color: var(--theme-muted);
  text-align: center;
}

body[data-page="admin"] .main-content {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.main-scroll-area {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: clip;
  padding-right: 8px;
  display: grid;
  align-content: start;
  gap: 26px;
}

body[data-page="admin"] .topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 300;
  width: 100%;
  min-height: 84px;
  padding: 10px var(--admin-page-pad-x) 10px calc(var(--admin-page-pad-x) + var(--admin-sidebar-width) + var(--admin-shell-gap));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  background: #ffffff !important;
  border: none !important;
  border-bottom: 1px solid var(--theme-border) !important;
  box-shadow: var(--shadow-sm) !important;
  border-radius: 0;
}

body[data-page="admin"] .topbar__brand {
  display: flex;
  align-items: center;
  gap: 22px;
  min-width: 0;
}

body[data-page="admin"] .topbar__brand-copy {
  min-width: 0;
  padding-left: 6px;
}

body[data-page="admin"] .topbar h1 {
  font-size: 2.15rem;
  letter-spacing: -0.03em;
}

.brand__logo {
  width: 58px;
  height: 58px;
  border-radius: var(--radius-md);
  object-fit: contain;
}

.brand__logo--sidebar {
  width: 150px;
  height: 90px;
  margin: 0;
  position: absolute;
  left: calc(var(--admin-page-pad-x) + (var(--admin-sidebar-width) / 2) - 75px);
  top: 50%;
  transform: translateY(-50%);
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
  flex: 0 0 auto;
}

.bc-datetime {
  display: grid;
  justify-items: end;
  margin-right: 4px;
}

.bc-datetime__time {
  font-size: 1.22rem;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.bc-datetime__date {
  color: var(--theme-muted);
  font-size: .82rem;
  margin-top: 4px;
}

.topbar-icon-btn {
  position: relative;
  width: 43px;
  height: 43px;
  border: 1px solid var(--theme-border);
  border-radius: 999px;
  background: #ffffff;
  color: var(--theme-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .2s ease;
  box-shadow: var(--shadow-sm);
}

.topbar-icon-btn:hover {
  background: var(--theme-accent-soft);
  color: var(--theme-accent);
  border-color: rgba(51, 170, 238, .35);
  transform: translateY(-1px);
}

.content-section {
  display: grid;
  gap: 26px;
  min-height: 0;
}

.panel {
  padding: 30px;
}

.panel--hero {
  padding: 26px 30px;
}

.panel__header,
.panel__subheader {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--theme-border);
}

.panel__header--compact {
  margin-bottom: 14px;
  padding-bottom: 12px;
}

.hero-summary,
.hero-summary__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}

.split {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
}

.grid-two,
.grid-three,
.grid-four {
  display: grid;
  gap: 18px;
}

.grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.bc-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.bc-kpi {
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--theme-border);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.bc-kpi__label {
  color: var(--theme-muted);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.bc-kpi__value {
  margin-top: 10px;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 700;
}

.bc-kpi__meta {
  margin-top: 8px;
  color: var(--theme-muted);
  line-height: 1.45;
}

.bc-list {
  display: grid;
  gap: 12px;
}

.bc-list-item {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--theme-border);
  background: #fcfdff;
}

.bc-list-item__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.bc-list-item p {
  color: var(--theme-muted);
  line-height: 1.55;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--theme-surface-hover);
  border: 1px solid var(--theme-border);
  font-size: .82rem;
  font-weight: 600;
}

.pill--ok {
  color: var(--theme-ok);
  background: var(--theme-ok-soft);
  border-color: rgba(16, 185, 129, .18);
}

.pill--danger {
  color: var(--theme-danger);
  background: var(--theme-danger-soft);
  border-color: rgba(239, 68, 68, .18);
}

.bc-table-wrap {
  overflow-x: auto;
}

.bc-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.bc-table th,
.bc-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--theme-border);
  text-align: left;
  vertical-align: middle;
}

.bc-table th {
  font-size: .82rem;
  color: var(--theme-muted);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.bc-table tbody tr:hover {
  background: #fbfdff;
}

.bc-progress {
  height: 10px;
  border-radius: 999px;
  background: #e8eff7;
  overflow: hidden;
}

.bc-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #33aaee 0%, #6bc4f4 100%);
}

.bc-note {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--theme-surface-hover);
  border: 1px solid var(--theme-border);
  color: var(--theme-muted);
  line-height: 1.55;
}

.bc-empty {
  padding: 64px 24px;
  text-align: center;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-lg);
  background: #fcfdff;
  color: var(--theme-muted);
}

.bc-clone-box {
  padding: 18px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px dashed rgba(51, 170, 238, .35);
}

@media (max-width: 1366px) {
  :root {
    --admin-page-pad-x: 30px;
    --admin-sidebar-width: 198px;
  }
}

@media (max-width: 1100px) {
  .bc-kpis,
  .grid-four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  body[data-page="admin"] {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
  }

  body[data-page="admin"] .admin-shell {
    --admin-page-pad-x: 28px;
    --admin-sidebar-width: 0px;
    --admin-shell-gap: 0px;
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    padding: 28px;
    overflow: visible;
  }

  body[data-page="admin"] .topbar {
    position: static;
    width: 100%;
    padding: 16px 18px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--theme-border) !important;
  }

  .brand__logo--sidebar {
    position: static;
    width: 110px;
    height: 64px;
    transform: none;
    left: auto;
    top: auto;
  }

  body[data-page="admin"] .sidebar {
    position: static;
    margin-top: 0;
    min-height: auto;
    max-height: none;
    overflow: visible;
    padding: 0 0 20px;
    border-bottom: 1px solid var(--theme-border) !important;
  }

  .sidebar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0;
  }

  .sidebar-footer {
    display: none;
  }

  body[data-page="admin"] .main-content {
    overflow: visible;
  }

  .main-scroll-area {
    height: auto;
    overflow: visible;
    padding-right: 0;
  }
}

@media (max-width: 640px) {
  html { font-size: 87.5%; }

  .panel,
  .panel--hero {
    padding: 22px;
  }

  .bc-kpis,
  .grid-two,
  .grid-three,
  .grid-four {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    flex-wrap: wrap;
    gap: 8px;
  }

  .bc-datetime {
    width: 100%;
    justify-items: start;
    margin-right: 0;
  }
}
