/* ============================================================
   CREO HUB — base.css
   Reset, body, .app grid, .main, decorative orbs, scrollbar
   ============================================================ */

/* ── Box-sizing reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Root / html ── */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

/* ── Body ── */
body {
  font-family: 'Barlow', sans-serif;
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--text-primary);
  background: var(--bg-gradient);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ── Skip navigation (accessibility) ── */
.skip-nav {
  position: absolute;
  top: -9999px;
  left: 16px;
  z-index: var(--z-toast);
  padding: 8px 16px;
  background: var(--navy);
  color: #fff;
  font-family: 'Barlow', sans-serif;
  font-weight: 600;
  font-size: var(--text-base);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: top var(--transition-fast);
}

.skip-nav:focus {
  top: 8px;
}

/* ── App shell — CSS Grid ── */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: var(--topbar-height) 1fr;
  min-height: 100vh;
  position: relative;
  z-index: var(--z-base);
}

/* Topbar spans full width */
.app > .topbar {
  grid-column: 1 / -1;
  grid-row: 1;
}

/* Sidebar occupies column 1, row 2 */
.app > .sidebar,
.app > #main-sidebar {
  grid-column: 1;
  grid-row: 2;
}

/* Main content occupies column 2, row 2 */
.app > .main {
  grid-column: 2;
  grid-row: 2;
}

/* ── Main content area ── */
.main {
  padding: var(--space-6) var(--space-6) var(--space-16);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  min-height: calc(100vh - var(--topbar-height));
  position: relative;
  z-index: var(--z-raised);
  overflow-x: hidden;
}

/* ── Decorative background orbs ── */
.orb {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
  opacity: 1;
}

.orb-navy {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--orb-navy) 0%, transparent 70%);
  top: -200px;
  right: -100px;
}

.orb-cerulean {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--orb-cerulean) 0%, transparent 70%);
  bottom: 100px;
  left: 100px;
}

.orb-gold {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--orb-gold) 0%, transparent 70%);
  top: 40%;
  right: 20%;
}

/* ── Sidebar overlay (mobile) ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: calc(var(--z-sidebar) - 1);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.sidebar-overlay.open {
  display: block;
  opacity: 1;
}

/* ── Custom scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-heavy);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-medium) transparent;
}

/* ── Images ── */
img {
  max-width: 100%;
  display: block;
}

/* ── Links ── */
a {
  color: var(--text-cerulean);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--cerulean);
  text-decoration: none;
}

/* ── Focus ring — global ── */
:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Remove outline for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* ── Typography helpers ── */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

p {
  line-height: 1.6;
}

/* ── Utility classes ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }

.ml-auto { margin-left: auto; }
.mt-auto { margin-top: auto; }

.w-full { width: 100%; }
.h-full { height: 100%; }

/* ── Page section helpers ── */
.page-header {
  margin-bottom: var(--space-6);
}

.page-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.page-subtitle {
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin-top: var(--space-1);
}

/* ── Section card / panel ── */
.panel {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-light);
}

.panel-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.panel-body {
  padding: var(--space-5);
}

/* ── Divider ── */
.divider {
  height: 1px;
  background: var(--border-light);
  margin: var(--space-4) 0;
}


/* ══════════════════════════════════════
   COLLAPSIBLE SIDEBAR — grid adjustment
══════════════════════════════════════ */
.app.sidebar-collapsed {
  grid-template-columns: 60px 1fr;
  transition: grid-template-columns var(--transition-slow);
}

.app {
  transition: grid-template-columns var(--transition-slow);
}

/* ── Partner Content Pages ── */
.card {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    box-shadow: 0 2px 12px rgba(15,44,76,0.06);
    margin-bottom: 16px;
    overflow: hidden;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-hover);
}
.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}
.card-body {
    padding: 20px;
}
.fg {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 4px;
}
.fg label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.fg input, .fg textarea, .fg select {
    width: 100%;
    padding: 9px 13px;
    border: 1.5px solid var(--border-light);
    border-radius: 9px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-input);
    outline: none;
    transition: border-color 0.2s;
}
.fg input:focus, .fg textarea:focus, .fg select:focus {
    border-color: var(--cerulean, #176487);
}
.fg textarea { resize: vertical; min-height: 80px; }
.alert {
    padding: 11px 16px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
}
.alert-success {
    background: rgba(18,107,62,0.08);
    color: var(--text-success);
    border: 1px solid rgba(18,107,62,0.2);
}
.alert-error {
    background: rgba(181,45,34,0.08);
    color: var(--text-danger);
    border: 1px solid rgba(181,45,34,0.2);
}
.b-gold {
    background: rgba(229,156,40,0.12);
    color: var(--text-gold);
    border: 1px solid rgba(138,95,16,0.25);
}
