:root {
  color-scheme: light;
  --ink: #151816;
  --muted: #69736f;
  --quiet: #8a938f;
  --line: #d9ded7;
  --line-strong: #c4ccc3;
  --panel: #fbfcfa;
  --paper: #ffffff;
  --soft: #f2f5f1;
  --field: #f9faf8;
  --accent: #117a5d;
  --accent-dark: #0b5844;
  --blue: #37678f;
  --amber: #9a641f;
  --red: #a6403a;
  --shadow: 0 24px 70px rgba(22, 29, 25, 0.14);
  --shadow-soft: 0 14px 36px rgba(22, 29, 25, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    linear-gradient(90deg, rgba(21, 24, 22, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(21, 24, 22, 0.035) 1px, transparent 1px),
    linear-gradient(135deg, #eef2ed 0%, #f8faf7 48%, #edf4f1 100%);
  background-size: 42px 42px, 42px 42px, auto;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

[hidden] {
  display: none !important;
}

.shell {
  width: min(1240px, calc(100% - 36px));
  margin: 0 auto;
  padding: 28px 0 46px;
}

.top-nav {
  position: sticky;
  top: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-height: 58px;
  margin-bottom: 20px;
  border: 1px solid rgba(21, 24, 22, 0.1);
  border-radius: 8px;
  background: rgba(251, 252, 250, 0.9);
  padding: 8px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.top-nav::before {
  content: "OpenFrame Studio";
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  margin-right: 12px;
  padding: 0 16px 0 10px;
  border-right: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
  white-space: nowrap;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 850;
  padding: 0 14px;
  text-decoration: none;
  transition:
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.nav-link:hover {
  background: rgba(17, 122, 93, 0.08);
  color: var(--ink);
}

.nav-home {
  background: #161a17;
  color: #fff;
  padding-inline: 18px;
}

.nav-home:hover {
  background: #0f1411;
  color: #fff;
}

.nav-link.active {
  background: rgba(17, 122, 93, 0.11);
  color: var(--accent-dark);
}

.nav-action {
  margin-left: auto;
  color: var(--red);
}

.nav-status {
  margin-left: auto;
  background: rgba(17, 122, 93, 0.08);
  color: var(--accent-dark);
}

.nav-status + .nav-action {
  margin-left: 0;
}

.nav-action:hover {
  background: rgba(166, 64, 58, 0.08);
  color: var(--red);
}

.login-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    #111511;
  background-size: 36px 36px;
}

.login-shell {
  width: min(100% - 32px, 440px);
}

.login-panel {
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  background: #f8faf7;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.32);
  padding: 32px;
}

.login-panel .eyebrow {
  color: var(--accent-dark);
}

.login-panel h1 {
  margin: 0 0 24px;
  font-size: clamp(2rem, 7vw, 2.9rem);
  line-height: 1.02;
}

.portal-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 80% 0%, rgba(17, 122, 93, 0.22), transparent 34%),
    #252928;
}

.portal-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 22px;
}

.app-launcher {
  width: min(720px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 36px;
  background: #181b19;
  color: #f5f6f4;
  padding: clamp(24px, 5vw, 40px);
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.36);
}

.launcher-header,
.launcher-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.launcher-header {
  margin-bottom: 34px;
}

.launcher-header h1 {
  margin: 0;
  color: #d8dcda;
  font-size: clamp(2rem, 7vw, 3rem);
  line-height: 1;
}

.launcher-edit {
  display: grid;
  width: 112px;
  height: 80px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: #4a4f4d;
  color: #d8dcda;
}

.launcher-edit svg {
  width: 34px;
  height: 34px;
  stroke-width: 2.2;
}

.launcher-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(30px, 7vw, 58px) clamp(22px, 6vw, 56px);
  padding: 4px 2px 36px;
}

.launcher-app {
  display: grid;
  justify-items: center;
  gap: 14px;
  min-width: 0;
  color: #e5e7e5;
  font-size: clamp(1rem, 3.8vw, 1.45rem);
  font-weight: 560;
  text-align: center;
  text-decoration: none;
}

.launcher-app:hover .launcher-icon {
  transform: translateY(-3px);
}

.launcher-icon {
  display: grid;
  width: clamp(66px, 14vw, 86px);
  aspect-ratio: 1;
  place-items: center;
  border-radius: 22px;
  color: #fff;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.24);
  transition: transform 160ms ease;
}

.launcher-icon svg {
  width: 52%;
  height: 52%;
  stroke-width: 2.2;
}

.launcher-icon.green {
  background: linear-gradient(135deg, #0a7b62, #6ce0b5);
}

.launcher-icon.blue {
  background: linear-gradient(135deg, #1e63d6, #65d1ff);
}

.launcher-icon.amber {
  background: linear-gradient(135deg, #e0a11b, #ffdf59);
}

.launcher-icon.pink {
  background: linear-gradient(135deg, #d9427a, #ff8058);
}

.launcher-icon.violet {
  background: linear-gradient(135deg, #6543c7, #be7dff);
}

.launcher-footer {
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.launcher-footer span {
  color: #bfc5c1;
  font-weight: 850;
}

.launcher-footer .ghost-button {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #f5f6f4;
}

.workspace {
  display: grid;
  min-height: 640px;
  overflow: hidden;
  border: 1px solid rgba(21, 24, 22, 0.1);
  border-radius: 8px;
  background: rgba(251, 252, 250, 0.94);
  box-shadow: var(--shadow);
}

.rail {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.48fr) minmax(180px, 0.38fr);
  align-items: stretch;
  gap: 18px;
  min-height: 184px;
  padding: 26px 28px;
  color: #f7faf7;
  background:
    linear-gradient(90deg, rgba(15, 18, 16, 0.96), rgba(19, 29, 25, 0.92)),
    url("data:image/svg+xml,%3Csvg width='920' height='260' viewBox='0 0 920 260' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='920' height='260' fill='%23121612'/%3E%3Cg fill='none' stroke='rgba(255,255,255,.16)' stroke-width='1.4'%3E%3Cpath d='M32 38h856v172H32z'/%3E%3Cpath d='M32 81h856M32 124h856M32 167h856M154 38v172M276 38v172M398 38v172M520 38v172M642 38v172M764 38v172'/%3E%3C/g%3E%3Cg fill='rgba(17,122,93,.64)'%3E%3Crect x='62' y='93' width='58' height='28' rx='3'/%3E%3Crect x='428' y='136' width='58' height='28' rx='3'/%3E%3Crect x='672' y='93' width='58' height='28' rx='3'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
}

.rail::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, rgba(17, 122, 93, 0.14) 100%);
}

.rail > * {
  position: relative;
  z-index: 1;
}

.rail h1,
.surface-header h2,
.section-header h2 {
  margin: 0;
  line-height: 1.04;
  letter-spacing: 0;
}

.rail h1 {
  max-width: 520px;
  overflow-wrap: anywhere;
  font-size: clamp(2rem, 3vw, 2.7rem);
  font-weight: 900;
}

.eyebrow {
  margin: 0 0 10px;
  color: inherit;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.booking-surface {
  padding: 30px 34px 34px;
}

.directory-surface {
  padding: 30px;
  border: 1px solid rgba(21, 24, 22, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.98)),
    var(--panel);
  box-shadow: var(--shadow);
}

.surface-header,
.section-header,
.actions,
.booking-title-row,
.booking-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.surface-header {
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.surface-header .eyebrow,
.section-header .eyebrow {
  color: var(--accent-dark);
}

.surface-header h2,
.section-header h2 {
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  font-weight: 900;
}

.booking-form {
  display: grid;
  gap: 18px;
}

.lark-preview {
  margin-top: 22px;
  border: 1px solid rgba(55, 103, 143, 0.22);
  border-radius: 8px;
  background: #f4f8fa;
  padding: 18px;
}

.preview-header {
  margin-bottom: 14px;
}

.preview-header h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 1.18rem;
}

.preview-fields {
  display: grid;
  gap: 12px;
  margin: 0;
}

.preview-fields div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
}

.preview-fields dt {
  color: var(--muted);
  font-weight: 850;
}

.preview-fields dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.preview-fields pre {
  margin: 0;
  white-space: pre-wrap;
  font: inherit;
}

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

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

.client-panel,
.photographer-panel {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(17, 122, 93, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(17, 122, 93, 0.055), rgba(17, 122, 93, 0.025)),
    #fbfdfb;
  padding: 16px;
}

.client-panel-header,
.photographer-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.client-panel-header span,
.photographer-panel-header span {
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.text-link {
  color: var(--blue);
  font-weight: 850;
  text-underline-offset: 4px;
}

.hidden-select {
  display: none;
}

.saved-client-field {
  display: grid;
  gap: 8px;
}

.client-dropdown {
  position: relative;
}

.client-dropdown-button {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field);
  color: var(--ink);
  padding: 11px 12px;
  text-align: left;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.client-dropdown-button:hover,
.client-dropdown.open .client-dropdown-button {
  border-color: var(--line-strong);
  background: #fff;
}

.client-dropdown.open .client-dropdown-button {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(55, 103, 143, 0.14);
}

.client-dropdown-button span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-dropdown-chevron {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 1rem;
}

.client-dropdown-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: min(320px, 46vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  padding: 6px;
  box-shadow: 0 18px 38px rgba(30, 36, 34, 0.18);
}

.client-dropdown-option {
  width: 100%;
  display: grid;
  gap: 3px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  padding: 10px;
  text-align: left;
}

.client-dropdown-option:hover,
.client-dropdown-option.selected {
  background: var(--soft);
}

.client-dropdown-option strong {
  font-size: 0.94rem;
}

.client-dropdown-option span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  min-height: 1em;
}

.client-search-results {
  display: grid;
  gap: 8px;
  margin-top: -6px;
}

.client-search-result,
.client-search-empty {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 10px 12px;
  text-align: left;
}

.client-search-result {
  display: grid;
  gap: 3px;
  color: var(--ink);
}

.client-search-result:hover {
  border-color: var(--line-strong);
  background: var(--soft);
}

.client-search-result span,
.client-search-empty {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.client-save-row {
  display: flex;
  justify-content: flex-start;
}

.helper-text {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 720;
  line-height: 1.35;
}

.address-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: -8px;
}

#addressMessage {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-weight: 760;
}

#addressMessage.error {
  color: var(--red);
}

#addressMessage.success {
  color: var(--accent-dark);
}

.address-suggestions {
  display: grid;
  gap: 8px;
  margin-top: -8px;
}

.address-suggestion {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 9px 11px;
  text-align: left;
}

.address-suggestion:hover {
  border-color: var(--line-strong);
  background: var(--soft);
}

.invitation-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid rgba(55, 103, 143, 0.22);
  border-radius: 8px;
  background: #f5f9fa;
  padding: 12px 14px;
}

