@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Sora:wght@500;600;700;800&display=swap");

:root {
  --bg: #f2f4f7;
  --panel: #ffffff;
  --text: #0f141a;
  --muted: #5f6b7a;
  --line: #dde3ec;
  --line-strong: #c8d0dc;
  --accent: #0d7f4f;
  --accent-strong: #07613b;
  --ok: #0d7f4f;
  --danger: #c81e1e;
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 82px;
  --radius-xl: 14px;
  --radius-lg: 12px;
  --radius-md: 10px;
  --ui-fast: 180ms ease;
  --ui-med: 260ms ease;
  --ui-slow: 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.3;
}

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

.min-w-0 {
  min-width: 0;
}

.app-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  transition: grid-template-columns var(--ui-med);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.58rem;
  background: #fff;
  border-right: 1px solid var(--line);
  transition: padding var(--ui-fast), gap var(--ui-fast);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
}

.brand-logo-shell {
  width: 100%;
  max-width: 286px;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 90px;
  object-fit: contain;
  display: block;
}

.brand-copy {
  display: none;
}

.brand-title,
.brand-sub {
  display: none;
}

.sidebar-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border-color: var(--line-strong);
  color: #31363d;
}

.nav-section-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.65px;
  color: #8b93a0;
  font-weight: 700;
  padding: 0 0.25rem;
}

.nav-side {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.nav-link-side {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.56rem;
  border-radius: 8px;
  border: 1px solid transparent;
  color: #2f3540;
  font-size: 0.86rem;
  font-weight: 600;
  transition: background var(--ui-fast), border-color var(--ui-fast), color var(--ui-fast), padding var(--ui-fast);
}

.nav-link-side:hover {
  background: #f6f7f9;
  border-color: var(--line);
}

.nav-link-side.active {
  background: #f6f7f9;
  border-color: var(--line);
  color: #111214;
}

.nav-link-side.active::before {
  content: "";
  position: absolute;
  left: 0.24rem;
  top: 0.34rem;
  bottom: 0.34rem;
  width: 3px;
  border-radius: 999px;
  background: var(--accent);
}

.nav-icon {
  width: 1.05rem;
  text-align: center;
  color: #6d7480;
}

.nav-link-side.active .nav-icon {
  color: #111214;
}

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

.content-wrap {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}

body.sidebar-collapsed .app-layout,
html.sidebar-collapsed .app-layout {
  grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr);
}

body.sidebar-collapsed .brand,
html.sidebar-collapsed .brand {
  padding: 0.3rem;
}

body.sidebar-collapsed .nav-section-label,
body.sidebar-collapsed .nav-link-side span,
body.sidebar-collapsed .sidebar-toggle-btn span,
html.sidebar-collapsed .nav-section-label,
html.sidebar-collapsed .nav-link-side span,
html.sidebar-collapsed .sidebar-toggle-btn span {
  display: none;
}

body.sidebar-collapsed .brand-logo-shell,
html.sidebar-collapsed .brand-logo-shell {
  width: min(100%, 64px);
  min-height: 62px;
}

body.sidebar-collapsed .nav-link-side,
body.sidebar-collapsed .sidebar-toggle-btn,
html.sidebar-collapsed .nav-link-side,
html.sidebar-collapsed .sidebar-toggle-btn {
  justify-content: center;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 1040;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.58rem;
  padding: 0.64rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.topbar-title {
  margin: 0;
  font-size: clamp(0.98rem, 1.7vw, 1.08rem);
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0;
  color: #111214;
  overflow-wrap: anywhere;
}

.topbar-actions {
  min-height: 2rem;
}

.global-help-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  white-space: nowrap;
  transition: color var(--ui-fast), border-color var(--ui-fast), background var(--ui-fast), box-shadow var(--ui-fast);
}

.global-help-toggle.is-active {
  border-color: color-mix(in srgb, var(--company-brand-color) 72%, #17334a);
  background: color-mix(in srgb, var(--company-brand-color) 90%, #17334a);
  color: #fff;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--company-brand-color) 24%, transparent);
}

.context-help-guide {
  position: fixed;
  z-index: 1090;
  top: 4.35rem;
  left: 50%;
  width: max-content;
  max-width: min(430px, calc(100vw - 2rem));
  margin: 0;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.5rem;
  border: 1px solid color-mix(in srgb, var(--company-brand-color) 28%, #ccd8e5);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 28px rgba(20, 35, 52, 0.14);
  backdrop-filter: blur(16px) saturate(135%);
}

.context-help-guide-icon {
  width: 1.65rem;
  height: 1.65rem;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--company-brand-color) 12%, #eef5f8);
  color: color-mix(in srgb, var(--company-brand-color) 82%, #17334a);
}

.context-help-guide-copy {
  display: flex;
  align-items: baseline;
  min-width: 0;
  gap: 0.35rem;
}

.context-help-guide-copy strong {
  color: #172231;
  font-size: 0.82rem;
  font-weight: 800;
}

.context-help-guide-copy small {
  color: #66778a;
  font-size: 0.72rem;
  line-height: 1.35;
}

.context-help-guide button {
  width: 1.65rem;
  height: 1.65rem;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #617185;
}

.context-help-guide button:hover {
  background: #edf2f7;
  color: #172231;
}

body.context-help-active [data-help] {
  outline: 2px dashed color-mix(in srgb, var(--company-brand-color) 62%, #3c6f91);
  outline-offset: 3px;
  cursor: help;
  transition: outline-color var(--ui-fast), box-shadow var(--ui-fast), background-color var(--ui-fast);
}

body.context-help-active [data-help].context-help-current {
  outline-style: solid;
  outline-color: color-mix(in srgb, var(--company-brand-color) 88%, #153a54);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--company-brand-color) 12%, transparent);
}

.context-help-tooltip {
  position: fixed;
  z-index: 1100;
  width: min(350px, calc(100vw - 24px));
  display: grid;
  gap: 0.28rem;
  padding: 0.9rem 1rem;
  border: 1px solid #263d52;
  border-radius: 16px;
  background: #17283a;
  color: #f8fbff;
  box-shadow: 0 20px 46px rgba(10, 22, 34, 0.28);
  pointer-events: none;
}

.context-help-tooltip-tag {
  color: #9fcce2;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.context-help-tooltip strong {
  font-family: "Sora", "Manrope", sans-serif;
  font-size: 0.94rem;
  line-height: 1.25;
}

.context-help-tooltip > span:last-child {
  color: #d7e3ec;
  font-size: 0.8rem;
  line-height: 1.48;
}

.context-help-guide[hidden],
.context-help-tooltip[hidden] {
  display: none !important;
}

.company-topbar-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  max-width: min(34vw, 340px);
  padding: 0.28rem 0.58rem 0.28rem 0.32rem;
  border: 1px solid color-mix(in srgb, var(--company-brand-color) 26%, #d8e3ef);
  border-radius: 999px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--company-brand-color) 10%, #ffffff), #ffffff 72%);
  box-shadow: 0 8px 18px rgba(15, 22, 29, 0.05);
}

.company-topbar-logo {
  width: 1.85rem;
  height: 1.85rem;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid color-mix(in srgb, var(--company-brand-color) 32%, #d8e3ef);
  color: var(--company-brand-color);
  font-family: "Sora", "Manrope", "Segoe UI", system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 900;
  overflow: hidden;
}

.company-topbar-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.18rem;
}

.company-topbar-copy {
  display: grid;
  min-width: 0;
  line-height: 1.02;
}

.company-topbar-copy small {
  color: #6c7b8d;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.company-topbar-copy strong {
  overflow: hidden;
  color: #182230;
  font-size: 0.78rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-search {
  position: relative;
  width: clamp(220px, 28vw, 390px);
  max-width: 100%;
}

.global-search-input {
  width: 100%;
  min-height: 2.18rem;
  padding: 0.4rem 2.1rem 0.4rem 2.05rem;
  border: 1px solid #cfd9e5;
  border-radius: 999px;
  background: #f7fafc;
  color: #182230;
  font-size: 0.86rem;
  font-weight: 600;
  outline: none;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.global-search-input::placeholder {
  color: #7a8a9d;
  font-weight: 600;
}

.global-search-input:focus {
  border-color: #84a5c5;
  background: #fff;
  box-shadow: 0 0 0 0.16rem rgba(54, 91, 123, 0.12);
}

.global-search-icon,
.global-search-clear {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.global-search-icon {
  left: 0.78rem;
  color: #63758a;
  pointer-events: none;
}

.global-search-clear {
  right: 0.42rem;
  width: 1.55rem;
  height: 1.55rem;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #65778b;
}

.global-search-clear:hover {
  background: #e9f0f7;
  color: #172335;
}

.global-search-panel {
  position: absolute;
  top: calc(100% + 0.42rem);
  right: 0;
  z-index: 1065;
  width: min(92vw, 520px);
  max-height: min(70vh, 520px);
  overflow: auto;
  padding: 0.42rem;
  border: 1px solid #d1deeb;
  border-radius: 18px;
  background:
    radial-gradient(420px 160px at 100% 0%, rgba(178, 226, 200, 0.18), rgba(178, 226, 200, 0)),
    linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  box-shadow: 0 18px 42px rgba(15, 22, 29, 0.16);
}

.global-search-empty {
  padding: 0.92rem;
  color: #65758a;
  font-size: 0.84rem;
  text-align: center;
}

.global-search-result {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 0.62rem;
  align-items: center;
  padding: 0.62rem;
  border: 1px solid transparent;
  border-radius: 14px;
  color: #203045;
  text-decoration: none;
}

.global-search-result:hover,
.global-search-result.active {
  border-color: #c8d7e5;
  background: #fff;
  color: #111827;
  box-shadow: 0 8px 18px rgba(15, 22, 29, 0.08);
}

.global-search-result-icon {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cfe0ed;
  background: #eef6f8;
  color: #1f6f83;
  font-size: 1rem;
}

.global-search-result-copy {
  min-width: 0;
  display: grid;
  gap: 0.12rem;
}

.global-search-result-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.global-search-result-top strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
}

.global-search-result-copy small {
  color: #65758a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-search-badge {
  flex: 0 0 auto;
  padding: 0.12rem 0.42rem;
  border-radius: 999px;
  background: #eef3f8;
  color: #36516c;
  font-size: 0.68rem;
  font-weight: 800;
}

.notification-menu {
  position: relative;
}

.notification-toggle {
  position: relative;
  width: 2.18rem;
  height: 2.18rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: #cfd9e5;
  background: #fff;
}

.notification-badge {
  position: absolute;
  top: -0.36rem;
  right: -0.36rem;
  min-width: 1.08rem;
  height: 1.08rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #d92d20;
  color: #fff;
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 0 0 2px #fff;
}

.notification-panel.offcanvas {
  width: min(94vw, 520px) !important;
  border-left: 1px solid #cad8e7;
  background: #f4f7fa;
  box-shadow: -20px 0 46px rgba(15, 22, 29, 0.14);
}

.notification-panel .notification-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 1rem 1.08rem;
  border-bottom: 1px solid #d7e2ee;
  background:
    radial-gradient(380px 120px at 0% 0%, rgba(178, 226, 200, 0.26), rgba(178, 226, 200, 0)),
    linear-gradient(180deg, #ffffff 0%, #f5f9fc 100%);
}

.notification-panel .notification-title {
  display: block;
  margin-top: 0.08rem;
  margin-bottom: 0;
  color: #172335;
  font-size: 1.08rem;
  font-weight: 750;
  line-height: 1.15;
}

.notification-panel .notification-head-actions {
  display: flex;
  align-items: center;
  gap: 0.54rem;
}

.notification-panel .notification-subtitle {
  display: block;
  margin-top: 0.16rem;
  color: #68798c;
  font-size: 0.76rem;
  font-weight: 600;
}

.notification-panel .notification-read-all {
  flex: 0 0 auto;
  border-radius: 999px;
  padding-inline: 0.66rem;
  font-size: 0.75rem;
}

.notification-panel .notification-body {
  display: block;
  padding: 0;
  background:
    linear-gradient(180deg, #f4f7fa 0%, #eef3f7 100%);
}

.notification-panel .notification-list {
  min-height: 100%;
  overflow: auto;
  padding: 0.86rem;
  background:
    linear-gradient(180deg, #f4f7fa 0%, #eef3f7 100%);
}

.notification-panel .notification-empty {
  margin: 0.1rem;
  padding: 1.15rem;
  border: 1px dashed #cfdbe7;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: #66768a;
  font-size: 0.85rem;
  text-align: center;
}

.notification-panel .notification-item {
  position: relative;
  display: grid;
  grid-template-columns: 4px 42px minmax(0, 1fr);
  gap: 0.74rem;
  align-items: stretch;
  margin-bottom: 0.64rem;
  padding: 0.76rem 0.84rem 0.76rem 0;
  border: 1px solid #dbe5ee;
  border-radius: 18px;
  color: #233247;
  text-decoration: none;
  background:
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 2px 8px rgba(15, 22, 29, 0.04);
}

.notification-panel .notification-item:hover {
  border-color: #bfd0df;
  background: #fff;
  color: #152235;
  box-shadow: 0 10px 22px rgba(15, 22, 29, 0.08);
  transform: translateY(-1px);
}

.notification-panel .notification-item.unread {
  background:
    linear-gradient(90deg, rgba(45, 143, 102, 0.1), rgba(255, 255, 255, 0.99) 32%);
  border-color: #bfdccc;
}

.notification-panel .notification-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef6f8;
  color: #1f6f83;
  border: 1px solid #cfe0ed;
  font-size: 1.02rem;
  align-self: center;
}

.notification-panel .notification-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.24rem;
  padding: 0.04rem 0;
}

.notification-panel .notification-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.42rem;
  order: 1;
}

.notification-panel .notification-event-pill {
  display: inline-flex;
  align-items: center;
  min-height: 1.15rem;
  padding: 0.08rem 0.42rem;
  border: 1px solid #cbd9e6;
  border-radius: 999px;
  background: #f3f7fb;
  color: #34475d;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.notification-panel .notification-copy strong {
  order: 2;
  color: #172335;
  font-size: 0.96rem;
  line-height: 1.28;
}

.notification-panel .notification-copy small {
  order: 3;
  margin-top: 0.08rem;
  color: #637389;
  display: -webkit-box;
  font-size: 0.84rem;
  line-height: 1.36;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notification-panel .notification-copy em {
  color: #7a8a9b;
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 650;
}

.notification-panel .notification-unread-dot {
  width: 4px;
  height: auto;
  margin: 0;
  border-radius: 18px 0 0 18px;
  background: transparent;
}

.notification-panel .notification-item.unread .notification-unread-dot {
  background: #2d8f66;
  box-shadow: none;
}

@media (max-width: 768px) {
  .notification-panel.offcanvas {
    width: 100vw !important;
  }

  .notification-panel .notification-head {
    padding: 0.78rem 0.82rem;
  }

  .notification-panel .notification-list {
    padding: 0.56rem;
  }

  .notification-panel .notification-item {
    grid-template-columns: 4px 38px minmax(0, 1fr);
    gap: 0.62rem;
    padding: 0.72rem 0.72rem 0.72rem 0;
  }
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #3a4250;
  font-size: 0.72rem;
  font-weight: 600;
  max-width: min(64vw, 560px);
}

.user-pill-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-trigger {
  border-color: var(--line-strong);
  color: #2d323a;
}

.page-content {
  width: 100%;
  max-width: 100%;
  padding: 0.82rem;
}

body.sidebar-collapsed .page-content,
html.sidebar-collapsed .page-content {
  padding-left: 1.02rem;
  padding-right: 1.02rem;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.62rem;
}

.section-tag {
  margin: 0;
  font-size: 0.66rem;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  font-weight: 700;
  color: #848b96;
}

.page-title {
  margin: 0.12rem 0 0;
  font-size: clamp(1.08rem, 2.05vw, 1.3rem);
  line-height: 1.2;
  font-weight: 700;
  color: #111214;
}

.page-subtitle {
  margin: 0.14rem 0 0;
  max-width: 62ch;
  color: #717987;
  font-size: 0.8rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: 0 1px 0 rgba(17, 19, 24, 0.02);
}

.btn {
  border-radius: 7px;
  font-weight: 600;
}

.btn-primary {
  background: #111214;
  border: 1px solid #111214;
  color: #fff;
}

.btn-primary:hover,
.btn-primary:focus {
  background: #000;
  border-color: #000;
}

.btn-ghost,
.btn-outline-secondary {
  background: #fff;
  border: 1px solid var(--line-strong);
  color: #1e232b;
}

.btn-ghost:hover,
.btn-outline-secondary:hover {
  background: #f6f7f9;
  border-color: var(--line-strong);
}

.form-control,
.form-select,
.form-control-color,
.choices__inner {
  min-height: 36px;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  color: #111214;
  background: #fff;
}

.form-control::placeholder {
  color: #8c949f;
}

.form-control:focus,
.form-select:focus,
.form-control-color:focus,
.btn:focus-visible {
  border-color: #aab2bf;
  box-shadow: 0 0 0 0.16rem rgba(17, 18, 20, 0.08);
}

.form-label,
.form-label.small,
.stack-controls label.small,
.stack-controls .small.fw-semibold {
  color: #596272 !important;
  font-size: 0.71rem !important;
  letter-spacing: 0.45px;
  text-transform: uppercase;
  font-weight: 700 !important;
}

.compact-toggle-row {
  padding: 0.1rem 0.12rem;
}

.compact-toggle-row .form-check-input {
  width: 2rem;
  height: 1rem;
  cursor: pointer;
}

#calendarCount {
  color: #4d5563;
  font-size: 0.72rem;
  font-weight: 600;
}

.calendar-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: 0.75rem;
  align-items: stretch;
  transition: grid-template-columns var(--ui-med);
}

.calendar-layout.filters-collapsed {
  grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr);
}

.calendar-side,
.calendar-main {
  min-width: 0;
}

.calendar-filter-panel {
  transition: padding var(--ui-fast), gap var(--ui-fast);
}

.calendar-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.calendar-filter-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.calendar-filter-panel.filters-collapsed {
  padding: 0.52rem 0.46rem !important;
}

.calendar-filter-panel.filters-collapsed .calendar-filter-head {
  margin-bottom: 0 !important;
  justify-content: center;
}

.calendar-filter-panel.filters-collapsed .section-tag {
  display: none;
}

.calendar-filter-panel.filters-collapsed .calendar-filter-toggle {
  width: 100%;
}

.calendar-filter-panel.filters-collapsed .calendar-filter-toggle .btn-label {
  display: none;
}

.calendar-filter-panel.filters-collapsed #calendarFiltersBody {
  display: none;
}

.stack-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.68rem;
  margin-bottom: 0.8rem;
  border: 1px solid var(--line);
  background: #fcfcfd;
}

.stack-controls > * {
  min-width: 0;
}

.control-w-xs {
  width: 90px;
}

.control-w-sm {
  width: 160px;
}

.control-w-md {
  width: 240px;
}

.stack-controls .form-control.form-control-sm,
.stack-controls .form-select.form-select-sm {
  max-width: 100%;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.8rem;
}

.kpi-card {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 1px solid #111214;
  border-radius: var(--radius-lg);
  padding: 0.56rem;
}

.kpi-card .label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.58px;
  font-weight: 700;
  color: #747c87;
}

