:root {
  --bg: #151933;
  --bg-accent: radial-gradient(circle at top left, rgba(76, 108, 255, 0.24), transparent 26%),
    radial-gradient(circle at right 20%, rgba(0, 198, 255, 0.16), transparent 24%),
    linear-gradient(180deg, #181d38 0%, #14182f 100%);
  --surface: rgba(34, 40, 72, 0.9);
  --surface-strong: rgba(42, 49, 86, 0.96);
  --border: rgba(113, 126, 184, 0.24);
  --text: #edf1ff;
  --muted: #a5b0d6;
  --accent: #1ed3ff;
  --accent-dark: #9ce8ff;
  --highlight: #00c2ff;
  --success: #4ade80;
  --warning: #f8c14e;
  --error: #ff6b7d;
  --shadow: 0 28px 70px rgba(5, 8, 21, 0.32);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  color: var(--text);
  background: var(--bg-accent), var(--bg);
}

body.login-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

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

.login-shell {
  width: min(100%, 460px);
}

.login-card {
  display: grid;
  gap: 24px;
  padding: 34px;
  background: rgba(30, 35, 62, 0.94);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.login-card h1 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form label {
  display: grid;
  gap: 8px;
}

.login-form span {
  font-size: 0.95rem;
  color: var(--muted);
}

.login-form input {
  border: 1px solid rgba(117, 129, 187, 0.22);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(46, 53, 90, 0.92);
  color: var(--text);
}

.sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: 36px 28px;
  background:
    linear-gradient(180deg, rgba(39, 45, 80, 0.98), rgba(25, 30, 57, 0.98)),
    #20264a;
  color: #f6f8ff;
  border-right: 1px solid rgba(117, 129, 187, 0.18);
}

.sidebar h1,
.hero-card h2,
.panel h2,
.panel h3 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.sidebar-copy,
.hero-copy,
.muted-text,
.subtle {
  color: var(--muted);
}

.sidebar-copy {
  color: rgba(226, 232, 255, 0.66);
  line-height: 1.5;
}

.sidebar-section-title {
  margin: 0 0 14px;
  font-size: 1.2rem;
}

.sidebar-label {
  display: block;
  margin-bottom: 8px;
  color: rgba(228, 233, 255, 0.66);
  font-size: 0.9rem;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.73rem;
  color: #7cdfff;
}

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

.nav a,
.primary-button,
.secondary-button,
.danger-button,
.secondary-link-button {
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  transition: transform 160ms ease, background 160ms ease;
}

.nav a {
  background: rgba(79, 90, 141, 0.2);
  color: rgba(240, 244, 255, 0.9);
}

.nav a.active,
.nav a:hover {
  background: linear-gradient(135deg, rgba(0, 194, 255, 0.28), rgba(0, 107, 255, 0.26));
  transform: translateX(4px);
}

.sync-card {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid rgba(117, 129, 187, 0.18);
  border-radius: var(--radius);
  background: rgba(54, 62, 104, 0.22);
}

.project-card,
.project-switcher,
.project-create-form {
  display: grid;
  gap: 12px;
}

.project-card {
  padding: 20px;
  border: 1px solid rgba(117, 129, 187, 0.18);
  border-radius: var(--radius);
  background: rgba(54, 62, 104, 0.22);
}

.project-card select,
.project-card input {
  width: 100%;
  border: 1px solid rgba(117, 129, 187, 0.22);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(42, 48, 84, 0.94);
  color: #f5f7ff;
}

.project-card input::placeholder {
  color: rgba(231, 236, 255, 0.46);
}

.primary-button {
  background: linear-gradient(135deg, #00c2ff, #006bff);
  color: #f5f9ff;
  cursor: pointer;
  font-weight: 600;
  box-shadow: var(--shadow);
}

.primary-button:hover,
.secondary-button:hover,
.danger-button:hover,
.secondary-link-button:hover {
  transform: translateY(-1px);
}

.secondary-button {
  background: rgba(76, 87, 136, 0.42);
  color: #edf2ff;
  cursor: pointer;
  font-weight: 600;
}

.secondary-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(76, 87, 136, 0.32);
  color: #edf2ff;
  font-weight: 600;
}

.secondary-button-small,
.success-button,
.secondary-link-button-small {
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
}

.secondary-button-small {
  background: rgba(76, 87, 136, 0.34);
  color: #edf2ff;
}

.danger-button {
  background: rgba(255, 87, 122, 0.18);
  color: #ffd7df;
  cursor: pointer;
  font-weight: 600;
  padding: 10px 14px;
}

.success-button {
  background: rgba(74, 222, 128, 0.14);
  color: #d9ffe8;
}

.secondary-link-button-small {
  background: rgba(76, 87, 136, 0.32);
  color: #edf2ff;
}

.content {
  padding: 32px;
  display: grid;
  gap: 24px;
  background: linear-gradient(180deg, rgba(17, 22, 45, 0.82), rgba(16, 20, 39, 0.94));
}

.hero-card,
.panel,
.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero-card {
  padding: 34px;
}

.hero-header,
.hero-actions,
.header-actions {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.hero-actions {
  align-items: flex-start;
}

.hero-action-stack {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.dashboard-action-stack {
  display: grid;
  gap: 12px;
  justify-items: stretch;
  margin-left: auto;
}

.dashboard-hero-header {
  align-items: flex-start;
}

.dashboard-hero-layout {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  flex: 1 1 auto;
  min-width: 0;
}

.dashboard-eyebrow {
  margin: 0;
  white-space: nowrap;
}

.dashboard-hero-copy {
  text-align: left;
  min-width: 0;
}

.dashboard-hero-copy h2 {
  margin: 0 0 8px;
}

.dashboard-hero-copy .hero-copy,
.dashboard-hero-copy .muted-text {
  margin: 0;
}

.dashboard-hero-copy .muted-text {
  margin-top: 10px;
}

.header-actions {
  align-items: center;
}

.compact-hero {
  padding: 26px 30px;
}

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

.metric-card {
  padding: 24px;
}

.metric-card span {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
}

.metric-card strong {
  font-size: 2rem;
  color: #ffffff;
}

.panel {
  padding: 28px;
}

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

.panel-header-tight {
  align-items: center;
}

.collapsible-panel .panel-header {
  margin-bottom: 0;
}

.panel-collapse-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.panel-collapse-copy {
  display: grid;
  gap: 4px;
}

.panel-collapse-copy .eyebrow {
  margin-bottom: 0;
}

.panel-collapse-copy h3 {
  margin: 0;
}

.panel-collapse-chevron {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--accent);
  font-size: 1.15rem;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 160ms ease;
}

.collapsible-panel.is-collapsed .panel-collapse-chevron {
  transform: rotate(-90deg);
}

.collapsible-panel.is-collapsed [data-collapsible-content] {
  display: none;
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

tbody tr:hover td {
  background: rgba(70, 80, 130, 0.16);
}

th,
td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(117, 129, 187, 0.14);
  vertical-align: top;
}

th {
  color: rgba(236, 241, 255, 0.82);
  font-size: 0.9rem;
  font-weight: 600;
}

td strong,
.subtle {
  display: block;
}

.subtle {
  margin-top: 4px;
  font-size: 0.92rem;
  color: var(--muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-created,
.status-success {
  background: rgba(74, 222, 128, 0.16);
  color: #d4ffe3;
}

.status-skipped,
.status-warning {
  background: rgba(248, 193, 78, 0.18);
  color: #fff0bf;
}

.status-error {
  background: rgba(255, 87, 122, 0.18);
  color: #ffd8e1;
}

.status-pending,
.status-running {
  background: rgba(30, 211, 255, 0.16);
  color: #d8f8ff;
}

.status-active {
  background: rgba(74, 222, 128, 0.16);
  color: #d4ffe3;
}

.status-inactive {
  background: rgba(130, 141, 190, 0.18);
  color: #d6defc;
}

.flash-stack {
  display: grid;
  gap: 10px;
}

.flash {
  padding: 14px 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
}

.flash-success {
  color: var(--success);
}

.flash-warning {
  color: var(--warning);
}

.flash-error {
  color: var(--error);
}

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

.project-settings-form {
  display: grid;
  gap: 16px;
}

.settings-section {
  display: grid;
  gap: 16px;
  padding: 22px 24px;
  border: 1px solid rgba(117, 129, 187, 0.18);
  border-radius: 22px;
  background: rgba(37, 43, 75, 0.52);
}

.settings-section-header,
.settings-subsection {
  display: grid;
  gap: 8px;
}

.settings-subsection {
  padding-top: 8px;
}

.settings-subsection-spaced {
  margin-top: 10px;
  margin-bottom: 18px;
  padding-top: 18px;
  padding-bottom: 10px;
  border-top: 1px solid rgba(117, 129, 187, 0.16);
}

.settings-subsection h4,
.settings-section-header h3 {
  margin: 0;
}

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

.settings-grid-span {
  grid-column: 1 / -1;
}

.advisor-form label {
  display: grid;
  gap: 8px;
}

.project-settings-form label {
  display: grid;
  gap: 8px;
}

.advisor-form span {
  font-size: 0.95rem;
  color: var(--muted);
}

.project-settings-form span {
  font-size: 0.95rem;
  color: var(--muted);
}

.advisor-form input,
.advisor-form select,
.advisor-form textarea {
  border: 1px solid rgba(117, 129, 187, 0.22);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(42, 48, 84, 0.94);
  color: var(--text);
}

.project-settings-form input,
.project-settings-form select,
.project-settings-form textarea {
  border: 1px solid rgba(117, 129, 187, 0.22);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(42, 48, 84, 0.94);
  color: var(--text);
}

.advisor-form input::placeholder,
.advisor-form textarea::placeholder,
.project-settings-form input::placeholder,
.project-settings-form textarea::placeholder {
  color: rgba(229, 235, 255, 0.42);
}

.project-settings-form textarea,
.advisor-form textarea {
  min-height: 140px;
  resize: vertical;
}

.advisor-form input:focus,
.advisor-form select:focus,
.advisor-form textarea:focus,
.project-settings-form input:focus,
.project-settings-form select:focus,
.project-settings-form textarea:focus,
.project-card input:focus,
.project-card select:focus,
.login-form input:focus {
  outline: none;
  border-color: rgba(30, 211, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(30, 211, 255, 0.12);
}

.group-order-builder {
  display: grid;
  gap: 14px;
}

.group-order-header {
  display: grid;
  gap: 6px;
}

.group-order-add {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.group-order-add input {
  flex: 1 1 260px;
}

.group-order-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.group-order-item,
.group-order-empty {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(117, 129, 187, 0.18);
  background: rgba(44, 50, 86, 0.92);
}

.group-order-item.dragging {
  opacity: 0.45;
}

.group-order-item-plain {
  justify-content: space-between;
}

.group-order-accent {
  --group-preview-color: #55c2ff;
  width: 6px;
  align-self: stretch;
  border-radius: 999px;
  background: var(--group-preview-color);
  box-shadow: 0 0 16px color-mix(in srgb, var(--group-preview-color) 55%, transparent);
}

.group-order-handle {
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted);
  cursor: grab;
}

.group-order-label {
  flex: 1 1 auto;
  font-weight: 600;
}

.group-order-color-picker {
  position: relative;
}

.group-order-color-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(117, 129, 187, 0.26);
  border-radius: 12px;
  background: rgba(53, 61, 101, 0.96);
  color: #c6d3ff;
  cursor: pointer;
}

.group-order-color-button svg {
  width: 18px;
  height: 18px;
}

.group-order-color-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  min-width: 168px;
  border: 1px solid rgba(117, 129, 187, 0.22);
  border-radius: 16px;
  background: rgba(27, 32, 59, 0.98);
  box-shadow: 0 18px 42px rgba(5, 8, 21, 0.45);
}

.group-order-color-option {
  --group-option-color: #55c2ff;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--group-option-color);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.08),
    0 0 16px color-mix(in srgb, var(--group-option-color) 70%, transparent);
  cursor: pointer;
}

.group-order-remove {
  padding: 10px 12px;
  font-size: 0.84rem;
}

.dashboard-only-toggle {
  display: grid;
  gap: 8px;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.checkbox-row-danger,
.checkbox-row-danger span {
  color: var(--error);
}

.advisor-form button {
  width: fit-content;
}

.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.edit-actions-panel {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(117, 129, 187, 0.16);
}

.advisor-form button[disabled],
.advisor-form select[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
}

.inline-error {
  margin: 18px 0 0;
  color: #ffc0cc;
}

.inline-form {
  margin: 0;
}

.action-stack {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.advisor-link {
  color: #8fe7ff;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(30, 211, 255, 0.36);
  text-underline-offset: 3px;
}

.metrics-grid-secondary {
  grid-template-columns: repeat(1, minmax(0, 1fr));
  max-width: 260px;
}

.advisor-metrics-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

.advisor-detail-table {
  margin-top: 8px;
}

.board-shell {
  display: grid;
  gap: 24px;
  margin-top: 28px;
}

.board-panel-dark {
  background:
    radial-gradient(circle at top left, rgba(81, 121, 255, 0.15), transparent 28%),
    radial-gradient(circle at bottom right, rgba(0, 200, 255, 0.12), transparent 24%),
    #1b1f3a;
  border-color: rgba(120, 132, 185, 0.24);
  color: #eef1ff;
}

.board-panel-dark .panel-header h3,
.board-panel-dark .metric-card strong,
.board-panel-dark .muted-text,
.board-panel-dark .eyebrow {
  color: inherit;
}

.board-panel-dark .muted-text {
  color: rgba(225, 231, 255, 0.74);
}

.board-panel-dark .metrics-grid .metric-card {
  background: rgba(45, 52, 92, 0.72);
  border-color: rgba(122, 133, 186, 0.28);
  box-shadow: none;
}

.board-panel-dark .metric-card span {
  color: rgba(225, 231, 255, 0.72);
}

.board-panel-dark .advisor-form input,
.board-panel-dark .advisor-form select,
.board-panel-dark .advisor-form textarea {
  background: rgba(47, 54, 90, 0.92);
  border-color: rgba(119, 131, 189, 0.26);
  color: #eef1ff;
}

.board-panel-dark .advisor-form input::placeholder,
.board-panel-dark .advisor-form textarea::placeholder {
  color: rgba(226, 231, 255, 0.38);
}

.board-panel-dark .advisor-form span {
  color: rgba(225, 231, 255, 0.72);
}

.board-monday-chrome {
  display: grid;
  gap: 16px;
  margin-top: 24px;
  padding: 18px 20px 16px;
  border: 1px solid rgba(113, 127, 189, 0.22);
  border-radius: 22px;
  background: rgba(28, 33, 63, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.board-monday-tabs,
.board-monday-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.board-monday-tabs {
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(119, 131, 189, 0.24);
}

.board-tab,
.board-toolbar-chip,
.board-toolbar-primary {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font: inherit;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.board-tab {
  background: transparent;
  color: rgba(230, 235, 255, 0.82);
  font-weight: 600;
}

.board-tab:hover,
.board-toolbar-chip:hover,
.board-toolbar-primary:hover {
  transform: translateY(-1px);
}

.board-tab.is-active {
  position: relative;
  color: #ffffff;
}

.board-tab.is-active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -9px;
  height: 3px;
  border-radius: 999px;
  background: #1ed3ff;
}

.board-toolbar-primary {
  background: linear-gradient(135deg, #00c2ff, #006bff);
  color: #f5f9ff;
  font-weight: 700;
}

.board-toolbar-chip {
  background: rgba(59, 67, 112, 0.92);
  color: rgba(232, 237, 255, 0.9);
  font-weight: 600;
}

.board-search-shell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 320px;
  padding: 0 12px;
  border: 1px solid rgba(0, 194, 255, 0.42);
  border-radius: 12px;
  background: rgba(26, 74, 107, 0.4);
}

.board-search-icon {
  color: rgba(233, 239, 255, 0.72);
  font-size: 1.05rem;
}

.board-search-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  padding: 11px 0;
  background: transparent;
  color: #f3f6ff;
  font: inherit;
}

.board-search-input::placeholder {
  color: rgba(232, 237, 255, 0.52);
}

.board-search-input:focus {
  outline: none;
}

.board-search-clear {
  display: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: rgba(232, 237, 255, 0.72);
  font: inherit;
  font-size: 1.2rem;
  cursor: pointer;
}

.board-search-clear.is-visible {
  display: inline-block;
}

.board-search-empty {
  margin: 0;
  color: rgba(232, 237, 255, 0.68);
}

.board-view-root {
  display: grid;
  gap: 18px;
}

.board-view-pane.hidden {
  display: none;
}

.board-shell-monday {
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  background: linear-gradient(180deg, #171b33, #161a30);
  border: 1px solid rgba(104, 118, 180, 0.24);
  border-radius: 24px;
  padding: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.board-group {
  --group-accent: #55c2ff;
  border: 1px solid rgba(105, 117, 168, 0.28);
  border-radius: 18px;
  background: #232846;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(8, 10, 21, 0.28);
}

.calendar-panel {
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid rgba(104, 118, 180, 0.24);
  border-radius: 24px;
  background: linear-gradient(180deg, #171b33, #161a30);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.calendar-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.calendar-panel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.calendar-view-picker {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-view-picker span {
  color: rgba(227, 233, 255, 0.76);
  font-size: 0.92rem;
  white-space: nowrap;
}

.calendar-view-picker select {
  min-width: 160px;
  border: 1px solid rgba(123, 137, 194, 0.24);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(23, 27, 51, 0.98);
  color: #f4f7ff;
  font: inherit;
}

.calendar-create-form {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(109, 124, 187, 0.2);
  border-radius: 18px;
  background: rgba(30, 35, 63, 0.78);
}

.calendar-controls-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.calendar-create-form label {
  display: grid;
  gap: 6px;
}

.calendar-create-form span {
  color: rgba(227, 233, 255, 0.76);
  font-size: 0.92rem;
}

.calendar-create-form input,
.calendar-create-form select,
.calendar-create-form textarea {
  width: 100%;
  border: 1px solid rgba(123, 137, 194, 0.24);
  border-radius: 12px;
  padding: 11px 12px;
  background: rgba(23, 27, 51, 0.98);
  color: #f4f7ff;
  font: inherit;
}

.calendar-create-form input:focus,
.calendar-create-form select:focus,
.calendar-create-form textarea:focus {
  outline: none;
  border-color: rgba(30, 211, 255, 0.72);
  box-shadow: 0 0 0 3px rgba(30, 211, 255, 0.15);
}

.calendar-create-description {
  grid-column: 1 / -1;
}

.calendar-create-form.hidden {
  display: none;
}

.calendar-event-list {
  display: grid;
  gap: 14px;
}

.calendar-event-card {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 18px;
  border: 1px solid rgba(109, 124, 187, 0.22);
  border-radius: 18px;
  background: rgba(36, 42, 73, 0.92);
  border-left: 6px solid rgba(30, 211, 255, 0.35);
}

.calendar-event-card.is-cancelled {
  border-left-color: #ef4444;
  background: linear-gradient(90deg, rgba(120, 28, 44, 0.38) 0%, rgba(63, 31, 39, 0.96) 18%, rgba(63, 31, 39, 0.92) 100%);
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.18);
}

.calendar-event-card.is-cancelled .calendar-event-copy h5,
.calendar-event-card.is-cancelled .calendar-event-date strong {
  color: #ffe0e6;
}

.calendar-event-date {
  display: grid;
  gap: 4px;
}

.calendar-event-date strong {
  color: #f5f7ff;
}

.calendar-event-date span,
.calendar-event-copy p {
  color: rgba(227, 233, 255, 0.74);
}

.calendar-event-copy {
  display: grid;
  gap: 6px;
}

.calendar-event-copy h5,
.calendar-event-copy p {
  margin: 0;
}

.calendar-event-copy h5 {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.calendar-event-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.calendar-event-badge-cancelled {
  background: rgba(239, 68, 68, 0.16);
  color: #fecaca;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.board-group:nth-of-type(2n) {
  --group-accent: #ff5db8;
}

.board-group:nth-of-type(3n) {
  --group-accent: #8b7dff;
}

.board-group:nth-of-type(4n) {
  --group-accent: #44df90;
}

.board-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid rgba(118, 130, 182, 0.18);
  background: linear-gradient(180deg, rgba(38, 45, 79, 0.96), rgba(31, 36, 66, 0.98));
  box-shadow: inset 6px 0 0 var(--group-accent);
}

.board-group-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.board-group-toggle-copy {
  display: grid;
  gap: 4px;
}

.board-group-chevron {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--group-accent);
  font-size: 1.15rem;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 160ms ease;
}

.board-group.is-collapsed .board-group-chevron {
  transform: rotate(-90deg);
}

.board-group-header h4 {
  margin: 0;
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--group-accent);
  letter-spacing: -0.02em;
}

.board-group-header .muted-text {
  color: rgba(227, 233, 255, 0.62);
}

.board-table-wrapper {
  overflow-x: auto;
  background: #232846;
}

.board-group.is-collapsed .board-table-wrapper {
  display: none;
}

.board-table {
  min-width: 1280px;
  border-collapse: separate;
  border-spacing: 0;
}

.board-table th {
  position: sticky;
  top: 0;
  background: #34395c;
  z-index: 1;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(139, 151, 204, 0.22);
  border-right: 1px solid rgba(139, 151, 204, 0.16);
  color: rgba(236, 240, 255, 0.88);
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.board-table th:first-child,
.board-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
}

.board-table th:first-child {
  z-index: 4;
  background: #3b4063;
}

.board-table td:first-child {
  background: #2b3051;
  box-shadow: 1px 0 0 rgba(129, 141, 194, 0.16);
}

.board-table td {
  padding: 0;
  border-bottom: 1px solid rgba(129, 141, 194, 0.16);
  border-right: 1px solid rgba(129, 141, 194, 0.12);
  vertical-align: top;
  background: #2f3456;
  min-width: 170px;
}

.board-table th.board-phone-column,
.board-table td.board-phone-column {
  min-width: 220px;
}

.board-table input,
.board-table select,
.board-table textarea {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 12px 14px;
  background: transparent;
  color: #eef1ff;
  font-size: 0.95rem;
  line-height: 1.45;
}

.board-table input:hover,
.board-table select:hover,
.board-table textarea:hover {
  background: rgba(88, 100, 156, 0.2);
}

.board-table input:focus,
.board-table select:focus,
.board-table textarea:focus {
  outline: none;
  border-color: #61c8ff;
  background: rgba(90, 102, 161, 0.26);
  box-shadow: 0 0 0 3px rgba(53, 182, 255, 0.14);
}

.board-table textarea {
  resize: none;
  min-height: 40px;
  overflow: hidden;
  white-space: pre-wrap;
}

.board-field-shell {
  position: relative;
  min-height: 56px;
}

.board-attempt-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 56px;
  padding: 8px 10px;
}

.board-attempt-value {
  flex: 1 1 auto;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #eef1ff;
  font: inherit;
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
}

.board-attempt-call-button {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(116, 214, 255, 0.28);
  border-radius: 999px;
  background: rgba(31, 180, 255, 0.14);
  color: #7ad8ff;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.board-attempt-call-button:hover {
  transform: translateY(-1px);
  background: rgba(31, 180, 255, 0.22);
  border-color: rgba(116, 214, 255, 0.46);
}

body.has-board-detail-modal {
  overflow: hidden;
}

.board-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  overflow: auto;
}

.board-detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 13, 26, 0.58);
  backdrop-filter: blur(6px);
}

.board-detail-panel {
  position: relative;
  z-index: 2;
  width: min(1420px, calc(100vw - 64px));
  max-width: 100%;
  max-height: calc(100vh - 64px);
  overflow: auto;
  margin: auto;
  padding: 28px 28px 34px;
  border: 1px solid rgba(127, 138, 190, 0.24);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(25, 31, 61, 0.98), rgba(21, 27, 53, 0.98));
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.42);
}

