:root {
  --bg: #f5f5f7;
  --panel: #ffffff;
  --panel-soft: #fbfbfd;
  --border: #e5e5ea;
  --border-strong: #d2d2d7;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --accent: #0071e3;
  --accent-soft: #e8f2ff;
  --danger: #d92d20;
  --success: #0c7c59;
  --shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

html.theme-dark,
body.theme-dark {
  --bg: #0b0d10;
  --panel: #11151b;
  --panel-soft: #161b22;
  --border: #242b35;
  --border-strong: #323b48;
  --text: #f5f7fb;
  --muted: #9aa6b5;
  --accent: #5aa7ff;
  --accent-soft: rgba(90, 167, 255, 0.14);
  --danger: #ff6b6b;
  --success: #34c38f;
  --shadow: 0 22px 52px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(0, 113, 227, 0.06), transparent 24rem),
    linear-gradient(180deg, #fbfbfd 0%, #f5f5f7 100%);
  font-family: var(--font-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif);
  font-weight: 400;
  line-height: 1.5;
}

body.theme-dark {
  background:
    radial-gradient(circle at top left, rgba(90, 167, 255, 0.1), transparent 24rem),
    linear-gradient(180deg, #0f1319 0%, #0b0d10 100%);
}

body.theme-dark,
body.theme-dark p,
body.theme-dark label,
body.theme-dark td,
body.theme-dark strong,
body.theme-dark summary,
body.theme-dark h1,
body.theme-dark h2,
body.theme-dark h3 {
  color: var(--text);
}

body.modal-open {
  overflow: hidden;
}

body.sidebar-open {
  overflow: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

h1,
h2,
h3 {
  font-weight: 500;
  letter-spacing: -0.02em;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

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

input,
select,
textarea {
  width: 100%;
  padding: 0.78rem 0.95rem;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(0, 113, 227, 0.12);
  border-color: rgba(0, 113, 227, 0.42);
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.82rem 1.15rem;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  transition: transform 140ms ease, opacity 140ms ease, box-shadow 140ms ease;
}

button:hover,
.button:hover {
  transform: translateY(-1px);
  opacity: 0.96;
  box-shadow: 0 8px 20px rgba(0, 113, 227, 0.18);
  text-decoration: none;
}

.button-secondary {
  background: color-mix(in srgb, var(--panel-soft) 88%, white 12%);
  color: var(--text);
}

body.theme-dark .button-secondary {
  background: rgba(255, 255, 255, 0.08);
}

.button-danger {
  background: var(--danger);
}

.button-inline {
  padding: 0.62rem 0.9rem;
  font-size: 0.92rem;
}

.app-shell {
  min-height: 100vh;
  position: relative;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: min(320px, calc(100vw - 1.5rem));
  padding: 1.35rem;
  background: rgba(255, 255, 255, 0.82);
  border-right: 1px solid rgba(229, 229, 234, 0.9);
  backdrop-filter: blur(18px);
  position: fixed;
  left: 0;
  top: 0;
  z-index: 50;
  height: 100vh;
  overflow-y: auto;
  transition: transform 180ms ease, opacity 180ms ease;
}

body.theme-dark .sidebar {
  background: rgba(14, 18, 24, 0.9);
  border-right-color: rgba(50, 59, 72, 0.92);
}

body.theme-dark .brand-mark {
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
}

.app-shell.sidebar-collapsed .sidebar {
  transform: translateX(calc(-100% - 1rem));
  opacity: 0;
  pointer-events: none;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: block;
  border: 0;
  border-radius: 0;
  padding: 0;
  min-width: 0;
  min-height: 0;
  background: transparent;
  box-shadow: none;
  color: transparent;
  backdrop-filter: none;
  cursor: pointer;
  transform: none;
  opacity: 1;
}

.sidebar-backdrop:hover {
  transform: none;
  opacity: 1;
  box-shadow: none;
  background: transparent;
}

.sidebar-backdrop[hidden] {
  display: none !important;
}

.sidebar-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.brand {
  display: inline-flex;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.brand-lockup {
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-mark {
  display: block;
  width: auto;
  height: 86px;
  max-width: 220px;
  object-fit: contain;
  box-shadow: var(--shadow);
}

.sidebar-close {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  padding: 0.7rem;
}

.sidebar-close[hidden] {
  display: none !important;
}

.sidebar-close-x {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
}

.brand-kicker,
.eyebrow,
.option-eyebrow,
.doc-eyebrow {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.eyebrow {
  color: var(--accent);
  margin-bottom: 0.45rem;
}

.nav-list {
  display: grid;
  gap: 0.42rem;
  margin-top: 0.2rem;
}

.nav-link {
  display: block;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  color: var(--text);
  transition: background 140ms ease, color 140ms ease;
}

.nav-link:hover,
.nav-link.is-active {
  background: rgba(0, 113, 227, 0.08);
  color: var(--accent);
  text-decoration: none;
}

body.theme-dark .nav-link:hover,
body.theme-dark .nav-link.is-active {
  background: rgba(90, 167, 255, 0.12);
}

.nav-link-text {
  display: inline-flex;
  align-items: center;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 0.75rem;
}

.sidebar-note {
  width: 100%;
  margin-top: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.92rem;
}

.sidebar-user-card strong {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--text);
  word-break: break-word;
}

.sidebar-user-card {
  min-height: 148px;
  display: grid;
  align-content: start;
}

.sidebar-user-card p {
  margin-bottom: 0.8rem;
  word-break: break-word;
}

.theme-toggle {
  width: 100%;
  justify-content: flex-start;
  gap: 0.65rem;
}

.theme-toggle-icon {
  display: inline-grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: rgba(0, 113, 227, 0.12);
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
}

.theme-toggle-label {
  font-size: 0.95rem;
}

body.theme-dark .theme-toggle-icon {
  background: rgba(90, 167, 255, 0.16);
}

.content {
  min-width: 0;
  width: 100%;
  padding: 1.25rem clamp(1rem, 2vw, 1.8rem) 1.75rem;
}

.auth-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 2rem;
}

.auth-panel {
  width: min(460px, 100%);
}

.auth-brand {
  display: inline-flex;
  margin-bottom: 1rem;
}

.auth-switch {
  margin-top: 0.35rem;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.3rem;
}

.page-header-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.9rem;
  min-width: 0;
}

.page-header h1 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 2.4vw, 2.35rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.05;
  word-break: break-word;
}

.sidebar-toggle {
  gap: 0.72rem;
  padding: 0.72rem 0.98rem;
  box-shadow: none;
}

.sidebar-toggle-label {
  font-size: 0.92rem;
}

.burger-icon {
  display: inline-flex;
  flex-direction: column;
  gap: 0.22rem;
}

.burger-bar {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 160ms ease, opacity 160ms ease;
}

.sidebar-toggle[aria-expanded="true"] .burger-bar:nth-child(1) {
  transform: translateY(4px) rotate(45deg);
}

.sidebar-toggle[aria-expanded="true"] .burger-bar:nth-child(2) {
  opacity: 0;
}

.sidebar-toggle[aria-expanded="true"] .burger-bar:nth-child(3) {
  transform: translateY(-4px) rotate(-45deg);
}

.panel {
  margin-bottom: 1.2rem;
  padding: 1.35rem;
  background: color-mix(in srgb, var(--panel) 88%, transparent 12%);
  border: 1px solid color-mix(in srgb, var(--border) 88%, transparent 12%);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

body.theme-dark .project-picker,
body.theme-dark .option-card,
body.theme-dark .tab-link,
body.theme-dark .calendar-day,
body.theme-dark .calendar-modal-card,
body.theme-dark .modal-submit-progress,
body.theme-dark .modal-submit-progress-panel,
body.theme-dark .crm-key-card,
body.theme-dark .table-wrap table,
body.theme-dark .panel-soft,
body.theme-dark .panel-nested,
body.theme-dark .timeline-track,
body.theme-dark .timeline-item-card,
body.theme-dark .timing-list-event,
body.theme-dark .inline-create-summary,
body.theme-dark .section-card,
body.theme-dark .section-lines,
body.theme-dark .section-band,
body.theme-dark .control-card,
body.theme-dark .sidebar-note {
  background-color: var(--panel-soft);
  border-color: var(--border);
}

body.theme-dark .stat-card,
body.theme-dark .calendar-day,
body.theme-dark .crm-key-card {
  background: linear-gradient(180deg, rgba(28, 34, 42, 0.98) 0%, rgba(18, 23, 29, 0.98) 100%);
}

body.theme-dark .calendar-event {
  color: var(--text);
  background: color-mix(in srgb, var(--timing-color, var(--panel-soft)) 22%, #11151b 78%);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}

body.theme-dark .calendar-event span,
body.theme-dark .calendar-event-more,
body.theme-dark .calendar-empty-day,
body.theme-dark .stat-label,
body.theme-dark .stat-detail,
body.theme-dark .muted,
body.theme-dark .toolbar-note,
body.theme-dark .row-hint,
body.theme-dark th,
body.theme-dark .project-summary-grid .stat-label,
body.theme-dark .project-summary-grid .stat-detail {
  color: var(--muted);
}

body.theme-dark .flash-notice {
  background: rgba(12, 124, 89, 0.16);
}

body.theme-dark .flash-error {
  background: rgba(255, 107, 107, 0.16);
}

.panel-danger {
  border-color: rgba(217, 45, 32, 0.18);
}

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

.project-picker {
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--panel-soft);
}

.project-picker label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.split-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.stat-card {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 100%, transparent 0%) 0%, color-mix(in srgb, var(--panel-soft) 100%, transparent 0%) 100%);
}

.stat-card h3 {
  margin-bottom: 0.3rem;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  word-break: break-word;
}

.project-summary-panel .split-header {
  margin-bottom: 0.9rem;
}

.project-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
}

.project-summary-grid .stat-card {
  padding: 0.85rem 0.95rem;
  border-radius: 18px;
}

.project-summary-grid .stat-card h3 {
  font-size: 1.08rem;
  line-height: 1.2;
  margin-bottom: 0.2rem;
}

.project-summary-grid .stat-label,
.project-summary-grid .stat-detail {
  font-size: 0.8rem;
}

.project-summary-divider {
  margin: 0.95rem 0;
  border-top: 1px solid var(--border);
}

.quick-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.project-tab-bar {
  width: 100%;
}

.stat-label,
.stat-detail,
.muted,
.toolbar-note,
.row-hint {
  color: var(--muted);
}

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

.stack-form {
  display: grid;
  gap: 0.9rem;
}

.stack-form label {
  display: grid;
  gap: 0.42rem;
  color: var(--muted);
  font-weight: 600;
}

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

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

.compact-form {
  margin-top: 0.8rem;
}

.checkbox-grid {
  display: grid;
  gap: 0.65rem;
  margin: 0.35rem 0 0.2rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  font-weight: 500;
}

.checkbox-row input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.inline-form {
  display: inline-flex;
  margin-top: 0.4rem;
  margin-right: 0.4rem;
}

.flash {
  margin-bottom: 1rem;
  padding: 0.95rem 1.1rem;
  border-radius: 18px;
}

.flash-notice {
  background: rgba(12, 124, 89, 0.1);
  color: var(--success);
}

.flash-error {
  background: rgba(217, 45, 32, 0.1);
  color: var(--danger);
}

.empty-state {
  text-align: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.badge-accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge-default {
  background: #f0f4f9;
  color: var(--text);
}

.badge-success {
  background: rgba(12, 124, 89, 0.12);
  color: var(--success);
}

.badge-danger {
  background: rgba(217, 45, 32, 0.12);
  color: var(--danger);
}

details {
  display: inline-block;
}

summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
}

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

.option-card {
  display: block;
  padding: 1.15rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.option-card:hover {
  border-color: rgba(0, 113, 227, 0.28);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.option-card h3 {
  margin-bottom: 0.35rem;
  font-size: 1.1rem;
  font-weight: 500;
}

.inline-builder {
  margin-top: 1rem;
}

.panel-soft {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, var(--panel-soft) 100%);
  border-color: var(--border);
  box-shadow: none;
}

.panel-nested {
  margin-bottom: 0;
  height: 100%;
}

.builder-shell {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 248, 250, 0.9) 100%);
}

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

.admin-tabs-panel {
  padding: 0.75rem;
}

.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.tab-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.tab-link:hover {
  border-color: rgba(0, 113, 227, 0.3);
  text-decoration: none;
}

.tab-link.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.calendar-nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.calendar-header-tools {
  display: grid;
  gap: 0.85rem;
  justify-items: end;
}

.calendar-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: flex-end;
  gap: 0.75rem;
}

