:root {
  --sidebar-bg: #0b1925;
  --sidebar-active: #26323c;
  --sidebar-border: #39434b;
  --workspace-bg: #f6f8f7;
  --card-bg: #fff;
  --text-primary: #071521;
  --text-secondary: #64748b;
  --border: #d9dfdc;
  --accent: #e56a28;
  --accent-hover: #cf5b20;
  --success: #15803d;
  --warning: #b45309;
  --danger: #c2412d;
  --radius-sm: 7px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --sidebar-width: 255px;
  --header-height: 66px;
  --shadow: 0 2px 8px rgba(7, 21, 33, .045);
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; scrollbar-gutter: stable; scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar { display: none; }
body {
  margin: 0;
  color: var(--text-primary);
  background: var(--workspace-bg);
  font: 400 14px/1.5 "Montserrat", Arial, sans-serif;
  letter-spacing: -.01em;
}
.app-booting body { background: linear-gradient(90deg, #081523 0 46%, #f7f8fa 46% 100%); }
.app-booting #app { visibility: hidden; opacity: 0; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
p { color: var(--text-secondary); }
.hidden { display: none !important; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: var(--sidebar-width);
  color: #d7dee4;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  transition: width .2s ease, transform .2s ease;
}
.brand {
  height: var(--header-height);
  padding: 7px 22px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-logo-full { width: 168px; max-height: 54px; display: block; object-fit: contain; object-position: left center; }
.brand-logo-compact { display: none; width: 42px; height: 42px; object-fit: contain; }
.sidebar nav { flex: 1; padding: 16px 10px 8px; overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none; }
.sidebar nav::-webkit-scrollbar { display: none; }
.nav-group { margin-bottom: 13px; }
.nav-group-title {
  padding: 0 7px 5px;
  color: #70808d;
  font-size: 8px;
  letter-spacing: .1em;
}
.nav-item {
  width: 100%;
  min-height: 37px;
  margin: 1px 0;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #b7c1c9;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 9px;
  position: relative;
  cursor: pointer;
  text-align: left;
  font-size: 11px;
  font-weight: 400;
}
.nav-item:hover { background: rgba(255,255,255,.045); color: #fff; }
.nav-item.active {
  color: #fff;
  background: var(--sidebar-active);
  border-color: #d7dde1;
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  width: 2px;
  height: 17px;
  border-radius: 3px;
  background: var(--accent);
}
.nav-icon { width: 16px; height: 16px; color: #8fa0ad; display: grid; place-items: center; }
.nav-icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.nav-item.active .nav-icon { color: var(--accent); }
.sidebar-footer { padding: 12px 10px 10px; border-top: 1px solid rgba(255,255,255,.08); }
.user-summary { padding: 0 6px 11px; display: flex; align-items: center; gap: 10px; }
.user-summary strong { display: block; color: #fff; font-size: 11px; font-weight: 500; }
.user-summary small { display: block; color: #7f909d; font-size: 8px; letter-spacing: .1em; }
.logout-button {
  width: 100%; padding: 7px; border: 0; color: #b7c1c9; background: none; display: flex; align-items: center; gap: 8px; cursor: pointer; text-align: left;
}

.topbar {
  position: fixed;
  inset: 0 0 auto var(--sidebar-width);
  z-index: 20;
  height: var(--header-height);
  padding: 0 28px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  transition: left .2s ease;
}
.workspace-identity { margin-left: 10px; display: flex; align-items: center; gap: 10px; }
.workspace-mark { width: 30px; height: 30px; border-radius: 8px; color: #fff; background: var(--sidebar-bg); display: grid; place-items: center; font-size: 8px; font-weight: 700; letter-spacing: .04em; }
.workspace-icon, .icon-button {
  width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 10px; background: #fff; display: grid; place-items: center;
}
.workspace-icon svg, .icon-button svg, .search-box svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.workspace-identity small, .workspace-identity strong { display: block; }
.workspace-identity small { font-size: 9px; letter-spacing: .13em; }
.workspace-identity strong { font-size: 11px; font-weight: 500; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.search-box {
  width: min(420px, 38vw); height: 38px; padding: 0 12px; border: 1px solid #d5dcda; border-radius: 20px; color: #627285; background: #f8faf9; display: flex; gap: 9px; align-items: center; cursor: pointer; font-size: 10px; white-space: nowrap; transition: border-color .15s, background .15s, box-shadow .15s;
}
.search-box:hover { border-color: #aeb9b3; background: #fff; box-shadow: 0 2px 8px rgba(7,21,33,.05); }
.search-box .search-label { min-width: 0; flex: 1; overflow: hidden; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
kbd { padding: 2px 6px; border: 1px solid var(--border); border-radius: 5px; color: #8a969f; background: #fafbfb; font-size: 9px; }
.icon-button { padding: 0; cursor: pointer; }
.topbar-help { height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 18px; color: #40515d; background: #fff; display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 9px; font-weight: 600; }
.topbar-help:hover { border-color: var(--accent); color: var(--accent); background: #fffaf7; }
.topbar-help svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 12px; overflow: hidden; }
.avatar-navy { width: 32px; height: 32px; background: #102536; }
.avatar-orange { background: var(--accent); }
.mobile-menu { display: grid; }

.main-content { min-height: 100vh; margin-left: var(--sidebar-width); padding: calc(var(--header-height) + 35px) 35px 48px; transition: margin-left .2s ease; }
.sidebar-collapsed { --sidebar-width: 78px; }
.sidebar-collapsed .brand { justify-content: center; padding-inline: 0; }
.sidebar-collapsed .brand-logo-full { display: none; }
.sidebar-collapsed .brand-logo-compact { display: block; }
.sidebar-collapsed .brand > span,
.sidebar-collapsed .nav-group-title,
.sidebar-collapsed .nav-item > span:not(.nav-icon),
.sidebar-collapsed .user-summary > span:last-child,
.sidebar-collapsed .logout-label { display: none; }
.sidebar-collapsed .sidebar nav { padding-inline: 11px; }
.sidebar-collapsed .nav-group { margin-bottom: 10px; }
.sidebar-collapsed .nav-item { padding: 0; justify-content: center; }
.sidebar-collapsed .nav-icon { width: 18px; height: 18px; }
.sidebar-collapsed .user-summary,
.sidebar-collapsed .logout-button { justify-content: center; padding-inline: 0; }
.page { width: 100%; max-width: 1680px; margin: 0 auto; }
.page-header { min-height: 71px; margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.page-header h1 { margin-bottom: 3px; font-size: clamp(28px, 2.15vw, 36px); font-weight: 600; line-height: 1.12; letter-spacing: -.05em; }
.page-header p { margin-bottom: 0; font-size: 11px; }
.eyebrow { margin-bottom: 8px; color: #b46135; font-size: 9px; font-weight: 600; letter-spacing: .16em; }
.button {
  min-height: 40px; padding: 0 20px; border: 1px solid transparent; border-radius: 24px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; font-weight: 600; font-size: 10px;
}
.button.primary { color: #fff; background: var(--accent); box-shadow: 0 4px 10px rgba(229,106,40,.18); }
.button.primary:hover { background: var(--accent-hover); }
.button.secondary { border-color: var(--border); background: #fff; }
.button.danger { border-color: #efc8c2; color: var(--danger); background: #fff; }
.button.danger:disabled,
.button.danger:disabled:hover {
  border-color: #e8ecea;
  color: #a8b2ae;
  background: #f6f7f7;
  cursor: not-allowed;
  box-shadow: none;
}
.button.small { min-height: 32px; padding: 0 14px; }
.header-actions { display: flex; gap: 8px; align-items: center; }

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.metrics { margin-bottom: 26px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-card { min-height: 105px; padding: 19px 20px; }
.metric-card small { display: block; margin-bottom: 13px; color: var(--text-secondary); font-size: 9px; letter-spacing: .11em; }
.metric-card strong { font-size: 24px; font-weight: 600; line-height: 1; }
.quick-actions { min-height: 54px; margin-bottom: 32px; padding: 0 20px; display: flex; align-items: center; gap: 30px; }
.quick-actions button { border: 0; background: none; cursor: pointer; font-size: 11px; font-weight: 500; }
.quick-actions span { color: var(--text-secondary); font-size: 10px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(280px, 1fr); gap: 18px; }
.card-heading { min-height: 58px; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; }
.card-heading h2 { margin: 0; font-size: 19px; letter-spacing: -.03em; }
.text-link { border: 0; background: none; cursor: pointer; font-size: 10px; }
.activity-list { padding: 0 20px 20px; }
.activity-item { margin-bottom: 16px; }
.activity-item strong { display: block; font-size: 11px; }
.activity-item small { color: var(--text-secondary); font-size: 9px; }

.tabs { margin-bottom: 20px; border-bottom: 1px solid var(--border); display: flex; gap: 26px; overflow-x: auto; }
.tab { padding: 0 0 12px; border: 0; border-bottom: 2px solid transparent; background: none; cursor: pointer; white-space: nowrap; font-size: 10px; font-weight: 500; }
.tab.active { border-color: var(--text-primary); }
.pill-tabs { margin-bottom: 16px; display: flex; gap: 5px; flex-wrap: wrap; }
.pill-tab { min-height: 38px; padding: 0 17px; border: 1px solid var(--border); border-radius: 21px; background: #fff; cursor: pointer; font-size: 10px; }
.pill-tab.active { color: #fff; background: var(--sidebar-bg); border-color: var(--sidebar-bg); }

.table-card { overflow: hidden; }
.table-scroll { overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.table-scroll::-webkit-scrollbar { display: none; }
table { width: 100%; border-collapse: collapse; }
th { padding: 14px 13px; color: var(--text-secondary); font-size: 8px; font-weight: 500; letter-spacing: .09em; text-align: left; white-space: nowrap; }
td { padding: 13px; border-top: 1px solid var(--border); font-size: 10px; white-space: nowrap; }
tbody tr:hover { background: #fafbfb; }
tbody tr.is-selected { background: #f3f7f5; }
tbody tr.is-selected:hover { background: #edf3f0; }
.select-col {
  width: 42px;
  padding-left: 16px !important;
  padding-right: 4px !important;
  vertical-align: middle;
}
.table-check {
  width: 18px;
  height: 18px;
  margin: 0;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  position: relative;
}
.table-check input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.table-check span {
  width: 16px;
  height: 16px;
  border: 1.5px solid #b7c1bc;
  border-radius: 4px;
  background: #fff;
  display: grid;
  place-items: center;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.table-check input:hover + span { border-color: #8a9891; }
.table-check input:focus-visible + span {
  outline: 2px solid rgba(229, 106, 40, .35);
  outline-offset: 1px;
}
.table-check input:checked + span {
  border-color: var(--sidebar-bg);
  background: var(--sidebar-bg);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.table-check input:checked + span::after {
  content: "";
  width: 8px;
  height: 5px;
  border-left: 1.8px solid #fff;
  border-bottom: 1.8px solid #fff;
  transform: translateY(-1px) rotate(-45deg);
}
.table-check input:indeterminate + span {
  border-color: var(--sidebar-bg);
  background: var(--sidebar-bg);
}
.table-check input:indeterminate + span::after {
  content: "";
  width: 8px;
  height: 1.8px;
  background: #fff;
  border-radius: 1px;
}
.total-cell { font-weight: 600; letter-spacing: -.01em; }
.link-cell { white-space: nowrap; }
.link-cell.muted-cell { color: var(--text-secondary); }
.table-link,
.table-link-copy {
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  color: #1f4f86;
  text-decoration: none;
}
.table-link:hover,
.table-link-copy:hover { color: var(--accent); text-decoration: underline; }
.table-link-copy { margin-left: 10px; color: #667085; font-weight: 500; }
.document-cell strong, .user-cell strong { display: block; font-size: 10px; }
.document-cell small, .user-cell small { color: var(--text-secondary); font-size: 8px; }
.status {
  padding: 2px 7px; border-radius: 3px; color: #39434b; background: #edf0ef; font-size: 7px; font-weight: 600; letter-spacing: .08em;
}
.status.sent, .status.completed, .status.signed { color: var(--success); background: #edf7f0; }
.status.awaiting { color: var(--warning); background: #fff7e9; }
.status.declined, .status.voided { color: var(--danger); background: #fdf0ee; }
.action-dots { border: 0; background: none; cursor: pointer; }
.empty-state { min-height: 230px; padding: 40px; border-style: dashed; display: grid; place-items: center; text-align: center; }
.empty-state h3 { margin-bottom: 4px; font-size: 14px; }
.empty-state p { margin-bottom: 18px; font-size: 10px; }

.country-selection-page { padding-top: 2px; }
.country-back { margin-bottom: 12px; padding: 0; border: 0; color: var(--text-primary); background: none; cursor: pointer; font-size: 10px; }
.country-heading { margin-bottom: 38px; padding-bottom: 14px; border-bottom: 2px solid transparent; border-image: linear-gradient(90deg, var(--accent), #dd6b37 52%, #b7c1bc) 1; }
.country-heading h1 { margin-bottom: 8px; font-size: clamp(30px, 2.4vw, 40px); font-weight: 600; line-height: 1.1; letter-spacing: -.05em; }
.country-heading p { margin: 0; font-size: 11px; }
.country-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.country-card { min-height: 170px; padding: 28px; border: 1px solid var(--border); border-radius: 14px; color: var(--text-primary); background: #fff; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: flex-start; text-align: left; cursor: pointer; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.country-card:hover { transform: translateY(-2px); border-color: #aeb9b3; box-shadow: 0 5px 14px rgba(7,21,33,.07); }
.country-card strong { margin-bottom: 10px; font-size: 25px; font-weight: 700; letter-spacing: -.03em; }
.country-card span { margin-bottom: 20px; color: var(--text-secondary); font-size: 14px; line-height: 1.55; }
.country-card small { font-size: 12px; font-weight: 700; letter-spacing: .03em; }

.templates-page .page-header { min-height: 58px; margin-bottom: 28px; }
.template-filter-tabs { width: fit-content; margin-bottom: 32px; padding: 4px; border: 1px solid var(--border); border-radius: 24px; background: #edf1ef; display: flex; gap: 3px; }
.template-filter-tabs button { min-height: 36px; padding: 0 18px; border: 1px solid transparent; border-radius: 20px; color: #62716b; background: transparent; cursor: pointer; font-size: 10px; font-weight: 600; transition: color .15s, background .15s, box-shadow .15s; }
.template-filter-tabs button:hover { color: var(--text-primary); }
.template-filter-tabs button.active { color: #fff; background: var(--sidebar-bg); box-shadow: 0 2px 6px rgba(7,21,33,.15); }
.template-type-switch { max-width: 790px; margin-bottom: 35px; padding: 5px; border: 1px solid var(--border); border-radius: 13px; background: #edf1ef; display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.template-type-switch button { min-height: 72px; padding: 12px 16px; border: 1px solid transparent; border-radius: 9px; color: #6c7973; background: transparent; display: grid; grid-template-columns: 31px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; cursor: pointer; text-align: left; transition: background .15s, border-color .15s, box-shadow .15s; }
.template-type-switch button > span { grid-row: 1 / 3; width: 31px; height: 31px; border-radius: 8px; color: #8b9791; background: #dde3e0; display: grid; place-items: center; font-size: 9px; font-weight: 700; }
.template-type-switch strong { align-self: end; color: #30414e; font-size: 12px; font-weight: 700; }
.template-type-switch small { align-self: start; font-size: 8px; }
.template-type-switch button.active { border-color: #e9c5b2; background: #fff; box-shadow: 0 2px 7px rgba(7,21,33,.06); }
.template-type-switch button.active > span { color: #b84f1b; background: #fff0e8; }
.template-type-switch button.active strong { color: var(--text-primary); }
.template-section { margin-bottom: 46px; scroll-margin-top: calc(var(--header-height) + 24px); }
.section-row { min-height: 57px; margin-bottom: 11px; display: flex; justify-content: space-between; align-items: flex-start; }
.section-row h2 { margin-bottom: 19px; font-size: 16px; font-weight: 600; letter-spacing: -.03em; }
.section-row p { margin: 0; font-size: 10px; }
.section-row .button { margin-top: -3px; }
.template-grid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.all-template-grid {
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.template-card { position: relative; border-radius: 11px; transition: transform .15s, border-color .15s, box-shadow .15s; overflow: hidden; cursor: pointer; }
.template-card.template-readonly { cursor: default; }
.template-card:hover { transform: translateY(-2px); border-color: #aeb8b3; box-shadow: 0 8px 22px rgba(7,21,33,.08); }
.template-actions { position: absolute; inset: auto 12px 78px; display: flex; gap: 6px; opacity: 0; transform: translateY(3px); transition: opacity .15s, transform .15s; }
.template-card:hover .template-actions { opacity: 1; }
.template-card:hover .template-actions { transform: translateY(0); }
.template-card-meta { min-height: 66px; padding: 11px 13px; border-top: 1px solid var(--border); background: #fff; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.template-card-meta > div { min-width: 0; }
.template-card-meta span, .template-card-meta strong, .template-card-meta small { display: block; }
.template-card-meta > div > span { margin-bottom: 2px; color: var(--accent); font-size: 7px; font-weight: 700; letter-spacing: .1em; }
.template-card-meta strong { overflow: hidden; color: var(--text-primary); font-size: 10px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.template-card-meta small { margin-top: 2px; color: var(--text-secondary); font-size: 7px; }
.template-card-meta .template-arrow { width: 28px; height: 28px; border: 1px solid var(--border); border-radius: 50%; color: var(--text-primary); display: grid; place-items: center; flex: 0 0 auto; transition: color .15s, border-color .15s, background .15s; }
.template-card:hover .template-arrow { border-color: var(--accent); color: #fff; background: var(--accent); }
.paper-preview {
  aspect-ratio: 210 / 297; padding: 0; color: #29343c; background: #fff; overflow: hidden; font-family: "Montserrat", Arial, sans-serif;
}
.template-preview-image { width: 100%; height: 100%; display: block; object-fit: cover; }
.invoice-paper { position: relative; color: #27333a; font-size: clamp(5px, .52vw, 8px); }
.invoice-paper-header { height: 17%; padding: 5.5% 5.5% 4%; display: flex; justify-content: space-between; align-items: flex-start; }
.invoice-paper-original .invoice-paper-header { color: #fff; background: linear-gradient(100deg, #f17416 0%, #df3d17 50%, #bc052a 100%); }
.invoice-paper-clean .invoice-paper-header { height: 11%; padding-top: 4%; color: #1c2830; border-bottom: 5px solid var(--accent); background: #fff; }
.preview-logo { display: flex; flex-direction: column; line-height: 1; }
.preview-logo b { color: #fff; font-size: clamp(16px, 2.25vw, 31px); letter-spacing: -.06em; }
.invoice-paper-clean .preview-logo b { color: #16232d; font-size: clamp(12px, 1.7vw, 23px); }
.preview-logo b span { color: inherit; }
.invoice-paper-clean .preview-logo b span { color: var(--accent); }
.preview-logo small { margin: 2px 0 0 12%; color: inherit; font-size: .48em; letter-spacing: .01em; }
.preview-social { text-align: right; font-size: 1.25em; }
.preview-social small { margin-top: 8px; display: block; font-size: .62em; }
.preview-contact { padding-top: 5px; color: #1c2830; font-size: .72em; font-weight: 600; white-space: nowrap; }
.invoice-paper-content { padding: 5.2% 5.5%; }
.original-title-row { margin-bottom: 10%; display: flex; justify-content: space-between; font-size: 1.05em; }
.original-title-row > div { text-align: right; }
.original-title-row small { margin-top: 4px; display: block; font-weight: 400; line-height: 1.55; }
.clean-title-row { margin-bottom: 8%; display: flex; justify-content: space-between; }
.clean-title-row h3 { margin: 0; font-size: 3em; letter-spacing: -.04em; }
.clean-title-row > div { text-align: right; font-size: .88em; }
.preview-addresses { margin-bottom: 7%; display: grid; grid-template-columns: 1fr 1fr; gap: 12%; }
.preview-addresses b, .preview-addresses strong, .preview-addresses span { display: block; }
.preview-addresses b { margin-bottom: 7px; color: var(--accent); font-size: .8em; }
.invoice-paper-original .preview-addresses b { color: #7a858b; }
.preview-addresses strong { margin-bottom: 4px; font-size: .95em; }
.preview-addresses span { color: #5f696f; line-height: 1.55; }
.preview-table { margin-bottom: 5%; border-top: 1px solid #37434a; border-bottom: 1px solid #37434a; }
.preview-table-row { min-height: 28px; padding: 0 5px; border-top: 1px solid #e2e5e4; display: grid; grid-template-columns: 1fr 12% 23%; align-items: center; }
.preview-table-row span:nth-child(n+2) { text-align: right; }
.preview-table-head { min-height: 23px; border-top: 0; color: #4f5b62; font-size: .8em; text-transform: uppercase; }
.preview-total { width: 38%; margin: 0 0 6% auto; display: flex; justify-content: space-between; text-align: right; line-height: 1.8; }
.preview-notes { line-height: 1.6; }
.preview-payment { position: absolute; right: 5.5%; bottom: 6%; left: 5.5%; padding: 4%; color: #4a555b; background: #f6f7f7; line-height: 1.6; }
.invoice-banner { width: auto; height: auto; aspect-ratio: 21 / 4; padding: 4% 7%; color: #fff; background: var(--accent); font-size: clamp(15px,2vw,28px); font-weight: 700; overflow: hidden; }
.invoice-banner.alt { height: auto; aspect-ratio: 21 / 4; color: #17232c; background: #fff; border-bottom: 5px solid var(--accent); }
.invoice-mock-body { padding: 8%; }
.mock-title { margin: 2% 0 8%; font-size: clamp(13px,1.5vw,22px); font-weight: 700; }
.mock-row { height: 7px; margin: 8px 0; background: #e9eceb; }
.mock-row.short { width: 48%; }
.mock-columns { margin: 10% 0; display: grid; grid-template-columns: 1fr 1fr; gap: 15%; }
.mock-table { margin-top: 10%; border-top: 2px solid #4b555b; border-bottom: 2px solid #4b555b; }
.contract-preview { padding: 12%; }
.contract-brand-logo { width: 34px; height: 34px; display: block; object-fit: contain; }
.contract-preview .brand-mark {
  width: 30px;
  height: 30px;
  border: 3px solid var(--text-primary);
  border-radius: 8px 3px 8px 3px;
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 17px;
  font-weight: 700;
}
.contract-preview h3 { margin: 18% 0 5%; text-align: center; font: 700 clamp(14px,1.8vw,24px)/1.2 "Montserrat", Arial, sans-serif; }
.contract-preview .contract-rule { width: 30%; margin: 0 auto 12%; border-top: 2px solid var(--accent); }

.settings-page { max-width: 1320px; }
.business-page { max-width: 1320px; }
.business-details-card { overflow: hidden; }
.business-tip {
  margin: 0 26px 18px;
  padding: 14px 16px;
  border: 1px solid rgba(229, 106, 40, .18);
  border-radius: 12px;
  background: #fff8f3;
  color: #5c4638;
  font-size: 11px;
  line-height: 1.45;
}
.business-tip strong { color: var(--accent); }
.settings-page .pill-tabs { margin-bottom: 18px; padding: 4px; width: fit-content; border: 1px solid var(--border); border-radius: 24px; background: #edf1ef; gap: 3px; }
.settings-page .pill-tab { min-height: 34px; padding-inline: 15px; border: 0; background: transparent; }
.settings-page .pill-tab.active { background: var(--sidebar-bg); box-shadow: 0 2px 6px rgba(7,21,33,.14); }
.settings-panel { width: min(1120px, 100%); padding: 0; overflow: hidden; }
.settings-section-heading { min-height: 112px; padding: 24px 26px; border-bottom: 1px solid var(--border); background: linear-gradient(135deg, #fff, #fafcfb); display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.settings-section-heading h2 { margin: 2px 0 4px; font-size: 23px; letter-spacing: -.035em; }
.settings-section-heading p { margin: 0; font-size: 10px; }
.settings-kicker { color: var(--accent); font-size: 8px; font-weight: 700; letter-spacing: .13em; }
.settings-status { padding: 7px 11px; border: 1px solid #d8e6dc; border-radius: 18px; color: #287045; background: #f1f8f3; font-size: 8px; font-weight: 600; white-space: nowrap; }
.logo-upload { min-height: 118px; margin: 22px 26px; padding: 17px; border: 1px solid var(--border); border-radius: 12px; background: #fbfcfc; display: flex; align-items: center; gap: 17px; box-shadow: 0 1px 3px rgba(7,21,33,.035); }
.logo-box { width: 130px; height: 75px; padding: 10px; border: 1px solid var(--border); border-radius: 9px; background: #fff; display: grid; place-items: center; }
.logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-upload-copy { flex: 1; }
.logo-upload-copy strong { display: block; margin-bottom: 3px; font-size: 12px; }
.logo-upload-copy p { margin: 0 0 10px; font-size: 9px; }
.logo-file-note { align-self: flex-start; color: var(--text-secondary); font-size: 8px; }
.country-settings-grid { padding: 0 26px 26px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.country-settings { min-width: 0; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 13px; background: #fff; overflow: hidden; }
.country-settings > header { min-height: 72px; padding: 14px 16px; border-bottom: 1px solid var(--border); background: #f8faf9; display: flex; align-items: center; gap: 11px; }
.country-settings-icon { width: 35px; height: 35px; border-radius: 9px; color: #fff; background: var(--sidebar-bg); display: grid; place-items: center; font-size: 9px; font-weight: 700; }
.country-settings h2 { margin: 0 0 1px; font-size: 15px; }
.country-settings header p { margin: 0; font-size: 8px; }
.country-ready { margin-left: auto; padding: 4px 7px; border-radius: 10px; color: var(--success); background: #eaf6ed; font-size: 7px; font-weight: 700; }
.settings-field-group { padding: 17px 16px; }
.settings-field-group + .settings-field-group { border-top: 1px solid var(--border); }
.settings-field-group h3 { margin-bottom: 13px; color: #213747; font-size: 11px; }
.settings-field-group .form-grid { gap: 11px; }
.settings-field-group .form-field > span { font-size: 7px; font-weight: 700; }
.settings-field-group .input { height: 39px; border-color: #d6ddda; background: #fbfcfc; font-size: 9px; }
.settings-field-group textarea.input { min-height: 74px; }
.settings-field-group .input:focus { background: #fff; border-color: var(--accent); }
.settings-save-bar { min-height: 70px; padding: 14px 26px; border-top: 1px solid var(--border); background: #fafcfb; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.settings-save-bar span { color: var(--text-secondary); font-size: 9px; }
.settings-save-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.settings-placeholder-card { margin: 24px 26px; padding: 22px; border: 1px solid var(--border); border-radius: 12px; background: #fbfcfc; }
.settings-placeholder-card > strong { font-size: 13px; }
.settings-placeholder-card > p { margin: 3px 0 18px; font-size: 9px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-field { display: block; }
.form-field.full { grid-column: 1 / -1; }
.form-field > span { display: block; margin-bottom: 6px; color: #65727b; font-size: 9px; font-weight: 500; letter-spacing: .08em; }
.input {
  width: 100%; height: 42px; padding: 0 13px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); background: #fff; outline: none;
}
textarea.input { min-height: 100px; padding-top: 12px; resize: vertical; }
.input:focus { border-color: #94a19a; box-shadow: 0 0 0 3px rgba(229,106,40,.08); }
.account-page { max-width: 1380px; color: #0f172a; }
.account-page .page-header { margin-bottom: 24px; }
.account-page .page-header h1 { color: #0f172a; font-size: 32px; font-weight: 700; letter-spacing: -.04em; }
.account-page .page-header p { color: #64748b; font-size: 14px; }
.account-profile-grid { margin-bottom: 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.account-card { border: 1px solid #e2e8f0; border-radius: 14px; background: #fff; box-shadow: 0 4px 20px rgba(15,23,42,.04); }
.account-profile-card, .account-security-card { min-height: 430px; padding: 26px; }
.account-card-heading { margin-bottom: 24px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.account-card-heading h2, .login-accounts-heading h2 { margin: 0 0 4px; color: #0f172a; font-size: 20px; font-weight: 700; letter-spacing: -.025em; }
.account-card-heading p, .login-accounts-heading p { margin: 0; color: #64748b; font-size: 12px; }
.profile-summary { margin-bottom: 26px; padding-bottom: 22px; border-bottom: 1px solid #e8edf3; display: flex; align-items: center; gap: 14px; }
.profile-avatar-wrap {
  display: grid;
  justify-items: start;
  gap: 8px;
  flex: 0 0 auto;
}
.profile-avatar { width: 52px; height: 52px; border-radius: 50%; color: #fff; background: #0b1728; display: grid; place-items: center; flex: 0 0 auto; font-size: 17px; font-weight: 700; overflow: hidden; }
.profile-avatar.has-image,
.avatar.has-image { padding: 0; }
.profile-avatar img,
.avatar.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profile-avatar-upload,
.profile-avatar-remove {
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
}
.profile-avatar-upload { color: var(--accent); }
.profile-avatar-upload:hover { text-decoration: underline; }
.profile-avatar-remove { color: #94a3b8; }
.profile-avatar-remove:hover { color: var(--danger); }
.profile-summary > div { display: grid; justify-items: start; gap: 6px; }
.profile-summary strong { color: #0f172a; font-size: 17px; font-weight: 700; }
.profile-details { display: grid; gap: 21px; }
.profile-details > div:not(.profile-actions) { display: grid; gap: 5px; }
.profile-details > div > span { color: #64748b; font-size: 11px; font-weight: 600; }
.profile-details > div > strong { color: #1e293b; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.profile-actions, .security-actions { margin-top: auto; display: flex; justify-content: flex-end; gap: 9px; }
.account-profile-card { display: flex; flex-direction: column; }
.account-profile-card .profile-details { flex: 1; }
.account-profile-card .profile-actions { align-self: end; }
.security-icon { width: 38px; height: 38px; border-radius: 10px; color: #f97316; background: #fff4ec; display: grid; place-items: center; flex: 0 0 auto; }
.security-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.security-form { display: grid; gap: 16px; }
.security-actions { margin-top: 3px; }
.account-field { min-width: 0; display: grid; gap: 7px; }
.account-field > span { color: #334155; font-size: 12px; font-weight: 600; }
.account-field input, .account-field select, .account-toolbar select, .account-search {
  width: 100%; height: 49px; padding: 0 14px; border: 1px solid #dce1e8; border-radius: 9px; color: #0f172a; background: #fff; outline: none; font-size: 13px; transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.account-field input:hover, .account-field select:hover, .account-toolbar select:hover, .account-search:hover { border-color: #c6ced8; }
.account-field input:focus, .account-field select:focus, .account-toolbar select:focus, .account-search:focus-within { border-color: #f97316; box-shadow: 0 0 0 3px rgba(249,115,22,.10); }
.account-password-field { position: relative; }
.account-password-field input { padding-right: 48px; }
.account-password-field button { position: absolute; top: 50%; right: 6px; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 7px; color: #64748b; background: transparent; display: grid; place-items: center; cursor: pointer; transform: translateY(-50%); transition: color .18s ease, background .18s ease; }
.account-password-field button:hover { color: #0f172a; background: #f1f5f9; }
.account-password-field svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.account-button { min-height: 42px; padding: 0 17px; border: 1px solid transparent; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; font-size: 12px; font-weight: 700; transition: transform .18s ease, border-color .18s ease, color .18s ease, background .18s ease, box-shadow .18s ease; }
.account-button:hover { transform: translateY(-1px); }
.account-button.primary { color: #fff; background: #0b1728; }
.account-button.primary:hover { background: #14243a; box-shadow: 0 8px 18px rgba(11,23,40,.14); }
.account-button.secondary { border-color: #dce1e8; color: #334155; background: #fff; }
.account-button.secondary:hover { border-color: #b9c3cf; background: #f8fafc; }
.account-button.add-login { color: #fff; background: #f97316; }
.account-button.add-login:hover { background: #ea580c; box-shadow: 0 8px 18px rgba(249,115,22,.18); }
.account-button.danger { border-color: #fecaca; color: #b91c1c; background: #fff; }
.account-button.danger:hover { background: #fff5f5; }
.account-role { width: fit-content; padding: 4px 8px; border-radius: 6px; font-size: 9px; font-weight: 700; letter-spacing: .055em; }
.role-super { color: #334155; background: #eef2f7; }
.role-manager { color: #315a83; background: #edf4fb; }
.role-client { color: #a84b16; background: #fff2e8; }
.login-accounts-card { overflow: visible; }
.login-accounts-heading { min-height: 91px; padding: 22px 24px; border-bottom: 1px solid #e2e8f0; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.account-toolbar { padding: 16px 24px; border-bottom: 1px solid #e2e8f0; background: #fbfcfe; display: grid; grid-template-columns: minmax(240px, 1fr) 160px 170px; gap: 10px; }
.account-toolbar select { height: 44px; cursor: pointer; font-size: 12px; }
.account-search { position: relative; height: 44px; padding: 0; display: flex; align-items: center; }
.account-search svg { width: 17px; height: 17px; margin-left: 14px; color: #64748b; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.account-search input { min-width: 0; height: 100%; padding: 0 13px 0 10px; border: 0; outline: 0; color: #0f172a; background: transparent; flex: 1; font-size: 12px; }
.account-search input::placeholder { color: #94a3b8; }
.account-table-wrap { position: relative; overflow: visible; }
.account-table { table-layout: fixed; overflow: visible; }
.account-table th { padding: 13px 18px; color: #64748b; background: #fff; font-size: 11px; font-weight: 700; letter-spacing: .05em; }
.account-table th:nth-child(1) { width: 28%; }
.account-table th:nth-child(2) { width: 30%; }
.account-table th:nth-child(3) { width: 14%; }
.account-table th:nth-child(4) { width: 16%; }
.account-table th:nth-child(5) { width: 12%; text-align: center; }
.account-table td { height: 68px; padding: 10px 18px; border-top: 1px solid #edf1f5; color: #475569; font-size: 13px; overflow: visible; white-space: normal; }
.account-table tbody tr { transition: background .18s ease; }
.account-table tbody tr:hover { background: #fafcff; }
.account-table tbody tr.filtered-out { display: none; }
.account-table tbody tr:has(.account-menu.open) { position: relative; z-index: 5; }
.account-identity { min-width: 0; display: flex; align-items: center; gap: 11px; }
.account-avatar { width: 36px; height: 36px; border-radius: 9px; color: #fff; background: #0b1728; display: grid; place-items: center; flex: 0 0 auto; font-size: 11px; font-weight: 700; }
.account-identity > span:last-child { min-width: 0; }
.account-identity strong, .account-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-identity strong { color: #0f172a; font-size: 13px; font-weight: 700; }
.account-identity small { margin-top: 2px; color: #64748b; font-size: 10px; }
.account-email { overflow-wrap: anywhere; }
.account-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.account-status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-active { color: #16803c; }
.status-disabled { color: #9a4f51; }
.account-action-cell { position: relative; overflow: visible; text-align: center; }
.account-menu-trigger {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #e8edf3;
  border-radius: 9px;
  color: #64748b;
  background: #fff;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
}
.account-menu-trigger svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
.account-menu-trigger:hover,
.account-menu-trigger.is-open,
.account-menu-trigger[aria-expanded="true"] {
  border-color: rgba(249, 115, 22, .35);
  color: #ea580c;
  background: #fff7ed;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, .08);
}
.account-menu {
  position: absolute;
  z-index: 40;
  top: auto;
  bottom: calc(100% + 8px);
  right: 10px;
  width: 198px;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .14);
  display: none;
  text-align: left;
  animation: accountMenuIn .16s ease;
}
.account-menu.open { display: grid; gap: 2px; }
.account-menu.is-fixed {
  position: fixed;
  top: auto;
  bottom: auto;
  right: auto;
  left: auto;
  z-index: 90;
}
.account-menu:not(.open) {
  display: none !important;
  visibility: hidden;
  pointer-events: none;
}
.account-actions-portal {
  position: fixed;
  z-index: 95;
  width: 198px;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .14);
  display: grid;
  gap: 2px;
  text-align: left;
  animation: accountMenuIn .16s ease;
}
.account-menu-label {
  padding: 4px 10px 8px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.account-menu-divider {
  height: 1px;
  margin: 4px 6px;
  background: #edf2f7;
}
.account-menu button,
.account-actions-portal button {
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  color: #1e293b;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  transition: background .15s ease, color .15s ease;
}
.account-menu button svg,
.account-actions-portal button svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: #64748b;
}
.account-menu button:hover,
.account-actions-portal button:hover {
  color: #0f172a;
  background: #f8fafc;
}
.account-menu button:hover svg,
.account-actions-portal button:hover svg { color: #f97316; }
.account-menu button.danger,
.account-actions-portal button.danger { color: #b91c1c; }
.account-menu button.danger svg,
.account-actions-portal button.danger svg { color: #ef4444; }
.account-menu button.danger:hover,
.account-actions-portal button.danger:hover { color: #991b1b; background: #fff1f2; }
.account-empty { min-height: 150px; color: #64748b; display: grid; place-content: center; gap: 3px; text-align: center; }
.account-empty strong { color: #334155; font-size: 14px; }
.account-empty span { font-size: 11px; }
.account-drawer-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(3,13,21,.45); animation: accountFadeIn .2s ease; }
.account-drawer { position: absolute; inset: 0 0 0 auto; width: min(520px, 94vw); padding: 0; background: #fff; box-shadow: -18px 0 50px rgba(15,23,42,.16); display: flex; flex-direction: column; animation: accountDrawerIn .22s ease; z-index: 1; }
.account-drawer-header { padding: 25px 26px 22px; border-bottom: 1px solid #e2e8f0; display: flex; justify-content: space-between; gap: 20px; flex: 0 0 auto; }
.account-kicker { color: #f97316; font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.account-drawer-header h2 { margin: 5px 0 4px; color: #0f172a; font-size: 24px; letter-spacing: -.03em; }
.account-drawer-header p, .account-modal-header p { margin: 0; color: #64748b; font-size: 11px; }
.account-icon-button { width: 34px; height: 34px; padding: 0; border: 1px solid #e2e8f0; border-radius: 9px; background: #fff; cursor: pointer; font-size: 20px; line-height: 1; }
.account-icon-button:hover { background: #f8fafc; }
.account-drawer-body { min-height: 0; flex: 1; overflow-y: auto; }
.account-drawer-form { padding: 24px 26px; display: flex; flex-direction: column; gap: 16px; }
.account-permissions {
  margin-top: 4px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
  display: grid;
  gap: 14px;
}
.account-permissions-heading strong {
  display: block;
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
}
.account-permissions-heading p,
.account-permission-note {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 11px;
  line-height: 1.45;
}
.account-permission-group { display: grid; gap: 8px; }
.account-permission-label {
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.account-permission-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.account-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #dbe3ec;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.account-check input {
  width: 14px;
  height: 14px;
  accent-color: #f97316;
}
.account-check:has(input:checked) {
  border-color: rgba(249, 115, 22, .45);
  background: rgba(249, 115, 22, .08);
  color: #9a3412;
}
.account-drawer-footer {
  flex: 0 0 auto;
  margin-top: 0;
  padding: 16px 26px 22px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}
.account-modal-header h2 { margin: 4px 0; }
.delete-login-summary { padding: 14px; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; display: flex; align-items: center; gap: 11px; }
.delete-login-summary strong, .delete-login-summary small { display: block; }
.delete-login-summary strong { color: #0f172a; font-size: 13px; }
.delete-login-summary small { margin-top: 2px; color: #64748b; font-size: 10px; }
.reset-password-fields { display: grid; gap: 16px; }
@keyframes accountDrawerIn { from { transform: translateX(30px); opacity: .6; } }
@keyframes accountFadeIn { from { opacity: 0; } }
@keyframes accountMenuIn { from { opacity: 0; transform: translateY(-4px); } }

.user-summary-button { width: 100%; border: 0; background: transparent; cursor: pointer; text-align: left; }
.user-summary-button .profile-chevron { margin-left: auto; color: #7f909d; font-size: 11px; transition: transform .18s ease; }
.user-summary-button[aria-expanded="true"] .profile-chevron { transform: rotate(180deg); }
.profile-popover { margin: 0 3px 8px; padding: 5px; border: 1px solid rgba(255,255,255,.1); border-radius: 9px; background: rgba(255,255,255,.045); display: none; }
.profile-popover.open { display: grid; animation: accountMenuIn .18s ease; }
.profile-popover button { min-height: 34px; padding: 0 9px; border: 0; border-radius: 6px; color: #b7c1c9; background: transparent; display: flex; align-items: center; gap: 8px; cursor: pointer; text-align: left; font-size: 10px; }
.profile-popover button:hover { color: #fff; background: rgba(255,255,255,.07); }
.profile-popover svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-collapsed .user-summary-button .profile-chevron { display: none; }
.sidebar-collapsed .user-summary-button > span:nth-child(2) { display: none; }
.sidebar-collapsed .profile-popover button { justify-content: center; padding: 0; }
.sidebar-collapsed .profile-popover button span { display: none; }
.role-dashboard { max-width: 1450px; }
.role-dashboard-header { min-height: 112px; margin-bottom: 20px; padding: 24px 26px; border: 1px solid #e2e8f0; border-radius: 14px; color: #fff; background: linear-gradient(135deg, #0b1728, #13273e); box-shadow: 0 8px 25px rgba(11,23,40,.10); display: flex; align-items: center; justify-content: space-between; gap: 22px; overflow: hidden; position: relative; }
.role-dashboard-header::after { content: ""; position: absolute; right: -80px; bottom: -150px; width: 310px; height: 310px; border: 1px solid rgba(255,255,255,.07); border-radius: 50%; box-shadow: 0 0 0 48px rgba(255,255,255,.025); }
.role-dashboard-header > * { position: relative; z-index: 1; }
.role-dashboard-header > div:first-child { min-width: 0; }
.role-dashboard-brand { margin-bottom: 7px; color: #fb923c; display: block; font-size: 9px; font-weight: 700; letter-spacing: .14em; }
.role-dashboard-header h1 { margin: 0 0 4px; font-size: clamp(25px, 2.3vw, 34px); font-weight: 700; letter-spacing: -.04em; }
.role-dashboard-header p { margin: 0; color: #b8c4d0; font-size: 12px; }
.dashboard-role-chip { padding: 7px 11px; border: 1px solid rgba(255,255,255,.16); border-radius: 16px; color: #e5edf5; background: rgba(255,255,255,.07); font-size: 8px; font-weight: 700; letter-spacing: .1em; white-space: nowrap; }
.dashboard-role-chip.manager { color: #ffdcc7; border-color: rgba(249,115,22,.25); background: rgba(249,115,22,.11); }
.dashboard-header-actions { margin-left: auto; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.workspace-selector { min-width: 185px; padding: 7px 10px; border: 1px solid rgba(255,255,255,.18); border-radius: 9px; background: rgba(255,255,255,.08); display: grid; gap: 2px; }
.workspace-selector span { color: #aebccc; font-size: 7px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.workspace-selector select { width: 100%; padding: 0 20px 0 0; border: 0; color: #fff; background: transparent; outline: 0; cursor: pointer; font-size: 10px; font-weight: 600; }
.workspace-selector select option { color: #0f172a; background: #fff; }
.page-header .workspace-selector { min-width: 190px; border-color: #dce1e8; color: #0f172a; background: #fff; }
.page-header .workspace-selector span { color: #64748b; }
.page-header .workspace-selector select { color: #0f172a; }
.workspace-page-actions { display: flex; align-items: center; gap: 10px; }
.role-metrics { margin-bottom: 20px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.role-metric-card { min-height: 122px; padding: 18px 20px; border: 1px solid #e2e8f0; border-radius: 13px; color: #0f172a; background: #fff; box-shadow: 0 4px 18px rgba(15,23,42,.035); display: flex; flex-direction: column; align-items: flex-start; cursor: default; text-align: left; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
button.role-metric-card { cursor: pointer; }
.role-metric-card:hover { border-color: #cdd5df; box-shadow: 0 8px 22px rgba(15,23,42,.06); transform: translateY(-1px); }
.role-metric-card span { color: #64748b; font-size: 10px; font-weight: 700; letter-spacing: .045em; text-transform: uppercase; }
.role-metric-card strong { margin: 9px 0 5px; color: #0f172a; font-size: 29px; line-height: 1; }
.role-metric-card small { margin-top: auto; color: #94a3b8; font-size: 8px; }
.role-dashboard-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, .8fr); gap: 18px; align-items: start; }
.role-content-card { min-width: 0; overflow: hidden; }
.role-content-card > header, .role-activity-card > header { min-height: 68px; padding: 16px 20px; border-bottom: 1px solid #e2e8f0; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.role-content-card > header h2, .role-activity-card > header h2 { margin: 0 0 3px; color: #0f172a; font-size: 16px; }
.role-content-card > header p { margin: 0; font-size: 9px; }
.role-content-card > header .account-button { margin-left: auto; flex: 0 0 auto; }
.role-activity-card { overflow: hidden; }
.role-activity-card .activity-list { padding-top: 17px; }
.role-record-table th { padding: 12px 16px; font-size: 8px; }
.role-record-table td { height: 55px; padding: 12px 16px; font-size: 10px; }
.role-record-table td strong { color: #0f172a; }
.role-empty-state { min-height: 210px; padding: 30px; color: #64748b; display: grid; place-items: center; align-content: center; text-align: center; }
.role-empty-state > span { width: 40px; height: 40px; margin-bottom: 9px; border-radius: 10px; color: #f97316; background: #fff2e9; display: grid; place-items: center; }
.role-empty-state svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.role-empty-state h3 { margin: 0 0 4px; font-size: 14px; }
.role-empty-state p { margin: 0; font-size: 9px; }
.manager-task-list { padding: 12px 20px 20px; display: grid; gap: 9px; }
.manager-task-list > div { min-height: 48px; padding: 10px 12px; border: 1px solid #e8edf3; border-radius: 9px; background: #fbfcfe; display: flex; align-items: center; gap: 11px; }
.manager-task-list span { width: 25px; height: 25px; border-radius: 7px; color: #b84f1b; background: #fff0e8; display: grid; place-items: center; flex: 0 0 auto; font-size: 9px; font-weight: 700; }
.manager-task-list strong { color: #334155; font-size: 10px; }
.role-records-page { max-width: 1250px; }
.role-records-page .role-content-card { min-height: 220px; }
.manager-client-list { padding: 8px 18px; display: grid; }
.manager-client-list > div { min-height: 64px; padding: 10px 0; border-bottom: 1px solid #edf1f5; display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 11px; }
.manager-client-list > div:last-child { border-bottom: 0; }
.manager-client-list strong { font-size: 11px; }
.own-profile-page { max-width: 1050px; }

.editor-page { max-width: none; }
.editor-mode .main-content { padding: var(--header-height) 0 0; overflow: hidden; }
.document-editor { height: calc(100vh - var(--header-height)); min-height: 560px; background: #eef1f0; }
.document-editor-toolbar {
  position: relative;
  height: 52px;
  padding: 0 18px;
  border-bottom: 1px solid #e8e8e8;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.editor-country-context { position: absolute; left: 50%; display: flex; flex-direction: column; align-items: center; transform: translateX(-50%); line-height: 1.25; }
.editor-country-context strong { color: #10283b; font-size: 11px; font-weight: 700; }
.editor-country-context small { color: #78857f; font-size: 7px; font-weight: 500; }
.editor-breadcrumb { display: flex; align-items: center; gap: 14px; font-size: 10px; }
.editor-breadcrumb button { padding: 5px 8px; border: 1px solid transparent; border-radius: 6px; background: none; cursor: pointer; font-size: 10px; }
.editor-breadcrumb button:hover { border-color: var(--border); background: #f5f7f6; }
.editor-breadcrumb span { padding-left: 14px; border-left: 1px solid var(--border); color: #b45c32; font-size: 9px; font-weight: 600; letter-spacing: .12em; }
.editor-breadcrumb strong { font-size: 14px; font-weight: 600; }
.editor-save { color: #fff; border-color: var(--sidebar-bg); background: var(--sidebar-bg); }
.editor-save-banner { height: 24px; padding: 5px 16px; border-bottom: 1px solid #cce9db; color: #167047; background: #eaf8f1; font-size: 9px; }
.document-editor-body {
  height: calc(100% - 76px);
  display: grid;
  grid-template-columns: minmax(420px, 460px) minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
  background: #f6f6f6;
}
.document-editor-body.no-save-banner { height: calc(100% - 52px); }
.document-form-panel {
  padding: 18px 16px 28px;
  border-right: 1px solid #e8e8e8;
  background: #f9f9f9;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.document-form-panel::-webkit-scrollbar { display: none; }
.document-form-shell {
  padding: 8px 14px 18px;
  border: 1px solid #e4e4e4;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .04);
}
.invoice-form-panel { padding: 18px 16px 28px; background: #f9f9f9; }
.invoice-form-panel .document-form-shell,
.contract-form-panel .document-form-shell { background: #fff; }
.invoice-form-panel .editor-form-card { margin: 0; padding: 18px 0; border: 0; border-bottom: 1px solid #eee; border-radius: 0; box-shadow: none; }
.invoice-form-panel .editor-form-card:last-of-type { border-bottom: 0; }
.invoice-form-panel .editor-form-card h3 {
  margin-bottom: 15px;
  padding: 0;
  border: 0;
  color: #183044;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
}
.invoice-form-panel .section-number {
  width: 22px;
  height: 22px;
  border: 1px solid #f2c3aa;
  border-radius: 6px;
  color: #b94f1b;
  background: #fff4ed;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 9px;
  letter-spacing: 0;
}
.invoice-form-panel .form-field > span {
  width: fit-content;
  margin-bottom: 6px;
  padding: 3px 6px;
  border-radius: 3px;
  color: #344b5e;
  background: #e9eef2;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .07em;
}
.invoice-form-panel .input {
  border-color: #d8dce0;
  color: #10283b;
  background: #fafafa;
  border-radius: 10px;
  font-weight: 500;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.invoice-form-panel .input:hover { border-color: #c0c6cc; background: #fff; }
.invoice-form-panel .input::placeholder { color: #7b8995; font-weight: 400; }
.invoice-form-panel .input:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(229,106,40,.1); }
.invoice-form-panel input[type="date"] { color-scheme: light; cursor: pointer; }
.invoice-form-panel input[type="date"]::-webkit-calendar-picker-indicator { opacity: .78; cursor: pointer; }
.invoice-form-panel .invoice-detail-row { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.editor-download-cta {
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid #eee;
  display: grid;
  gap: 10px;
}
.download-pdf-cta {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #ff4d6d, #ff3366);
  box-shadow: 0 10px 24px rgba(255, 51, 102, .28);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
}
.download-pdf-cta:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}
.download-cta-note {
  margin: 0;
  color: #7a8491;
  text-align: center;
  font-size: 10px;
  line-height: 1.45;
}
.preview-branding-bar {
  margin-bottom: 10px;
  padding: 10px 14px;
  border: 1px solid #e4e4e4;
  border-radius: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .04);
}
.preview-branding-bar strong {
  color: #183044;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
}
.preview-branding-bar span {
  color: #8a94a0;
  font-size: 9px;
}
.editor-form-card { margin-bottom: 13px; padding: 16px 14px; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.editor-form-card h3 { margin-bottom: 16px; color: #65727b; font-size: 9px; font-weight: 600; letter-spacing: .1em; }
.editor-form-card .property-stack { gap: 13px; }
.editor-form-card .form-field > span { font-size: 8px; }
.editor-form-card .input { height: 43px; border-radius: 9px; font-size: 10px; }
.editor-form-card .editor-textarea { height: 62px; min-height: 62px; }
.invoice-detail-row { margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid #e8ebea; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.joined-control { display: flex; }
.joined-control .input { min-width: 0; border-radius: 9px 0 0 9px; }
.joined-control button { width: 42px; border: 1px solid var(--border); border-left: 0; border-radius: 0 9px 9px 0; color: #173047; background: #fff; cursor: pointer; font-size: 15px; }
.branding-heading { margin: 2px 0 11px; display: flex; justify-content: space-between; color: #65727b; font-size: 8px; font-weight: 600; letter-spacing: .08em; }
.design-section-label { margin: 3px 0 9px; display: flex; justify-content: space-between; align-items: center; color: #65727b; font-size: 8px; font-weight: 600; letter-spacing: .08em; }
.design-section-label small { color: #9aa39f; font-size: 7px; font-weight: 400; letter-spacing: 0; }
.default-design-grid { margin-bottom: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.default-design-grid.single-design, .custom-design-actions.single-design, .design-remove-actions.single-design { grid-template-columns: 1fr; }
.default-design-grid button { min-width: 0; padding: 7px; border: 1px solid var(--border); border-radius: 8px; color: #52615a; background: #fff; cursor: pointer; font-size: 8px; transition: border-color .15s, background .15s; }
.default-design-grid button:hover { border-color: var(--accent); }
.default-design-grid button.active { border: 2px solid var(--accent); padding: 6px; background: #fffaf7; }
.default-design-grid img { width: 100%; height: 54px; margin-bottom: 6px; border-radius: 4px; display: block; object-fit: cover; background: #f5f5f0; }
.default-design-grid button:last-child img { object-fit: contain; }
.default-design-grid span { display: block; font-weight: 600; }
.custom-design-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.custom-design-actions button { min-height: 55px; padding: 7px; border: 1px dashed #b9c8d4; border-radius: 7px; color: #53636d; background: #fbfcfc; display: grid; grid-template-columns: 22px 1fr; grid-template-rows: 1fr 1fr; column-gap: 5px; align-items: center; text-align: left; cursor: pointer; }
.custom-design-actions button:hover { border-color: var(--accent); background: #fffaf7; }
.custom-design-actions button > span { grid-row: 1 / 3; color: var(--accent); font-size: 16px; text-align: center; }
.custom-design-actions button strong { align-self: end; color: var(--text-primary); font-size: 8px; }
.custom-design-actions button small { align-self: start; color: var(--text-secondary); font-size: 6px; }
.design-remove-actions { margin-top: 6px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; text-align: center; }
.design-remove-actions .text-link { color: var(--danger); font-size: 7px; }
.branding-grid { margin-bottom: 11px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.branding-grid > button { min-height: 57px; padding: 7px 3px; border: 1px dashed var(--border); border-radius: 9px; color: #64727b; background: #fff; display: grid; place-items: center; cursor: pointer; font-size: 12px; }
.branding-grid > button span { color: var(--text-primary); font-size: 7px; font-weight: 600; line-height: 1.35; }
.header-creative-upload {
  width: 100%;
  min-height: 82px;
  padding: 8px;
  border: 1px dashed #cbd3cf;
  border-radius: 9px;
  color: #68756f;
  background: #fbfcfc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
}
.header-creative-upload:hover { border-color: var(--accent); background: #fffaf7; }
.header-creative-upload img { width: 100%; aspect-ratio: 21 / 4; border-radius: 5px; object-fit: cover; }
.header-creative-upload .creative-applied { margin-top: 6px; color: var(--success); font-size: 7px; font-weight: 500; }
.pdf-background-heading { margin-top: 18px; }
.pdf-background-upload {
  width: 100%;
  min-height: 106px;
  padding: 8px;
  border: 1px dashed #cbd3cf;
  border-radius: 9px;
  color: #68756f;
  background: #fbfcfc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
}
.pdf-background-upload:hover { border-color: var(--accent); background: #fffaf7; }
.pdf-background-upload img { width: 66px; aspect-ratio: 210 / 297; border: 1px solid var(--border); border-radius: 3px; object-fit: cover; }
.pdf-background-upload strong { margin: 5px 0 2px; color: var(--text-primary); font-size: 8px; }
.pdf-background-upload small { font-size: 6px; }
.pdf-background-upload .creative-applied { margin-top: 5px; color: var(--success); font-size: 7px; font-weight: 500; }
.header-creative-upload strong { margin: 5px 0 2px; color: var(--text-primary); font-size: 8px; }
.header-creative-upload small { font-size: 6px; }
.upload-creative-icon { color: var(--accent); font-size: 18px; }
.brand-thumbnail { width: 61px; height: 40px; padding: 4px; border-radius: 5px; color: #fff; background: linear-gradient(115deg, #e96818, #b80e29); display: flex; flex-direction: column; justify-content: center; font-size: 12px; font-weight: 700; line-height: 1; overflow: hidden; }
.brand-thumbnail small { margin-top: 4px; font-size: 5px; text-align: center; }
.editor-detail-fields { margin-top: 16px; }
.line-item-list { display: grid; gap: 10px; }
.line-item-editor { padding: 11px; border: 1px solid #d7dfe3; border-radius: 8px; background: #f6f8f8; box-shadow: 0 1px 2px rgba(7,21,33,.035); }
.line-item-editor .line-description { height: 78px; min-height: 78px; background: #fff; }
.line-item-values { margin-top: 8px; display: grid; grid-template-columns: 1fr 1fr 25px; gap: 8px; align-items: end; }
.line-item-values .input { height: 30px; border-radius: 4px; background: #fff; }
.remove-line-item { width: 25px; height: 30px; border: 0; border-radius: 5px; color: #ff948c; background: #fff0ef; cursor: pointer; font-size: 15px; }
.add-line-item-button { width: 100%; height: 34px; margin-top: 10px; border: 1px dashed #8ca9c1; border-radius: 6px; color: #173047; background: #fff; cursor: pointer; font-size: 10px; font-weight: 600; transition: border-color .15s, background .15s; }
.add-line-item-button:hover { border-color: var(--accent); background: #fffaf7; }
.bank-option { position: relative; width: 100%; margin-bottom: 8px; padding: 12px 40px 12px 12px; border: 1px solid var(--border); border-radius: 8px; color: #253542; background: #fff; display: block; text-align: left; cursor: pointer; font-size: 9px; line-height: 1.55; transition: border-color .15s, background .15s; }
.bank-option:hover { border-color: #aeb9b3; background: #fbfcfc; }
.bank-option strong, .bank-option span { display: block; }
.bank-option strong { margin-bottom: 5px; color: #162d40; font-size: 9px; font-weight: 700; }
.bank-option.active { border: 2px solid var(--accent); padding: 11px 39px 11px 11px; background: #fffaf6; }
.bank-option.active::after { content: "✓"; position: absolute; top: 12px; right: 12px; width: 18px; height: 18px; border-radius: 50%; color: #fff; background: var(--accent); display: grid; place-items: center; font-size: 10px; font-weight: 700; }
.invoice-form-panel::-webkit-scrollbar { display: none; }
.contract-form-panel { padding: 18px 16px 28px; background: #f9f9f9; }
.contract-form-panel .editor-form-card { margin: 0; padding: 18px 0; border: 0; border-bottom: 1px solid #eee; border-radius: 0; box-shadow: none; }
.contract-form-panel .editor-form-card:last-of-type { border-bottom: 0; }
.contract-form-panel .editor-form-card h3 { margin-bottom: 16px; color: #183044; display: flex; align-items: center; gap: 8px; font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.contract-form-panel .section-number { width: 22px; height: 22px; border: 1px solid #f2c3aa; border-radius: 6px; color: #b94f1b; background: #fff4ed; display: grid; place-items: center; flex: 0 0 auto; font-size: 9px; }
.contract-form-panel .form-field > span { width: fit-content; margin-bottom: 6px; padding: 3px 6px; border-radius: 3px; color: #344b5e; background: #e9eef2; font-size: 8px; font-weight: 700; letter-spacing: .07em; }
.contract-form-panel .input { border-color: #d8dce0; color: #10283b; background: #fafafa; border-radius: 10px; font-weight: 500; }
.contract-form-panel .input:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(229,106,40,.1); }
.contract-form-panel .contract-client-signature-field:disabled { border-color: #d8dee2; color: #8a969f; background: #eef1f3; cursor: not-allowed; opacity: 1; }
.contract-form-panel .contract-client-signature-field:disabled::placeholder { color: #8a969f; opacity: 1; }
.contract-service-textarea { min-height: 90px !important; }
.contract-payment-label { margin-top: 15px; color: #183044; }
.contract-payment-list { display: grid; gap: 8px; }
.contract-payment-row { padding: 8px; border-radius: 8px; background: #f6f8f9; display: grid; grid-template-columns: 1fr 1fr 28px; gap: 8px; }
.contract-payment-row .input { min-width: 0; height: 36px; background: #fff; }
.contract-payment-row button { border: 0; border-radius: 5px; color: #e87870; background: #fff1f0; cursor: pointer; }
.contract-add-payment { color: var(--accent); border-color: var(--accent); }
.contract-form-panel::-webkit-scrollbar { display: none; }
.live-preview { position: relative; min-width: 0; padding: 16px 22px 28px; background: #f0f0f0; overflow: auto; scrollbar-width: none; -ms-overflow-style: none; }
.live-preview::-webkit-scrollbar { display: none; }
.preview-topline {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #8a94a0;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .06em;
}
.preview-topline strong { color: #5c6773; }
.preview-topline { display: flex; justify-content: space-between; color: #78847f; font-size: 8px; letter-spacing: .08em; }
.preview-topline span { font-weight: 400; letter-spacing: 0; }
.zoom-controls { height: 40px; display: flex; justify-content: center; align-items: center; gap: 5px; }
.zoom-controls button, .zoom-controls output { min-width: 29px; height: 29px; padding: 0 8px; border: 1px solid var(--border); border-radius: 16px; color: #5f6b66; background: #fff; display: grid; place-items: center; font-size: 10px; }
.zoom-controls button { cursor: pointer; }
.zoom-controls button:hover { border-color: #aab6b0; color: var(--text-primary); background: #fff; }
.zoom-controls .fit-button { color: #a3aaa7; background: #e9eceb; }
.editor-paper-wrap { min-height: calc(100% - 56px); display: flex; align-items: flex-start; justify-content: center; }
.contract-paper-stack { flex-direction: column; align-items: center; justify-content: flex-start; gap: 22px; }
.editor-preview-page { width: 210mm; max-width: 100%; }
.editor-preview-page .page-label { width: 100%; }
.editor-a4 {
  width: 210mm;
  min-width: 210mm;
  min-height: 297mm;
  margin: 0;
  transform: none;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  border: 1px solid #d9dfdc;
  box-shadow: 0 10px 28px rgba(7,21,33,.12);
}
.editor-a4.invoice-a4 { position: relative; isolation: isolate; background: #fff; }
.editor-a4.invoice-a4 .a4-inner { position: relative; z-index: 1; padding: 6% 10%; background: transparent; }
.editor-a4.invoice-a4.template-two .a4-inner { padding-top: 15.5%; }
.editor-a4.invoice-a4 .a4-inner .invoice-banner { margin: -7.5% -12.5% 6%; }
.invoice-page-background { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.invoice-a4 .invoice-banner, .invoice-a4 .invoice-content-exact { position: relative; z-index: 2; }
.editor-a4 .a4-inner { font-size: 13px; }
.editor-a4 .invoice-banner { font-size: 37px; }
.editor-a4 p { font-size: 13px; line-height: 1.5; }
.editor-a4 .invoice-items { margin-block: 5%; }
.editor-a4 .invoice-items th, .editor-a4 .invoice-items td { padding: 9px 8px; font-size: 13px; }
.editor-a4 .totals div { padding: 4px 0; font-size: 13px; }
.editor-a4 .mock-title { font-size: 28px; }
.editor-layout { height: calc(100vh - 190px); min-height: 650px; display: grid; grid-template-columns: 220px minmax(520px, 1fr) 280px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: #edf0ef; overflow: hidden; }
.editor-panel { padding: 18px; background: #fff; overflow-y: auto; }
.editor-panel.left { border-right: 1px solid var(--border); }
.editor-panel.right { border-left: 1px solid var(--border); }
.editor-panel h3 { font-size: 13px; }
.editor-section-button {
  width: 100%; padding: 10px; margin-bottom: 5px; border: 1px solid transparent; border-radius: 7px; background: none; text-align: left; cursor: pointer; font-size: 10px;
}
.editor-section-button.active { border-color: var(--border); background: #f5f7f6; }
.document-workspace { padding: 26px; overflow: auto; text-align: center; }
.page-label { margin: 0 auto 7px; width: min(100%, 720px); color: var(--text-secondary); text-align: left; font-size: 9px; }
.a4-page { width: min(100%, 720px); aspect-ratio: 210/297; margin: 0 auto 28px; text-align: left; background: #fff; box-shadow: 0 3px 14px rgba(7,21,33,.1); overflow: hidden; font-family: "Montserrat", Arial, sans-serif; }
.a4-inner { min-height: 100%; padding: 8%; }
.contract-cover-page { width: 100%; height: 100%; padding: 0; }
.contract-cover-page img { width: 100%; height: 100%; display: block; object-fit: cover; }
.contract-a4 { position: relative; isolation: isolate; }
.contract-document-page { position: relative; width: 100%; height: 100%; min-height: 297mm; padding: 0; color: #071627; background: #fff; overflow: hidden; }
.contract-header-design { position: relative; z-index: 2; width: 100%; aspect-ratio: 21 / 4; display: block; object-fit: cover; }
.contract-document-content { position: relative; z-index: 2; padding: 3.5% 8% 11%; }
.contract-template-two .contract-document-content { padding-top: 11.5%; padding-bottom: 13%; }
.contract-document-content > h1 { margin: 0 0 24px; text-align: center; font-size: 38px; line-height: 1; letter-spacing: .08em; }
.contract-document-content section { margin-bottom: 14px; }
.contract-document-content section > h2 { margin: 0 0 10px; padding: 5px 12px; color: #fff; background: #0b172b; display: flex; align-items: center; gap: 9px; font-size: 18px; line-height: 1.2; }
.contract-section-icon { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.contract-details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.contract-details-grid dl { margin: 0; }
.contract-details-grid dl > div { margin-bottom: 6px; display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 7px; }
.contract-details-grid dt { font-size: 10px; font-weight: 700; }
.contract-details-grid dd { min-height: 25px; margin: 0; padding: 4px 7px; border: 1px solid #d7dcdf; font-size: 10px; }
.contract-service-box { min-height: 164px; padding: 10px; border: 1px solid #172536; white-space: pre-wrap; font-size: 11px; }
.contract-fees-table { width: 100%; border: 1px solid #172536; border-collapse: collapse; table-layout: fixed; }
.contract-fees-table th, .contract-fees-table td { padding: 9px 5px; border: 1px solid #172536; text-align: center; font-size: 10px; }
.contract-fees-table th { color: #071627; background: #f0f1f2; font-weight: 700; }
.contract-fees-table td { background: #fff; }
.contract-fees-table th:first-child { width: 10%; }
.contract-grand-total { width: 45%; margin: 0 0 0 auto; display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; font-size: 16px; }
.contract-grand-total strong { min-height: 42px; padding: 8px; background: #fff; display: flex; align-items: center; justify-content: flex-end; text-align: right; }
.contract-grand-total strong:first-child { background: transparent; }
.contract-grand-total strong:last-child { border: 1px solid #172536; justify-content: center; text-align: center; }
.contract-document-footer { position: absolute; z-index: 2; right: 7%; bottom: 22px; left: 7%; min-height: 50px; padding-bottom: 7px; border-bottom: 6px solid var(--accent); display: flex; align-items: flex-end; gap: 12px; }
.contract-document-footer img { width: 60px; height: 50px; object-fit: contain; }
.contract-document-footer strong { font-size: 10px; }
.contract-terms-page .contract-document-content { padding-top: 4%; }
.contract-terms-page.contract-template-two .contract-document-content { padding-top: 14%; }
.contract-terms-page .contract-document-content section > h2 { font-size: 18px; text-transform: uppercase; }
.contract-terms { margin: 0; padding-left: 18px; font-size: 9px; line-height: 1.28; }
.contract-terms li { margin-bottom: 3px; padding-left: 2px; }
.contract-authorise { margin-top: 14px; }
.contract-signature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.contract-signature-grid > div { display: block; font-size: 11px; line-height: 1.45; }
.contract-signature-box { grid-column: 1 / -1; height: 82px; margin-bottom: 8px; border: 1px dashed #bfc6ca; background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.contract-signature-script { max-width: 92%; color: #071627; font: 400 42px/1 "Allura", cursive; white-space: nowrap; transform: rotate(-2deg); }
.contract-signature-grid strong { margin-right: 4px; }
.contract-signature-grid > div > span:not(.contract-signature-script) { font-weight: 700; }
.contract-signature-grid > div > span:not(.contract-signature-script)::after { content: ""; display: block; height: 1px; }
.a4-inner .invoice-banner { margin: -9.524% -9.524% 7%; }
.invoice-banner { display: flex; align-items: flex-start; justify-content: space-between; }
.invoice-banner > span { display: flex; flex-direction: column; font-weight: 700; line-height: .9; }
.invoice-banner > span small { margin: 6px 0 0 18px; font-size: .36em; font-weight: 400; }
.invoice-banner > em { font-size: .34em; font-style: normal; font-weight: 400; text-align: right; }
.invoice-banner > em small { margin-top: 8px; display: block; }
.invoice-banner.custom-header { position: relative; padding: 0; background: #fff; }
.invoice-banner.custom-header img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; object-position: center; }
.invoice-banner.empty-header { padding: 7px; border: 1px solid #cbd3cf; color: var(--text-secondary); background: #fff; }
.invoice-banner.empty-header > button {
  width: 100%;
  height: 100%;
  border: 1px dashed #cbd3cf;
  border-radius: 4px;
  color: var(--text-secondary);
  background: #fafbfb;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.invoice-banner.empty-header > button:hover { border-color: var(--accent); color: var(--accent); background: #fffaf7; }
.invoice-banner.empty-header > button span { font-size: .8em; line-height: 1; }
.invoice-banner.empty-header > button strong { margin: 4px 0 2px; font-size: .42em; letter-spacing: .1em; }
.invoice-banner.empty-header > button small { font-size: .28em; }
.invoice-meta { margin: 7% 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12%; }
.invoice-heading-row { margin: 0 0 7%; }
.invoice-heading-row > div:last-child { text-align: right; }
.invoice-parties { margin: 0 0 7%; }
.invoice-parties small { margin-bottom: 5px; display: block; color: #707c76; font-weight: 600; }
.invoice-items { width: 100%; margin: 7% 0; }
.invoice-items th, .invoice-items td { padding: 8px 5px; font-size: 8px; }
.totals { width: 45%; margin-left: auto; }
.invoice-summary { display: flex; align-items: flex-start; justify-content: space-between; gap: 10%; }
.invoice-notes { width: 45%; font-size: 8px; }
.invoice-notes p { margin: 3px 0 10px; }
.invoice-summary .totals { width: 45%; margin: 0; }
.invoice-content-exact { color: #061729; }
.invoice-title-block { margin-bottom: 22px; display: flex; align-items: flex-start; justify-content: space-between; }
.invoice-title-block h2 { margin: 0; font-size: 4.1em; font-weight: 700; line-height: 1; letter-spacing: -.045em; }
.invoice-title-block dl { margin: 0; min-width: 86px; text-align: right; }
.invoice-title-block dt { margin-bottom: 2px; color: #7a858d; font-size: .72em; font-weight: 600; }
.invoice-title-block dd { margin: 0 0 11px; font-weight: 600; }
.invoice-address-row { margin-bottom: 52px; display: grid; grid-template-columns: 1fr 1fr; gap: 7%; }
.invoice-address-row small { margin-bottom: 5px; display: block; color: var(--accent); font-size: .72em; font-weight: 700; }
.invoice-address-row strong { display: block; font-size: 1.12em; }
.invoice-address-row p { margin: 2px 0 0; color: #172733; line-height: 1.5; }
.invoice-exact-table { width: 100%; table-layout: fixed; }
.invoice-exact-table th { padding: 0 9px 9px; border-bottom: 1px solid #172733; color: #25333e; font-size: .72em; font-weight: 600; }
.invoice-exact-table th:first-child, .invoice-exact-table td:first-child { width: 53%; text-align: left; }
.invoice-exact-table th:not(:first-child), .invoice-exact-table td:not(:first-child) { text-align: right; }
.invoice-exact-table td { padding: 10px 9px; border-bottom: 1px solid #e0e4e5; font-size: .9em; }
.invoice-lower-area { position: relative; min-height: 590px; }
.invoice-exact-totals { position: absolute; z-index: 5; top: 295px; right: 0; width: 39%; color: #061729; }
.invoice-exact-totals > div { padding: 4px 3px; display: flex; justify-content: space-between; }
.invoice-exact-grand { margin-top: 3px; border-top: 2px solid var(--accent); background: transparent; font-size: 1.35em; }
.invoice-exact-grand strong:first-child { margin-left: -5px; padding: 3px 5px; background: transparent; }
.bank-transfer-box { position: absolute; z-index: 2; top: 395px; right: 0; left: 0; min-height: 108px; padding: 16px; border: 1px solid #dce1e3; border-radius: 7px; background: #f7f8f8; display: flex; flex-direction: column; gap: 3px; }
.bank-transfer-box > strong { margin-bottom: 4px; font-size: .85em; }
.invoice-contact-note { position: absolute; z-index: 2; top: 520px; right: 0; left: 0; margin: 0; font-size: .76em; font-style: italic; }
.invoice-a4.with-header .invoice-lower-area { min-height: 455px; }
.invoice-a4.with-header .invoice-exact-totals { top: 150px; }
.invoice-a4.with-header .bank-transfer-box { top: 250px; }
.invoice-a4.with-header .invoice-contact-note { top: 375px; }
.invoice-a4.template-two .invoice-lower-area { min-height: 390px; }
.invoice-a4.template-two .invoice-exact-totals { top: 95px; }
.invoice-a4.template-two .bank-transfer-box { top: 190px; }
.invoice-a4.template-two .invoice-contact-note { top: 315px; }
.totals div { padding: 4px 0; display: flex; justify-content: space-between; font-size: 9px; }
.totals .grand-total { margin-top: 5px; padding-top: 8px; border-top: 2px solid #27343c; font-weight: 700; }
.property-stack { display: grid; gap: 12px; }
.property-stack .input { height: 38px; font-size: 10px; }
.add-page { margin: 0 auto 30px; }
.section-list-item { padding: 9px; margin-bottom: 6px; border: 1px solid var(--border); border-radius: 7px; display: flex; justify-content: space-between; font-size: 9px; cursor: grab; }
.signature-field { margin: 10% 0 0 auto; width: 42%; padding: 12px; border: 1px solid var(--accent); background: #fff8f3; color: #a34b1c; font-size: 9px; font-weight: 600; }

/* Consistent, high-clarity typography across every workspace page */
.nav-group-title,
.workspace-identity small,
.eyebrow,
.metric-card small,
th,
.form-field > span,
.branding-heading,
.design-section-label,
.page-label {
  font-weight: 700;
}
.nav-item,
.logout-button,
.search-box,
.tab,
.pill-tab,
.text-link,
td,
.page-header p,
.section-row p,
.country-heading p,
.activity-item small {
  font-weight: 500;
}
.nav-item.active,
.workspace-identity strong,
.user-summary strong,
.quick-actions button,
.document-cell strong,
.user-cell strong,
.activity-item strong {
  font-weight: 700;
}
.page-header h1,
.country-heading h1,
.section-row h2,
.card-heading h2,
.empty-state h3,
.editor-breadcrumb strong,
.editor-form-card h3 {
  font-weight: 700;
}
.invoice-form-panel .input,
.invoice-form-panel select,
.invoice-form-panel textarea {
  font-weight: 600;
}

.modal-backdrop { position: fixed; inset: 0; z-index: 100; padding: 20px; background: rgba(3,13,21,.55); display: grid; place-items: center; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 40px); padding: 24px; border-radius: var(--radius-lg); background: #fff; box-shadow: 0 20px 50px rgba(3,13,21,.2); overflow-y: auto; }
.modal.wide { width: min(720px, 100%); }
.modal.wide:has(.create-template-grid) { width: min(900px, 100%); }
.modal.paywall-modal,
.modal.wide.paywall-modal { width: min(980px, 100%); }
.paywall-header { align-items: flex-start; }
.paywall-kicker {
  margin-bottom: 8px;
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  color: #ff3366;
  background: rgba(255, 51, 102, .08);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.paywall-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.paywall-plan {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 18px 18px;
  border: 1px solid #e8e8e8;
  border-radius: 16px;
  background: #fafafa;
}
.paywall-plan.popular {
  border-color: transparent;
  background: #0d2750;
  color: #fff;
  box-shadow: 0 16px 36px rgba(13, 39, 80, .22);
}
.paywall-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 10px;
  border-radius: 999px;
  color: #fff;
  background: #ff3366;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .08em;
  white-space: nowrap;
}
.paywall-tier {
  display: inline-flex;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  color: #667085;
  background: #fff;
  border: 1px solid #e8e8e8;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.paywall-plan.popular .paywall-tier {
  color: #ffb07a;
  background: rgba(255, 107, 24, .12);
  border-color: rgba(255, 107, 24, .28);
}
.paywall-plan h3 { margin: 4px 0 0; font-size: 18px; }
.paywall-plan.popular h3 { color: #fff; }
.paywall-plan > p { margin: 0; color: #667085; font-size: 11px; line-height: 1.45; }
.paywall-plan.popular > p { color: #b7c1d0; }
.paywall-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 4px 0 6px;
}
.paywall-price strong { font-size: 28px; line-height: 1; }
.paywall-price small { color: #7a8699; font-size: 11px; }
.paywall-plan.popular .paywall-price small { color: #a8b3c4; }
.paywall-plan .button { width: 100%; justify-content: center; }
.paywall-plan ul {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.paywall-plan li {
  position: relative;
  padding-left: 16px;
  color: #465468;
  font-size: 11px;
  line-height: 1.4;
}
.paywall-plan li::before {
  position: absolute;
  left: 0;
  top: .35em;
  color: #ff3366;
  content: "✓";
  font-weight: 800;
  font-size: 10px;
}
.paywall-plan.popular li { color: #c5cedb; }
.paywall-plan.popular li::before { color: #ff9a5d; }
.paywall-note {
  margin: 0;
  color: #7a8491;
  text-align: center;
  font-size: 11px;
}
.paywall-payment-form { display: grid; gap: 12px; }
.paywall-plan-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #f6f6f6;
  border: 1px solid #e8e8e8;
}
.paywall-plan-summary strong { font-size: 14px; }
.paywall-plan-summary span { color: #667085; font-size: 12px; font-weight: 600; }
.paywall-payment-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.paywall-payment-error {
  min-height: 14px;
  margin: 0;
  color: #b42318;
  font-size: 11px;
}

@media (max-width: 900px) {
  .paywall-grid { grid-template-columns: 1fr; }
  .modal.paywall-modal,
  .modal.wide.paywall-modal { width: min(560px, 100%); }
}
.modal-template-preview { width: min(390px, 100%); max-height: 64vh; margin: 0 auto; border: 1px solid var(--border); border-radius: 7px; display: block; object-fit: contain; }
.modal-header { margin-bottom: 20px; display: flex; justify-content: space-between; gap: 20px; }
.modal-header h2 { margin-bottom: 3px; font-size: 22px; }
.modal-header p { margin: 0; font-size: 11px; }
.modal-footer { margin-top: 20px; display: flex; justify-content: flex-end; gap: 8px; }
.document-actions-modal { width: min(290px, 100%); padding: 16px; }
.send-modal-header { padding-bottom: 16px; border-bottom: 1px solid #e6ebee; }
.send-workflow-label { margin-bottom: 7px; color: var(--accent); display: block; font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.send-workflow-label.contract { color: #1e6a9e; }
.send-summary-card { position: relative; margin-bottom: 20px; padding: 18px 112px 18px 18px; border: 1px solid #f2cfbb; border-radius: 12px; background: #fff8f3; overflow: hidden; }
.send-summary-card.contract { border-color: #cbdce8; background: #f5f9fc; }
.send-summary-card > span { color: #9d5b37; display: block; font-size: 9px; font-weight: 700; letter-spacing: .1em; }
.send-summary-card.contract > span { color: #376c8e; }
.send-summary-card > strong { margin: 4px 0 2px; display: block; font-size: 15px; }
.send-summary-card p { margin: 0; color: #687684; font-size: 11px; }
.send-summary-card b { position: absolute; top: 50%; right: 18px; color: #0b1925; font-size: 18px; transform: translateY(-50%); }
.send-workflow-form { gap: 16px; }
.send-workflow-note { padding: 13px 15px; border: 1px solid #dfe6ea; border-radius: 10px; background: #f8fafb; display: grid; gap: 3px; }
.send-workflow-note strong { color: #253545; font-size: 11px; }
.send-workflow-note span { color: #71808d; font-size: 10px; line-height: 1.55; }
.send-success { text-align: center; }
.send-success-icon { width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 50%; color: #fff; background: #16a36a; display: grid; place-items: center; font-size: 22px; box-shadow: 0 10px 24px rgba(22,163,106,.2); }
.send-success > h2 { margin: 4px 0 7px; font-size: 24px; }
.send-success > p { max-width: 520px; margin: 0 auto 18px; font-size: 11px; }
.generated-link-card { margin: 0 0 18px; padding: 14px; border: 1px solid #bfe6d1; border-radius: 10px; background: #f0fbf5; text-align: left; }
.generated-link-card > strong { margin-bottom: 7px; color: #15744a; display: block; font-size: 9px; letter-spacing: .08em; }
.generated-link-card > div { display: flex; gap: 8px; }
.generated-link-card input { min-width: 0; height: 38px; padding: 0 10px; border: 1px solid #cfdad4; border-radius: 7px; flex: 1; color: #334155; background: #fff; font-size: 10px; }
.generated-link-card button { padding: 0 13px; border: 0; border-radius: 7px; color: #fff; background: #13a36a; cursor: pointer; font-size: 10px; font-weight: 700; }
.simulated-email-preview { max-height: 330px; border: 1px solid #dde3e7; border-radius: 11px; background: #fff; text-align: left; overflow: auto; }
.simulated-email-preview > header { padding: 12px 15px; border-bottom: 1px solid #e8ecef; background: #f8fafb; display: flex; justify-content: space-between; gap: 15px; }
.simulated-email-preview > header div { display: grid; gap: 2px; }
.simulated-email-preview > header strong, .simulated-email-preview > header span { font-size: 10px; }
.simulated-email-preview > header span { color: #6c7985; }
.simulated-email-preview > header small { color: var(--accent); font-size: 8px; font-weight: 700; letter-spacing: .1em; }
.simulated-email-preview > div { padding: 18px; color: #283640; font: 400 11px/1.6 Arial, sans-serif; }
.simulated-email-preview > div p { margin: 0 0 12px; color: inherit; }
.simulated-email-preview > div h3 { margin: 15px 0 7px; font: 700 12px/1.3 Arial, sans-serif; }
.simulated-email-button { padding: 9px 13px; border-radius: 5px; color: #fff; background: var(--accent); display: inline-block; text-decoration: none; font-weight: 700; }
.simulated-email-preview > footer { padding: 11px 15px; border-top: 1px solid #e8ecef; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 10px; }
.simulated-email-preview > footer span { color: #6b7784; }
.secure-link-button { text-decoration: none; }
.send-tracking-card { margin-top: 18px; padding: 20px; }
.send-tracking-grid { margin-bottom: 17px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.send-tracking-grid > div { min-width: 0; padding: 13px; border: 1px solid #e2e7ea; border-radius: 9px; background: #f8fafb; display: grid; gap: 4px; }
.send-tracking-grid span { color: #788592; font-size: 8px; font-weight: 700; letter-spacing: .08em; }
.send-tracking-grid strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.document-actions-header { margin-bottom: 8px; padding-bottom: 11px; border-bottom: 1px solid var(--border); }
.document-actions-header h2 { font-size: 16px; }
.document-action-list { display: grid; }
.document-action-list button { min-height: 42px; padding: 0 3px; border: 0; border-bottom: 1px solid #edf0ef; color: #172936; background: transparent; cursor: pointer; text-align: left; font-size: 11px; font-weight: 500; }
.document-action-list button:last-child { border-bottom: 0; }
.document-action-list button:hover { padding-left: 9px; color: var(--accent); background: #fff8f3; }
.document-action-list .danger-action { color: var(--danger); }
.document-choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.document-choice { min-height: 180px; padding: 20px; border: 1px solid var(--border); border-radius: 12px; background: #fff; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; text-align: left; cursor: pointer; }
.document-choice:hover { border-color: var(--accent); background: #fffaf7; }
.document-choice strong { margin: 16px 0 4px; }
.document-choice small { color: var(--text-secondary); }
.choice-icon { width: 44px; height: 44px; border-radius: 10px; color: var(--accent); background: #fff3ec; display: grid; place-items: center; font-size: 22px; }
.choice-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.create-template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.create-template-option {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.create-template-option:hover {
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(7, 21, 33, .08);
  transform: translateY(-1px);
}
.create-template-option img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: top center;
  border-radius: 10px;
  background: #f3f5f4;
  border: 1px solid rgba(15, 23, 42, .06);
}
.create-template-option span {
  display: grid;
  gap: 3px;
}
.create-template-option strong {
  font-size: 12px;
  color: var(--text-primary);
}
.create-template-option small {
  color: var(--text-secondary);
  font-size: 10px;
  line-height: 1.35;
}
.modal:has(.account-manager-picker) {
  width: min(640px, 100%);
  max-height: none;
  padding: 0;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 100% -10%, rgba(229, 106, 40, .14), transparent 55%),
    #fff;
}
.account-manager-picker {
  display: grid;
  gap: 0;
}
.account-manager-hero {
  position: relative;
  padding: 16px 20px 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(229, 106, 40, .18), transparent 42%),
    linear-gradient(160deg, #0b1925 0%, #132433 58%, #1a303f 100%);
  overflow: hidden;
}
.account-manager-hero::before {
  content: "";
  position: absolute;
  inset: auto -40px -60px auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(229, 106, 40, .35), transparent 68%);
  pointer-events: none;
}
.account-manager-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #f0a06a 45%, transparent);
}
.account-manager-hero-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}
.account-manager-kicker {
  display: inline-flex;
  align-items: center;
  margin-bottom: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .08);
  color: #f6d3bf;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.account-manager-hero h2 {
  margin: 0 0 4px;
  color: #fff;
  font-size: 18px;
  letter-spacing: -.02em;
}
.account-manager-hero p {
  margin: 0;
  color: rgba(255, 255, 255, .72);
  font-size: 11px;
  line-height: 1.4;
}
.account-manager-hero p strong {
  color: #fff;
  font-weight: 600;
}
.account-manager-hero-meta {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex: 0 0 auto;
}
.account-manager-country {
  min-width: 42px;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .1);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}
.account-manager-close {
  color: #fff;
  border-color: rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .08);
}
.account-manager-close:hover {
  background: rgba(255, 255, 255, .16);
}
.account-manager-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: none;
  overflow: visible;
  padding: 14px 16px 10px;
}
.account-manager-option {
  --am-i: 0;
  position: relative;
  min-height: 52px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, rgba(15, 23, 42, .1), rgba(15, 23, 42, .08)) border-box;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(7, 21, 33, .04);
  opacity: 0;
  transform: translateY(10px);
  animation: account-manager-in .42s cubic-bezier(.2, .8, .2, 1) forwards;
  animation-delay: calc(var(--am-i) * 35ms);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
@keyframes account-manager-in {
  to { opacity: 1; transform: translateY(0); }
}
.account-manager-option:hover,
.account-manager-option:focus-visible {
  outline: none;
  background:
    linear-gradient(#fffaf7, #fff) padding-box,
    linear-gradient(135deg, rgba(229, 106, 40, .85), rgba(11, 25, 37, .28)) border-box;
  box-shadow: 0 10px 20px rgba(7, 21, 33, .1);
  transform: translateY(-1px);
}
.account-manager-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}
.account-manager-avatar[data-tone="0"] { background: linear-gradient(145deg, #0b1925, #243746); }
.account-manager-avatar[data-tone="1"] { background: linear-gradient(145deg, #e56a28, #b84d16); }
.account-manager-avatar[data-tone="2"] { background: linear-gradient(145deg, #1f3b4d, #355868); }
.account-manager-avatar[data-tone="3"] { background: linear-gradient(145deg, #c45a22, #8f3d12); }
.account-manager-avatar[data-tone="4"] { background: linear-gradient(145deg, #163041, #2c4d60); }
.account-manager-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
  flex: 1;
}
.account-manager-copy strong {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.account-manager-copy small {
  color: var(--text-secondary);
  font-size: 9px;
}
.account-manager-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: transparent;
  background: #fff;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}
.account-manager-check svg {
  width: 11px;
  height: 11px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.account-manager-option:hover .account-manager-check,
.account-manager-option:focus-visible .account-manager-check {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
  transform: scale(1.05);
}
.account-manager-footer {
  padding: 10px 16px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(15, 23, 42, .06);
  background: linear-gradient(#fbfcfc, #f6f8f7);
}
.account-manager-hint {
  color: var(--text-secondary);
  font-size: 11px;
}
@media (prefers-reduced-motion: reduce) {
  .account-manager-option {
    opacity: 1;
    transform: none;
    animation: none;
  }
}
@media (max-width: 640px) {
  .account-manager-hero {
    padding: 14px 14px 12px;
  }
  .account-manager-grid {
    padding: 12px 12px 8px;
    gap: 7px;
  }
  .account-manager-option {
    min-height: 48px;
    padding: 7px 9px;
  }
  .account-manager-footer {
    padding: 10px 12px 12px;
  }
}

/* ===== Custom Gradient Invoice (template 3) ===== */
.gradient-invoice-a4 {
  background: #f3f4f6 !important;
  color: #1f2937;
}
.editor-a4.gradient-invoice-a4 .a4-inner,
.gradient-invoice-a4 .a4-inner.gi-page,
.gradient-invoice-a4 .gi-page {
  padding: 0 !important;
  background: #f3f4f6 !important;
}
.gradient-invoice-a4 .a4-inner,
.gi-page {
  position: relative;
  height: 100%;
  min-height: 297mm;
  display: flex;
  flex-direction: column;
  background: #f3f4f6;
  overflow: hidden;
}
.gi-hero {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  min-height: 38%;
  padding: 1.2cm 1.5cm 1.7cm;
  color: #fff;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-position: center;
}
.gi-hero-top {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 18px;
}
.gi-brand {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}
.gi-logo,
.gi-logo-fallback {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  flex: 0 0 auto;
  object-fit: contain;
  background: rgba(255,255,255,.92);
}
.gi-logo-fallback {
  display: grid;
  place-items: center;
  color: #0b1925;
  font-weight: 800;
  font-size: 20px;
}
.gi-brand strong,
.gi-brand small {
  display: block;
}
.gi-brand strong {
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.gi-brand small {
  margin-top: 3px;
  opacity: .82;
  font-size: 9px;
  line-height: 1.35;
}
.gi-hero-meta {
  display: grid;
  gap: 8px;
  justify-items: end;
  text-align: right;
  font-size: 10px;
}
.gi-hero-meta > div span,
.gi-billto > span {
  display: block;
  opacity: .78;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.gi-hero-meta strong {
  font-size: 11px;
}
.gi-billto {
  margin-top: 4px;
  max-width: 210px;
}
.gi-billto strong {
  display: block;
  margin-top: 3px;
  font-size: 13px;
}
.gi-billto p {
  margin: 2px 0 0;
  color: inherit;
  opacity: .9;
  font-size: 10px;
  line-height: 1.4;
}
.gi-hero-bottom {
  margin-top: 22px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}
.gi-hero h1 {
  margin: 0;
  font-size: 42px;
  line-height: .95;
  letter-spacing: -.03em;
  font-weight: 800;
}
.gi-invoice-no {
  margin: 8px 0 0;
  color: inherit;
  opacity: .9;
  font-size: 12px;
}
.gi-company-line {
  margin: 8px 0 0;
  color: inherit;
  opacity: .8;
  font-size: 10px;
}
.gi-total-due {
  margin: 0;
  color: inherit;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.gi-continue {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7cm 1.5cm;
  font-size: 11px;
  font-weight: 700;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-position: center;
}
.gi-body {
  position: relative;
  z-index: 2;
  flex: 1;
  margin-top: -28px;
  padding: 1.2cm 1.5cm 1.3cm;
  border-radius: 28px 28px 0 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.gi-body.has-curve {
  box-shadow: 0 -10px 24px rgba(15, 23, 42, .08);
}
.gi-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
  font-size: 10px;
}
.gi-table thead th {
  padding: 10px 12px;
  background: #eef0f3;
  color: #334155;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: none;
}
.gi-table thead th:first-child { border-radius: 14px 0 0 14px; width: 42px; }
.gi-table thead th:last-child { border-radius: 0 14px 14px 0; }
.gi-row td {
  padding: 11px 12px;
  vertical-align: top;
  background: #fff;
}
.gi-row.is-alt td { background: #f3f4f6; }
.gi-row td:first-child { border-radius: 12px 0 0 12px; }
.gi-row td:last-child { border-radius: 0 12px 12px 0; }
.gi-no { color: #64748b; font-weight: 700; }
.gi-desc strong,
.gi-desc small { display: block; }
.gi-desc strong { color: #0f172a; font-size: 11px; }
.gi-desc small { margin-top: 3px; color: #94a3b8; font-size: 9px; line-height: 1.35; }
.gi-num { text-align: right; white-space: nowrap; }
.gi-footer {
  margin-top: auto;
  padding-top: 18px;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 18px;
}
.gi-thanks {
  margin: 0 0 8px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
}
.gi-contact-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  color: #64748b;
  font-size: 9px;
}
.gi-block { margin-top: 10px; }
.gi-block h4 {
  margin: 0 0 6px;
  color: #0f172a;
  font-size: 10px;
  letter-spacing: .06em;
}
.gi-block p {
  margin: 0 0 4px;
  color: #64748b;
  font-size: 9px;
  display: flex;
  gap: 8px;
}
.gi-block p span { min-width: 88px; }
.gi-block p b { color: #334155; font-weight: 600; }
.gi-terms { display: block !important; line-height: 1.45; }
.gi-totals-block {
  display: grid;
  gap: 8px;
  width: 100%;
  font-size: 10px;
}
.gi-totals-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 10px minmax(4.75rem, auto);
  column-gap: 10px;
  align-items: center;
  padding: 0 16px;
  color: #64748b;
}
.gi-tot-label {
  min-width: 0;
  text-align: left;
}
.gi-tot-colon {
  text-align: center;
}
.gi-tot-value {
  color: #0f172a;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.gi-total-bar {
  min-height: 40px;
  padding: 10px 16px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 10px 20px rgba(15, 23, 42, .12);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-position: center;
  overflow: hidden;
}
.gi-total-bar .gi-tot-label,
.gi-total-bar .gi-tot-colon,
.gi-total-bar .gi-tot-value {
  color: inherit;
}
.gi-sign-wrap {
  position: relative;
  margin-top: 16px;
  min-height: 78px;
}
.gi-sign {
  display: grid;
  gap: 2px;
  justify-items: start;
}
.gi-sign strong { font-size: 12px; color: #0f172a; }
.gi-sign small { color: #64748b; font-size: 9px; }
.gi-signature {
  margin-top: 4px;
  max-width: 150px;
  max-height: 54px;
  object-fit: contain;
}
.gi-stamp {
  position: absolute;
  right: 0;
  top: 0;
  width: 72px;
  height: 72px;
  object-fit: contain;
  opacity: .85;
  pointer-events: none;
}
.gi-theme-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.gi-theme-swatch {
  position: relative;
  aspect-ratio: 1.35;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(15, 23, 42, .1);
  border-radius: 12px;
  cursor: pointer;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-position: center;
  background-origin: border-box;
  background-clip: border-box;
  box-shadow: none;
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.gi-theme-swatch:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(7, 21, 33, .12);
}
.gi-theme-swatch:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.gi-theme-swatch.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent);
}
.gi-theme-swatch.custom {
  border-style: dashed;
}
.gi-theme-swatch.custom::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, transparent 46%, rgba(255,255,255,.92) 46% 54%, transparent 54%),
    linear-gradient(45deg, transparent 46%, rgba(15,23,42,.2) 46% 54%, transparent 54%);
  pointer-events: none;
  opacity: .35;
}
.gi-color-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.gi-color-field {
  display: grid;
  gap: 6px;
}
.gi-color-field > span {
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.gi-color-control {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
.gi-color-control input[type="color"] {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
}
.gi-color-control input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.gi-color-control input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 8px;
}
.gi-color-control code {
  color: var(--text-primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
}
.gi-upload-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.gi-upload-row strong,
.gi-upload-row small { display: block; }
.gi-upload-row small { color: var(--text-secondary); font-size: 10px; }
.gi-upload-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.gi-logo-preview {
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: #f8fafc;
}
.gi-logo-preview img {
  display: block;
  max-width: 160px;
  max-height: 64px;
  object-fit: contain;
}
.gi-logo-preview.signature img { max-height: 48px; }
.gi-logo-preview.stamp img { max-width: 72px; max-height: 72px; }
.gi-toggle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
}
.gi-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-secondary);
}
.gi-line-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 6px;
}
.gi-line-actions .danger { color: var(--danger); }
.gi-help {
  margin: 0;
  font-size: 11px;
}
@media (max-width: 960px) {
  .gi-theme-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ===== Custom Gradient Contract (template 3) ===== */
.gradient-contract-a4 {
  background: #f3f4f6 !important;
  color: #1f2937;
}
.editor-a4.gradient-contract-a4 .a4-inner,
.gradient-contract-a4 .a4-inner.gc-page,
.gradient-contract-a4 .gc-page {
  padding: 0 !important;
  background: #f3f4f6 !important;
}
.gradient-contract-a4 .a4-inner,
.gc-page {
  position: relative;
  height: 100%;
  min-height: 297mm;
  display: flex;
  flex-direction: column;
  background: #f3f4f6;
  overflow: hidden;
}
.gc-hero {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  min-height: 32%;
  padding: 1.2cm 1.5cm 1.7cm;
  color: #fff;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-position: center;
}
.gc-hero-top {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 18px;
}
.gc-brand {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}
.gc-logo,
.gc-logo-fallback {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  flex: 0 0 auto;
  object-fit: contain;
  background: rgba(255,255,255,.92);
}
.gc-logo-fallback {
  display: grid;
  place-items: center;
  color: #0b1925;
  font-weight: 800;
  font-size: 20px;
}
.gc-brand strong,
.gc-brand small { display: block; }
.gc-brand strong {
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.gc-brand small {
  margin-top: 3px;
  opacity: .82;
  font-size: 9px;
  line-height: 1.35;
}
.gc-hero-meta {
  display: grid;
  gap: 8px;
  justify-items: end;
  text-align: right;
  font-size: 10px;
}
.gc-hero-meta > div span {
  display: block;
  opacity: .78;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.gc-hero-meta strong { font-size: 11px; }
.gc-hero-bottom {
  margin-top: 22px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}
.gc-hero h1 {
  margin: 0;
  font-size: 42px;
  line-height: .95;
  letter-spacing: -.03em;
  font-weight: 800;
}
.gc-sub {
  margin: 8px 0 0;
  color: inherit;
  opacity: .9;
  font-size: 12px;
}
.gc-total-due {
  margin: 0;
  color: inherit;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.gc-continue {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7cm 1.5cm;
  font-size: 11px;
  font-weight: 700;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-position: center;
}
.gc-body {
  position: relative;
  z-index: 2;
  flex: 1;
  margin-top: -28px;
  padding: 1.2cm 1.5cm 1.3cm;
  border-radius: 28px 28px 0 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 18px;
}
.gc-body.has-curve {
  box-shadow: 0 -10px 24px rgba(15, 23, 42, .08);
}
.gc-section h2 {
  margin: 0 0 10px;
  color: #0f172a;
  font-size: 13px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.gc-kicker {
  display: block;
  margin-bottom: 4px;
  color: #64748b;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.gc-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.gc-parties article {
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
}
.gc-parties strong {
  display: block;
  margin-bottom: 6px;
  color: #0f172a;
  font-size: 12px;
}
.gc-parties p {
  margin: 0 0 4px;
  color: #64748b;
  font-size: 10px;
  line-height: 1.4;
}
.gc-service {
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
  color: #334155;
  font-size: 10px;
  line-height: 1.5;
  min-height: 48px;
}
.gc-fees {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
  font-size: 10px;
}
.gc-fees thead th {
  padding: 10px 12px;
  background: #eef0f3;
  color: #334155;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  text-align: left;
}
.gc-fees thead th:first-child { border-radius: 14px 0 0 14px; width: 42px; }
.gc-fees thead th:last-child { border-radius: 0 14px 14px 0; text-align: right; }
.gc-fees thead th:nth-child(3),
.gc-fees thead th:nth-child(4) { text-align: right; }
.gc-fee-row td {
  padding: 11px 12px;
  vertical-align: middle;
  background: #fff;
  color: #334155;
}
.gc-fee-row.is-alt td { background: #f3f4f6; }
.gc-fee-row td:first-child { border-radius: 12px 0 0 12px; color: #64748b; font-weight: 700; }
.gc-fee-row td:last-child { border-radius: 0 12px 12px 0; }
.gc-fees .num { text-align: right; font-variant-numeric: tabular-nums; }
.gc-totals-block {
  display: grid;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
  font-size: 10px;
}
.gc-totals-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 10px minmax(4.75rem, auto);
  column-gap: 10px;
  align-items: center;
  padding: 0 16px;
  color: #64748b;
}
.gc-tot-label { min-width: 0; text-align: left; }
.gc-tot-colon { text-align: center; }
.gc-tot-value {
  color: #0f172a;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.gc-total-bar {
  min-height: 40px;
  padding: 10px 16px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 10px 20px rgba(15, 23, 42, .12);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-position: center;
  overflow: hidden;
}
.gc-total-bar .gc-tot-label,
.gc-total-bar .gc-tot-colon,
.gc-total-bar .gc-tot-value { color: inherit; }
.gc-terms {
  margin: 0;
  padding-left: 18px;
  color: #475569;
  font-size: 9px;
  line-height: 1.45;
}
.gc-terms li { margin-bottom: 8px; }
.gc-terms strong { color: #0f172a; }
.gc-sign-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.gc-sign-card {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #eef2f7;
  background: #f8fafc;
}
.gc-sign-box {
  display: grid;
  place-items: center;
  min-height: 64px;
  margin: 8px 0 12px;
  border-radius: 12px;
  border: 1px dashed #cbd5e1;
  background: #fff;
}
.gc-sign-script {
  font-size: 28px;
  line-height: 1;
  color: #0f172a;
}
.gc-sign-placeholder {
  color: #94a3b8;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.gc-sign-card p {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 8px;
  margin: 0 0 4px;
  font-size: 10px;
}
.gc-sign-card p span { color: #64748b; }
.gc-sign-card p strong { color: #0f172a; font-weight: 600; }

.toast-region { position: fixed; z-index: 200; right: 20px; bottom: 20px; display: grid; gap: 8px; }
.toast { padding: 12px 16px; border: 1px solid var(--border); border-radius: 9px; color: #fff; background: var(--sidebar-bg); box-shadow: 0 8px 22px rgba(7,21,33,.18); font-size: 11px; animation: toast-in .2s; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

.search-results { margin-top: 12px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.search-result { width: 100%; padding: 12px; border: 0; border-bottom: 1px solid var(--border); background: #fff; display: flex; align-items: center; gap: 11px; text-align: left; cursor: pointer; }
.search-result:last-child { border-bottom: 0; }
.search-result:hover { background: #f8faf9; }
.search-result-icon { width: 31px; height: 31px; border-radius: 8px; color: var(--accent); background: #fff1e9; display: grid; place-items: center; flex: 0 0 auto; font-size: 11px; font-weight: 700; }
.search-result-copy { min-width: 0; flex: 1; }
.search-result-copy strong, .search-result-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result-copy strong { font-size: 10px; }
.search-result-copy small { color: var(--text-secondary); font-size: 8px; }
.search-result-type { color: #819089; font-size: 7px; font-weight: 700; letter-spacing: .08em; }
.search-empty { padding: 24px; color: var(--text-secondary); text-align: center; font-size: 10px; }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.help-card { min-height: 100px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: #fbfcfc; cursor: pointer; text-align: left; }
.help-card:hover { border-color: var(--accent); background: #fffaf7; }
.help-card strong { display: block; margin-bottom: 4px; font-size: 11px; }
.help-card small { color: var(--text-secondary); font-size: 8px; line-height: 1.5; }
.help-shortcuts { margin-top: 16px; padding: 13px; border-radius: 9px; background: #f3f6f5; display: flex; gap: 18px; color: #58675f; font-size: 8px; }

@media (max-width: 1150px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .template-grid,
  .all-template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor-layout { grid-template-columns: 190px minmax(480px, 1fr); }
  .editor-panel.right { display: none; }
  .country-settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 850px) {
  html { scrollbar-gutter: auto; }
  .sidebar, .sidebar-collapsed .sidebar { width: 255px; transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 15px 0 40px rgba(0,0,0,.2); }
  .topbar { left: 0; padding: 0 16px; }
  .main-content { margin-left: 0; padding-left: 20px; padding-right: 20px; }
  .workspace-identity { margin-right: auto; margin-left: 10px; }
  .sidebar-collapsed .brand { justify-content: flex-start; padding-inline: 27px; }
  .sidebar-collapsed .brand-logo-full { display: block; }
  .sidebar-collapsed .brand-logo-compact { display: none; }
  .sidebar-collapsed .brand > span,
  .sidebar-collapsed .nav-group-title,
  .sidebar-collapsed .nav-item > span:not(.nav-icon),
  .sidebar-collapsed .user-summary > span:last-child,
  .sidebar-collapsed .logout-label { display: block; }
  .sidebar-collapsed .sidebar nav { padding-inline: 10px; }
  .sidebar-collapsed .nav-item { padding: 0 10px; justify-content: flex-start; }
  .all-template-grid,
  .template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar-collapsed .user-summary { justify-content: flex-start; padding-inline: 6px; }
  .sidebar-collapsed .logout-button { justify-content: flex-start; padding-inline: 7px; }
  .search-box { width: 38px; }
  .search-label, .search-box kbd { display: none; }
  .topbar-help { width: 36px; padding: 0; justify-content: center; }
  .topbar-help span { display: none; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .editor-layout { height: auto; display: block; overflow: visible; }
  .editor-panel.left { border: 0; border-bottom: 1px solid var(--border); }
  .document-workspace { max-height: none; }
  .document-editor-body { grid-template-columns: 250px minmax(450px, 1fr); overflow-x: auto; }
}
@media (max-width: 620px) {
  .main-content { padding-top: calc(var(--header-height) + 24px); }
  .page-header { display: block; }
  .page-header .button, .header-actions { margin-top: 16px; }
  .metrics, .admin-metrics { grid-template-columns: 1fr; }
  .quick-actions { padding: 14px; align-items: flex-start; flex-direction: column; gap: 10px; }
  .template-grid, .document-choice-grid, .create-template-grid, .form-grid { grid-template-columns: 1fr; }
  .template-type-switch { grid-template-columns: 1fr; }
  .template-filter-tabs { width: 100%; overflow-x: auto; }
  .template-filter-tabs button { flex: 0 0 auto; }
  .settings-page .pill-tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .settings-page .pill-tab { flex: 0 0 auto; }
  .settings-section-heading, .settings-save-bar { align-items: flex-start; flex-direction: column; }
  .settings-save-actions { width: 100%; flex-wrap: wrap; justify-content: flex-start; }
  .logo-upload { align-items: flex-start; flex-wrap: wrap; }
  .logo-file-note { width: 100%; }
  .country-settings-grid { padding-inline: 16px; }
  .business-tip { margin-inline: 16px; }
  .settings-section-heading, .settings-save-bar { padding-inline: 18px; }
  .logo-upload, .settings-placeholder-card { margin-inline: 16px; }
  .country-card-grid { grid-template-columns: 1fr; }
  .form-field.full { grid-column: auto; }
  .topbar-actions .icon-button { display: none; }
  .a4-page { min-width: 500px; }
  .document-workspace { overflow-x: auto; }
  .editor-mode .main-content { padding: var(--header-height) 0 0; }
  .document-editor-toolbar { height: auto; min-height: 58px; padding-block: 8px; gap: 10px; }
  .editor-breadcrumb span { display: none; }
  .editor-breadcrumb strong { font-size: 11px; }
  .editor-country-context { display: none; }
  .document-editor-body { height: calc(100% - 88px); display: flex; flex-direction: column; overflow-y: auto; }
  .document-editor-body.no-save-banner { height: calc(100% - 64px); }
  .document-form-panel { min-height: 340px; overflow: visible; }
  .live-preview { min-height: 620px; overflow: auto; }
}

.login-mode { height: 100vh; overflow: hidden; }
.login-mode .sidebar, .login-mode .topbar { display: none; }
.login-mode .main-content { height: 100vh; min-height: 0; margin: 0; padding: 0; overflow: hidden; }
.login-screen { height: 100vh; min-height: 0; display: grid; grid-template-columns: 46% 54%; background: linear-gradient(135deg, #fafaf8 0%, #f6f7fb 100%); }
.login-showcase {
  position: relative; height: 100vh; min-height: 0; padding: clamp(46px, 6vw, 96px); color: #fff; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
  background:
    radial-gradient(circle at 20% 15%, rgba(249,115,22,.10), transparent 28%),
    radial-gradient(circle at 80% 80%, rgba(59,130,246,.08), transparent 32%),
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(145deg, #07111f 0%, #0b1728 50%, #071523 100%);
  background-size: auto, auto, 72px 72px, 72px 72px, auto;
}
.login-showcase::before { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 1px; background: rgba(255,255,255,.08); }
.login-showcase::after { content: ""; position: absolute; right: -170px; bottom: -200px; width: 560px; height: 560px; border: 1px solid rgba(255,255,255,.035); border-radius: 50%; box-shadow: 0 0 0 80px rgba(255,255,255,.012), 0 0 0 160px rgba(255,255,255,.008); }
.login-showcase-content { position: relative; z-index: 1; width: min(100%, 570px); }
.login-showcase-logo { width: 168px; height: 58px; margin-bottom: 31px; padding: 6px 8px; border: 1px solid rgba(255,255,255,.08); border-radius: 12px; display: block; background: rgba(255,255,255,.035); transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.login-showcase-logo img { width: 100%; height: 100%; object-fit: contain; }
.login-showcase-logo:hover { border-color: rgba(249,115,22,.28); background: rgba(255,255,255,.065); transform: translateY(-2px); }
.login-showcase-logo:focus-visible { outline: 3px solid rgba(249,115,22,.35); outline-offset: 4px; }
.login-wordmark { margin-bottom: 30px; font-size: clamp(42px, 4vw, 64px); font-weight: 700; line-height: .98; letter-spacing: -2px; }
.login-wordmark span, .login-wordmark strong { display: block; }
.login-wordmark strong { margin-top: 9px; color: #f0742f; }
.login-showcase-content > p { max-width: 570px; margin-bottom: 42px; color: #b9c4cf; font-size: clamp(15px, 1.15vw, 18px); line-height: 1.7; }
.login-showcase ul { display: grid; gap: 18px; margin: 0; padding: 0; list-style: none; }
.login-showcase li { display: flex; align-items: center; gap: 15px; color: #e8edf1; animation: loginFeatureIn .4s ease both; }
.login-showcase li:nth-child(2) { animation-delay: .06s; }
.login-showcase li:nth-child(3) { animation-delay: .12s; }
.login-showcase li > span { flex: 0 0 auto; width: 40px; height: 40px; border: 1px solid rgba(249,115,22,.16); border-radius: 10px; color: #f97316; background: rgba(255,255,255,.055); display: grid; place-items: center; box-shadow: 0 8px 24px rgba(249,115,22,.04); }
.login-showcase li svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.login-showcase li strong { color: #e8edf1; font-size: 14px; font-weight: 500; }
.login-showcase > small { position: absolute; z-index: 2; left: clamp(46px, 6vw, 96px); bottom: 34px; color: #82909d; display: flex; align-items: center; gap: 8px; font-size: 13px; letter-spacing: 0; }
.login-showcase > small svg { width: 16px; height: 16px; color: #a6b2bc; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.login-document-art { position: absolute; z-index: 1; right: -12px; bottom: 76px; width: 220px; height: 190px; opacity: .13; transform: rotate(-3deg); pointer-events: none; }
.art-page { position: absolute; width: 132px; height: 174px; padding: 22px 18px; border: 1px solid #fff; border-radius: 8px; background: rgba(255,255,255,.14); box-shadow: 0 18px 35px rgba(0,0,0,.15); }
.art-page-back { right: 4px; top: 2px; transform: rotate(10deg); }
.art-page-front { left: 13px; bottom: 0; }
.art-page b { display: block; margin-bottom: 25px; font-size: 10px; letter-spacing: .08em; }
.art-page i { display: block; height: 3px; margin: 10px 0; border-radius: 3px; background: #fff; }
.art-page i:nth-of-type(2) { width: 72%; }
.art-page i:nth-of-type(3) { width: 48%; }
.art-page span { position: absolute; right: 14px; bottom: 14px; width: 24px; height: 24px; border: 1px solid #fff; border-radius: 50%; display: grid; place-items: center; font-size: 12px; }
.login-form-area { position: relative; height: 100vh; min-height: 0; padding: 40px; display: grid; place-items: center; overflow: hidden; }
.login-form-area::before { content: ""; position: absolute; width: 620px; height: 620px; border-radius: 50%; background: radial-gradient(circle, rgba(249,115,22,.055), transparent 66%); pointer-events: none; }
.login-card { --login-scale: 1; position: absolute; z-index: 1; top: 50%; left: 50%; width: 560px; min-width: 560px; max-width: 560px; padding: 42px 48px 40px; border: 1px solid #e2e7ed; border-radius: 18px; background: rgba(255,255,255,.98); box-shadow: 0 28px 75px rgba(15,23,42,.11), 0 5px 18px rgba(15,23,42,.04); transform: translate(-50%, -50%) scale(var(--login-scale)); transform-origin: center; }
.login-card.is-fitting { opacity: 0; animation: none; }
.login-card::before { content: ""; position: absolute; top: -1px; left: 34px; right: 34px; height: 3px; border-radius: 0 0 4px 4px; background: linear-gradient(90deg, #f97316, #ff9b52); }
.login-home-link { width: max-content; min-height: 38px; margin: 0 0 22px; padding: 5px 13px 5px 6px; border: 1px solid #e1e6ec; border-radius: 999px; color: #526174; background: #f8fafc; box-shadow: 0 4px 12px rgba(15,23,42,.04); display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; text-decoration: none; transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease; }
.login-home-link span { width: 26px; height: 26px; border-radius: 50%; color: #ea580c; background: #fff0e6; display: grid; place-items: center; font-size: 15px; line-height: 1; }
.login-home-link:hover { border-color: #f5c7aa; color: #c94d09; background: #fffaf7; box-shadow: 0 7px 16px rgba(234,88,12,.08); transform: translateX(-2px); }
.login-home-link:focus-visible { border-radius: 4px; outline: 3px solid rgba(249,115,22,.16); outline-offset: 4px; }
.login-card-brand { margin-bottom: 36px; padding-bottom: 27px; border-bottom: 1px solid #e8ebef; display: flex; align-items: center; gap: 12px; }
.login-card-mark { width: 44px; height: 44px; padding: 5px; border-radius: 11px; background: #0d1a2d; object-fit: contain; }
.login-card-brand div { display: grid; line-height: 1.15; }
.login-card-brand div strong { color: #142234; font-size: 15px; }
.login-card-brand div small { margin-top: 3px; color: #84909a; font-size: 9px; font-weight: 600; letter-spacing: .12em; }
.secure-access { margin-left: auto; padding: 7px 12px; border: 1px solid #cfe1d4; border-radius: 999px; color: #39714a; background: #f1f8f3; display: inline-flex; align-items: center; gap: 5px; font-size: 9px; font-weight: 700; letter-spacing: .08em; }
.secure-access svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.login-card-heading { margin-bottom: 34px; }
.login-eyebrow { display: block; margin-bottom: 11px; color: #f97316; font-size: 12px; font-weight: 700; letter-spacing: 1px; }
.login-card h1 { margin-bottom: 12px; color: #0f172a; font-size: clamp(36px, 2.4vw, 43px); font-weight: 700; line-height: 1.12; letter-spacing: -1px; }
.login-card-heading p { max-width: 440px; margin: 0; color: #64748b; font-size: 15px; line-height: 1.65; }
.login-card form { display: grid; gap: 20px; }
.login-card label { display: grid; gap: 8px; }
.login-card label > span:not(.password-label-row) { color: #334155; font-size: 13px; font-weight: 600; letter-spacing: 0; }
.password-label-row { color: #334155; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 13px; font-weight: 600; }
.password-label-row button { min-height: 24px; padding: 0; border: 0; color: #475569; background: transparent; cursor: pointer; font-size: 13px; font-weight: 600; transition: color .18s ease; }
.password-label-row button:hover { color: #ea580c; }
.password-label-row button:focus-visible { border-radius: 4px; outline: 3px solid rgba(249,115,22,.16); outline-offset: 3px; }
.login-input-field { position: relative; }
.login-input-field > svg { position: absolute; z-index: 1; top: 50%; left: 14px; width: 16px; height: 16px; color: #81909d; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transform: translateY(-50%); pointer-events: none; }
.login-card .input { width: 100%; height: 53px; padding: 0 48px 0 44px; border: 1px solid #dce1e8; border-radius: 10px; color: #0f172a; background: #fff; font-size: 15px; transition: border-color .18s ease, box-shadow .18s ease; }
.login-card .input:hover { border-color: #cbd5e1; }
.login-card .input:focus { border-color: #f97316; box-shadow: 0 0 0 3px rgba(249,115,22,.10); outline: none; }
.login-card form.auth-error .input { border-color: #d69a9a; }
.login-card form.auth-error .input:focus { border-color: #c96868; box-shadow: 0 0 0 3px rgba(185,70,70,.08); }
.login-password-field button { position: absolute; z-index: 2; top: 50%; right: 6px; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 8px; color: #64748b; background: transparent; display: grid; place-items: center; cursor: pointer; transform: translateY(-50%); }
.login-password-field button:hover, .login-password-field button:focus-visible { color: #16263a; background: rgba(13,26,45,.07); outline: none; }
.login-password-field button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.login-submit { position: relative; height: 54px; margin-top: 1px; padding: 0 18px; border: 0; border-radius: 10px; color: #fff; background: #0b1728; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 15px; font-weight: 600; transition: background .18s ease, transform .18s ease, box-shadow .18s ease; }
.login-submit:hover:not(:disabled) { background: #14243a; box-shadow: 0 10px 22px rgba(11,23,40,.17); transform: translateY(-1px); }
.login-submit:active:not(:disabled) { transform: translateY(0); }
.login-submit:focus-visible { outline: 3px solid rgba(249,115,22,.2); outline-offset: 3px; }
.login-submit:disabled { cursor: wait; opacity: .78; }
.login-spinner { display: none; width: 17px; height: 17px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: loginSpin .7s linear infinite; }
.login-card form.submitting .login-button-label { display: none; }
.login-card form.submitting .login-spinner { display: block; }
.login-error { min-height: 18px; margin: -7px 0 -6px; color: #b74444; font-size: 12px; line-height: 1.5; }
.login-links { margin-top: 24px; color: #64748b; display: flex; align-items: center; justify-content: center; gap: 5px; text-align: center; font-size: 13px; }
.login-links button, .login-links a { min-height: 44px; padding: 0 3px; border: 0; color: #0f172a; background: none; display: inline-flex; align-items: center; cursor: pointer; font-size: 13px; font-weight: 700; text-decoration: none; transition: color .18s ease; }
.login-links button:hover, .login-links a:hover { color: #ea580c; }
.login-links button:focus-visible, .login-links a:focus-visible { border-radius: 4px; outline: 3px solid rgba(249,115,22,.16); outline-offset: 1px; }
.login-security-note { margin-top: 4px; padding-top: 18px; border-top: 1px solid #e2e8f0; color: #64748b; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px; }
.login-security-note svg { width: 16px; height: 16px; color: #64748b; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.login-card input:-webkit-autofill, .login-card input:-webkit-autofill:hover, .login-card input:-webkit-autofill:focus { -webkit-text-fill-color: #0f172a; box-shadow: 0 0 0 1000px #fff inset; transition: background-color 9999s ease-out; }
@keyframes loginCardIn { from { opacity: 0; transform: translate(-50%, calc(-50% + 12px)) scale(var(--login-scale)); } to { opacity: 1; transform: translate(-50%, -50%) scale(var(--login-scale)); } }
@keyframes loginFeatureIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes loginSpin { to { transform: rotate(360deg); } }
@media (max-width: 1199px) and (min-width: 901px) {
  .login-showcase { padding: 48px 42px; }
  .login-showcase-content > p { font-size: 15px; }
  .login-wordmark { font-size: clamp(42px, 5vw, 54px); }
  .login-showcase li strong { font-size: 12px; }
  .login-document-art { display: none; }
  .login-showcase > small { left: 42px; bottom: 25px; max-width: calc(100% - 84px); font-size: 11px; }
  .login-form-area { padding: 28px; }
}
@media (min-width: 901px) and (max-height: 700px) {
  .login-showcase { padding-block: 34px; }
  .login-showcase-logo { width: 140px; height: 47px; margin-bottom: 14px; }
  .login-wordmark { margin-bottom: 20px; font-size: clamp(38px, 4vw, 50px); }
  .login-showcase-content > p { margin-bottom: 25px; font-size: 13px; line-height: 1.6; }
  .login-showcase ul { gap: 10px; }
  .login-showcase li > span { width: 34px; height: 34px; }
  .login-showcase li strong { font-size: 11px; }
  .login-showcase > small { bottom: 18px; font-size: 9px; }
  .login-document-art { right: -30px; bottom: 38px; transform: scale(.78) rotate(-3deg); }
  .login-form-area { padding: 28px 52px; place-items: center; }
}
@media (max-width: 900px) {
  .login-mode { overflow: hidden; }
  .login-screen { width: 100%; min-width: 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .login-showcase { height: auto; min-height: 0; padding: 22px 24px 20px; display: block; }
  .login-showcase-logo { display: none; }
  .login-wordmark { margin: 0; font-size: 27px; line-height: .95; letter-spacing: -1.2px; }
  .login-wordmark strong { margin-top: 5px; }
  .login-showcase-content > p, .login-showcase ul, .login-showcase > small, .login-document-art { display: none; }
  .login-form-area { width: 100%; height: auto; min-width: 0; min-height: 0; padding: 22px 20px 30px; overflow: hidden; align-items: start; justify-items: center; }
  .login-form-area::before { width: 430px; height: 430px; top: -100px; }
  .login-card { position: relative; top: auto; left: auto; width: min(520px, calc(100vw - 40px)); min-width: 0; max-width: calc(100vw - 40px); margin-bottom: 4px; padding: 27px 28px 25px; transform: none; animation: none; }
  .login-home-link { margin-bottom: 17px; }
  .login-card-brand { margin-bottom: 20px; padding-bottom: 15px; }
  .login-card-heading { margin-bottom: 20px; }
  .login-card h1 { font-size: 31px; }
  .login-card-heading p { font-size: 13px; }
  .login-card form { gap: 14px; }
  .login-card .input { height: 50px; }
  .login-submit { height: 52px; }
  .login-links { margin-top: 16px; }
  .login-security-note { margin-top: 0; padding-top: 14px; }
  .login-card form, .login-card label, .login-input-field { min-width: 0; }
  .login-links { flex-wrap: wrap; }
}
@media (max-width: 419px) {
  .login-showcase { padding: 20px 20px 18px; }
  .login-form-area { padding: 18px 14px 30px; }
  .login-card { width: calc(100vw - 28px); max-width: calc(100vw - 28px); padding: 24px 20px 22px; border-radius: 15px; }
  .secure-access { display: none; }
  .login-card h1 { font-size: 30px; }
  .login-card .input, .login-submit { min-height: 52px; }
  .login-links { gap: 2px; font-size: 12px; }
  .login-links button { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .login-card, .login-showcase li, .login-spinner { animation: none; }
}

@media (max-width: 1100px) {
  .account-profile-grid { grid-template-columns: 1fr; }
  .account-profile-card, .account-security-card { min-height: 0; }
  .account-toolbar { grid-template-columns: minmax(200px, 1fr) 145px 155px; }
  .role-dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .send-tracking-grid { grid-template-columns: 1fr 1fr; }
  .send-summary-card { padding-right: 18px; }
  .send-summary-card b { position: static; margin-top: 8px; display: block; transform: none; }
  .simulated-email-preview > header { align-items: flex-start; flex-direction: column; }
  .account-page .page-header { min-height: 0; margin-bottom: 20px; }
  .account-page .page-header h1 { font-size: 28px; }
  .account-page .page-header p { font-size: 12px; line-height: 1.55; }
  .account-profile-grid { gap: 14px; }
  .account-profile-card, .account-security-card { padding: 20px; }
  .account-card-heading { margin-bottom: 20px; }
  .login-accounts-heading { padding: 19px 18px; align-items: flex-start; }
  .login-accounts-heading .add-login { min-height: 39px; padding-inline: 13px; white-space: nowrap; }
  .account-toolbar { padding: 14px 18px; grid-template-columns: 1fr 1fr; }
  .account-search { grid-column: 1 / -1; }
  .account-table { display: block; }
  .account-table thead { display: none; }
  .account-table tbody { padding: 14px; display: grid; gap: 10px; }
  .account-table tbody tr { position: relative; padding: 14px; border: 1px solid #e2e8f0; border-radius: 11px; background: #fff; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
  .account-table tbody tr:hover { background: #fff; box-shadow: 0 5px 15px rgba(15,23,42,.05); }
  .account-table td { width: auto; height: auto; padding: 0; border: 0; }
  .account-table td:nth-child(1) { grid-column: 1 / -1; padding-right: 76px; }
  .account-table td:nth-child(2) { grid-column: 1 / -1; color: #64748b; font-size: 12px; }
  .account-table td:nth-child(3), .account-table td:nth-child(4) { align-self: center; }
  .account-action-cell { position: absolute; top: 13px; right: 12px; }
  .account-menu-trigger { width: 34px; height: 34px; font-size: inherit; letter-spacing: normal; }
  .account-menu-trigger::after { content: none; }
  .account-menu { top: auto; bottom: calc(100% + 8px); right: 0; }
  .role-dashboard-header { min-height: 126px; padding: 21px; align-items: flex-start; flex-direction: column; }
  .dashboard-header-actions { width: 100%; align-items: stretch; flex-direction: column; }
  .workspace-selector { width: 100%; }
  .workspace-page-actions { margin-top: 14px; align-items: stretch; flex-direction: column; }
  .workspace-page-actions .header-actions { margin-top: 0; }
  .role-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .role-metric-card { min-height: 108px; padding: 15px; }
  .role-record-table, .role-record-table tbody { display: block; }
  .role-record-table thead { display: none; }
  .role-record-table tr { padding: 13px 15px; border-bottom: 1px solid #edf1f5; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
  .role-record-table td { width: auto; height: auto; padding: 0; border: 0; white-space: normal; }
  .role-record-table td:nth-child(2) { grid-column: 1 / -1; color: #334155; }
  .role-record-table td:nth-child(3), .role-record-table td:nth-child(4) { color: #64748b; }
  .role-record-table td:nth-child(5) { grid-column: 2; grid-row: 1; }
}

@media (max-width: 480px) {
  .account-profile-card, .account-security-card { padding: 18px; }
  .profile-summary { margin-bottom: 21px; }
  .account-card-heading h2, .login-accounts-heading h2 { font-size: 18px; }
  .login-accounts-heading { flex-direction: column; }
  .login-accounts-heading .add-login { width: 100%; }
  .account-toolbar { grid-template-columns: 1fr; }
  .account-search { grid-column: auto; }
  .account-drawer { width: 100%; }
  .account-drawer-header { padding: 21px 20px 18px; }
  .account-drawer-form { padding: 20px; }
  .account-drawer-footer { padding: 15px 20px 20px; }
  .account-drawer-footer .account-button { flex: 1; }
  
.toast-region { right: 14px; bottom: 14px; left: 14px; }
  .toast { text-align: center; }
  .role-metrics { grid-template-columns: 1fr; }
  .role-metric-card { min-height: 98px; }
}

@page { size: A4; margin: 0; }
@media print {
  body * { visibility: hidden; }
  #editor-a4, #editor-a4 * { visibility: visible; }
  #editor-a4 {
    position: absolute;
    inset: 0 auto auto 0;
    width: 210mm;
    min-width: 210mm;
    height: 297mm;
    min-height: 297mm;
    margin: 0;
    transform: none !important;
    zoom: 1 !important;
    box-shadow: none;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