.invitation-summary span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.invitation-summary strong {
  min-width: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
  text-align: right;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 760;
}

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

.service-option {
  position: relative;
  display: block;
}

.service-option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.service-option span {
  display: grid;
  min-height: 58px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 13px;
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.86) inset;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.service-option strong {
  font-size: 0.96rem;
  overflow-wrap: anywhere;
}

.service-option input:checked + span {
  border-color: rgba(17, 122, 93, 0.58);
  background: #eef8f4;
  box-shadow:
    inset 0 0 0 1px rgba(17, 122, 93, 0.5),
    0 10px 24px rgba(17, 122, 93, 0.08);
}

.service-option input:focus-visible + span {
  box-shadow:
    inset 0 0 0 1px var(--accent),
    0 0 0 4px rgba(55, 103, 143, 0.14);
}

label {
  display: grid;
  gap: 8px;
}

label span,
.saved-client-field > span {
  color: #5d6662;
  font-size: 0.82rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field);
  color: var(--ink);
  outline: none;
  padding: 11px 12px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

textarea {
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--line-strong);
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(55, 103, 143, 0.14);
}

button:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(55, 103, 143, 0.14);
  outline: none;
}

.primary-button,
.ghost-button,
.icon-button {
  border: 0;
  border-radius: 7px;
  font-weight: 850;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  background: #111611;
  color: #fff;
  box-shadow: 0 12px 24px rgba(17, 22, 17, 0.18);
}

