.workspace {
  display: grid;
  grid-template-columns: 240px 1fr 280px;
  grid-template-rows: 1fr;
  min-height: 100vh;
  height: 100vh;
  background: var(--black);
  color: var(--off-white);
}

.panel-left,
.panel-center,
.panel-right {
  min-height: 0;
  min-width: 0;
  overflow: auto;
}

.panel-left {
  background: var(--charcoal);
  border-right: 1px solid var(--border);
}

.panel-center {
  background: var(--black);
  display: flex;
  flex-direction: column;
}

.panel-right {
  background: var(--charcoal);
  border-left: 1px solid var(--border);
}

.topbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 48px;
  padding: 0 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--charcoal);
}

.topbar__logo {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  color: var(--off-white);
}

.topbar__nav {
  display: flex;
  align-items: flex-end;
  gap: 0.25rem;
  flex: 1;
  justify-content: center;
  height: 100%;
}

.topbar__rep-select {
  background: var(--steel);
  color: var(--off-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.35rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
  max-width: 220px;
  appearance: auto;
}
.topbar__rep-select:focus {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.topbar__user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

.topbar__theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--steel);
  color: var(--off-white);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.topbar__theme-toggle:hover {
  background: var(--surface-hover);
  border-color: var(--mid);
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0 0.875rem;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.nav-tab:hover {
  color: var(--off-white);
  background: rgba(255, 255, 255, 0.04);
}

.nav-tab.is-active {
  color: var(--off-white);
  border-bottom-color: var(--blue);
}

.score-ring {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: conic-gradient(
    var(--ring-color, var(--green)) calc(var(--score, 0) * 1%),
    var(--steel) 0
  );
  box-shadow: inset 0 0 0 8px var(--charcoal);
}

.score-ring::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: var(--charcoal);
}

.score-ring__number {
  position: relative;
  z-index: 1;
  font-family: var(--font-heading);
  font-size: 64px;
  line-height: 1;
  color: var(--off-white);
}

.score-ring--green {
  --ring-color: var(--green);
}

.score-ring--amber {
  --ring-color: var(--amber);
}

.score-ring--red {
  --ring-color: var(--red);
}

.kpi-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.625rem;
  font-size: 0.75rem;
}

.kpi-row__label {
  flex: 0 0 5rem;
  color: var(--muted);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.kpi-bar {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--steel);
  overflow: hidden;
}

.kpi-bar__fill {
  height: 100%;
  border-radius: 3px;
  background: var(--blue);
  transition: width 0.2s ease;
}

.kpi-row__val {
  flex: 0 0 2.5rem;
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--off-white);
}

.kpi-row__val--green {
  color: var(--green);
}

.kpi-row__val--amber {
  color: var(--amber);
}

.kpi-row__val--red {
  color: var(--red);
}

.ai-brief {
  margin: 1rem 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-left: 4px solid var(--green);
  background: var(--steel);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.ai-brief summary {
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.ai-brief summary::-webkit-details-marker {
  display: none;
}

.ai-brief[open] summary {
  border-bottom: 1px solid var(--border);
}

.ai-brief__body {
  padding: 0.75rem 1rem 1rem;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.55;
}

.next-up {
  margin: 1rem 0;
  padding: 1rem 1.125rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--charcoal);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.next-up__title {
  font-family: var(--font-heading);
  font-size: 1.375rem;
  letter-spacing: 0.03em;
  color: var(--off-white);
  margin-bottom: 0.375rem;
}

.next-up__meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.875rem;
}

.next-up__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.4375rem 0.75rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--off-white);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease,
    box-shadow 0.2s ease;
}

.action-btn:hover {
  background: var(--surface-hover);
}

.action-btn--call {
  border-color: var(--green);
  color: var(--green);
}

.action-btn--call:hover {
  background: var(--green-bg);
}

.action-btn--email {
  border-color: var(--blue);
  color: var(--blue);
}

.action-btn--email:hover {
  background: var(--blue-bg);
}

.action-btn--snooze {
  border-color: var(--amber);
  color: var(--amber);
}

.action-btn--snooze:hover {
  background: var(--amber-bg);
}

.action-btn--detail {
  border-color: var(--muted);
  color: var(--muted);
}

.plan-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.plan-item {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--steel);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.plan-item:hover {
  border-color: var(--mid);
  background: var(--surface-hover);
}

.plan-item__icon {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.plan-item__main {
  flex: 1;
  min-width: 0;
}

.plan-item__title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--off-white);
  margin-bottom: 0.125rem;
}

.plan-item__value {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--muted);
}

.plan-item__badge {
  flex-shrink: 0;
}

.plan-item__actions {
  display: flex;
  flex-shrink: 0;
  gap: 0.25rem;
}

.cal-strip {
  position: relative;
  padding-left: 1.25rem;
  border-left: 2px solid var(--border);
  margin-left: 0.5rem;
}

.cal-event {
  position: relative;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.625rem;
  border-radius: var(--radius);
  border-left: 3px solid var(--event-color, var(--blue));
  background: var(--steel);
  font-size: 0.75rem;
  transition: background 0.2s ease;
}

.cal-event:hover {
  background: var(--surface-hover);
}

