:root,
html[data-theme="current"] {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #18202f;
  --muted: #667085;
  --line: #e6eaf0;
  --sidebar: #101827;
  --sidebar-2: #1c2740;
  --accent: #2563eb;
  --accent-soft: #eef4ff;
  --ok: #0f766e;
  --warn: #b45309;
  --text: var(--ink);
  --shadow-soft: 0 12px 28px rgba(16, 24, 40, .05);
}

html {
  font-size: 15px;
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 1200;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.skip-link:focus {
  top: 16px;
  color: #fff;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: #1746ad;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 18px;
  background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  padding: 8px 6px 22px;
}

.brand:hover {
  color: #fff;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #fff;
  color: var(--sidebar);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: #b9c3d6;
}

.side-nav {
  display: grid;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-color: rgba(255, 255, 255, .26) transparent;
  scrollbar-width: thin;
}

.side-nav-tools {
  padding: 0 0 12px;
}

.side-nav-filter {
  border-color: rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.side-nav-filter::placeholder {
  color: #b9c3d6;
}

.side-nav-filter:focus {
  border-color: rgba(147, 197, 253, .7);
  background: rgba(255, 255, 255, .12);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(147, 197, 253, .18);
}

.side-nav a,
.mobile-nav a {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  color: #d9e2f1;
  font-weight: 600;
}

.side-nav a:hover {
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.side-user {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  color: #ffffff;
  font-size: .88rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.side-group {
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  background: rgba(255, 255, 255, .035);
}

.side-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  color: #ffffff;
  cursor: pointer;
  font-size: .92rem;
  font-weight: 750;
  list-style: none;
}

.side-group summary::-webkit-details-marker {
  display: none;
}

.side-group summary::after {
  content: "+";
  color: #9fb0ca;
  font-weight: 800;
}

.side-group[open] summary::after {
  content: "-";
}

.side-subnav {
  display: grid;
  gap: 2px;
  padding: 0 8px 8px;
}

.side-subnav a {
  padding: 8px 10px 8px 18px;
  color: #b9c3d6;
  font-size: .86rem;
  font-weight: 600;
}

.side-subnav a:hover {
  background: rgba(255, 255, 255, .07);
  color: #fff;
}

.side-subnav a.active {
  background: rgba(37, 99, 235, .24);
  color: #ffffff;
}

.role-note {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: rgba(255, 255, 255, .05);
}

.role-note span {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
}

.role-note p {
  margin: 0;
  color: #b9c3d6;
  font-size: .9rem;
}

.app-main {
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 84px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(8px);
}

.navbar-toggler {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 3px rgba(43, 108, 246, .16);
}

.navbar-toggler-icon {
  position: relative;
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  border-radius: 999px;
  background: var(--ink);
}

.navbar-toggler-icon::before,
.navbar-toggler-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--ink);
}

.navbar-toggler-icon::before {
  top: -6px;
}

.navbar-toggler-icon::after {
  top: 6px;
}

.topbar h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 750;
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1;
}

.back-button:hover {
  border-color: rgba(37, 99, 235, .35);
  background: var(--accent-soft);
  color: var(--accent);
}

.topbar-eyebrow,
.section-kicker {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

.navbar-nav {
  align-items: center;
  gap: 8px;
}

.nav-link {
  color: var(--muted);
}

.content-wrap {
  padding: 28px;
}

.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 700;
}

.breadcrumb-nav a {
  color: var(--muted);
}

.breadcrumb-nav a:hover {
  color: var(--accent);
}

.breadcrumb-nav a::after {
  content: ">";
  margin-left: 8px;
  color: #98a2b3;
}

.breadcrumb-nav span {
  color: var(--ink);
}

.mobile-nav {
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  max-height: calc(100vh - 84px);
  overflow-y: auto;
}

.mobile-nav .side-group + .side-group {
  margin-top: 8px;
}

.mobile-nav .side-user {
  background: var(--accent-soft);
  color: var(--ink);
}

.mobile-nav .side-group {
  border-color: var(--line);
  background: #fff;
}

.mobile-nav .side-group summary {
  color: var(--ink);
}

.mobile-nav .side-nav-tools {
  padding-bottom: 10px;
}

.mobile-nav .side-nav-filter {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.mobile-nav .side-nav-filter::placeholder {
  color: var(--muted);
}

.mobile-nav .side-subnav a {
  color: var(--muted);
}

.mobile-nav .side-subnav a:hover,
.mobile-nav a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.mobile-nav .side-subnav a.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.metric-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-card,
.panel-block,
.welcome-panel,
.project-header {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 28px rgba(16, 24, 40, .05);
  content-visibility: auto;
  contain-intrinsic-size: 320px;
}

.metric-card {
  padding: 18px;
}

.metric-card span,
.metric-card small {
  display: block;
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin: 8px 0;
  font-size: 2rem;
  line-height: 1;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.panel-block {
  padding: 18px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-heading h2,
.welcome-panel h2,
.project-header h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 750;
}

.list-stack {
  display: grid;
  gap: 10px;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.list-row-link {
  color: var(--ink);
}

.list-row-link:hover {
  border-color: rgba(37, 99, 235, .35);
  background: var(--accent-soft);
  color: var(--ink);
}

.list-row strong,
.list-row small {
  display: block;
}

.list-row small {
  color: var(--muted);
}

.task-tree-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  padding: 2px 7px;
  border: 1px solid rgba(37, 99, 235, .2);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .72rem;
  font-weight: 850;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #1d4ed8;
  font-size: .78rem;
  font-weight: 750;
  white-space: nowrap;
}

.inline-status-form {
  display: inline-flex;
  margin: 0;
}

.status-select {
  min-width: 128px;
  max-width: 190px;
  padding: 5px 28px 5px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background-color: var(--accent-soft);
  color: #1d4ed8;
  font-size: .78rem;
  font-weight: 750;
  line-height: 1.2;
  cursor: pointer;
}

.status-select:hover,
.status-select:focus {
  border-color: rgba(37, 99, 235, .35);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.status-success {
  background: #dcfce7;
  color: #166534;
}

.status-warning {
  background: #fef3c7;
  color: #92400e;
}

.status-danger {
  background: #fee2e2;
  color: #991b1b;
}

.status-pill.status-planned,
.status-select.status-planned,
.status-pill.status-draft,
.status-select.status-draft,
.status-pill.status-todo,
.status-select.status-todo {
  background: #eef2ff;
  color: #3730a3;
}

.status-pill.status-inprogress,
.status-select.status-inprogress,
.status-pill.status-ordered,
.status-select.status-ordered,
.status-pill.status-requested,
.status-select.status-requested,
.status-pill.status-inreview,
.status-select.status-inreview {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-pill.status-waiting,
.status-select.status-waiting,
.status-pill.status-partiallydelivered,
.status-select.status-partiallydelivered {
  background: #fef3c7;
  color: #92400e;
}

.status-pill.status-completed,
.status-select.status-completed,
.status-pill.status-done,
.status-select.status-done,
.status-pill.status-delivered,
.status-select.status-delivered {
  background: #dcfce7;
  color: #166534;
}

.status-pill.status-cancelled,
.status-select.status-cancelled {
  background: #fee2e2;
  color: #991b1b;
}

.status-pill.status-instock,
.status-select.status-instock {
  background: #dcfce7;
  color: #166534;
}

.status-pill.status-reserved,
.status-select.status-reserved {
  background: #e0f2fe;
  color: #0369a1;
}

.status-pill.status-lowstock,
.status-select.status-lowstock {
  background: #fef3c7;
  color: #92400e;
}

.status-pill.status-outofstock,
.status-select.status-outofstock,
.status-pill.status-scrapped,
.status-select.status-scrapped {
  background: #fee2e2;
  color: #991b1b;
}

.priority-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 750;
  white-space: nowrap;
}

.priority-low {
  background: #ecfdf5;
  color: #047857;
}

.priority-normal {
  background: #e0f2fe;
  color: #0369a1;
}

.priority-high {
  background: #fef3c7;
  color: #92400e;
}

.priority-critical {
  background: #fee2e2;
  color: #991b1b;
}

.row-muted {
  opacity: .62;
  background: #f8fafc;
}

.status-row.status-completed,
.status-row.status-done,
.status-row.status-delivered,
.status-row.status-fulfilled {
  border-left: 4px solid #16a34a;
}

.status-row.status-completed > td,
.status-row.status-done > td,
.status-row.status-delivered > td,
.status-row.status-fulfilled > td {
  background: #c8f2d8;
  color: #0f3d24;
}

.status-row.status-cancelled {
  border-left: 4px solid #dc2626;
}

.status-row.status-blocked {
  border-left: 4px solid #dc2626;
}

.status-row.status-inprogress,
.status-row.status-requested,
.status-row.status-approved,
.status-row.status-ordered,
.status-row.status-inreview {
  border-left: 4px solid #2563eb;
}

.status-row.status-planned,
.status-row.status-draft,
.status-row.status-todo {
  border-left: 4px solid #6366f1;
}

.status-row.status-waiting,
.status-row.status-partiallydelivered {
  border-left: 4px solid #d97706;
}

.status-row.status-instock {
  border-left: 4px solid #16a34a;
}

.status-row.status-reserved {
  border-left: 4px solid #0284c7;
}

.status-row.status-lowstock {
  border-left: 4px solid #d97706;
}

.status-row.status-outofstock,
.status-row.status-scrapped {
  border-left: 4px solid #dc2626;
}

.status-row[data-row-link] {
  cursor: pointer;
}

.status-row[data-row-link]:hover > td {
  background: #f8fbff;
}

.status-row.status-completed[data-row-link]:hover > td,
.status-row.status-done[data-row-link]:hover > td,
.status-row.status-delivered[data-row-link]:hover > td,
.status-row.status-fulfilled[data-row-link]:hover > td {
  background: #b2eac8;
}

.stock-material-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.stock-material-card {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}

.stock-material-card:hover {
  border-color: rgba(37, 99, 235, .35);
  background: #f8fbff;
  color: var(--ink);
}

.stock-material-card strong,
.stock-material-card small,
.stock-card-meta span,
.stock-card-meta strong,
.stock-card-meta em {
  display: block;
}

.stock-material-card small,
.stock-card-meta span {
  color: var(--muted);
}

.stock-card-meta {
  text-align: right;
}

.stock-card-meta em {
  color: #b45309;
  font-style: normal;
  font-weight: 750;
}

.stock-group-stack {
  display: grid;
  gap: 18px;
}

.stock-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.stock-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}

.stock-group-heading h3 {
  margin: 0;
  font-size: 1rem;
}

.stock-group-heading span {
  color: var(--muted);
  font-size: .85rem;
}

.app-table {
  margin: 0;
  min-width: 720px;
}

.app-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding-top: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 750;
  text-transform: uppercase;
}

.app-table tbody tr:not(.status-row) > td,
.app-table tbody tr:not(.status-row) > th {
  background: var(--panel);
}

.app-table tbody tr:nth-child(even):not(.status-row.status-completed):not(.status-row.status-done):not(.status-row.status-delivered):not(.status-row.status-fulfilled) > td {
  background: var(--panel);
}

.app-table td {
  border-color: var(--line);
  vertical-align: middle;
}

.table-responsive {
  position: relative;
  overflow-x: auto;
  overflow-y: visible;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 -1px 0 rgba(15, 23, 42, .02);
}

.table-responsive.table-responsive-menu {
  min-height: 320px;
}

.table-responsive::after {
  content: none;
  display: none;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.calendar-toolbar strong {
  min-width: 150px;
  text-align: center;
  text-transform: capitalize;
}

.project-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.calendar-weekday {
  padding: 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.calendar-weekday:nth-child(7) {
  border-right: 0;
}

.calendar-day {
  min-height: 132px;
  padding: 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.calendar-day:nth-child(7n) {
  border-right: 0;
}

.calendar-day.is-muted {
  background: #f8fafc;
  color: #98a2b3;
}

.calendar-day.is-today {
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, .55);
}

.calendar-day-number {
  margin-bottom: 6px;
  font-size: .86rem;
  font-weight: 800;
}

.calendar-events {
  display: grid;
  gap: 5px;
}

.calendar-event {
  display: grid;
  gap: 1px;
  padding: 6px 7px;
  border-left: 3px solid #2563eb;
  border-radius: 6px;
  background: #eff6ff;
  color: var(--ink);
}

.calendar-event:hover {
  color: var(--ink);
  filter: brightness(.98);
}

.calendar-event span,
.calendar-more {
  color: var(--muted);
  font-size: .7rem;
  font-weight: 750;
}

.calendar-event strong {
  overflow: hidden;
  font-size: .78rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-event.status-completed {
  border-color: #16a34a;
  background: #dcfce7;
}

.calendar-event.status-cancelled {
  border-color: #dc2626;
  background: #fee2e2;
}

.calendar-event.status-waiting {
  border-color: #d97706;
  background: #fef3c7;
}

.calendar-event.status-planned {
  border-color: #6366f1;
  background: #eef2ff;
}

.list-filter-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1.8fr) repeat(4, minmax(130px, 1fr)) auto auto;
  gap: 8px;
  align-items: center;
  margin: 0 0 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  position: sticky;
  top: 12px;
  z-index: 5;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .04);
}

.list-filter-bar-wide {
  grid-template-columns: minmax(220px, 2fr) repeat(7, minmax(120px, 1fr)) auto auto;
}

.bulk-action-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: -4px 0 12px;
}

