:root {
  --bg: #050b12;
  --surface: #111823;
  --surface-2: #17202d;
  --ink: #f7f7f2;
  --muted: #aab3bf;
  --line: rgba(255, 255, 255, .14);
  --green: #c7922d;
  --green-2: #7d5817;
  --amber: #f1c869;
  --gold: #c7922d;
  --gold-2: #f1c869;
  --hub-accent: #c7922d;
  --hub-accent-2: #7d5817;
  --patriot-red: #e63946;
  --patriot-white: #f8fafc;
  --blue: #132238;
  --danger: #b04444;
  --sidebar: #03070d;
  --sidebar-2: #0b111c;
  --sidebar-line: rgba(255, 255, 255, .12);
  --shadow: 0 18px 46px rgba(0, 0, 0, .34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 278px minmax(0, 1fr);
  font-family: "Segoe UI Variable Text", "Segoe UI", Arial, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(241, 200, 105, .14), transparent 360px),
    radial-gradient(circle at 14% 22%, rgba(255, 255, 255, .06), transparent 320px),
    linear-gradient(180deg, #02060b 0, #07111d 52%, var(--bg) 100%),
    var(--bg);
}

button,
input,
textarea,
select {
  font-family: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  min-height: 34px;
  padding: 0 12px;
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  color: #101722;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 8px 18px rgba(0, 0, 0, .16);
  transition: transform .14s ease, border-color .14s ease, background .14s ease, box-shadow .14s ease;
}

button:hover {
  transform: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 12px 24px rgba(0, 0, 0, .22);
}

.button-link {
  border-radius: 9px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  color: #101722;
  font-weight: 700;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 8px 18px rgba(0, 0, 0, .16);
}

button.secondary {
  background: #1b2432;
  color: #f8fafc;
  border: 1px solid var(--line);
}

button.danger {
  background: linear-gradient(180deg, #c45353, var(--danger));
}

button:disabled {
  cursor: wait;
  opacity: .65;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 9px;
  background: #f8fafc;
  color: #0f1726;
  font-size: .9rem;
  font-weight: 500;
}

input::placeholder,
textarea::placeholder {
  color: #7b8798;
  font-weight: 500;
}

.currency-field {
  position: relative;
  display: block;
}

.currency-field > span {
  position: absolute;
  top: 50%;
  left: 11px;
  transform: translateY(-50%);
  color: #7fa6ff;
  font-size: .88rem;
  font-weight: 700;
  pointer-events: none;
}

.currency-field input {
  padding-left: 28px;
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 650;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  letter-spacing: 0;
  font-weight: 700;
}

.sidebar {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 12px;
  border-right: 1px solid var(--sidebar-line);
  background:
    linear-gradient(180deg, #151823 0, var(--sidebar) 270px),
    var(--sidebar);
  overflow: auto;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--sidebar-line);
  padding: 4px 4px 10px;
}

.mark {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(29, 99, 255, .58);
  border-radius: 7px;
  background: linear-gradient(135deg, #2f7cff, #0b2f86);
  color: #f4f8ff;
  font-weight: 900;
  font-size: .95rem;
}

.brand-logo-mark {
  overflow: hidden;
  border-color: rgba(241, 200, 105, .45);
  background: #050b12;
}

.brand-logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 34%;
  transform: scale(1.55);
}

.brand-block h1 {
  margin: 0;
  color: #f6f7fb;
  font-size: .98rem;
  line-height: 1.1;
}

.brand-block p {
  margin: 2px 0 0;
  color: #8e95a5;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.helper,
#project-description {
  color: var(--muted);
}

.sidebar .brand-block p {
  color: #8e95a5;
}

.agent-status {
  margin-bottom: 12px;
  border: 1px solid var(--sidebar-line);
  border-radius: 5px;
  padding: 7px 8px;
  background: #0e121d;
  color: #a7afbf;
  font-size: .72rem;
  font-weight: 800;
}

.agent-status.ready {
  border-color: rgba(57, 211, 123, .35);
  background: rgba(29, 132, 77, .14);
  color: #a5efc5;
}

.agent-status.unavailable {
  border-color: rgba(29, 99, 255, .42);
  background: rgba(29, 99, 255, .13);
  color: #a8c5ff;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: var(--surface);
  box-shadow: none;
}

.panel.compact {
  display: grid;
  gap: 7px;
  margin: 6px 0 0;
  padding: 9px;
}

.panel h2,
.panel h3 {
  margin-bottom: 8px;
}

.panel h2 {
  font-size: 1.12rem;
}

.panel h3 {
  font-size: 1rem;
}

.sidebar .panel {
  border-color: var(--sidebar-line);
  background: #111723;
  box-shadow: none;
}

.sidebar .panel h2,
.sidebar label {
  color: #d8deea;
}

.sidebar input,
.sidebar textarea,
.sidebar select {
  border-color: #2b3447;
  background: #080b12;
  color: #f4f6fb;
}

.sidebar input::placeholder,
.sidebar textarea::placeholder {
  color: #697185;
}

.sidebar-drawer {
  margin-bottom: 8px;
}

.sidebar-drawer summary {
  min-height: 37px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 4px;
  padding: 0 12px;
  background:
    linear-gradient(90deg, var(--patriot-red) 0 3px, transparent 3px),
    linear-gradient(180deg, var(--hub-accent), var(--hub-accent-2));
  color: #f4f8ff;
  font-size: .9rem;
  font-weight: 900;
  letter-spacing: .02em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}

.sidebar-drawer summary::-webkit-details-marker {
  display: none;
}

.sidebar-drawer summary span {
  width: 25px;
  color: rgba(255, 255, 255, .84);
  text-align: center;
  font-size: .82rem;
}

.side-nav {
  display: grid;
  gap: 4px;
  margin: 12px 0;
  border-bottom: 1px solid var(--sidebar-line);
  padding-bottom: 14px;
}

.side-nav-item {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border-radius: 5px;
  padding: 0 13px;
  background: transparent;
  color: #aeb5c4;
  font-size: .88rem;
  font-weight: 850;
  text-align: left;
}

.side-nav-item .nav-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #71798a;
  flex: 0 0 28px;
}

.side-nav-item .nav-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.side-nav-item b {
  flex: 1;
  min-width: 0;
  font: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-unread-badge {
  min-width: 21px;
  height: 21px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  margin-left: 8px;
  padding: 0 6px;
  background: var(--patriot-red);
  color: #fff;
  font-size: .72rem;
  font-style: normal;
  font-weight: 750;
  box-shadow: 0 0 0 2px #0a0e17, 0 0 18px rgba(230, 57, 70, .34);
}

.side-nav-item:hover,
.side-nav-item.active {
  background: #151d2d;
  color: #f4f6fb;
}

.side-nav-item.active .nav-icon {
  color: var(--gold, #c7922d);
}

.side-nav-item.active-accent.active {
  background:
    linear-gradient(90deg, var(--patriot-red) 0 3px, transparent 3px),
    rgba(29, 99, 255, .2);
  color: #cfe0ff;
  box-shadow: inset 0 0 0 1px rgba(93, 140, 255, .16);
}

.nav-group-title {
  margin: 4px 8px 5px;
  color: #777f90;
  font-size: .67rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.section-label {
  margin: 12px 8px 7px;
  color: #777f90;
  font-size: .68rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.sidebar-footer {
  display: grid;
  gap: 7px;
  margin-top: auto;
  border-top: 1px solid var(--sidebar-line);
  padding: 10px 8px 4px;
  color: #aeb5c4;
  font-size: .74rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.team-dot {
  width: 7px;
  height: 7px;
  display: inline-block;
  margin: 0 4px;
  border-radius: 50%;
  background: #39d37b;
}

.profile-button {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  justify-content: flex-start;
  min-height: 42px;
  padding: 6px;
  border: 1px solid transparent;
  background: #0d121c;
  color: #dbe7ff;
  text-align: left;
}

.profile-button.has-profile {
  border-color: rgba(29, 99, 255, .35);
  background: #111b2f;
}

.profile-button strong,
.profile-button small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-button strong {
  font-size: .8rem;
  line-height: 1.1;
  text-transform: none;
}

.profile-button small {
  margin-top: 2px;
  color: #8e95a5;
  font-size: .63rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.current-profile-avatar {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--profile-color, var(--hub-accent));
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
}

.logout-button {
  justify-content: flex-start;
  min-height: 30px;
  padding: 0 6px;
  border: 1px solid transparent;
  background: transparent;
  color: #8e95a5;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-align: left;
  text-transform: uppercase;
}

.logout-button:hover {
  color: #dbe7ff;
}

.workspace {
  min-width: 0;
  padding: 14px 18px;
  background:
    radial-gradient(circle at top right, rgba(29, 99, 255, .08), transparent 420px),
    var(--bg);
  overflow: auto;
}

.empty-state {
  min-height: calc(100vh - 56px);
  display: grid;
  align-content: center;
  max-width: 860px;
}

.empty-state h2 {
  margin-bottom: 10px;
  font-size: clamp(1.8rem, 3.2vw, 3.3rem);
  line-height: 1;
}

.empty-state p:last-child {
  max-width: 680px;
  color: var(--muted);
  font-size: 1rem;
}

.projects-dashboard {
  display: block;
}

.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.dashboard-header h2 {
  margin-bottom: 4px;
  font-size: clamp(1.55rem, 2vw, 2.1rem);
  line-height: 1;
}

.dashboard-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.metric-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background:
    linear-gradient(90deg, var(--patriot-red) 0 4px, transparent 4px),
    linear-gradient(180deg, #ffffff, #f8fafc);
  box-shadow: none;
}

.metric-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  color: #10213d;
  font-size: 1.45rem;
  line-height: 1;
}

.project-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.project-directory-controls {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.project-filter-bar,
.client-filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(135px, .8fr));
  gap: 8px;
  align-items: end;
}

.project-filter-summary,
.client-filter-summary {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 850;
}

.dashboard-project-card {
  display: grid;
  grid-template-columns: minmax(118px, .75fr) minmax(155px, 1fr) minmax(210px, 1.35fr) minmax(165px, .95fr) minmax(155px, .9fr) minmax(165px, .8fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background:
    linear-gradient(135deg, rgba(29, 99, 255, .14), transparent 45%),
    var(--surface);
  box-shadow: none;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.dashboard-project-card:hover {
  transform: none;
  border-color: rgba(93, 140, 255, .72);
  background:
    linear-gradient(135deg, rgba(29, 99, 255, .14), transparent 45%),
    #ffffff;
}

.project-card-topline,
.project-card-meta,
.project-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.project-card-topline {
  justify-content: flex-start;
  min-width: 0;
}

.project-card-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--hub-accent), #0b2f86);
  color: white;
  font-weight: 700;
}

.project-card-status {
  border: 1px solid rgba(29, 99, 255, .34);
  border-radius: 999px;
  padding: 5px 8px;
  background: #dbe8ff;
  color: #0f2f75;
  font-size: .75rem;
  font-weight: 750;
}

.dashboard-project-card h3 {
  margin: 0;
  overflow: hidden;
  font-size: .98rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-project-card p {
  margin: 0;
  color: var(--muted);
  overflow: hidden;
  font-size: .82rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-card-meta {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.project-card-meta span {
  border: 1px solid rgba(29, 99, 255, .2);
  border-radius: 999px;
  padding: 5px 8px;
  background: #f8fbff;
  color: #10213d;
  font-size: .76rem;
  font-weight: 700;
}

.project-card-meta span:first-child {
  border-color: rgba(230, 57, 70, .55);
  color: #10213d;
  box-shadow: inset 3px 0 0 var(--patriot-red);
}

.project-card-activity {
  border-top: 0;
  padding-top: 0;
}

.project-card-activity strong,
.project-card-activity time {
  display: block;
}

.project-card-activity strong {
  margin-bottom: 2px;
  color: #10213d;
  font-size: .85rem;
}

.project-card-activity time {
  color: var(--muted);
  font-size: .78rem;
}

.project-card-actions button {
  flex: 1;
  min-height: 32px;
  font-size: .8rem;
}

.empty-dashboard-card {
  grid-column: 1 / -1;
}

.sales-view {
  display: block;
}

.sales-layout {
  display: grid;
  grid-template-columns: minmax(280px, 330px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.sales-intake {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 10px;
}

.sales-intake h3 {
  margin-bottom: 2px;
}

.form-grid.two-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.form-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.form-actions button:only-child,
.form-actions button.hidden + button,
.form-actions button:not(.hidden):first-child:last-child {
  grid-column: 1 / -1;
}

.sales-board-wrap {
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 8px;
}

.sales-board {
  min-width: 980px;
  display: grid;
  grid-template-columns: repeat(6, minmax(160px, 1fr));
  gap: 8px;
}

.sales-column {
  min-height: calc(100vh - 275px);
  display: grid;
  grid-template-rows: auto 1fr;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
}

.sales-column-head {
  display: grid;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  padding: 8px;
  background:
    linear-gradient(90deg, var(--patriot-red) 0 3px, transparent 3px),
    linear-gradient(180deg, #ffffff, #f3f6fb);
}

.sales-column-head h3 {
  margin: 0;
  font-size: .94rem;
  color: #10213d;
}

.sales-column-head span {
  color: #5f6e84;
  font-size: .75rem;
  font-weight: 650;
}

.sales-column-list {
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 7px;
}

.sales-card {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(93, 140, 255, .2);
  border-radius: 6px;
  padding: 8px;
  background:
    linear-gradient(90deg, var(--patriot-red) 0 3px, transparent 3px),
    #ffffff;
  box-shadow: none;
}

.sales-card.is-editing {
  border-color: rgba(93, 140, 255, .85);
  box-shadow: 0 0 0 2px rgba(29, 99, 255, .22), 0 16px 32px rgba(0, 0, 0, .22);
}

.sales-card-top,
.sales-card-values,
.sales-card-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.sales-card-top,
.sales-card-values {
  justify-content: space-between;
}

.sales-card-top strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.sales-card-top span,
.sales-card-values span,
.sales-card-contact span {
  border-radius: 999px;
  padding: 4px 7px;
  background: rgba(29, 99, 255, .14);
  color: #1d4ed8;
  font-size: .7rem;
  font-weight: 700;
}

.sales-card p {
  margin: 0;
  color: #475569;
  font-size: .84rem;
  line-height: 1.35;
}

.sales-card-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sales-card-notes {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.sales-card-actions {
  flex-wrap: wrap;
}

.sales-card-actions button {
  min-height: 31px;
  flex: 1;
  min-width: 92px;
  padding-inline: 8px;
  font-size: .8rem;
}

.danger-lite {
  color: #ffbec5;
}

.empty-sales-stage {
  border: 1px dashed rgba(29, 99, 255, .24);
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, .65);
  text-align: center;
  font-weight: 650;
}

.clients-view {
  display: block;
}

.clients-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
}

.clients-intake {
  display: grid;
  gap: 10px;
}

.clients-intake h3 {
  margin-bottom: 2px;
}

.billing-month-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.billing-month-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.billing-month-toolbar h3 {
  margin-bottom: 4px;
  font-size: 1.25rem;
}

.billing-month-controls {
  display: grid;
  grid-template-columns: auto minmax(145px, 1fr) auto auto;
  gap: 7px;
  align-items: center;
}

.billing-month-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.billing-month-metrics div {
  border: 1px solid rgba(93, 140, 255, .18);
  border-radius: 8px;
  padding: 10px;
  background: #141b27;
  color: #f8fafc;
}

.billing-month-metrics span {
  display: block;
  margin-bottom: 5px;
  color: #9fb0c9;
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.billing-month-metrics strong {
  color: #ffffff;
  font-size: 1.22rem;
}

.billing-month-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 10px;
  overflow-x: auto;
}

.billing-month-column {
  min-width: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.billing-month-column-head {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  background: linear-gradient(180deg, #1b2230, #121925);
  color: #ffffff;
}

.billing-month-column-head h4 {
  margin: 0 0 4px;
  font-size: .92rem;
}

.billing-month-column-head span,
.billing-month-column-head p {
  display: block;
  margin: 0;
  color: #9fb0c9;
  font-size: .74rem;
  font-weight: 850;
}

.billing-month-list {
  display: grid;
  gap: 8px;
  padding: 8px;
}

.billing-month-item,
.empty-billing-month {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(93, 140, 255, .16);
  border-radius: 8px;
  padding: 10px;
  background: #151d2b;
  color: #f8fafc;
}

.billing-month-item.paid {
  box-shadow: inset 4px 0 0 #31c48d;
}

.billing-month-item.overdue {
  box-shadow: inset 4px 0 0 var(--patriot-red);
}

.billing-month-item.skipped {
  opacity: .75;
  box-shadow: inset 4px 0 0 #697386;
}

.billing-month-item strong,
.billing-month-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.billing-month-item span,
.empty-billing-month {
  color: #9fb0c9;
  font-size: .78rem;
  font-weight: 800;
}

.billing-month-actions {
  display: flex;
  gap: 6px;
}

.billing-month-actions button {
  flex: 1;
  min-height: 32px;
  padding-inline: 8px;
  font-size: .76rem;
}

.clients-directory {
  display: grid;
  gap: 10px;
  min-width: 0;
  overflow: auto;
}

.client-list-head,
.client-card {
  display: grid;
  grid-template-columns: minmax(210px, 1.35fr) minmax(170px, 1fr) minmax(150px, .8fr) minmax(150px, .8fr) minmax(120px, .65fr) minmax(230px, .9fr);
  gap: 10px;
  align-items: center;
}

.client-list-head {
  border-bottom: 1px solid var(--line);
  padding: 0 10px 8px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.clients-list {
  display: grid;
  gap: 8px;
  min-width: 980px;
}

.client-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background:
    linear-gradient(90deg, var(--patriot-red) 0 4px, transparent 4px),
    linear-gradient(135deg, rgba(29, 99, 255, .13), transparent 48%),
    var(--surface);
  box-shadow: none;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.client-card:hover,
.client-card.is-selected {
  border-color: rgba(93, 140, 255, .72);
  background:
    linear-gradient(90deg, var(--patriot-red) 0 4px, transparent 4px),
    linear-gradient(135deg, rgba(29, 99, 255, .24), transparent 55%),
    #eef4ff;
}

.client-card:focus-visible {
  outline: 2px solid rgba(93, 140, 255, .85);
  outline-offset: 2px;
}

.client-card.is-editing {
  border-color: rgba(93, 140, 255, .85);
  box-shadow: 0 0 0 2px rgba(29, 99, 255, .22), 0 16px 32px rgba(0, 0, 0, .22);
}

.client-primary,
.client-money-row,
.client-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.client-primary {
  justify-content: flex-start;
  min-width: 0;
}

.client-primary > div,
.client-project-cell,
.client-next-cell {
  min-width: 0;
}

.client-card h3 {
  margin: 0;
  overflow: hidden;
  font-size: .98rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-card p,
.client-project-cell span,
.client-next-cell span {
  margin: 0;
  color: var(--muted);
  overflow: hidden;
  font-size: .78rem;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-project-cell strong,
.client-next-cell strong {
  display: block;
  overflow: hidden;
  color: #10213d;
  font-size: .86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-money-row,
.client-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.client-money-row span,
.client-card-meta span {
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(29, 99, 255, .14);
  color: #0f3d91;
  font-size: .73rem;
  font-weight: 900;
}

.client-money-row span:first-child {
  background: rgba(230, 57, 70, .13);
  color: #a82734;
}

.client-card-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.client-card-actions button {
  min-height: 34px;
  flex: 1;
  min-width: 88px;
  padding-inline: 8px;
  font-size: .8rem;
}

.undo-paid-button {
  color: #dbe6ff;
  box-shadow: inset 0 0 0 1px rgba(93, 140, 255, .36);
}

.client-record-stack {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.client-record-drawer,
.client-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.drawer-backdrop,
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .48);
}

.client-record-shell {
  position: absolute;
  top: 0;
  right: 0;
  width: min(760px, calc(100vw - 24px));
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  padding: 14px;
  border-left: 1px solid var(--line);
  background: #111722;
  box-shadow: -20px 0 50px rgba(0, 0, 0, .34);
  overflow: auto;
}

.drawer-close-button {
  justify-self: end;
}

.client-modal {
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(740px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
}

.modal-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.client-record-panel {
  display: grid;
  gap: 14px;
  box-shadow: none;
}

.client-record-header,
.client-record-title,
.client-record-actions,
.record-section-head,
.record-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.client-record-header {
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.client-record-title {
  min-width: 0;
}

.client-record-title h3 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.05;
}

.client-record-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.client-record-actions button {
  min-height: 38px;
}

.client-record-stats,
.client-record-grid {
  display: grid;
  gap: 10px;
}

.client-record-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.client-record-stats div,
.record-section {
  border: 1px solid rgba(93, 140, 255, .16);
  border-radius: 8px;
  background: #141b27;
}

.client-record-stats div {
  padding: 12px;
}

.client-record-stats span,
.record-field-grid dt,
.record-section-head span {
  display: block;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.client-record-stats strong {
  display: block;
  margin-top: 4px;
  color: #f7fbff;
  font-size: 1rem;
}

.client-record-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.record-section {
  min-width: 0;
  padding: 12px;
}

.record-section-head {
  justify-content: space-between;
  margin-bottom: 10px;
}

.record-section h4,
.record-section-head h4 {
  margin: 0;
  font-size: .95rem;
}

.record-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.record-field-grid div {
  min-width: 0;
  border: 1px solid rgba(93, 140, 255, .13);
  border-radius: 8px;
  padding: 9px;
  background: rgba(7, 12, 21, .32);
}

.record-field-grid dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  color: #dbe6ff;
  font-size: .88rem;
  font-weight: 850;
}

.contact-record-section .record-field-grid div:last-child {
  grid-column: 1 / -1;
}

.record-list {
  display: grid;
  gap: 8px;
}

.record-list-item,
.empty-record-line {
  border: 1px solid rgba(93, 140, 255, .13);
  border-radius: 8px;
  padding: 10px;
  background: rgba(7, 12, 21, .32);
}

.record-list-item {
  justify-content: space-between;
}

.record-list-item strong,
.record-list-item span {
  display: block;
}

.record-list-item strong {
  color: #f7fbff;
  font-size: .9rem;
}

.record-list-item span,
.empty-record-line,
.record-notes p {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.45;
}

.record-list-item button {
  min-height: 32px;
  padding-inline: 12px;
}

.payment-history-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  overflow-x: auto;
}

.payment-history-head,
.payment-history-row {
  display: grid;
  grid-template-columns: minmax(95px, .65fr) minmax(180px, 1.2fr) minmax(95px, .65fr) minmax(110px, .65fr) minmax(190px, 1fr) minmax(90px, .55fr);
  gap: 10px;
  align-items: center;
  min-width: 880px;
}

.payment-history-head {
  border-bottom: 1px solid var(--line);
  padding: 0 10px 8px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.payment-history-list {
  display: grid;
  gap: 7px;
}

.payment-history-row,
.empty-payment-row {
  border: 1px solid rgba(93, 140, 255, .16);
  border-radius: 8px;
  padding: 10px;
  background: #141b27;
}

.payment-history-row span,
.payment-history-row strong,
.empty-payment-row {
  overflow: hidden;
  color: #dbe6ff;
  font-size: .84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-history-row span {
  color: var(--muted);
}

.payment-history-row.is-void {
  opacity: .65;
  background: #111722;
}

.agent-queue-view {
  display: block;
}

.queue-layout {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.queue-intake {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 10px;
}

.queue-intake h3,
.queue-board-panel h3 {
  margin-bottom: 2px;
}

.queue-board-panel {
  min-height: calc(100vh - 285px);
}

.agent-queue-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 10px;
}

.queue-card {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background:
    linear-gradient(90deg, var(--hub-accent) 0 4px, transparent 4px),
    linear-gradient(180deg, #1b2230, var(--surface));
  box-shadow: var(--shadow);
}

.queue-card.running {
  background:
    linear-gradient(90deg, #5d8cff 0 4px, transparent 4px),
    linear-gradient(180deg, #1b2230, var(--surface));
}

.queue-card.completed {
  background:
    linear-gradient(90deg, #2bbd72 0 4px, transparent 4px),
    linear-gradient(180deg, #1b2230, var(--surface));
}

.queue-card.failed {
  background:
    linear-gradient(90deg, var(--patriot-red) 0 4px, transparent 4px),
    linear-gradient(180deg, #1b2230, var(--surface));
}

.queue-card-head,
.queue-card-footer,
.queue-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.queue-card-head,
.queue-card-footer {
  justify-content: space-between;
}

.queue-kind,
.queue-status,
.queue-meta span {
  border-radius: 999px;
  padding: 5px 8px;
  background: #111823;
  color: #aeb8c9;
  font-size: .76rem;
  font-weight: 900;
}

.queue-status {
  color: #dbe6ff;
  background: rgba(29, 99, 255, .14);
}

.queue-card h3,
.queue-card p {
  margin: 0;
}

.queue-card h3 {
  font-size: 1.05rem;
}

.queue-card p {
  color: #dbe6ff;
  line-height: 1.42;
}

.queue-meta {
  flex-wrap: wrap;
}

.queue-card-footer time {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
}

.queue-card-footer .button-row {
  flex-wrap: nowrap;
}

.queue-empty {
  grid-column: 1 / -1;
  min-height: 220px;
}

.supabase-view {
  display: block;
}

.supabase-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 12px;
  align-items: start;
}

.schema-panel {
  margin-top: 12px;
}

.supabase-config-form {
  display: grid;
  gap: 10px;
}

.supabase-table-status {
  margin-top: 12px;
}

.table-status-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: #10213d;
  font-size: .88rem;
}

.table-status-head span {
  color: #51627a;
  font-weight: 800;
}

.table-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 7px;
}

.table-status-item {
  border: 1px solid rgba(230, 57, 70, .38);
  border-radius: 7px;
  padding: 8px;
  background: #fff5f6;
  color: #10213d;
}

.table-status-item.ready {
  border-color: rgba(29, 99, 255, .46);
  background: #dbe8ff;
}

.table-status-item strong,
.table-status-item span {
  display: block;
  overflow-wrap: anywhere;
}

.table-status-item strong {
  margin-bottom: 4px;
  color: #10213d;
  font-size: .82rem;
}

.table-status-item span {
  color: #385174;
  font-size: .76rem;
  line-height: 1.35;
}

.auth-readiness-list {
  display: grid;
  gap: 7px;
}

.auth-readiness-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px;
  background: #f8fafc;
  color: #51627a;
}

.auth-readiness-item span {
  display: grid;
  place-items: center;
  min-height: 24px;
  border-radius: 5px;
  background: #dbe8ff;
  color: #0f2f75;
  font-size: .7rem;
  font-weight: 900;
}

.auth-readiness-item strong,
.auth-readiness-item small {
  display: block;
}

.auth-readiness-item small {
  margin-top: 2px;
  color: #64748b;
  font-size: .76rem;
  font-weight: 800;
  line-height: 1.3;
}

.auth-readiness-item.ready {
  border-color: rgba(29, 99, 255, .48);
  color: #10213d;
}

.auth-readiness-item.ready span {
  background: #1d63ff;
  color: #fff;
}

.auth-readiness-item.ready small {
  color: #385174;
}

.schema-table-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.schema-table-card {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  background: #f8fafc;
}

.schema-table-card strong {
  display: block;
  margin-bottom: 5px;
  color: #10213d;
}

.schema-table-card p {
  margin: 0;
  color: #51627a;
  line-height: 1.4;
}

.schema-sql {
  max-height: 380px;
  margin: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  background: #090d14;
  color: #d7e3ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.team-chat-view {
  height: auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: visible;
}

.team-chat-view .dashboard-header {
  margin-bottom: 10px;
}

.chat-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(280px, 340px) minmax(230px, 280px);
  gap: 10px;
  align-items: start;
  width: 100%;
  max-width: none;
  overflow: visible;
}

.chat-panel {
  grid-column: 1;
  min-height: 0;
  height: min(560px, calc(100vh - 210px));
  min-height: 420px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-color: #cbd5e1;
  background: #ffffff;
}

.chat-channel-bar {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 10px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  background: #ffffff;
}

.chat-channel-bar label {
  margin: 0;
}

.chat-channel-bar select {
  min-height: 34px;
}

.chat-channel-bar .helper {
  margin: 0 0 3px;
  overflow: hidden;
  color: #51627a;
  font-size: .8rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-messages {
  min-height: 0;
  max-height: none;
  display: grid;
  align-content: start;
  gap: 6px;
  overflow: auto;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 10px 12px;
  background:
    linear-gradient(180deg, rgba(29, 99, 255, .05), transparent 260px),
    #f8fafc;
  scrollbar-color: #94a3b8 #e5e7eb;
  scrollbar-width: thin;
}

.chat-messages::-webkit-scrollbar,
.chat-info-panel::-webkit-scrollbar {
  width: 10px;
}

.chat-messages::-webkit-scrollbar-track,
.chat-info-panel::-webkit-scrollbar-track {
  background: #e5e7eb;
}

.chat-messages::-webkit-scrollbar-thumb,
.chat-info-panel::-webkit-scrollbar-thumb {
  border: 2px solid #e5e7eb;
  border-radius: 999px;
  background: #94a3b8;
}

.chat-message {
  width: fit-content;
  max-width: min(460px, 76%);
  display: grid;
  grid-template-columns: 26px minmax(0, auto);
  gap: 7px;
  align-items: end;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.chat-message > div {
  min-width: 0;
  border: 1px solid #d7e0ee;
  border-radius: 12px 12px 12px 4px;
  padding: 6px 8px;
  background: #ffffff;
  color: #10213d;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .08);
}

.chat-message.is-mine {
  justify-self: end;
  grid-template-columns: minmax(0, auto) 26px;
}

.chat-message.is-mine .chat-avatar {
  grid-column: 2;
  grid-row: 1;
}

.chat-message.is-mine > div {
  grid-column: 1;
  grid-row: 1;
  border-color: rgba(29, 99, 255, .35);
  border-radius: 12px 12px 4px 12px;
  background: #1d63ff;
  color: #ffffff;
}

.chat-avatar,
.profile-avatar {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--profile-color, var(--hub-accent));
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}

.chat-message-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  margin-bottom: 2px;
}

.chat-message-head strong {
  color: inherit;
  font-size: .76rem;
}

.chat-message-head time {
  color: #647086;
  font-size: .65rem;
}

.chat-message.is-mine .chat-message-head time {
  color: #dbe7ff;
}

.chat-message p {
  margin: 0;
  color: inherit;
  font-size: .84rem;
  line-height: 1.35;
  white-space: pre-wrap;
}

.empty-chat {
  align-self: center;
  justify-self: center;
  max-width: 420px;
  text-align: center;
  color: #10213d;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(135px, 180px) minmax(0, 1fr) auto;
  gap: 6px;
  align-items: end;
  padding: 7px;
  background: #ffffff;
  border-top: 1px solid var(--line);
}

.chat-form.profile-locked {
  grid-template-columns: minmax(0, 1fr) auto;
}

.chat-form.profile-locked #chat-profile {
  display: none;
}

.chat-form textarea {
  min-height: 38px;
  max-height: 72px;
  resize: vertical;
  padding-right: 18px;
  background: #ffffff;
  color: #0f1726;
  line-height: 1.35;
}

.chat-form button {
  min-height: 36px;
}

.chat-info-panel {
  grid-column: 3;
  min-height: 0;
  height: auto;
  max-height: min(560px, calc(100vh - 210px));
  align-self: stretch;
  overflow: auto;
  padding: 10px;
  background: #ffffff;
  border-color: #cbd5e1;
}

.chat-workspace-panel {
  grid-column: 2;
  display: grid;
  gap: 10px;
  max-height: min(560px, calc(100vh - 210px));
  overflow: auto;
}

.chat-workspace-head h3 {
  margin-bottom: 3px;
}

.chat-workspace-head .helper {
  margin: 0;
}

.chat-tool-section {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px;
  background: #f8fafc;
}

.chat-tool-section h4,
.section-row h4 {
  margin: 0;
  color: #10213d;
  font-size: .86rem;
}

.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mini-button {
  min-height: 28px;
  padding-inline: 10px;
  font-size: .76rem;
}

#chat-pinned-note {
  min-height: 84px;
  max-height: 150px;
  resize: vertical;
  background: #ffffff;
}

.chat-action-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.chat-action-form button {
  min-height: 34px;
}

.chat-action-list,
.chat-activity-list {
  display: grid;
  gap: 6px;
}

.chat-activity-list {
  max-height: 190px;
  overflow: auto;
  padding-right: 2px;
}

.chat-action-item,
.chat-activity-item,
.empty-line {
  border: 1px solid #d7e0ee;
  border-radius: 6px;
  padding: 7px;
  background: #ffffff;
}

.chat-action-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 7px;
  align-items: center;
}

.chat-action-item label {
  display: flex;
  min-width: 0;
  flex-direction: row;
  align-items: center;
  gap: 7px;
  color: #10213d;
  font-size: .82rem;
}

.chat-action-item input {
  width: auto;
}

.chat-action-item span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.chat-action-item.done span {
  color: #7b8798;
  text-decoration: line-through;
}

.icon-button {
  min-height: 28px;
  width: 28px;
  padding: 0;
  background: #eef4ff;
  color: #385174;
  box-shadow: none;
}

.chat-activity-item strong,
.chat-activity-item time {
  display: block;
}

.chat-activity-item strong {
  color: #10213d;
  font-size: .82rem;
  line-height: 1.3;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.chat-activity-item time {
  margin-top: 2px;
  color: #647086;
  font-size: .74rem;
}

.empty-line {
  margin: 0;
  color: #647086;
  font-size: .82rem;
}

.chat-channel-list {
  display: grid;
  gap: 5px;
  margin: 8px 0 12px;
}

.chat-channel-item {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 9px;
  background: #f8fafc;
  color: #10213d;
  box-shadow: none;
  text-align: left;
}

.chat-channel-item:hover,
.chat-channel-item.active {
  border-color: rgba(29, 99, 255, .44);
  background: #eef4ff;
}

.chat-channel-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-channel-item b {
  min-width: 22px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  padding: 0 6px;
  background: var(--patriot-red);
  color: #ffffff;
  font-size: .68rem;
  font-weight: 750;
}

.profile-list {
  display: grid;
  gap: 5px;
  margin: 8px 0;
}

.profile-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px;
  background: #f8fafc;
}

.profile-chip strong {
  color: #10213d;
}

.chat-guidance {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.chat-guidance summary {
  cursor: pointer;
  color: #1d4ed8;
  font-weight: 850;
}

.profile-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 7px;
  margin-bottom: 14px;
}

.profile-form button {
  grid-column: 1 / -1;
}

.profile-form input[type="color"] {
  min-height: 38px;
  padding: 4px;
}

.eyebrow {
  margin-bottom: 6px;
  color: #7fa6ff;
  font-size: .74rem;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.project-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.project-header h2 {
  margin-bottom: 4px;
  font-size: clamp(1.55rem, 2.1vw, 2.25rem);
  line-height: 1;
}

.status-pill {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: linear-gradient(135deg, #1b2b4b, #17202f);
  font-weight: 800;
  color: #cfe0ff;
}

.tabs {
  display: flex;
  gap: 3px;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  background: rgba(23, 27, 34, .92);
  margin-bottom: 10px;
}

.tab {
  border-radius: 5px;
  min-height: 32px;
  background: transparent;
  color: var(--muted);
}

.tab.active {
  background: linear-gradient(180deg, #2b77ff, var(--green));
  color: #f4f8ff;
}

.cloud-mode .tab[data-tab="preview"],
.cloud-mode .tab[data-tab="github"] {
  opacity: .42;
}

.tab-page {
  display: block;
}

.hidden {
  display: none !important;
}

.grid {
  display: grid;
  gap: 10px;
}

.grid.two {
  grid-template-columns: minmax(0, 1fr) minmax(280px, .55fr);
  align-items: start;
}

#project-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  align-content: start;
}

#project-form h3,
#project-form > label:first-of-type,
#project-form > label:nth-of-type(2),
#project-form > label:nth-of-type(3),
#project-form > label:last-of-type,
#project-form .button-row {
  grid-column: 1 / -1;
}

#project-form input,
#project-form select {
  min-height: 34px;
}

#project-form textarea {
  min-height: 78px;
  max-height: 150px;
}

#project-form .form-grid.two-fields {
  grid-column: 1 / -1;
  gap: 9px;
}

#event-list {
  max-height: 360px;
  overflow: auto;
}

.event-list,
.task-list,
.file-list {
  display: grid;
  gap: 6px;
}

.event,
.task,
.file-row {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 8px;
  background: var(--surface-2);
}

.task {
  width: 100%;
  min-height: auto;
  color: var(--ink);
  text-align: left;
  font-weight: 750;
}

.task.active {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.task.running {
  border-color: var(--amber);
  background: #17233f;
}

.task.completed {
  border-color: #4f75d6;
  background: #172642;
}

.task.failed {
  border-color: #b86b6b;
  background: #2b1b1f;
}

.event time,
.task time {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: .78rem;
}

.task p {
  margin-bottom: 8px;
}

.changed-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.changed-files span {
  border-radius: 999px;
  padding: 5px 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
}

.file-layout {
  display: grid;
  grid-template-columns: minmax(210px, 280px) minmax(0, 1fr);
  gap: 10px;
}

.github-write-tools {
  display: grid;
  grid-template-columns: minmax(220px, 420px) minmax(0, 1fr);
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}

.github-write-tools label {
  margin: 0;
}

.github-write-tools input {
  min-height: 38px;
}

.github-write-tools .compact-result {
  margin: 0;
  color: #647086;
}

.github-write-tools a {
  color: #8fb2ff;
  overflow-wrap: anywhere;
}

.file-review-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
  border: 1px solid rgba(93, 140, 255, .32);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 12px;
  background: #101722;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .16);
}

.file-review-panel .panel-head {
  margin-bottom: 0;
}

.file-review-panel h3 {
  margin: 0;
}

.file-review-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.file-review-meta span {
  border: 1px solid rgba(93, 140, 255, .22);
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(29, 99, 255, .11);
  color: #dbe7ff;
  font-size: .76rem;
  font-weight: 900;
}

.file-review-diff {
  max-height: 280px;
  margin: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  background: #080d16;
  color: #d7e3ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .8rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.preview-shell {
  min-height: 72vh;
}

#preview-frame {
  width: 100%;
  min-height: 70vh;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111;
}

.run-log {
  max-height: 420px;
  margin: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #090d14;
  color: #d7e3ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.github-status,
.github-write-status,
.provider-status {
  display: grid;
  gap: 8px;
}

.github-status dl,
.github-write-status dl,
.provider-status dl {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
}

.github-status dt,
.github-write-status dt,
.provider-status dt {
  color: var(--muted);
  font-weight: 900;
}

.github-status dd,
.github-write-status dd,
.provider-status dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.github-write-panel {
  grid-column: 1 / -1;
}

.write-status-card {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(230, 57, 70, .34);
  border-radius: 8px;
  padding: 10px;
  background: rgba(230, 57, 70, .1);
}

.write-status-card.warning {
  border-color: rgba(240, 180, 41, .4);
  background: rgba(240, 180, 41, .1);
}

.write-status-card.ready {
  border-color: rgba(43, 189, 114, .42);
  background: rgba(43, 189, 114, .1);
}

.write-status-card span {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: .72rem;
  font-weight: 750;
  text-transform: uppercase;
}

.write-status-card strong {
  color: #edf4ff;
  line-height: 1.35;
}

.setup-steps {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 10px;
  margin-top: 12px;
}

.setup-steps span {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(29, 99, 255, .22);
  color: #cfe0ff;
  font-size: .78rem;
  font-weight: 750;
}

.setup-steps p {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.4;
}

.github-token-command {
  margin: 12px 0 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  background: #080d16;
  color: #d7e3ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem;
  overflow: auto;
}

.provider-warning {
  margin: 10px 0 0;
  border: 1px solid rgba(93, 140, 255, .34);
  border-radius: 7px;
  padding: 9px 10px;
  background: rgba(29, 99, 255, .11);
  color: #cfe0ff;
  font-weight: 800;
  line-height: 1.4;
}

.deploy-review-box {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: #111823;
}

.deploy-review-box .panel-head {
  align-items: flex-start;
}

.deploy-review-list {
  display: grid;
  gap: 7px;
  max-height: 230px;
  overflow: auto;
}

.deploy-change-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(93, 140, 255, .2);
  border-radius: 7px;
  padding: 8px;
  background: #0e141f;
}

.deploy-change-row span {
  border-radius: 999px;
  padding: 4px 7px;
  background: rgba(29, 99, 255, .14);
  color: #cfe0ff;
  font-size: .72rem;
  font-weight: 750;
  text-transform: uppercase;
}

.deploy-change-row.added span {
  background: rgba(43, 189, 114, .14);
  color: #a5efc5;
}

.deploy-change-row.deleted span {
  background: rgba(230, 57, 70, .14);
  color: #ffb4bc;
}

.deploy-change-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.deploy-change-row small,
.deploy-clean-state {
  color: var(--muted);
  font-weight: 800;
}

.deploy-clean-state {
  border: 1px dashed rgba(93, 140, 255, .28);
  border-radius: 7px;
  padding: 10px;
  text-align: center;
}

.deploy-actions {
  flex-wrap: wrap;
  margin-top: 12px;
}

.deploy-actions button {
  flex: 1;
  min-width: 150px;
}

.deployment-list {
  display: grid;
  gap: 8px;
}

.deployment-row {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  background: #111823;
}

.deployment-row div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.deployment-row strong {
  color: #f8fafc;
  text-transform: capitalize;
}

.deployment-row time,
.deployment-row span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
}

.deployment-row a,
.result a {
  color: #8fb2ff;
  overflow-wrap: anywhere;
}

.backup-export-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}

.github-output {
  min-height: 120px;
  margin: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #11161f;
  color: #dbe7ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.file-row {
  width: 100%;
  min-height: 34px;
  border-color: #d8e1ee;
  background: #f8fafc;
  color: #10213d;
  text-align: left;
  font-weight: 650;
  box-shadow: none;
}

.file-row.active {
  border-color: #1d63ff;
  background: #1d63ff;
  color: #ffffff;
}

.file-row:hover {
  border-color: rgba(29, 99, 255, .45);
  background: #eef4ff;
  color: #10213d;
}

.file-row.active:hover {
  background: #1d63ff;
  color: #ffffff;
}

.editor-panel {
  min-width: 0;
}

.path-input {
  min-width: 180px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.button-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.split-actions {
  justify-content: space-between;
}

.split-actions button {
  flex: 0 0 auto;
}

.code-editor {
  min-height: 61vh;
  background: #ffffff;
  color: #10213d;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .9rem;
  line-height: 1.55;
  tab-size: 2;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.checklist {
  margin-bottom: 0;
  padding-left: 20px;
  color: var(--muted);
}

.result {
  margin: 14px 0 0;
  color: #8fb2ff;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.compact-result {
  min-height: 1.2em;
  margin: -2px 0 8px;
  font-size: .88rem;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: min(420px, calc(100vw - 40px));
  border-radius: 8px;
  border: 1px solid rgba(29, 99, 255, .45);
  padding: 12px 15px;
  background: #172033;
  color: #dbe7ff;
  font-family: inherit;
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.35;
  box-shadow: var(--shadow);
}

.login-gate,
.profile-gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(5, 8, 13, .78);
  backdrop-filter: blur(10px);
}

.login-gate {
  overflow: hidden;
  background: #02060b;
  backdrop-filter: none;
}

.login-gate::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 50% 42%, rgba(241, 200, 105, .08), transparent 300px),
    rgba(2, 6, 11, .66);
}

.login-site-backdrop {
  position: absolute;
  inset: -18px;
  width: calc(100% + 36px);
  height: calc(100% + 36px);
  border: 0;
  filter: blur(10px) brightness(.58) saturate(.9);
  transform: scale(1.03);
  transform-origin: center;
  pointer-events: none;
}

.login-card,
.profile-gate-card {
  width: min(560px, 100%);
  border: 1px solid rgba(93, 140, 255, .28);
  border-radius: 10px;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(29, 99, 255, .12), transparent 180px),
    #121824;
  color: #edf4ff;
  box-shadow: var(--shadow);
}

.login-card {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 12px;
}

.login-card h2,
.profile-gate-card h2 {
  margin-bottom: 8px;
  color: #f8fbff;
  font-size: clamp(1.55rem, 3vw, 2.4rem);
  line-height: 1;
}

.login-card .helper,
.profile-gate-card .helper {
  color: #b7c6dd;
}

.login-card .result {
  min-height: 1.2em;
  margin-top: 0;
}

.remember-row {
  display: flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  color: #d8e4f8;
  font-weight: 800;
  cursor: pointer;
}

.remember-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--hub-accent);
}

.login-actions {
  display: grid;
  grid-template-columns: minmax(0, .36fr) minmax(0, .64fr);
  gap: 10px;
}

.login-cancel-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 6px;
  background: #202632;
  color: #dbe7ff;
  font-weight: 800;
  text-decoration: none;
}

.login-cancel-button:hover {
  border-color: rgba(93, 140, 255, .55);
  background: #273047;
}

.profile-gate-list {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.profile-gate-option {
  min-height: 64px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #101722;
  color: #edf4ff;
  text-align: left;
}

.profile-gate-option:hover {
  border-color: rgba(29, 99, 255, .65);
  background: #14213a;
}

.profile-gate-option .profile-avatar {
  width: 40px;
  height: 40px;
}

.profile-gate-option strong,
.profile-gate-option small {
  display: block;
}

.profile-gate-option strong {
  color: #f8fbff;
  font-size: 1rem;
}

.profile-gate-option small {
  margin-top: 3px;
  color: #a9b9d1;
  font-size: .78rem;
  font-weight: 800;
}

.profile-gate-note {
  margin: 14px 0 0;
  color: #a9b9d1;
  font-size: .82rem;
  line-height: 1.45;
}

.workspace {
  background:
    radial-gradient(circle at top right, rgba(241, 200, 105, .12), transparent 420px),
    linear-gradient(180deg, #07111d 0, #050b12 460px),
    var(--bg);
}

.panel,
.metric-card,
.dashboard-project-card,
.sales-column,
.client-card,
.project-directory-controls,
.billing-month-column,
.empty-dashboard-card {
  border-color: rgba(255, 255, 255, .14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .045), transparent 180px),
    #101722;
  color: #f7f7f2;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .2);
}

.metric-card {
  border-left: 4px solid var(--gold);
  background:
    linear-gradient(135deg, rgba(241, 200, 105, .12), transparent 56%),
    #101722;
}

.metric-card span,
.project-filter-summary,
.client-filter-summary,
.helper,
#project-description,
.dashboard-project-card p,
.client-card p,
.client-project-cell span,
.client-next-cell span,
.sales-card p,
.empty-sales-stage,
.empty-billing-month {
  color: #aab3bf;
}

.metric-card strong,
.dashboard-header h2,
.dashboard-project-card h3,
.project-card-activity strong,
.sales-column-head h3,
.sales-card-top strong,
.client-card h3,
.client-project-cell strong,
.client-next-cell strong,
.panel h2,
.panel h3 {
  color: #f7f7f2;
}

.dashboard-header {
  border-bottom-color: rgba(255, 255, 255, .14);
}

.command-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.35fr) minmax(260px, .85fr) minmax(260px, .85fr);
  gap: 10px;
  margin: 0 0 12px;
}

.command-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 214px;
}

.command-card-wide {
  min-width: 0;
}

.command-list {
  display: grid;
  gap: 8px;
}

.command-row,
.command-empty {
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(5, 11, 18, .72);
  color: #f7f7f2;
  text-align: left;
  box-shadow: none;
}

.command-row:hover {
  border-color: rgba(241, 200, 105, .42);
  background: rgba(241, 200, 105, .08);
}

.command-row.is-selected {
  border-color: rgba(241, 200, 105, .62);
  background:
    linear-gradient(90deg, var(--gold) 0 3px, transparent 3px),
    rgba(241, 200, 105, .1);
}

.command-row span {
  min-width: 0;
}

.command-row strong,
.command-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-row strong {
  font-size: .92rem;
}

.command-row small {
  margin-top: 3px;
  color: #aab3bf;
  font-size: .76rem;
  font-weight: 750;
}

.command-row em {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(241, 200, 105, .14);
  color: #ffe6a8;
  font-size: .74rem;
  font-style: normal;
  font-weight: 900;
}

.command-empty {
  justify-content: center;
  color: #aab3bf;
  font-weight: 750;
}

.dashboard-lead-preview {
  border: 1px solid rgba(241, 200, 105, .25);
  border-radius: 8px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(241, 200, 105, .1), rgba(5, 11, 18, .76));
}