.board-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.board-detail-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.board-detail-header h3 {
  margin: 4px 0 0;
  font-size: 2.1rem;
  line-height: 1.05;
}

.board-detail-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.board-detail-notes-shell {
  margin-bottom: 18px;
}

.board-detail-notes {
  display: grid;
  gap: 8px;
}

.board-detail-notes span {
  font-size: 0.95rem;
  color: #c6ccee;
}

.board-detail-notes textarea {
  width: 100%;
  min-height: 136px;
  border: 1px solid rgba(127, 138, 190, 0.24);
  border-radius: 18px;
  padding: 16px 18px;
  background: rgba(34, 39, 73, 0.98);
  color: #eef1ff;
  font-size: 1rem;
  line-height: 1.55;
  resize: vertical;
}

.board-detail-tab {
  border: 1px solid rgba(127, 138, 190, 0.2);
  border-radius: 999px;
  background: rgba(36, 42, 74, 0.88);
  color: #cbd4f5;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
}

.board-detail-tab.is-active {
  background: rgba(36, 177, 255, 0.16);
  border-color: rgba(72, 199, 255, 0.45);
  color: #f2f7ff;
}

.board-detail-close {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(127, 138, 190, 0.24);
  border-radius: 12px;
  background: rgba(42, 48, 84, 0.9);
  color: #eef1ff;
  font-size: 1.5rem;
  cursor: pointer;
}

