:root {
  color-scheme: dark;
  --bg: #0c1117;
  --surface: #121922;
  --surface-strong: #17212b;
  --surface-soft: #0f151d;
  --ink: #f4f7f8;
  --muted: #92a1ad;
  --line: #263440;
  --line-strong: #3a4a57;
  --green: #31d0aa;
  --coral: #ff765f;
  --violet: #9b8cff;
  --gold: #f3c75c;
  --blue: #48a7e8;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 75% 0%, rgba(49, 208, 170, 0.055), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 260px),
    var(--bg);
}

body.auth-page {
  display: grid;
  place-items: center;
  padding: 28px;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sprite {
  display: none;
}

.shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 20px;
  border-right: 1px solid var(--line);
  background: rgba(12, 17, 23, 0.88);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 42px;
}

.brand img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
}

.brand strong,
.brand span {
  display: block;
}

.brand span,
.eyebrow,
.metric-tile span,
.task-meta,
.signal-numbers span,
.daily-summary p,
.project-card small {
  color: var(--muted);
}

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

.sidebar-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding-top: 22px;
}

.user-pill {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.user-pill strong,
.user-pill span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-pill span,
.sync-status {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.sync-status {
  min-height: 18px;
  margin: 0;
}

.logout-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  background: var(--surface-strong);
}

.logout-link svg {
  transform: rotate(90deg);
}

.logout-link:hover,
.logout-link:focus-visible {
  border-color: var(--green);
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--muted);
  background: transparent;
}

.nav-button.is-active {
  color: var(--ink);
  border-color: var(--line);
  background: var(--surface-strong);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
}

.workspace {
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 154px;
  padding: 32px 36px;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 17, 23, 0.76);
  backdrop-filter: blur(10px);
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 3.5rem;
  line-height: 0.96;
}

h2 {
  margin-bottom: 0;
  font-size: 1rem;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(32vw, 320px);
  min-width: 220px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.search-field input,
.task-composer input,
.tool-panel input,
select {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

input::placeholder {
  color: #788895;
}

select option {
  color: var(--ink);
  background: var(--surface-strong);
}

.metric-tile {
  min-width: 164px;
  padding: 13px 16px;
  border-radius: var(--radius);
  color: var(--ink);
  background: #06090d;
  box-shadow: var(--shadow);
}

.metric-tile span {
  display: block;
  color: #efd062;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.metric-tile strong {
  display: block;
  font-size: 1.8rem;
  line-height: 1.1;
}

.view {
  display: none;
  padding: 30px 36px 48px;
}

.view.is-visible {
  display: block;
}

.content-grid,
.log-layout,
.project-layout,
.agent-layout,
.billing-layout,
.customers-layout,
.team-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 26px;
  align-items: start;
}

.primary-panel,
.timeline {
  min-width: 0;
}

.task-composer {
  display: grid;
  grid-template-columns: minmax(170px, 220px) minmax(170px, 220px) minmax(0, 1fr) 44px;
  gap: 12px;
  align-items: center;
  min-height: 70px;
  padding: 12px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.task-composer select,
.tool-panel select,
.tool-panel input,
.link-select {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface-strong);
}

.task-list {
  display: grid;
  gap: 18px;
}

.task-composer.needs-title {
  border-color: var(--coral);
  box-shadow: 0 0 0 1px rgba(255, 118, 95, 0.5), var(--shadow);
}

.task-composer.needs-title input::placeholder {
  color: var(--coral);
}

.task-group {
  display: grid;
  gap: 10px;
}

.task-group-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 0 2px;
  color: var(--muted);
  font-weight: 800;
}