.kpi-card .value {
  margin-top: 0.12rem;
  font-size: clamp(1.08rem, 2.1vw, 1.42rem);
  line-height: 1.1;
  font-weight: 700;
  color: #111214;
}

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

.board-col {
  min-height: 300px;
  padding: 0.52rem;
}

.board-col--ongoing {
  border-top: 2px solid var(--ok);
}

.board-col--future {
  border-top: 2px solid #111214;
}

.board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.52rem;
}

.board-head h3 {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.2;
  font-weight: 700;
}

.counter-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.14rem 0.54rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: #444d59;
  font-size: 0.72rem;
  font-weight: 700;
}

.trip-list {
  display: grid;
  gap: 0.48rem;
}

.trip-card {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0.42rem;
  box-shadow: none;
}

.trip-top {
  margin-bottom: 0.15rem;
}

.trip-destination {
  font-size: 0.91rem;
  line-height: 1.18;
  font-weight: 700;
  color: #111214;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.trip-link {
  color: inherit;
  text-decoration: none;
}

.trip-link:hover {
  text-decoration: underline;
}

.trip-destination .trip-inline-time {
  font-weight: 700;
}

.trip-dates {
  margin-top: 0.04rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: #7b838f;
  overflow-wrap: anywhere;
}

.trip-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.24rem;
  margin-bottom: 0.18rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0.07rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f7f8fa;
  color: #39414d;
  font-size: 0.64rem;
  font-weight: 600;
}

.trip-note {
  margin-bottom: 0.2rem;
  color: #596272;
  font-size: 0.74rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.trip-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.attachment-list {
  display: grid;
  gap: 0.42rem;
}

.attachment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.44rem 0.52rem;
  background: #fff;
}

.attachment-main {
  min-width: 0;
}

.attachment-name {
  display: inline-block;
  max-width: 100%;
  color: #1f2a37;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-name:hover {
  text-decoration: underline;
}

.attachment-meta {
  margin-top: 0.08rem;
  color: #69707d;
  font-size: 0.69rem;
}

.attachment-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}

.mission-document-upload {
  padding: 0.82rem;
  border: 1px solid #dbe6f1;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.mission-document-upload .form-label {
  margin-bottom: 0.28rem;
  color: #43546b;
  font-size: 0.74rem;
  font-weight: 850;
}

.mission-document-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.mission-document-summary span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.28rem 0.52rem;
  border: 1px solid #dbe6f1;
  border-radius: 999px;
  background: #f8fbff;
  color: #52637a;
  font-size: 0.72rem;
  font-weight: 750;
}

.mission-document-summary strong {
  color: #1d2d42;
}

.mission-document-list {
  gap: 0.55rem;
}

.mission-document-row {
  align-items: flex-start;
  padding: 0.7rem;
  border-color: #dbe6f1;
  border-radius: 15px;
  box-shadow: 0 8px 18px rgba(15, 22, 29, 0.045);
}

.mission-document-icon {
  display: inline-grid;
  flex: 0 0 auto;
  width: 2.15rem;
  height: 2.15rem;
  place-items: center;
  border: 1px solid #dbe6f1;
  border-radius: 12px;
  background: #eef6fb;
  color: #1f6b8f;
}

.mission-document-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.mission-document-type {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.44rem;
  border: 1px solid #d4e2ee;
  border-radius: 999px;
  background: #f2f7fb;
  color: #35506a;
  font-size: 0.66rem;
  font-weight: 850;
}

.mission-document-description {
  margin-top: 0.22rem;
  color: #334155;
  font-size: 0.8rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.mission-document-empty {
  padding: 0.85rem;
  border: 1px dashed #cbd8e6;
  border-radius: 15px;
  background: #fbfdff;
  color: #66778d;
  font-size: 0.84rem;
}

.btn-icon {
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.timeline {
  display: grid;
  gap: 0.65rem;
}

.timeline-month {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 2px solid #111214;
  border-radius: var(--radius-lg);
  padding: 0.56rem;
}

.timeline-title {
  margin: 0 0 0.42rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.58px;
  font-weight: 700;
  color: #757d88;
}

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

.member-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.62rem;
}

.member-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}

.member-name {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.2;
  font-weight: 700;
  color: #111214;
  overflow-wrap: anywhere;
}

.color-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.24);
}

.chart-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0.7rem;
}

.chart-panel {
  min-height: 320px;
  padding: 0.72rem;
}

.chart-panel canvas {
  width: 100% !important;
  height: 290px !important;
}

.table-responsive,
.table {
  border-radius: 10px;
  overflow: hidden;
}

.table > :not(caption) > * > * {
  border-color: var(--line);
}

.table thead th {
  background: #f7f8fa;
  color: #414a56;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.audit-table td,
.audit-table th {
  vertical-align: middle;
}

.audit-table tbody tr:hover {
  background: #fbfcfd;
}

.audit-day-row td {
  padding: 0.35rem 0.45rem;
  background: #f4f6f8;
  border-top: 1px solid var(--line) !important;
}

.audit-day-toggle {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  font-weight: 700;
  color: #253041;
  padding: 0.18rem 0.28rem;
}

.audit-day-toggle .badge {
  margin-left: auto;
}

.audit-summary {
  min-width: 180px;
  max-width: 640px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.audit-actor-name {
  color: #1f2937;
  font-weight: 700;
}

.audit-summary-main {
  color: #1f2937;
  font-weight: 600;
}

.audit-meta {
  margin-top: 0.12rem;
  font-size: 0.68rem;
  color: #6b7280;
  line-height: 1.2;
}

.audit-kpi-latest {
  font-size: 0.95rem !important;
  line-height: 1.25;
}

.audit-details-pre {
  max-height: min(56vh, 440px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.68rem;
  background: #f7f8fa;
  color: #2d3745;
  font-size: 0.78rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.audit-details-content {
  display: grid;
  gap: 0.62rem;
}

.audit-detail-section {
  border: 1px solid #d7e1ec;
  border-radius: 10px;
  background: #f9fbfe;
  padding: 0.58rem 0.62rem;
}

.audit-detail-title {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #223244;
}

.audit-subsection + .audit-subsection {
  margin-top: 0.52rem;
}

.audit-subtitle {
  margin-bottom: 0.28rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.45px;
  color: #54657b;
}

.audit-summary-block {
  margin-top: 0.46rem;
  padding: 0.44rem 0.5rem;
  border: 1px dashed #cfdbea;
  border-radius: 8px;
  background: #ffffff;
  font-size: 0.78rem;
  color: #1f2f41;
  overflow-wrap: anywhere;
}

.audit-kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.44rem;
}

.audit-kv-item {
  border: 1px solid #d9e3ef;
  border-radius: 8px;
  background: #fff;
  padding: 0.38rem 0.44rem;
  min-width: 0;
}

.audit-kv-key {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.46px;
  color: #5a6c83;
}

.audit-kv-value {
  margin-top: 0.18rem;
  font-size: 0.78rem;
  line-height: 1.28;
  color: #1c2b3d;
  overflow-wrap: anywhere;
}

.audit-json-mini {
  margin: 0;
  max-height: 180px;
  overflow: auto;
  border: 1px solid #d8e3ef;
  border-radius: 7px;
  padding: 0.34rem 0.4rem;
  background: #f7f9fc;
  font-size: 0.71rem;
  line-height: 1.34;
  white-space: pre-wrap;
  word-break: break-word;
}

.audit-changes-wrap {
  border: 1px solid #d8e3ef;
  border-radius: 9px;
}

.audit-changes-table thead th {
  background: #eef3f9;
  color: #3f5168;
}

.audit-changes-table td {
  vertical-align: top;
}

@media (max-width: 768px) {
  .audit-kv-grid {
    grid-template-columns: 1fr;
  }
}

.swatch {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid var(--line);
  display: inline-block;
  vertical-align: middle;
}

.choices__inner {
  padding: 0.14rem 0.3rem;
}

.choices__list--multiple .choices__item {
  border: 1px solid var(--line);
  background: #f7f8fa;
  color: #38424f;
  border-radius: 999px;
  font-size: 0.68rem;
}

.fc {
  --fc-border-color: var(--line);
  --fc-page-bg-color: transparent;
  --fc-neutral-bg-color: transparent;
  --fc-today-bg-color: rgba(0, 0, 0, 0.05);
}

.fc .fc-toolbar-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #111214;
}

.fc .fc-button {
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-weight: 600;
  background: #fff;
  color: #1f252d;
  padding: 0.2rem 0.5rem;
  font-size: 0.74rem;
}

.fc .fc-button-primary {
  background: #fff;
  border-color: var(--line-strong);
  color: #1f252d;
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
  background: #111214;
  border-color: #111214;
  color: #fff;
}

.fc .fc-event {
  border-radius: 5px;
  cursor: pointer;
}

.fc .fc-daygrid-day-events {
  margin-top: 1px;
  margin-bottom: 2px;
}

.fc .fc-daygrid-event-harness {
  margin-top: 1px;
}

.fc .fc-daygrid-day-frame {
  min-height: 88px;
  height: auto;
}

.fc .fc-event-title,
.fc .fc-event-main {
  white-space: normal;
  word-break: break-word;
}

.fc .fc-event-main {
  padding: 1px 3px;
}

.fc .fc-event-card {
  display: grid;
  gap: 1px;
  line-height: 1.15;
}

.fc .fc-event-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
}

.fc .fc-event-top .fc-event-dest {
  min-width: 0;
  flex: 1 1 auto;
}

.fc .fc-event-dest {
  font-size: 0.67rem;
  font-weight: 700;
}

.fc .fc-status-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0 5px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  background: rgba(255, 255, 255, 0.92);
  color: #1d2735;
  font-size: 0.46rem;
  font-weight: 800;
  letter-spacing: 0.35px;
  text-transform: uppercase;
  line-height: 1.25;
  white-space: nowrap;
}

.fc .fc-status-tag--approved {
  background: rgba(214, 246, 228, 0.96);
  border-color: rgba(25, 135, 84, 0.38);
  color: #0f5132;
}

.fc .fc-status-tag--unconfirmed {
  background: rgba(255, 224, 226, 0.96);
  border-color: rgba(220, 53, 69, 0.38);
  color: #842029;
}

.fc .fc-activity-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  width: fit-content;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #111214;
  font-size: 0.54rem;
  font-weight: 700;
  line-height: 1.15;
}

.fc .fc-event-sub {
  font-size: 0.57rem;
  opacity: 0.9;
}

.calendar-compact .fc .fc-toolbar-title {
  font-size: 0.82rem;
}

.calendar-compact .fc .fc-button {
  padding: 0.14rem 0.42rem;
  font-size: 0.69rem;
}

.calendar-compact .fc .fc-daygrid-day-number {
  font-size: 0.72rem;
  padding: 1px 4px;
}

.calendar-compact .fc .fc-event-main {
  padding: 0 2px;
}

.calendar-compact .fc .fc-event-dest {
  font-size: 0.61rem;
}

.calendar-compact .fc .fc-status-tag {
  padding: 0 4px;
  font-size: 0.42rem;
}

.calendar-compact .fc .fc-activity-pill {
  font-size: 0.5rem;
  padding: 0 4px;
}

.cal-activity-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f5f7f9;
  color: #2f3744;
  font-size: 0.6rem;
  font-weight: 600;
}

.fc .past-event {
  opacity: 0.55;
}

.modal-content {
  border-radius: 10px;
  border: 1px solid var(--line);
}

.offcanvas {
  background: #fff;
  color: #111214;
}

.offcanvas .offcanvas-header {
  border-bottom: 1px solid var(--line);
}

.offcanvas .offcanvas-body {
  padding-top: 0.8rem;
}

.mobile-brand-logo {
  width: auto;
  height: auto;
  max-width: clamp(210px, 52vw, 300px);
  max-height: 90px;
  object-fit: contain;
  display: block;
}

.toast-zone {
  z-index: 1080;
}