.primary-button:hover {
  background: var(--accent-dark);
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  padding: 0 13px;
  text-decoration: none;
}

.ghost-button:hover {
  border-color: var(--line-strong);
  background: #fff;
}

.ghost-button.active {
  border-color: rgba(17, 122, 93, 0.58);
  background: #eef8f4;
  color: var(--accent-dark);
}

.icon-ghost {
  width: 40px;
  flex: 0 0 40px;
  padding: 0;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  background: #f6e5e2;
  color: var(--red);
  font-size: 1.3rem;
  line-height: 1;
}

.icon-button:hover {
  background: #eed0cc;
}

.primary-button svg,
.ghost-button svg,
.icon-button svg,
.assignment-meta svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  stroke-width: 2.2;
}

#formMessage,
#clientMessage,
#photographerMessage,
#loginMessage {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-weight: 760;
}

#formMessage.error,
#clientMessage.error,
#photographerMessage.error,
#loginMessage.error {
  color: var(--red);
}

#formMessage.success,
#clientMessage.success,
#photographerMessage.success,
#loginMessage.success {
  color: var(--accent-dark);
}

.status-panel {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
}

.status-panel p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.35;
}

.status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  margin-top: 5px;
  border-radius: 999px;
  background: #d99d45;
  box-shadow: 0 0 0 4px rgba(217, 157, 69, 0.18);
}

