:root {
  color-scheme: light;
  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface-2: #f8faf9;
  --mint: #e6f1eb;
  --blue-soft: #eaf2f6;
  --line: #d9dfdc;
  --line-strong: #b8c4bf;
  --text: #17211d;
  --muted: #64706b;
  --green: #277354;
  --green-dark: #1f5c43;
  --blue: #2f657f;
  --red: #a33a36;
  --amber: #9b6b14;
  --shadow: 0 6px 20px rgba(23, 33, 29, 0.06);
  --shadow-hover: 0 8px 24px rgba(23, 33, 29, 0.08);
  --radius: 7px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ease-standard: 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-emphasized: 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  letter-spacing: 0;
}

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

button {
  border: 0;
  cursor: pointer;
  transition:
    transform var(--ease-standard),
    box-shadow var(--ease-standard),
    background-color var(--ease-standard),
    border-color var(--ease-standard),
    color var(--ease-standard),
    opacity var(--ease-standard);
}

button:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.app-shell {
  min-height: 100vh;
  display: block;
}

.app-nav {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 256px;
  height: 100dvh;
  overflow: hidden;
  background: #1d1f1e;
  color: #ffffff;
  padding: 18px 12px 12px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  border-right: 1px solid #303331;
}

.nav-brand {
  min-height: 56px;
  display: grid;
  align-items: center;
  padding: 0 8px 14px;
  border-bottom: 1px solid #343735;
}

.nav-brand-logo {
  display: block;
  width: min(100%, 174px);
  height: auto;
  max-height: 54px;
  object-fit: contain;
  object-position: left center;
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 11px;
  background: linear-gradient(145deg, #e6f2ec, #c8ded3);
  color: #153026;
  font-weight: 850;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
}

.brand-mark.large {
  width: 48px;
  height: 48px;
  font-size: 22px;
}

.nav-list {
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-content: start;
  gap: 2px;
  padding: 0 2px 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.nav-section-label {
  margin: 15px 10px 5px;
  color: #747a76;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-section-label:first-child {
  margin-top: 2px;
}

.nav-item {
  position: relative;
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #afb4b1;
  text-align: left;
  font-size: 13px;
  font-weight: 650;
  transition:
    background-color var(--ease-standard),
    color var(--ease-standard);
}

.nav-item svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  opacity: 0.8;
}

.nav-item:hover {
  background: #282b29;
  color: #ffffff;
}

.nav-item.active {
  border-color: transparent;
  background: #303431;
  color: #ffffff;
  box-shadow: inset 3px 0 0 #65997d;
}

.nav-item.active svg {
  color: #8db9a2;
  opacity: 1;
}

.nav-item:active {
  transform: none;
}

.nav-account {
  min-width: 0;
  padding: 13px 8px 2px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 9px;
  border: 0;
  border-top: 1px solid #343735;
  border-radius: 0;
  background: transparent;
}

.nav-account-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid #454a47;
  border-radius: 4px;
  background: #2a2d2b;
  color: #d5d9d6;
  font-size: 11px;
  font-weight: 850;
}

.nav-account-copy {
  min-width: 0;
}

.nav-account-copy strong,
.nav-account-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-account-copy strong {
  font-size: 12px;
}

.nav-account-copy small {
  margin-top: 2px;
  color: #7f8581;
  font-size: 10px;
}

.nav-account-logout {
  width: 32px;
  height: 32px;
  padding: 7px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: transparent;
  color: #858b87;
}

.nav-account-logout:hover {
  background: #2b2e2c;
  color: #ffffff;
}

.nav-account-logout svg {
  width: 16px;
  height: 16px;
}

.app-main {
  min-width: 0;
  min-height: 100vh;
  margin-left: 256px;
  display: grid;
  grid-template-rows: 84px minmax(0, 1fr);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 5px 20px rgba(23, 33, 29, 0.035);
}

.top-logout {
  display: none;
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
}

.topbar p {
  margin: 5px 0 0;
  color: var(--muted);
}

.top-actions,
.hero-actions,
.profile-actions,
.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-stat-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 10px;
}

.hero-stat-card {
  min-height: 88px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(23, 33, 29, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(4px);
}

.hero-stat-card span,
.hero-stat-card small {
  color: var(--muted);
  font-size: 12px;
}

.hero-stat-card strong {
  font-size: 22px;
}

.status-pill {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fbfcfc;
  white-space: nowrap;
}

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

.dot.api {
  background: var(--blue);
}

.workspace {
  min-width: 0;
  overflow: auto;
  padding: 30px;
  display: grid;
  gap: 16px;
  align-content: start;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--ease-emphasized), transform var(--ease-emphasized);
}

.workspace.view-ready {
  opacity: 1;
  transform: translateY(0);
}

