/* Command Center Layout Toolkit */
:root {
  --cc-border: rgba(15,23,42,.08);
  --cc-shadow: 0 24px 48px -36px rgba(15,23,42,.45);
  --cc-rail-active: linear-gradient(135deg, rgba(59,130,246,.08), rgba(59,130,246,.05));
  --cc-chip-bg: #f8fafc;
}

.cc-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2rem;
}

.cc-rail {
  position: sticky;
  top: 82px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.cc-rail__header {
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #94a3b8;
}

.cc-rail__nav {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.cc-rail__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .6rem .85rem;
  border-radius: .75rem;
  border: 1px solid transparent;
  background: transparent;
  color: #1f2937;
  text-decoration: none;
  font-size: .85rem;
  transition: all .2s ease;
}

.cc-rail__link-label {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.cc-rail__link-icon {
  width: 1.25rem;
  text-align: center;
  opacity: .7;
}

.cc-rail__link-count {
  font-weight: 600;
  font-size: .75rem;
  color: #2563eb;
}

.cc-rail__link:hover,
.cc-rail__link.active {
  border-color: rgba(59,130,246,.35);
  background: var(--cc-rail-active);
  box-shadow: 0 12px 32px -24px rgba(37,99,235,.6);
}

.cc-head {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.cc-head h1 {
  font-size: 1.75rem;
  margin-bottom: .35rem;
}

.cc-head p {
  margin: 0;
  color: #64748b;
}

.cc-head__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.cc-banner {
  border-radius: 1rem;
  border: 1px solid rgba(234,179,8,.4);
  background: linear-gradient(135deg, rgba(253,230,138,.35), rgba(254,243,199,.9));
  padding: 1rem 1.25rem;
  color: #713f12;
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.5rem;
  box-shadow: 0 24px 48px -36px rgba(217,119,6,.6);
}

.cc-metrics {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 2rem;
}

.cc-metric {
  border-radius: 1rem;
  padding: 1.05rem;
  border: 1px solid var(--cc-border);
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  box-shadow: var(--cc-shadow);
}

.cc-metric .label {
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #94a3b8;
}

.cc-metric .value {
  font-size: 1.45rem;
  font-weight: 600;
  color: #0f172a;
}

.cc-metric .note {
  font-size: .78rem;
  color: #64748b;
}

.cc-section {
  margin-bottom: 2.5rem;
}

.cc-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.cc-section__header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.cc-panel {
  border-radius: 1rem;
  border: 1px solid var(--cc-border);
  background: #fff;
  box-shadow: var(--cc-shadow);
}

.cc-panel__header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(15,23,42,.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #f8fafc;
}

.cc-panel__body {
  padding: 1.1rem 1.25rem;
}

.cc-chip-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.cc-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .8rem;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.12);
  background: var(--cc-chip-bg);
  font-size: .75rem;
  text-decoration: none;
  color: #0f172a;
  transition: all .2s ease;
}

.cc-chip:hover {
  border-color: rgba(59,130,246,.35);
}

.cc-chip.active {
  background: #0f172a;
  color: #f8fafc;
  border-color: #0f172a;
  box-shadow: 0 16px 28px -26px rgba(15,23,42,.8);
}

.cc-empty {
  background: linear-gradient(135deg, rgba(59,130,246,.08), rgba(59,130,246,.04));
  border: 1px dashed rgba(59,130,246,.35);
  border-radius: 1rem;
  padding: 1.25rem;
  color: #1d4ed8;
}

.cc-table thead th {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .72rem;
  white-space: nowrap;
}

.cc-table td {
  white-space: nowrap;
}

.cc-table .desc-col {
  max-width: 26rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cc-scrollable {
  margin: -.75rem -1.25rem -1.25rem;
  padding: 0 1.25rem 1.25rem;
}

@media (max-width: 1199.98px) {
  .cc-shell {
    grid-template-columns: 1fr;
  }
  .cc-rail {
    position: static;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--cc-border);
    flex-direction: row;
    flex-wrap: wrap;
    gap: .75rem;
  }
  .cc-rail__header {
    width: 100%;
  }
  .cc-rail__nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: .5rem;
  }
  .cc-rail__link {
    flex: 1 1 180px;
    justify-content: flex-start;
    gap: .5rem;
  }
}

@media (max-width: 767.98px) {
  .cc-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .cc-head__actions {
    width: 100%;
  }
  .cc-head__actions > * {
    width: 100%;
  }
  .cc-scrollable {
    margin: 0;
    padding: 0;
  }
  .cc-table thead {
    display: none;
  }
  .cc-table tbody tr {
    display: grid;
    grid-template-columns: 1fr;
    background: rgba(248,250,252,1);
    border-radius: .85rem;
    padding: .75rem;
    margin-bottom: .75rem;
    box-shadow: inset 0 0 0 1px rgba(15,23,42,.05);
  }
  .cc-table tbody tr td {
    display: flex;
    justify-content: space-between;
    font-size: .9rem;
    padding: .3rem 0;
    border: 0;
  }
  .cc-table tbody tr td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #475569;
    margin-right: 1.5rem;
  }
  .cc-table .desc-col {
    max-width: 100%;
    white-space: normal;
  }
}

@media (max-width: 575.98px) {
  .cc-rail__link {
    flex: 1 1 calc(50% - .5rem);
  }
}
