:root {
  --blue: #0000d2;
  --blue-2: #2934a3;
  --blue-soft: #eceeff;
  --ink: #050505;
  --ink-2: #17171c;
  --muted: #60616a;
  --line: #d9d9df;
  --line-strong: #b8bac7;
  --soft: #f6f7fb;
  --soft-2: #eef0f8;
  --paper: #ffffff;
  --success: #0b6f4a;
  --warning: #865300;
  --danger: #c2413c;
  --radius: 8px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "DM Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(135deg, rgba(0, 0, 210, 0.06) 0 1px, transparent 1px 28px),
    linear-gradient(180deg, #ffffff 0%, #f8f9ff 100%);
  color: var(--ink);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  background: transparent;
  position: relative;
}

.auth-pending .app-shell,
.auth-locked .app-shell {
  display: none;
}

.auth-ready .auth-gate {
  display: none;
}

.auth-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    url("assets/pattern.png") left top / 760px auto repeat,
    linear-gradient(180deg, #ffffff 0%, #f5f6ff 100%);
}

.auth-card {
  width: min(460px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  padding: 28px;
  display: grid;
  gap: 18px;
  position: relative;
  overflow: hidden;
}

.auth-card::after {
  content: "";
  position: absolute;
  right: -38px;
  top: -38px;
  width: 120px;
  height: 120px;
  border: 1px solid rgba(0, 0, 210, 0.18);
  border-radius: 50%;
}

.auth-card > * {
  position: relative;
}

.auth-card img {
  width: 180px;
  max-width: 60%;
  justify-self: center;
}

.auth-card h1 {
  font-size: 34px;
  line-height: 1;
}

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

.mfa-qr {
  width: 190px;
  height: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.auth-message {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: url("assets/pattern.png");
  background-size: 960px auto;
  background-position: right top;
  background-repeat: no-repeat;
  opacity: 0.13;
  mix-blend-mode: multiply;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  padding: 20px 14px;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  background:
    linear-gradient(180deg, rgba(0, 0, 210, 0.08), transparent 34%),
    rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}

.sidebar::before {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -92px;
  top: 92px;
  border: 1px solid rgba(0, 0, 210, 0.18);
  border-radius: 50%;
  transform: rotate(-24deg);
  pointer-events: none;
}

.sidebar > * {
  position: relative;
}

.brand {
  display: block;
  padding: 8px 10px 16px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}

.brand img {
  width: 184px;
  max-width: 100%;
  display: block;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 210, 0.14));
}

.nav-list {
  display: grid;
  gap: 5px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 4px 8px 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 210, 0.38) transparent;
}

.nav-list::-webkit-scrollbar {
  width: 8px;
}

.nav-list::-webkit-scrollbar-track {
  background: transparent;
}

.nav-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 210, 0.22);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.nav-list::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 210, 0.42);
  border: 2px solid transparent;
  background-clip: content-box;
}

.nav-item {
  border: 0;
  background: transparent;
  color: #555762;
  text-align: left;
  padding: 8px 9px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 9px;
  position: relative;
  min-height: 48px;
  isolation: isolate;
}

.nav-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  padding: 7px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--blue);
  fill: currentColor;
  transition: transform 140ms ease, border 140ms ease, background 140ms ease;
}

.nav-item:hover,
.nav-item.active {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 14px 34px rgba(0, 0, 210, 0.2);
}

.nav-item.dragging {
  opacity: 0.46;
  transform: scale(0.98);
}

.nav-item.active::after {
  content: "";
  position: absolute;
  right: 8px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.16);
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
  background: #fff;
  border-color: #fff;
  color: var(--blue);
  transform: scale(1.04);
}

.sidebar-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--success);
}

.workspace {
  min-width: 0;
  padding: 28px clamp(18px, 3vw, 44px) 46px;
}

.topbar {
  position: sticky;
  top: 16px;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  padding: 18px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.06);
}

.section-label {
  margin: 0 0 5px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1;
  font-weight: 800;
}

.view-subtitle {
  max-width: 720px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 650;
}