.calendar-filters label {
  display: grid;
  gap: 0.35rem;
  min-width: 160px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.calendar-view-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 0.9rem;
}

.inline-month-form {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.inline-month-form input[type="month"] {
  min-width: 150px;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.7rem;
}

.calendar-weekdays {
  margin-bottom: 0.7rem;
}

.calendar-weekdays span {
  padding: 0.2rem 0.35rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.calendar-day {
  min-height: 150px;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(180deg, #fff 0%, #fafafc 100%);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
  overflow: visible;
}

.calendar-day.is-outside {
  opacity: 0.42;
}

.calendar-day.is-today {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(0, 113, 227, 0.12);
}

.calendar-day-number {
  margin-bottom: 0.65rem;
  font-size: 0.88rem;
  font-weight: 700;
}

.calendar-day-events {
  display: grid;
  gap: 0.45rem;
  overflow: visible;
}

.calendar-event {
  display: grid;
  gap: 0.16rem;
  width: max-content;
  min-width: min(10rem, calc(100vw - 6rem));
  max-width: min(18rem, calc(100vw - 6rem));
  padding: 0.42rem 0.5rem;
  border-radius: 14px;
  border-left: 4px solid var(--timing-color, var(--accent));
  background: color-mix(in srgb, var(--timing-color, var(--panel-soft)) 14%, white 86%);
  position: relative;
  z-index: 2;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.timing-draggable {
  cursor: grab;
}

.timing-draggable.is-dragging {
  opacity: 0.55;
}

[data-drop-date].is-drop-target {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(0, 113, 227, 0.16);
  transform: translateY(-1px);
}

.calendar-event strong {
  font-size: 0.76rem;
  line-height: 1.15;
}

.calendar-event span,
.calendar-event-more,
.calendar-empty-day {
  font-size: 0.68rem;
  line-height: 1.25;
}

.calendar-event span,
.calendar-event-more {
  color: var(--muted);
}

.calendar-event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.calendar-empty-day {
  margin: 0;
}

.calendar-event-more {
  background: transparent;
  padding: 0;
}

.calendar-color-field {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.calendar-color-field input[type="color"] {
  width: 48px;
  min-width: 48px;
  height: 42px;
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
}

.calendar-color-chip {
  display: inline-block;
  width: 0.8rem;
  height: 0.8rem;
  margin-right: 0.45rem;
  border-radius: 999px;
  background: var(--timing-color, var(--accent));
  vertical-align: middle;
}

.timeline-shell {
  display: grid;
  gap: 0.75rem;
}

.timeline-header {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: 0.9rem;
  align-items: center;
}

.timeline-header-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.timeline-header-days {
  display: grid;
  grid-template-columns: repeat(var(--timeline-columns), minmax(22px, 1fr));
  gap: 0.15rem;
}

.timeline-header-days span {
  text-align: center;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.timeline-rows {
  display: grid;
  gap: 0.75rem;
}

.timeline-row {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: 0.9rem;
  align-items: center;
}

.timeline-row-meta {
  display: grid;
  gap: 0.2rem;
}

.timeline-row-meta strong {
  font-size: 0.92rem;
}

.timeline-row-meta span {
  color: var(--muted);
  font-size: 0.78rem;
}

.timeline-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--timeline-columns), minmax(22px, 1fr));
  gap: 0.15rem;
  align-items: center;
  min-height: 52px;
}

.timeline-drop-cell {
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  transition: border-color 140ms ease, background 140ms ease;
}

.timeline-track .timeline-drop-cell.is-drop-target,
.timeline-track [data-drop-date].is-drop-target {
  border-color: var(--accent);
  background: rgba(0, 113, 227, 0.06);
}

.timeline-bar {
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  min-height: 36px;
  padding: 0.4rem 0.45rem 0.4rem 0.55rem;
  border-radius: 12px;
  border-left: 4px solid var(--timing-color, var(--accent));
  background: color-mix(in srgb, var(--timing-color, var(--panel-soft)) 18%, white 82%);
  box-shadow: var(--shadow);
  overflow: visible;
}

.timeline-bar span {
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.timeline-resize-handle {
  flex: 0 0 auto;
  width: 18px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.14);
  cursor: ew-resize;
  position: relative;
}

.timeline-resize-handle::before,
.timeline-resize-handle::after {
  content: "";
  position: absolute;
  top: 7px;
  width: 2px;
  height: 14px;
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.55);
}

.timeline-resize-handle::before {
  left: 6px;
}

.timeline-resize-handle::after {
  right: 6px;
}

.timing-month-list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(250px, 1fr);
  gap: 0.95rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
}

.timing-month-column {
  min-width: 250px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, #fff 0%, #fafafc 100%);
  overflow: hidden;
}

.timing-month-title {
  padding: 0.7rem 0.9rem;
  background: #c98b2b;
  color: #fff;
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.timing-month-days {
  display: grid;
}

.timing-month-day-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 0.65rem;
  align-items: start;
  padding: 0.26rem 0.7rem;
  border-bottom: 1px dotted var(--border);
  min-height: 30px;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.timing-month-day-row:last-child {
  border-bottom: 0;
}

.timing-month-day-row.is-drop-target {
  background: rgba(0, 113, 227, 0.05);
}

.timing-month-day-label {
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.timing-month-day-label span {
  color: var(--muted);
  font-weight: 600;
}

.timing-month-day-events {
  display: grid;
  gap: 0.12rem;
  min-height: 0.95rem;
}

.timing-list-event {
  display: grid;
  gap: 0.08rem;
  padding: 0.08rem 0 0.08rem 0.45rem;
  border-left: 3px solid var(--timing-color, var(--accent));
  line-height: 1.2;
}

.timing-list-event strong {
  font-size: 0.72rem;
  font-weight: 700;
}

.timing-list-event-project,
.timing-list-event-range {
  color: var(--muted);
  font-size: 0.64rem;
}

.timing-version-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
  grid-column: 1 / -1;
}

.calendar-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
  z-index: 60;
}

.calendar-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  z-index: 61;
}