.hero-band,
.toolbar-band,
.profile-hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-band {
  min-height: 150px;
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.74)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='280' viewBox='0 0 900 280'%3E%3Crect width='900' height='280' fill='%23dfece6'/%3E%3Cg fill='none' stroke='%2394aaa0' stroke-width='2' opacity='.65'%3E%3Cpath d='M58 62h180v120H58zM290 62h240v55H290zM290 145h240v70H290zM590 62h250v153H590z'/%3E%3Cpath d='M92 92h110M92 122h84M325 92h160M325 178h130M625 92h170M625 126h125M625 160h146'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
}

.hero-band h2,
.profile-hero h2,
.login-visual h1 {
  margin: 4px 0 6px;
  font-size: 30px;
  line-height: 1.1;
}

.hero-band p,
.profile-hero p,
.login-visual p {
  margin: 0;
  color: var(--muted);
}

.eyebrow {
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

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

.metric,
.info-tile,
.summary-block {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px;
  box-shadow: var(--shadow);
}

.metric,
.info-tile,
.summary-block,
.panel,
.toolbar-band,
.filter-band,
.catalog-card,
.directory-item,
.schedule-row,
.user-row,
.timeline-card,
.message-recipient,
.template-card,
.mini-client,
.hero-band,
.profile-hero {
  transition:
    transform var(--ease-standard),
    box-shadow var(--ease-standard),
    border-color var(--ease-standard),
    background-color var(--ease-standard);
}

.metric:hover,
.panel:hover,
.catalog-card:hover,
.directory-item:hover,
.schedule-row:hover,
.user-row:hover,
.template-card:hover {
  transform: none;
  box-shadow: var(--shadow-hover);
}

.today-command-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(180px, 0.75fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.today-command {
  min-width: 0;
  padding: 17px 18px;
  border-right: 1px solid var(--line);
}

.today-command:last-child {
  border-right: 0;
}

.today-command.primary-command {
  box-shadow: inset 3px 0 0 var(--green);
}

.today-command span,
.today-command strong,
.today-command small {
  display: block;
}

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

.today-command strong {
  margin-top: 6px;
  font-size: 21px;
  overflow-wrap: anywhere;
}

.today-command small {
  margin-top: 4px;
  color: var(--muted);
}

.dashboard-today-panel .timeline.expanded {
  min-height: 360px;
}

.metric span,
.summary-block span,
.info-tile span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.metric strong,
.summary-block strong {
  display: block;
  margin: 6px 0;
  font-size: 30px;
  line-height: 1;
}

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

.dashboard-grid,
.schedule-layout,
.clients-layout,
.messages-layout,
.settings-grid,
.users-layout {
  display: grid;
  gap: 16px;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
}

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

.activity-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 16px;
}

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

.clients-toolbar {
  min-height: 82px;
  padding: 14px 16px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.98), rgba(241, 247, 244, 0.86));
}

.clients-toolbar-heading {
  flex: 0 0 auto;
}

.clients-toolbar-heading h2,
.clients-toolbar-heading p {
  margin: 0;
}

.clients-toolbar-heading h2 {
  margin-top: 2px;
  font-size: 21px;
}

.clients-toolbar-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.client-search-wrap {
  width: min(480px, 100%);
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.client-search-box {
  position: relative;
  flex: 1;
}

.client-search-box:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(39, 115, 84, 0.1);
}

.search-clear {
  width: 28px;
  height: 28px;
  padding: 6px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
}

.search-clear:hover {
  background: var(--mint);
  color: var(--green-dark);
}

.search-clear svg {
  width: 14px;
  height: 14px;
}

.search-clear.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

.client-result-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.directory {
  position: sticky;
  top: 16px;
  overflow: hidden;
}

.directory-head {
  min-height: 58px;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #fafcfb);
}

.directory-head h3 {
  margin: 2px 0 0;
  font-size: 15px;
}

.directory-total {
  min-width: 34px;
  height: 28px;
  padding: 0 9px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--mint);
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 820;
}

.directory .directory-list {
  max-height: calc(100vh - 210px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

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

.message-panel-wide {
  grid-column: 1 / -1;
}

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

.working-hours-form {
  display: grid;
  gap: 10px;
}

.working-hours-row {
  min-height: 74px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: minmax(180px, 0.75fr) minmax(260px, 1fr);
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, #f7faf8);
}

.working-day {
  display: grid;
  gap: 8px;
}

.working-day strong {
  font-size: 14px;
}

.working-day .check-line {
  min-height: auto;
  color: var(--muted);
  font-size: 12px;
}

.working-time-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
}

.working-time-fields .field {
  margin: 0;
}

.working-time-fields input:disabled {
  opacity: 0.55;
  background: #eef2f0;
}

.users-layout {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  align-items: start;
}

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

.panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.btn:active,
.icon-btn:active,
.nav-item:active,
.directory-item:active,
.schedule-row:active,
.user-row:active,
.catalog-card:active {
  transform: translateY(1px) scale(0.99);
}

.panel-head {
  min-height: 56px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-title {
  margin: 0;
  font-size: 15px;
  font-weight: 780;
}

.panel-body {
  padding: 16px;
}

.toolbar-band {
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.filter-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr)) auto;
  align-items: end;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.schedule-filter-band {
  padding: 12px;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
}

.schedule-filter-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 10px;
  border-bottom: 1px solid var(--line);
}