.bulk-action-bar.smart-bulk-bar {
  position: sticky;
  top: 62px;
  z-index: 6;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: rgba(239, 246, 255, .96);
  box-shadow: 0 10px 24px rgba(37, 99, 235, .12);
  backdrop-filter: blur(8px);
}

.bulk-action-bar.smart-bulk-bar[hidden] {
  display: none;
}

.bulk-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bulk-selection-count {
  color: var(--muted);
  font-size: .86rem;
  font-weight: 700;
}

.list-with-preview {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(280px, .85fr);
  gap: 16px;
  align-items: start;
}

.list-preview-panel {
  position: sticky;
  top: 62px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfdff 0%, #f4f8ff 100%);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
}

.list-preview-panel .section-kicker {
  margin-bottom: 6px;
}

.list-preview-panel h3 {
  margin: 0;
  font-size: 1.05rem;
}

.list-preview-panel p {
  margin: 0;
}

.list-preview-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: .78rem;
  font-weight: 800;
}

.list-preview-subtitle,
.list-preview-meta {
  color: var(--muted);
  font-size: .88rem;
}

.list-preview-description {
  margin-top: 12px;
  color: var(--ink);
  line-height: 1.55;
}

.status-row.is-preview-active > td {
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .18);
}

.action-cell {
  white-space: nowrap;
  width: 1%;
}

.action-cell > .action-shell {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.preview-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: .82rem;
  font-weight: 800;
}

.preview-trigger:hover,
.preview-trigger.is-active {
  border-color: rgba(37, 99, 235, .35);
  background: var(--accent-soft);
  color: #1d4ed8;
}

.compact-preview-popover {
  position: fixed;
  width: min(320px, calc(100vw - 24px));
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 18px 42px rgba(15, 23, 42, .18);
  z-index: 1200;
}

.compact-preview-popover[hidden] {
  display: none;
}

.compact-preview-popover h3 {
  margin: 6px 0 4px;
  font-size: 1rem;
}

.compact-preview-popover p {
  margin: 0;
}

.file-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.image-preview-open {
  overflow: hidden;
}

.image-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 1400;
}

.image-preview-overlay[hidden] {
  display: none;
}

.image-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .74);
}

.image-preview-dialog {
  position: relative;
  display: grid;
  gap: 14px;
  width: min(1080px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: 16px auto;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 24px 54px rgba(15, 23, 42, .28);
  overflow: auto;
}

.image-preview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.image-preview-header h3,
.image-preview-meta,
.image-preview-description,
.image-preview-counter {
  margin: 0;
}

.image-preview-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.image-preview-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 420px;
  padding: 18px 52px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(15, 23, 42, .04), rgba(37, 99, 235, .08));
}

.image-preview-stage img {
  max-width: 100%;
  max-height: min(72vh, 760px);
  border-radius: 12px;
  object-fit: contain;
  box-shadow: 0 16px 34px rgba(15, 23, 42, .18);
}

.image-preview-nav {
  position: absolute;
  top: 50%;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 999px;
  background: rgba(15, 23, 42, .66);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  transform: translateY(-50%);
}

.image-preview-nav.prev {
  left: 12px;
}

.image-preview-nav.next {
  right: 12px;
}

.image-preview-nav:hover {
  background: rgba(15, 23, 42, .84);
}

.image-preview-meta,
.image-preview-counter {
  color: var(--muted);
}

.action-menu {
  position: relative;
}

.action-menu summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

.action-menu summary::-webkit-details-marker {
  display: none;
}

.action-menu[open] summary,
.action-menu summary:hover {
  border-color: rgba(37, 99, 235, .35);
  background: var(--accent-soft);
  color: #1d4ed8;
}

.action-menu-list {
  position: absolute;
  top: calc(100% + 6px);
  left: auto;
  right: 0;
  min-width: 180px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(15, 23, 42, .14);
}

.action-menu-list a,
.action-menu-list button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: flex-start;
  min-height: 36px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: .9rem;
  text-decoration: none;
}

.action-menu-list a:hover,
.action-menu-list button:hover {
  background: #f8fafc;
  color: #1d4ed8;
}

.action-menu-list .text-danger:hover {
  background: #fef2f2;
  color: #b91c1c;
}

.empty-note-empty-state {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
}

.empty-note-empty-state strong,
.empty-note-empty-state span {
  display: block;
}

.empty-note-empty-state span {
  margin-top: 4px;
}

.bulk-check-cell {
  width: 44px;
  text-align: center;
}

.bulk-check-cell input,
.app-table td input[type="checkbox"][form] {
  width: 16px;
  height: 16px;
}

.filter-field {
  position: relative;
}

.filter-field .form-control {
  padding-left: 30px;
}

.filter-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-weight: 800;
  pointer-events: none;
}

.icon-filter-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

.icon-filter-button:hover {
  border-color: rgba(37, 99, 235, .35);
  background: var(--accent-soft);
  color: #1d4ed8;
}

.icon-filter-button.clear {
  color: #991b1b;
}

.icon-filter-button.clear:hover {
  border-color: rgba(220, 38, 38, .35);
  background: #fee2e2;
  color: #991b1b;
}

.welcome-panel,
.project-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
}

.filter-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: -4px 0 14px;
}

.filter-summary-title {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 800;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid #dbe7ff;
  border-radius: 999px;
  background: #f5f9ff;
  color: #1d4ed8;
  font-size: .78rem;
  font-weight: 750;
}

.welcome-panel p,
.project-header p {
  max-width: 780px;
  margin: 10px 0 0;
  color: var(--muted);
}

.welcome-actions {
  display: flex;
  gap: 10px;
  white-space: nowrap;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 8px;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.check-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  font-weight: 650;
}

.check-inline {
  width: fit-content;
}

.task-relation-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.is-disabled-soft,
.form-control:disabled,
.form-select:disabled {
  background: #eef2f7;
  color: #98a2b3;
  cursor: not-allowed;
}

.searchable-select {
  position: relative;
}

.searchable-select-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.searchable-select-input {
  padding-right: 36px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 52%,
    calc(100% - 13px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.searchable-select-list,
.searchable-select-empty {
  display: none;
  position: absolute;
  z-index: 60;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(16, 24, 40, .16);
}

.searchable-select.is-open .searchable-select-list {
  display: grid;
  padding: 6px;
  gap: 2px;
}

.searchable-select-empty.is-visible {
  display: block;
  padding: 10px 12px;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 700;
}

.searchable-select-option {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  padding: 8px 10px;
  text-align: left;
  font-size: .9rem;
}

.searchable-select-option:hover,
.searchable-select-option[aria-selected="true"] {
  background: var(--accent-soft);
  color: var(--accent);
}

.searchable-select-option:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: .65;
}

.activity-panel {
  margin-top: 18px;
}

.activity-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.activity-form {
  display: grid;
  gap: 10px;
}

.file-upload-status {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #f8fbff;
}

.file-upload-status-text {
  font-size: 0.88rem;
  color: #1e3a8a;
  font-weight: 600;
}

.file-upload-status-text.is-error {
  color: #b91c1c;
}

.file-upload-progress {
  height: 8px;
  border-radius: 999px;
  background: #dbeafe;
  overflow: hidden;
}

.file-upload-progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #38bdf8);
  transition: width .18s ease;
}

.file-upload-list {
  display: grid;
  gap: 4px;
}

.file-upload-item {
  font-size: 0.82rem;
  color: #334155;
  word-break: break-word;
}