.calendar-modal[hidden],
.calendar-modal-backdrop[hidden] {
  display: none;
}

.calendar-modal-card {
  width: min(760px, calc(100vw - 2rem));
  max-height: calc(100vh - 3rem);
  overflow: auto;
  position: relative;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22);
  padding: 1.35rem;
}

.calendar-modal-card.is-submitting {
  overflow: hidden;
}

.calendar-modal-card.is-submitting form > :not(.modal-submit-progress) {
  pointer-events: none;
  opacity: 0.62;
}

.modal-submit-progress {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.4rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  z-index: 3;
}

.modal-submit-progress[hidden] {
  display: none !important;
}

.modal-submit-progress-panel {
  width: min(360px, 100%);
  display: grid;
  gap: 0.7rem;
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.1);
}

.modal-submit-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.modal-submit-progress-panel strong {
  font-size: 0.98rem;
}

.modal-submit-progress-percent {
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
}

.modal-submit-progress-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.modal-submit-progress-bar {
  position: relative;
  height: 0.48rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 113, 227, 0.12);
}

.modal-submit-progress-bar span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(0, 113, 227, 0.7), var(--accent));
  transition: width 180ms ease;
}

.calendar-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.crm-table th,
.crm-table td {
  vertical-align: top;
}

.crm-columns-table strong {
  display: block;
  font-weight: 600;
}