.board-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(127, 138, 190, 0.18);
  border-radius: 22px;
  background: rgba(27, 33, 63, 0.92);
}

.board-detail-grid label,
.board-detail-attempt-card {
  display: grid;
  gap: 8px;
}

.board-detail-grid span,
.board-detail-attempt-card > span {
  font-size: 0.95rem;
  color: #c6ccee;
}

.board-detail-grid input,
.board-detail-grid select,
.board-detail-grid textarea,
.board-detail-attempt-card .board-attempt-shell {
  width: 100%;
  border: 1px solid rgba(127, 138, 190, 0.24);
  border-radius: 14px;
  padding: 14px 16px;
  background: rgba(34, 39, 73, 0.98);
  color: #eef1ff;
  font-size: 1rem;
  line-height: 1.45;
}

.board-detail-grid textarea {
  min-height: 82px;
  resize: vertical;
}

.board-detail-grid input[readonly] {
  color: #aeb8e7;
  background: rgba(28, 33, 60, 0.98);
}

.board-detail-grid input:focus,
.board-detail-grid select:focus,
.board-detail-grid textarea:focus {
  outline: none;
  border-color: rgba(72, 199, 255, 0.68);
  box-shadow: 0 0 0 3px rgba(53, 182, 255, 0.12);
}