.error-wrap {
  min-height: calc(100vh - 6rem);
  display: grid;
  place-items: center;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: radial-gradient(1200px 400px at 50% -10%, #ffffff, var(--bg));
}

.login-card {
  width: min(440px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
}

.login-logo {
  width: auto;
  height: auto;
  max-width: clamp(240px, 52vw, 360px);
  max-height: 98px;
  object-fit: contain;
  display: block;
}

.error-card {
  width: min(560px, 96%);
  padding: 1.6rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  text-align: center;
}

.error-code {
  font-size: clamp(2.4rem, 8vw, 4rem);
  line-height: 1;
  color: var(--danger);
  font-weight: 800;
}

/* Global visual refresh: light, minimal, higher readability */
body {
  background:
    radial-gradient(900px 260px at 10% -40%, #ffffff 0%, rgba(255, 255, 255, 0) 70%),
    radial-gradient(900px 240px at 90% -40%, #ffffff 0%, rgba(255, 255, 255, 0) 70%),
    var(--bg);
}

.app-layout {
  gap: 0.58rem;
  padding: 0.58rem;
}

.sidebar {
  margin: 0;
  height: calc(100vh - 1.16rem);
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 6px 20px rgba(15, 20, 26, 0.05);
}

.content-wrap {
  min-height: calc(100vh - 1.16rem);
}

.topbar {
  top: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 6px 16px rgba(15, 20, 26, 0.04);
  padding: 0.72rem 0.92rem;
}

.topbar-title {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.page-content {
  padding: 0.86rem 0.08rem 1.2rem;
}

body.sidebar-collapsed .page-content,
html.sidebar-collapsed .page-content {
  padding-left: 0.08rem;
  padding-right: 0.08rem;
}

.section-tag {
  color: #798393;
  letter-spacing: 0.5px;
}

.page-title {
  font-size: clamp(1.14rem, 2.2vw, 1.42rem);
  letter-spacing: -0.015em;
}

.page-subtitle {
  color: #667486;
  font-size: 0.82rem;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(15, 20, 26, 0.04);
}

.btn {
  border-radius: 10px;
  min-height: 36px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.btn-sm {
  min-height: 32px;
}

.btn-primary {
  background: #11161d;
  border-color: #11161d;
}

.btn-primary:hover,
.btn-primary:focus {
  background: #0a0f14;
  border-color: #0a0f14;
}

.btn-ghost,
.btn-outline-secondary {
  color: #1a212c;
  border-color: #cfd7e3;
  background: #fff;
}

.btn-ghost:hover,
.btn-outline-secondary:hover {
  background: #f7f9fc;
  border-color: #c1cbda;
}

.stack-controls {
  background: #fff;
  border-radius: 14px;
  padding: 0.72rem;
  gap: 0.56rem;
}

.form-control,
.form-select,
.form-control-color,
.choices__inner {
  min-height: 38px;
  border-radius: 10px;
}

.board {
  gap: 0.82rem;
}

.board-col {
  padding: 0.64rem;
  min-height: 320px;
}

.board-col--ongoing,
.board-col--future {
  border-top-width: 1px;
}

.trip-card {
  border-radius: 11px;
  padding: 0.52rem;
}

.trip-destination {
  font-size: 0.92rem;
  letter-spacing: -0.01em;
}

.trip-dates {
  font-size: 0.7rem;
  color: #707b8b;
}

.chip {
  border-radius: 999px;
  background: #f6f8fb;
  border-color: #d9e1ec;
  color: #334152;
}

.timeline-month {
  border-left-width: 1px;
  border-radius: 14px;
}

.member-card {
  border-radius: 12px;
}

.kpi-card {
  border-left-width: 1px;
  border-radius: 12px;
  padding: 0.68rem;
}

.kpi-card .value {
  letter-spacing: -0.02em;
}

.table {
  border: 1px solid var(--line);
  background: #fff;
}

.table thead th {
  background: #f5f7fb;
  color: #4a5667;
  font-size: 0.69rem;
}

.calendar-layout {
  gap: 0.82rem;
}

.calendar-filter-panel {
  border-radius: 14px;
}

.fc .fc-toolbar-title {
  font-size: 0.94rem;
  font-weight: 700;
}

.fc .fc-event {
  border-radius: 7px;
}

.fc .fc-event-dest {
  font-size: 0.66rem;
}

.fc .fc-event-sub {
  font-size: 0.56rem;
}

.modal-content {
  border-radius: 14px;
}

.login-shell {
  background:
    radial-gradient(800px 260px at 50% -15%, #ffffff, rgba(255, 255, 255, 0)),
    var(--bg);
}

.login-card {
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(15, 20, 26, 0.08);
}

/* Uniformity pass: all boxes/sections share the same visual language */
:is(.panel, .kpi-card, .trip-card, .timeline-month, .member-card, .attachment-row, .error-card, .login-card) {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(15, 20, 26, 0.04);
}

.board-col--ongoing,
.board-col--future,
.timeline-month,
.kpi-card {
  border-top: 1px solid var(--line) !important;
  border-left: 1px solid var(--line) !important;
}

.page-content > section,
.page-content > div.calendar-layout,
.page-content > div.error-wrap {
  margin-bottom: 0.82rem;
}

.page-content > section:last-child,
.page-content > div.calendar-layout:last-child,
.page-content > div.error-wrap:last-child {
  margin-bottom: 0;
}

.panel h3,
.timeline-title,
.board-head h3 {
  letter-spacing: -0.01em;
  color: #11161d;
}

.table-responsive {
  border-radius: 12px;
}

/* Motion and micro-interactions */
@keyframes uiFadeSlideIn {
  from {
    opacity: 0;
    transform: translate3d(0, 10px, 0) scale(0.995);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.ui-reveal {
  opacity: 0;
  transform: translate3d(0, 10px, 0) scale(0.995);
}

.ui-reveal.is-in {
  animation: uiFadeSlideIn var(--ui-slow) both;
  animation-delay: var(--reveal-delay, 0ms);
}

.nav-link-side,
.btn,
.chip,
.counter-pill,
.trip-card,
.kpi-card,
.timeline-month,
.member-card,
.attachment-row,
.table tbody tr {
  transition:
    transform var(--ui-fast),
    box-shadow var(--ui-med),
    border-color var(--ui-fast),
    background-color var(--ui-fast),
    color var(--ui-fast);
}

.nav-link-side:hover {
  transform: translateX(2px);
}

.nav-link-side.active {
  box-shadow: inset 0 0 0 1px rgba(17, 22, 29, 0.04);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(15, 20, 26, 0.08);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus-visible {
  outline: none;
}

:is(.trip-card, .kpi-card, .timeline-month, .member-card, .attachment-row):hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 20, 26, 0.08);
  border-color: #c9d3e1;
}

.chip:hover,
.counter-pill:hover {
  border-color: #c7d2df;
  background: #f1f5fa;
}

.table tbody tr:hover {
  transform: translateY(-1px);
}

.topbar,
.sidebar {
  transition: box-shadow var(--ui-med), border-color var(--ui-fast), background-color var(--ui-fast);
}

.topbar:hover,
.sidebar:hover {
  box-shadow: 0 10px 24px rgba(15, 20, 26, 0.06);
}

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

body.motion-reduce .ui-reveal,
body.motion-reduce .ui-reveal.is-in {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}

@media (max-width: 1200px) {
  .dashboard-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .calendar-layout,
  .calendar-layout.filters-collapsed {
    grid-template-columns: 1fr;
  }
}

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

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

  body.sidebar-collapsed .app-layout,
  html.sidebar-collapsed .app-layout {
    grid-template-columns: 1fr;
  }

  .page-content {
    padding: 0.84rem;
  }

  .control-w-xs,
  .control-w-sm,
  .control-w-md {
    width: 100%;
  }

  .stack-controls .ms-auto {
    margin-left: 0 !important;
  }
}

@media (max-width: 768px) {
  .topbar {
    padding: 0.62rem 0.78rem;
    align-items: flex-start;
  }

  .topbar-title {
    font-size: 0.96rem;
  }

  .page-subtitle {
    display: none;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .global-search {
    width: 100%;
    flex: 1 0 100%;
  }

  .global-search-panel {
    left: 0;
    right: auto;
    width: 100%;
  }

  .stack-controls {
    align-items: stretch;
  }

  .stack-controls .btn,
  .stack-controls .form-control,
  .stack-controls .form-select,
  .stack-controls .small {
    width: 100%;
  }

  .page-head .btn {
    width: 100%;
  }

  .attachment-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .attachment-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* Aesthetic v2: login + dashboard + calendar */
.topbar-title,
.page-title,
.board-head h3,
.login-title,
.login-hero-title,
.fc .fc-toolbar-title {
  font-family: "Sora", "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* Login */
body.login-page {
  background:
    radial-gradient(1200px 520px at 10% -15%, #fff4dc 0%, rgba(255, 244, 220, 0) 62%),
    radial-gradient(900px 380px at 100% 110%, #d8efe5 0%, rgba(216, 239, 229, 0) 62%),
    #eef3f8;
}

.login-shell {
  padding: clamp(0.9rem, 2.5vw, 1.8rem);
}

.login-stage {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 1rem;
  align-items: stretch;
}

.login-brand-panel {
  border-radius: 22px;
  padding: 1.45rem 1.3rem;
  border: 1px solid rgba(15, 22, 29, 0.08);
  background:
    radial-gradient(520px 160px at 6% 0%, rgba(255, 218, 153, 0.36), rgba(255, 218, 153, 0)),
    radial-gradient(540px 180px at 100% 100%, rgba(102, 176, 142, 0.28), rgba(102, 176, 142, 0)),
    linear-gradient(156deg, #0f1d2b 0%, #162534 60%, #1f2f40 100%);
  color: #eef4fb;
  box-shadow: 0 20px 42px rgba(15, 22, 29, 0.22);
  display: grid;
  align-content: center;
  gap: 0.8rem;
}

.login-brand-panel .login-logo {
  max-width: clamp(270px, 56vw, 420px);
  max-height: 118px;
  filter: brightness(0) invert(1);
}

.login-kicker {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.08);
  color: #f3f7fd;
  padding: 0.18rem 0.62rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-hero-title {
  margin: 0;
  font-size: clamp(1.2rem, 2.6vw, 1.84rem);
  line-height: 1.16;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.login-hero-subtitle {
  margin: 0;
  color: rgba(238, 244, 251, 0.88);
  font-size: 0.9rem;
  max-width: 44ch;
}

.login-feature-list {
  display: grid;
  gap: 0.44rem;
  margin-top: 0.24rem;
}

.login-feature-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(238, 244, 251, 0.96);
  font-size: 0.8rem;
  font-weight: 600;
}

.login-feature-item i {
  width: 1.32rem;
  height: 1.32rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
}

.login-card {
  width: 100%;
  border-radius: 22px;
  border: 1px solid #d8e2ed;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  box-shadow: 0 18px 40px rgba(15, 22, 29, 0.12);
  padding: 1.2rem 1.1rem;
}

.login-card-head {
  margin-bottom: 0.45rem;
}

.login-title {
  margin: 0;
  font-size: 1.16rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.login-subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: #667588;
}

.login-page .form-label {
  color: #4f5e72 !important;
}

.login-guest-btn i {
  margin-right: 0.2rem;
}

/* Dashboard */
.dashboard-head {
  margin-bottom: 0.72rem;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  border: 1px solid #d7e1ec;
  background:
    radial-gradient(420px 140px at 0% 0%, rgba(255, 223, 169, 0.35), rgba(255, 223, 169, 0)),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.dashboard-head .section-tag {
  color: #5f6f85;
}

.dashboard-head .page-title {
  font-size: clamp(1.2rem, 2.8vw, 1.58rem);
}

.dashboard-controls {
  border-radius: 16px;
  border-color: #d9e2ee;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.96));
  box-shadow: 0 8px 20px rgba(15, 22, 29, 0.05);
}

.dashboard-company-strip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.72rem;
  min-height: 4.25rem;
  margin-bottom: 0.72rem;
  padding: 0.72rem 1rem;
  border: 1px solid color-mix(in srgb, var(--company-brand-color) 24%, #d8e3ef);
  border-radius: 18px;
  background:
    radial-gradient(440px 120px at 0% 0%, color-mix(in srgb, var(--company-brand-color) 14%, transparent), transparent 68%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 10px 22px rgba(15, 22, 29, 0.055);
  overflow: hidden;
}

.dashboard-company-logo {
  width: 3rem;
  height: 3rem;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  background: #ffffff;
  border: 1px solid color-mix(in srgb, var(--company-brand-color) 34%, #d8e3ef);
  color: var(--company-brand-color);
  font-family: "Sora", "Manrope", "Segoe UI", system-ui, sans-serif;
  font-size: 1.15rem;
  font-weight: 900;
  box-shadow: 0 10px 20px rgba(15, 22, 29, 0.06);
  overflow: hidden;
}

.dashboard-company-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.32rem;
}

.dashboard-company-copy {
  display: grid;
  gap: 0.08rem;
  min-width: 0;
}

.dashboard-company-copy span {
  color: #617187;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-company-copy strong {
  overflow: hidden;
  color: #172232;
  font-family: "Sora", "Manrope", "Segoe UI", system-ui, sans-serif;
  font-size: clamp(1rem, 2.2vw, 1.26rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-company-copy small {
  color: #6b7b8f;
  font-size: 0.76rem;
  font-weight: 700;
}

.dashboard-company-accent {
  position: absolute;
  inset: auto 0 0;
  height: 4px;
  background: linear-gradient(90deg, var(--company-brand-color), color-mix(in srgb, var(--company-brand-color) 35%, #ffffff));
}

.dashboard-actions-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.62rem;
}

.dashboard-action-card {
  display: flex;
  align-items: center;
  gap: 0.58rem;
  min-width: 0;
  padding: 0.72rem 0.78rem;
  border: 1px solid #d8e2ed;
  border-left-width: 4px;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  color: #26384d;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(15, 22, 29, 0.05);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.dashboard-action-card:hover {
  transform: translateY(-1px);
  color: #172536;
  border-color: #bfd0df;
  box-shadow: 0 12px 24px rgba(15, 22, 29, 0.08);
}

.dashboard-action-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: #eef4fa;
  color: #38566f;
}

.dashboard-action-body {
  display: grid;
  gap: 0.04rem;
  min-width: 0;
}

.dashboard-action-body strong {
  font-size: 1.2rem;
  line-height: 1;
  color: #132235;
}

.dashboard-action-body span {
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.15;
}

.dashboard-action-body small {
  color: #697a8d;
  font-size: 0.68rem;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-action-card--danger {
  border-left-color: #c94a4a;
}

.dashboard-action-card--danger .dashboard-action-icon {
  background: #fff1f1;
  color: #af3030;
}

.dashboard-action-card--warning {
  border-left-color: #d49a2a;
}

.dashboard-action-card--warning .dashboard-action-icon {
  background: #fff7e8;
  color: #996b18;
}

.dashboard-action-card--primary {
  border-left-color: #276b98;
}

.dashboard-action-card--primary .dashboard-action-icon {
  background: #edf7ff;
  color: #245f86;
}

.dashboard-action-card--info {
  border-left-color: #2d8f66;
}

.dashboard-action-card--info .dashboard-action-icon {
  background: #edf9f3;
  color: #247552;
}

.dashboard-action-card--muted {
  border-left-color: #9aabba;
}

.dashboard-board {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.95rem;
}

.dashboard-board.dashboard-board--no-drafts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-column {
  border-radius: 18px;
  border: 1px solid #d8e2ed !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.98));
  box-shadow: 0 10px 24px rgba(15, 22, 29, 0.06);
  min-width: 0;
  transition: padding 0.18s ease;
}

.dashboard-column.board-col--draft {
  border-top: 1px solid #d8e2ed !important;
  border-left: 4px solid #6d7a8a !important;
}

.dashboard-column.board-col--ongoing {
  border-top: 1px solid #d8e2ed !important;
  border-left: 4px solid #2d8f66 !important;
}

.dashboard-column.board-col--future {
  border-top: 1px solid #d8e2ed !important;
  border-left: 4px solid #c58b2d !important;
}

.dashboard-column .board-head {
  margin-bottom: 0.62rem;
}

.board-head-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
}

.dashboard-collapse-btn {
  width: 1.72rem;
  height: 1.72rem;
  border: 1px solid #c8d5e4;
  border-radius: 9px;
  background: #ffffff;
  color: #2f4460;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.dashboard-collapse-btn:hover {
  border-color: #a9bdd3;
  background: #f2f7fd;
}

.dashboard-collapse-btn i {
  font-size: 0.76rem;
}

.dashboard-column .counter-pill {
  background: #ffffff;
  border-color: #cfd9e4;
}

.dashboard-column.is-collapsed {
  padding: 0.5rem 0.36rem;
  overflow: hidden;
}

.dashboard-column.is-collapsed .trip-list {
  display: none;
}

.dashboard-column.is-collapsed .board-head {
  min-height: 220px;
  margin-bottom: 0;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.34rem;
}

.dashboard-column.is-collapsed .board-head h3 {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-align: center;
  line-height: 1;
  margin: 0;
  font-size: 0.78rem;
}

.dashboard-column.is-collapsed .board-head-tools {
  flex-direction: column;
  gap: 0.3rem;
}

.dashboard-column.is-collapsed .counter-pill {
  min-width: 1.78rem;
  justify-content: center;
  padding: 0.14rem 0.24rem;
  font-size: 0.68rem;
}

.dashboard-trip-card {
  border-radius: 14px;
  border-color: #d6dfeb;
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(15, 22, 29, 0.06);
}

.dashboard-trip-card:hover {
  border-color: #bfcddf;
}

.dashboard-column .trip-card.ui-reveal {
  opacity: 1;
  transform: none;
}

.dashboard-column .trip-card.ui-reveal.is-in {
  animation: none;
}

.mission-form-modal,
.dashboard-mission-modal {
  border-radius: 16px;
  border: 1px solid #d8e3ef;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 251, 255, 0.99));
  box-shadow: 0 16px 30px rgba(15, 22, 29, 0.12);
}

.mission-form-dialog {
  --bs-modal-width: min(1240px, 96vw);
}

.mission-form-modal .modal-header,
.dashboard-mission-modal .modal-header {
  align-items: flex-start;
  padding: 0.58rem 0.78rem;
  border-bottom: 1px solid #d9e3ef;
  background:
    radial-gradient(420px 120px at 0% 0%, rgba(170, 214, 196, 0.24), rgba(170, 214, 196, 0)),
    linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.mission-form-modal .modal-title,
.dashboard-mission-modal .modal-title {
  margin: 0.12rem 0 0;
  font-size: 0.98rem;
  color: #243549;
}

.dashboard-mission-modal-subtitle {
  margin-top: 0.08rem;
  font-size: 0.76rem;
  line-height: 1.28;
}

.mission-form-modal .modal-body,
.dashboard-mission-modal .modal-body {
  padding: 0.66rem 0.78rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.96));
}

.mission-form-modal .modal-footer,
.dashboard-mission-modal .modal-footer {
  padding: 0.56rem 0.78rem;
  border-top: 1px solid #d9e3ef;
  background: #f7fafd;
}

.mission-form-grid,
.dashboard-mission-grid {
  row-gap: 0.56rem;
}

.dashboard-mission-section-title {
  padding-bottom: 0.22rem;
  border-bottom: 1px dashed #d3deea;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.56px;
  text-transform: uppercase;
  color: #5f6f85;
}

.mission-form-section-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.18rem 0 0.08rem;
  color: #40546c;
  font-size: 0.76rem;
  font-weight: 800;
}

.mission-form-section-title::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: #0d7f4f;
  box-shadow: 0 0 0 4px rgba(13, 127, 79, 0.12);
}

.mission-form-status-field {
  padding: 0.58rem;
  border: 1px solid #cbdceb;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #f7fbff);
}

.mission-form-status-field .form-check {
  padding-top: 0.18rem;
}

.mission-form-grid .form-label,
.dashboard-mission-grid .form-label {
  margin-bottom: 0.22rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #495a71;
}

.mission-form-grid .form-control,
.mission-form-grid .form-select,
.mission-form-grid .choices__inner,
.dashboard-mission-grid .form-control,
.dashboard-mission-grid .form-select,
.dashboard-mission-grid .choices__inner {
  min-height: 32px;
  border-color: #bfd0e1;
}

.mission-form-grid .choices__inner,
.dashboard-mission-grid .choices__inner {
  max-height: 72px;
  overflow: auto;
}

.mission-form-grid .form-control:focus,
.mission-form-grid .form-select:focus,
.dashboard-mission-grid .form-control:focus,
.dashboard-mission-grid .form-select:focus {
  border-color: #8ea5c0;
  box-shadow: 0 0 0 0.14rem rgba(73, 104, 142, 0.18);
}

.mission-form-grid textarea.form-control,
.dashboard-mission-grid textarea.form-control {
  min-height: 40px;
  resize: vertical;
}

@media (max-width: 991.98px) {
  .mission-form-dialog {
    --bs-modal-width: 96vw;
  }

  .mission-form-modal .modal-header,
  .mission-form-modal .modal-body,
  .mission-form-modal .modal-footer {
    padding-left: 0.7rem;
    padding-right: 0.7rem;
  }
}

/* Calendar */
.calendar-head {
  margin-bottom: 0.72rem;
  padding: 0.88rem 0.96rem;
  border-radius: 18px;
  border: 1px solid #d7e2ef;
  background:
    radial-gradient(420px 120px at 100% 0%, rgba(167, 215, 191, 0.28), rgba(167, 215, 191, 0)),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.calendar-layout {
  gap: 0.95rem;
}

.calendar-filter-panel {
  border-radius: 18px;
  border-color: #d8e3ef;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.98));
  box-shadow: 0 10px 24px rgba(15, 22, 29, 0.05);
}

.calendar-surface {
  border-radius: 18px;
  border-color: #d8e3ef;
  background:
    radial-gradient(540px 180px at 100% 0%, rgba(255, 222, 168, 0.2), rgba(255, 222, 168, 0)),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.fc .fc-toolbar.fc-header-toolbar {
  margin-bottom: 0.8rem;
}

.fc .fc-daygrid-day-frame {
  min-height: 96px;
}

.fc .fc-daygrid-day-number {
  color: #536175;
  font-weight: 700;
  font-size: 0.78rem;
}

.fc .fc-event {
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(15, 22, 29, 0.12);
}

.fc .fc-event-main {
  padding: 2px 4px;
}

.fc .fc-event-dest {
  font-size: 0.68rem;
}

.calendar-fallback-card {
  border-radius: 13px;
  border-color: #d5dfeb;
  box-shadow: 0 4px 12px rgba(15, 22, 29, 0.06);
}

/* Aesthetic v3: activity + statistics + users */
:is(.activity-head, .stats-head, .users-head) {
  margin-bottom: 0.72rem;
  padding: 0.88rem 0.96rem;
  border-radius: 18px;
  border: 1px solid #d7e2ef;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.activity-head {
  background:
    radial-gradient(440px 130px at 0% 0%, rgba(255, 220, 162, 0.28), rgba(255, 220, 162, 0)),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.stats-head {
  background:
    radial-gradient(420px 130px at 100% 0%, rgba(161, 219, 191, 0.28), rgba(161, 219, 191, 0)),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.users-head {
  background:
    radial-gradient(430px 130px at 0% 0%, rgba(177, 206, 255, 0.22), rgba(177, 206, 255, 0)),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.activity-controls,
.users-controls {
  border-radius: 16px;
  border-color: #d8e3ef;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.98));
  box-shadow: 0 8px 20px rgba(15, 22, 29, 0.05);
}

.role-permissions-panel {
  padding: 0.95rem;
  border-radius: 18px;
  border-color: #d8e3ef;
  background:
    radial-gradient(520px 150px at 100% 0%, rgba(31, 107, 143, 0.08), rgba(31, 107, 143, 0)),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 10px 24px rgba(15, 22, 29, 0.055);
}

.role-permissions-head {
  display: flex;
  justify-content: space-between;
  gap: 0.85rem;
  align-items: flex-start;
  margin-bottom: 0.85rem;
}

.role-permissions-head h3 {
  color: #172335;
  font-weight: 850;
}

.role-permissions-settings {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.role-setting-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.44rem 0.62rem;
  border: 1px solid #c9d8e7;
  border-radius: 999px;
  background: #ffffff;
  color: #314156;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.role-setting-chip i {
  color: #1f6b8f;
}

.role-setting-chip.is-locked {
  border-color: #efd1d1;
  background: #fff7f7;
  color: #8f3d3d;
}

.role-setting-chip.is-locked i {
  color: #b14949;
}

.role-permissions-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.72rem;
}

.role-permission-card {
  padding: 0.8rem;
  border: 1px solid #d8e3ef;
  border-top: 4px solid #94a3b8;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 18px rgba(15, 22, 29, 0.045);
}

.role-permission-card p {
  min-height: 2.35rem;
  margin: 0.4rem 0 0.55rem;
  color: #5d6c7e;
  font-size: 0.82rem;
  line-height: 1.35;
}

.role-permission-card ul {
  display: grid;
  gap: 0.34rem;
  margin: 0;
  padding-left: 1rem;
  color: #34445a;
  font-size: 0.79rem;
  line-height: 1.34;
}

.role-permission-title {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  color: #172335;
}

.role-permission-title strong {
  font-size: 0.96rem;
  font-weight: 900;
}

.role-dot {
  width: 0.58rem;
  height: 0.58rem;
  border-radius: 999px;
  background: #94a3b8;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.16);
}

.role-permission-card.is-admin {
  border-top-color: #b14949;
}

.role-permission-card.is-admin .role-dot {
  background: #b14949;
  box-shadow: 0 0 0 4px rgba(177, 73, 73, 0.16);
}

.role-permission-card.is-supervisor {
  border-top-color: #172335;
}

.role-permission-card.is-supervisor .role-dot {
  background: #172335;
  box-shadow: 0 0 0 4px rgba(23, 35, 53, 0.14);
}

.role-permission-card.is-backoffice {
  border-top-color: #2f6f73;
}

.role-permission-card.is-backoffice .role-dot {
  background: #2f6f73;
  box-shadow: 0 0 0 4px rgba(47, 111, 115, 0.16);
}

.role-permission-card.is-operator {
  border-top-color: #1f6b8f;
}

.role-permission-card.is-operator .role-dot {
  background: #1f6b8f;
  box-shadow: 0 0 0 4px rgba(31, 107, 143, 0.16);
}

.role-permission-card.is-viewer {
  border-top-color: #2d8f66;
}

.role-permission-card.is-viewer .role-dot {
  background: #2d8f66;
  box-shadow: 0 0 0 4px rgba(45, 143, 102, 0.16);
}

.role-permissions-form {
  margin-top: 0.85rem;
  padding: 0.78rem;
  border: 1px solid #d8e3ef;
  border-radius: 16px;
  background:
    radial-gradient(420px 130px at 0% 0%, rgba(45, 143, 102, 0.08), rgba(45, 143, 102, 0)),
    #ffffff;
}

.role-permissions-form-head {
  display: flex;
  justify-content: space-between;
  gap: 0.85rem;
  align-items: flex-start;
  margin-bottom: 0.72rem;
}

.role-permissions-form-head h4 {
  color: #172335;
  font-weight: 850;
}

.role-permission-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.role-permissions-form .settings-block {
  border: 1px solid #e0e8f2;
}

.activity-kpi-row .kpi-card:nth-child(1) {
  border-left-color: #2d8f66;
}

.activity-kpi-row .kpi-card:nth-child(2) {
  border-left-color: #238a5f;
}

.activity-kpi-row .kpi-card:nth-child(3) {
  border-left-color: #2473a6;
}

.activity-kpi-row .kpi-card:nth-child(4) {
  border-left-color: #b14949;
}

.activity-kpi-row .kpi-card:nth-child(5) {
  border-left-color: #6c7789;
}

.stats-kpi-row .kpi-card {
  border-left-color: #3b4b62;
}

.stats-kpi-row-secondary .kpi-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.98));
}

.stats-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.stats-overview-grid,
.stats-work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 0.85rem;
  align-items: stretch;
  margin-bottom: 0.85rem;
}

.stats-command-panel,
.stats-attention-panel,
.stats-next-panel,
.stats-workload-panel {
  padding: 0.92rem;
  border: 1px solid #d8e3ef;
  border-radius: 18px;
  background:
    radial-gradient(420px 150px at 100% 0%, rgba(31, 107, 143, 0.08), rgba(31, 107, 143, 0)),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 10px 24px rgba(15, 22, 29, 0.055);
}

.stats-command-panel h3,
.stats-attention-panel h3,
.stats-panel-head h3 {
  margin: 0;
  color: #172335;
  font-size: 1rem;
  font-weight: 850;
}

.stats-command-value {
  margin-top: 0.5rem;
  color: #172335;
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
}

.stats-command-panel p {
  max-width: 680px;
  margin: 0.55rem 0 0;
  color: #5d6c7e;
  font-size: 0.92rem;
  line-height: 1.45;
}

.stats-command-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.82rem;
}

.stats-command-strip span {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.34rem 0.58rem;
  border: 1px solid #d8e3ef;
  border-radius: 999px;
  background: #fff;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 750;
}

.stats-command-strip b {
  color: #172335;
}

.stats-attention-list,
.stats-next-list,
.stats-workload-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.stats-attention-card {
  display: flex;
  gap: 0.62rem;
  align-items: flex-start;
  padding: 0.68rem;
  border: 1px solid #d8e3ef;
  border-left: 4px solid #94a3b8;
  border-radius: 14px;
  background: #fff;
}

.stats-attention-card i {
  color: #4b5b70;
  font-size: 1.1rem;
}

.stats-attention-card strong,
.stats-attention-card span {
  display: block;
}

.stats-attention-card strong {
  color: #172335;
  font-size: 0.9rem;
}

.stats-attention-card span {
  margin-top: 0.1rem;
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.35;
}

.stats-attention-card.is-ok {
  border-left-color: #2d8f66;
}

.stats-attention-card.is-ok i {
  color: #2d8f66;
}

.stats-attention-card.is-warning {
  border-left-color: #c58b2d;
  background: linear-gradient(180deg, #fff 0%, #fff9ed 100%);
}

.stats-attention-card.is-warning i {
  color: #b7791f;
}

.stats-attention-card.is-danger {
  border-left-color: #b14949;
  background: linear-gradient(180deg, #fff 0%, #fff5f5 100%);
}

.stats-attention-card.is-danger i {
  color: #b14949;
}

.stats-attention-card.is-info {
  border-left-color: #276b98;
}

.stats-attention-card.is-info i {
  color: #276b98;
}

.stats-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.65rem;
}

.stats-next-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 0.7rem;
  align-items: stretch;
  padding: 0.68rem;
  border: 1px solid #d8e3ef;
  border-radius: 15px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.stats-next-row:hover {
  border-color: #b8c9dc;
  box-shadow: 0 10px 22px rgba(15, 22, 29, 0.075);
  transform: translateY(-1px);
}

.stats-next-date {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 62px;
  border-radius: 13px;
  background: #eef4f8;
  color: #172335;
}

.stats-next-date strong {
  font-size: 1.05rem;
  font-weight: 900;
}

.stats-next-date span {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.stats-next-main {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: flex-start;
  min-width: 0;
}

.stats-next-main strong,
.stats-next-main span:not(.badge) {
  display: block;
}

.stats-next-main strong {
  color: #172335;
  font-size: 0.92rem;
}

.stats-next-main span:not(.badge) {
  margin-top: 0.16rem;
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.35;
}

.stats-workload-row {
  display: grid;
  gap: 0.38rem;
  padding: 0.65rem;
  border: 1px solid #d8e3ef;
  border-radius: 14px;
  background: #fff;
}

.stats-workload-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: center;
}

.stats-workload-meta strong {
  color: #172335;
  font-size: 0.9rem;
}

.stats-workload-meta span {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
}

.stats-workload-bar {
  overflow: hidden;
  height: 0.48rem;
  border-radius: 999px;
  background: #e8eef5;
}

.stats-workload-bar span {
  display: block;
  height: 100%;
  min-width: 0.4rem;
  border-radius: inherit;
  background: linear-gradient(90deg, #1f6b8f, #2d8f66);
}

.activity-table-panel,
.users-table-panel {
  border-radius: 18px;
  border-color: #d8e3ef;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 251, 255, 0.99));
}

.activity-table-wrap,
.users-table-wrap {
  border-radius: 14px;
  border: 1px solid #d8e2ee;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.activity-table-wrap .table thead th,
.users-table-wrap .table thead th {
  background: #f3f6fb;
  color: #4a5a6d;
}

.activity-table tbody tr:hover,
.users-table tbody tr:hover {
  background: #f9fbfe;
}

.stats-chart-grid {
  gap: 0.95rem;
}

.stats-chart-panel {
  border-radius: 18px;
  border: 1px solid #d8e3ef;
  background:
    radial-gradient(420px 140px at 100% 0%, rgba(255, 225, 173, 0.16), rgba(255, 225, 173, 0)),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 10px 24px rgba(15, 22, 29, 0.06);
}

.stats-chart-panel h3 {
  color: #263448;
}

.stats-chart-panel canvas {
  height: 300px !important;
}

.users-table td {
  color: #2d3a4e;
}

.users-table .btn-icon {
  border-radius: 9px;
}

.activity-modal-content .modal-header,
.user-modal-content .modal-header {
  background: #f7f9fc;
}

.activity-modal-content .modal-footer,
.user-modal-content .modal-footer {
  background: #fbfcfe;
}

@media (max-width: 991.98px) {
  .login-stage {
    grid-template-columns: 1fr;
  }

  .login-brand-panel {
    min-height: 220px;
  }

  :is(.activity-head, .stats-head, .users-head) {
    padding: 0.78rem 0.8rem;
  }

  .stats-overview-grid,
  .stats-work-grid {
    grid-template-columns: 1fr;
  }

  .role-permissions-head {
    flex-direction: column;
  }

  .role-permissions-settings {
    justify-content: flex-start;
  }

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

  .role-permission-settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .activity-head-actions {
    width: 100%;
  }

  .activity-head-actions .btn {
    flex: 1 1 0;
  }

  .stats-chart-panel canvas {
    height: 260px !important;
  }

  .stats-head-actions,
  .stats-head-actions .btn,
  .stats-panel-head,
  .stats-panel-head .btn {
    width: 100%;
  }

  .stats-panel-head,
  .stats-next-main,
  .stats-workload-meta {
    flex-direction: column;
  }

  .stats-next-row {
    grid-template-columns: 1fr;
  }

  .stats-next-date {
    place-items: start;
    padding: 0.55rem 0.65rem;
  }
}

/* Aesthetic v4: concluse + missione + persone + impostazioni + backup */
:is(.archive-head, .mission-head, .people-head, .settings-head, .backup-head) {
  margin-bottom: 0.72rem;
  padding: 0.88rem 0.96rem;
  border-radius: 18px;
  border: 1px solid #d7e2ef;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.archive-head {
  background:
    radial-gradient(430px 130px at 0% 0%, rgba(178, 205, 238, 0.2), rgba(178, 205, 238, 0)),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.mission-head {
  background:
    radial-gradient(430px 130px at 100% 0%, rgba(160, 218, 190, 0.24), rgba(160, 218, 190, 0)),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.people-head {
  background:
    radial-gradient(430px 130px at 0% 0%, rgba(174, 205, 255, 0.24), rgba(174, 205, 255, 0)),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.settings-head {
  background:
    radial-gradient(420px 130px at 100% 0%, rgba(205, 211, 223, 0.28), rgba(205, 211, 223, 0)),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.backup-head {
  background:
    radial-gradient(430px 130px at 0% 0%, rgba(176, 220, 206, 0.26), rgba(176, 220, 206, 0)),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.archive-controls,
.backup-controls {
  border-radius: 16px;
  border-color: #d8e3ef;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(245, 250, 255, 0.97));
  box-shadow: 0 8px 20px rgba(15, 22, 29, 0.05);
}

.archive-timeline .timeline-month {
  border-left-color: #3a4a62;
}

.archive-modal-content .modal-header,
.archive-attachments-modal-content .modal-header,
.mission-modal-content .modal-header,
.person-modal-content .modal-header {
  background: #f7f9fc;
}

.archive-modal-content .modal-footer,
.archive-attachments-modal-content .modal-footer,
.mission-modal-content .modal-footer,
.person-modal-content .modal-footer {
  background: #fbfcfe;
}

.mission-form-modal .modal-header {
  background:
    radial-gradient(420px 120px at 0% 0%, rgba(170, 214, 196, 0.24), rgba(170, 214, 196, 0)),
    linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.mission-form-modal .modal-footer {
  background: #f7fafd;
}

.archive-attachment-upload .btn,
.mission-attachment-upload .btn {
  min-width: 126px;
}

.mission-kpi-row .kpi-card:nth-child(1) {
  border-left-color: #4c5668;
}

.mission-kpi-row .kpi-card:nth-child(2) {
  border-left-color: #2d8f66;
}

.mission-kpi-row .kpi-card:nth-child(3) {
  border-left-color: #2f7aa3;
}

.mission-kpi-row .kpi-card:nth-child(4) {
  border-left-color: #8564a8;
}

.mission-summary-panel,
.mission-attachments-panel,
.mission-comments-panel,
.mission-tasks-panel,
.mission-orders-panel,
.mission-kpi-panel,
.mission-team-panel,
.mission-notes-panel,
.today-panel {
  border-radius: 18px;
  border-color: #d8e3ef;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 251, 255, 0.99));
}

.mission-history-modal {
  border: 1px solid #d8e3ef;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 251, 255, 0.99));
  box-shadow: 0 18px 36px rgba(15, 22, 29, 0.14);
}

.mission-history-modal .modal-header {
  align-items: flex-start;
  border-bottom: 1px solid #d9e3ef;
  background:
    radial-gradient(420px 120px at 0% 0%, rgba(170, 214, 196, 0.24), rgba(170, 214, 196, 0)),
    linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.mission-history-modal .modal-body {
  background: #f7fafd;
}

.mission-quick-panel {
  border-radius: 18px;
  border-color: #d8e3ef;
  background:
    radial-gradient(520px 150px at 100% 0%, rgba(178, 226, 200, 0.2), rgba(178, 226, 200, 0)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 251, 255, 0.99));
}

.mission-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.5rem;
}

.mission-quick-item {
  padding: 0.5rem 0.56rem;
  border: 1px solid #d5e0ec;
  border-radius: 12px;
  background: #fff;
}

.mission-quick-item .label {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.42px;
  color: #62748a;
}

.mission-quick-item .value {
  margin-top: 0.14rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: #223449;
  line-height: 1.2;
}

.mission-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.68rem;
  align-items: start;
}

.mission-tabs-wrap {
  border-radius: 18px;
  border-color: #d8e3ef;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.mission-tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.mission-tabs-nav .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  border: 1px solid #d4dfeb;
  border-radius: 999px;
  padding: 0.46rem 0.72rem;
  color: #41546a;
  background: #ffffff;
  font-size: 0.82rem;
  font-weight: 800;
}

.mission-tabs-nav .nav-link:hover {
  border-color: #b8c8d8;
  color: #213349;
  background: #f5f8fb;
}

.mission-tabs-nav .nav-link.active {
  border-color: #1f6b8f;
  background: #eaf5fb;
  color: #164d69;
  box-shadow: inset 0 0 0 1px rgba(31, 107, 143, 0.08);
}

.mission-main-col,
.mission-side-col {
  display: grid;
  gap: 0.68rem;
}

.mission-side-col {
  position: static;
  grid-template-columns: minmax(0, 1fr);
}

.mission-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.mission-summary-item {
  display: flex;
  align-items: flex-start;
  gap: 0.52rem;
  padding: 0.48rem 0.52rem;
  border: 1px solid #d9e3ef;
  border-radius: 12px;
  background: #fff;
}

.mission-summary-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid #d4e0ec;
  background: #f4f8fd;
  color: #305578;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.mission-note-block {
  padding: 0.48rem 0.54rem;
  border: 1px dashed #d9e3ef;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.84);
}

.mission-comments-list {
  display: grid;
  gap: 0.52rem;
}

.mission-task-progress {
  min-width: min(100%, 220px);
  color: #53657a;
  font-size: 0.78rem;
  font-weight: 700;
}

.mission-task-progress .progress {
  height: 7px;
  margin-top: 0.32rem;
  background: #e5edf5;
}

.mission-task-progress .progress-bar {
  background: linear-gradient(90deg, #2d8f66, #4aa987);
}

.mission-task-list {
  display: grid;
  gap: 0.55rem;
}

.mission-task-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) minmax(230px, 310px);
  gap: 0.62rem;
  align-items: start;
  padding: 0.68rem;
  border: 1px solid #d9e3ef;
  border-radius: 15px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.mission-task-row.is-done {
  border-color: #c9e3d6;
  background: linear-gradient(180deg, #fbfffd 0%, #f2fbf6 100%);
}

.mission-task-check {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cfe0ed;
  background: #eef6f8;
  color: #1f6f83;
  font-size: 1.12rem;
}

.mission-task-row.is-done .mission-task-check {
  border-color: #a8d7bf;
  background: #e8f8ef;
  color: #1f7a52;
}

.mission-task-main {
  min-width: 0;
}

.mission-task-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  align-items: center;
}

.mission-task-top strong {
  color: #172335;
  line-height: 1.28;
}

.mission-task-row.is-done .mission-task-top strong {
  text-decoration: line-through;
  color: #607187;
}

.mission-task-note {
  margin-top: 0.28rem;
  color: #62748a;
  font-size: 0.84rem;
  line-height: 1.35;
}

.mission-task-editor {
  display: grid;
  grid-template-columns: minmax(95px, 1fr) minmax(120px, 1.1fr) auto;
  gap: 0.38rem;
  align-items: center;
}

.mission-task-readonly {
  display: flex;
  justify-content: flex-end;
}

.mission-task-details {
  margin-top: 0.42rem;
}

.mission-task-details summary {
  cursor: pointer;
  color: #365b7b;
  font-size: 0.78rem;
  font-weight: 700;
}

.mission-task-edit-form {
  display: grid;
  gap: 0.42rem;
  margin-top: 0.42rem;
  padding: 0.5rem;
  border: 1px dashed #cfdae7;
  border-radius: 12px;
  background: #fff;
}

.mission-task-create {
  padding: 0.72rem;
  border: 1px solid #d9e3ef;
  border-radius: 15px;
  background: #f7fbff;
}

.mission-orders-list {
  display: grid;
  gap: 0.62rem;
}

.mission-order-card {
  padding: 0.74rem;
  border: 1px solid #d9e3ef;
  border-radius: 15px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.mission-order-top {
  display: flex;
  justify-content: space-between;
  gap: 0.65rem;
  align-items: flex-start;
}

.mission-order-card h4 {
  margin: 0 0 0.4rem;
  font-size: 0.98rem;
  color: #172335;
}

.mission-order-material {
  margin-top: 0.58rem;
  padding: 0.62rem 0.72rem;
  border: 1px solid #d9e3ef;
  border-radius: 13px;
  background: #fff;
  color: #2f3f53;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.mission-note-form {
  padding: 0.62rem;
  border: 1px solid #d9e3ef;
  border-radius: 14px;
  background: #fbfdff;
}

@media (max-width: 991.98px) {
  .mission-task-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .mission-task-editor,
  .mission-task-readonly {
    grid-column: 2;
    justify-content: flex-start;
  }
}

@media (max-width: 575.98px) {
  .role-permissions-grid {
    grid-template-columns: 1fr;
  }

  .role-setting-chip {
    width: 100%;
    justify-content: center;
    white-space: normal;
  }

  .role-permissions-form-head {
    flex-direction: column;
  }

  .role-permissions-form-head .btn {
    width: 100%;
  }

  .mission-task-editor {
    grid-template-columns: 1fr;
  }
}

.mission-comment-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 0.58rem;
  align-items: start;
  padding: 0.62rem;
  border: 1px solid #d9e3ef;
  border-radius: 14px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.mission-comment-avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cfe0ed;
  background: #eef6f8;
  color: #1f6f83;
}

.mission-comment-content {
  min-width: 0;
}

.mission-comment-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.38rem;
  font-size: 0.82rem;
  color: #26384d;
}

.mission-comment-top span {
  color: #6b7c8f;
  font-size: 0.76rem;
}

.mission-comment-body {
  margin-top: 0.18rem;
  color: #2f3f53;
  font-size: 0.9rem;
  line-height: 1.42;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.mission-comment-actions {
  display: flex;
  justify-content: flex-end;
}

.mission-comment-form {
  padding: 0.62rem;
  border: 1px solid #d9e3ef;
  border-radius: 14px;
  background: #fbfdff;
}

.mission-kpi-row-compact {
  margin-bottom: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mission-team-panel .trip-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.36rem;
}

.mission-summary-item .trip-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
}

.today-head {
  margin-bottom: 0.72rem;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  border: 1px solid #d7e1ec;
  background:
    radial-gradient(500px 160px at 100% 0%, rgba(178, 226, 200, 0.24), rgba(178, 226, 200, 0)),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.today-kpi-row {
  margin-bottom: 0.72rem;
}

.today-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.36fr);
  gap: 0.78rem;
  align-items: start;
}

.today-main-col,
.today-side-col {
  display: grid;
  gap: 0.78rem;
}

.today-panel-primary {
  border-left: 4px solid #2d8f66;
}

.today-list {
  display: grid;
  gap: 0.48rem;
}

.today-list-compact {
  gap: 0.4rem;
}

.today-trip-card {
  padding: 0.56rem 0.62rem;
  border: 1px solid #d8e3ef;
  border-radius: 13px;
  background: #ffffff;
  box-shadow: 0 6px 14px rgba(15, 22, 29, 0.045);
}

.today-trip-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.58rem;
}

.today-trip-main .badge {
  flex: 0 0 auto;
}

.today-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.68rem;
}

.today-subtitle {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  margin-bottom: 0.42rem;
  color: #35465d;
  font-size: 0.76rem;
  font-weight: 800;
}

.today-people {
  display: flex;
  flex-wrap: wrap;
  gap: 0.34rem;
}

.today-task-list {
  display: grid;
  gap: 0.48rem;
}

.today-task-list.compact {
  gap: 0.4rem;
}

.today-task-card {
  padding: 0.62rem;
  border: 1px solid #d8e3ef;
  border-radius: 14px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 6px 14px rgba(15, 22, 29, 0.045);
}

.today-task-main {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 0.55rem;
  align-items: start;
}

.today-task-check {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.today-task-title {
  color: #172335;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.24;
}

.today-task-trip {
  display: block;
  margin-top: 0.08rem;
  font-size: 0.82rem;
}

.today-task-note {
  margin-top: 0.24rem;
  color: #65758a;
  font-size: 0.8rem;
  line-height: 1.34;
}

.today-task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
  align-items: center;
  margin-top: 0.52rem;
  padding-left: 2.8rem;
}

.today-side-col .today-task-card {
  padding: 0.56rem;
}

.today-side-col .today-task-meta {
  padding-left: 0;
}

.today-empty {
  padding: 0.78rem;
  border: 1px dashed #d3dfeb;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: #5a687c;
  font-size: 0.82rem;
}

.today-empty.compact {
  padding: 0.56rem;
  font-size: 0.78rem;
}

.mission-history-list {
  display: grid;
  gap: 0.62rem;
}

.mission-history-item {
  position: relative;
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 0.54rem;
}

.mission-history-item:not(:last-child)::before {
  position: absolute;
  top: 18px;
  bottom: -0.5rem;
  left: 6px;
  width: 1px;
  background: #d8e3ef;
  content: "";
}

.mission-history-dot {
  width: 12px;
  height: 12px;
  margin-top: 0.38rem;
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(100, 116, 139, 0.12);
  z-index: 1;
}

.mission-history-content {
  min-width: 0;
  padding: 0.56rem 0.62rem;
  border: 1px solid #d8e3ef;
  border-radius: 13px;
  background: #ffffff;
}

.mission-history-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.32rem;
}

.mission-history-date,
.mission-history-meta {
  color: #5a687c;
  font-size: 0.72rem;
}

.mission-history-summary {
  color: #1c2b3d;
  font-size: 0.86rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.mission-history-changes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.34rem;
  margin-top: 0.48rem;
}

.mission-history-change {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  max-width: 100%;
  padding: 0.26rem 0.38rem;
  border: 1px solid #d8e3ef;
  border-radius: 999px;
  background: #f4f8fd;
  color: #42546b;
  font-size: 0.72rem;
}

.mission-history-change strong {
  color: #17283d;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.mission-attachments-head h3 {
  color: #263448;
  letter-spacing: -0.01em;
}

.people-grid {
  gap: 0.78rem;
}

.people-grid .member-card {
  border-color: #d8e3ef;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 251, 255, 0.99));
}

.member-card--clickable {
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.member-card--clickable:hover,
.member-card--clickable:focus-visible {
  border-color: rgba(31, 107, 143, 0.38);
  box-shadow: 0 16px 34px rgba(31, 45, 61, 0.10);
  transform: translateY(-1px);
  outline: none;
}

.member-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  color: #617085;
  font-size: 0.82rem;
}

.member-meta-row span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.person-detail-modal {
  border: 1px solid rgba(191, 209, 229, 0.9);
  border-radius: 24px;
  overflow: hidden;
}

.person-detail-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #d8e3ef;
  border-radius: 18px;
  background:
    radial-gradient(420px 160px at 0% 0%, rgba(31, 107, 143, 0.10), transparent 70%),
    linear-gradient(180deg, #ffffff, #f8fbff);
}

.person-detail-identity {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
}

.person-detail-avatar {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72), 0 10px 24px rgba(31, 45, 61, 0.14);
  flex: 0 0 auto;
}

.person-detail-identity h3 {
  margin: 0;
  color: #172335;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.person-detail-muted {
  color: #64748b;
  font-size: 0.9rem;
}

.person-detail-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0.85rem 0;
}

.person-detail-metrics article {
  border: 1px solid #d8e3ef;
  border-radius: 16px;
  padding: 0.85rem;
  background: #fff;
}

.person-detail-metrics span,
.person-detail-metrics small {
  display: block;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
}

.person-detail-metrics strong {
  display: block;
  margin: 0.18rem 0;
  color: #173b55;
  font-size: 1.42rem;
  line-height: 1;
}

.person-detail-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.person-detail-section {
  border: 1px solid #d8e3ef;
  border-radius: 18px;
  background: #fff;
  padding: 0.8rem;
  min-width: 0;
}

.person-detail-section-head {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: baseline;
  margin-bottom: 0.55rem;
}

.person-detail-section-head h4 {
  margin: 0;
  font-size: 0.98rem;
  color: #172335;
}

.person-detail-section-head span {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 800;
}

.person-detail-trip {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.7rem 0;
  color: inherit;
  text-decoration: none;
  border-top: 1px solid rgba(216, 227, 239, 0.85);
}

.person-detail-trip:first-of-type {
  border-top: 0;
}

.person-detail-trip strong {
  color: #172335;
  overflow-wrap: anywhere;
}

.person-detail-trip:hover strong {
  color: #1f6b8f;
}

.person-detail-trip-meta {
  color: #64748b;
  text-align: right;
  font-size: 0.78rem;
  font-weight: 750;
  white-space: nowrap;
}

.person-detail-trip-meta span {
  display: block;
}

.person-detail-empty {
  color: #64748b;
  padding: 0.8rem 0;
  border-top: 1px solid rgba(216, 227, 239, 0.85);
}

.settings-panel {
  border-radius: 18px;
  border-color: #d8e3ef;
  background:
    radial-gradient(520px 180px at 100% 0%, rgba(255, 221, 166, 0.18), rgba(255, 221, 166, 0)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 251, 255, 0.99));
}

.settings-panel-title {
  color: #263448;
}

.settings-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.settings-form {
  max-width: 620px;
}

.company-profile-layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.company-profile-preview {
  display: grid;
  gap: 0.68rem;
  padding: 0.9rem;
  border: 1px solid #d8e3ef;
  border-radius: 16px;
  background:
    radial-gradient(320px 120px at 100% 0%, rgba(31, 107, 143, 0.11), rgba(31, 107, 143, 0)),
    linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 8px 18px rgba(15, 22, 29, 0.05);
}

.company-logo-preview {
  width: 82px;
  height: 82px;
  border: 2px solid #1f6b8f;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #ffffff;
  color: #172232;
  font-family: "Sora", "Manrope", "Segoe UI", system-ui, sans-serif;
  font-size: 1.7rem;
  font-weight: 900;
}

.company-logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.company-preview-name {
  color: #172232;
  font-family: "Sora", "Manrope", "Segoe UI", system-ui, sans-serif;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.company-preview-slug {
  color: #64748b;
  font-size: 0.78rem;
}

.company-brand-strip {
  height: 9px;
  border-radius: 999px;
  background: #1f6b8f;
}

.company-preview-contact {
  display: grid;
  gap: 0.36rem;
  color: #4e6076;
  font-size: 0.78rem;
}

.company-preview-contact div {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  min-width: 0;
}

.company-preview-contact span {
  overflow-wrap: anywhere;
}

.company-profile-form {
  min-width: 0;
}

.company-profile-form .form-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #495a71;
}

.company-logo-upload {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.55rem;
  border: 1px solid #d8e3ef;
  border-radius: 14px;
  background: #f8fbff;
}

.company-logo-upload .form-control {
  background: #ffffff;
}

.company-advanced-toggle {
  color: #52647a;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.company-advanced-toggle:hover,
.company-advanced-toggle:focus {
  color: #172232;
  text-decoration: underline;
}

.company-color-input {
  max-width: 54px;
  min-height: 40px;
  padding: 0.26rem;
}

.settings-block {
  padding: 0.5rem 0.58rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.settings-block .fw-semibold {
  color: #2a3a4f;
  letter-spacing: -0.01em;
}

.settings-actions {
  padding-top: 0.16rem;
}

.backup-table-panel {
  border-radius: 18px;
  border-color: #d8e3ef;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 251, 255, 0.99));
}

.backup-diag-panel {
  border-radius: 18px;
  border-color: #d8e3ef;
  background:
    radial-gradient(520px 180px at 100% 0%, rgba(170, 211, 255, 0.14), rgba(170, 211, 255, 0)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 251, 255, 0.99));
}

.backup-diag-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.52rem;
}

.backup-diag-item {
  border: 1px solid #d5e0ec;
  border-radius: 12px;
  background: #fff;
  padding: 0.46rem 0.54rem;
  display: grid;
  gap: 0.12rem;
}

.backup-diag-item .label {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.35px;
  text-transform: uppercase;
  color: #5e7289;
}

.backup-diag-item .value {
  font-size: 0.81rem;
  font-weight: 700;
  color: #24384f;
  line-height: 1.2;
  word-break: break-word;
}

.backup-table-wrap {
  border-radius: 14px;
  border: 1px solid #d8e2ee;
}

.backup-table thead th {
  background: #f3f6fb;
  color: #4a5a6d;
}

.backup-table tbody tr:hover {
  background: #f9fbfe;
}

@media (max-width: 991.98px) {
  :is(.archive-head, .mission-head, .people-head, .settings-head, .backup-head) {
    padding: 0.78rem 0.8rem;
  }

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

  .mission-layout {
    grid-template-columns: 1fr;
  }

  .mission-side-col {
    position: static;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .archive-head-actions,
  .mission-head-actions,
  .backup-head-actions {
    width: 100%;
  }

  .archive-head-actions .btn,
  .mission-head-actions .btn,
  .backup-head-actions .btn {
    flex: 1 1 0;
  }

  .settings-actions {
    flex-direction: column;
    align-items: stretch !important;
  }

  .company-profile-layout {
    grid-template-columns: 1fr;
  }

  .mission-summary-grid,
  .mission-quick-grid,
  .backup-diag-grid,
  .mission-kpi-row-compact,
  .mission-side-col {
    grid-template-columns: 1fr;
  }
}

/* Aesthetic v5 micro-pass: spacing + font-size consistency */
.page-content {
  --tm-section-gap: 0.84rem;
}

.page-content > section,
.page-content > div.calendar-layout,
.page-content > div.error-wrap {
  margin-bottom: var(--tm-section-gap);
}

.page-content > section:last-child,
.page-content > div.calendar-layout:last-child,
.page-content > div.error-wrap:last-child {
  margin-bottom: 0;
}

.page-head {
  gap: 0.72rem;
  margin-bottom: 0.72rem;
}

:is(
  .dashboard-head,
  .calendar-head,
  .activity-head,
  .stats-head,
  .users-head,
  .archive-head,
  .mission-head,
  .people-head,
  .settings-head,
  .backup-head
) {
  padding: 0.9rem 0.98rem;
}

.section-tag {
  font-size: 0.67rem;
  letter-spacing: 0.62px;
}

.page-title {
  font-size: clamp(1.16rem, 2.15vw, 1.44rem);
  line-height: 1.18;
}

.page-subtitle {
  margin-top: 0.18rem;
  max-width: 68ch;
  font-size: 0.82rem;
  line-height: 1.34;
}

.stack-controls {
  gap: 0.56rem;
  padding: 0.74rem;
  border-radius: 16px;
}

.stack-controls .btn,
.stack-controls .form-control,
.stack-controls .form-select {
  min-height: 34px;
}

.kpi-card {
  padding: 0.7rem 0.72rem;
}

.kpi-card .label {
  font-size: 0.67rem;
}

.kpi-card .value {
  margin-top: 0.14rem;
  font-size: clamp(1.06rem, 1.9vw, 1.32rem);
  line-height: 1.15;
}

.panel h3,
.board-head h3,
.timeline-title {
  font-size: 0.9rem;
  line-height: 1.24;
}

.table thead th {
  padding: 0.62rem 0.56rem;
  font-size: 0.68rem;
  letter-spacing: 0.52px;
}

.table > :not(caption) > * > * {
  padding: 0.56rem 0.52rem;
}

.modal-header,
.modal-footer {
  padding: 0.78rem 0.9rem;
}

.modal-body {
  padding: 0.9rem;
}

@media (max-width: 991.98px) {
  .page-content {
    --tm-section-gap: 0.78rem;
  }

  :is(
    .dashboard-head,
    .calendar-head,
    .activity-head,
    .stats-head,
    .users-head,
    .archive-head,
    .mission-head,
    .people-head,
    .settings-head,
    .backup-head
  ) {
    padding: 0.8rem 0.82rem;
  }
}

@media (max-width: 768px) {
  .page-content {
    --tm-section-gap: 0.72rem;
  }

  .page-head {
    gap: 0.58rem;
  }

  .page-title {
    font-size: clamp(1.04rem, 5.2vw, 1.24rem);
  }

  .kpi-card {
    padding: 0.64rem 0.66rem;
  }

  .modal-header,
  .modal-footer,
  .modal-body {
    padding: 0.72rem 0.76rem;
  }
}

/* Aesthetic v6: contrast/accessibility pass */
body {
  color: #0d131a;
}

.section-tag {
  color: #5d6878;
}

.page-subtitle {
  color: #556376;
}

.form-label,
.form-label.small,
.stack-controls label.small,
.stack-controls .small.fw-semibold {
  color: #445164 !important;
}

.small.text-secondary,
.text-secondary {
  color: #4e5c70 !important;
}

.kpi-card .label,
.timeline-title,
.trip-dates,
.audit-meta,
.attachment-meta {
  color: #5a687c;
}

.table thead th {
  color: #36475b;
  background: #eef3f9;
}

.table tbody td {
  color: #1a2736;
}

.chip {
  color: #2c3a4f;
  background: #f1f6fc;
  border-color: #ccd8e6;
}

.btn-ghost,
.btn-outline-secondary {
  color: #162130;
  border-color: #b7c5d8;
}

.btn-ghost:hover,
.btn-outline-secondary:hover {
  color: #0f1724;
  border-color: #9eb0c8;
  background: #f1f5fb;
}

.form-control,
.form-select,
.form-control-color,
.choices__inner {
  border-color: #b8c4d6;
}

.form-control:focus,
.form-select:focus,
.form-control-color:focus,
.btn:focus-visible {
  border-color: #7e95b3;
  box-shadow: 0 0 0 0.16rem rgba(57, 88, 127, 0.2);
}

/* Workflow + checklist + availability */
.trip-meta .badge {
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.mission-checklists-panel .progress {
  background: #e8eef6;
}

.mission-checklists-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.mission-checklist-col {
  min-width: 0;
}

.mission-checklists-panel .progress-bar {
  background: #2f7aa3;
}

.mission-checklists-panel .form-check-input {
  cursor: pointer;
}

.mission-checklists-panel .form-check-input:disabled {
  cursor: not-allowed;
}

.chip-person {
  border-color: #6c8fb8;
  background: linear-gradient(180deg, #eaf2fb 0%, #ddebf9 100%);
  color: #17283d;
  font-weight: 700;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.65) inset;
}

.chip-person i {
  color: #214b79;
}

.chip-person:hover {
  border-color: #587faa;
  background: linear-gradient(180deg, #dceafb 0%, #cfe2f8 100%);
}

.btn-create-mission {
  background: #11161d !important;
  border: 1px solid #11161d !important;
  color: #ffffff !important;
}

.btn-create-mission:hover,
.btn-create-mission:focus {
  background: #0b1118 !important;
  border-color: #11161d !important;
  color: #ffffff !important;
}

.btn-create-activity {
  background: #2f7aa3 !important;
  border: 1px solid #2f7aa3 !important;
  color: #ffffff !important;
}

.btn-create-activity:hover,
.btn-create-activity:focus {
  background: #245f7d !important;
  border-color: #245f7d !important;
  color: #ffffff !important;
}

.mission-form-grid .js-time-toggle-wrap,
.dashboard-mission-grid .js-time-toggle-wrap {
  margin-top: 0.1rem;
  padding: 0.44rem 0.58rem;
  border: 1px dashed #bfd0e1;
  border-radius: 10px;
  background: #f6f9fc;
}

.mission-form-grid .js-time-toggle-wrap .form-check-label,
.dashboard-mission-grid .js-time-toggle-wrap .form-check-label {
  color: #324964;
}

.mission-form-grid .form-control[readonly],
.dashboard-mission-grid .form-control[readonly] {
  background-color: #f4f7fb;
  color: #31465f;
}

.mission-form-grid .form-label,
.dashboard-mission-grid .form-label {
  margin-bottom: 0.24rem;
  font-size: 0.72rem;
  letter-spacing: 0.2px;
  text-transform: none;
}

.mission-form-grid .form-control,
.mission-form-grid .form-select,
.dashboard-mission-grid .form-control,
.dashboard-mission-grid .form-select {
  min-height: 36px;
}

.mission-form-modal .modal-body,
.dashboard-mission-modal .modal-body {
  overflow-x: clip;
}

.mission-form-modal .mission-form-grid,
.dashboard-mission-modal .dashboard-mission-grid {
  --bs-gutter-x: 0.56rem;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

.mission-form-grid .choices,
.dashboard-mission-grid .choices {
  width: 100%;
  min-width: 0;
}

.fc .fc-event-dest {
  font-size: 0.72rem;
  line-height: 1.22;
}

.fc .fc-event-sub {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 0.58rem;
  line-height: 1.2;
  opacity: 0.96;
}

.fc .fc-event-dot {
  opacity: 0.68;
  font-weight: 700;
}

.fc .fc-daygrid-more-link {
  font-size: 0.62rem;
  font-weight: 700;
  color: #324964;
}

.fc .fc-event-line1 {
  min-width: 0;
  flex: 1 1 auto;
  font-size: 0.66rem;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: 0.1px;
  text-transform: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fc .fc-event-time-inline {
  font-weight: 800;
  opacity: 0.98;
  letter-spacing: 0.1px;
  white-space: nowrap;
}

/* Week view: compact time-grid slots for cleaner empty rows */
.fc .fc-timegrid-slot {
  height: 1.5rem;
}

.fc .fc-timegrid-axis-cushion,
.fc .fc-timegrid-slot-label-cushion {
  font-size: 0.63rem;
  line-height: 1.1;
  padding-top: 0.08rem;
  padding-bottom: 0.08rem;
}

.fc .fc-event-card:not(.fc-event-card--compact) .fc-event-line1 {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: initial;
}

.fc .fc-event-operators {
  font-weight: 800;
}

.fc .fc-event-activity {
  font-weight: 500;
  opacity: 0.95;
}

.fc .fc-event-sep {
  opacity: 0.78;
}

.fc .fc-event-line2 {
  margin-top: 1px;
  font-size: 0.58rem;
  line-height: 1.2;
  font-weight: 700;
  opacity: 0.95;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fc .fc-status-indicator {
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  border: 2px solid #ffffff;
  box-shadow:
    0 0 0 1px rgba(17, 18, 20, 0.45),
    0 1px 2px rgba(17, 18, 20, 0.25);
  margin-top: 2px;
}

.fc .fc-status-indicator--approved {
  background: #16c46b;
}

.fc .fc-status-indicator--unconfirmed {
  background: #ff4d4f;
}

.fc .fc-status-indicator--in-progress {
  background: #ff9f1a;
}

.fc .fc-status-indicator--default {
  background: #7f8c9b;
}

.fc .fc-activity-pill--ghost {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(17, 18, 20, 0.18);
}

@media (max-width: 900px) {
  .mission-checklists-grid {
    grid-template-columns: 1fr;
  }

  .person-detail-metrics,
  .person-detail-sections {
    grid-template-columns: 1fr;
  }

  .person-detail-hero,
  .person-detail-trip {
    align-items: flex-start;
    flex-direction: column;
  }

  .person-detail-trip-meta {
    text-align: left;
    white-space: normal;
  }
}

.people-availability-panel .section-tag {
  margin: 0;
}

.people-availability-grid {
  gap: 0.62rem;
}

/* Final mobile stabilization */
@media (max-width: 1200px) {
  .dashboard-actions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-board {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .dashboard-board.dashboard-board--no-drafts {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .mission-layout {
    grid-template-columns: 1fr !important;
  }

  .mission-side-col {
    position: static;
    grid-template-columns: 1fr;
  }

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

@media (max-width: 991.98px) {
  .app-layout {
    padding: 0.42rem;
  }

  .content-wrap,
  .sidebar {
    min-height: auto;
    height: auto;
  }

  .topbar {
    border-radius: 14px;
    padding: 0.62rem 0.7rem;
  }

  .company-topbar-badge {
    max-width: calc(100vw - 7rem);
    order: 3;
  }

  .page-content {
    padding: 0.72rem 0;
  }

  .user-pill {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .stack-controls {
    gap: 0.5rem;
  }

  .stack-controls .form-control,
  .stack-controls .form-select,
  .stack-controls .btn,
  .stack-controls .control-w-xs,
  .stack-controls .control-w-sm,
  .stack-controls .control-w-md {
    width: 100% !important;
  }

  .dashboard-board,
  .dashboard-actions-grid,
  .dashboard-board.dashboard-board--no-drafts,
  .board,
  .chart-grid,
  .stats-chart-grid,
  .calendar-layout,
  .calendar-layout.filters-collapsed,
  .mission-side-col,
  .mission-summary-grid,
  .mission-kpi-row-compact,
  .member-grid,
  .people-grid {
    grid-template-columns: 1fr !important;
  }

  .company-topbar-badge {
    width: 100%;
    max-width: 100%;
    border-radius: 14px;
  }

  .dashboard-company-strip {
    align-items: flex-start;
    padding: 0.68rem 0.78rem;
  }

  .dashboard-company-logo {
    width: 2.55rem;
    height: 2.55rem;
    border-radius: 13px;
  }

  .dashboard-company-copy strong {
    white-space: normal;
  }

  .dashboard-collapse-btn {
    display: none;
  }

  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mission-form-dialog {
    --bs-modal-width: 96vw;
  }

  .mission-form-dialog .modal-content {
    max-height: calc(100dvh - 1rem);
    display: flex;
    flex-direction: column;
  }

  .mission-form-dialog .modal-body {
    overflow-y: auto;
  }

  .fc .fc-event-sub {
    font-size: 0.55rem;
  }

  .fc .fc-event-line1 {
    font-size: 0.62rem;
  }

  .fc .fc-event-line2 {
    font-size: 0.54rem;
  }

  .fc .fc-status-indicator {
    width: 10px;
    height: 10px;
  }
}

@media (max-width: 768px) {
  .topbar {
    gap: 0.5rem;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
    gap: 0.45rem !important;
  }

  .activity-head-actions,
  .archive-head-actions,
  .mission-head-actions,
  .backup-head-actions {
    width: 100%;
    flex-direction: column;
  }

  .activity-head-actions .btn,
  .archive-head-actions .btn,
  .mission-head-actions .btn,
  .backup-head-actions .btn {
    width: 100%;
  }

  .dashboard-controls .btn {
    width: 100%;
  }

  .mission-form-dialog {
    margin: 0.45rem auto;
  }

  .mission-form-dialog .modal-header,
  .mission-form-dialog .modal-body,
  .mission-form-dialog .modal-footer {
    padding: 0.66rem 0.7rem;
  }
}

@media (max-width: 575.98px) {
  .app-layout {
    padding: 0.3rem;
  }

  .topbar {
    border-radius: 12px;
  }

  .user-pill {
    display: none;
  }

  .page-title {
    line-height: 1.22;
  }

  .trip-actions {
    justify-content: flex-start;
  }
}

/* Phase 1 polish: calendar readability + mobile balance */
.fc .fc-event-main {
  overflow: visible;
}

.fc .fc-event-card {
  min-width: 0;
}

.fc .fc-event-top {
  align-items: flex-start;
  gap: 6px;
}

.fc .fc-event-line1 {
  min-height: 2.25em;
}

.fc .fc-status-indicator {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.98);
  box-shadow:
    0 0 0 1.25px rgba(14, 18, 25, 0.62),
    0 1px 2px rgba(14, 18, 25, 0.28);
}

.fc .fc-status-indicator--approved {
  background: #11bf61;
}

.fc .fc-status-indicator--unconfirmed {
  background: #e24848;
}

.fc .fc-status-indicator--in-progress {
  background: #ff9800;
  animation: calendar-status-pulse 1.05s ease-in-out infinite;
  box-shadow:
    0 0 0 1.25px rgba(14, 18, 25, 0.62),
    0 0 0 5px rgba(255, 193, 7, 0.22),
    0 1px 2px rgba(14, 18, 25, 0.28);
}

@keyframes calendar-status-pulse {
  0%,
  100% {
    transform: scale(1);
    background: #ffbf1f;
  }
  50% {
    transform: scale(1.24);
    background: #ffd54a;
  }
}

@media (max-width: 991.98px) {
  .calendar-head {
    padding: 0.72rem 0.78rem;
  }

  .calendar-head-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.44rem !important;
  }

  .calendar-head-actions .btn {
    width: 100%;
  }

  .calendar-layout,
  .calendar-layout.filters-collapsed {
    gap: 0.62rem !important;
  }

  .calendar-filter-panel {
    padding: 0.74rem !important;
  }

  .fc .fc-toolbar {
    flex-wrap: wrap;
    row-gap: 0.36rem;
  }

  .fc .fc-toolbar-title {
    font-size: 1rem;
  }

  .fc .fc-daygrid-day-frame {
    min-height: 80px;
  }

  .fc .fc-event-line1 {
    font-size: 0.61rem;
    line-height: 1.16;
  }

  .fc .fc-event-line2 {
    font-size: 0.53rem;
    text-transform: none;
  }

  .fc .fc-status-indicator {
    width: 11px;
    height: 11px;
  }
}

@media (max-width: 768px) {
  .calendar-head-actions {
    grid-template-columns: 1fr;
  }

  .calendar-filter-toggle .btn-label {
    display: none;
  }

  .fc .fc-toolbar-chunk {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.3rem;
  }

  .fc .fc-button {
    padding: 0.2rem 0.38rem;
    font-size: 0.67rem;
  }

  .fc .fc-daygrid-day-frame {
    min-height: 72px;
  }

  .fc .fc-event-card:not(.fc-event-card--compact) .fc-event-line1 {
    -webkit-line-clamp: 1;
  }
}

/* Calendar layout stabilization: collapsible filters + predictable expansion */
#calendarLayout.calendar-layout {
  grid-template-columns: minmax(252px, 286px) minmax(0, 1fr);
  align-items: stretch;
  gap: 0.95rem;
}

#calendarLayout.calendar-layout.filters-collapsed {
  grid-template-columns: 72px minmax(0, 1fr);
}

#calendarLayout > .calendar-side,
#calendarLayout > .calendar-main {
  min-width: 0;
}

#calendarLayout > .calendar-main {
  width: 100%;
}

#calendarLayout #calendarFilterPanel {
  min-width: 0;
}

#calendarLayout.filters-collapsed #calendarFilterPanel {
  padding: 0.52rem 0.46rem !important;
}

#calendarLayout.filters-collapsed #calendarFilterPanel .calendar-filter-head {
  margin-bottom: 0 !important;
  justify-content: center;
}

#calendarLayout.filters-collapsed #calendarFilterPanel .section-tag,
#calendarLayout.filters-collapsed #calendarFilterPanel .calendar-filter-toggle .btn-label {
  display: none;
}

#calendarLayout.filters-collapsed #calendarFilterPanel .calendar-filter-toggle {
  width: 100%;
}

#calendarLayout.filters-collapsed #calendarFilterPanel #calendarFiltersBody {
  display: none;
}

#calendarLayout .calendar-surface {
  min-height: 0;
  overflow: hidden;
}

#calendarLayout .fc {
  width: 100%;
  min-width: 0;
}

#calendarLayout .fc .fc-event-line1,
#calendarLayout .fc .fc-event-line2 {
  min-width: 0;
}

@media (max-width: 1199.98px) {
  #calendarLayout.calendar-layout,
  #calendarLayout.calendar-layout.filters-collapsed {
    grid-template-columns: 1fr !important;
  }

  #calendarLayout #calendarFilterPanel,
  #calendarLayout #calendarFilterPanel.filters-collapsed {
    padding: 0.74rem !important;
  }
}

/* Mobile adaptation pass: shared actions, tables, modals */
@media (max-width: 991.98px) {
  [class*="head-actions"] {
    width: 100%;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.44rem !important;
  }

  [class*="head-actions"] .btn {
    width: 100%;
  }

  :is(.users-table, .activity-table, .backup-table, .audit-changes-table) {
    min-width: 640px;
  }

  :is(.users-table-wrap, .activity-table-wrap, .backup-table-wrap, .audit-changes-wrap) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 768px) {
  .page-head {
    align-items: stretch;
  }

  [class*="head-actions"] {
    grid-template-columns: 1fr !important;
  }

  .modal-dialog {
    max-width: calc(100vw - 0.8rem);
    margin: 0.4rem auto;
  }

  .modal-content {
    max-height: calc(100dvh - 0.8rem);
    display: flex;
    flex-direction: column;
  }

  .modal-body {
    overflow-y: auto;
  }

  .modal-footer {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.44rem;
  }

  .modal-footer .btn,
  .modal-footer .btn.me-auto {
    width: 100%;
    margin: 0 !important;
  }
}

/* Visual refresh v1: coherent app-wide polish */
:root {
  --theme-bg-a: #eef4ff;
  --theme-bg-b: #f7fafc;
  --theme-ink: #0e1824;
  --theme-line: #d4dfec;
  --theme-line-strong: #b8c8dc;
  --theme-primary: #111214;
  --theme-primary-strong: #000000;
  --theme-surface: #ffffff;
}

body {
  color: var(--theme-ink);
  background:
    radial-gradient(1000px 480px at -8% -12%, rgba(176, 210, 255, 0.34), rgba(176, 210, 255, 0)),
    radial-gradient(860px 420px at 108% 104%, rgba(198, 217, 246, 0.24), rgba(198, 217, 246, 0)),
    linear-gradient(180deg, var(--theme-bg-a), var(--theme-bg-b));
}

.topbar,
.sidebar {
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.9);
}

.page-head {
  border: 1px solid var(--theme-line);
  border-radius: 18px;
  padding: 0.92rem 1rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 255, 0.96));
  box-shadow: 0 10px 26px rgba(23, 39, 60, 0.06);
}

.panel {
  border-color: var(--theme-line);
  border-radius: 16px;
  background: var(--theme-surface);
  box-shadow:
    0 1px 0 rgba(18, 28, 40, 0.03),
    0 10px 22px rgba(24, 39, 61, 0.05);
}

.btn {
  border-radius: 10px;
  font-weight: 700;
  letter-spacing: 0.1px;
}

.btn-primary {
  background: linear-gradient(180deg, var(--theme-primary), var(--theme-primary-strong));
  border-color: var(--theme-primary-strong);
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(180deg, #0e1012, #000000);
  border-color: #000000;
}

.btn-ghost,
.btn-outline-secondary {
  border-color: var(--theme-line-strong);
  background: #fff;
}

.btn-create-mission {
  background: linear-gradient(180deg, #263547, #1c2735);
  border-color: #1c2735;
  color: #fff;
}

.btn-create-activity {
  background: linear-gradient(180deg, #1270b7, #0f5c97);
  border-color: #0f5c97;
  color: #fff;
}

.form-control,
.form-select,
.choices__inner {
  border-color: #c2d0e2;
  border-radius: 10px;
}

.form-control:focus,
.form-select:focus,
.choices__inner:focus-within {
  border-color: #7da0c5;
  box-shadow: 0 0 0 0.16rem rgba(75, 123, 176, 0.2);
}

.kpi-card {
  border-left: 4px solid rgba(17, 22, 29, 0.84);
  border-color: var(--theme-line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.98));
}

.kpi-card .label {
  color: #4f6076;
}

:is(.trip-card, .timeline-month, .member-card, .attachment-row, .board-col) {
  border-color: var(--theme-line);
  box-shadow: 0 6px 16px rgba(22, 37, 59, 0.05);
}

:is(.trip-card, .timeline-month, .member-card, .attachment-row, .board-col):hover {
  box-shadow: 0 12px 28px rgba(22, 37, 59, 0.1);
}

.chip {
  border-color: #c6d5e8;
  background: #edf4fc;
  color: #1d3552;
  font-weight: 700;
}

.table {
  border-radius: 12px;
}

.table thead th {
  background: #eaf1f9;
  color: #2f4662;
  border-bottom-color: #cbd9ea;
}

.table tbody tr:nth-child(even) {
  background: rgba(241, 246, 252, 0.46);
}

.modal-content {
  border-color: #cbd9e9;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(17, 31, 49, 0.22);
}

.modal-header {
  background:
    radial-gradient(460px 130px at 100% 0%, rgba(176, 209, 246, 0.24), rgba(176, 209, 246, 0)),
    linear-gradient(180deg, #ffffff, #f4f9ff);
  border-bottom-color: #d1deee;
}

.modal-footer {
  border-top-color: #d1deee;
  background: #f8fbff;
}

.login-card,
.login-brand-panel {
  box-shadow: 0 18px 40px rgba(17, 31, 49, 0.14);
}

/* Concluse: keep page tone aligned with global theme */
.archive-head {
  border-color: var(--theme-line) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 255, 0.96)) !important;
}

.archive-controls {
  border-color: var(--theme-line) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.98)) !important;
}