.crm-column-name {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.crm-column-drag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3rem;
  padding: 0.28rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: grab;
  user-select: none;
}

.crm-column-position {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.crm-columns-table [data-column-row='true'].is-dragging {
  opacity: 0.55;
}

.crm-column-order-hint {
  color: var(--muted);
  font-size: 0.8rem;
}

.crm-column-toggle {
  display: inline-flex !important;
  align-items: center;
  gap: 0.6rem;
  color: var(--text) !important;
  font-weight: 600 !important;
}

.crm-column-toggle input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.crm-select-custom-field {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.crm-name-link {
  font-weight: 600;
}

.crm-avatar-table {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  object-fit: cover;
  display: block;
  background: #eef2ff;
}

.crm-detail-modal-card {
  width: min(1400px, calc(100vw - 1.5rem));
  max-height: calc(100vh - 1.5rem);
  padding: 1.5rem;
}

.crm-detail-topbar {
  align-items: start;
}

.crm-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
}

.crm-hero {
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr);
  gap: 1.15rem;
  margin-bottom: 1rem;
}

.crm-hero-media {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.crm-avatar {
  width: 9.5rem;
  height: 9.5rem;
  border-radius: 28px;
  object-fit: cover;
  display: block;
  background: #eef2ff;
}

.crm-avatar-fallback {
  display: grid;
  place-items: center;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent);
  background: linear-gradient(180deg, rgba(0, 113, 227, 0.12), rgba(0, 113, 227, 0.04));
}