h2 {
  font-size: 20px;
  line-height: 1.2;
  margin-bottom: 14px;
}

h3 {
  font-size: 15px;
  line-height: 1.2;
  margin-bottom: 8px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 360px;
}

.search {
  min-width: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 11px 8px 13px;
  display: grid;
  gap: 2px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.search span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.search input {
  border: 0;
  outline: 0;
  min-width: 0;
}

.icon-button,
.primary-button,
.secondary-button,
.ghost-button {
  border-radius: 6px;
  min-height: 44px;
  border: 1px solid var(--line);
  font-weight: 800;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.icon-button:focus-visible,
.primary-button:focus-visible,
.secondary-button:focus-visible,
.ghost-button:focus-visible,
.nav-item:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(0, 0, 210, 0.22);
  outline-offset: 2px;
}

.icon-button {
  width: 42px;
  background: var(--ink);
  color: var(--blue);
  font-size: 20px;
  color: #fff;
}

.primary-button {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
  padding: 0 14px;
  box-shadow: 0 12px 28px rgba(0, 0, 210, 0.18);
}

.secondary-button,
.ghost-button {
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
}

.ghost-button {
  color: var(--blue);
  border-color: rgba(0, 0, 210, 0.12);
  background: rgba(0, 0, 210, 0.035);
}

.icon-button:hover,
.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.user-chip {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--ink), var(--blue-2));
  font-weight: 900;
  font-size: 13px;
  box-shadow: 0 14px 30px rgba(0, 0, 210, 0.18);
}

.view {
  display: grid;
  gap: 20px;
  opacity: 1;
  transform: translateY(0);
}

.view.view-enter {
  animation: viewIn 220ms ease both;
}

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

.ops-item {
  display: grid;
  gap: 10px;
  align-content: center;
  min-height: 86px;
  padding: 15px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background:
    url("assets/stella-blu.png") right 12px top 12px / 22px 22px no-repeat,
    linear-gradient(180deg, #fff, #f8f9ff);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.045);
}

.ops-item strong {
  font-size: 14px;
  line-height: 1.25;
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.command-center {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  background:
    url("assets/freccia-dx.png") right 30px center / 160px auto no-repeat,
    linear-gradient(120deg, rgba(0, 0, 210, 0.12), rgba(255, 255, 255, 0.96) 42%),
    #fff;
  padding-right: min(190px, 18vw);
}

.command-center h2 {
  font-size: clamp(24px, 3vw, 34px);
  margin-bottom: 8px;
}

.command-center p:last-child {
  margin-bottom: 0;
}

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

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

.insight-card {
  min-height: 132px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 17px;
  background:
    url("assets/stella-blu.png") right 14px top 14px / 28px 28px no-repeat,
    radial-gradient(circle at 100% 0%, rgba(0, 0, 210, 0.1), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 248, 255, 0.92));
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.055);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  align-items: end;
  gap: 12px;
  overflow: hidden;
}

.insight-card span {
  display: block;
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.insight-card strong {
  display: block;
  font-size: 28px;
  line-height: 1;
  margin-bottom: 8px;
}

.insight-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.sparkline {
  width: 112px;
  height: 54px;
  align-self: center;
}

.sparkline polyline {
  fill: none;
  stroke: var(--blue);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.grid {
  display: grid;
  gap: 16px;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
}

.kpi-grid {
  grid-template-columns: repeat(5, minmax(140px, 1fr));
}

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

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

.panel,
.kpi,
.record-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.055);
  backdrop-filter: blur(10px);
}

.panel {
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), transparent);
  opacity: 0.55;
}

.panel::after {
  content: "";
  position: absolute;
  right: 16px;
  bottom: 14px;
  width: 18px;
  height: 18px;
  background: url("assets/stella-blu.png") center / contain no-repeat;
  opacity: 0.16;
  pointer-events: none;
}

.panel-header,
.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-header h2,
.table-header h2 {
  margin-bottom: 0;
}