.board-detail-span {
  grid-column: 1 / -1;
}

.board-detail-attempt-card {
  grid-column: span 1;
}

.board-detail-appointment-card {
  display: grid;
  gap: 12px;
  grid-column: span 1;
}

.board-detail-appointment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.board-detail-appointment-content {
  min-height: 0;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(127, 138, 190, 0.24);
  background: rgba(34, 39, 73, 0.98);
}

.board-detail-appointment-empty,
.board-detail-appointment-summary {
  display: grid;
  gap: 6px;
}

.board-detail-appointment-empty {
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}

.board-detail-appointment-empty .muted-text,
.board-detail-appointment-summary p {
  margin: 0;
}

.board-detail-appointment-summary strong {
  color: #eef1ff;
}

.board-detail-inline-modal {
  position: absolute;
  inset: 0;
  z-index: 5;
}

.board-detail-inline-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 16, 31, 0.58);
  backdrop-filter: blur(4px);
}

.board-detail-inline-modal-panel {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: min(860px, calc(100% - 48px));
  max-height: calc(100% - 48px);
  overflow: auto;
  padding: 22px;
  border-radius: 24px;
  border: 1px solid rgba(112, 126, 189, 0.26);
  background: linear-gradient(180deg, rgba(25, 31, 58, 0.98) 0%, rgba(21, 26, 49, 0.98) 100%);
  box-shadow: 0 28px 60px rgba(5, 8, 19, 0.45);
}

