:root {
  --ink: #18211d;
  --muted: #66736b;
  --line: #d7ded4;
  --paper: #f6f4ed;
  --panel: #ffffff;
  --panel-soft: #edf6fc;
  --forest: #007ec6;
  --teal: #007ec6;
  --mint: #e6f4fc;
  --coral: #9e161a;
  --gold: #007ec6;
  --danger: #9e161a;
  --shadow: 0 18px 50px rgba(24, 33, 29, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(0, 126, 198, 0.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(0, 126, 198, 0.05) 1px, transparent 1px),
    var(--paper);
  background-size: 36px 36px;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(340px, 1.05fr) minmax(360px, 0.95fr);
}

.brand-stage {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 42px;
  color: #f8fbf7;
  background:
    radial-gradient(circle at 20% 20%, rgba(0, 126, 198, 0.96), transparent 38%),
    radial-gradient(circle at 82% 26%, rgba(158, 22, 26, 0.92), transparent 38%),
    radial-gradient(circle at 52% 86%, rgba(0, 126, 198, 0.62), transparent 34%),
    linear-gradient(145deg, #0d2e46 0%, #5b1f35 52%, #9e161a 100%);
}

.brand-stage::after {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  content: "";
  border: 0;
  transform: none;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.16), transparent 24%),
    radial-gradient(circle at 74% 74%, rgba(255, 255, 255, 0.11), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), transparent 45%, rgba(0, 0, 0, 0.16));
  pointer-events: none;
}

.brand-topline,
.brand-ribbon,
.topbar,
.sidebar-brand,
.toolbar,
.data-zone,
.report-layout,
.form-row,
.drawer-head,
.report-head {
  display: flex;
  align-items: center;
}

.brand-topline {
  position: relative;
  z-index: 1;
  gap: 14px;
}

.geo-logo {
  width: 250px;
  height: 105px;
  object-fit: contain;
  padding: 6px 12px;
  border-radius: var(--radius);
  /* background: #007ec6; */
}

.evolutis-logo {
  width: 250px;
  height: 60px;
  object-fit: contain;
  padding: 7px 12px;
  border-radius: var(--radius);
  /* background: #9e161a; */
}

.brand-focus {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-stage .eyebrow {
  color: var(--gold);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 28px;
  font-size: clamp(4.2rem, 8vw, 7.2rem);
  line-height: 0.88;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0;
  font-size: 1.2rem;
}

.status-mosaic {
  display: grid;
  width: min(520px, 100%);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.status-mosaic article {
  min-height: 110px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
}

.status-mosaic span,
.kpi-card span,
.sidebar-brand span,
.report-head span {
  display: block;
  color: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0.68;
}

.status-mosaic strong {
  display: block;
  margin-top: 22px;
  font-size: 2.2rem;
}

.brand-ribbon {
  position: relative;
  z-index: 1;
  gap: 10px;
  flex-wrap: wrap;
}

.brand-ribbon span {
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: #f8fbf7;
  font-size: 0.84rem;
  font-weight: 700;
}

.login-panel {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px;
}

.login-card {
  width: min(440px, 100%);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.login-heading {
  margin-bottom: 24px;
}

.segmented {
  display: inline-flex;
  width: 100%;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.segment {
  flex: 1;
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.segment.active {
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 8px 18px rgba(24, 33, 29, 0.09);
}

.auth-form,
.entry-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  outline: 0;
}

input,
select {
  min-height: 46px;
  padding: 0 42px 0 12px;
  text-overflow: ellipsis;
}

input[type="search"],
input[type="month"] {
  height: 58px;
}

textarea {
  min-height: 104px;
  resize: vertical;
  padding: 12px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0, 126, 198, 0.16);
}

.form-row {
  justify-content: space-between;
  gap: 12px;
}

.checkline {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
}

.checkline input {
  width: 16px;
  min-height: 16px;
}

.ghost-link {
  border: 0;
  color: var(--teal);
  background: transparent;
  font-weight: 800;
}

.primary-action,
.icon-button,
.logout-button,
.row-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
}

.primary-action {
  min-height: 48px;
  gap: 10px;
  padding: 0 18px;
  border-radius: 6px;
  color: #fff;
  background: var(--forest);
  font-weight: 900;
}

.primary-action:hover {
  background: #0069a5;
}

.primary-action.soft {
  color: var(--forest);
  background: var(--mint);
}

.primary-action.soft:hover {
  background: #d6edf9;
}

.primary-action.compact {
  min-height: 42px;
}

.form-alert {
  min-height: 20px;
  color: var(--danger);
  font-size: 0.86rem;
  font-weight: 700;
}

.reset-link-box {
  max-width: 100%;
  margin: 0 0 16px;
  padding: 12px;
  border: 1px solid rgba(0, 126, 198, 0.24);
  border-radius: 6px;
  background: var(--mint);
  color: var(--teal);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.45;
}

.reset-link-box a {
  color: inherit;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.app-shell {
  display: none;
  min-height: 100vh;
  grid-template-columns: 260px minmax(0, 1fr);
}

body.is-authenticated .login-shell {
  display: none;
}

body.is-authenticated .app-shell {
  display: grid;
}

.sidebar {
  position: sticky;
  top: 0;
  display: grid;
  height: 100vh;
  grid-template-rows: auto 1fr;
  padding: 20px;
  color: #edf7f2;
  background:
    radial-gradient(circle at 18% 8%, rgba(0, 126, 198, 0.92), transparent 34%),
    radial-gradient(circle at 86% 92%, rgba(158, 22, 26, 0.9), transparent 36%),
    linear-gradient(165deg, #0b436b 0%, #38405d 46%, #8f1820 100%);
}

.sidebar::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.12), transparent 25%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.12));
  pointer-events: none;
}