.panel-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.kpi {
  padding: 17px;
  min-height: 118px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: transform 140ms ease, border 140ms ease, box-shadow 140ms ease;
}

.kpi::after {
  content: "";
  position: absolute;
  right: -26px;
  top: -26px;
  width: 76px;
  height: 76px;
  border: 1px solid rgba(0, 0, 210, 0.18);
  border-radius: 50%;
}

.kpi:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 0, 210, 0.22);
  box-shadow: 0 22px 60px rgba(0, 0, 210, 0.08);
}

.kpi span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.kpi strong {
  font-size: 32px;
  line-height: 1;
}

.kpi em {
  color: var(--blue);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.workflow {
  display: grid;
  grid-template-columns: repeat(7, minmax(92px, 1fr));
  gap: 8px;
  counter-reset: flow;
}

.workflow-step {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 13px 10px;
  background: linear-gradient(180deg, #fff, var(--soft));
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  position: relative;
}

.workflow-step::before {
  counter-increment: flow;
  content: "0" counter(flow);
  display: block;
  color: currentColor;
  opacity: 0.62;
  font-size: 10px;
  margin-bottom: 4px;
}

.workflow-step.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.calendar-layout {
  grid-template-columns: minmax(0, 1.8fr) minmax(320px, 0.8fr);
}

.calendar-panel {
  overflow: hidden;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(98px, 1fr));
}

.calendar-weekdays {
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: #f3f4fb;
  overflow: hidden;
}

.calendar-weekdays span {
  padding: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  text-align: center;
}

.calendar-grid {
  border: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
  background: #fff;
}

.calendar-day {
  min-height: 116px;
  padding: 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #fbfbff);
}

.calendar-day:nth-child(7n) {
  border-right: 0;
}

.calendar-day:nth-last-child(-n + 7) {
  border-bottom: 0;
}

.calendar-day header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 24px;
  margin-bottom: 8px;
  font-weight: 900;
}

.calendar-day header b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(0, 0, 210, 0.1);
  color: var(--blue);
  font-size: 11px;
}

.calendar-day.is-muted {
  background: #f8f8fb;
  color: var(--muted);
}

.calendar-day.is-today {
  box-shadow: inset 0 0 0 2px var(--blue);
}

.calendar-day-events {
  display: grid;
  gap: 5px;
}

.calendar-event {
  width: 100%;
  border: 0;
  border-radius: 6px;
  padding: 6px 7px;
  text-align: left;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-event.video {
  background: var(--blue);
}

.calendar-event.live {
  background: #f0752d;
}

.calendar-more {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.calendar-form {
  display: grid;
  gap: 12px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 #fff;
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  background: #fff;
}

.schedule-panel table {
  min-width: 1720px;
}

.schedule-panel td,
.schedule-panel th {
  white-space: nowrap;
}

thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

th,
td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

td:first-child,
th:first-child {
  padding-left: 16px;
}

td:last-child,
th:last-child {
  padding-right: 16px;
}

th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0;
  background: #f3f4fb;
}

tbody tr {
  transition: background 120ms ease;
}

tbody tr:hover {
  background: #fafaff;
}

tr:last-child td {
  border-bottom: 0;
}

.strong {
  font-weight: 900;
}

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

.soft-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 8px 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 900;
  background: var(--soft-2);
  color: var(--muted);
  white-space: nowrap;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.badge.blue {
  background: rgba(0, 0, 210, 0.1);
  color: var(--blue);
}

.badge.green {
  background: rgba(15, 143, 95, 0.12);
  color: var(--success);
}

.badge.orange {
  background: rgba(183, 121, 31, 0.14);
  color: var(--warning);
}

.badge.red {
  background: rgba(194, 65, 60, 0.12);
  color: var(--danger);
}

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

.mini-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: linear-gradient(180deg, #fff, #fbfbff);
  transition: border 120ms ease, transform 120ms ease;
}

.mini-item:hover {
  border-color: rgba(0, 0, 210, 0.22);
  transform: translateY(-1px);
}

.mini-item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.uploadable-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 12px;
}