.archive-timeline .timeline-month {
  border-color: var(--theme-line) !important;
  background: #ffffff !important;
}

/* Creation form refinement: clearer mission/activity workflow */
.mission-form-modal .modal-title,
.dashboard-mission-modal .modal-title {
  font-family: "Sora", "Manrope", "Segoe UI", system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.mission-form-subtitle {
  margin: 0.18rem 0 0;
  color: #5f6b7a;
  font-size: 0.84rem;
  line-height: 1.35;
}

.mission-form-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 0.62rem;
  padding: 0.72rem 0.82rem;
  border: 1px solid #dbe5ef;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 248, 252, 0.96));
}

.mission-form-intro strong {
  display: block;
  color: #172232;
  font-family: "Sora", "Manrope", "Segoe UI", system-ui, sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.mission-form-intro span:not(.mission-form-type-pill) {
  display: block;
  margin-top: 0.14rem;
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.35;
}

.mission-form-type-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 0.7rem;
  border: 1px solid #c7d8ea;
  border-radius: 999px;
  color: #173f5f;
  background: #eaf3fb;
  font-size: 0.75rem;
  font-weight: 800;
}

.create-guided-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 330px);
  gap: 0.75rem;
  align-items: start;
}

.create-guided-main {
  display: grid;
  gap: 0.64rem;
  min-width: 0;
}