.schedule-filter-heading span,
.schedule-filter-heading small {
  display: block;
}

.schedule-filter-heading span {
  font-size: 13px;
  font-weight: 820;
}

.schedule-filter-heading small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.filter-clear {
  padding: 5px 8px;
  background: transparent;
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 800;
}

.filter-clear:hover {
  background: var(--mint);
}

.schedule-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding: 4px 2px 0;
}

.schedule-section-heading span,
.schedule-section-heading small {
  display: block;
}

.schedule-section-heading span {
  font-size: 15px;
  font-weight: 820;
}

.schedule-section-heading small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.btn.quiet {
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--green-dark);
}

.btn.quiet.is-current {
  color: var(--muted);
  background: #f2f5f3;
}

.reports-filter-band,
.activity-filter-band {
  margin-bottom: 16px;
}

.quick-actions,
.filter-summary {
  display: flex;
  align-items: end;
  gap: 10px;
}

.filter-summary {
  min-height: 44px;
  padding-bottom: 6px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
}

.summary-hero {
  background:
    linear-gradient(180deg, rgba(39, 115, 84, 0.08), rgba(39, 115, 84, 0.02)),
    var(--surface);
}

.accent-blue {
  background:
    linear-gradient(180deg, rgba(47, 101, 127, 0.08), rgba(47, 101, 127, 0.02)),
    var(--surface);
}

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

.schedule-date-banner {
  position: relative;
  overflow: hidden;
  min-height: 126px;
  padding: 24px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-radius: var(--radius);
  color: #fff;
  background:
    radial-gradient(circle at 82% 10%, rgba(255, 255, 255, 0.16), transparent 34%),
    linear-gradient(135deg, var(--green-dark), #245f49);
  box-shadow: var(--shadow);
}

.schedule-date-kicker {
  display: block;
  margin-bottom: 5px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.schedule-date-banner h2,
.schedule-date-banner p {
  margin: 0;
}

.schedule-date-banner h2 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1;
}

.schedule-date-banner p {
  margin-top: 9px;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 650;
}

.schedule-date-count {
  min-width: 90px;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  text-align: center;
  backdrop-filter: blur(8px);
}

.schedule-date-count strong,
.schedule-date-count span {
  display: block;
}

.schedule-date-count strong {
  font-size: 30px;
  line-height: 1;
}

.schedule-date-count span {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 700;
}

.schedule-date-banner.is-changed,
.schedule-day-content.is-changed {
  animation: calendarSoftReveal 180ms ease-out;
}

@keyframes calendarSoftReveal {
  from { opacity: 0.72; }
  to { opacity: 1; }
}

.month-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.month-overview {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.month-overview summary {
  min-height: 62px;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  list-style: none;
}

.month-overview summary::-webkit-details-marker {
  display: none;
}

.month-overview summary span,
.month-overview summary small {
  display: block;
}

.month-overview summary b {
  font-size: 13px;
}

.month-overview summary small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.month-overview summary > strong {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--green-dark);
  font-size: 13px;
}

.month-overview summary > strong::after {
  content: "+";
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--mint);
  font-size: 16px;
}

.month-overview[open] summary {
  border-bottom: 1px solid var(--line);
}

.month-overview[open] summary > strong::after {
  content: "−";
}

.month-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  padding: 12px 12px 0;
}

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