.status-dot.ready {
  background: #6ce0b5;
  box-shadow: 0 0 0 4px rgba(108, 224, 181, 0.18);
}

.status-dot.offline {
  background: #e17b72;
  box-shadow: 0 0 0 4px rgba(225, 123, 114, 0.18);
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  min-width: 0;
}

.mini-stats div {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.mini-stats span {
  display: block;
  font-size: 2rem;
  font-weight: 900;
}

.mini-stats small {
  color: rgba(255, 255, 255, 0.76);
  font-weight: 760;
}

.list-section {
  margin-top: 22px;
  padding: 26px;
  border: 1px solid rgba(21, 24, 22, 0.1);
  border-radius: 8px;
  background: rgba(251, 252, 250, 0.95);
  box-shadow: var(--shadow-soft);
}

.section-header {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.booking-list,
.client-list,
.photographer-list,
.invoice-list {
  display: grid;
  gap: 10px;
}

.booking-item {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(21, 24, 22, 0.1);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(22, 29, 25, 0.045);
}

.client-item,
.photographer-item,
.invoice-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(21, 24, 22, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(17, 122, 93, 0.045), transparent 46%),
    #fff;
  box-shadow: 0 8px 22px rgba(22, 29, 25, 0.045);
}

.invoice-summary-surface {
  display: grid;
  gap: 20px;
}

.surface-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 700;
}

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

.invoice-stats div {
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.invoice-stats span {
  display: block;
  color: var(--ink);
  font-size: 1.8rem;
  font-weight: 900;
}

.invoice-stats small {
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
}

.invoice-item {
  grid-template-columns: minmax(0, 1fr) minmax(110px, 0.18fr) auto;
}

.invoice-item.void {
  opacity: 0.58;
}

.invoice-main,
.invoice-total {
  min-width: 0;
}

.invoice-main p {
  margin: 4px 0;
  color: var(--muted);
  font-weight: 650;
}

.invoice-main .invoice-sent {
  color: var(--accent-dark);
  font-weight: 850;
}

.invoice-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 9px;
  color: var(--blue);
  background: rgba(55, 103, 143, 0.1);
  font-size: 0.74rem;
  font-weight: 900;
  white-space: nowrap;
}

.invoice-status.paid {
  color: var(--accent-dark);
  background: rgba(17, 122, 93, 0.12);
}

.invoice-status.void {
  color: var(--red);
  background: rgba(166, 64, 58, 0.1);
}