.cal-event--meeting {
  --event-color: var(--blue);
}

.cal-event--call {
  --event-color: var(--green);
}

.cal-event--block {
  --event-color: var(--amber);
}

.cal-event--personal {
  --event-color: var(--purple);
}

.cal-event--other {
  --event-color: var(--muted);
}

.email-item {
  padding: 0.75rem 0.875rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--steel);
  transition: border-color 0.2s ease;
}

.email-item:hover {
  border-color: var(--mid);
}

.email-item__sender {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--off-white);
  margin-bottom: 0.25rem;
}

.email-item__subject {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.email-item__badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  align-items: center;
}

.quick-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.quick-links a,
.quick-links button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.5rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  color: var(--off-white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--steel);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.quick-links a:hover,
.quick-links button:hover {
  background: var(--surface-hover);
  border-color: var(--blue);
  color: var(--blue);
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.drawer-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1001;
  width: 60%;
  max-width: 720px;
  min-width: 280px;
  height: 100vh;
  background: var(--charcoal);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.2s ease;
}

.drawer.is-open {
  transform: translateX(0);
}

.drawer__header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-heading);
  font-size: 1.125rem;
  letter-spacing: 0.03em;
}

.drawer__tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  padding: 0 0.5rem;
}

.drawer__tabs .nav-tab {
  height: 44px;
}

.drawer__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 1rem;
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  z-index: 2000;
  transform: translateX(-50%) translateY(120%);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: #0e0e0e;
  background: var(--green);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  pointer-events: none;
}

.toast.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.1875rem 0.5rem;
  font-size: 0.625rem;
  font-weight: 700;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--steel);
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.4375rem;
  font-size: 0.625rem;
  font-weight: 700;
  border-radius: var(--radius);
  background: var(--steel);
  color: var(--off-white);
}

.temp-hot {
  background: rgba(231, 76, 60, 0.2);
  color: #ff8a80;
  border: 1px solid rgba(231, 76, 60, 0.45);
}

.temp-warm {
  background: var(--amber-bg);
  color: var(--amber);
  border: 1px solid rgba(232, 160, 32, 0.4);
}

.temp-strategic {
  background: var(--purple-bg);
  color: var(--purple);
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.data-table th,
.data-table td {
  padding: 0.5rem 0.625rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--charcoal);
}

.data-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.data-table tbody tr:hover {
  background: var(--surface-hover);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--steel);
  color: var(--off-white);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease,
    box-shadow 0.2s ease;
}

.btn:hover {
  background: var(--surface-hover);
  border-color: var(--mid);
}

.btn--primary {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--black);
}

.btn--primary:hover {
  filter: brightness(1.08);
  border-color: var(--blue);
}

.btn--danger {
  background: transparent;
  border-color: var(--red);
  color: var(--red);
}

.btn--danger:hover {
  background: rgba(231, 76, 60, 0.15);
}

input[type="text"],
input[type="email"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="time"],
select,
textarea {
  width: 100%;
  max-width: 100%;
  padding: 0.5rem 0.625rem;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--off-white);
  background: var(--steel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea {
  min-height: 5rem;
  resize: vertical;
  line-height: 1.5;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--mid);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 2px var(--blue-bg);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237a7a7a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.625rem center;
  padding-right: 2rem;
}

.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--steel);
  min-height: 1rem;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.06) 50%,
    transparent 100%
  );
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.kanban-board {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-snap-type: x proximity;
}

.kanban-col {
  flex: 0 0 260px;
  min-width: 200px;
  max-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--charcoal);
  overflow-y: auto;
  scroll-snap-align: start;
}

.kanban-card {
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--steel);
  font-size: 0.8125rem;
  cursor: grab;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.kanban-card:hover {
  border-color: var(--mid);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.kanban-card:active {
  cursor: grabbing;
}

.activity-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.8125rem;
}

.activity-row:last-child {
  border-bottom: none;
}

.activity-icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  background: var(--steel);
  color: var(--muted);
}

.activity-icon--call {
  background: var(--green-bg);
  color: var(--green);
}

.activity-icon--email {
  background: var(--blue-bg);
  color: var(--blue);
}

.activity-icon--meeting {
  background: var(--purple-bg);
  color: var(--purple);
}

.activity-icon--note {
  background: var(--amber-bg);
  color: var(--amber);
}

.activity-row__content {
  flex: 1;
  min-width: 0;
}

.activity-row__meta {
  font-size: 0.6875rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.rep-card {
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--charcoal);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rep-card:hover {
  border-color: var(--mid);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.rep-card__name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  letter-spacing: 0.03em;
  margin-bottom: 0.25rem;
}

.rep-card__stats {
  font-size: 0.75rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

@media (max-width: 1024px) {
  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    height: auto;
    min-height: 100vh;
  }

  .panel-left,
  .panel-center,
  .panel-right {
    border-left: none;
    border-right: none;
  }

  .panel-left {
    border-bottom: 1px solid var(--border);
  }

  .panel-right {
    border-top: 1px solid var(--border);
  }

  .drawer {
    width: 100%;
    max-width: none;
  }

  .topbar__nav {
    flex-wrap: wrap;
    justify-content: flex-start;
    overflow-x: auto;
  }
}
