:root {
  --color-urgent: rgba(184, 56, 46, 0.9);
  --color-urgent-solid: #b8382e;
  --color-high: rgba(56, 115, 86, 0.9);
  --color-high-solid: #387356;
  --color-neutral: rgba(76, 102, 139, 0.82);
  --color-neutral-solid: #4c668b;
  --color-done: rgba(138, 132, 126, 0.55);
  --color-bg: #f4efe7;
  --color-bg-accent: #e7d8c5;
  --color-surface: rgba(255, 251, 247, 0.94);
  --color-surface-strong: #fffdf9;
  --color-surface-muted: #f1e7db;
  --color-border: rgba(113, 92, 72, 0.22);
  --color-border-strong: rgba(113, 92, 72, 0.38);
  --color-text: #261c17;
  --color-text-muted: #6f6056;
  --color-text-soft: #927f72;
  --color-primary: #1c5c4c;
  --color-primary-hover: #174d40;
  --color-primary-soft: rgba(28, 92, 76, 0.12);
  --color-secondary: #dbcab8;
  --color-secondary-hover: #ccb6a2;
  --color-danger: #8f2f2a;
  --color-danger-hover: #762723;
  --color-overdue-bg: #faebe7;
  --color-overdue-border: #c86052;
  --color-due-soon-bg: #faf2df;
  --color-due-soon-border: #c1912b;
  --radius-xs: 10px;
  --radius-sm: 16px;
  --radius-md: 22px;
  --radius-lg: 30px;
  --shadow-sm: 0 10px 22px rgba(63, 42, 27, 0.08);
  --shadow-md: 0 24px 50px rgba(63, 42, 27, 0.12);
  --shadow-lg: 0 36px 80px rgba(63, 42, 27, 0.16);
  --font-body: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --content-width: 1380px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(231, 216, 197, 0.85), transparent 34%),
    radial-gradient(circle at top right, rgba(190, 202, 193, 0.55), transparent 28%),
    linear-gradient(180deg, #f8f3eb 0%, #f4efe7 44%, #efe5d8 100%);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--color-text);
  background: transparent;
  line-height: 1.55;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.22), transparent 80%);
  pointer-events: none;
  z-index: -1;
}

a {
  color: inherit;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 18px 24px;
  background: rgba(248, 243, 235, 0.84);
  border-bottom: 1px solid rgba(113, 92, 72, 0.12);
  backdrop-filter: blur(18px);
}