.crm-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.crm-key-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
}

.crm-key-card {
  display: grid;
  gap: 0.3rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, #fff 0%, #fafafc 100%);
}

.crm-key-card span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.crm-key-card strong {
  font-size: 0.92rem;
  font-weight: 600;
  word-break: break-word;
}

.crm-edit-details {
  margin-bottom: 1rem;
}

.crm-edit-details > summary {
  list-style: none;
}

.crm-edit-details > summary::-webkit-details-marker {
  display: none;
}

.crm-edit-details[open] > summary {
  margin-bottom: 1rem;
}

.crm-related-panel {
  margin-bottom: 0;
}

.crm-create-related-form {
  margin-bottom: 1rem;
}

.timing-export-page {
  background: #f5f5f7;
}

.timing-export-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 1rem 1rem 0;
}

.timing-export-sheet {
  max-width: 1440px;
  margin: 0 auto 1.5rem;
}

.timing-export-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--export-border);
}

.timing-export-subtitle {
  margin-top: 0.35rem;
  color: var(--export-ink);
  font-size: 0.92rem;
}

.timing-export-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.1rem;
}

.timing-export-meta div {
  border: 1px solid var(--export-border);
  border-radius: 16px;
  background: #fff;
  padding: 0.85rem 1rem;
}

.timing-export-meta span {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--export-ink);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.timing-export-meta strong {
  font-size: 0.98rem;
}