.invoice-total {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.invoice-total strong {
  font-size: 1.16rem;
  font-weight: 900;
}

.invoice-total small {
  color: var(--muted);
  font-weight: 800;
}

.invoice-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.directory-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.booking-item.cancelled {
  opacity: 0.58;
}

.date-box {
  display: grid;
  place-items: center;
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5f7f4;
}

.date-box .month {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.date-box .day {
  font-size: 1.8rem;
  line-height: 1;
}

.booking-main,
.client-main,
.photographer-main {
  min-width: 0;
}

.booking-actions {
  justify-content: flex-end;
}

.booking-actions .ghost-button {
  min-height: 36px;
}

.client-main h3,
.photographer-main h3 {
  margin: 0 0 5px;
  overflow-wrap: anywhere;
  font-size: 1.06rem;
  font-weight: 900;
}

.client-main p,
.photographer-main p {
  margin: 4px 0;
  color: var(--muted);
  font-weight: 650;
}

.client-email:empty,
.client-agent:empty,
.photographer-email:empty,
.photographer-phone:empty {
  display: none;
}

.booking-title-row {
  justify-content: flex-start;
  margin-bottom: 5px;
}

.booking-title-row h3 {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 1.05rem;
  font-weight: 900;
}

.booking-main p {
  margin: 4px 0;
  color: var(--muted);
}

.booking-location:empty,
.booking-client:empty,
.booking-contact:empty,
.booking-notes:empty {
  display: none;
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 9px;
  color: var(--blue);
  background: rgba(55, 103, 143, 0.1);
  font-size: 0.74rem;
  font-weight: 900;
  white-space: nowrap;
}

.sync-pill.synced {
  color: var(--accent-dark);
  background: rgba(17, 122, 93, 0.12);
}

.sync-pill.failed {
  color: var(--red);
  background: rgba(166, 64, 58, 0.1);
}

.sync-pill.not-configured {
  color: var(--amber);
  background: rgba(154, 100, 31, 0.1);
}

.work-mini-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.integration-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 720;
  line-height: 1.45;
}

.message-list,
.assignment-list {
  display: grid;
  gap: 10px;
}

.message-row {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(21, 24, 22, 0.1);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 8px 22px rgba(22, 29, 25, 0.045);
}

.message-row strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-row span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
}

.assignment-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 116px;
  padding: 16px;
  border: 1px solid rgba(21, 24, 22, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(17, 122, 93, 0.045), transparent 46%),
    #fff;
  box-shadow: 0 8px 22px rgba(22, 29, 25, 0.045);
}

.assignment-card.overdue {
  border-color: rgba(166, 64, 58, 0.28);
  background:
    linear-gradient(90deg, rgba(166, 64, 58, 0.06), transparent 48%),
    #fffafa;
}

.assignment-card.done {
  background:
    linear-gradient(90deg, rgba(105, 115, 111, 0.055), transparent 46%),
    #f8faf8;
}

.assignment-content {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.assignment-kicker,
.assignment-meta,
.assignment-actions,
.dialog-actions,
.dialog-actions > div {
  display: flex;
  align-items: center;
}

.assignment-kicker {
  flex-wrap: wrap;
  gap: 6px;
}

.status-pill,
.priority-pill {
  display: inline-flex;
  min-width: 70px;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 2px 9px;
  color: var(--blue);
  background: rgba(55, 103, 143, 0.1);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.assignment-card.done .status-pill {
  color: var(--accent-dark);
  background: rgba(17, 122, 93, 0.12);
}

.assignment-card.overdue .status-pill {
  color: var(--red);
  background: rgba(166, 64, 58, 0.1);
}

.priority-pill {
  min-width: 58px;
  color: var(--amber);
  background: rgba(154, 100, 31, 0.1);
}

.assignment-card h3 {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 1.06rem;
  font-weight: 900;
  line-height: 1.2;
}

.assignment-notes {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.45;
  white-space: pre-line;
}

.assignment-meta {
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
}

.assignment-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.assignment-meta em {
  font-style: normal;
}

.assignment-actions {
  justify-content: flex-end;
  gap: 8px;
}

.finished-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 7px;
  color: var(--accent-dark);
  background: rgba(17, 122, 93, 0.1);
  padding: 0 12px;
  font-size: 0.82rem;
  font-weight: 900;
}

dialog {
  width: min(640px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
}

dialog::backdrop {
  background: rgba(17, 22, 17, 0.46);
  backdrop-filter: blur(3px);
}

.dialog-card {
  border: 1px solid rgba(21, 24, 22, 0.1);
  border-radius: 8px;
  background: #f8faf7;
  box-shadow: var(--shadow);
  padding: 24px;
}

.dialog-heading {
  margin-bottom: 2px;
  padding-bottom: 18px;
}

.form-error {
  min-height: 18px;
  margin: 0;
  color: var(--red);
  font-size: 0.84rem;
  font-weight: 800;
}

.dialog-actions {
  justify-content: space-between;
  gap: 14px;
  margin-top: 2px;
}

.dialog-actions > div {
  gap: 8px;
  justify-content: flex-end;
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 36px));
}