.uploadable-item p {
  grid-column: 1;
}

.uploadable-item .ghost-button {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.bar-list {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  gap: 6px;
}

.bar-row header {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.bar {
  height: 9px;
  border-radius: 99px;
  background: var(--soft-2);
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  width: var(--value);
  background: var(--blue);
  border-radius: inherit;
}

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

.timeline-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(180deg, #fff, #fafaff);
  position: relative;
  overflow: hidden;
}

.timeline-item::before {
  content: "";
  position: absolute;
  right: 70px;
  bottom: -8px;
  width: 42px;
  height: 42px;
  background: url("assets/uparrow.png") center / contain no-repeat;
  opacity: 0.08;
  pointer-events: none;
}

.timeline-item time {
  color: var(--blue);
  font-weight: 950;
  font-size: 13px;
}

.deadline-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.deadline-panel .panel-header {
  align-items: flex-start;
}

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

.deadline-card {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(180deg, #fff, #fbfbff);
}

.deadline-card time {
  color: var(--blue);
  font-size: 13px;
  font-weight: 950;
}

.deadline-card strong {
  display: block;
  margin-bottom: 3px;
}

.deadline-card span:not(.badge) {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.finance-hero {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.4fr);
  gap: 24px;
  align-items: end;
}

.finance-bars {
  min-height: 250px;
  display: grid;
  grid-template-columns: repeat(6, minmax(34px, 1fr));
  gap: 14px;
  align-items: end;
  padding: 42px 16px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(0, 0, 210, 0.06), transparent),
    #fff;
}

.finance-month {
  display: grid;
  gap: 8px;
  justify-items: center;
  min-width: 0;
}

.finance-month strong {
  color: var(--muted);
  font-size: 12px;
}

.finance-columns {
  width: 100%;
  height: 190px;
  display: grid;
  grid-template-columns: repeat(3, minmax(5px, 1fr));
  align-items: end;
  gap: 4px;
}

.finance-columns span {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 5px;
  height: var(--h);
  border-radius: 5px 5px 2px 2px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  position: relative;
}

.finance-columns span b {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%) rotate(-42deg);
  transform-origin: center;
  color: var(--ink);
  font-size: 9px;
  line-height: 1;
  font-weight: 950;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 4px;
  padding: 2px 3px;
}

.finance-columns .issued,
.chart-legend .issued {
  background: var(--blue);
}

.finance-columns .paid,
.chart-legend .paid {
  background: var(--success);
}

.finance-columns .expenses,
.chart-legend .expenses {
  background: var(--warning);
}

.chart-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.chart-legend.compact {
  margin-top: 10px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.trend-chart {
  width: 100%;
  height: 230px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(0, 0, 210, 0.05), transparent),
    repeating-linear-gradient(0deg, transparent 0 47px, rgba(0, 0, 0, 0.06) 48px),
    #fff;
}

.trend-chart polyline {
  fill: none;
  stroke: var(--success);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.timeline-item strong,
.timeline-item span {
  display: block;
}

.timeline-item div span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-top: 3px;
}

.automation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.automation-card {
  min-height: 146px;
  display: grid;
  grid-template-rows: auto auto minmax(56px, 1fr) auto;
  align-content: stretch;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background:
    url("assets/stella-blu.png") right 12px bottom 12px / 22px 22px no-repeat,
    linear-gradient(180deg, #fff, #fafaff);
}

.automation-card strong {
  display: block;
  font-size: 15px;
  line-height: 1.25;
}

.automation-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  text-wrap: pretty;
}

.automation-card small {
  align-self: end;
  display: grid;
  gap: 3px;
  min-height: 38px;
  padding-top: 9px;
  border-top: 1px solid rgba(0, 0, 210, 0.12);
  color: var(--blue);
  font-weight: 900;
  line-height: 1.2;
}

.automation-card small span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.state-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.state-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 10px 6px 7px;
  border: 1px solid rgba(0, 0, 210, 0.12);
  border-radius: 999px;
  background: rgba(0, 0, 210, 0.04);
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.state-pill b {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: #fff;
  font-size: 10px;
}

.checklist-note {
  margin: -4px 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 210, 0.14);
  background: rgba(0, 0, 210, 0.045);
  border-radius: 6px;
}

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