.timing-export-timeline {
  display: grid;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.timing-export-row {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 0.9rem;
  align-items: center;
}

.timing-export-row-label {
  display: grid;
  gap: 0.15rem;
}

.timing-export-row-label span {
  color: var(--export-ink);
  font-size: 0.82rem;
}

.timing-export-row-track {
  position: relative;
  min-height: 34px;
  border-radius: 999px;
  background: #f3f3f3;
  overflow: hidden;
}

.timing-export-row-bar {
  position: absolute;
  top: 4px;
  bottom: 4px;
  min-width: 3rem;
  border-radius: 999px;
  border-left: 4px solid var(--timing-color, var(--accent));
  background: color-mix(in srgb, var(--timing-color, #d9e8ff) 18%, white 82%);
  color: #111;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 26px;
  padding: 0 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timing-export-table th,
.timing-export-table td {
  color: #111;
}

.timing-export-table td:nth-child(1),
.timing-export-table td:nth-child(5) {
  text-align: center;
}

.header-actions,
.autosave-status-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.autosave-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.78rem;
  border-radius: 999px;
  background: #f0f4f9;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.autosave-pill[data-state="saving"] {
  background: var(--accent-soft);
  color: var(--accent);
}

.autosave-pill[data-state="saved"] {
  background: rgba(12, 124, 89, 0.12);
  color: var(--success);
}

.autosave-pill[data-state="error"] {
  background: rgba(217, 45, 32, 0.12);
  color: var(--danger);
}

.autosave-pill[data-state="dirty"] {
  background: rgba(0, 113, 227, 0.08);
  color: var(--accent);
}

.bid-editor-page .panel {
  margin-bottom: 1rem;
  padding: 1.1rem 1.15rem;
  border-radius: 20px;
}

.bid-editor-page .split-header {
  margin-bottom: 0.8rem;
}

.bid-editor-page .stat-grid {
  gap: 0.85rem;
}

.bid-editor-page .stat-card {
  padding: 0.85rem 0.95rem;
  border-radius: 18px;
}

.bid-editor-page .stat-card h3 {
  font-size: 1.35rem;
}

.bid-editor-page th,
.bid-editor-page td {
  padding: 0.68rem 0.72rem;
}

.bid-editor-page .table-input {
  min-width: 0;
  padding: 0.55rem 0.62rem;
  font-size: 0.92rem;
}

.bid-editor-page .table-input-compact {
  min-width: 84px;
}

.bid-editor-page .control-grid,
.bid-editor-page .section-card-stack {
  gap: 0.85rem;
}

.bid-editor-page .section-card-stack {
  margin-bottom: 1.35rem;
}

.bid-editor-page .section-card-band {
  padding: 0.58rem 0.72rem;
  border-radius: 14px;
}

.bid-editor-page .section-title-grid {
  grid-template-columns: minmax(170px, 1fr) 88px;
}

.bid-editor-page .section-card-note {
  margin-bottom: 0.65rem;
  font-size: 0.82rem;
}

.bid-editor-page .inline-add-row-toggle {
  padding: 0.72rem 0.82rem;
}

.bid-editor-page .inline-add-row-body {
  padding: 0 0.82rem 0.82rem;
}

.section-card-stack {
  display: grid;
  gap: 1rem;
}

.section-card {
  margin-bottom: 0;
}

.section-card-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.55rem;
}

.section-card-band {
  padding: 0.72rem 0.86rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
}

.section-band-form,
.section-band-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 0.9rem;
  width: 100%;
}

.section-band-title {
  align-items: center;
  color: var(--text);
}

.section-band-title strong {
  font-size: 0.88rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.section-band-title span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.section-title-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 110px;
  gap: 0.75rem;
  flex: 1;
}

.section-title-grid label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.section-title-grid input {
  background: rgba(255, 255, 255, 0.98);
}

.section-card-actions {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.section-card-summary {
  justify-content: flex-end;
}

.section-total-badge {
  white-space: nowrap;
}

.section-card-note {
  margin-bottom: 0.9rem;
}

.row-handle-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.section-row-index {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
}

.drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.28rem 0.48rem;
  border: 1px dashed var(--border-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: grab;
  user-select: none;
}

.section-items-table [data-sortable-item].is-dragging {
  opacity: 0.55;
}

.section-create-card .inline-builder {
  margin-top: 0;
}

.section-tools-grid {
  margin-bottom: 1rem;
}

.csv-import-card .inline-builder {
  margin-top: 0;
}

.csv-import-hint {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
}

.csv-import-example {
  margin: 0;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  background: rgba(0, 113, 227, 0.05);
  color: var(--muted);
  font-size: 0.82rem;
}

.csv-import-example strong {
  color: var(--text);
}

.inline-add-row {
  margin-top: 0.95rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
}

.inline-add-row summary {
  list-style: none;
}

.inline-add-row summary::-webkit-details-marker {
  display: none;
}

.inline-add-row-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.9rem 1rem;
  color: var(--accent);
  font-weight: 700;
}

.inline-add-row-body {
  padding: 0 1rem 1rem;
}

.inline-add-row-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.8rem;
}

.inline-add-row-grid-compact {
  grid-template-columns: minmax(160px, 1.15fr) minmax(180px, 1.45fr) 110px 90px 120px auto;
  align-items: center;
}

.inline-add-row-grid label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.inline-add-row-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0;
}

.cost-total-value {
  display: inline-flex;
  align-items: center;
  min-height: 2.4rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.line-total-value {
  display: inline-flex;
  align-items: center;
  min-height: 2.2rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.editor-table th,
.editor-table td {
  white-space: nowrap;
}

.leave-guard {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(17, 24, 39, 0.28);
  backdrop-filter: blur(8px);
}

.leave-guard[hidden] {
  display: none !important;
}

.leave-guard-card {
  width: min(420px, 100%);
  padding: 1.35rem;
  border: 1px solid rgba(229, 229, 234, 0.92);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.leave-guard-card h3 {
  margin-bottom: 0.35rem;
}

.leave-guard-card p {
  margin-bottom: 1rem;
  color: var(--muted);
}

.leave-guard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: flex-end;
}

.section-items-table {
  table-layout: fixed;
}

.table-input {
  min-width: 110px;
  padding: 0.62rem 0.72rem;
  border-radius: 10px;
}

.table-input-compact {
  min-width: 84px;
}

.action-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.danger-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
}

.costs-panel {
  margin-top: 1.35rem;
}

.section-row td {
  background: #fafafc;
  font-weight: 700;
  color: var(--text);
}

.add-row td {
  background: rgba(0, 113, 227, 0.03);
}

.print-body {
  color: var(--export-ink);
  background: #fff;
  font-family: var(--font-export, var(--font-ui, "Helvetica Neue", Helvetica, Arial, sans-serif));
  font-weight: 400;
}

.print-shell {
  max-width: 940px;
  margin: 0 auto;
  padding: 1.4rem;
}

.export-preview {
  max-width: 860px;
}

.print-toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}