.board-detail-inline-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.board-detail-calendar-form {
  display: grid;
  gap: 18px;
}

.board-detail-calendar-form .calendar-controls-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.board-detail-calendar-form label {
  min-width: 0;
}

.board-detail-calendar-form input,
.board-detail-calendar-form select,
.board-detail-calendar-form textarea {
  min-width: 0;
}

.board-detail-calendar-form .calendar-create-notes {
  grid-column: 1 / -1;
}

.board-detail-history {
  padding: 18px;
  border: 1px solid rgba(127, 138, 190, 0.18);
  border-radius: 22px;
  background: rgba(27, 33, 63, 0.92);
}

.board-detail-history-list {
  display: grid;
  gap: 14px;
}

.board-history-card {
  border: 1px solid rgba(127, 138, 190, 0.18);
  border-radius: 16px;
  padding: 16px 18px;
  background: rgba(34, 39, 73, 0.98);
}

.board-history-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 6px;
}

.board-history-card-head strong {
  color: #eef1ff;
}

.board-history-card-head span,
.board-history-card-meta {
  color: #aeb8e7;
  font-size: 0.92rem;
}

.board-history-card-meta,
.board-history-card-detail {
  margin: 0;
}

.board-history-card-detail {
  margin-top: 6px;
  color: #d8e0ff;
}