.month-overview .month-board {
  padding: 8px 12px 12px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.month-day {
  position: relative;
  min-height: 54px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.month-day:hover {
  border-color: #aac8bb;
  transform: translateY(-1px);
}

.month-day span {
  font-weight: 780;
}

.month-count {
  min-width: 23px;
  height: 23px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--mint);
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 850;
}

.month-day.muted {
  opacity: 0.46;
}

.month-day.active {
  border-color: var(--green);
  box-shadow: inset 0 0 0 2px var(--green), 0 4px 12px rgba(24, 70, 55, 0.12);
}

.month-day.active .month-count {
  background: var(--green-dark);
  color: #fff;
}

.day-tile {
  position: relative;
  overflow: hidden;
  min-height: 108px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  box-shadow: var(--shadow);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.day-tile:hover {
  border-color: #aac8bb;
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(24, 70, 55, 0.1);
}

.day-tile.active {
  background: var(--green-dark);
  border-color: var(--green-dark);
  color: #fff;
  box-shadow: 0 8px 20px rgba(24, 70, 55, 0.2);
  animation: selectedDayConfirm 220ms ease-out;
}

@keyframes selectedDayConfirm {
  from { box-shadow: 0 0 0 3px rgba(39, 115, 84, 0.12), 0 8px 20px rgba(24, 70, 55, 0.2); }
  to { box-shadow: 0 8px 20px rgba(24, 70, 55, 0.2); }
}

.day-tile.active span,
.day-tile.active small {
  color: rgba(255, 255, 255, 0.72);
}

.day-tile .day-name,
.day-tile .day-count {
  color: var(--muted);
}

.day-tile strong {
  font-size: 24px;
}

.day-count {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef5f1;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.day-count b {
  color: var(--green-dark);
  font-size: 12px;
}

.day-tile.is-empty .day-count {
  background: transparent;
  padding-left: 0;
  opacity: 0.7;
}

.day-load {
  position: absolute;
  right: 12px;
  bottom: 9px;
  left: 12px;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7efeb;
}

.day-load span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.day-tile.active .day-count {
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.78);
}

.day-tile.active .day-name {
  color: rgba(255, 255, 255, 0.72);
}

.day-tile.active .day-count b {
  color: #fff;
}

.day-tile.active .day-load {
  background: rgba(255, 255, 255, 0.14);
}

.day-tile.active .day-load span {
  background: #b9ead1;
}

.timeline {
  padding: 14px 16px 16px;
}

.timeline.expanded {
  min-height: 460px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
}

.stagger-item {
  opacity: 0;
  transform: translateY(10px);
  animation: staggerIn 420ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: calc(min(var(--stagger, 0), 8) * 36ms);
}

@keyframes staggerIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.timeline-item time {
  color: var(--muted);
  font-weight: 800;
}

.timeline-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 12px;
  border-left: 3px solid #9ab9aa;
}

.timeline-card.status-completed { border-left-color: #4a8f70; }
.timeline-card.status-confirmed { border-left-color: #3e7791; }
.timeline-card.status-arrived { border-left-color: #8b6f30; }
.timeline-card.status-cancelled { border-left-color: #c87474; opacity: 0.78; }
.timeline-card.status-no_show { border-left-color: #d49a52; }

.schedule-empty {
  min-height: 390px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 32px;
  text-align: center;
}

.schedule-empty-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  border-radius: 14px;
  background: var(--mint);
  color: var(--green-dark);
}

.schedule-empty-mark svg {
  width: 22px;
  height: 22px;
}

.schedule-empty strong {
  font-size: 16px;
}

.schedule-empty p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.timeline-card > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.timeline-card strong {
  display: block;
}

.timeline-card span,
.timeline-card p {
  color: var(--muted);
}

.timeline-card p {
  margin: 8px 0 10px;
}

.appointment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.appointment-meta span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef2f0;
}

.status-badge.scheduled {
  background: var(--blue-soft);
  color: var(--blue);
}

.status-badge.completed {
  background: var(--mint);
  color: var(--green-dark);
}

.status-badge.confirmed {
  background: var(--blue-soft);
  color: var(--blue);
}

.status-badge.arrived {
  background: #f6eedc;
  color: #765818;
}

.status-badge.cancelled,
.status-badge.no_show {
  background: #f4e6e4;
  color: var(--red);
}

.quick-status {
  min-width: 132px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.quick-status span {
  font-size: 10px;
  font-weight: 760;
}

.quick-status select {
  min-height: 36px;
  padding: 6px 28px 6px 8px;
  font-size: 11px;
}

.client-strip,
.directory-list,
.attention-list,
.schedule-list,
.message-templates,
.message-recipient-list,
.user-list,
.role-board {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.mini-client,
.directory-item,
.attention-row,
.schedule-row,
.template-card,
.message-recipient,
.user-row,
.role-card {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--text);
  text-align: left;
}

.mini-client,
.directory-item {
  grid-template-columns: 42px minmax(0, 1fr) auto;
}

.message-recipient {
  grid-template-columns: 42px minmax(0, 1fr) auto;
}

.mini-client {
  grid-template-columns: 42px minmax(0, 1fr);
}

.mini-client:hover,
.directory-item:hover,
.directory-item.active,
.attention-row:hover,
.schedule-row:hover,
.template-card:hover,
.user-row:hover {
  background: var(--mint);
}

.directory-item:hover {
  transform: none;
  border-color: #b8cfc4;
  box-shadow: 0 6px 16px rgba(24, 70, 55, 0.07);
}

.directory-item.active {
  border-color: #8cb4a2;
  box-shadow: inset 3px 0 0 var(--green), 0 8px 18px rgba(24, 70, 55, 0.08);
}

.directory-item.active .avatar {
  background: var(--green-dark);
  color: #ffffff;
}

.mini-client strong,
.directory-item strong,
.attention-row strong,
.schedule-row strong,
.template-card strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.mini-client small,
.directory-item small,
.attention-row span,
.schedule-row span,
.schedule-row em,
.template-card span {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.directory-treatment-count {
  display: grid;
  justify-items: center;
  gap: 3px;
}

.directory-treatment-count b {
  min-width: 28px;
  min-height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
}

.directory-treatment-count small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 760;
}

.directory-copy {
  min-width: 0;
}

.directory-copy strong,
.directory-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.directory-copy .missing-contact {
  color: var(--amber);
}

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

.catalog-card {
  min-width: 0;
  display: grid;
  gap: 16px;
  align-content: space-between;
  min-height: 220px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.catalog-card h3 {
  margin: 6px 0;
  font-size: 18px;
  line-height: 1.2;
}

.catalog-card p {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.template-card-wrap {
  display: grid;
  gap: 8px;
}

.messages-hero,
.settings-hero {
  min-height: 164px;
}

.catalog-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.catalog-meta strong,
.catalog-meta span,
.muted-pill,
.status-pill.small,
.role-pills span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef2f0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.catalog-meta strong {
  background: var(--mint);
  color: var(--green-dark);
}

.muted-pill {
  background: #f1f1ee;
}

.status-pill.small {
  border: 0;
  background: var(--blue-soft);
  color: var(--blue);
}

.user-row {
  grid-template-columns: 42px minmax(0, 1fr) minmax(140px, auto) auto;
}

.user-row small {
  display: block;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.role-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.role-card {
  align-content: center;
  min-height: 76px;
}

.role-card span {
  color: var(--muted);
}

.report-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.activity-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.report-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.report-row strong,
.report-row small {
  display: block;
}

.report-row small {
  color: var(--muted);
}

.report-row b {
  white-space: nowrap;
}

.audit-row {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.audit-row strong,
.audit-row small,
.audit-row time {
  display: block;
}

.audit-row small,
.audit-row time,
.audit-row p {
  color: var(--muted);
}

.audit-row p {
  margin: 0;
  overflow-wrap: anywhere;
}

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

.archive-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.archive-row strong,
.archive-row small {
  display: block;
}

.archive-row small {
  color: var(--muted);
}

.finance-side-panel,
.activity-side-panel {
  display: grid;
  align-content: start;
}

.finance-note {
  display: grid;
  gap: 4px;
  margin: 0 12px 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(39, 115, 84, 0.06), rgba(39, 115, 84, 0.01));
}

.finance-note span,
.finance-note small,
.summary-signal span {
  color: var(--muted);
}

.finance-note strong,
.summary-signal strong {
  font-size: 22px;
}

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

.summary-signal {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.skeleton-grid {
  display: grid;
  gap: 12px;
}

.skeleton-grid.metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.skeleton-row,
.skeleton-card,
.skeleton-metric {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(90deg, #eef2f0 0%, #f8faf9 50%, #eef2f0 100%);
  background-size: 220% 100%;
  animation:
    shimmer 1.2s linear infinite,
    staggerIn 320ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: 0s, calc(min(var(--stagger, 0), 8) * 28ms);
}

.skeleton-row {
  min-height: 84px;
}

.skeleton-card {
  min-height: 220px;
}

.skeleton-metric {
  min-height: 116px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.check-line {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 760;
}

.check-line input {
  width: 18px;
  height: 18px;
}

.profile-view {
  display: grid;
  gap: 14px;
}

.profile-hero {
  padding: 18px;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.client-profile-hero {
  min-height: 112px;
  padding: 18px 20px;
  border-color: #cbd9d2;
  background:
    radial-gradient(circle at 80% 0, rgba(39, 115, 84, 0.1), transparent 38%),
    var(--surface);
}

.client-mobile-back {
  display: none;
}

.client-profile-hero .avatar.xl {
  width: 76px;
  height: 76px;
  border: 1px solid #bcd2c7;
  border-radius: 16px;
  background: linear-gradient(145deg, #e4f0ea, #cfe3d9);
  font-size: 24px;
}

.profile-identity {
  min-width: 0;
}

.profile-contact-line {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--muted);
  font-size: 12px;
}

.profile-contact-line span {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  overflow-wrap: anywhere;
}

.profile-contact-line svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: var(--green);
}

.client-profile-hero .profile-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.client-profile-tabs {
  min-height: 46px;
  padding: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #edf2ef;
}

.client-profile-tabs button {
  min-height: 36px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 780;
}

.client-profile-tabs button:hover {
  color: var(--text);
}

.client-profile-tabs button.active {
  background: var(--surface);
  color: var(--green-dark);
  box-shadow: 0 3px 10px rgba(23, 33, 29, 0.08);
}

.client-profile-tabs button span {
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--mint);
  color: var(--green-dark);
  font-size: 10px;
}

.client-at-a-glance {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.client-at-a-glance > div {
  min-width: 0;
  padding: 14px 16px;
  border-right: 1px solid var(--line);
}

.client-at-a-glance > div:last-child {
  border-right: 0;
}

.client-at-a-glance > div.next {
  box-shadow: inset 3px 0 0 var(--green);
}

.client-at-a-glance span,
.client-at-a-glance strong,
.client-at-a-glance small {
  display: block;
}

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

.client-at-a-glance strong {
  margin-top: 5px;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.client-at-a-glance small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

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

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

.client-info-grid .info-tile {
  padding: 5px 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.client-general-note {
  margin: 2px 16px 16px;
  padding: 12px 4px 0;
  border-top: 1px solid var(--line);
}

.client-general-note span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.client-general-note p {
  margin: 5px 0 0;
  line-height: 1.5;
}

.profile-record-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(230px, 0.55fr);
  gap: 12px;
}

.profile-side-notes,
.notes-grid {
  display: grid;
  gap: 10px;
}

.profile-side-notes .summary-signal span,
.profile-side-notes .summary-signal strong {
  display: block;
}

.client-care-panel .summary-signal {
  padding: 4px 0 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.client-care-panel .summary-signal:last-child {
  padding-bottom: 4px;
  border-bottom: 0;
}

.profile-side-notes .summary-signal span {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-side-notes .summary-signal strong {
  margin-top: 6px;
  font-size: 16px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.profile-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.note-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.note-card span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
}

.note-card strong {
  display: block;
  overflow-wrap: anywhere;
}

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

.client-notes-grid .note-card {
  padding: 5px 12px;
  border: 0;
  border-left: 2px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
}

.note-card.has-warning {
  border-left-color: #c58b26;
  background: linear-gradient(90deg, #fff8e9, transparent);
}

.note-card.has-warning span {
  color: var(--amber);
  font-weight: 800;
}

.history-count {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.client-history-panel {
  min-height: 320px;
}

.info-tile svg {
  width: 20px;
  height: 20px;
  color: var(--green);
}

.info-tile strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #dcebe3;
  color: var(--green-dark);
  font-weight: 820;
}

.avatar.xl {
  width: 72px;
  height: 72px;
  font-size: 22px;
}

.side-summary {
  display: grid;
  gap: 12px;
}

.side-summary.schedule-insights {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.schedule-insights .summary-block {
  padding: 14px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.schedule-insights .summary-block:first-child {
  grid-column: 1 / -1;
}

.schedule-insights .summary-block:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.schedule-insights .summary-block strong {
  font-size: 22px;
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: #e5ebe8;
  overflow: hidden;
}

.progress i {
  display: block;
  height: 100%;
  background: var(--green);
}

.search-box,
.date-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-box {
  width: min(420px, 100%);
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #ffffff;
}

.search-box svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.search-box input {
  border: 0;
  padding: 0;
  min-height: 38px;
}

.danger-zone {
  display: flex;
  justify-content: flex-end;
}

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

.field-grid.compact {
  gap: 10px;
}

.form-intro {
  margin-bottom: 16px;
}

.form-intro p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.appointment-core {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.appointment-preview {
  min-height: 58px;
  margin-top: 12px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-left: 3px solid var(--green);
  background: #f1f6f3;
  color: var(--muted);
  font-size: 12px;
}

.appointment-preview span,
.appointment-preview strong {
  display: flex;
  align-items: center;
  gap: 6px;
}

.appointment-preview svg {
  width: 15px;
  height: 15px;
  color: var(--green);
}

.appointment-preview b {
  color: var(--text);
}

.appointment-preview.has-conflict {
  display: grid;
  justify-content: start;
  border-left-color: var(--red);
  background: #fff2f1;
  color: var(--red);
}

.form-details {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.form-details summary {
  padding: 13px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 780;
}

.form-details summary span {
  margin-left: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.form-details .field-grid {
  padding: 0 14px 14px;
}

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

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

label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

input,
textarea,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--text);
  padding: 9px 10px;
  outline: none;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 101, 127, 0.15);
}

.btn,
.icon-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-weight: 760;
}

.btn {
  gap: 8px;
  padding: 0 12px;
  border: 1px solid transparent;
  background: #e8efec;
  color: var(--text);
  white-space: nowrap;
}

.btn svg,
.icon-btn svg {
  width: 17px;
  height: 17px;
}

.btn.primary {
  background: var(--green);
  color: #ffffff;
}

.btn.primary:hover {
  background: var(--green-dark);
}

.btn.secondary,
.icon-btn {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
}

.btn.secondary:hover,
.icon-btn:hover {
  background: var(--blue-soft);
}

.btn.danger {
  background: #f4e6e4;
  color: var(--red);
}

.icon-btn {
  width: 44px;
  padding: 0;
}

.timeline-client-btn {
  width: auto;
  min-width: 82px;
  gap: 6px;
  padding: 0 10px;
  font-size: 12px;
}

.timeline-client-btn svg {
  width: 15px;
  height: 15px;
}

.btn:focus-visible,
.icon-btn:focus-visible,
.nav-item:focus-visible,
.directory-item:focus-visible,
.schedule-row:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(39, 115, 84, 0.18);
}

.button-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.empty {
  min-height: 96px;
  padding: 28px 18px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.empty strong {
  color: var(--text);
  font-size: 14px;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(244, 246, 245, 0.86), rgba(244, 246, 245, 0.98)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='760' viewBox='0 0 1200 760'%3E%3Crect width='1200' height='760' fill='%23dfece6'/%3E%3Cg fill='none' stroke='%2394aaa0' stroke-width='2' opacity='.65'%3E%3Cpath d='M140 130h240v420H140zM430 130h330v160H430zM430 330h330v220H430zM810 130h250v420H810z'/%3E%3Cpath d='M180 190h150M180 235h112M180 280h154M470 190h230M470 235h170M470 390h220M850 190h160M850 235h120M850 280h150M850 390h140'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
}

.login-panel {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.login-visual {
  padding: 38px;
  display: grid;
  align-content: end;
  min-height: 420px;
  background: #19352b;
  color: #ffffff;
}

.login-visual p {
  color: rgba(255, 255, 255, 0.76);
  max-width: 420px;
}

.login-form {
  padding: 32px;
  display: grid;
  align-content: center;
  gap: 14px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f1f4f3;
}

.segment {
  min-height: 34px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 760;
}

.segment.active {
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(23, 33, 29, 0.08);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(10, 18, 15, 0.42);
  opacity: 0;
  transition: opacity var(--ease-emphasized);
}

.modal-panel {
  width: min(720px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transform: translateY(16px) scale(0.985);
  transition: opacity var(--ease-emphasized), transform var(--ease-emphasized);
}

.modal-backdrop.visible {
  opacity: 1;
}

.modal-backdrop.visible .modal-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.confirm-panel {
  width: min(440px, 100%);
}

.confirm-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.modal-head {
  min-height: 58px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-head h2 {
  margin: 0;
  font-size: 17px;
}

.modal-body {
  padding: 16px;
}

.form-error {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #e6b8b5;
  border-radius: var(--radius);
  background: #fff1f0;
  color: var(--red);
  font-weight: 700;
}

.field-error {
  display: block;
  margin-top: 6px;
  color: var(--red);
  font-size: 12px;
  font-weight: 720;
}

input.invalid,
textarea.invalid,
select.invalid {
  border-color: var(--red);
  background: #fff8f7;
}

.recipient-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.recipient-line strong,
.recipient-line span {
  display: block;
}

.recipient-line span {
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #20362e;
  color: #ffffff;
  box-shadow: var(--shadow);
  font-weight: 700;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--ease-emphasized), transform var(--ease-emphasized);
}

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

.toast.error {
  background: var(--red);
}

.toast.success {
  border-left: 4px solid #6fd09c;
}

.app-busy .workspace {
  filter: saturate(0.98);
}

@keyframes pulseSuccess {
  0% { box-shadow: 0 0 0 0 rgba(39, 115, 84, 0.18); }
  100% { box-shadow: 0 0 0 12px rgba(39, 115, 84, 0); }
}

.toast.visible:not(.error) {
  animation: pulseSuccess 700ms ease-out 1;
}

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

  .workspace,
  .modal-backdrop,
  .modal-panel,
  .toast {
    transform: none !important;
  }
}

@media (max-width: 1080px) {
  .today-command-grid {
    grid-template-columns: 1fr 1fr;
  }

  .today-command.primary-command {
    grid-column: 1 / -1;
    border-bottom: 1px solid var(--line);
  }

  .today-command:nth-child(2) {
    border-right: 1px solid var(--line);
  }

  .metric-grid,
  .profile-info-grid,
  .catalog-grid,
  .skeleton-grid.metrics,
  .skeleton-grid.cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .schedule-layout,
  .activity-layout,
  .clients-layout,
  .messages-layout,
  .settings-grid,
  .reports-grid,
  .users-layout,
  .filter-band {
    grid-template-columns: 1fr;
  }

  .archive-row {
    align-items: stretch;
    flex-direction: column;
  }

  .working-hours-row {
    grid-template-columns: 1fr;
  }

  .quick-actions {
    flex-wrap: wrap;
  }

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

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

  .directory {
    position: static;
  }

  .directory .directory-list {
    max-height: 440px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .clients-toolbar {
    flex-wrap: wrap;
  }
}

@media (max-width: 820px) {
  .clients-toolbar.mobile-detail-hidden {
    display: none;
  }

  .clients-screen.show-directory .profile-view,
  .clients-screen.show-profile .directory {
    display: none;
  }

  .clients-screen.show-profile .profile-view {
    display: grid;
  }

  .client-mobile-back {
    grid-column: 1 / -1;
    width: max-content;
    padding: 4px 0;
    display: inline-flex;
    background: transparent;
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 760;
  }

  .app-shell {
    display: block;
  }

  .app-nav {
    inset: auto 0 0 0;
    z-index: 30;
    width: 100%;
    height: calc(68px + env(safe-area-inset-bottom));
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    display: block;
    border-top: 1px solid #343735;
    border-right: 0;
    box-shadow: none;
  }

  .nav-brand,
  .nav-account,
  .nav-section-label {
    display: none;
  }

  .nav-list {
    height: 100%;
    padding: 0;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 3px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .nav-list::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    min-width: 66px;
    min-height: 54px;
    flex: 1 0 66px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 4px 5px;
    border-radius: 4px;
    font-size: 9px;
  }

  .nav-item span {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-item svg {
    width: 18px;
    height: 18px;
  }

  .nav-item.active {
    box-shadow: inset 0 3px 0 #8ed2b1;
  }

  .app-main {
    min-height: 100vh;
    margin-left: 0;
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
    grid-template-rows: auto minmax(0, 1fr);
  }

  .topbar {
    align-items: flex-start;
    padding: 14px;
  }

  .workspace {
    padding: 14px 14px 24px;
  }

  .top-logout {
    display: grid;
  }

  .login-panel {
    grid-template-columns: 1fr;
  }

  .login-visual {
    min-height: 240px;
  }
}

@media (max-width: 640px) {
  .topbar,
  .toolbar-band,
  .hero-band,
  .profile-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar {
    display: grid;
  }

  .today-command-grid {
    grid-template-columns: 1fr;
  }

  .today-command,
  .today-command:nth-child(2) {
    grid-column: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .today-command:last-child {
    border-bottom: 0;
  }

  .appointment-preview {
    align-items: flex-start;
    flex-direction: column;
  }

  .form-details summary span {
    display: block;
    margin: 3px 0 0;
  }

  .form-sticky-actions {
    position: sticky;
    bottom: -16px;
    z-index: 2;
    margin: 14px -16px -16px;
    padding: 12px 16px;
    border-top: 1px solid var(--line);
    background: var(--surface);
  }

  .clients-toolbar {
    align-items: stretch;
  }

  .client-search-wrap {
    width: 100%;
    margin-left: 0;
    flex-wrap: wrap;
  }

  .clients-toolbar > .btn {
    width: 100%;
  }

  .client-result-count {
    width: 100%;
  }

  .directory .directory-list {
    max-height: 420px;
    grid-template-columns: 1fr;
  }

  .top-actions,
  .hero-actions,
  .profile-actions,
  .button-row {
    width: 100%;
    justify-content: stretch;
  }

  .top-actions .icon-btn,
  .hero-actions .btn,
  .profile-actions .btn,
  .button-row .btn {
    flex: 1;
  }

  .status-pill {
    display: none;
  }

  .metric-grid,
  .profile-info-grid,
  .catalog-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .week-board {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(118px, 42vw);
    overflow-x: auto;
    padding: 2px 2px 10px;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
  }

  .day-tile {
    scroll-snap-align: start;
  }

  .month-board {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .month-day {
    min-height: 42px;
    padding: 5px;
  }

  .schedule-date-banner {
    min-height: 108px;
    padding: 18px;
  }

  .schedule-date-count {
    min-width: 72px;
    padding: 12px;
  }

  .schedule-filter-band {
    grid-template-columns: 1fr;
  }

  .month-overview summary {
    padding: 12px;
  }

  .month-overview summary > strong {
    font-size: 11px;
  }

  .user-row {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .user-row .row-actions,
  .role-pills {
    grid-column: 1 / -1;
  }

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

  .client-profile-hero .avatar.xl {
    width: 64px;
    height: 64px;
  }

  .client-at-a-glance,
  .client-notes-grid {
    grid-template-columns: 1fr;
  }

  .client-at-a-glance > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .client-at-a-glance > div:last-child {
    border-bottom: 0;
  }

  .client-profile-tabs button {
    flex: 1;
    justify-content: center;
  }

  .client-profile-hero .profile-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .client-profile-hero .profile-actions .btn:first-child {
    grid-column: 1 / -1;
  }

  .hero-band h2,
  .profile-hero h2,
  .login-visual h1 {
    font-size: 24px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .timeline-card > div:first-child,
  .row-actions {
    flex-wrap: wrap;
  }

  .search-box,
  .date-control {
    width: 100%;
  }

  .date-control input {
    min-width: 0;
  }
}