.print-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.print-toolbar-form {
  display: inline-flex;
  margin: 0;
}

.toolbar-note-inline {
  font-size: 0.82rem;
}

.export-sheet {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0.8rem;
  min-height: 266mm;
  margin-bottom: 1rem;
  padding: 1.1rem 1.15rem 0.85rem;
  background: var(--export-page);
  border: 1px solid var(--export-border);
  border-radius: 18px;
  page-break-after: always;
  break-after: page;
}

.export-sheet:last-child {
  page-break-after: auto;
  break-after: auto;
}

.export-header,
.export-costs-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.export-sheet-body {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  min-height: 0;
}

.export-header-left {
  min-width: 220px;
}

.export-title {
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0.01em;
  color: var(--export-ink);
}

.export-brand-mark {
  display: inline-flex;
  align-items: center;
  margin-top: 2.4rem;
  color: var(--export-ink);
}

.export-brand-mark img {
  display: block;
  width: auto;
  height: 44px;
  max-width: 140px;
  object-fit: contain;
}

.export-meta-card {
  display: grid;
  gap: 0.45rem;
  min-width: 250px;
  font-size: 0.78rem;
}

.export-meta-card div,
.export-costs-metrics div {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
}

.export-meta-card span,
.export-costs-metrics span {
  color: var(--export-ink);
  font-weight: 600;
}

.export-meta-card strong,
.export-costs-metrics strong {
  font-weight: 700;
}

.export-page-kicker,
.export-front-label,
.export-footer-title {
  color: var(--export-ink);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.export-front-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.8fr);
  gap: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--export-border);
  background: var(--export-hero-bg);
}

.export-front-hero h1,
.export-costs-intro h2 {
  margin-bottom: 0.4rem;
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.export-front-copy,
.export-costs-intro p {
  margin-bottom: 0;
  color: var(--export-ink);
  font-size: 0.92rem;
}

.export-front-metrics {
  display: grid;
  gap: 0.65rem;
}

.export-front-metrics article {
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--export-border);
  background: var(--export-page);
}

.export-front-metrics span {
  display: block;
  color: var(--export-ink);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.export-front-metrics strong {
  display: block;
  margin-top: 0.18rem;
  font-size: 1.02rem;
  color: var(--export-ink);
}

.export-band {
  margin-top: 0.15rem;
  padding: 0.38rem 0.65rem;
  border: 0;
  background: #000;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.export-letter-body {
  min-height: 0;
  padding: 0.9rem 0.15rem 0;
  font-size: 0.98rem;
  line-height: 1.75;
}

.export-footer {
  margin-top: auto;
  padding-top: 0.65rem;
  border-top: 1px solid var(--export-border);
}

.export-company-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
  padding: 0.2rem 0 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--export-ink);
}

.export-totals {
  padding: 0.2rem 0 0.35rem;
}

.export-total-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px 120px;
  gap: 0.5rem;
  align-items: center;
  padding: 0.34rem 0;
  font-size: 0.92rem;
}

.export-total-row strong {
  text-align: right;
}

.export-total-row .currency {
  text-align: center;
  color: var(--export-ink);
  font-size: 0.84rem;
}

.export-grand-total {
  margin-top: 0.45rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--export-ink);
  font-weight: 700;
}

.export-caveats {
  padding-top: 0.1rem;
  font-size: 0.76rem;
  line-height: 1.1;
  color: var(--export-ink);
}

.export-caveats p {
  margin-bottom: 0.18rem;
}

.export-calculation-wrap {
  padding-top: 0.05rem;
}

.export-calculation-block {
  margin-top: 0.55rem;
  page-break-inside: avoid;
  break-inside: avoid;
}

.export-section-band {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.38rem 0.65rem;
  border: 0;
  background: #000;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
}

.export-empty-block {
  padding: 0.9rem;
  border: 1px solid var(--export-border);
  background: var(--export-panel);
  color: var(--export-ink);
}

.export-grid-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.export-grid-table th,
.export-grid-table td {
  padding: 0.18rem 0.3rem;
  border: 1px solid var(--export-border);
  font-size: 0.68rem;
  line-height: 1.25;
  color: var(--export-ink);
}