.toast {
  border: 1px solid rgba(17, 122, 93, 0.32);
  border-radius: 8px;
  background: #e9f7f1;
  box-shadow: var(--shadow);
  color: var(--ink);
  padding: 12px 14px;
  font-size: 0.9rem;
  font-weight: 800;
}

.empty-state {
  padding: 28px;
  border: 1px dashed #b5beb6;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.68);
  text-align: center;
}

.invoice-print-sheet {
  position: relative;
  box-sizing: border-box;
  width: min(794px, 100%);
  min-height: 1123px;
  margin: 32px auto;
  background: #fff;
  color: #000;
  font-family: Arial, Helvetica, sans-serif;
  padding: 62px 52px 52px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.16);
}

.invoice-print-sheet::before {
  position: absolute;
  inset: 0 0 auto;
  height: 8px;
  background: #2ecad3;
  content: "";
}

.tax-invoice-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
}

.tax-invoice-header h1 {
  margin: 0;
  font-size: 2.75rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.05;
}

.tax-invoice-header img {
  width: 118px;
  height: 118px;
  object-fit: contain;
}

.tax-invoice-meta {
  display: grid;
  grid-template-columns: 160px 150px;
  gap: 11px 16px;
  margin-top: 26px;
  font-size: 1rem;
}

.tax-invoice-meta strong {
  font-weight: 400;
}

.tax-info-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.45fr) minmax(0, 0.55fr);
  gap: 56px;
  margin-top: 54px;
}

.tax-info-grid h2,
.payment-info h2 {
  margin: 0 0 15px;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0;
}

.tax-info-grid p,
.payment-info p {
  margin: 0 0 9px;
  font-size: 0.92rem;
  line-height: 1.13;
}

.tax-invoice-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 58px;
  border-bottom: 1.5px solid #000;
}

.tax-invoice-table th {
  background: #e7e7e7;
  padding: 14px 12px;
  font-size: 0.9rem;
  font-weight: 900;
  text-align: center;
}

.tax-invoice-table td {
  min-height: 58px;
  padding: 13px 12px;
  font-size: 0.92rem;
  line-height: 1.35;
  vertical-align: middle;
}

.tax-invoice-table th:first-child,
.tax-invoice-table td:first-child {
  width: 36%;
  text-align: center;
}

.tax-invoice-table th:nth-child(2),
.tax-invoice-table td:nth-child(2) {
  width: 22%;
  text-align: center;
}

.tax-invoice-table th:nth-child(3),
.tax-invoice-table td:nth-child(3),
.tax-invoice-table th:nth-child(4),
.tax-invoice-table td:nth-child(4) {
  text-align: right;
}

.tax-invoice-lower {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 306px;
  gap: 34px;
  align-items: center;
  margin-top: 42px;
}