.task-group-header div {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.task-group-header h2 {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.98rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-group-header strong {
  color: var(--ink);
}

.task-group-list {
  display: grid;
  gap: 10px;
}

.task-row {
  display: grid;
  grid-template-columns: 8px 44px minmax(0, 1fr) 112px 44px 44px;
  gap: 12px;
  align-items: center;
  min-height: 78px;
  padding: 10px 12px 10px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

.task-row.is-active {
  border-color: var(--green);
  box-shadow: 0 0 0 1px rgba(49, 208, 170, 0.5), var(--shadow);
}

.task-stripe {
  align-self: stretch;
  border-radius: 8px 0 0 8px;
  background: var(--project-color);
}

.task-complete {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface-soft);
}

.task-complete:hover,
.task-complete:focus-visible {
  border-color: var(--project-color);
  color: #06100d;
  background: var(--project-color);
}

.task-body {
  min-width: 0;
}

.task-title {
  margin-bottom: 6px;
  font-weight: 800;
  line-height: 1.25;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 700;
}

.pill::before,
.legend-dot,
.project-dot {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--project-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--project-color), transparent 78%);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 16px;
  border-radius: var(--radius);
  font-weight: 800;
}

.primary-button {
  border: 0;
  color: #06100d;
  background: var(--green);
}

.secondary-button {
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: var(--surface-strong);
}

.compact-button {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.86rem;
}

.task-row .secondary-button {
  width: 100%;
}

.task-row .link-select {
  width: min(260px, 100%);
}

.task-row .primary-button {
  grid-column: 4;
}

.task-project-menu {
  grid-column: 5;
  position: relative;
}

.task-project-menu summary {
  list-style: none;
}

.task-project-menu summary::-webkit-details-marker {
  display: none;
}

.task-project-menu[open] summary {
  border-color: var(--project-color);
  color: var(--project-color);
}

.task-project-menu .link-select {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 4;
  min-width: 260px;
  box-shadow: var(--shadow);
}

.task-row .task-delete {
  grid-column: 6;
}

.task-delete {
  color: var(--muted);
}

.task-delete:hover {
  color: #d34c3b;
}

.insights,
.project-tools,
.agent-detail,
.billing-summary {
  display: grid;
  gap: 16px;
}

.signal-panel,
.project-legend,
.daily-summary,
.tool-panel,
.mail-detail-card,
.billing-summary-card,
.billing-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.project-legend {
  background: rgba(23, 33, 43, 0.78);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--green);
}

.signal-numbers {
  display: grid;
  gap: 16px;
}

.signal-numbers div {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 14px;
  align-items: baseline;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.signal-numbers strong {
  font-size: 2.6rem;
  line-height: 1;
}

.signal-numbers div:last-child strong {
  color: var(--coral);
}

.progress-track {
  height: 12px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 99px;
  background: #26323b;
}

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.project-legend {
  display: grid;
  gap: 12px;
}

.legend-item {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  font-weight: 750;
}

.legend-item span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline {
  position: relative;
  padding-left: 72px;
}

.time-slot {
  position: relative;
  min-height: 72px;
  border-top: 1px solid var(--line);
}

.time-slot-label {
  position: absolute;
  left: -72px;
  top: -11px;
  width: 58px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-align: right;
}

.log-entry {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  margin: 12px 0;
  padding: 14px 18px;
  border: 1px solid color-mix(in srgb, var(--project-color), #17212b 54%);
  border-left: 6px solid var(--project-color);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--project-color), #121922 84%);
}

.log-entry strong {
  display: block;
  font-size: 1.03rem;
}

.log-entry span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.daily-summary {
  position: sticky;
  top: 28px;
}

.daily-summary strong {
  display: block;
  margin-bottom: 10px;
  font-size: 3rem;
  line-height: 1;
}

.compact-input,
.manual-time-form select,
.manual-time-form input[type="text"],
.manual-time-form input[type="date"],
.manual-time-form input[type="time"] {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface-soft);
}

.compact-input {
  margin-bottom: 14px;
}

.manual-time-form {
  display: grid;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.compact-title {
  margin-bottom: 4px;
}

.manual-time-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 108px;
  gap: 10px;
}

.check-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.check-row input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--green);
}

