
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

a {
  color: inherit;
}

/* Existing login surface: resilient spacing, touch targets and native states. */
.private-email-access {
  width: min(100%, 32rem);
  margin-inline: auto;
  padding: clamp(1.25rem, 5vw, 3rem) 1.25rem;
  overflow-wrap: anywhere;
}
.private-email-access h1 { font-size: clamp(1.5rem, 5vw, 2rem); line-height: 1.2; font-weight: 700; text-wrap: balance; }
.private-email-access p, .private-email-access noscript { margin-block: 0.75rem 1.5rem; line-height: 1.5; }
.private-email-access form { display: grid; gap: 0.75rem; margin-top: 1.5rem; }
.private-email-access input, .private-email-access button {
  min-width: 0; width: 100%; min-height: 44px; padding: 0.75rem;
  border: 1px solid var(--line); border-radius: 8px; font-size: 1rem;
  color: var(--ink); background: var(--surface); caret-color: var(--brand);
}
.private-email-access button { cursor: pointer; font-weight: 650; }
.private-email-access button[type="submit"] { background: var(--brand); color: var(--klesora-on-gradient); border-color: var(--brand); }
.private-email-access button:hover:not(:disabled) { filter: brightness(1.12); }
.private-email-access button:disabled { opacity: 0.7; cursor: wait; }
.private-email-access a { display: inline-flex; align-items: center; min-height: 44px; color: var(--brand); text-underline-offset: 0.2em; text-decoration: underline; }
.private-email-access :focus-visible { outline: 3px solid var(--klesora-focus); outline-offset: 3px; }
.private-email-access ::selection { background: var(--brand); color: var(--klesora-on-gradient); }
.private-email-access [role="alert"] { color: var(--danger); }
.private-email-access [role="status"] { color: var(--muted); }

.personal-command-center {
  width: min(100%, 1220px);
  min-height: calc(100vh - var(--product-bar-height));
  margin-inline: auto;
  padding: 14px 16px 18px;
  display: grid;
  align-content: start;
  gap: 10px;
  background: var(--private-bg);
  color: var(--private-text);
  overflow-wrap: anywhere;
}