.export-grid-table thead th {
  color: #fff;
  background: #000;
  border-color: #000;
  font-size: 0.68rem;
  letter-spacing: 0;
  text-transform: none;
}

.export-calculation-wrap .export-grid-table th,
.export-calculation-wrap .export-grid-table td {
  border: 0;
  background: transparent;
}

.export-calculation-wrap .export-grid-table thead th {
  background: #000;
  color: #fff;
  border-color: #000;
}

.export-grid-table th:nth-child(1),
.export-grid-table td:nth-child(1) {
  width: 48px;
}

.export-grid-table th:nth-child(3),
.export-grid-table td:nth-child(3),
.export-grid-table th:nth-child(4),
.export-grid-table td:nth-child(4),
.export-grid-table th:nth-child(5),
.export-grid-table td:nth-child(5),
.export-grid-table th:nth-child(6),
.export-grid-table td:nth-child(6) {
  width: 14%;
}

.export-costs-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 1rem;
  margin-bottom: 0.2rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--export-border);
  background: transparent;
}

.export-header-costs {
  flex: 1;
}

.export-meta-card-costs {
  min-width: 220px;
}

.export-costs-metrics {
  min-width: 0;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--export-border);
  background: transparent;
  color: var(--export-ink);
  font-size: 0.82rem;
}

.export-costs-metrics span {
  color: var(--export-ink);
}

.export-cost-table th:nth-child(1),
.export-cost-table td:nth-child(1) {
  width: 44px;
}

.export-cost-table th:nth-child(3),
.export-cost-table td:nth-child(3),
.export-cost-table th:nth-child(4),
.export-cost-table td:nth-child(4),
.export-cost-table th:nth-child(6),
.export-cost-table td:nth-child(6) {
  width: 14%;
}

.export-cost-table th:nth-child(5),
.export-cost-table td:nth-child(5) {
  width: 24%;
}

@page {
  size: A4;
  margin: 16mm 14mm 15mm;
}

@media print {
  body,
  .print-body {
    background: #fff;
  }

  .timing-export-toolbar {
    display: none;
  }

  .print-hide {
    display: none !important;
  }

  .print-shell {
    max-width: none;
    padding: 0;
  }

  .export-sheet {
    border: none;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    padding: 0;
    min-height: 266mm;
  }
}

@media (max-width: 1080px) {
  .sidebar {
    width: min(320px, calc(100vw - 1.25rem));
  }

  .content {
    padding: 1rem;
  }
}

@media (max-width: 720px) {
  .hero,
  .two-column-form,
  .crm-select-custom-field,
  .control-grid,
  .inline-add-row-grid,
  .inline-add-row-grid-compact,
  .section-title-grid,
  .export-front-hero,
  .export-costs-top,
  .option-grid,
  .export-company-grid {
    grid-template-columns: 1fr;
  }

  .section-band-form,
  .section-band-title {
    flex-direction: column;
    align-items: stretch;
  }

  .split-header,
  .print-toolbar {
    flex-direction: column;
    align-items: start;
  }

  .calendar-nav-links,
  .inline-month-form,
  .calendar-header-tools,
  .calendar-filters {
    width: 100%;
    justify-content: flex-start;
  }

  .crm-hero {
    grid-template-columns: 1fr;
  }

  .crm-hero-media {
    justify-content: flex-start;
  }

  .crm-avatar {
    width: 7rem;
    height: 7rem;
  }

  .crm-detail-modal-card {
    width: calc(100vw - 1rem);
    max-height: calc(100vh - 1rem);
    padding: 1rem;
  }

  .calendar-weekdays {
    display: none;
  }

  .calendar-grid,
  .timeline-header,
  .timeline-row {
    grid-template-columns: 1fr;
  }

  .timing-month-list {
    grid-auto-columns: minmax(220px, 88vw);
  }

  .timeline-header-days,
  .timeline-track {
    grid-template-columns: repeat(var(--timeline-columns), minmax(18px, 1fr));
  }

  .timing-export-meta,
  .timing-export-row {
    grid-template-columns: 1fr;
  }

  .timeline-header-label {
    margin-bottom: 0.35rem;
  }

  .brand-mark {
    height: 64px;
    max-width: 180px;
  }

  .sidebar {
    width: min(300px, calc(100vw - 1rem));
    padding: 1rem;
  }

  .sidebar-header-row {
    align-items: center;
  }

  .sidebar-note {
    font-size: 0.86rem;
  }

  .page-header {
    margin-bottom: 1rem;
  }

  .page-header-main {
    align-items: flex-start;
  }

  .page-header h1 {
    font-size: clamp(1.2rem, 6vw, 1.65rem);
  }

  th,
  td {
    padding: 0.8rem 0.6rem;
  }

  .panel,
  .export-sheet {
    padding: 1rem;
  }
}