.project-dashboard {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.customers-panel,
.team-panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.customers-notes,
.team-notes {
  display: grid;
  gap: 16px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.panel-heading h2 {
  font-size: 1.4rem;
}

.panel-heading p:last-child {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.team-create-form {
  display: grid;
  grid-template-columns: minmax(160px, 1.1fr) minmax(180px, 1.2fr) 150px minmax(150px, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.team-create-form input,
.team-create-form select {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.project-controls {
  display: grid;
  grid-template-columns: 180px minmax(220px, 1fr);
  gap: 12px;
  max-width: 560px;
}

.project-controls select {
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.analytics-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.kpi-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent), var(--surface-strong);
  box-shadow: var(--shadow);
}

.kpi-card span,
.kpi-card small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.kpi-card span {
  margin-bottom: 8px;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.kpi-card strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 2rem;
  line-height: 1;
}

.kpi-card small {
  margin-top: 8px;
  font-size: 0.82rem;
}

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

.project-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-top: 7px solid var(--project-color);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.project-card.is-completed {
  opacity: 0.78;
  background: rgba(23, 33, 43, 0.72);
}

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

.project-card h2 {
  margin-bottom: 4px;
  font-size: 1.15rem;
  line-height: 1.25;
}

.project-category-read {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  margin-top: 6px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 0.82rem;
  font-weight: 850;
}

.project-company {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 1.18rem;
  font-weight: 950;
  line-height: 1.2;
}

.project-inline-edit {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}

.project-inline-edit span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.project-inline-edit input,
.project-inline-edit select {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface-soft);
}

.project-inline-edit input:focus,
.project-inline-edit select:focus {
  border-color: var(--green);
  outline: 0;
}

.project-inline-edit.is-compact {
  max-width: 260px;
}

.project-hours {
  flex: 0 0 auto;
  font-size: 1.65rem;
  font-weight: 900;
  line-height: 1;
}

.project-card-metrics {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: -6px 0 16px;
}

.project-card-metrics span {
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 0.84rem;
  font-weight: 850;
}

.project-customer-field {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 44px;
  margin-bottom: 16px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.project-customer-field span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.project-customer-field select {
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.project-customer-field.is-empty {
  color: var(--muted);
}

.project-customer-field.is-empty strong {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: end;
  gap: 8px;
  height: 72px;
  margin-bottom: 14px;
}

.bar-chart span {
  min-height: 10px;
  border-radius: 6px 6px 0 0;
  background: color-mix(in srgb, var(--project-color), #f4f7f8 16%);
}

.project-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.project-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.project-card footer .pill {
  min-width: 0;
  max-width: 100%;
}

.project-section-title,
.project-grid-empty {
  grid-column: 1 / -1;
}

.project-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 14px 2px 2px;
  border-top: 1px solid var(--line);
}

.project-section-title h2 {
  color: var(--ink);
  font-size: 1rem;
}

.project-section-title span {
  min-width: 30px;
  min-height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-soft);
  font-weight: 900;
}

.project-task-analysis {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.analysis-table-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.analysis-table-header h2 {
  margin-bottom: 5px;
  font-size: 1.08rem;
}

.analysis-table-header p {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 750;
}

.analysis-table-header strong {
  flex: 0 0 auto;
  color: var(--green);
  font-size: 1.25rem;
}

.analysis-table {
  display: grid;
}

.analysis-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 92px 112px 118px 120px;
  gap: 12px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}

.analysis-row:last-child {
  border-bottom: 0;
}

.analysis-task {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.analysis-task div {
  min-width: 0;
}

.analysis-task strong,
.billing-mini-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-task small,
.analysis-row > span {
  color: var(--muted);
  font-weight: 800;
}

.rate-field,
.time-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.rate-field input,
.time-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-weight: 850;
}

.rate-field span,
.time-field span {
  color: var(--muted);
  font-weight: 850;
}

.agent-inbox {
  display: grid;
  gap: 12px;
}

.mail-card {
  display: grid;
  gap: 7px;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--blue);
  border-radius: var(--radius);
  color: var(--ink);
  text-align: left;
  background: var(--surface-strong);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

.mail-card.is-active {
  border-color: var(--green);
  border-left-color: var(--green);
  box-shadow: 0 0 0 1px rgba(49, 208, 170, 0.35), var(--shadow);
}

.mail-card strong {
  font-size: 1.04rem;
}

.mail-card span,
.mail-card small,
.mail-from,
.mail-note,
.mail-kicker,
.billing-summary-card p {
  color: var(--muted);
}

.mail-status {
  width: fit-content;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid rgba(72, 167, 232, 0.36);
  border-radius: 6px;
  color: var(--blue);
  background: rgba(72, 167, 232, 0.12);
  font-size: 0.78rem;
  font-weight: 900;
}

.mail-status.is-done {
  border-color: rgba(49, 208, 170, 0.42);
  color: var(--green);
  background: rgba(49, 208, 170, 0.12);
}

.mail-detail-card {
  display: grid;
  gap: 12px;
}

.mail-detail-card h2 {
  font-size: 1.15rem;
  line-height: 1.25;
}

.mail-detail-card p {
  margin-bottom: 0;
  line-height: 1.55;
}

.suggestion-list {
  display: grid;
  gap: 10px;
}

.suggestion-list div,
.billing-mini-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.suggestion-list div {
  grid-template-columns: 72px minmax(0, 1fr);
}

.suggestion-list span {
  color: var(--muted);
  font-weight: 800;
}

.agent-actions,
.billing-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.draft-output,
.billing-output {
  width: 100%;
  min-height: 220px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface-soft);
  font: inherit;
  line-height: 1.55;
  resize: vertical;
}

.billing-panel {
  display: grid;
  gap: 16px;
}

.billing-controls {
  align-items: center;
  justify-content: space-between;
}

.billing-controls select {
  flex: 1 1 260px;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.billing-output {
  min-height: 420px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
}

.billing-summary-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 2.4rem;
  line-height: 1;
}

.tool-panel {
  display: grid;
  gap: 12px;
}

.inline-create {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: center;
}

.file-drop {
  position: relative;
  display: grid;
  gap: 4px;
  min-height: 78px;
  place-items: center;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface-soft);
  cursor: pointer;
}

.file-drop:hover {
  border-color: var(--green);
}

.file-drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-drop span {
  font-weight: 900;
}

.file-drop small {
  color: var(--muted);
  font-weight: 750;
}

.customer-list {
  display: grid;
  gap: 8px;
  max-height: 330px;
  overflow: auto;
}

.view-customers .customer-list {
  max-height: min(720px, calc(100vh - 430px));
}

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

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

.customer-row,
.category-row,
.user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 21, 29, 0.7);
}

.customer-row strong,
.customer-row span,
.category-row span,
.user-row strong,
.user-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-row span {
  font-weight: 850;
}

.customer-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 750;
}