.lead-preview-card {
  display: grid;
  gap: 10px;
}

.lead-preview-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.lead-preview-head span,
.lead-preview-card dt {
  color: #91a4c1;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.lead-preview-head h4 {
  margin: 3px 0 0;
  color: #f7f7f2;
  font-size: 1rem;
}

.lead-preview-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.lead-preview-card dd {
  margin: 3px 0 0;
  color: #f7f7f2;
  font-size: .8rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.lead-preview-card p {
  margin: 0;
  border-top: 1px solid rgba(255, 255, 255, .1);
  padding-top: 10px;
  color: #c4cedd;
  font-size: .82rem;
  line-height: 1.45;
}

.project-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-card-status,
.project-card-meta span,
.sales-card-top span,
.sales-card-values span,
.sales-card-contact span,
.client-money-row span,
.client-card-meta span,
.status-pill {
  border-color: rgba(241, 200, 105, .34);
  background: rgba(241, 200, 105, .13);
  color: #ffe6a8;
}

.project-card-icon {
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  color: #101722;
}

.sales-column-head,
.billing-month-column-head {
  border-bottom-color: rgba(255, 255, 255, .14);
  background:
    linear-gradient(90deg, var(--gold) 0 3px, transparent 3px),
    linear-gradient(180deg, #151f2d, #101722);
}

.sales-card,
.billing-month-item,
.empty-billing-month,
.payment-history-row,
.empty-payment-row,
.record-section,
.client-record-stats div {
  border-color: rgba(255, 255, 255, .12);
  background: rgba(5, 11, 18, .72);
  color: #f7f7f2;
}

.client-card:hover,
.client-card.is-selected {
  border-color: rgba(241, 200, 105, .52);
  background:
    linear-gradient(90deg, var(--gold) 0 4px, transparent 4px),
    linear-gradient(135deg, rgba(241, 200, 105, .13), transparent 58%),
    #101722;
  color: #f7f7f2;
}

.client-card:hover h3,
.client-card.is-selected h3,
.client-card:hover .client-project-cell strong,
.client-card.is-selected .client-project-cell strong,
.client-card:hover .client-next-cell strong,
.client-card.is-selected .client-next-cell strong {
  color: #f7f7f2;
}

.client-card:hover p,
.client-card.is-selected p,
.client-card:hover .client-project-cell span,
.client-card.is-selected .client-project-cell span,
.client-card:hover .client-next-cell span,
.client-card.is-selected .client-next-cell span {
  color: #aab3bf;
}

.table-status-head,
.table-status-head span {
  color: #aab3bf;
}

.table-status-item,
.table-status-item.ready,
.schema-table-card {
  border-color: rgba(255, 255, 255, .12);
  background: rgba(5, 11, 18, .72);
  color: #f7f7f2;
}

.table-status-item.ready {
  border-color: rgba(241, 200, 105, .36);
}

.table-status-item.missing {
  border-color: rgba(241, 200, 105, .62);
  background: rgba(241, 200, 105, .08);
}

.table-status-item strong,
.schema-table-card strong {
  color: #f7f7f2;
}

.table-status-item span,
.schema-table-card p {
  color: #aab3bf;
}

.tabs {
  border-color: rgba(255, 255, 255, .14);
  background: #0b111c;
}

.tab {
  color: #aab3bf;
}

.tab.active {
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  color: #101722;
}

.file-row,
.deploy-clean-state,
.write-status-card,
.github-output,
.run-log,
.code-editor,
.file-review-diff,
.schema-preview,
.github-token-command {
  border-color: rgba(255, 255, 255, .12);
  background: #050b12;
  color: #f7f7f2;
}

.file-row.active,
.file-row:hover {
  background: rgba(241, 200, 105, .14);
  color: #ffe6a8;
}

.side-nav-item.active-accent.active {
  background:
    linear-gradient(90deg, var(--gold) 0 3px, transparent 3px),
    rgba(241, 200, 105, .12);
  color: #f7f7f2;
}

@media (max-width: 980px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .grid.two,
  .file-layout,
  .queue-layout,
  .clients-layout,
  .supabase-layout,
  .chat-layout,
  .command-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .project-filter-bar,
  .client-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .billing-month-toolbar {
    display: grid;
  }

  .billing-month-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .queue-intake,
  .clients-intake,
  .clients-directory {
    position: static;
    max-height: none;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .project-header,
  .panel-head,
  .button-row {
    align-items: stretch;
    flex-direction: column;
  }

  .backup-export-panel {
    grid-template-columns: 1fr;
  }

  .deploy-change-row {
    grid-template-columns: 1fr;
  }

  .tabs {
    overflow-x: auto;
  }

  .project-filter-bar,
  .client-filter-bar,
  .billing-month-controls,
  .billing-month-metrics,
  .client-record-stats,
  .client-record-grid,
  .record-field-grid,
  .dashboard-metrics {
    grid-template-columns: 1fr;
  }

  .action-grid {
    grid-template-columns: 1fr;
  }
}