.quote-editor-panel {
  border-color: rgba(0, 0, 210, 0.18);
}

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

.field {
  display: grid;
  gap: 5px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 42px;
  padding: 10px 11px;
  outline-color: var(--blue);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(0, 0, 210, 0.09);
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

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

.record-card {
  padding: 16px;
  display: grid;
  gap: 12px;
  transition: border 120ms ease, transform 120ms ease, box-shadow 120ms ease;
  overflow-wrap: anywhere;
}

.record-card:hover {
  border-color: rgba(0, 0, 210, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 20px 60px rgba(0, 0, 210, 0.09);
}

.case-card {
  cursor: pointer;
}

.case-card:focus-visible {
  outline: 3px solid rgba(0, 0, 210, 0.22);
  outline-offset: 2px;
}

.case-detail-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(0, 0, 210, 0.14);
  border-radius: var(--radius);
  background:
    url("assets/stella-blu.png") right 18px center / 28px 28px no-repeat,
    linear-gradient(135deg, rgba(0, 0, 210, 0.08), rgba(255, 255, 255, 0.94));
  box-shadow: 0 16px 45px rgba(0, 0, 210, 0.065);
}

.case-detail-hero h2 {
  margin-bottom: 5px;
}

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

.progress.large {
  height: 12px;
  margin-bottom: 16px;
}

.file-input {
  display: none;
}

.report-card {
  min-height: 150px;
}

.record-card header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.record-card h3 {
  margin-bottom: 5px;
}

.cab-balance-card {
  border-color: rgba(0, 0, 210, 0.16);
}

.cab-balance-card.is-warning {
  border-color: rgba(194, 65, 60, 0.3);
  background:
    url("assets/stella-blu.png") right 14px top 14px / 26px 26px no-repeat,
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 246, 246, 0.94));
}

.cab-balance {
  display: block;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1;
  color: var(--blue);
  letter-spacing: 0;
}

.progress {
  height: 8px;
  border-radius: 99px;
  background: var(--soft-2);
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  width: var(--progress);
  background: var(--blue);
}

.case-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.row-actions.compact {
  flex-wrap: nowrap;
  gap: 5px;
}

.row-actions.compact .ghost-button {
  min-height: 30px;
  padding: 0 8px;
  font-size: 11px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 10;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  font-weight: 800;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 26px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

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

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand img {
    width: 150px;
  }

  .nav-list {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .dashboard-grid,
  .deadline-board,
  .finance-hero,
  .calendar-layout,
  .two-cols,
  .three-cols,
  .insight-strip,
  .ops-strip,
  .kpi-grid {
    grid-template-columns: 1fr;
  }

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

  .calendar-weekdays,
  .calendar-grid {
    grid-template-columns: repeat(7, minmax(78px, 1fr));
  }
}

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

  .topbar,
  .command-center,
  .case-detail-hero,
  .topbar-actions,
  .panel-header,
  .table-header {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .search {
    min-width: 0;
    width: 100%;
  }

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

  .quote-form-grid {
    grid-template-columns: 1fr;
  }

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

  .calendar-panel {
    overflow-x: auto;
  }

  .calendar-weekdays,
  .calendar-grid {
    min-width: 680px;
  }

  .insight-card,
  .timeline-item,
  .deadline-card {
    grid-template-columns: 1fr;
  }

  .finance-bars {
    gap: 8px;
    padding-inline: 10px;
  }

  .sparkline {
    width: 100%;
  }

  .command-center {
    padding-right: 20px;
    background:
      linear-gradient(120deg, rgba(0, 0, 210, 0.1), rgba(255, 255, 255, 0.9) 42%),
      #fff;
  }

  .primary-button,
  .secondary-button,
  .ghost-button {
    width: 100%;
  }

  .row-actions.compact .ghost-button {
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