.file-upload-item.is-error {
  color: #b91c1c;
  font-weight: 600;
}

.project-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.record-count {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 0.86rem;
}

.detail-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.detail-summary-card,
.amount-breakdown > div,
.detail-note {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px 14px;
}

.detail-summary-card span,
.amount-breakdown span,
.detail-note span {
  display: block;
  color: #64748b;
  font-size: 0.78rem;
  margin-bottom: 4px;
}

.detail-summary-card strong {
  color: #0f172a;
}

.detail-summary-card.total {
  background: #ecfdf5;
  border-color: #bbf7d0;
}

.amount-breakdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.amount-breakdown .grand {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.detail-note {
  margin-top: 12px;
}

.detail-note p {
  margin: 0;
  color: #334155;
}

.inline-form {
  display: inline-flex;
  margin: 0 0 0 8px;
}

.link-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 650;
}

.link-button:hover {
  color: #1746ad;
}

.slim-progress {
  height: 8px;
  min-width: 120px;
}

.category-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--category-color, var(--accent));
}

.permission-group {
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.permission-group h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 750;
}

.permission-toggle {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 0;
}

.permission-toggle summary {
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 750;
}

.permission-toggle .permission-group {
  margin: 0 14px 14px;
}

.collapsible-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.collapsible-section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 750;
}

.collapsible-section summary::-webkit-details-marker {
  display: none;
}

.collapsible-section summary::after {
  content: "+";
  color: var(--accent);
  font-weight: 900;
}

.collapsible-section[open] summary {
  border-bottom: 1px solid var(--line);
}

.collapsible-section[open] summary::after {
  content: "-";
}

.collapsible-section .table-responsive,
.collapsible-section .empty-state {
  margin: 14px;
}

.recovery-code-list {
  display: grid;
  gap: 12px;
}

.recovery-code-list > div {
  display: grid;
  gap: 2px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.recovery-code-list code {
  display: block;
  padding: 14px;
  border: 1px dashed rgba(37, 99, 235, .35);
  border-radius: 8px;
  background: #eff6ff;
  color: #1746ad;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: .04em;
}

.auth-recovery-panel {
  max-width: 760px;
}

.recovery-code-input {
  text-transform: uppercase;
}

.backup-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.backup-hero h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 800;
}

.backup-hero p {
  margin: 0;
  color: var(--muted);
}

.backup-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.backup-card {
  display: flex;
  min-height: 168px;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.backup-card h3 {
  margin: 10px 0 6px;
  font-size: 1rem;
  font-weight: 800;
}

.backup-card p {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
}

.diagram-hero {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.diagram-hero h2 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 850;
}

.diagram-hero p:not(.section-kicker) {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--muted);
}

.diagram-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: 10px;
  min-width: 380px;
}

.diagram-summary-grid > div {
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.diagram-summary-grid span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.diagram-summary-grid strong {
  font-size: 1.65rem;
  line-height: 1;
}

.diagram-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
}

.diagram-filter-bar .form-select {
  max-width: 420px;
}

.google-gantt-shell {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.google-gantt-shell-large {
  min-height: 560px;
}

.google-gantt-chart {
  min-width: 980px;
  padding: 14px 16px 14px 22px;
}

.google-gantt-chart-large {
  min-height: 560px;
}

.google-gantt-chart text {
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  fill: #111111;
}

.google-visualization-tooltip,
.google-visualization-tooltip * {
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif !important;
}

.gantt-data-fallback {
  margin-top: 14px;
}

.gantt-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}

.gantt-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
}

.gantt-legend i {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
}