.header-inner {
  width: min(100%, var(--content-width));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.brand-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.brand-eyebrow {
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(38, 28, 23, 0.08);
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand-chip {
  font-size: 12px;
  color: var(--color-primary);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 0.96;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.brand-subtitle {
  max-width: 58ch;
  margin: 0;
  color: var(--color-text-muted);
  font-size: 14px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.app-main {
  width: min(100%, var(--content-width));
  margin: 0 auto;
  padding: 26px 24px 48px;
}

.dashboard-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
  gap: 18px;
  margin-bottom: 20px;
}

.hero-card,
.hero-aside {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(113, 92, 72, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.hero-card {
  padding: 26px 28px;
  background:
    linear-gradient(135deg, rgba(255, 251, 247, 0.96), rgba(244, 233, 219, 0.92));
}

.hero-card::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -60px;
  top: -90px;
  border-radius: 50%;
  background: rgba(28, 92, 76, 0.09);
}

.hero-card h2,
.hero-aside h2,
.panel-heading h2,
.panel-heading h3,
.empty-state h2,
.form-title,
.settings-title-main {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}

.hero-card h2 {
  max-width: 13ch;
  font-size: clamp(1.9rem, 3vw, 2.8rem);
  line-height: 1;
}

.hero-card p {
  position: relative;
  z-index: 1;
  max-width: 56ch;
  margin: 14px 0 0;
  color: var(--color-text-muted);
}

.hero-aside {
  padding: 22px 24px;
  background: rgba(38, 28, 23, 0.92);
  color: #f8f0e5;
}

.hero-aside h2 {
  font-size: 1.35rem;
}

.hero-aside p {
  margin: 10px 0 0;
  color: rgba(248, 240, 229, 0.78);
  font-size: 14px;
}

.signal-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.signal-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
}

.signal-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 10px;
  border-radius: 14px;
  background: rgba(248, 240, 229, 0.12);
  color: #f6dfb5;
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.signal-copy strong {
  display: block;
  margin-bottom: 2px;
  font-size: 13px;
}

.signal-copy span {
  color: rgba(248, 240, 229, 0.78);
  font-size: 13px;
}

.app-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.panel {
  position: relative;
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid rgba(113, 92, 72, 0.14);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 18%);
  pointer-events: none;
}

.panel-heading {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 22px 0;
}

.panel-heading h2,
.panel-heading h3 {
  font-size: 1.5rem;
  line-height: 1;
}

.panel-heading p {
  margin: 8px 0 0;
  color: var(--color-text-muted);
  font-size: 13px;
  max-width: 45ch;
  white-space: nowrap;
}

.panel-kicker {
  display: inline-flex;
  align-items: center;
  margin-bottom: 6px;
  color: var(--color-text-soft);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.chart-panel {
  min-height: 560px;
  background:
    radial-gradient(circle at top right, rgba(28, 92, 76, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 251, 247, 0.92));
}

.chart-stage {
  position: relative;
  min-height: 470px;
  padding: 8px 16px 18px;
}

#quadrant-chart {
  display: block;
  width: 100%;
  min-height: 440px;
}

.chart-empty-overlay {
  position: absolute;
  inset: 8px 16px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.76), rgba(244, 233, 219, 0.9));
  border: 1px dashed rgba(113, 92, 72, 0.28);
  z-index: 10;
}

.chart-empty-overlay .empty-state {
  min-height: auto;
}

.list-panel {
  min-height: 560px;
}

.form-panel,
.settings-panel {
  padding: 28px;
  animation: panelRise 180ms ease-out;
}

.panel-stack {
  display: grid;
  gap: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  min-height: 44px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 140ms ease,
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease,
    opacity 140ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:focus-visible,
.show-done-toggle:focus-within,
.metric-chip:focus-visible {
  outline: 3px solid rgba(28, 92, 76, 0.2);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff9f3;
  box-shadow: 0 16px 28px rgba(28, 92, 76, 0.2);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
}

.btn-secondary {
  background: rgba(255, 251, 247, 0.7);
  border-color: rgba(113, 92, 72, 0.2);
  color: var(--color-text);
}

.btn-secondary:hover {
  background: rgba(239, 229, 216, 0.9);
  border-color: rgba(113, 92, 72, 0.28);
}

.btn-danger {
  background: var(--color-danger);
  color: #fff7f6;
}

.btn-danger:hover {
  background: var(--color-danger-hover);
}

.btn-ghost {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(241, 231, 219, 0.8);
  color: var(--color-text-muted);
  border-color: rgba(113, 92, 72, 0.12);
  font-size: 11px;
}

.btn-ghost:hover {
  background: rgba(227, 213, 198, 0.92);
  color: var(--color-text);
}

.btn-sm {
  min-height: 32px;
  padding: 7px 12px;
  font-size: 11px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 420px;
  padding: 42px 30px;
  text-align: center;
  animation: panelRise 220ms ease-out;
}

.empty-state-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(28, 92, 76, 0.1);
  color: var(--color-primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.empty-state h2 {
  max-width: 12ch;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 0.98;
}

.empty-state p {
  max-width: 46ch;
  margin: 14px 0 0;
  color: var(--color-text-muted);
}

.empty-state-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.empty-state-metrics {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 24px;
}

.metric-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(113, 92, 72, 0.14);
  color: var(--color-text-muted);
  font-size: 12px;
  white-space: nowrap;
}

.metric-chip strong {
  color: var(--color-text);
}

.list-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid rgba(113, 92, 72, 0.1);
}