.sidebar > * {
  position: relative;
  z-index: 1;
}

.sidebar-brand {
  gap: 12px;
  min-width: 0;
  align-items: flex-start;
}

.sidebar-brand > div {
  min-width: 0;
  flex: 1;
}

.sidebar-avatar {
  display: inline-flex;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--forest);
  background: #fff;
  font-weight: 950;
}

.sidebar-brand strong {
  display: block;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.15;
}

.sidebar-brand strong.medium {
  font-size: 0.93rem;
}

.sidebar-brand strong.long {
  font-size: 0.8rem;
}

.sidebar-brand span:not(.sidebar-avatar) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main-nav {
  display: grid;
  align-content: start;
  gap: 8px;
  margin-top: 34px;
}

.nav-item {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: rgba(237, 247, 242, 0.78);
  background: transparent;
  font-weight: 800;
  padding: 0 14px;
  text-decoration: none;
  text-align: left;
}

.nav-item.active,
.nav-item:hover {
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.workspace {
  min-width: 0;
  padding: 22px clamp(18px, 3vw, 36px) 36px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  justify-content: space-between;
  gap: 18px;
  min-height: 78px;
  margin: -22px calc(clamp(18px, 3vw, 36px) * -1) 22px;
  padding: 16px clamp(18px, 3vw, 36px);
  border-bottom: 1px solid var(--line);
  background: rgba(246, 244, 237, 0.9);
  backdrop-filter: blur(14px);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.export-action {
  display: flex;
  align-items: center;
  gap: 8px;
}

.export-action select,
.export-action input {
  width: 92px;
  min-height: 42px;
  padding-right: 12px;
  font-weight: 800;
}

.export-action input {
  width: 96px;
}

.export-action .export-user-select {
  width: min(260px, 28vw);
}

.export-panel {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
}

.export-panel strong {
  display: block;
  font-size: 1.05rem;
}

.export-panel .eyebrow {
  margin-bottom: 4px;
}

.icon-button,
.row-action {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}

.logout-button {
  min-height: 42px;
  gap: 9px;
  padding: 0 14px;
  border-radius: 6px;
  color: #fff;
  background: var(--coral);
  box-shadow: 0 10px 24px rgba(158, 22, 26, 0.24);
  font-weight: 900;
}

.logout-button:hover {
  background: #7f1014;
}

.logout-button svg {
  width: 19px;
  height: 19px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi-card {
  min-height: 126px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.kpi-card strong {
  display: block;
  margin-top: 16px;
  font-size: 2rem;
  line-height: 1;
}

.kpi-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-weight: 700;
}

.accent-teal {
  border-color: rgba(0, 126, 198, 0.28);
  background: var(--mint);
}

.accent-coral {
  border-color: rgba(158, 22, 26, 0.28);
  background: #fff1f2;
}

.accent-gold {
  border-color: rgba(0, 126, 198, 0.24);
  background: var(--panel-soft);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 254px;
  align-items: end;
  gap: 14px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.toolbar label {
  min-width: 0;
}

.searchbox {
  position: relative;
  min-width: 0;
}

.searchbox-icon {
  position: absolute;
  left: 14px;
  bottom: 17px;
  width: 20px;
  height: 20px;
  color: var(--muted);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  pointer-events: none;
}

.searchbox input {
  padding-left: 40px;
}

.segmented.compact {
  width: auto;
  align-self: end;
}

.segmented.compact .segment {
  flex: none;
  min-width: 86px;
  padding: 0 12px;
}

.data-zone {
  align-items: stretch;
  gap: 14px;
}

.table-wrap {
  flex: 1;
  min-width: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 840px;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: #fbfaf6;
  font-size: 0.78rem;
  text-transform: uppercase;
}

td {
  font-size: 0.92rem;
}

.activity-cell {
  max-width: 440px;
  color: var(--ink);
  line-height: 1.45;
}

.muted {
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--forest);
  background: var(--mint);
  font-size: 0.78rem;
  font-weight: 900;
}

.pill.field {
  color: var(--teal);
  background: var(--panel-soft);
}

.row-actions {
  display: flex;
  gap: 8px;
}

.row-action.danger {
  color: var(--danger);
}

.day-panel {
  width: min(340px, 30vw);
  min-width: 280px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.panel-heading {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.panel-heading strong {
  display: block;
  font-size: 1.35rem;
}

.timeline {
  display: grid;
  gap: 0;
}

.timeline-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.timeline-item strong {
  color: var(--teal);
}

.timeline-item p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.report-layout {
  align-items: flex-start;
  gap: 18px;
}

.report-sheet {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.report-head {
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.report-head img {
  width: 152px;
  height: 48px;
  object-fit: contain;
}

.report-head strong {
  display: block;
  margin-top: 6px;
  font-size: 1.4rem;
}

.report-rows {
  display: grid;
}

.report-row {
  display: grid;
  grid-template-columns: 120px 1fr 90px;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.report-row p {
  margin: 0;
  line-height: 1.45;
}

.report-side {
  display: grid;
  width: 280px;
  gap: 14px;
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.person-card {
  display: grid;
  min-height: 150px;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.person-card strong {
  display: block;
}

.person-card span {
  color: var(--muted);
}

.entry-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  width: min(460px, 100vw);
  height: auto;
  max-height: 100dvh;
  padding: 24px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  border-left: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
  transform: translateX(105%);
  transition: transform 180ms ease;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.entry-drawer.open {
  transform: translateX(0);
}

.drawer-head {
  position: sticky;
  top: -24px;
  z-index: 2;
  justify-content: space-between;
  gap: 18px;
  margin: -24px -24px 0;
  padding: 24px;
  background: #fff;
  border-bottom: 1px solid transparent;
}

.entry-form {
  padding-bottom: 96px;
}

.entry-form > .primary-action {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 8px 0 0;
  box-shadow: 0 -14px 28px rgba(255, 255, 255, 0.92);
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.project-picker {
  position: relative;
  min-width: 0;
}

.project-picker-button {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  font-weight: 800;
}

.project-picker-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-picker-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 8;
  display: none;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: var(--shadow);
}

.project-picker.open .project-picker-menu {
  display: block;
}

.project-picker-menu input {
  min-height: 40px;
  margin-bottom: 8px;
}

.project-picker-list {
  display: grid;
  max-height: min(320px, 42dvh);
  overflow-y: auto;
  gap: 2px;
}

.project-picker-list button {
  min-width: 0;
  min-height: 38px;
  padding: 8px 10px;
  border: 0;
  border-radius: 5px;
  color: var(--ink);
  background: transparent;
  font-size: 0.88rem;
  font-weight: 750;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-picker-list button:hover,
.project-picker-list button.active {
  background: var(--panel-soft);
  color: var(--forest);
}

.manager-toolbar {
  grid-template-columns: minmax(280px, 1fr) 180px;
}

.project-toolbar.with-export {
  grid-template-columns: minmax(260px, 1fr) minmax(520px, auto) 180px;
}

.project-export-form {
  display: grid;
  grid-template-columns: 188px 188px 250px;
  align-items: end;
  gap: 12px;
}

.project-export-form label {
  min-width: 0;
}

.project-export-form .primary-action {
  width: 100%;
}

.manager-stat {
  display: grid;
  min-height: 58px;
  align-content: center;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.manager-stat span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.manager-stat strong {
  font-size: 1.8rem;
  line-height: 1;
}

.management-grid {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}

.management-grid.wide-form {
  grid-template-columns: minmax(330px, 440px) minmax(0, 1fr);
}

.management-grid.viewer-mode {
  grid-template-columns: minmax(0, 1fr);
}

.management-grid.drawer-form-mode,
.management-grid.wide-form.drawer-form-mode,
.cv-layout.drawer-form-mode {
  grid-template-columns: minmax(0, 1fr);
}

.inline-form-drawer.manager-card {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 22;
  width: min(460px, 100vw);
  max-height: 100dvh;
  align-content: start;
  padding: 24px;
  border-radius: 0;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  background: #fff;
  box-shadow: var(--shadow);
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(105%);
  transition: transform 180ms ease;
}

.inline-form-drawer.manager-card.open {
  transform: translateX(0);
}

.inline-form-drawer.manager-card > div:first-of-type {
  margin-right: 56px;
}

.inline-form-drawer.manager-card .form-actions {
  position: sticky;
  bottom: -24px;
  z-index: 2;
  margin: 8px -24px -24px;
  padding: 14px 24px 24px;
  border-top: 1px solid rgba(215, 222, 212, 0.78);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -14px 28px rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
}

.manager-card {
  position: sticky;
  top: 100px;
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 16px 36px rgba(24, 33, 29, 0.08);
}

.manager-card textarea {
  min-height: 130px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.management-table table {
  min-width: 760px;
}

.viewer-mode .management-table table {
  min-width: 0;
  table-layout: fixed;
}

.viewer-mode .management-table th:nth-child(1),
.viewer-mode .management-table td:nth-child(1) {
  width: 130px;
}

.viewer-mode .management-table th:nth-child(3),
.viewer-mode .management-table td:nth-child(3) {
  width: 150px;
}

.viewer-mode .management-table td {
  font-size: 1rem;
  line-height: 1.45;
}

.viewer-mode .management-table .activity-cell {
  max-width: none;
  overflow-wrap: anywhere;
}

.cv-toolbar {
  grid-template-columns: minmax(280px, 1fr) minmax(180px, 260px) 120px;
}

.cv-layout {
  display: grid;
  grid-template-columns: minmax(330px, 420px) minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}

.cv-layout.viewer-mode {
  grid-template-columns: minmax(0, 1fr);
}

.cv-form {
  max-height: min(640px, calc(100dvh - 250px));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-bottom: 0;
}

.cv-form.inline-form-drawer {
  max-height: 100dvh;
}

.cv-form > div:first-of-type {
  position: sticky;
  top: -18px;
  z-index: 2;
  margin: -18px -18px 0;
  padding: 18px 18px 12px;
  border-bottom: 1px solid rgba(215, 222, 212, 0.78);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.cv-form .form-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 0 -18px;
  padding: 12px 18px 18px;
  border-top: 1px solid rgba(215, 222, 212, 0.78);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -14px 28px rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
}

.cv-form.inline-form-drawer .form-actions {
  bottom: -24px;
  margin: 8px -24px -24px;
  padding: 14px 24px 24px;
}

.cv-form label {
  min-width: 0;
}

.cv-table table {
  min-width: 0;
  table-layout: fixed;
}

.cv-table th,
.cv-table td {
  padding: 12px 10px;
}

.cv-table th:nth-child(1),
.cv-table td:nth-child(1) {
  width: 20%;
}

.cv-table th:nth-child(2),
.cv-table td:nth-child(2) {
  width: 25%;
}

.cv-table th:nth-child(3),
.cv-table td:nth-child(3) {
  width: 19%;
}

.cv-table th:nth-child(4),
.cv-table td:nth-child(4) {
  width: 18%;
}

.cv-table th:nth-child(5),
.cv-table td:nth-child(5) {
  width: 98px;
}

.cv-table th:nth-child(6),
.cv-table td:nth-child(6) {
  width: 92px;
}

.cv-speciality-field {
  position: relative;
  display: grid;
  gap: 8px;
  min-width: 0;
}

.cv-speciality-field > select {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.cv-speciality-button {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  font-weight: 850;
}

.cv-speciality-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cv-speciality-chips {
  display: flex;
  min-height: 32px;
  flex-wrap: wrap;
  gap: 6px;
}

.cv-speciality-chip {
  display: inline-flex;
  max-width: 100%;
  min-height: 30px;
  align-items: center;
  gap: 6px;
  padding: 0 8px 0 10px;
  border: 0;
  border-radius: 999px;
  color: var(--forest);
  background: var(--mint);
  font-size: 0.76rem;
  font-weight: 900;
}

.cv-speciality-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cv-speciality-chip svg {
  width: 14px;
  height: 14px;
}

.cv-speciality-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 8;
  display: none;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: var(--shadow);
}

.cv-speciality-field.open .cv-speciality-menu {
  display: block;
}

.searchbox.compact {
  min-height: 42px;
  margin-bottom: 8px;
}

.searchbox.compact .searchbox-icon {
  bottom: 11px;
}

.cv-speciality-options {
  display: grid;
  max-height: min(260px, 38dvh);
  overflow-y: auto;
  gap: 4px;
}

.cv-speciality-option {
  display: flex;
  grid-template-columns: none;
  min-height: 38px;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: 5px;
  cursor: pointer;
}

.cv-speciality-option:hover {
  background: var(--panel-soft);
}

.cv-speciality-option input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--forest);
}

.empty-state.compact {
  display: block;
  padding: 10px;
}

.cv-table td span {
  display: block;
}

.cv-table td,
.cv-table .activity-cell {
  max-width: none;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.cv-table .primary-action.compact {
  min-height: 38px;
  padding: 0 10px;
  gap: 6px;
  font-size: 0.82rem;
}

.cv-table .row-actions {
  gap: 6px;
}

.cv-table .row-action {
  width: 36px;
  height: 36px;
}

.cv-table .pill {
  display: inline-flex;
  max-width: 100%;
  margin: 2px 4px 2px 0;
  white-space: normal;
}

.cv-file-tabs {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}

.cv-file-form {
  display: grid;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.cv-file-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding-bottom: 28px;
}

.cv-file-card,
.empty-state {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.cv-file-card strong,
.cv-file-card small,
.cv-file-card p {
  display: block;
  margin: 8px 0 0;
}

.cv-file-card p,
.cv-file-card small,
.empty-state {
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: var(--radius);
  color: #fff;
  background: var(--forest);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
  font-weight: 800;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1100px) {
  .kpi-grid,
  .people-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .data-zone,
  .report-layout {
    flex-direction: column;
  }

  .day-panel,
  .report-side {
    width: 100%;
  }
}

@media (max-width: 840px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .brand-stage {
    min-height: 44vh;
    padding: 26px;
  }

  .login-panel {
    min-height: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    grid-template-rows: auto auto auto;
  }

  .main-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 18px;
  }

  .nav-item {
    justify-content: center;
    padding: 0 10px;
  }

  .sidebar-footer {
    margin-top: 16px;
  }

  .toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .export-panel {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .export-action,
  .export-action .export-user-select,
  .export-action input,
  .export-action select {
    width: 100%;
  }

  .manager-toolbar {
    grid-template-columns: 1fr;
  }

  .project-toolbar.with-export {
    grid-template-columns: 1fr;
  }

  .project-export-form {
    grid-template-columns: 1fr;
  }

  .management-grid,
  .management-grid.wide-form {
    grid-template-columns: 1fr;
  }

  .manager-card {
    position: static;
  }

  .cv-form {
    max-height: none;
    overflow: visible;
  }

  .cv-form > div:first-of-type,
  .cv-form .form-actions {
    position: static;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .toolbar label,
  .searchbox {
    min-width: 0;
  }
}

@media (max-width: 620px) {
  .brand-topline,
  .topbar,
  .form-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .status-mosaic,
  .kpi-grid,
  .people-grid,
  .split {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .main-nav {
    grid-template-columns: 1fr;
  }

  .segmented.compact {
    width: 100%;
  }

  .segmented.compact .segment {
    min-width: 0;
    flex: 1;
  }

  .report-row {
    grid-template-columns: 1fr;
  }

  .entry-drawer {
    width: 100vw;
    padding: 18px;
  }

  .drawer-head {
    top: -18px;
    margin: -18px -18px 0;
    padding: 18px;
  }
}


/* application */

.applications-intro {
  position: static;
  margin-bottom: 16px;
}

.applications-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.application-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 12px;
  min-height: 110px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  text-decoration: none;
}

.application-card:hover {
  transform: translateY(-2px);
}