.create-step-panel {
  position: relative;
  padding: 0.74rem;
  border: 1px solid #d9e3ef;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 253, 0.98));
  box-shadow: 0 8px 18px rgba(15, 22, 29, 0.04);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.create-step-panel.is-complete {
  border-color: #b7d9c8;
  background:
    radial-gradient(340px 90px at 100% 0%, rgba(45, 143, 102, 0.1), rgba(45, 143, 102, 0)),
    linear-gradient(180deg, #ffffff, #f7fbf9);
}

.create-step-panel.is-complete .create-step-number {
  border-color: #2d8f66;
  background: #2d8f66;
  color: #ffffff;
}

.create-step-head {
  display: flex;
  align-items: flex-start;
  gap: 0.58rem;
  margin-bottom: 0.58rem;
}

.create-step-number {
  width: 28px;
  height: 28px;
  border: 1px solid #cbd9e6;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: #f4f8fc;
  color: #385168;
  font-size: 0.78rem;
  font-weight: 900;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.create-step-head h6 {
  margin: 0;
  color: #1d2c3f;
  font-family: "Sora", "Manrope", "Segoe UI", system-ui, sans-serif;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.create-step-head p {
  margin: 0.1rem 0 0;
  color: #64748b;
  font-size: 0.76rem;
  line-height: 1.32;
}

.create-summary-card {
  position: sticky;
  top: 0.7rem;
  padding: 0.78rem;
  border: 1px solid #d7e2ee;
  border-radius: 16px;
  background:
    radial-gradient(360px 120px at 100% 0%, rgba(39, 107, 152, 0.1), rgba(39, 107, 152, 0)),
    linear-gradient(180deg, #ffffff, #f7fbff);
  box-shadow: 0 10px 22px rgba(15, 22, 29, 0.06);
}

.create-summary-card h6 {
  margin: 0 0 0.62rem;
  color: #172232;
  font-family: "Sora", "Manrope", "Segoe UI", system-ui, sans-serif;
  font-size: 0.94rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.create-summary-card dl {
  display: grid;
  gap: 0.48rem;
  margin: 0;
}

.create-summary-card dl > div {
  padding: 0.48rem 0.52rem;
  border: 1px solid #e0e8f1;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
}

.create-summary-card dt {
  margin: 0 0 0.12rem;
  color: #6b7b8f;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.42px;
  text-transform: uppercase;
}

.create-summary-card dd {
  margin: 0;
  color: #1f2f43;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.create-summary-note {
  margin-top: 0.62rem;
  padding: 0.55rem 0.6rem;
  border-radius: 12px;
  background: #eef5fb;
  color: #43566c;
  font-size: 0.74rem;
  line-height: 1.35;
}

.mission-form-section-title {
  margin-top: 0.2rem;
  padding: 0.5rem 0.12rem 0.18rem;
  color: #263547;
  font-family: "Sora", "Manrope", "Segoe UI", system-ui, sans-serif;
  font-size: 0.78rem;
  letter-spacing: -0.01em;
}

.mission-form-section-title::before {
  width: 0.46rem;
  height: 0.46rem;
  background: #0d7f4f;
  box-shadow: 0 0 0 4px rgba(13, 127, 79, 0.12);
}

.mission-form-help {
  margin-top: 0.28rem;
  color: #738195;
  font-size: 0.74rem;
  line-height: 1.35;
}

.mission-form-status-field {
  border-color: #d8e3ef;
  background: linear-gradient(180deg, #ffffff, #f6f9fc);
}

.mission-form-status-field .js-confirmation-hint {
  color: #5f6b7a !important;
}

.mission-form-grid .choices__inner,
.dashboard-mission-grid .choices__inner {
  min-height: 40px;
  max-height: 92px;
  background: #ffffff;
}

.mission-form-grid .form-control,
.mission-form-grid .form-select,
.dashboard-mission-grid .form-control,
.dashboard-mission-grid .form-select {
  min-height: 40px;
  background-color: #ffffff;
}

.mission-form-grid textarea.form-control,
.dashboard-mission-grid textarea.form-control {
  min-height: 48px;
}

.mission-form-submit-btn {
  min-width: 148px;
}

@media (max-width: 991.98px) {
  .create-guided-layout {
    grid-template-columns: 1fr;
  }

  .create-summary-card {
    position: static;
  }
}

@media (max-width: 575.98px) {
  .mission-form-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .mission-form-type-pill,
  .mission-form-submit-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .today-layout,
  .today-split {
    grid-template-columns: 1fr;
  }

  .mission-history-top,
  .today-trip-main {
    align-items: flex-start;
    flex-direction: column;
  }
}

.orders-process-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.72rem;
  margin-bottom: 0.75rem;
}

.orders-process-panel article {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.82rem;
  border: 1px solid #d9e3ef;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 8px 18px rgba(15, 22, 29, 0.045);
}

.orders-process-panel article > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: #172335;
  color: #fff;
  font-weight: 900;
}

.orders-process-panel strong {
  display: block;
  color: #172335;
  font-size: 0.9rem;
}

.orders-process-panel small {
  display: block;
  margin-top: 0.14rem;
  color: #6b7c8f;
  font-size: 0.78rem;
  line-height: 1.35;
}

.orders-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.72rem;
  margin-bottom: 0.75rem;
}

.orders-kpi-card {
  padding: 0.78rem 0.85rem;
  border: 1px solid #d9e3ef;
  border-left: 4px solid #6d7a8a;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 22, 29, 0.04);
}

.orders-kpi-card:nth-child(1) { border-left-color: #276b98; }
.orders-kpi-card:nth-child(2) { border-left-color: #2d8f66; }
.orders-kpi-card:nth-child(3) { border-left-color: #3b4b62; }
.orders-kpi-card:nth-child(4) { border-left-color: #c58b2d; }

.orders-kpi-card span {
  display: block;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.orders-kpi-card strong {
  display: block;
  margin-top: 0.18rem;
  color: #172335;
  font-size: 1.45rem;
  line-height: 1;
}

.orders-list-panel {
  margin-top: 0.75rem;
}

.orders-list-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.65rem;
}

.orders-list-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.orders-list-controls .form-label {
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.orders-list-controls .form-select {
  min-width: 180px;
  border-color: #cbd8e6;
  background-color: #fff;
}

.orders-list-help {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.orders-list-help span {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: 0.28rem 0.58rem;
  border: 1px solid #d9e3ef;
  border-radius: 999px;
  background: #f8fbff;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
}

.orders-list-help b {
  color: #334155;
}

.orders-list {
  display: grid;
  gap: 0.65rem;
}

.orders-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: start;
  padding: 0.8rem;
  border: 1px solid #d9e3ef;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 10px 22px rgba(15, 22, 29, 0.045);
}

.orders-card h4 {
  margin: 0;
  font-size: 1rem;
  color: #172335;
}

.orders-title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.42rem;
  margin-bottom: 0.38rem;
}

.orders-id {
  display: inline-flex;
  padding: 0.14rem 0.42rem;
  border: 1px solid #d5e0eb;
  border-radius: 999px;
  background: #fff;
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 850;
}

.orders-meta,
.orders-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  align-items: center;
}

.orders-actions {
  justify-content: flex-end;
}

.orders-material {
  margin-top: 0.55rem;
  padding: 0.58rem 0.68rem;
  border: 1px solid #d9e3ef;
  border-radius: 13px;
  background: #fff;
}

.orders-material-input {
  font-size: 0.95rem;
  line-height: 1.48;
}

.orders-create-modal {
  overflow: hidden;
  border: 1px solid #d8e3ef;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 24px 70px rgba(15, 22, 29, 0.22);
}

.orders-create-modal .modal-header,
.orders-create-modal .modal-footer {
  border-color: #d9e3ef;
  background: rgba(255, 255, 255, 0.74);
}

.orders-create-modal .modal-title {
  color: #172335;
  font-weight: 850;
}

.orders-create-modal .modal-body {
  padding-top: 1rem;
}

.orders-items-list {
  margin: 0;
  padding-left: 1.1rem;
  color: #2f3f53;
}

.orders-items-list li + li {
  margin-top: 0.2rem;
}

.orders-note {
  margin-top: 0.5rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid #e1e8f0;
  border-radius: 12px;
  background: #fff;
  color: #5d6c7e;
  font-size: 0.88rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.orders-filter-hint {
  display: grid;
  gap: 0.34rem;
  padding-top: 0.75rem;
  border-top: 1px solid #d9e3ef;
}

.orders-filter-hint strong {
  color: #172335;
  font-size: 0.84rem;
}

.orders-filter-hint span {
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.35;
}

.orders-filter-hint b {
  color: #334155;
}

.hours-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: end;
  border-color: rgba(191, 209, 229, 0.92);
  background:
    radial-gradient(240px 120px at 100% 0%, rgba(31, 107, 143, 0.08), transparent 70%),
    linear-gradient(180deg, #ffffff, #f8fbff);
}

.hours-filter label {
  display: grid;
  gap: 0.2rem;
  margin: 0;
  color: #5d6c7e;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.35px;
}

.hours-month-status-panel {
  margin-bottom: 0.75rem;
  border-color: #d9e3ef;
  overflow: hidden;
  position: relative;
}

.hours-month-status-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: #2d8f66;
}

.hours-month-status-panel.is-locked::before {
  background: #64748b;
}

.hours-lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.38rem 0.68rem;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.01em;
}

.hours-lock-badge.is-open {
  color: #145c43;
  background: #e8f8ef;
  border: 1px solid #bfe5cf;
}

.hours-lock-badge.is-locked {
  color: #334155;
  background: #eef2f6;
  border: 1px solid #d8e3ef;
}

.hours-layout {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
  margin-top: 0.75rem;
}

.hours-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 0.75rem;
  align-items: start;
}

.hours-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.58rem;
  color: #5d6c7e;
  font-size: 0.78rem;
  font-weight: 700;
}

.hours-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.22rem 0.48rem;
  border: 1px solid #d8e3ef;
  border-radius: 999px;
  background: #fff;
}

.hours-legend-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  display: inline-block;
}

.hours-legend-dot.is-filled {
  background: #2d8f66;
}

.hours-legend-dot.is-missing {
  background: #d99822;
}

.hours-legend-dot.is-warning {
  background: #c2410c;
}

.hours-legend-dot.is-future {
  background: #94a3b8;
}

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

.hours-calendar-day {
  min-height: 102px;
  display: grid;
  align-content: space-between;
  gap: 0.25rem;
  padding: 0.62rem;
  border: 1px solid #d9e3ef;
  border-radius: 15px;
  background: #fff;
  color: #26384d;
  text-align: left;
  position: relative;
  overflow: hidden;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.hours-calendar-day::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: #d8e3ef;
}

.hours-calendar-day:hover {
  border-color: #b8c9dc;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.hours-calendar-day.is-selected {
  border-color: #1f6f83;
  box-shadow: 0 0 0 3px rgba(31, 111, 131, 0.16), 0 14px 26px rgba(15, 23, 42, 0.08);
}

.hours-calendar-day.is-filled {
  background: linear-gradient(180deg, #fbfffd 0%, #eefaf4 100%);
  border-color: #bfe5cf;
}

.hours-calendar-day.is-filled::before {
  background: #2d8f66;
}

.hours-calendar-day.is-missing {
  background: linear-gradient(180deg, #ffffff 0%, #fff8ea 100%);
  border-color: #f0cf85;
}

.hours-calendar-day.is-missing::before {
  background: #d99822;
}

.hours-calendar-day.is-warning {
  background: linear-gradient(180deg, #fff 0%, #fff0e8 100%);
  border-color: #f0ae8a;
}

.hours-calendar-day.is-warning::before {
  background: #c2410c;
}

.hours-calendar-day.is-future,
.hours-calendar-day:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
}

.hours-calendar-day.is-future::before,
.hours-calendar-day:disabled::before {
  background: #94a3b8;
}

.hours-calendar-day.is-future:hover,
.hours-calendar-day:disabled:hover {
  border-color: #d9e3ef;
  box-shadow: none;
  transform: none;
}

.hours-calendar-day.is-today .hours-calendar-date {
  background: #172335;
  color: #fff;
}

.hours-calendar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.hours-calendar-date {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #eef4f8;
  color: #172335;
  font-weight: 800;
}

.hours-calendar-weekday {
  color: #6b7c8f;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hours-calendar-day strong {
  color: #172335;
  font-size: 0.88rem;
}

.hours-calendar-day.is-warning strong {
  color: #9a3412;
}

.hours-calendar-day small {
  color: #6b7c8f;
  font-weight: 700;
}

.hours-kpi-card {
  position: relative;
  overflow: hidden;
  border-color: #d8e3ef;
}

.hours-kpi-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 4px;
  background: #cbd5e1;
}

.hours-kpi-card.is-hours::after,
.hours-kpi-card.is-days::after,
.hours-kpi-card.is-ok::after {
  background: #2d8f66;
}

.hours-kpi-card.is-warning::after {
  background: #c2410c;
}

.hours-kpi-card.is-people::after,
.hours-kpi-card.is-period::after {
  background: #1f6b8f;
}

.hours-summary-list,
.hours-day-list,
.hours-entry-list,
.hours-untracked-list {
  display: grid;
  gap: 0.55rem;
}

.hours-person-row,
.hours-day-card {
  border: 1px solid #d9e3ef;
  border-radius: 15px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.hours-person-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.72rem;
}

.hours-person-main,
.hours-day-head > div {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.person-dot {
  width: 0.78rem;
  height: 0.78rem;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12);
  flex: 0 0 auto;
}

.hours-person-total,
.hours-day-total {
  font-weight: 800;
  color: #172335;
  white-space: nowrap;
}

.hours-person-side {
  min-width: 110px;
  text-align: right;
}

.hours-person-bar {
  width: 100%;
  height: 0.38rem;
  border-radius: 999px;
  background: #e7eef6;
  overflow: hidden;
  margin-top: 0.32rem;
}

.hours-person-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1f6b8f, #2d8f66);
}

.hours-day-card {
  padding: 0.72rem;
  box-shadow: 0 10px 24px rgba(31, 45, 61, 0.04);
}

.hours-day-head {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: center;
  margin-bottom: 0.55rem;
}

.hours-warning-list {
  display: grid;
  gap: 0.45rem;
}

.hours-warning-rule {
  display: flex;
  gap: 0.58rem;
  align-items: flex-start;
  padding: 0.7rem 0.78rem;
  border: 1px solid #f0cf85;
  border-radius: 14px;
  background: #fff9ec;
  color: #5b4420;
}

.hours-warning-rule i {
  color: #b7791f;
  margin-top: 0.12rem;
}

.hours-warning-rule strong,
.hours-warning-rule span {
  display: block;
}

.hours-warning-rule span {
  color: #7a5a25;
  font-size: 0.82rem;
  margin-top: 0.1rem;
}

.hours-settings-current {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.75rem;
  border: 1px solid #f0cf85;
  border-radius: 14px;
  background: #fff9ec;
  color: #5b4420;
}

.hours-settings-current i {
  color: #b7791f;
  margin-top: 0.12rem;
}

.hours-settings-current strong,
.hours-settings-current span {
  display: block;
}

.hours-settings-current span {
  color: #7a5a25;
  font-size: 0.82rem;
  margin-top: 0.1rem;
}

.hours-warning-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  padding: 0.55rem 0.65rem;
  border: 1px solid #f0cf85;
  border-radius: 13px;
  background: #fff8e8;
  color: #5b4420;
}

.hours-warning-row i {
  color: #b7791f;
}

.hours-validation-list {
  display: grid;
  gap: 0.55rem;
}

.hours-validation-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  border: 1px solid #d9e3ef;
  border-radius: 15px;
  padding: 0.72rem;
  background: #fff;
}