.list-title-group h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
  line-height: 1;
}

.list-title-group p {
  margin: 8px 0 0;
  color: var(--color-text-muted);
  font-size: 13px;
}

.show-done-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(241, 231, 219, 0.72);
  border: 1px solid rgba(113, 92, 72, 0.12);
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.show-done-toggle input[type="checkbox"] {
  inline-size: 16px;
  block-size: 16px;
  margin: 0;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.list-table-wrap {
  padding: 0 10px 10px;
}

.example-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 22px 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(28, 92, 76, 0.08);
  border: 1px solid rgba(28, 92, 76, 0.12);
}

.example-banner .empty-state-badge {
  margin: 0;
  flex: 0 0 auto;
}

.example-banner p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 13px;
}

/* Ensure table columns align properly in vertical layout */
table.item-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0 10px;
  font-size: 13px;
  padding: 0 10px;
}

table.item-table col.col-initiative {
  width: auto;
}

table.item-table col.col-wsjf {
  width: 112px;
}

table.item-table col.col-cod {
  width: 136px;
}

table.item-table col.col-size {
  width: 104px;
}

table.item-table col.col-actions {
  width: 248px;
}

table.item-table thead th {
  padding: 0 14px 6px;
  text-align: left;
  color: var(--color-text-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

table.item-table tbody td {
  padding: 16px 14px;
  vertical-align: middle;
  background: rgba(255, 255, 255, 0.72);
  border-top: 1px solid rgba(113, 92, 72, 0.12);
  border-bottom: 1px solid rgba(113, 92, 72, 0.12);
}

table.item-table tbody td:first-child {
  border-left: 1px solid rgba(113, 92, 72, 0.12);
  border-radius: 18px 0 0 18px;
}

table.item-table tbody td:last-child {
  border-right: 1px solid rgba(113, 92, 72, 0.12);
  border-radius: 0 18px 18px 0;
}

table.item-table tbody tr:hover td {
  background: rgba(251, 247, 241, 0.96);
  border-color: rgba(113, 92, 72, 0.2);
}

table.item-table tbody tr.item-done td {
  opacity: 0.64;
}

table.item-table tbody tr.item-done .item-title {
  color: var(--color-text-muted);
  text-decoration: line-through;
}

.item-title-cell {
  min-width: 0;
}

.item-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
}

.item-meta {
  margin-top: 8px;
  color: var(--color-text-soft);
  font-size: 12px;
}

.item-notes {
  margin-top: 6px;
  color: var(--color-text-muted);
  font-size: 13px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge-overdue {
  background: var(--color-overdue-bg);
  color: #962f26;
  border-color: rgba(200, 96, 82, 0.36);
}

.badge-due-soon {
  background: var(--color-due-soon-bg);
  color: #8c6419;
  border-color: rgba(193, 145, 43, 0.34);
}

.badge-done {
  background: rgba(117, 111, 105, 0.11);
  color: #5b524b;
  border-color: rgba(117, 111, 105, 0.18);
}

.example-row-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(28, 92, 76, 0.08);
  border: 1px solid rgba(28, 92, 76, 0.12);
  color: var(--color-primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.score-cell {
  font-family: var(--font-mono);
  font-size: 14px;
  white-space: nowrap;
}

.score-label {
  display: block;
  margin-top: 6px;
  color: var(--color-text-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.score-value {
  display: block;
  font-size: 18px;
  line-height: 1;
}

.score-high .score-value {
  color: var(--color-high-solid);
  font-weight: 700;
}

.score-normal .score-value {
  color: var(--color-text);
}

.action-cell {
  width: 248px;
}

.action-icons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

/* Icon-only buttons - no background rounded button */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  color: var(--color-text-muted);
  transition:
    background-color 120ms ease,
    color 120ms ease;
}

.icon-btn:hover {
  background: rgba(143, 47, 42, 0.1);
  color: var(--color-danger);
}

.icon-btn i {
  font-size: 16px;
  width: 16px;
}

/* For edit icon - green color on hover */
.icon-btn[data-action="edit"]:hover {
  background: rgba(28, 92, 76, 0.1);
  color: var(--color-primary);
}

/* For done/toggle icon - blue/teal color on hover */
.icon-btn[data-action="toggle-done"]:hover {
  background: rgba(28, 92, 76, 0.1);
  color: var(--color-primary);
}

/* For delete icon - red/danger color on hover */
.icon-btn[data-action="delete"]:hover {
  background: rgba(143, 47, 42, 0.1);
  color: var(--color-danger);
}

.form-shell,
.settings-shell {
  display: grid;
  gap: 24px;
}

.form-header,
.settings-title {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.form-kicker,
.settings-kicker {
  display: inline-flex;
  align-items: center;
  margin-bottom: 8px;
  color: var(--color-text-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.form-title,
.settings-title-main {
  font-size: clamp(1.75rem, 3vw, 2.2rem);
  line-height: 1;
}

.form-copy,
.settings-copy {
  margin: 10px 0 0;
  max-width: 52ch;
  color: var(--color-text-muted);
  font-size: 14px;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid rgba(113, 92, 72, 0.1);
  border-radius: var(--radius-sm);
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group.highlight {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(244, 233, 219, 0.5));
}

.form-label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--color-text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.form-label .optional {
  color: var(--color-text-soft);
  font-size: 11px;
  font-weight: 600;
}

.required-mark {
  color: var(--color-danger);
  font-weight: 700;
}

.field-hint {
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 1.45;
  display: block;
}

.form-control {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid rgba(113, 92, 72, 0.18);
  border-radius: 14px;
  background: rgba(255, 253, 250, 0.92);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 14px;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    background-color 140ms ease;
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

.form-control:focus {
  outline: none;
  border-color: rgba(28, 92, 76, 0.48);
  box-shadow: 0 0 0 4px rgba(28, 92, 76, 0.12);
  background: #fffdfb;
}

.form-control.error {
  border-color: rgba(143, 47, 42, 0.58);
  box-shadow: 0 0 0 4px rgba(143, 47, 42, 0.1);
}

.field-error {
  color: var(--color-danger);
  font-size: 12px;
  font-weight: 700;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-group input[type="checkbox"] {
  inline-size: 18px;
  block-size: 18px;
  margin: 0;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.checkbox-group label {
  cursor: pointer;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 4px;
  padding-top: 18px;
  border-top: 1px solid rgba(113, 92, 72, 0.14);
}

.form-actions-right {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.wsjf-preview {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(113, 92, 72, 0.12);
  color: var(--color-text-muted);
  font-size: 13px;
  width: fit-content;
}

.modal-overlay .wsjf-preview {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(113, 92, 72, 0.18);
}

.wsjf-preview strong {
  color: var(--color-primary);
  font-family: var(--font-display);
  font-size: 1.45rem;
  line-height: 1;
}

.settings-section {
  padding: 18px;
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid rgba(113, 92, 72, 0.1);
  border-radius: var(--radius-sm);
}

.settings-section-title {
  margin: 0 0 14px;
  color: var(--color-text-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

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

.settings-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.settings-note {
  color: var(--color-text-muted);
  font-size: 13px;
}

.error-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.error-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(38, 28, 23, 0.92);
  color: #fff8f2;
  box-shadow: var(--shadow-md);
  animation: toastIn 180ms ease-out;
}

.toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 248, 242, 0.14);
  font-size: 14px;
  font-weight: 700;
}

.quadrant-label {
  font-size: 11px;
  fill: var(--color-text-muted);
}

.hidden {
  display: none !important;
}

.text-muted {
  color: var(--color-text-muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes panelRise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .dashboard-intro,
  .app-grid {
    grid-template-columns: 1fr;
  }

  .chart-panel,
  .list-panel {
    min-height: auto;
  }

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

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

@media (max-width: 768px) {
  body {
    font-size: 14px;
  }

  .app-header,
  .app-main {
    padding-left: 16px;
    padding-right: 16px;
  }

  .header-inner,
  .form-header,
  .settings-title,
  .form-actions,
  .settings-footer,
  .list-header {
    flex-direction: column;
    align-items: stretch;
  }

  .header-actions,
  .form-actions-right {
    justify-content: stretch;
  }

  .header-actions .btn,
  .form-actions-right .btn,
  .settings-footer .btn {
    width: 100%;
  }

  .hero-card,
  .hero-aside,
  .form-panel,
  .settings-panel {
    padding: 20px;
  }

  .panel-heading {
    padding: 18px 18px 0;
  }

  .chart-stage {
    min-height: 320px;
    padding: 8px 10px 12px;
  }

  #quadrant-chart {
    min-height: 300px;
  }

  .chart-empty-overlay {
    inset: 8px 10px 12px;
  }

  .empty-state {
    min-height: 320px;
    padding: 30px 18px;
  }

  .example-banner {
    margin: 0 16px 12px;
    align-items: flex-start;
    flex-direction: column;
  }

  .form-grid,
  .settings-grid,
  .settings-grid-2 {
    grid-template-columns: 1fr;
  }

  .list-table-wrap {
    padding: 0 10px 12px;
    overflow-x: auto;
  }

  table.item-table {
    min-width: 620px;
  }

  table.item-table col.col-initiative {
    width: 280px;
  }

  table.item-table col.col-wsjf {
    width: 108px;
  }

  table.item-table col.col-cod {
    width: 128px;
  }

  table.item-table col.col-size {
    width: 100px;
  }

  table.item-table col.col-actions {
    width: 212px;
  }

  .action-icons {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .action-cell {
    width: 212px;
  }

  .btn,
  .btn-sm {
    min-height: 44px;
  }

  .btn-ghost {
    min-height: 36px;
  }

  .error-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .error-toast {
    max-width: none;
  }
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  animation: fadeIn 180ms ease-out;
  pointer-events: none;
}

.modal-overlay.hidden {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Modal Content */
.modal-content {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: min(100%, 960px);
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 240ms ease-out;
  pointer-events: auto;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Settings Modal Content */
.settings-content {
  /* No max-height to ensure Playwright can interact with all elements */
}

.modal-content .form-header,
.modal-content .settings-title {
  padding: 20px 24px 0;
}

.modal-content .form-shell,
.modal-content .settings-shell {
  padding: 8px 24px 24px;
}

.modal-content .form-group {
  background: var(--color-surface-muted);
  border-color: rgba(113, 92, 72, 0.14);
}

.modal-content .form-group.highlight {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(244, 233, 219, 0.6));
}

.modal-content .btn-secondary {
  background: rgba(255, 251, 247, 0.8);
  border-color: rgba(113, 92, 72, 0.2);
}

.modal-content .btn-secondary:hover {
  background: rgba(239, 229, 216, 0.95);
}

.modal-content .btn-primary {
  background: var(--color-primary);
  color: #fff9f3;
}

.modal-content .btn-primary:hover {
  background: var(--color-primary-hover);
}

/* Close button for modal */
.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: 16px;
}

.modal-close-btn:hover {
  background: rgba(239, 229, 216, 0.9);
}

.modal-overlay[data-target="settings"] .modal-close-btn {
  top: 18px;
  right: 18px;
}

/* Modal backdrop click to close */
.modal-backdrop {
  position: absolute;
  inset: 0;
}

/* Close button for modal */
.modal-content .modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: 16px;
}

.modal-content .modal-close-btn:hover {
  background: rgba(239, 229, 216, 0.9);
}
