:root {
  --bg: #0b1220;
  --bg-soft: #111a2f;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --line: #dbe2ea;
  --line-soft: #e8edf3;
  --text: #0f172a;
  --text-soft: #566377;
  --text-faint: #7a8798;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --green: #10b981;
  --amber: #f59e0b;
  --red: #ef4444;
  --purple: #8b5cf6;
  --chip: #eef2ff;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 12px 30px rgba(15, 23, 42, 0.05);
  --sidebar-width: 278px;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Inter", system-ui, sans-serif;
  background: #eef3f8;
  color: var(--text);
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
.hidden {
  display: none !important;
}
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}
.sidebar {
  background: linear-gradient(180deg, #0b1220 0%, #101a31 100%);
  color: #fff;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}
.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}
.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.35);
}
.brand-title {
  font-weight: 800;
  font-size: 1rem;
}
.brand-subtitle {
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.82rem;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nav-item {
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  border: 1px solid transparent;
  text-align: left;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  transition: 0.2s ease;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
}
.nav-item.active {
  background: rgba(37, 99, 235, 0.18);
  border-color: rgba(96, 165, 250, 0.22);
  color: #fff;
}
.nav-icon {
  width: 20px;
  text-align: center;
}
.sidebar-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.user-mini-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  align-items: center;
}
.user-mini-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 800;
}
.user-mini-name {
  font-weight: 700;
  font-size: 0.95rem;
}
.user-mini-role {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.8rem;
  text-transform: capitalize;
}
.main {
  min-width: 0;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(238, 243, 248, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #dde6ee;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px 24px;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.topbar-left h1 {
  margin: 0;
  font-size: 1.45rem;
}
.topbar-left p {
  margin: 4px 0 0;
  color: var(--text-soft);
  font-size: 0.94rem;
}
.topbar-right {
  display: flex;
  gap: 10px;
  align-items: center;
}
.search-wrap input {
  width: 340px;
  max-width: 42vw;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #d5dee7;
  background: #fff;
  outline: none;
}
.auth-gate {
  min-height: calc(100vh - 82px);
  display: grid;
  place-items: center;
  padding: 32px;
}
.auth-card {
  width: 100%;
  max-width: 500px;
  background: #fff;
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 32px;
}
.auth-logo {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 18px;
}
.auth-card h2 {
  margin: 0 0 8px;
  font-size: 1.55rem;
}
.auth-card p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.6;
}
.auth-form {
  margin-top: 24px;
  display: grid;
  gap: 16px;
}
.auth-divider {
  height: 1px;
  background: var(--line-soft);
  margin: 26px 0;
}
.auth-help-title {
  font-weight: 700;
  margin-bottom: 6px;
}
.auth-error {
  margin-top: 16px;
  color: var(--red);
  font-weight: 600;
  min-height: 24px;
}
.dashboard-root {
  padding: 22px 24px 30px;
}
.view {
  display: none;
}
.active-view {
  display: block;
}
.metric-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 20px;
}
.metric-card,
.panel,
.notice-card {
  background: #fff;
  border: 1px solid #dfe7ee;
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
}
.metric-card {
  padding: 18px 18px 16px;
}
.metric-label {
  color: var(--text-soft);
  font-size: 0.88rem;
  margin-bottom: 10px;
}
.metric-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.metric-note {
  color: var(--text-faint);
  margin-top: 8px;
  font-size: 0.83rem;
}
.content-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}
.two-col {
  grid-template-columns: 1.25fr 1fr;
}
.panel {
  padding: 18px;
}
.panel-spaced {
  margin-top: 16px;
}
.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.panel-header h3 {
  margin: 0;
  font-size: 1.08rem;
}
.panel-header p {
  margin: 6px 0 0;
  color: var(--text-soft);
  font-size: 0.9rem;
}
.pipeline-bars {
  display: grid;
  gap: 12px;
}
.pipeline-row {
  display: grid;
  gap: 8px;
}
.pipeline-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.92rem;
}
.pipeline-track {
  height: 12px;
  background: #edf2f7;
  border-radius: 999px;
  overflow: hidden;
}
.pipeline-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--purple));
}
.list-stack {
  display: grid;
  gap: 12px;
}
.list-card {
  border: 1px solid var(--line-soft);
  background: var(--panel-2);
  border-radius: 16px;
  padding: 14px;
}
.list-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.list-card-title {
  font-weight: 700;
  margin-bottom: 4px;
}
.list-card-subtitle,
.list-card-meta {
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height: 1.5;
}
.toolbar {
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.toolbar-left,
.toolbar-right {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.toolbar select {
  min-width: 190px;
}
.primary-btn,
.secondary-btn,
.ghost-btn,
.icon-btn,
.quick-link-card {
  border: none;
  transition: 0.18s ease;
}
.primary-btn,
.secondary-btn,
.ghost-btn {
  padding: 11px 15px;
  border-radius: 12px;
  font-weight: 700;
}
.primary-btn {
  background: var(--blue);
  color: #fff;
}
.primary-btn:hover {
  background: var(--blue-dark);
}
.secondary-btn {
  background: #fff;
  color: var(--text);
  border: 1px solid #d4dee8;
}
.secondary-btn:hover,
.ghost-btn:hover {
  background: #f7fafc;
}
.ghost-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #f1f5f9;
  color: var(--text);
}
.full-width {
  width: 100%;
}
.table-wrap {
  width: 100%;
  overflow: auto;
}
table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}
th,
td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid #ebf0f5;
  vertical-align: top;
}
th {
  font-size: 0.85rem;
  color: var(--text-soft);
  font-weight: 700;
  background: #fafcff;
}
td {
  font-size: 0.93rem;
}
.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.text-link-btn {
  background: transparent;
  border: none;
  color: var(--blue);
  font-weight: 700;
  padding: 0;
}
.badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  border: 1px solid transparent;
}
.badge.gray {
  background: #f1f5f9;
  color: #475569;
  border-color: #dbe4ee;
}
.badge.blue {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}
.badge.green {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}
.badge.amber {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}
.badge.red {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}
.badge.purple {
  background: #f5f3ff;
  color: #6d28d9;
  border-color: #ddd6fe;
}
.form-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.field {
  display: grid;
  gap: 8px;
}
.field-full {
  grid-column: 1 / -1;
}
label {
  font-size: 0.87rem;
  font-weight: 700;
  color: #243347;
}
input,
select,
textarea {
  width: 100%;
  padding: 12px 13px;
  border-radius: 12px;
  border: 1px solid #d5dfea;
  background: #fff;
  outline: none;
  color: var(--text);
}
input:focus,
select:focus,
textarea:focus {
  border-color: #7fb0ff;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.08);
}
textarea {
  resize: vertical;
}
.form-actions {
  padding-top: 4px;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 18, 32, 0.55);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 200;
}
.modal-card {
  background: #fff;
  width: 100%;
  max-width: 900px;
  max-height: 88vh;
  overflow: auto;
  border-radius: 26px;
  box-shadow: 0 35px 100px rgba(15, 23, 42, 0.2);
}
.modal-header {
  position: sticky;
  top: 0;
  background: #fff;
  border-bottom: 1px solid #e8eef3;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  z-index: 5;
}
.modal-header h3 {
  margin: 0;
}
.modal-header p {
  margin: 5px 0 0;
  color: var(--text-soft);
  font-size: 0.9rem;
}
.modal-body {
  padding: 20px;
}
.notice-card {
  padding: 16px;
  color: var(--text-soft);
  line-height: 1.65;
}
.quick-links-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.quick-link-card {
  text-align: left;
  padding: 16px;
  border-radius: 18px;
  background: #f8fbff;
  border: 1px solid #dbe7f4;
}
.quick-link-card:hover {
  transform: translateY(-2px);
  background: #f1f7ff;
}
.quick-link-title {
  font-weight: 800;
  margin-bottom: 6px;
}
.quick-link-subtitle {
  color: var(--text-soft);
  line-height: 1.5;
}
.panel-subsection {
  margin-top: 22px;
}
.panel-subsection h4 {
  margin: 0 0 10px;
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  padding: 8px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 700;
}
.simple-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-soft);
  line-height: 1.8;
}
.banner {
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 14px;
  font-weight: 700;
  border: 1px solid transparent;
}
.banner.info {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}
.banner.success {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}
.banner.error {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}
.mobile-only,
.desktop-hidden {
  display: none;
}
.empty-state {
  padding: 18px;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px dashed #d8e2eb;
  color: var(--text-soft);
}
.muted {
  color: var(--text-soft);
}
.small {
  font-size: 0.86rem;
}
@media (max-width: 1260px) {
  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .two-col {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(88vw, 320px);
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.24);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .mobile-only,
  .desktop-hidden {
    display: inline-flex;
  }
  .topbar {
    padding: 16px;
  }
  .dashboard-root {
    padding: 16px;
  }
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .search-wrap input {
    width: 220px;
    max-width: 48vw;
  }
}
@media (max-width: 680px) {
  .auth-card {
    padding: 22px;
    border-radius: 22px;
  }
  .metric-grid {
    grid-template-columns: 1fr;
  }
  .form-grid,
  .quick-links-grid {
    grid-template-columns: 1fr;
  }
  .toolbar {
    align-items: stretch;
  }
  .toolbar-left,
  .toolbar-right,
  .topbar-right {
    width: 100%;
  }
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }
  .search-wrap input {
    width: 100%;
    max-width: none;
  }
}