.board-attempt-shell-detail {
  padding: 8px;
}

.board-field-preview {
  display: -webkit-box;
  width: 100%;
  min-height: 56px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 12px 14px;
  background: transparent;
  color: #eef1ff;
  font: inherit;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.board-field-preview:hover {
  background: rgba(88, 100, 156, 0.2);
}

.board-field-link {
  text-decoration: none;
}

.board-name-preview mark,
.board-field-preview mark,
.subtle-preview mark,
.subtle-full mark {
  padding: 0 2px;
  border-radius: 4px;
  background: rgba(245, 247, 255, 0.38);
  color: #ffffff;
}

.board-cell-editor {
  display: none;
}

.board-name-cell {
  width: 42ch;
  min-width: 42ch;
  max-width: 42ch;
  overflow: hidden;
}

.board-name-shell {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  min-width: 0;
}

.board-name-preview,
.board-cell-title-input {
  min-width: 0;
  flex: 1 1 auto;
  font-weight: 600;
}

.board-name-preview {
  display: block;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 12px;
  background: transparent;
  color: #f3f6ff;
  font: inherit;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-name-preview:hover {
  background: rgba(88, 100, 156, 0.2);
}

.board-cell-title-input {
  display: none;
}

.board-drag-handle {
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 8px;
  background: transparent;
  color: rgba(229, 235, 255, 0.5);
  cursor: grab;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.board-drag-handle:hover {
  background: rgba(84, 97, 150, 0.24);
  color: #f3f6ff;
}

.board-drag-handle:active {
  cursor: grabbing;
}

.board-status-cell {
  min-width: 180px;
  max-width: 200px;
}

.board-status-select {
  appearance: none;
  border: 1px solid var(--status-border, #cbd5e1) !important;
  background: var(--status-bg, #eef2f7) !important;
  color: var(--status-text, #334155) !important;
  border-radius: 999px !important;
  font-weight: 700;
  text-align: center;
  padding: 10px 38px 10px 14px !important;
  margin: 8px;
  width: calc(100% - 16px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.board-inline-button {
  padding: 9px 12px;
  white-space: nowrap;
  margin: 8px;
  border-radius: 12px;
  font-size: 0.86rem;
  background: rgba(92, 102, 154, 0.24);
  color: #f2f5ff;
}

.board-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 8px;
  flex-wrap: wrap;
}

.board-inline-button-delete {
  background: rgba(180, 35, 24, 0.2);
}

[data-board-row] {
  cursor: default;
  transition: background 120ms ease, box-shadow 120ms ease;
}

[data-board-row]:hover td {
  background: #34395d;
}

[data-board-row].dragging {
  opacity: 0.45;
}

[data-group-dropzone] {
  min-height: 56px;
}

.board-empty-row td {
  background: rgba(31, 41, 51, 0.02);
  padding: 22px;
}

.board-add-row td {
  background: #313659;
}

.board-name-shell-add {
  gap: 12px;
  padding-bottom: 8px;
}

.board-add-plus {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  color: rgba(241, 245, 255, 0.76);
  font-size: 1.25rem;
  font-weight: 500;
}

.board-add-name-input {
  width: 100%;
  min-width: 0;
  border: 1px dashed transparent !important;
  color: rgba(241, 245, 255, 0.84) !important;
  background: transparent !important;
  font-weight: 600;
}

.board-add-name-input::placeholder {
  color: rgba(241, 245, 255, 0.52);
}

.board-add-name-input:hover,
.board-add-name-input:focus {
  border-color: rgba(98, 201, 255, 0.42) !important;
  background: rgba(88, 100, 156, 0.14) !important;
}

.board-add-muted-cell {
  background: #313659;
}

.board-add-action-cell {
  background: #313659;
}

.board-add-submit {
  margin: 8px;
  border: 1px solid rgba(118, 130, 189, 0.28);
  border-radius: 12px;
  padding: 10px 14px;
  background: rgba(90, 102, 156, 0.22);
  color: #f2f5ff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.board-add-submit:hover {
  background: rgba(101, 116, 179, 0.34);
}

.board-add-submit:disabled {
  opacity: 0.6;
  cursor: progress;
}

.board-archive-panel {
  margin-top: 24px;
}

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

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

.status-chart-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
}

.status-chart-card {
  display: flex;
  justify-content: center;
}

.status-chart {
  position: relative;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(42, 53, 69, 0.08);
}

.status-chart-center {
  position: absolute;
  inset: 28%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  border-radius: 50%;
  background: var(--surface-strong);
  text-align: center;
}

.status-chart-center strong {
  font-size: 2rem;
  color: var(--accent-dark);
}

.status-chart-center span {
  color: var(--muted);
  font-size: 0.95rem;
}

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

.status-legend-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.status-legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-top: 3px;
  flex: 0 0 auto;
}

.status-legend-dot-inline {
  display: inline-block;
  margin-right: 10px;
  vertical-align: middle;
}

.hidden {
  display: none;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 30px 12px;
}

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

  .sidebar {
    gap: 24px;
  }

  .metrics-grid,
  .advisor-metrics-grid,
  .analytics-grid,
  .status-chart-layout,
  .advisor-form,
  .board-quick-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .content {
    padding: 18px;
  }

  .sidebar {
    padding: 24px 18px;
  }

  .metrics-grid,
  .advisor-metrics-grid,
  .analytics-grid,
  .status-chart-layout,
  .advisor-form,
  .board-quick-grid {
    grid-template-columns: 1fr;
  }

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

  .panel-header,
  .panel-header-tight,
  .hero-header,
  .hero-actions,
  .header-actions {
    flex-direction: column;
  }
}
