/* CornerEngine UI/UX Final Polish — visual layer only */
:root {
  --sidebar-width: 268px;
  --navbar-height: 76px;
  --background: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-raised: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text-primary: #172033;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --primary: #3157d5;
  --primary-hover: #2648bd;
  --primary-light: #edf2ff;
  --success: #168451;
  --warning: #b7791f;
  --danger: #c2414b;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 10px rgba(15, 23, 42, .045);
  --shadow-md: 0 14px 40px rgba(15, 23, 42, .075);
}

html[data-bs-theme="dark"] {
  --background: #0b1220;
  --surface: #111b2e;
  --surface-soft: #162238;
  --surface-raised: #17243b;
  --border: #273650;
  --border-strong: #3a4b68;
  --text-primary: #edf3fb;
  --text-secondary: #a9b7ca;
  --text-muted: #7f90a8;
  --primary: #7da2ff;
  --primary-hover: #9ab7ff;
  --primary-light: #1a2d54;
  --shadow-sm: 0 2px 12px rgba(0,0,0,.2);
  --shadow-md: 0 16px 44px rgba(0,0,0,.28);
}

body {
  font-family: Inter, "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.55;
  letter-spacing: -.006em;
}

body::before {
  content: "";
  position: fixed;
  inset: var(--navbar-height) 0 auto var(--sidebar-width);
  height: 280px;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle at 18% 0%, rgba(49,87,213,.08), transparent 52%);
}

.top-navbar {
  padding-inline: 28px;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: 0 1px 0 var(--border);
}

.brand { font-size: 22px; letter-spacing: -.035em; }
.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(145deg, #294ec7, #6e91ff);
  box-shadow: 0 8px 24px rgba(49,87,213,.25);
}
.brand-subtitle {
  display: block;
  margin-top: -3px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.version-badge {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 700;
}

.theme-button, .mobile-menu-button {
  border-color: var(--border);
  background: var(--surface-soft);
  box-shadow: var(--shadow-sm);
}
.mobile-menu-button { display: none; }

.sidebar {
  padding: 22px 14px;
  overflow-y: auto;
  background: color-mix(in srgb, var(--surface) 96%, var(--primary-light));
}
.sidebar-title { padding: 0 14px 11px; color: var(--text-muted); }
.sidebar-menu { gap: 5px; }
.menu-item {
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
}
.menu-item:hover { transform: none; border-color: var(--border); }
.menu-item.active {
  background: var(--primary-light);
  border-color: color-mix(in srgb, var(--primary) 25%, var(--border));
  color: var(--primary);
  box-shadow: none;
}
.menu-item.active::before {
  content: "";
  width: 3px;
  height: 22px;
  margin-left: -7px;
  border-radius: 99px;
  background: var(--primary);
}
.menu-item-muted { opacity: .55; cursor: not-allowed; }
.menu-group-label {
  margin: 18px 14px 7px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.main-content { max-width: 1760px; padding: 38px 40px 56px; }
.page-header { margin-bottom: 26px; }
.page-header h1, .container-fluid h1 { letter-spacing: -.035em; }
.eyebrow, .text-uppercase.small {
  color: var(--primary) !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: .12em;
}

.card, .dashboard-panel, .accuracy-panel, .analysis-card, .pro-pick-card {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  background: var(--surface) !important;
  box-shadow: var(--shadow-sm) !important;
}
.card { overflow: hidden; }
.card-header { padding: 18px 22px; border-color: var(--border); background: var(--surface-soft); }
.card-body { padding: 22px; }
.card-footer { padding: 0 22px 22px; }
.dashboard-panel { padding: 28px; }

.analysis-card, .stat-card { box-shadow: var(--shadow-sm); }
.analysis-card:hover, .stat-card:hover, .team-profile-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md) !important;
}

.btn {
  border-radius: 11px;
  font-weight: 650;
  letter-spacing: -.01em;
}
.btn-primary {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 8px 20px rgba(49,87,213,.16);
}
.btn-primary:hover { border-color: var(--primary-hover); background: var(--primary-hover); }
.btn-outline-primary { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }

.form-control, .form-select {
  min-height: 46px;
  border-color: var(--border);
  border-radius: 11px;
  background-color: var(--surface-soft);
  color: var(--text-primary);
}
.form-control:focus, .form-select:focus {
  border-color: color-mix(in srgb, var(--primary) 65%, white);
  background-color: var(--surface);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 12%, transparent);
}
.form-label { color: var(--text-secondary); font-size: 13px; font-weight: 700; }

.table { --bs-table-bg: transparent; --bs-table-color: var(--text-primary); margin-bottom: 0; }
.table thead th {
  padding: 13px 14px;
  border-bottom-width: 1px;
  border-color: var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
}
.table tbody td { padding: 15px 14px; border-color: var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: color-mix(in srgb, var(--primary-light) 45%, transparent); }

.badge { letter-spacing: .02em; }
.alert { border-radius: 14px; border-width: 1px; }
.progress { height: 8px; border-radius: 999px; background: var(--background); }
.progress-bar { border-radius: inherit; background: linear-gradient(90deg, var(--primary), #7597f8); }

.system-status { box-shadow: var(--shadow-sm); }
.empty-state { border: 1px dashed var(--border-strong); border-radius: 18px; background: var(--surface-soft); }

.sidebar-backdrop { display: none; }

@media (max-width: 1100px) {
  :root { --sidebar-width: 232px; }
  .main-content { padding-inline: 28px; }
}

@media (max-width: 860px) {
  :root { --sidebar-width: 0px; }
  body::before { left: 0; }
  .mobile-menu-button { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; color: var(--text-primary); }
  .sidebar {
    top: 0;
    z-index: 1200;
    width: 284px;
    padding-top: 92px;
    transform: translateX(-102%);
    transition: transform .22s ease;
    box-shadow: 20px 0 50px rgba(15,23,42,.18);
  }
  body.sidebar-open { overflow: hidden; }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-title, .menu-item span { display: block; }
  .menu-item { justify-content: flex-start; }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(5,10,20,.48);
    backdrop-filter: blur(2px);
  }
  body.sidebar-open .sidebar-backdrop { display: block; }
  .main-content { width: 100%; margin-left: 0; }
}

@media (max-width: 640px) {
  .top-navbar { height: 68px; padding-inline: 14px; }
  :root { --navbar-height: 68px; }
  .brand { font-size: 19px; }
  .brand-icon { width: 38px; height: 38px; }
  .brand-subtitle { display: none; }
  .navbar-actions { gap: 8px; }
  .main-content { padding: 24px 14px 42px; }
  .container-fluid.py-4 { padding: 0 !important; }
  .dashboard-panel, .card-body { padding: 18px; }
  .panel-header { align-items: flex-start; flex-direction: column; gap: 12px; }
  .page-header h1, .container-fluid h1 { font-size: 27px; }
  .table tbody td, .table thead th { padding-inline: 10px; }
}

/* RC2 — navigation hierarchy and restrained product motion */
.menu-group-label{display:flex;align-items:center;gap:8px;margin-top:20px;padding-top:2px}.menu-group-label i{font-size:12px;color:var(--primary);opacity:.9}.menu-item,.btn,.surface-card,.card,.dashboard-panel,.accuracy-panel,.analysis-card,.pro-pick-card{transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease,background-color .18s ease,color .18s ease}.menu-item:hover{background:color-mix(in srgb,var(--primary-light) 45%,transparent);color:var(--text-primary)}.menu-item i{width:20px;text-align:center}.sidebar-menu .menu-group-label:first-child{margin-top:4px}.sidebar::-webkit-scrollbar{width:8px}.sidebar::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--text-muted) 35%,transparent);border-radius:999px;border:2px solid transparent;background-clip:padding-box}
@media (prefers-reduced-motion: reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}

.navbar-user { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); font-size: 12px; font-weight: 700; }
@media (max-width: 640px) { .navbar-user { display: none; } }