.hours-validation-row.has-missing {
  border-color: #f0cf85;
  background: linear-gradient(180deg, #fff 0%, #fff8ea 100%);
}

.hours-validation-row.is-complete {
  border-color: #bfe5cf;
  background: linear-gradient(180deg, #fff 0%, #eefaf4 100%);
}

.hours-validation-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.hours-validation-missing {
  display: grid;
  gap: 0.35rem;
  justify-items: end;
  text-align: right;
}

.hours-missing-days {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.28rem;
  max-width: 520px;
}

.hours-missing-days span {
  border: 1px solid #f0cf85;
  border-radius: 999px;
  padding: 0.12rem 0.42rem;
  background: #fff;
  color: #5b4420;
  font-size: 0.72rem;
  font-weight: 700;
}

.hours-entry,
.hours-untracked {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  align-items: center;
  padding: 0.52rem 0.58rem;
  border: 1px solid #d9e3ef;
  border-radius: 12px;
  background: #fff;
  color: #26384d;
  text-decoration: none;
}

.hours-entry:hover,
.hours-untracked:hover {
  border-color: #b8c9dc;
  background: #f8fbff;
  color: #172335;
}

.hours-untracked {
  border-style: dashed;
  background: #fffaf0;
}

@media (max-width: 991.98px) {
  .orders-process-panel,
  .orders-kpi-grid,
  .orders-card,
  .hours-workspace,
  .hours-layout {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .hours-validation-row,
  .hours-validation-missing {
    justify-items: start;
    text-align: left;
  }

  .hours-validation-row {
    flex-direction: column;
  }

  .orders-actions {
    justify-content: flex-start;
  }

  .orders-list-head {
    flex-direction: column;
  }

  .orders-list-controls,
  .orders-list-controls .form-select {
    width: 100%;
  }
}

.customers-head {
  background:
    radial-gradient(420px 130px at 100% 0%, rgba(31, 107, 143, 0.16), rgba(31, 107, 143, 0)),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.customers-kpi-grid,
.customers-layout {
  display: grid;
  gap: 0.75rem;
}

.customers-kpi-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 0.75rem;
}

.customers-layout {
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  align-items: start;
}

.customers-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.customers-panel-head h3 {
  margin: 0;
  color: #172335;
  font-size: 1rem;
  font-weight: 850;
}

.customers-panel-head .form-control {
  max-width: 240px;
}

.customer-job-search {
  margin-bottom: 0.35rem;
  border-radius: 12px;
  background: #f8fbff;
  color: #172335;
  font-size: 0.84rem;
}

.customer-job-search::placeholder {
  color: #7b8798;
}

.customer-job-picker-results {
  position: relative;
  z-index: 1080;
  margin-top: -0.15rem;
  margin-bottom: 0.35rem;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #cdd9e7;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 16px 34px rgba(15, 22, 29, 0.14);
  padding: 0.35rem;
}

.customer-job-picker-option {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #172335;
  padding: 0.5rem 0.55rem;
  text-align: left;
  font-size: 0.86rem;
  font-weight: 800;
}

.customer-job-picker-option:hover,
.customer-job-picker-option:focus-visible {
  background: #eef7fb;
  outline: none;
}

.customer-job-picker-option small {
  display: block;
  margin-top: 0.1rem;
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 700;
}

.customer-job-picker-empty {
  padding: 0.55rem;
  color: #738195;
  font-size: 0.82rem;
  font-weight: 700;
}

.customer-job-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-height: 0.25rem;
}

.customer-job-selected-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  border: 1px solid #b9d2df;
  border-radius: 999px;
  background: #edf8fb;
  color: #164255;
  padding: 0.32rem 0.45rem 0.32rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 850;
}

.customer-job-selected-chip button {
  display: inline-grid;
  place-items: center;
  width: 1.05rem;
  height: 1.05rem;
  border: 0;
  border-radius: 999px;
  background: rgba(22, 66, 85, 0.12);
  color: #164255;
  line-height: 1;
}

.customer-job-selected-chip button:hover,
.customer-job-selected-chip button:focus-visible {
  background: rgba(22, 66, 85, 0.22);
  outline: none;
}

.customers-list {
  display: grid;
  gap: 0.55rem;
}

.customer-card,
.customer-job-card {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  width: 100%;
  padding: 0.72rem;
  border: 1px solid #d8e3ef;
  border-radius: 15px;
  background: #fff;
  color: inherit;
  text-align: left;
  text-decoration: none;
}

.customer-card,
.customer-job-card {
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.customer-card:hover,
.customer-card.is-selected,
.customer-job-card:hover,
.customer-card:focus-visible,
.customer-job-card:focus-visible {
  border-color: #9fb8cf;
  box-shadow: 0 10px 22px rgba(15, 22, 29, 0.07);
  transform: translateY(-1px);
  outline: none;
}

.customer-card.is-selected {
  background: linear-gradient(180deg, #ffffff 0%, #eef7fb 100%);
}

.customer-card.is-closed,
.customer-job-card.is-closed {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.customer-card.is-closed strong,
.customer-job-card.is-closed strong {
  color: #64748b;
}

.customer-card strong,
.customer-card span,
.customer-card small,
.customer-job-card strong,
.customer-job-card span,
.customer-job-card small {
  display: block;
}

.customer-card strong,
.customer-job-card strong {
  color: #172335;
  font-size: 0.94rem;
}

.customer-card span,
.customer-job-card span {
  margin-top: 0.14rem;
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 750;
}

.customer-card small,
.customer-job-card small {
  margin-top: 0.18rem;
  color: #738195;
  font-size: 0.76rem;
}

.customer-card-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  flex-shrink: 0;
}

.customer-card-actions .btn {
  border-radius: 999px;
  font-weight: 800;
}

@media (max-width: 991.98px) {
  .customers-kpi-grid,
  .customers-layout {
    grid-template-columns: 1fr;
  }

  .customers-panel-head,
  .customer-job-card {
    flex-direction: column;
  }

  .customers-panel-head .form-control {
    max-width: none;
    width: 100%;
  }

  .customer-card-actions {
    width: 100%;
    justify-content: space-between;
  }
}

/* Mobile app shell */
.mobile-bottom-nav {
  position: fixed;
  left: max(0.55rem, env(safe-area-inset-left));
  right: max(0.55rem, env(safe-area-inset-right));
  bottom: max(0.55rem, env(safe-area-inset-bottom));
  z-index: 1035;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.2rem;
  padding: 0.34rem;
  border: 1px solid rgba(184, 200, 220, 0.9);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 252, 0.96));
  box-shadow:
    0 18px 46px rgba(15, 22, 29, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
}

.mobile-bottom-link {
  min-width: 0;
  min-height: 3.2rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.14rem;
  border: 0;
  border-radius: 17px;
  background: transparent;
  color: #627389;
  font-size: 0.66rem;
  font-weight: 850;
  line-height: 1.05;
  text-align: center;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.mobile-bottom-link i {
  font-size: 1.12rem;
  line-height: 1;
}

.mobile-bottom-link span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-bottom-link.active {
  background:
    radial-gradient(120px 54px at 50% 0%, color-mix(in srgb, var(--company-brand-color) 16%, #ffffff), rgba(255, 255, 255, 0)),
    #ffffff;
  color: #162333;
  box-shadow: 0 8px 20px rgba(15, 22, 29, 0.08);
}

.mobile-bottom-link.active i {
  color: var(--company-brand-color);
}

.mobile-bottom-menu {
  font-family: inherit;
}

body.mobile-keyboard-open .mobile-bottom-nav {
  display: none;
}

.mobile-create-dock {
  position: fixed;
  left: max(0.65rem, env(safe-area-inset-left));
  right: max(0.65rem, env(safe-area-inset-right));
  bottom: calc(4.55rem + env(safe-area-inset-bottom));
  z-index: 1034;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.46rem;
  pointer-events: none;
}

.mobile-create-dock-btn {
  min-height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  border: 1px solid rgba(15, 22, 29, 0.12);
  border-radius: 18px;
  color: #fff;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.01em;
  box-shadow: 0 14px 34px rgba(15, 22, 29, 0.2);
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.mobile-create-dock-btn i {
  font-size: 1rem;
}

.mobile-create-dock-btn--mission {
  background: linear-gradient(180deg, #263547, #111a25);
}

.mobile-create-dock-btn--activity {
  background: linear-gradient(180deg, #1477bd, #0e548a);
}

body.mobile-keyboard-open .mobile-create-dock {
  display: none;
}

@media (max-width: 991.98px) {
  body {
    padding-bottom: calc(4.65rem + env(safe-area-inset-bottom));
  }

  .page-content {
    padding-bottom: calc(5.2rem + env(safe-area-inset-bottom)) !important;
  }

  body:has(.mobile-create-dock:not(.d-none)) .page-content {
    padding-bottom: calc(8.9rem + env(safe-area-inset-bottom)) !important;
  }

  .topbar {
    position: sticky;
    top: 0.42rem;
    z-index: 1034;
  }

  .topbar > .d-flex:first-child {
    width: 100%;
  }

  .topbar-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    align-items: center;
  }

  .topbar-actions .global-search {
    min-width: 0;
  }

  .topbar-actions .user-pill {
    display: none;
  }

  .topbar-actions > form.m-0 {
    justify-self: end;
  }

  .nav-trigger,
  .notification-toggle,
  .topbar-actions .btn-sm,
  .mobile-bottom-link {
    touch-action: manipulation;
  }

  .offcanvas#mobileNav {
    width: min(88vw, 360px);
    border-right: 1px solid #d2dfeb;
    background:
      radial-gradient(360px 180px at 0% 0%, rgba(31, 107, 143, 0.12), rgba(31, 107, 143, 0)),
      linear-gradient(180deg, #ffffff 0%, #f5f8fb 100%);
  }

  #mobileNav .offcanvas-header {
    padding: 0.86rem 0.92rem;
  }

  #mobileNav .offcanvas-body {
    padding: 0.82rem;
  }

  #mobileNav .nav-side {
    gap: 0.36rem;
  }

  #mobileNav .nav-link-side {
    min-height: 2.85rem;
    border-radius: 14px;
    font-size: 0.92rem;
  }

  #mobileNav .nav-icon {
    font-size: 1.05rem;
  }

  .toast-zone {
    top: auto !important;
    bottom: calc(5.3rem + env(safe-area-inset-bottom));
    left: 0;
    right: 0;
    padding: 0.65rem !important;
  }

  .toast-zone .toast {
    width: 100%;
    max-width: none;
    border-radius: 16px;
  }

  #newMissionBtn,
  #newDailyBtn,
  #calNewMissionBtn,
  #calNewDailyBtn {
    display: none !important;
  }

  .dashboard-head-actions,
  .calendar-head-actions {
    grid-template-columns: 1fr !important;
  }

  .dashboard-actions-grid {
    display: flex !important;
    gap: 0.55rem;
    overflow-x: auto;
    padding-bottom: 0.18rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .dashboard-action-card {
    min-width: min(72vw, 260px);
    scroll-snap-align: start;
  }

  .dashboard-column {
    padding: 0.7rem !important;
  }

  .board-col {
    min-height: auto;
  }

  .trip-list {
    gap: 0.62rem;
  }

  .trip-card,
  .dashboard-trip-card,
  .today-trip-card,
  .orders-card,
  .customer-card,
  .customer-job-card {
    border-radius: 18px;
    padding: 0.78rem;
  }

  .trip-destination {
    font-size: 1rem;
  }

  .trip-dates,
  .trip-note {
    font-size: 0.78rem;
  }

  .trip-actions,
  .orders-actions,
  .customer-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 0.42rem;
  }

  .trip-actions .btn,
  .orders-actions .btn,
  .customer-card-actions .btn {
    width: 100%;
    min-height: 2.45rem;
  }

  .chip {
    min-height: 1.55rem;
    padding: 0.18rem 0.52rem;
    font-size: 0.72rem;
  }

  .orders-card {
    grid-template-columns: 1fr;
  }

  .orders-list-help {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.15rem;
    -webkit-overflow-scrolling: touch;
  }

  .orders-list-help span {
    flex: 0 0 auto;
  }

  .fc .fc-header-toolbar {
    position: sticky;
    top: 4.7rem;
    z-index: 3;
    padding: 0.45rem;
    border: 1px solid #d7e2ee;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
  }

  .fc .fc-scrollgrid {
    border-radius: 16px;
    overflow: hidden;
  }

  .fc .fc-daygrid-day-number {
    min-width: 1.6rem;
    min-height: 1.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .modal-footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
  }
}

@media (max-width: 575.98px) {
  .mobile-bottom-nav {
    left: max(0.38rem, env(safe-area-inset-left));
    right: max(0.38rem, env(safe-area-inset-right));
    bottom: max(0.38rem, env(safe-area-inset-bottom));
    border-radius: 20px;
  }

  .mobile-bottom-link {
    min-height: 3.05rem;
    font-size: 0.6rem;
  }

  .mobile-create-dock {
    left: max(0.45rem, env(safe-area-inset-left));
    right: max(0.45rem, env(safe-area-inset-right));
    bottom: calc(4.35rem + env(safe-area-inset-bottom));
    gap: 0.36rem;
  }

  .mobile-create-dock-btn {
    min-height: 2.85rem;
    border-radius: 16px;
    font-size: 0.76rem;
  }

  .mobile-bottom-link i {
    font-size: 1.06rem;
  }

  .topbar-actions {
    grid-template-columns: minmax(0, 1fr) auto auto auto;
  }

  .company-topbar-badge {
    padding: 0.28rem;
  }

  .company-topbar-copy small {
    display: none;
  }

  .topbar-actions .btn-sm {
    min-width: 2.28rem;
    min-height: 2.28rem;
    padding-inline: 0.55rem;
  }

  .notification-toggle {
    width: 2.28rem;
    height: 2.28rem;
  }

  .global-search-input {
    min-height: 2.42rem;
  }

  .dashboard-action-card {
    min-width: min(82vw, 280px);
  }

  .trip-actions,
  .orders-actions,
  .customer-card-actions {
    grid-template-columns: 1fr;
  }

  .fc .fc-header-toolbar {
    top: 4.35rem;
  }
}

/* Mobile readability pass: larger text only on small screens */
@media (max-width: 768px) {
  body {
    font-size: 16px;
  }

  .topbar-title {
    font-size: 1.08rem;
  }

  .page-title {
    font-size: clamp(1.22rem, 6vw, 1.42rem);
  }

  .section-tag {
    font-size: 0.76rem;
  }

  .page-subtitle {
    font-size: 0.9rem;
  }

  .form-label,
  .form-label.small,
  .stack-controls label.small,
  .stack-controls .small.fw-semibold,
  .mission-form-grid .form-label,
  .dashboard-mission-grid .form-label {
    font-size: 0.78rem !important;
  }

  .form-control,
  .form-select,
  .choices__inner,
  .global-search-input {
    min-height: 44px;
    font-size: 1rem;
  }

  .btn,
  .btn-sm {
    min-height: 42px;
    font-size: 0.94rem;
  }

  .topbar-actions .btn-sm,
  .notification-toggle,
  .nav-trigger {
    min-width: 44px;
    min-height: 44px;
  }

  .global-help-toggle span {
    display: none;
  }

  .context-help-guide {
    top: auto;
    right: 0.65rem;
    bottom: calc(5.15rem + env(safe-area-inset-bottom));
    left: 0.65rem;
    width: auto;
    max-width: none;
    transform: none;
  }

  .context-help-guide-copy {
    display: grid;
    gap: 0.06rem;
  }

  .context-help-tooltip {
    top: auto !important;
    right: 0.65rem;
    bottom: calc(5.15rem + env(safe-area-inset-bottom));
    left: 0.65rem !important;
    width: auto;
    border-radius: 18px;
  }

  .mobile-bottom-link {
    min-height: 3.35rem;
    font-size: 0.72rem;
  }

  .mobile-bottom-link i {
    font-size: 1.22rem;
  }

  .mobile-create-dock-btn {
    min-height: 3.16rem;
    font-size: 0.9rem;
  }

  #mobileNav .nav-link-side {
    min-height: 3.08rem;
    font-size: 1rem;
  }

  .dashboard-action-body strong {
    font-size: 1.35rem;
  }

  .dashboard-action-body span,
  .orders-process-panel strong,
  .orders-kpi-card span,
  .customers-panel-head h3,
  .panel h3,
  .board-head h3,
  .timeline-title {
    font-size: 0.98rem;
  }

  .dashboard-action-body small,
  .orders-process-panel small,
  .orders-list-help span,
  .customer-card span,
  .customer-job-card span,
  .mission-form-help,
  .small,
  small {
    font-size: 0.84rem;
  }

  .trip-destination,
  .customer-card strong,
  .customer-job-card strong,
  .orders-card h4 {
    font-size: 1.08rem;
  }

  .trip-dates,
  .trip-note,
  .orders-note,
  .orders-material,
  .mission-quick-item .label,
  .mission-quick-item .value {
    font-size: 0.9rem;
  }

  .chip,
  .badge,
  .counter-pill,
  .orders-id,
  .mission-document-type {
    font-size: 0.8rem;
  }

  .modal-title,
  .mission-form-modal .modal-title,
  .dashboard-mission-modal .modal-title,
  .orders-create-modal .modal-title {
    font-size: 1.12rem;
  }

  .modal-body,
  .modal-body p,
  .modal-body li {
    font-size: 0.96rem;
  }

  .fc .fc-toolbar-title {
    font-size: 1.08rem;
  }

  .fc .fc-button {
    min-height: 38px;
    font-size: 0.82rem;
  }

  .fc .fc-daygrid-day-number {
    font-size: 0.88rem;
  }

  .fc .fc-event-line1,
  .fc .fc-event-dest {
    font-size: 0.74rem;
  }

  .fc .fc-event-line2,
  .fc .fc-event-sub,
  .fc .fc-activity-pill {
    font-size: 0.68rem;
  }
}