.customer-row .icon-button,
.category-row .icon-button,
.user-row .icon-button {
  width: 38px;
  height: 38px;
}

.user-row {
  grid-template-columns: minmax(0, 1fr) 112px 118px 38px;
}

.user-row select {
  min-height: 38px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.user-row .compact-button {
  min-height: 38px;
}

.customer-row .icon-button:disabled,
.user-row button:disabled,
.user-row select:disabled {
  cursor: default;
  opacity: 0.45;
}

.swatches {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

.swatch {
  width: 34px;
  height: 34px;
  border: 3px solid transparent;
  border-radius: 8px;
  background: var(--swatch);
}

.swatch.is-selected {
  border-color: var(--ink);
}

.empty-state {
  padding: 28px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(18, 25, 34, 0.78);
}

.auth-shell {
  display: grid;
  place-items: center;
  width: min(100%, 460px);
}

.auth-card {
  display: grid;
  gap: 18px;
  width: 100%;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    var(--surface-strong);
  box-shadow: var(--shadow);
}

.auth-card img {
  width: 54px;
  height: 54px;
  border-radius: var(--radius);
}

.auth-card h1 {
  font-size: 2.7rem;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  display: grid;
  gap: 7px;
}

.auth-form label span {
  color: var(--muted);
  font-weight: 850;
}

.auth-form input {
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
  color: var(--ink);
  background: var(--surface-soft);
}

.auth-form input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 1px rgba(49, 208, 170, 0.34);
}

.auth-error {
  margin-bottom: 0;
  padding: 12px 13px;
  border: 1px solid rgba(255, 118, 95, 0.48);
  border-radius: var(--radius);
  color: #ffc6bb;
  background: rgba(255, 118, 95, 0.11);
  font-weight: 750;
}

.auth-link {
  justify-self: center;
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

.auth-link:hover,
.auth-link:focus-visible {
  color: var(--green);
}

.focus-mode {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 28px;
  text-align: center;
  background:
    radial-gradient(circle at center, rgba(49, 208, 170, 0.16), transparent 34%),
    rgba(12, 17, 23, 0.98);
  z-index: 20;
}

.focus-mode.is-visible {
  display: grid;
}

.focus-close {
  position: fixed;
  top: 24px;
  right: 24px;
  font-size: 1.9rem;
  line-height: 1;
}

.focus-orbit {
  position: fixed;
  width: min(72vw, 620px);
  aspect-ratio: 1;
  border: 1px solid rgba(49, 208, 170, 0.22);
  border-radius: 50%;
  animation: breathe 8s linear infinite;
}

.focus-project {
  position: relative;
  margin: 0;
  color: var(--green);
  font-weight: 900;
}

.focus-mode h2 {
  position: relative;
  width: min(780px, 92vw);
  margin: 10px auto 24px;
  font-size: 4.8rem;
  line-height: 1;
}

.focus-time {
  position: relative;
  font-size: 9rem;
  font-weight: 950;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
}

.focus-before {
  position: relative;
  margin: 22px 0 18px;
  color: var(--muted);
  font-weight: 750;
}

.focus-actions {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 12px;
}

@keyframes breathe {
  from {
    transform: scale(0.96) rotate(0deg);
  }
  to {
    transform: scale(1.02) rotate(360deg);
  }
}

@media (max-width: 1080px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px;
    overflow: hidden;
  }

  .sidebar-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 0;
    padding-top: 0;
  }

  .sync-status {
    display: none;
  }

  .brand {
    margin-bottom: 0;
  }

  .nav {
    display: flex;
    max-width: 100%;
    overflow-x: auto;
  }

  .nav-button {
    flex: 0 0 auto;
  }

  .content-grid,
  .log-layout,
  .project-layout,
  .agent-layout,
  .billing-layout,
  .customers-layout,
  .team-layout {
    grid-template-columns: 1fr;
  }

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

  .analysis-row {
    grid-template-columns: minmax(220px, 1fr) 86px 100px 112px 116px;
  }

  .team-create-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar,
  .top-actions,
  .focus-actions,
  .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar,
  .view {
    padding-inline: 18px;
  }

  h1 {
    font-size: 2.4rem;
  }

  .focus-mode h2 {
    font-size: 2.5rem;
  }

  .focus-time {
    font-size: 4.4rem;
  }

  .search-field {
    width: 100%;
    min-width: 0;
  }

  .task-composer,
  .task-row {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    padding: 12px;
  }

  .task-group-header {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .task-stripe {
    grid-column: 1;
    grid-row: auto;
    height: 6px;
    border-radius: 6px;
  }

  .task-row .link-select,
  .task-row .primary-button,
  .task-row .task-project-menu,
  .task-row .task-delete {
    grid-column: 1;
    grid-row: auto;
  }

  .task-project-menu .link-select {
    position: static;
    width: 100%;
    min-width: 0;
    margin-top: 8px;
  }

  .task-row .secondary-button,
  .task-row select {
    width: 100%;
  }

  .project-controls,
  .analytics-kpis,
  .analysis-row,
  .manual-time-grid,
  .user-row,
  .team-create-form {
    grid-template-columns: 1fr;
  }

  .analysis-table-header {
    flex-direction: column;
  }

  .analysis-row {
    align-items: stretch;
  }

  .analysis-task strong,
  .billing-mini-row span,
  .customer-row strong,
  .customer-row span,
  .category-row span,
  .user-row strong,
  .user-row span {
    white-space: normal;
  }

  .timeline {
    padding-left: 0;
  }

  .log-entry {
    grid-template-columns: 1fr;
  }

  .time-slot-label {
    position: static;
    width: auto;
    padding-top: 12px;
    text-align: left;
  }
}