.personal-command-header {
  min-width: 0;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.personal-command-header h1,
.personal-command-header p,
.personal-metric h2,
.personal-metric p,
.journey-panel h2,
.unavailable-panel h2,
.unavailable-panel p {
  margin: 0;
}

.personal-command-header h1 {
  font-size: clamp(1.2rem, 2.4vw, 1.55rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.personal-command-header p {
  margin-top: 3px;
  color: var(--private-muted);
  font-size: 0.75rem;
}

.product-bar-actions,
.global-create-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.personal-command-center .primary-button,
.personal-command-center .secondary-button {
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid var(--private-border);
  border-radius: 7px;
  background: var(--private-surface-raised);
  color: var(--private-text);
  font-size: 0.75rem;
  font-weight: 680;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.personal-command-center .secondary-button {
  background: var(--private-text);
  color: #202020;
}

.personal-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.personal-metric,
.journey-panel,
.unavailable-panel {
  min-width: 0;
  border: 1px solid var(--private-border);
  border-radius: 9px;
  background: var(--private-surface);
}

.personal-metric {
  min-height: 76px;
  padding: 10px 11px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.personal-metric h2 {
  color: var(--private-muted);
  font-size: 0.6875rem;
  font-weight: 540;
  line-height: 1.25;
}

.personal-metric p {
  color: var(--private-text);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.1;
}

.personal-metric.metric-unavailable p {
  color: var(--private-muted);
  font-size: 0.8rem;
  font-weight: 560;
}

.personal-work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 0.5rem;
  align-items: stretch;
}

.journey-panel,
.unavailable-panel {
  min-height: 150px;
  padding: 11px;
}

.journey-panel h2,
.unavailable-panel h2 {
  font-size: 0.8125rem;
  font-weight: 620;
}

.journey-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.journey-item {
  min-width: 0;
  padding: 8px 0;
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto auto;
  grid-template-areas: "marker title status due" ". organization priority due";
  gap: 2px 7px;
  align-items: center;
  border-top: 1px solid var(--private-border);
  font-size: 0.72rem;
}

.journey-item:first-child {
  border-top: 0;
}

.journey-marker {
  grid-area: marker;
  width: 11px;
  height: 11px;
  border: 2px solid var(--private-accent);
  border-radius: 50%;
}

.journey-item > a {
  grid-area: title;
  min-width: 0;
  color: var(--private-text);
  font-weight: 590;
  text-decoration: none;
}

.journey-item > a:hover {
  color: var(--private-accent);
  text-decoration: underline;
}

.journey-organization {
  grid-area: organization;
}

.journey-priority {
  grid-area: priority;
}

.journey-status {
  grid-area: status;
  color: var(--private-warning);
}

.journey-time {
  grid-area: due;
  color: var(--private-text);
  white-space: nowrap;
}

.journey-organization,
.journey-priority {
  color: var(--private-muted);
  font-size: 0.65rem;
}

.unavailable-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-content: start;
  gap: 8px;
}

.unavailable-panel header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
}

.unavailable-status {
  flex: none;
  padding: 3px 6px;
  border-radius: 999px;
  background: #1f3950;
  color: #a9d8ff;
  font-size: 0.625rem;
  line-height: 1.2;
}

.unavailable-panel > p,
.personal-command-center .empty-state {
  color: var(--private-muted);
  font-size: 0.7rem;
  line-height: 1.4;
}

.unavailable-action {
  width: fit-content;
  color: var(--private-muted);
  font-size: 0.65rem;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: not-allowed;
}

.personal-command-center .global-create-dialog {
  width: min(420px, calc(100% - 24px));
  max-height: min(640px, calc(100dvh - 24px));
  padding: 0;
  border: 1px solid var(--private-border);
  border-radius: 10px;
  background: var(--private-surface);
  color: var(--private-text);
}

.personal-command-center .global-create-dialog::backdrop {
  background: rgb(0 0 0 / 0.68);
}

.personal-command-center .global-create-dialog .drawer-header {
  padding: 12px 14px;
  border-color: var(--private-border);
  background: var(--private-surface-raised);
}

.personal-command-center .global-create-dialog .drawer-content {
  padding: 14px;
}

.personal-command-center .global-create-dialog ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.personal-command-center .global-create-dialog a,
.personal-command-center .global-create-dialog .drawer-content button {
  width: 100%;
  padding: 9px 10px;
  display: block;
  border: 1px solid var(--private-border);
  border-radius: 7px;
  background: var(--private-surface-raised);
  color: var(--private-text);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.personal-command-center :is(a, button):focus-visible,
.app-shell[data-workspace-kind="personal"] .app-sidebar :is(a, button):focus-visible {
  outline-color: var(--private-accent);
}

.organization-content {
  width: min(100%, 1180px);
  margin-inline: auto;
}

.organization-content {
  padding: 36px 24px 56px;
}

.organization-today {
  display: grid;
  gap: 28px;
}

.page-heading h1,
.page-heading p,
.panel h2,
.section-heading h2,
.metric-card h3,
.metric-card p {
  margin: 0;
}

.page-heading {
  display: grid;
  gap: 8px;
}

.page-heading h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.page-heading > p:last-child,
.metric-card h3 {
  color: var(--muted);
}

.eyebrow {
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.metric-grid {
  display: grid;
  gap: 14px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.section-heading a {
  color: var(--brand);
  font-size: 0.875rem;
  font-weight: 700;
}

.metric-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}

.metric-card,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card {
  min-height: 132px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.metric-card h3 {
  font-size: 0.8125rem;
  font-weight: 700;
}

.metric-card p {
  font-size: 1.55rem;
  font-weight: 780;
  letter-spacing: -0.035em;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(250px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.dashboard-grid-single {
  grid-template-columns: minmax(0, 1fr);
}

.panel {
  padding: 22px;
}

.panel h2 {
  margin-bottom: 18px;
  font-size: 1.125rem;
}

.setup-notice {
  margin: 0;
  color: var(--muted);
}

.setup-notice a,
.attention-list a {
  color: var(--brand);
  font-weight: 700;
}

.attention-list,
.quick-actions {
  margin: 0;
  padding: 0;
  list-style: none;
}

.attention-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.attention-list li:first-child {
  padding-top: 0;
  border-top: 0;
}

.attention-list li:last-child {
  padding-bottom: 0;
}

.attention-list li > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.attention-list a {
  overflow-wrap: anywhere;
}

.attention-list li > div span,
.empty-state {
  color: var(--muted);
  font-size: 0.875rem;
}

.attention-label {
  flex: none;
  padding: 5px 8px;
  border-radius: 999px;
  background: #fff1e1;
  color: var(--warning);
  font-size: 0.75rem;
  font-weight: 750;
}

.quick-actions {
  display: grid;
  gap: 10px;
}

.quick-actions a {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.quick-actions a:hover {
  border-color: #b8d4c7;
  background: var(--brand-soft);
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #56a884;
  outline-offset: 2px;
}

.task-workspace {
  display: grid;
  gap: 24px;
}

.workspace-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.primary-button {
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: white;
  font-weight: 750;
  cursor: pointer;
}

.task-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.55fr);
  gap: 22px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.task-card-summary {
  display: grid;
  align-content: start;
  gap: 12px;
}

.task-card-summary h2,
.task-card-summary p {
  margin: 0;
}

.task-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.task-status-badge,
.task-priority-badge {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 750;
}

.task-status-badge {
  background: var(--brand-soft);
  color: var(--brand);
}

.task-status-completed {
  background: #e7eee9;
  color: var(--muted);
}

.task-priority-badge {
  background: #f2eee5;
  color: #6f5a2d;
}

.task-priority-high,
.task-priority-urgent {
  background: #fff0e8;
  color: var(--warning);
}

.task-priority-urgent {
  box-shadow: inset 0 0 0 1px #efb397;
}

.task-due {
  color: var(--muted);
  font-size: 0.875rem;
}

.task-quick-actions form,
.task-form {
  display: grid;
  gap: 8px;
}

.task-quick-actions form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.task-quick-actions label,
.task-quick-actions p {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.8125rem;
}

.task-form label {
  margin-top: 8px;
  font-size: 0.875rem;
  font-weight: 700;
}

.task-form input,
.task-form select,
.task-form textarea,
.task-quick-actions select {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.task-form textarea {
  min-height: 112px;
  resize: vertical;
}

.task-form button,
.task-quick-actions button {
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: white;
  font-weight: 750;
  cursor: pointer;
}

.task-form button:disabled,
.task-quick-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.drawer {
  grid-template-rows: auto minmax(0, 1fr);
  width: min(540px, 100%);
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: -18px 0 48px rgb(16 39 31 / 0.2);
}

.drawer[open] {
  display: grid;
}

.drawer::backdrop {
  background: rgb(16 39 31 / 0.5);
}

.drawer-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.drawer-header h2 {
  margin: 0;
}

.drawer-close {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font-size: 1.5rem;
  cursor: pointer;
}

.drawer-content {
  min-height: 0;
  padding: 24px;
  overflow-y: auto;
}

@media (max-width: 800px) {
  .personal-command-center {
    width: 100%;
    min-height: auto;
    padding: 12px;
    overflow-x: hidden;
  }

  .personal-command-header {
    align-items: stretch;
    flex-direction: column;
  }

  .product-bar-actions,
  .global-create-actions {
    justify-content: flex-start;
  }

  .personal-metrics,
  .personal-work-grid {
    grid-template-columns: 1fr;
  }

  .personal-metric {
    min-height: 68px;
  }

  .journey-panel,
  .unavailable-panel {
    min-height: 132px;
  }

  .journey-item {
    grid-template-columns: 14px minmax(0, 1fr) auto;
    grid-template-areas: "marker title status" ". organization due" ". priority due";
  }

  .organization-content {
    padding: 28px 16px 40px;
  }

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

  .workspace-header {
    align-items: start;
    flex-direction: column;
  }

  .task-card {
    grid-template-columns: 1fr;
  }
}