@media (max-width: 575.98px) {
  .page-title {
    font-size: clamp(1.24rem, 7vw, 1.48rem);
  }

  .mobile-bottom-link {
    font-size: 0.68rem;
  }

  .mobile-create-dock-btn {
    font-size: 0.86rem;
  }

  .trip-destination,
  .orders-card h4,
  .customer-card strong,
  .customer-job-card strong {
    font-size: 1.04rem;
  }

  .topbar-title {
    font-size: 1.02rem;
  }
}

/* Page-by-page mobile refinement: scoped to mobile only */
@media (max-width: 768px) {
  .page-head {
    border-radius: 20px;
    padding: 0.9rem;
  }

  .page-head > div:first-child {
    min-width: 0;
  }

  .dashboard-controls,
  .calendar-filter-panel,
  .hours-filter {
    border-radius: 18px;
  }

  .dashboard-controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .dashboard-controls label {
    margin-bottom: -0.28rem !important;
  }

  .dashboard-column .board-head {
    position: sticky;
    top: 4.72rem;
    z-index: 2;
    margin: -0.7rem -0.7rem 0.72rem;
    padding: 0.72rem;
    border-bottom: 1px solid #dbe6f1;
    border-radius: 18px 18px 0 0;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
  }

  .dashboard-trip-card .trip-actions {
    margin-top: 0.65rem;
  }

  .dashboard-trip-card .trip-actions .btn {
    justify-content: center;
  }

  .calendar-filter-panel #calendarFiltersBody {
    display: grid;
    gap: 0.58rem;
  }

  .calendar-filter-panel .form-label,
  .calendar-filter-panel .form-control,
  .calendar-filter-panel .form-select,
  .calendar-filter-panel .btn {
    margin-bottom: 0 !important;
  }

  .calendar-surface {
    padding: 0.52rem !important;
    border-radius: 18px;
  }

  .fc .fc-daygrid-day-frame {
    min-height: 86px;
  }

  .fc .fc-event-card {
    gap: 0.12rem;
  }

  .fc .fc-status-indicator {
    flex: 0 0 auto;
  }

  .mission-head-actions {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 0.46rem !important;
    width: calc(100vw - 2.2rem) !important;
    overflow-x: auto;
    padding-bottom: 0.18rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .mission-head-actions .btn {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: max-content;
    scroll-snap-align: start;
  }

  .mission-quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.58rem;
  }

  .mission-quick-item {
    min-height: 5rem;
    padding: 0.72rem;
    border-radius: 16px;
  }

  .mission-tabs-wrap {
    position: sticky;
    top: 4.62rem;
    z-index: 5;
    padding: 0.5rem !important;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
  }

  .mission-tabs-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.08rem;
    -webkit-overflow-scrolling: touch;
  }

  .mission-tabs-nav .nav-link {
    flex: 0 0 auto;
    min-height: 2.5rem;
    padding-inline: 0.85rem;
    font-size: 0.92rem;
  }

  .mission-summary-grid {
    grid-template-columns: 1fr !important;
  }

  .mission-summary-item {
    padding: 0.78rem;
    border-radius: 16px;
  }

  .mission-summary-icon {
    width: 36px;
    height: 36px;
    border-radius: 13px;
    font-size: 1.02rem;
  }

  .mission-task-row {
    grid-template-columns: 40px minmax(0, 1fr) !important;
    padding: 0.78rem;
    border-radius: 17px;
  }

  .mission-task-check {
    width: 40px;
    height: 40px;
    border-radius: 14px;
  }

  .mission-task-editor,
  .mission-task-readonly {
    grid-column: 1 / -1 !important;
    grid-template-columns: 1fr !important;
  }

  .mission-task-editor .btn,
  .mission-task-editor .form-select {
    width: 100%;
  }

  .mission-task-create .row > [class*="col-"],
  .mission-task-create .btn {
    width: 100%;
  }

  .mission-order-top {
    flex-direction: column;
  }

  .orders-process-panel {
    display: flex;
    overflow-x: auto;
    gap: 0.6rem;
    padding-bottom: 0.12rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .orders-process-panel article {
    flex: 0 0 min(82vw, 320px);
    scroll-snap-align: start;
  }

  .orders-kpi-grid,
  .hours-kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .orders-card-top,
  .orders-title-line,
  .orders-meta {
    align-items: flex-start;
  }

  .orders-material {
    line-height: 1.5;
  }

  .hours-head {
    align-items: stretch;
  }

  .hours-filter {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    padding: 0.72rem !important;
  }

  .hours-filter label,
  .hours-filter .btn,
  .hours-filter a.btn {
    width: 100%;
  }

  .hours-filter label:last-of-type:nth-child(3) {
    grid-column: 1 / -1;
  }

  .hours-calendar-panel,
  .hours-create-panel,
  .hours-summary-panel,
  .hours-detail-panel,
  .hours-validation-panel,
  .hours-month-status-panel {
    border-radius: 18px;
  }

  .hours-legend {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

  .hours-calendar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.56rem;
  }

  .hours-calendar-day {
    min-height: 112px;
    padding: 0.72rem;
    border-radius: 17px;
  }

  .hours-calendar-date {
    width: 34px;
    height: 34px;
    border-radius: 13px;
    font-size: 1rem;
  }

  .hours-calendar-weekday {
    font-size: 0.82rem;
  }

  .hours-calendar-day strong {
    font-size: 1rem;
  }

  .hours-create-panel fieldset .col-12:last-child {
    flex-direction: column;
    align-items: stretch !important;
  }

  .hours-create-panel button[type="submit"] {
    width: 100%;
  }

  .hours-person-row,
  .hours-day-head,
  .hours-entry {
    align-items: flex-start;
  }

  .hours-person-row,
  .hours-day-head {
    flex-direction: column;
  }

  .hours-person-side {
    width: 100%;
    min-width: 0;
    text-align: left;
  }

  .hours-entry .btn[data-delete-work-hour] {
    width: 100%;
    margin-left: 0 !important;
  }
}

@media (max-width: 575.98px) {
  .dashboard-column .board-head,
  .mission-tabs-wrap {
    top: 4.36rem;
  }

  .mission-quick-grid,
  .orders-kpi-grid,
  .hours-kpi-row,
  .hours-filter,
  .hours-calendar-grid {
    grid-template-columns: 1fr !important;
  }

  .mission-head-actions {
    width: calc(100vw - 1.55rem) !important;
  }

  .mission-head-actions .btn {
    min-width: 9.5rem;
  }

  .orders-process-panel article {
    flex-basis: min(88vw, 340px);
  }

  .calendar-surface .fc .fc-daygrid-day-frame {
    min-height: 78px;
  }

  .fc .fc-event-line1,
  .fc .fc-event-dest {
    font-size: 0.7rem;
  }

  .fc .fc-event-line2,
  .fc .fc-event-sub,
  .fc .fc-activity-pill {
    font-size: 0.64rem;
  }
}