.gantt-board {
  min-width: 980px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.gantt-header,
.gantt-row {
  display: grid;
  grid-template-columns: 300px minmax(720px, 1fr) 140px;
}

.gantt-header {
  position: sticky;
  top: 0;
  z-index: 1;
  min-width: 1160px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.gantt-header-title {
  padding: 12px 14px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.gantt-time-scale,
.gantt-row-track {
  position: relative;
  min-height: 56px;
  background:
    linear-gradient(to right, rgba(226, 232, 240, .82) 1px, transparent 1px) 0 0 / 12.5% 100%,
    #ffffff;
}

.gantt-months,
.gantt-days {
  position: relative;
  height: 28px;
}

.gantt-months {
  border-bottom: 1px solid var(--line);
  background: #eef4ff;
}

.gantt-days {
  background: #fff;
}

.gantt-months span,
.gantt-days span {
  position: absolute;
  top: 7px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  overflow: hidden;
  padding: 0 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gantt-months span {
  color: #1d4ed8;
  font-size: .76rem;
}

.gantt-row {
  min-width: 1160px;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}

.gantt-row:last-child {
  border-bottom: 0;
}

.gantt-row:hover {
  color: var(--ink);
  background: #f8fbff;
}

.gantt-row-meta {
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 10px 14px;
}

.gantt-row-meta strong,
.gantt-row-meta small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gantt-row-meta small {
  color: var(--muted);
}

.gantt-row-meta .status-pill {
  justify-self: start;
  min-width: 0;
}

.gantt-row.is-task .gantt-row-meta {
  padding-left: 34px;
}

.gantt-row.is-task .gantt-row-meta strong {
  font-size: .92rem;
}

.gantt-row-dates {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 0 12px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
}

.gantt-row-dates strong {
  color: var(--ink);
  font-size: .92rem;
}

.gantt-bar {
  position: absolute;
  top: 18px;
  height: 20px;
  min-width: 48px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbeafe;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .16);
}

.gantt-row.is-project .gantt-bar {
  height: 24px;
  background: #bfdbfe;
}

.gantt-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2563eb;
}

.gantt-bar em {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #0f172a;
  font-size: .68rem;
  font-style: normal;
  font-weight: 850;
}

.gantt-bar.status-completed span,
.gantt-bar.status-done span {
  background: #16a34a;
}

.gantt-bar.status-waiting span {
  background: #d97706;
}

.gantt-bar.status-cancelled span {
  background: #dc2626;
}

.gantt-row.is-late .gantt-row-meta strong {
  color: #b42318;
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(260px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.kanban-column {
  min-width: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.kanban-column header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.kanban-column header strong {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: .86rem;
}

.kanban-card-stack {
  display: grid;
  gap: 10px;
  min-height: 180px;
  padding: 10px;
}

.kanban-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(16, 24, 40, .04);
}

.kanban-card:hover {
  border-color: rgba(37, 99, 235, .35);
  color: var(--ink);
  transform: translateY(-1px);
}

.kanban-card.is-late {
  border-color: #fed7aa;
}

.kanban-card-top {
  display: grid;
  gap: 8px;
}

.kanban-card-top strong {
  line-height: 1.25;
}

.kanban-card-meta,
.kanban-card-people,
.kanban-card-bottom {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: .8rem;
}

.kanban-card-bottom {
  grid-template-columns: minmax(80px, auto) 1fr;
  align-items: center;
}

.kanban-empty {
  margin: 0;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: .86rem;
}

.planning-context {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.planning-context span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.planning-shell {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  align-items: start;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.planning-tree,
.planning-timeline {
  min-width: 0;
  overflow: hidden;
  background: #fff;
}

.planning-tree {
  border-right: 1px solid var(--line);
}

.planning-tree header,
.planning-timeline header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.planning-tree header,
.planning-timeline header {
  min-height: 64px;
}

.planning-tree header span,
.planning-timeline header span {
  display: block;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.planning-tree header strong,
.planning-timeline header strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
}

.planning-tree-list,
.planning-timeline-grid {
  display: grid;
}

.planning-tree-list {
  --planning-gantt-header-height: 72px;
  --planning-gantt-row-height: 42px;
  overflow-x: hidden;
}

.planning-tree-list::before {
  content: "Plan görevleri";
  display: flex;
  align-items: end;
  height: var(--planning-gantt-header-height);
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.planning-tree-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: var(--planning-gantt-row-height);
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

.planning-tree-row.is-hidden,
.planning-unscheduled-row.is-hidden {
  display: none;
}

.planning-tree-row:last-child,
.planning-timeline-row:last-child {
  border-bottom: 0;
}

.planning-tree-row:hover {
  background: #f8fbff;
  color: var(--ink);
}

.planning-tree-title {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1 1 auto;
  min-width: 0;
  padding-left: calc(var(--task-level, 0) * 16px);
  color: var(--ink);
}

.planning-tree-title:hover {
  color: var(--accent);
}

.planning-tree-title strong {
  overflow: hidden;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planning-tree-title em {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: .7rem;
  font-style: normal;
  font-weight: 800;
}

.planning-tree-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  flex: 0 0 12px;
  color: var(--accent);
  font-size: 1rem;
  font-weight: 900;
}

.planning-tree-toggle,
.planning-tree-toggle-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}

.planning-tree-toggle {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--accent);
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1;
  transform: rotate(90deg);
}

.planning-tree-toggle:hover {
  background: var(--accent-soft);
}

.planning-tree-toggle.is-collapsed {
  transform: rotate(0deg);
}

.planning-add-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
}

.planning-add-child:hover {
  border-color: rgba(37, 99, 235, .35);
  background: var(--accent-soft);
}

.planning-add-child.is-active {
  border-color: rgba(37, 99, 235, .42);
  background: var(--accent-soft);
}

.planning-task-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.planning-add-child.is-danger {
  color: #b42318;
}

.planning-add-child.is-danger:hover {
  border-color: rgba(220, 38, 38, .28);
  background: #fef2f2;
}

.planning-add-child.is-disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: .55;
}

.planning-add-child.is-disabled:hover {
  border-color: var(--line);
  background: #fff;
}

.planning-user-checks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.planning-task-modal .modal-body {
  max-height: calc(100vh - 220px);
  overflow-y: auto;
}

.planning-task-modal .planning-user-checks {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  max-height: 124px;
}

.planning-task-modal .modal-footer {
  border-top: 1px solid var(--line);
  background: #fff;
}

.planning-timeline-row {
  display: grid;
  grid-template-columns: minmax(180px, .9fr) minmax(240px, 1.1fr);
  gap: 12px;
  align-items: center;
  min-height: 48px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

.planning-unscheduled {
  display: grid;
  gap: 2px;
  padding: 10px;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
}

.planning-unscheduled > span {
  display: block;
  margin: 0 0 4px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.planning-unscheduled-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--ink);
}

.planning-unscheduled-row:hover {
  background: var(--accent-soft);
  color: var(--ink);
}

.planning-timeline-row strong,
.planning-timeline-row span {
  display: block;
}

.planning-timeline-row span {
  color: var(--muted);
  font-size: .78rem;
}

.planning-progress {
  position: relative;
  height: 22px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f7;
}

.planning-progress span {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: #2563eb;
}

.planning-progress em {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #0f172a;
  font-size: .72rem;
  font-style: normal;
  font-weight: 850;
}

.planning-gantt-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.planning-gantt-modes {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.planning-gantt-modes button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  padding: 6px 9px;
}

.planning-gantt-modes button:hover,
.planning-gantt-modes button.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.planning-gantt-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.planning-gantt-legend-strip {
  justify-content: flex-start;
  gap: 10px;
  margin: -4px 0 12px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.planning-gantt-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
}

.planning-gantt-legend i {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 999px;
}

.planning-gantt-legend .todo {
  background: #94a3b8;
}

.planning-gantt-legend .inprogress {
  background: #0284c7;
}

.planning-gantt-legend .waiting {
  background: #d97706;
}

.planning-gantt-legend .inreview {
  background: #7c3aed;
}

.planning-gantt-legend .done {
  background: #16a34a;
}

.planning-gantt-legend .cancelled {
  background: #dc2626;
}

.planning-gantt-shell {
  min-height: 420px;
  overflow: auto;
  background: #fff;
}

.planning-gantt-shell .gantt-container {
  border-radius: 0;
  border: 0;
  line-height: 14px;
}

.planning-gantt-shell .grid-header {
  border-top: 0;
}

.planning-gantt-shell .gantt .row-line {
  stroke: var(--line);
}

.planning-gantt-shell .gantt .bar-wrapper {
  transform-box: fill-box;
}

.planning-gantt-shell svg {
  min-width: 760px;
}

.planning-gantt-shell .grid-header {
  fill: #f8fafc;
}

.planning-gantt-shell .grid-row {
  fill: #fff;
}

.planning-gantt-shell .grid-row:nth-child(even) {
  fill: #fff;
}

.planning-gantt-shell .lower-text,
.planning-gantt-shell .upper-text {
  fill: #667085;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 12px;
  font-weight: 750;
}

.planning-gantt-shell .bar-label {
  fill: #0f172a;
  font-size: 12px;
  font-weight: 800;
}

.planning-gantt-shell .bar {
  fill: #94a3b8;
}

.planning-gantt-shell .bar-progress {
  fill: #64748b;
}

.planning-gantt-shell .bar-wrapper.todo .bar,
.planning-gantt-shell .bar.todo {
  fill: #94a3b8;
}

.planning-gantt-shell .bar-wrapper.todo .bar-progress,
.planning-gantt-shell .bar-progress.todo {
  fill: #64748b;
}

.planning-gantt-shell .bar-wrapper.inprogress .bar,
.planning-gantt-shell .bar.inprogress {
  fill: #38bdf8;
}

.planning-gantt-shell .bar-wrapper.inprogress .bar-progress,
.planning-gantt-shell .bar-progress.inprogress {
  fill: #0284c7;
}

.planning-gantt-shell .bar-wrapper.waiting .bar,
.planning-gantt-shell .bar.waiting {
  fill: #fbbf24;
}

.planning-gantt-shell .bar-wrapper.waiting .bar-progress,
.planning-gantt-shell .bar-progress.waiting {
  fill: #d97706;
}

.planning-gantt-shell .bar-wrapper.inreview .bar,
.planning-gantt-shell .bar.inreview {
  fill: #a78bfa;
}

.planning-gantt-shell .bar-wrapper.inreview .bar-progress,
.planning-gantt-shell .bar-progress.inreview {
  fill: #7c3aed;
}

.planning-gantt-shell .bar-wrapper.done .bar,
.planning-gantt-shell .bar.done {
  fill: #86efac;
}

.planning-gantt-shell .bar-wrapper.done .bar-progress,
.planning-gantt-shell .bar-progress.done {
  fill: #16a34a;
}

.planning-gantt-shell .bar-wrapper.cancelled .bar,
.planning-gantt-shell .bar.cancelled {
  fill: #fca5a5;
}

.planning-gantt-shell .bar-wrapper.cancelled .bar-progress,
.planning-gantt-shell .bar-progress.cancelled {
  fill: #dc2626;
}

.planning-gantt-shell .bar-wrapper {
  cursor: pointer;
}

.planning-gantt-shell .popup-wrapper {
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(16, 24, 40, .14);
  z-index: 30;
}

.planning-custom-gantt {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.planning-custom-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.planning-custom-toolbar span {
  display: block;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.planning-custom-toolbar strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
}

.planning-custom-board {
  --planning-task-column: 340px;
  --planning-row-height: 42px;
  overflow: auto;
  min-height: 560px;
  max-height: 680px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.planning-custom-header,
.planning-custom-row {
  display: grid;
  grid-template-columns: var(--planning-task-column) max-content;
  min-width: max-content;
}

.planning-custom-row.is-filler .planning-custom-task {
  background: #fbfcfe;
}

.planning-custom-task-filler {
  border-right: 1px solid var(--line);
}

.planning-custom-header {
  position: sticky;
  top: 0;
  z-index: 8;
  height: 72px;
  background: #fbfcfe;
}

.planning-custom-task-head,
.planning-custom-date-head {
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.planning-custom-task-head {
  position: sticky;
  left: 0;
  z-index: 9;
  display: flex;
  align-items: end;
  padding: 0 12px 10px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: .76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.planning-custom-date-head {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--planning-period-width, 116px);
}

.planning-custom-date-cell {
  display: flex;
  align-items: end;
  justify-content: center;
  min-width: 56px;
  padding: 0 8px 10px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: .75rem;
  font-weight: 850;
  text-align: center;
  white-space: nowrap;
}

.planning-custom-row {
  min-height: var(--planning-row-height);
}

.planning-custom-row.is-hidden {
  display: none;
}

.planning-custom-task {
  position: sticky;
  left: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--planning-row-height);
  padding: 0 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.planning-custom-row:nth-child(even) .planning-custom-task {
  background: #fff;
}

.planning-custom-timeline {
  position: relative;
  height: var(--planning-row-height);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.planning-custom-row:nth-child(even) .planning-custom-timeline {
  background: #fff;
}

.planning-custom-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--planning-period-width, 116px);
  height: 100%;
}

.planning-custom-grid-cell {
  border-right: 1px solid rgba(226, 232, 240, .9);
}

.planning-custom-bar {
  position: absolute;
  top: 9px;
  height: 24px;
  overflow: hidden;
  border-radius: 6px;
  background: #94a3b8;
  color: #0f172a;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08);
}

.planning-custom-bar span {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: #64748b;
}

.planning-custom-bar em {
  position: relative;
  z-index: 1;
  display: block;
  overflow: hidden;
  padding: 5px 8px 0;
  font-size: .74rem;
  font-style: normal;
  font-weight: 850;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planning-custom-bar.todo {
  background: #cbd5e1;
}

.planning-custom-bar.todo span {
  background: #64748b;
}

.planning-custom-bar.inprogress {
  background: #bae6fd;
}

.planning-custom-bar.inprogress span {
  background: #0284c7;
}

.planning-custom-bar.waiting {
  background: #fde68a;
}

.planning-custom-bar.waiting span {
  background: #d97706;
}

.planning-custom-bar.inreview {
  background: #ddd6fe;
}

.planning-custom-bar.inreview span {
  background: #7c3aed;
}

.planning-custom-bar.done {
  background: #bbf7d0;
}

.planning-custom-bar.done span {
  background: #16a34a;
}

.planning-custom-bar.cancelled {
  background: #fecaca;
}

.planning-custom-bar.cancelled span {
  background: #dc2626;
}

.planning-custom-no-date {
  position: absolute;
  top: 8px;
  left: 12px;
  padding: 4px 8px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
}

.planning-custom-popup {
  position: fixed;
  z-index: 1100;
  width: min(340px, calc(100vw - 28px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(16, 24, 40, .18);
  pointer-events: none;
}

.planning-custom-popup.is-hidden {
  display: none;
}

.planning-custom-popup strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: .92rem;
  line-height: 1.25;
}

.planning-custom-popup dl {
  display: grid;
  gap: 6px;
  margin: 0;
}

.planning-custom-popup dl div {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 8px;
}

.planning-custom-popup dt {
  color: var(--muted);
  font-size: .74rem;
  font-weight: 850;
}

.planning-custom-popup dd {
  margin: 0;
  color: var(--ink);
  font-size: .78rem;
  font-weight: 700;
}

.planning-custom-popup p {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.35;
}

.plan-list-project {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid #94a3b8;
  border-radius: 8px;
  background: #fff;
}

.plan-list-project-main {
  display: block;
  flex: 1;
  color: inherit;
  text-decoration: none;
}

.plan-list-project-main:hover strong {
  text-decoration: underline;
}

.plan-list-project-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.plan-list-project.status-planned {
  border-left-color: #64748b;
  background: #f8fafc;
}

.plan-list-project.status-inprogress {
  border-left-color: #0284c7;
  background: #f0f9ff;
}

.plan-list-project.status-waiting {
  border-left-color: #d97706;
  background: #fffbeb;
}

.plan-list-project.status-completed {
  border-left-color: #16a34a;
  background: #f0fdf4;
}

.plan-list-project.status-cancelled {
  border-left-color: #dc2626;
  background: #fef2f2;
}

.plan-list-project span,
.plan-list-head span,
.plan-list-meta span {
  display: block;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.plan-list-project strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
}

.plan-list-board {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.plan-list-head,
.plan-list-row {
  display: grid;
  grid-template-columns: minmax(240px, .8fr) minmax(440px, 1.2fr);
}

.plan-list-head {
  background: #fbfcfe;
  border-bottom: 1px solid var(--line);
}

.plan-list-head span {
  padding: 11px 14px;
}

.plan-list-head span:first-child {
  border-right: 1px solid var(--line);
}

.plan-list-row {
  min-height: 54px;
}

.plan-list-row.is-hidden {
  display: none;
}

.plan-list-task {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.plan-list-row:nth-child(even) .plan-list-task {
  background: #fff;
}

.plan-list-meta {
  display: grid;
  grid-template-columns: minmax(130px, .85fr) minmax(220px, 1.25fr) minmax(110px, .8fr) minmax(120px, auto);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  border-left: 4px solid #94a3b8;
  background: #f8fafc;
}

.plan-list-meta.status-todo {
  border-left-color: #64748b;
  background: #f8fafc;
}

.plan-list-meta.status-inprogress {
  border-left-color: #0284c7;
  background: #f0f9ff;
}

.plan-list-meta.status-waiting {
  border-left-color: #d97706;
  background: #fffbeb;
}

.plan-list-meta.status-inreview {
  border-left-color: #7c3aed;
  background: #f5f3ff;
}

.plan-list-meta.status-done {
  border-left-color: #16a34a;
  background: #c8f2d8;
}

.plan-list-meta.status-cancelled {
  border-left-color: #dc2626;
  background: #fef2f2;
}

.plan-list-meta strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: .86rem;
}

.plan-list-row.status-done .plan-list-task {
  background: #c8f2d8;
  color: #0f3d24;
}

.plan-list-row.status-done .plan-list-task strong,
.plan-list-row.status-done .plan-list-task a,
.plan-list-row.status-done .plan-list-task em {
  color: #0f3d24;
}

.plan-list-description {
  display: -webkit-box;
  overflow: hidden;
  margin: 3px 0 0;
  color: var(--ink);
  font-size: .83rem;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

@media (max-width: 900px) {
  .plan-list-project,
  .plan-list-head,
  .plan-list-row {
    display: block;
  }

  .plan-list-project {
    align-items: stretch;
  }

  .plan-list-task {
    border-right: 0;
  }

  .plan-list-meta {
    grid-template-columns: 1fr;
    border-left-width: 0;
    border-top: 4px solid #94a3b8;
  }
}

.planning-gantt-popup {
  min-width: 240px;
  max-width: 320px;
}

.planning-gantt-popup strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: .92rem;
  line-height: 1.25;
}

.planning-gantt-popup dl {
  display: grid;
  gap: 6px;
  margin: 0;
}

.planning-gantt-popup dl div {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 8px;
}

.planning-gantt-popup dt {
  color: var(--muted);
  font-size: .74rem;
  font-weight: 850;
}

.planning-gantt-popup dd {
  margin: 0;
  color: var(--ink);
  font-size: .78rem;
  font-weight: 700;
}

.planning-gantt-popup p {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.35;
}

.planning-empty {
  margin: 12px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: .9rem;
}

.error-panel {
  display: grid;
  gap: 18px;
  max-width: 760px;
}

.error-panel h2 {
  margin: 0 0 8px;
  font-weight: 850;
}

.error-panel p {
  margin: 0 0 8px;
  color: var(--muted);
}

.quick-order-context {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) repeat(6, minmax(120px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.inline-quick-panel {
  margin: 16px 0;
  padding: 14px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.inline-quick-panel summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--text);
  list-style: none;
}

.inline-quick-panel summary::-webkit-details-marker {
  display: none;
}

.inline-quick-panel summary::before {
  content: '+';
  display: inline-flex;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #e2e8f0;
  color: var(--accent);
  font-weight: 900;
}

.inline-quick-panel[open] summary::before {
  content: '−';
}

.quick-inline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}

.quick-inline-actions {
  display: flex;
  align-items: end;
}

.quick-order-sheet-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.quick-order-sheet-wrap.quick-order-sheet-wrap-tall {
  min-height: 420px;
}

.quick-order-sheet {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
}

.quick-order-sheet th {
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  color: var(--muted);
  font-size: .74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.quick-order-sheet td {
  padding: 6px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.quick-order-sheet tr:last-child td {
  border-bottom: 0;
}

.quick-order-sheet .row-number {
  width: 38px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.quick-order-sheet input,
.quick-order-sheet select {
  min-width: 96px;
}

.quick-order-sheet .main-cell {
  min-width: 240px;
}

.quick-order-row.is-disabled {
  background: #f8fafc;
}

.quick-order-row.is-disabled .row-number {
  color: #cbd5e1;
}

.empty-note {
  margin: 0;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.dashboard-focus-panel {
  display: block;
  margin-bottom: 18px;
  padding: 28px;
}

.dashboard-focus-panel .panel-heading {
  justify-content: space-between;
  align-items: flex-start;
  flex-direction: row;
}

.dashboard-focus-copy {
  margin: 6px 0 0;
  color: var(--muted);
}

.dashboard-focus-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.dashboard-focus-toolbar {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  flex: 1;
  justify-content: space-between;
}

.metric-grid-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
}

.dashboard-stats-strip {
  display: flex;
  align-items: stretch;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.dashboard-focus-content {
  display: grid;
  gap: 18px;
  width: 100%;
}

.dashboard-task-list-block {
  width: 100%;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.dashboard-task-list-block .section-kicker {
  margin-bottom: 10px;
}

.dashboard-stat-chip {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.dashboard-stat-chip strong,
.dashboard-stat-chip span {
  display: block;
}

.dashboard-stat-chip strong {
  font-size: 2rem;
  line-height: 1;
}

.dashboard-stat-chip span {
  margin-top: 4px;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 700;
}

.dashboard-task-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dashboard-task-meta small {
  color: var(--muted);
  font-weight: 700;
}

.dashboard-review-columns {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dashboard-review-columns-side {
  display: grid;
  grid-template-columns: 170px 110px;
  gap: 8px;
  justify-items: end;
}

.dashboard-review-row .dashboard-task-meta {
  display: grid;
  grid-template-columns: auto 170px 110px;
  gap: 8px;
  align-items: center;
  justify-items: end;
}

@media (max-width: 900px) {
  .dashboard-review-columns {
    display: none;
  }

  .dashboard-review-row .dashboard-task-meta {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
}

.dashboard-task-row {
  align-items: flex-start;
  flex-direction: column;
  width: 100%;
  gap: 10px;
  padding: 16px 18px;
}

.dashboard-task-main {
  width: 100%;
}

.dashboard-task-main strong {
  font-size: 1.08rem;
}

.dashboard-task-main small {
  margin-top: 6px;
  font-size: .95rem;
  line-height: 1.45;
}

.dashboard-task-row .dashboard-task-meta {
  display: flex;
  justify-content: flex-start;
  width: 100%;
}

.dashboard-grid-full {
  grid-template-columns: 1fr 1fr;
}

.dashboard-grid-overview {
  grid-template-columns: minmax(0, 1.75fr) minmax(320px, 1fr);
  align-items: start;
}

.dashboard-grid-single {
  grid-template-columns: 1fr;
}

.dashboard-grid-secondary {
  margin-top: 18px;
}

.dashboard-project-flow {
  margin-top: 18px;
}

.form-control,
.form-select,
.btn {
  border-radius: 8px;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  color: #fff;
}

.text-danger {
  font-size: .86rem;
}

@media (max-width: 1100px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .list-filter-bar,
  .list-filter-bar-wide {
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto auto;
  }

  .quick-order-context {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .planning-shell {
    grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  }

  .backup-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .diagram-hero {
    flex-direction: column;
  }

  .diagram-summary-grid {
    min-width: 0;
  }

  .filter-search {
    grid-column: span 2;
  }

  .metric-grid-compact,
  .dashboard-grid-full {
    grid-template-columns: 1fr;
  }

  .dashboard-grid-overview {
    grid-template-columns: 1fr;
  }

  .dashboard-grid-secondary {
    margin-top: 14px;
  }

  .dashboard-focus-panel .panel-heading,
  .dashboard-focus-toolbar,
  .dashboard-stats-strip {
    flex-direction: column;
  }
}

@media (max-width: 991.98px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    display: none;
  }

  .topbar {
    padding: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .topbar-title {
    flex: 1 1 calc(100% - 60px);
  }

  .user-nav {
    width: 100%;
    justify-content: flex-end;
  }

  .content-wrap {
    padding: 18px;
  }
}

@media (max-width: 720px) {
  .metric-grid,
  .detail-summary-grid,
  .amount-breakdown,
  .form-grid,
  .check-grid,
  .activity-grid,
  .quick-order-context {
    grid-template-columns: 1fr;
  }

  .welcome-panel,
  .project-header,
  .panel-heading,
  .list-row {
    align-items: stretch;
    flex-direction: column;
  }

  .list-with-preview {
    grid-template-columns: 1fr;
  }

  .list-preview-panel {
    position: static;
    order: -1;
  }

  .file-preview-toolbar,
  .image-preview-header,
  .image-preview-header-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .image-preview-dialog {
    width: calc(100vw - 20px);
    margin: 10px auto;
    padding: 14px;
  }

  .image-preview-stage {
    min-height: 260px;
    padding: 16px 42px;
  }

  .bulk-action-bar.smart-bulk-bar {
    top: 8px;
    flex-direction: column;
    align-items: stretch;
  }

  .bulk-bar-actions {
    justify-content: stretch;
  }

  .bulk-bar-actions .btn {
    width: 100%;
  }

  .action-menu-list {
    left: auto;
    right: 0;
  }

  .empty-note-empty-state {
    flex-direction: column;
  }

  .topbar {
    gap: 12px;
    padding: 12px;
  }

  .backup-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .backup-grid {
    grid-template-columns: 1fr;
  }

  .diagram-summary-grid {
    grid-template-columns: 1fr;
  }

  .diagram-filter-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .diagram-filter-bar .form-select {
    max-width: none;
  }

  .planning-context {
    align-items: stretch;
    flex-direction: column;
  }

  .planning-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .topbar h1 {
    font-size: 1rem;
  }

  .topbar-eyebrow {
    display: none;
  }

  .back-button,
  .navbar-toggler {
    width: 38px;
    height: 38px;
  }

  .content-wrap {
    padding: 12px;
  }

  .welcome-actions {
    flex-direction: column;
    white-space: normal;
  }

  .dashboard-focus-actions,
  .dashboard-task-meta {
    align-items: stretch;
    flex-direction: column;
  }

  .list-filter-bar,
  .list-filter-bar-wide {
    grid-template-columns: 1fr 1fr;
    position: static;
  }

  .filter-search {
    grid-column: span 2;
  }

  .table-responsive::after {
    left: auto;
    margin-right: 8px;
    font-size: .68rem;
  }
}

.list-load-more {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.empty-state-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.project-drive-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.project-drive-sidebar {
  position: sticky;
  top: 1rem;
}

.project-drive-main {
  display: grid;
  gap: 1.25rem;
}

.project-drive-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
}

.project-drive-breadcrumbs a,
.project-drive-breadcrumbs span {
  padding: .35rem .7rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, .06);
  text-decoration: none;
  color: inherit;
}

.project-drive-breadcrumbs .is-active {
  background: rgba(37, 99, 235, .12);
  color: #1d4ed8;
  font-weight: 700;
}

.project-drive-tree-shell {
  display: grid;
  gap: .75rem;
}

.project-drive-root-link,
.project-drive-tree-link {
  display: block;
  padding: .45rem .7rem;
  border-radius: .75rem;
  text-decoration: none;
  color: inherit;
}

.project-drive-root-link:hover,
.project-drive-tree-link:hover {
  background: rgba(15, 23, 42, .05);
}

.project-drive-root-link.is-active,
.project-drive-tree-link.is-active,
.project-drive-tree-row.is-active {
  background: rgba(37, 99, 235, .12);
  color: #1d4ed8;
  font-weight: 700;
}

.project-drive-tree {
  list-style: none;
  margin: 0;
  padding-left: 1rem;
  display: grid;
  gap: .3rem;
}

.project-drive-tree > li {
  display: grid;
  gap: .25rem;
}

.project-drive-tree-row {
  display: grid;
  gap: .5rem;
  padding: .45rem;
  border-radius: .9rem;
}

.project-drive-tree-row-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}

.project-drive-tree-actions {
  display: flex;
  gap: .35rem;
  align-items: center;
  flex: 0 0 auto;
}

.project-drive-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: .7rem;
  background: #fff;
  color: var(--muted);
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.project-drive-icon-button:hover,
.project-drive-icon-button[aria-expanded="true"] {
  border-color: rgba(37, 99, 235, .28);
  background: rgba(37, 99, 235, .08);
  color: #1d4ed8;
}

.project-drive-icon-button svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.project-drive-icon-button-danger:hover {
  border-color: rgba(220, 38, 38, .25);
  background: rgba(220, 38, 38, .08);
  color: #b91c1c;
}

.project-drive-rename-panel {
  padding-top: .1rem;
}

.project-drive-rename-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.project-drive-rename-cancel {
  padding-left: 0;
  padding-right: 0;
  text-decoration: none;
}

.project-drive-tree-form {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  align-items: stretch;
}

.project-drive-tree-form .form-control {
  max-width: 100%;
}

.project-drive-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.project-drive-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
}

.project-drive-subtitle {
  font-size: 1rem;
  margin-bottom: .9rem;
}

.project-drive-inline-actions {
  display: inline-flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #202124;
  --panel: #292a2d;
  --ink: #e8eaed;
  --muted: #9aa0a6;
  --line: #3c4043;
  --sidebar: #202124;
  --sidebar-2: #2b2c2f;
  --accent: #8ab4f8;
  --accent-soft: #334155;
  --ok: #81c995;
  --warn: #fbc66d;
  --text: var(--ink);
  --shadow-soft: 0 18px 38px rgba(0, 0, 0, .24);
}

html[data-theme="soft"] {
  color-scheme: light;
  --bg: #eeedfc;
  --panel: #f8f7ff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #dddaf4;
  --sidebar: #101827;
  --sidebar-2: #1c2740;
  --accent: #2563eb;
  --accent-soft: #f3f2ff;
  --ok: #0f766e;
  --warn: #b45309;
  --text: var(--ink);
  --shadow-soft: 0 12px 28px rgba(84, 74, 130, .06);
}

html[data-theme="soft"] body {
  color: var(--ink);
  background: var(--bg);
}

html[data-theme="dark"] body {
  color: var(--ink);
  background: var(--bg);
}

html[data-theme="dark"] .topbar,
html[data-theme="dark"] .mobile-nav,
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .panel-block,
html[data-theme="dark"] .welcome-panel,
html[data-theme="dark"] .project-header,
html[data-theme="dark"] .backup-hero,
html[data-theme="dark"] .backup-card,
html[data-theme="dark"] .table-responsive,
html[data-theme="dark"] .stock-material-card,
html[data-theme="dark"] .stock-group,
html[data-theme="dark"] .stock-group-heading,
html[data-theme="dark"] .project-calendar,
html[data-theme="dark"] .calendar-day,
html[data-theme="dark"] .quick-order-sheet-wrap,
html[data-theme="dark"] .quick-order-sheet th,
html[data-theme="dark"] .quick-order-row.is-disabled,
html[data-theme="dark"] .inline-quick-panel,
html[data-theme="dark"] .list-filter-bar,
html[data-theme="dark"] .list-filter-bar-wide,
html[data-theme="dark"] .bulk-action-bar.smart-bulk-bar,
html[data-theme="dark"] .project-drive-icon-button,
html[data-theme="dark"] .project-drive-root-link.is-active,
html[data-theme="dark"] .project-drive-tree-link.is-active,
html[data-theme="dark"] .project-drive-tree-row.is-active,
html[data-theme="dark"] .project-drive-breadcrumbs a,
html[data-theme="dark"] .project-drive-breadcrumbs span,
html[data-theme="dark"] .plan-list-project,
html[data-theme="dark"] .plan-list-board,
html[data-theme="dark"] .plan-list-head,
html[data-theme="dark"] .plan-list-task,
html[data-theme="dark"] .plan-list-meta,
html[data-theme="dark"] .dashboard-stat-chip,
html[data-theme="dark"] .role-note,
html[data-theme="dark"] .side-group,
html[data-theme="dark"] .side-user,
html[data-theme="dark"] .planning-custom-popup,
html[data-theme="dark"] .planning-shell,
html[data-theme="dark"] .planning-tree,
html[data-theme="dark"] .planning-timeline,
html[data-theme="dark"] .planning-custom-gantt,
html[data-theme="dark"] .planning-custom-board {
  border-color: var(--line);
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

html[data-theme="dark"] .list-row,
html[data-theme="dark"] .app-table td,
html[data-theme="dark"] .stock-material-card,
html[data-theme="dark"] .calendar-day,
html[data-theme="dark"] .quick-order-row.is-disabled,
html[data-theme="dark"] .dashboard-stat-chip,
html[data-theme="dark"] .planning-custom-task,
html[data-theme="dark"] .planning-custom-timeline,
html[data-theme="dark"] .planning-tree-row,
html[data-theme="dark"] .kanban-card,
html[data-theme="dark"] .kanban-column,
html[data-theme="dark"] .gantt-row,
html[data-theme="dark"] .gantt-row-track {
  background: #292a2d;
  color: var(--ink);
}

html[data-theme="dark"] .app-table tbody tr:not(.status-row) > td,
html[data-theme="dark"] .app-table tbody tr:not(.status-row) > th {
  background: #292a2d !important;
  color: var(--ink) !important;
}

html[data-theme="dark"] .app-table tbody tr:not(.status-row):nth-child(odd) > td,
html[data-theme="dark"] .app-table tbody tr:not(.status-row):nth-child(odd) > th,
html[data-theme="dark"] .app-table tbody tr:not(.status-row):nth-child(even) > td,
html[data-theme="dark"] .app-table tbody tr:not(.status-row):nth-child(even) > th {
  background: #292a2d !important;
  color: var(--ink) !important;
}

html[data-theme="dark"] .app-table tbody tr:hover > td,
html[data-theme="dark"] .status-row[data-row-link]:hover > td,
html[data-theme="dark"] .list-row-link:hover,
html[data-theme="dark"] .stock-material-card:hover,
html[data-theme="dark"] .project-drive-icon-button:hover,
html[data-theme="dark"] .back-button:hover,
html[data-theme="dark"] .mobile-nav a:hover,
html[data-theme="dark"] .mobile-nav .side-subnav a:hover,
html[data-theme="dark"] .planning-tree-row:hover,
html[data-theme="dark"] .gantt-row:hover,
html[data-theme="dark"] .kanban-card:hover {
  border-color: rgba(138, 180, 248, .34);
  background: #303134;
  color: var(--ink);
}

html[data-theme="dark"] .planning-custom-row .planning-custom-task,
html[data-theme="dark"] .planning-custom-row .planning-custom-timeline,
html[data-theme="dark"] .plan-list-row .plan-list-task,
html[data-theme="dark"] .plan-list-row .plan-list-meta {
  background: #292a2d;
  color: var(--ink);
}

html[data-theme="dark"] .planning-custom-row:nth-child(even) .planning-custom-task,
html[data-theme="dark"] .planning-custom-row:nth-child(even) .planning-custom-timeline,
html[data-theme="dark"] .plan-list-row:nth-child(even) .plan-list-task,
html[data-theme="dark"] .plan-list-row:nth-child(even) .plan-list-meta {
  background: #292a2d;
  color: var(--ink);
}

html[data-theme="dark"] .planning-custom-row:hover .planning-custom-task,
html[data-theme="dark"] .planning-custom-row:hover .planning-custom-timeline,
html[data-theme="dark"] .plan-list-row:hover .plan-list-task,
html[data-theme="dark"] .plan-list-row:hover .plan-list-meta {
  background: #34363a;
  color: var(--ink);
}

html[data-theme="dark"] .planning-gantt-legend-strip,
html[data-theme="dark"] .planning-gantt-modes,
html[data-theme="dark"] .planning-gantt-modes button,
html[data-theme="dark"] .planning-task-modal .modal-content,
html[data-theme="dark"] .planning-task-modal .modal-header,
html[data-theme="dark"] .planning-task-modal .modal-body,
html[data-theme="dark"] .planning-task-modal .modal-footer {
  border-color: var(--line) !important;
  background: #292a2d !important;
  color: var(--ink) !important;
}

html[data-theme="dark"] .planning-gantt-modes button:hover,
html[data-theme="dark"] .planning-gantt-modes button.active {
  background: #303134 !important;
  color: #d2e3fc !important;
}

html[data-theme="dark"] .planning-task-modal .modal-header .text-muted,
html[data-theme="dark"] .planning-task-modal .modal-body .form-label,
html[data-theme="dark"] .planning-task-modal .modal-body .text-muted,
html[data-theme="dark"] .planning-gantt-legend span {
  color: var(--muted) !important;
}

html[data-theme="dark"] .planning-task-modal .btn-close {
  filter: invert(1) grayscale(100%);
}

html[data-theme="dark"] .plan-list-row.status-done .plan-list-task,
html[data-theme="dark"] .plan-list-row.status-done .plan-list-task strong,
html[data-theme="dark"] .plan-list-row.status-done .plan-list-task a,
html[data-theme="dark"] .plan-list-row.status-done .plan-list-task em,
html[data-theme="dark"] .plan-list-row.status-done .plan-list-description {
  color: #8ab4f8 !important;
}

html[data-theme="dark"] .app-table thead th,
html[data-theme="dark"] .calendar-weekday,
html[data-theme="dark"] .stock-group-heading,
html[data-theme="dark"] .quick-order-sheet th,
html[data-theme="dark"] .plan-list-head,
html[data-theme="dark"] .backup-hero p,
html[data-theme="dark"] .backup-card p,
html[data-theme="dark"] .calendar-day.is-muted,
html[data-theme="dark"] .inline-quick-panel summary::before,
html[data-theme="dark"] .planning-tree header,
html[data-theme="dark"] .planning-timeline header,
html[data-theme="dark"] .planning-custom-toolbar,
html[data-theme="dark"] .planning-custom-task-head,
html[data-theme="dark"] .planning-custom-date-head,
html[data-theme="dark"] .gantt-header,
html[data-theme="dark"] .kanban-column header,
html[data-theme="dark"] .planning-context {
  background: #303134;
  color: var(--muted);
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .back-button,
html[data-theme="dark"] .navbar-toggler,
html[data-theme="dark"] .project-drive-icon-button,
html[data-theme="dark"] .status-select,
html[data-theme="dark"] .planning-add-child,
html[data-theme="dark"] .kanban-column header strong {
  border-color: var(--line);
  background: #202124;
  color: var(--ink);
}

html[data-theme="dark"] .btn-primary {
  background: #8ab4f8;
  border-color: #8ab4f8;
  color: #202124;
}

html[data-theme="dark"] .btn-primary:hover,
html[data-theme="dark"] .btn-primary:focus,
html[data-theme="dark"] .btn-primary:active {
  background: #9ec1fb;
  border-color: #9ec1fb;
  color: #202124;
}

html[data-theme="dark"] .form-control::placeholder,
html[data-theme="dark"] .side-nav-filter::placeholder {
  color: var(--muted);
}

html[data-theme="dark"] .list-row-link,
html[data-theme="dark"] .stock-material-card,
html[data-theme="dark"] .calendar-event,
html[data-theme="dark"] .project-drive-root-link,
html[data-theme="dark"] .project-drive-tree-link,
html[data-theme="dark"] .project-drive-tree-row,
html[data-theme="dark"] .plan-list-project-main,
html[data-theme="dark"] .nav-link {
  color: inherit;
}

html[data-theme="dark"] a {
  color: #8ab4f8;
}

html[data-theme="dark"] .mobile-nav .side-group,
html[data-theme="dark"] .mobile-nav .side-nav-filter,
html[data-theme="dark"] .mobile-nav .side-user,
html[data-theme="dark"] .mobile-nav .side-subnav a.active {
  background: #292a2d;
  color: var(--ink);
}

html[data-theme="dark"] .action-menu summary,
html[data-theme="dark"] .action-menu-list,
html[data-theme="dark"] .action-menu-list a,
html[data-theme="dark"] .action-menu-list button,
html[data-theme="dark"] [data-preview-trigger],
html[data-theme="dark"] .preview-trigger,
html[data-theme="dark"] .compact-preview-popover,
html[data-theme="dark"] .compact-preview-popover *,
html[data-theme="dark"] .searchable-select-list,
html[data-theme="dark"] .searchable-select-empty,
html[data-theme="dark"] .permission-group,
html[data-theme="dark"] .permission-toggle,
html[data-theme="dark"] .permission-toggle .permission-group,
html[data-theme="dark"] .diagram-hero,
html[data-theme="dark"] .diagram-summary-grid > div,
html[data-theme="dark"] .diagram-filter-bar .form-select,
html[data-theme="dark"] .google-gantt-shell,
html[data-theme="dark"] .google-visualization-tooltip,
html[data-theme="dark"] .google-visualization-tooltip *,
html[data-theme="dark"] .list-preview-panel,
html[data-theme="dark"] .planning-gantt-shell .popup-wrapper,
html[data-theme="dark"] .planning-gantt-popup,
html[data-theme="dark"] .planning-gantt-popup *,
html[data-theme="dark"] .planning-custom-popup,
html[data-theme="dark"] .planning-custom-popup *,
html[data-theme="dark"] .check-card,
html[data-theme="dark"] .collapsible-section {
  border-color: var(--line);
  color: var(--ink);
}

html[data-theme="dark"] .action-menu summary,
html[data-theme="dark"] .action-menu-list,
html[data-theme="dark"] .compact-preview-popover,
html[data-theme="dark"] .searchable-select-list,
html[data-theme="dark"] .searchable-select-empty,
html[data-theme="dark"] .permission-group,
html[data-theme="dark"] .permission-toggle,
html[data-theme="dark"] .diagram-hero,
html[data-theme="dark"] .diagram-summary-grid > div,
html[data-theme="dark"] .google-gantt-shell,
html[data-theme="dark"] .list-preview-panel,
html[data-theme="dark"] .planning-gantt-shell .popup-wrapper,
html[data-theme="dark"] .planning-gantt-popup,
html[data-theme="dark"] .check-card,
html[data-theme="dark"] .collapsible-section {
  background: #292a2d;
}

html[data-theme="dark"] .action-menu summary svg,
html[data-theme="dark"] .action-menu summary i,
html[data-theme="dark"] .action-menu summary::before,
html[data-theme="dark"] .action-menu summary::after,
html[data-theme="dark"] [data-preview-trigger] svg,
html[data-theme="dark"] [data-preview-trigger] i,
html[data-theme="dark"] .preview-trigger,
html[data-theme="dark"] .project-drive-icon-button svg {
  fill: currentColor;
  color: var(--ink);
}

html[data-theme="dark"] .action-menu[open] summary,
html[data-theme="dark"] .action-menu summary:hover,
html[data-theme="dark"] .action-menu-list a:hover,
html[data-theme="dark"] .action-menu-list button:hover,
html[data-theme="dark"] .searchable-select-option:hover,
html[data-theme="dark"] .searchable-select-option[aria-selected="true"],
html[data-theme="dark"] .permission-toggle summary:hover {
  background: #303134;
  color: #d2e3fc;
}

html[data-theme="dark"] .action-menu-list .text-danger:hover {
  background: #3a2628;
  color: #f2d6d8;
}

html[data-theme="dark"] .action-menu-list a,
html[data-theme="dark"] .action-menu-list button,
html[data-theme="dark"] .searchable-select-option,
html[data-theme="dark"] .compact-preview-popover h3,
html[data-theme="dark"] .compact-preview-popover strong,
html[data-theme="dark"] .permission-group h3,
html[data-theme="dark"] .permission-toggle summary,
html[data-theme="dark"] .diagram-hero h2,
html[data-theme="dark"] .diagram-summary-grid strong,
html[data-theme="dark"] .list-preview-panel h3,
html[data-theme="dark"] .planning-gantt-popup strong,
html[data-theme="dark"] .planning-custom-popup strong,
html[data-theme="dark"] .check-card span,
html[data-theme="dark"] .collapsible-section summary,
html[data-theme="dark"] .google-visualization-tooltip {
  color: var(--ink);
}

html[data-theme="dark"] .diagram-hero p:not(.section-kicker),
html[data-theme="dark"] .diagram-summary-grid span,
html[data-theme="dark"] .searchable-select-empty,
html[data-theme="dark"] .compact-preview-popover p,
html[data-theme="dark"] .planning-gantt-popup p,
html[data-theme="dark"] .planning-gantt-popup dt,
html[data-theme="dark"] .planning-gantt-popup dd,
html[data-theme="dark"] .planning-custom-popup p,
html[data-theme="dark"] .planning-custom-popup dt,
html[data-theme="dark"] .planning-custom-popup dd,
html[data-theme="dark"] .list-preview-panel p,
html[data-theme="dark"] .list-preview-status,
html[data-theme="dark"] .google-visualization-tooltip * {
  color: var(--muted);
}

html[data-theme="dark"] .diagram-filter-bar .form-select,
html[data-theme="dark"] .searchable-select-input,
html[data-theme="dark"] .searchable-select-option,
html[data-theme="dark"] .searchable-select-empty,
html[data-theme="dark"] .icon-filter-button,
html[data-theme="dark"] .preview-trigger,
html[data-theme="dark"] .planning-user-checks {
  background: #202124;
  color: var(--ink);
}

html[data-theme="dark"] .searchable-select-option:disabled {
  color: #6f7680;
}

html[data-theme="dark"] .permission-toggle .permission-group,
html[data-theme="dark"] .diagram-summary-grid > div,
html[data-theme="dark"] .list-preview-status,
html[data-theme="dark"] .planning-user-checks {
  background: #303134;
}

html[data-theme="dark"] .diagram-hero {
  background: linear-gradient(135deg, #292a2d 0%, #303134 100%);
}

html[data-theme="dark"] .list-preview-panel {
  background: linear-gradient(180deg, #292a2d 0%, #303134 100%);
}

html[data-theme="dark"] .google-visualization-tooltip,
html[data-theme="dark"] .planning-gantt-shell .popup-wrapper,
html[data-theme="dark"] .planning-gantt-popup,
html[data-theme="dark"] .planning-custom-popup,
html[data-theme="dark"] .compact-preview-popover {
  background: #303134 !important;
}

html[data-theme="dark"] .preview-trigger,
html[data-theme="dark"] button.preview-trigger,
html[data-theme="dark"] .icon-filter-button,
html[data-theme="dark"] button.icon-filter-button,
html[data-theme="dark"] a.icon-filter-button,
html[data-theme="dark"] .planning-user-checks,
html[data-theme="dark"] .planning-task-modal .planning-user-checks,
html[data-theme="dark"] .compact-preview-popover,
html[data-theme="dark"] .compact-preview-popover * {
  border-color: var(--line) !important;
  background: #303134 !important;
  color: var(--ink) !important;
}

html[data-theme="dark"] .compact-preview-popover p,
html[data-theme="dark"] .compact-preview-popover span,
html[data-theme="dark"] .compact-preview-popover small {
  color: var(--muted) !important;
}

html[data-theme="dark"] .compact-preview-popover h3,
html[data-theme="dark"] .compact-preview-popover strong,
html[data-theme="dark"] .compact-preview-popover [data-preview-title] {
  color: var(--ink) !important;
}

html[data-theme="dark"] .list-preview-status {
  background: rgba(138, 180, 248, .16) !important;
  color: #d2e3fc !important;
}

html[data-theme="dark"] .icon-filter-button {
  border-color: var(--line);
}

html[data-theme="dark"] .icon-filter-button:hover,
html[data-theme="dark"] .preview-trigger:hover,
html[data-theme="dark"] .preview-trigger.is-active {
  border-color: rgba(138, 180, 248, .34);
  background: #3c4043;
  color: #d2e3fc;
}

html[data-theme="dark"] .icon-filter-button.clear {
  color: #f28b82;
}

html[data-theme="dark"] .icon-filter-button.clear:hover {
  background: #3a2628;
  color: #f2d6d8;
}

html[data-theme="dark"] .status-pill,
html[data-theme="dark"] .task-tree-badge,
html[data-theme="dark"] .project-drive-root-link.is-active,
html[data-theme="dark"] .project-drive-tree-link.is-active,
html[data-theme="dark"] .project-drive-tree-row.is-active {
  background: rgba(138, 180, 248, .16);
  color: #d2e3fc;
}

html[data-theme="dark"] .status-row.status-completed > td,
html[data-theme="dark"] .status-row.status-done > td,
html[data-theme="dark"] .status-row.status-delivered > td,
html[data-theme="dark"] .status-row.status-fulfilled > td,
html[data-theme="dark"] .status-row.status-completed > th,
html[data-theme="dark"] .status-row.status-done > th,
html[data-theme="dark"] .status-row.status-delivered > th,
html[data-theme="dark"] .status-row.status-fulfilled > th {
  background: #23372b;
  color: #d7f3df;
}

html[data-theme="dark"] .status-row.status-completed,
html[data-theme="dark"] .status-row.status-done,
html[data-theme="dark"] .status-row.status-delivered,
html[data-theme="dark"] .status-row.status-fulfilled,
html[data-theme="dark"] .status-row.status-completed > td,
html[data-theme="dark"] .status-row.status-done > td,
html[data-theme="dark"] .status-row.status-delivered > td,
html[data-theme="dark"] .status-row.status-fulfilled > td,
html[data-theme="dark"] .status-row.status-completed > th,
html[data-theme="dark"] .status-row.status-done > th,
html[data-theme="dark"] .status-row.status-delivered > th,
html[data-theme="dark"] .status-row.status-fulfilled > th {
  background: #23372b !important;
  color: #d7f3df !important;
}

html[data-theme="dark"] .status-row.status-blocked > td,
html[data-theme="dark"] .status-row.status-blocked > th,
html[data-theme="dark"] .status-row.status-inprogress > td,
html[data-theme="dark"] .status-row.status-requested > td,
html[data-theme="dark"] .status-row.status-approved > td,
html[data-theme="dark"] .status-row.status-ordered > td,
html[data-theme="dark"] .status-row.status-inreview > td,
html[data-theme="dark"] .status-row.status-instock > td,
html[data-theme="dark"] .status-row.status-reserved > td,
html[data-theme="dark"] .status-row.status-lowstock > td,
html[data-theme="dark"] .status-row.status-outofstock > td,
html[data-theme="dark"] .status-row.status-scrapped > td,
html[data-theme="dark"] .status-row.status-inprogress > th,
html[data-theme="dark"] .status-row.status-requested > th,
html[data-theme="dark"] .status-row.status-approved > th,
html[data-theme="dark"] .status-row.status-ordered > th,
html[data-theme="dark"] .status-row.status-inreview > th,
html[data-theme="dark"] .status-row.status-instock > th,
html[data-theme="dark"] .status-row.status-reserved > th,
html[data-theme="dark"] .status-row.status-lowstock > th,
html[data-theme="dark"] .status-row.status-outofstock > th,
html[data-theme="dark"] .status-row.status-scrapped > th,
html[data-theme="dark"] .status-row.status-planned > td,
html[data-theme="dark"] .status-row.status-draft > td,
html[data-theme="dark"] .status-row.status-todo > td,
html[data-theme="dark"] .status-row.status-planned > th,
html[data-theme="dark"] .status-row.status-draft > th,
html[data-theme="dark"] .status-row.status-todo > th,
html[data-theme="dark"] .status-row.status-waiting > td,
html[data-theme="dark"] .status-row.status-partiallydelivered > td,
html[data-theme="dark"] .status-row.status-waiting > th,
html[data-theme="dark"] .status-row.status-partiallydelivered > th {
  background: #292a2d !important;
  color: var(--ink) !important;
}

html[data-theme="dark"] .app-table .text-muted,
html[data-theme="dark"] .app-table small,
html[data-theme="dark"] .app-table .small,
html[data-theme="dark"] .app-table .table-note-clamp,
html[data-theme="dark"] .app-table td small.d-block,
html[data-theme="dark"] .app-table td .d-block.text-muted {
  color: #b8c0c8 !important;
}

html[data-theme="dark"] .status-row.status-completed > td .text-muted,
html[data-theme="dark"] .status-row.status-done > td .text-muted,
html[data-theme="dark"] .status-row.status-delivered > td .text-muted,
html[data-theme="dark"] .status-row.status-fulfilled > td .text-muted,
html[data-theme="dark"] .status-row.status-completed > th .text-muted,
html[data-theme="dark"] .status-row.status-done > th .text-muted,
html[data-theme="dark"] .status-row.status-delivered > th .text-muted,
html[data-theme="dark"] .status-row.status-fulfilled > th .text-muted,
html[data-theme="dark"] .status-row.status-completed > td small,
html[data-theme="dark"] .status-row.status-done > td small,
html[data-theme="dark"] .status-row.status-delivered > td small,
html[data-theme="dark"] .status-row.status-fulfilled > td small,
html[data-theme="dark"] .status-row.status-completed > th small,
html[data-theme="dark"] .status-row.status-done > th small,
html[data-theme="dark"] .status-row.status-delivered > th small,
html[data-theme="dark"] .status-row.status-fulfilled > th small,
html[data-theme="dark"] .status-row.status-completed > td .small,
html[data-theme="dark"] .status-row.status-done > td .small,
html[data-theme="dark"] .status-row.status-delivered > td .small,
html[data-theme="dark"] .status-row.status-fulfilled > td .small,
html[data-theme="dark"] .status-row.status-completed > th .small,
html[data-theme="dark"] .status-row.status-done > th .small,
html[data-theme="dark"] .status-row.status-delivered > th .small,
html[data-theme="dark"] .status-row.status-fulfilled > th .small,
html[data-theme="dark"] .status-row.status-completed > td .table-note-clamp,
html[data-theme="dark"] .status-row.status-done > td .table-note-clamp,
html[data-theme="dark"] .status-row.status-delivered > td .table-note-clamp,
html[data-theme="dark"] .status-row.status-fulfilled > td .table-note-clamp,
html[data-theme="dark"] .status-row.status-completed > th .table-note-clamp,
html[data-theme="dark"] .status-row.status-done > th .table-note-clamp,
html[data-theme="dark"] .status-row.status-delivered > th .table-note-clamp,
html[data-theme="dark"] .status-row.status-fulfilled > th .table-note-clamp {
  color: inherit !important;
}

html[data-theme="dark"] .breadcrumb-nav span,
html[data-theme="dark"] .topbar h1,
html[data-theme="dark"] .panel-heading h2,
html[data-theme="dark"] .welcome-panel h2,
html[data-theme="dark"] .project-header h2,
html[data-theme="dark"] .backup-hero h3,
html[data-theme="dark"] .backup-card h3,
html[data-theme="dark"] .project-drive-subtitle,
html[data-theme="dark"] .planning-custom-popup strong,
html[data-theme="dark"] .plan-list-project strong,
html[data-theme="dark"] .plan-list-meta strong,
html[data-theme="dark"] .dashboard-stat-chip strong,
html[data-theme="dark"] .kanban-card strong,
html[data-theme="dark"] .planning-tree header strong,
html[data-theme="dark"] .planning-timeline header strong {
  color: var(--ink);
}

html[data-theme="dark"] .topbar-eyebrow,
html[data-theme="dark"] .section-kicker,
html[data-theme="dark"] .list-row small,
html[data-theme="dark"] .metric-card span,
html[data-theme="dark"] .metric-card small,
html[data-theme="dark"] .stock-material-card small,
html[data-theme="dark"] .stock-card-meta span,
html[data-theme="dark"] .stock-group-heading span,
html[data-theme="dark"] .calendar-event span,
html[data-theme="dark"] .calendar-more,
html[data-theme="dark"] .breadcrumb-nav,
html[data-theme="dark"] .breadcrumb-nav a,
html[data-theme="dark"] .empty-note,
html[data-theme="dark"] .dashboard-focus-copy,
html[data-theme="dark"] .dashboard-task-meta small,
html[data-theme="dark"] .dashboard-stat-chip span,
html[data-theme="dark"] .planning-custom-popup p,
html[data-theme="dark"] .planning-custom-popup dt,
html[data-theme="dark"] .planning-custom-popup dd,
html[data-theme="dark"] .kanban-card-meta,
html[data-theme="dark"] .kanban-card-people,
html[data-theme="dark"] .kanban-card-bottom {
  color: var(--muted);
}


.theme-quick-form {
  margin: 0;
}

.theme-select {
  min-width: 142px;
  border-color: var(--line);
  background: var(--panel);
  color: var(--ink);
}

.theme-settings-form {
  display: grid;
  gap: 14px;
}

.theme-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.theme-option-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.theme-option-card:hover {
  border-color: rgba(37, 99, 235, .35);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.theme-option-card.is-selected {
  border-color: rgba(37, 99, 235, .45);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.theme-option-card input[type="radio"] {
  margin: 0;
}

.theme-option-card strong {
  color: var(--ink);
}

.theme-option-card small {
  color: var(--muted);
  line-height: 1.45;
}

.theme-option-preview {
  display: block;
  height: 74px;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 10px;
}

.theme-preview-current {
  background: linear-gradient(135deg, #101827 0 28%, #f5f7fb 28% 100%);
}

.theme-preview-soft {
  background: linear-gradient(135deg, #dcd9f7 0 28%, #eeedfc 28% 100%);
}

.theme-preview-dark {
  background: linear-gradient(135deg, #111722 0 28%, #1d2531 28% 100%);
}

@media (max-width: 991.98px) {
  .project-drive-layout,
  .project-drive-actions-grid {
    grid-template-columns: 1fr;
  }

  .project-drive-sidebar {
    position: static;
  }

  .project-drive-tree-row-main {
    align-items: flex-start;
    flex-direction: column;
  }
}