.invoice-stamp {
  display: inline-flex;
  width: max-content;
  margin-left: 78px;
  transform: rotate(-10deg);
  border: 3px solid #f5a623;
  color: #f5a623;
  padding: 4px 12px;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.invoice-stamp.paid {
  border-color: #117a5d;
  color: #117a5d;
}

.invoice-stamp.void {
  border-color: #a6403a;
  color: #a6403a;
}

.tax-total-table {
  width: 100%;
  border-collapse: collapse;
  border: 2px solid #000;
}

.tax-total-table th,
.tax-total-table td {
  width: 50%;
  border: 2px solid #000;
  padding: 12px 16px;
  font-size: 0.92rem;
  font-weight: 900;
  text-align: center;
}

.tax-total-table td {
  text-align: center;
}

.payment-info {
  margin-top: 48px;
}

.payment-info p {
  color: #787878;
  font-size: 0.92rem;
}

@media print {
  @page {
    size: A4;
    margin: 0;
  }

  body.printing-invoice {
    background: #fff;
  }

  body.printing-invoice > :not(.invoice-print-sheet) {
    display: none !important;
  }

  body.printing-invoice .invoice-print-sheet {
    display: block !important;
    width: 210mm;
    height: 297mm;
    min-height: 0;
    margin: 0;
    padding: 16mm 14mm 12mm;
    overflow: hidden;
    box-shadow: none;
  }
}

@media (max-width: 860px) {
  .shell {
    width: min(100% - 22px, 680px);
    padding: 16px 0 30px;
  }

  .top-nav {
    position: static;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
  }

  .top-nav::before {
    grid-column: 1 / -1;
    justify-content: center;
    margin-right: 0;
    padding: 0 10px 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-action {
    margin-left: 0;
  }

  .nav-status {
    margin-left: 0;
  }

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

  .rail {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .booking-surface,
  .directory-surface,
  .list-section,
  .rail {
    padding: 22px;
  }

  .form-row,
  .form-row.two,
  .service-picker {
    grid-template-columns: 1fr;
  }

  .preview-fields div {
    grid-template-columns: 1fr;
  }

  .surface-header,
  .section-header,
  .actions,
  .booking-actions,
  .client-panel-header,
  .photographer-panel-header,
  .client-save-row,
  .address-actions,
  .invitation-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .invitation-summary strong {
    text-align: left;
  }

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

  .icon-ghost {
    width: 40px;
  }

  .dialog-heading {
    align-items: center;
    flex-direction: row;
  }

  .assignment-card {
    grid-template-columns: 1fr;
  }

  .assignment-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 40px;
    justify-content: stretch;
    width: 100%;
  }

  .assignment-actions .complete-button {
    width: 100%;
  }

  .dialog-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .dialog-actions > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .invoice-item,
  .tax-info-grid,
  .tax-invoice-lower {
    grid-template-columns: 1fr;
  }

  .invoice-total {
    justify-items: start;
  }

  .invoice-stamp {
    margin-left: 0;
  }

  .invoice-actions {
    display: grid;
    grid-template-columns: 1fr 40px;
    width: 100%;
  }

  .portal-shell {
    align-items: start;
    padding: 16px;
  }

  .app-launcher {
    border-radius: 28px;
  }

  .launcher-grid {
    gap: 28px 18px;
  }

  .launcher-footer .ghost-button {
    width: auto;
    min-width: 132px;
  }
}

@media (max-width: 520px) {
  .top-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rail h1 {
    font-size: 2rem;
  }

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

  .booking-item {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .booking-actions {
    grid-column: 1 / -1;
  }

  .client-item,
  .photographer-item,
  .invoice-stats {
    grid-template-columns: 1fr;
  }

  .invoice-actions {
    grid-template-columns: 1fr;
  }

  .invoice-actions .icon-button {
    width: 100%;
  }

  .directory-actions {
    justify-content: stretch;
  }

  .directory-actions .ghost-button {
    flex: 1 1 auto;
    width: auto;
  }

  .cancel-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .launcher-header,
  .launcher-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .launcher-edit {
    width: 84px;
    height: 58px;
  }

  .launcher-edit svg {
    width: 28px;
    height: 28px;
  }

  .launcher-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .launcher-footer .ghost-button {
    width: 100%;
  }

  .assignment-actions {
    grid-template-columns: 1fr;
  }

  .assignment-actions .icon-ghost {
    width: 100%;
  }

  .date-box {
    min-height: 58px;
  }
}
