:root {
  --coral: #ec5849;
  --coral-dark: #d9483c;
  --coral-soft: #fff1ef;
  --ink: #27363a;
  --ink-strong: #172428;
  --muted: #718084;
  --muted-light: #96a2a6;
  --line: #dfe6e8;
  --line-strong: #cbd6d9;
  --canvas: #f3f6f7;
  --panel: #fff;
  --panel-alt: #f8fafb;
  --green: #2f8757;
  --green-soft: #edf8f2;
  --blue: #3277b8;
  --blue-soft: #eef6fd;
  --amber: #9b6b20;
  --amber-soft: #fff7e7;
  --purple: #6c58d7;
  --purple-soft: #f3f0ff;
  --danger: #c7473e;
  --danger-soft: #fff0ef;
  --shadow-sm: 0 4px 14px rgb(32 53 59 / 5%);
  --shadow-md: 0 16px 42px rgb(32 53 59 / 10%);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  color: var(--ink);
  font-family: Montserrat, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { min-width: 320px; min-height: 100%; background: var(--canvas); }

body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--canvas); color: var(--ink); }

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

button,
select { cursor: pointer; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgb(50 119 184 / 30%);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

a { color: inherit; }

h1,
h2,
h3,
p { margin-top: 0; }

h1,
h2,
h3 { color: var(--ink-strong); letter-spacing: -.035em; }

h1 { margin-bottom: 0; font-size: clamp(24px, 3vw, 32px); }
h2 { margin-bottom: 8px; font-size: 21px; }
h3 { margin-bottom: 6px; font-size: 16px; }

p { line-height: 1.55; }

.sr-only {
  position: absolute !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.eyebrow {
  margin-bottom: 5px;
  color: var(--coral);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.eyebrow-light { color: #ffc5bf; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink-strong);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: var(--coral);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: -.04em;
  box-shadow: 0 8px 18px rgb(236 88 73 / 24%);
}

.brand strong,
.brand small { display: block; }
.brand strong { font-size: 14px; letter-spacing: -.025em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 600; }
.brand-light,
.brand-light strong { color: #fff; }
.brand-light small { color: rgb(255 255 255 / 66%); }

.button,
.icon-button,
.text-button,
.nav-item,
.folder-item {
  border: 0;
  background: none;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease, color .16s ease;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 15px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .5; transform: none; }
.button-primary { background: var(--coral); color: #fff; box-shadow: 0 8px 17px rgb(236 88 73 / 20%); }
.button-primary:hover { background: var(--coral-dark); box-shadow: 0 10px 20px rgb(236 88 73 / 25%); }
.button-secondary { background: var(--ink); color: #fff; }
.button-secondary:hover { background: var(--ink-strong); }
.button-quiet { border: 1px solid var(--line); background: #fff; color: var(--ink); box-shadow: 0 2px 7px rgb(39 54 58 / 3%); }
.button-quiet:hover { border-color: var(--line-strong); background: #fbfcfc; }
.button-danger { border: 1px solid #f2cbc8; background: #fff; color: var(--danger); }
.button-wide { width: 100%; }

.text-button { padding: 5px 2px; color: var(--blue); font-size: 11px; font-weight: 800; }
.text-button:hover { color: #1b5f9d; text-decoration: underline; }

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
}

.icon-button:hover { border-color: var(--line-strong); background: var(--panel-alt); }

.field { display: grid; gap: 7px; min-width: 0; }
.field > span:first-child,
.compact-filters label > span {
  color: #526267;
  font-size: 11px;
  font-weight: 800;
}

.field em { color: var(--muted-light); font-size: 10px; font-style: normal; font-weight: 600; }
.field small { margin-top: -2px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.field-full { grid-column: 1 / -1; }

input,
select,
textarea {
  min-width: 0;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink-strong);
  font-size: 12px;
}

input::placeholder,
textarea::placeholder { color: #99a5a9; }

input:hover,
select:hover,
textarea:hover { border-color: #aab8bc; }

input:focus,
select:focus,
textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgb(50 119 184 / 9%); outline: none; }

select { padding-right: 34px; }

.password-field { position: relative; display: block; }
.password-field input { width: 100%; padding-right: 62px; }
.password-toggle { position: absolute; top: 50%; right: 5px; padding: 7px 8px; transform: translateY(-50%); border: 0; background: transparent; color: var(--blue); font-size: 10px; font-weight: 800; }

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: #5b6b70;
  font-size: 11px;
  line-height: 1.45;
}

.check-row input { flex: 0 0 auto; width: 17px; height: 17px; min-height: auto; margin: 0; accent-color: var(--coral); }

.notice { margin-top: 16px; padding: 11px 13px; border-radius: 10px; font-size: 11px; font-weight: 650; line-height: 1.5; }
.notice-error { border: 1px solid #f0cfcc; background: var(--danger-soft); color: #8d302a; }
.notice-success { border: 1px solid #cbe7d7; background: var(--green-soft); color: #246f48; }

.spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 3px solid #dce5e7;
  border-top-color: var(--coral);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.boot-screen { display: grid; min-height: 100vh; place-content: center; justify-items: center; gap: 10px; color: var(--muted); }
.boot-screen p { margin: 0; font-size: 12px; font-weight: 700; }

/* Authentication */

.auth-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(380px, .9fr) minmax(500px, 1.1fr); background: #fff; }

.auth-brand {
  position: relative;
  display: flex;
  overflow: hidden;
  min-height: 100vh;
  padding: clamp(32px, 5vw, 72px);
  flex-direction: column;
  background:
    radial-gradient(circle at 90% 15%, rgb(255 255 255 / 13%) 0 9%, transparent 9.4%),
    radial-gradient(circle at -10% 90%, rgb(255 255 255 / 9%) 0 22%, transparent 22.4%),
    linear-gradient(145deg, #27383d 0%, #1d2b2f 55%, #172226 100%);
  color: #fff;
}

.auth-brand::after {
  position: absolute;
  right: -90px;
  bottom: 120px;
  width: 340px;
  height: 160px;
  border: 30px solid rgb(236 88 73 / 82%);
  border-left: 0;
  border-radius: 0 160px 160px 0;
  content: "";
  transform: rotate(-24deg);
  opacity: .75;
}

.auth-message { position: relative; z-index: 1; max-width: 580px; margin: auto 0; }
.auth-message h1 { max-width: 560px; margin-bottom: 18px; color: #fff; font-size: clamp(36px, 5vw, 62px); line-height: 1.02; letter-spacing: -.055em; }
.auth-message > p:not(.eyebrow) { max-width: 550px; color: rgb(255 255 255 / 70%); font-size: 15px; }
.auth-benefits { display: grid; gap: 13px; margin: 30px 0 0; padding: 0; list-style: none; }
.auth-benefits li { display: flex; align-items: flex-start; gap: 10px; color: rgb(255 255 255 / 82%); font-size: 12px; font-weight: 650; line-height: 1.55; }
.auth-benefits span { display: grid; width: 20px; height: 20px; place-items: center; border-radius: 50%; background: rgb(255 255 255 / 13%); color: #ffc5bf; }
.auth-footnote { position: relative; z-index: 1; margin: auto 0 0; color: rgb(255 255 255 / 45%); font-size: 10px; }

.auth-card-wrap { display: grid; min-height: 100vh; padding: 38px; place-items: center; background: linear-gradient(135deg, #fff 0%, #fbfcfc 100%); }
.auth-card { width: min(100%, 440px); padding: clamp(25px, 4vw, 42px); border: 1px solid #e7ecee; border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-md); }
.auth-card h2 { margin-bottom: 8px; font-size: 27px; }
.section-copy { margin-bottom: 24px; color: var(--muted); font-size: 12px; }
.stack-form { display: grid; gap: 16px; }

/* Shell */

.dashboard-app { display: grid; min-height: 100dvh; grid-template-columns: 250px minmax(0, 1fr); }

.sidebar {
  position: sticky;
  z-index: 40;
  top: 0;
  display: flex;
  overflow-y: auto;
  width: 250px;
  height: 100dvh;
  padding: 22px 16px 16px;
  flex-direction: column;
  border-right: 1px solid #e4e9ea;
  background: #fff;
}

.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 0 7px; }
.sidebar-close { display: none; }
.new-itinerary-button { width: 100%; margin: 24px 0 18px; }
.sidebar-nav { display: grid; gap: 3px; }

.nav-item {
  display: flex;
  width: 100%; min-height: 43px;
  align-items: center;
  gap: 11px;
  padding: 0 11px;
  border-radius: 10px;
  color: #56666b;
  font-size: 11px;
  font-weight: 750;
  text-align: left;
}

.nav-item:hover { background: var(--panel-alt); color: var(--ink-strong); }
.nav-item.is-active { background: var(--coral-soft); color: var(--coral-dark); }
.nav-icon { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 7px; background: #f0f4f5; color: #65767a; font-size: 14px; }
.nav-item.is-active .nav-icon { background: #fff; color: var(--coral); box-shadow: 0 3px 8px rgb(236 88 73 / 12%); }

.sidebar-note { display: flex; gap: 9px; margin-top: auto; padding: 12px; border: 1px solid #f1e3c5; border-radius: 12px; background: var(--amber-soft); }
.sidebar-note > span { flex: 0 0 auto; font-size: 14px; }
.sidebar-note p { margin: 0; }
.sidebar-note strong,
.sidebar-note small { display: block; }
.sidebar-note strong { color: #74501a; font-size: 10px; }
.sidebar-note small { margin-top: 4px; color: #927445; font-size: 9px; line-height: 1.45; }

.sidebar-account { display: flex; align-items: center; gap: 9px; margin-top: 13px; padding: 13px 6px 0; border-top: 1px solid var(--line); }
.sidebar-account p { overflow: hidden; min-width: 0; margin: 0; flex: 1; }
.sidebar-account strong,
.sidebar-account small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-account strong { color: var(--ink-strong); font-size: 10px; }
.sidebar-account small { margin-top: 2px; color: var(--muted); font-size: 9px; text-transform: capitalize; }
.sidebar-account .icon-button { width: 31px; height: 31px; border: 0; background: transparent; }

.avatar {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: var(--purple-soft);
  color: var(--purple);
  font-size: 10px;
  font-weight: 900;
}

.workspace { min-width: 0; }
.workspace-header {
  position: sticky;
  z-index: 25;
  top: 0;
  display: flex;
  height: 76px;
  align-items: center;
  gap: 15px;
  padding: 0 clamp(18px, 3vw, 36px);
  border-bottom: 1px solid #e3e9ea;
  background: rgb(255 255 255 / 93%);
  backdrop-filter: blur(14px);
}
.workspace-header h1 { font-size: 23px; }
.workspace-header .eyebrow { margin-bottom: 1px; }
.header-actions { display: flex; gap: 8px; margin-left: auto; }
.menu-button { display: none; }
.workspace-main { max-width: 1540px; margin: 0 auto; padding: clamp(20px, 3vw, 36px); outline: none; }
.tab-panel { animation: panel-in .18s ease; }
@keyframes panel-in { from { opacity: .25; transform: translateY(3px); } }

.welcome-row,
.section-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.welcome-row h2,
.section-header h2 { margin-bottom: 4px; font-size: clamp(24px, 3vw, 31px); }
.welcome-row p,
.section-header p { margin-bottom: 0; color: var(--muted); font-size: 12px; }
.section-header-actions { align-items: center; }

.compact-filters { display: flex; align-items: flex-end; gap: 8px; }
.compact-filters label { display: grid; gap: 4px; }
.compact-filters input { width: 135px; min-height: 38px; }

.metric-grid { display: grid; margin-bottom: 20px; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.metric-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric-card { display: flex; min-height: 125px; align-items: center; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.metric-card-primary { border-color: #f4d1ce; background: linear-gradient(145deg, #fff 20%, #fff4f2 100%); }
.metric-icon { display: grid; flex: 0 0 auto; width: 44px; height: 44px; place-items: center; border-radius: 13px; background: var(--panel-alt); color: #637479; font-size: 18px; }
.metric-card-primary .metric-icon { background: #fff; color: var(--coral); box-shadow: 0 5px 14px rgb(236 88 73 / 12%); }
.metric-card p { min-width: 0; margin: 0; }
.metric-card small,
.metric-card strong,
.metric-card em { display: block; }
.metric-card small { overflow: hidden; color: var(--muted); font-size: 10px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.metric-card strong { margin: 4px 0 2px; color: var(--ink-strong); font-size: 26px; line-height: 1; }
.metric-card em { color: #9aa6a9; font-size: 9px; font-style: normal; }

.content-grid { display: grid; margin-bottom: 20px; grid-template-columns: minmax(0, 1.4fr) minmax(300px, .6fr); gap: 16px; }
.content-grid-wide { grid-template-columns: minmax(0, 1.5fr) minmax(300px, .5fr); }
.learning-grid { align-items: start; }
.panel-card,
.table-card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.panel-card { padding: 20px; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.card-heading h2 { margin-bottom: 0; font-size: 17px; }
.card-heading p:not(.eyebrow) { margin: 2px 0 0; color: var(--muted); font-size: 10px; }

.quick-start-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; border-color: #dfe4fa; background: linear-gradient(115deg, #fff 0%, #f7f6ff 100%); }
.quick-start-card h2 { margin-bottom: 5px; }
.quick-start-card p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 11px; }
.quick-start-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.activity-list { display: grid; gap: 2px; }
.activity-item { display: grid; width: 100%; align-items: center; gap: 12px; padding: 11px 5px; grid-template-columns: 38px minmax(0, 1fr) auto; border: 0; border-bottom: 1px solid #edf1f2; background: transparent; color: inherit; text-align: left; }
.activity-item:last-child { border-bottom: 0; }
.activity-avatar { display: grid; width: 37px; height: 37px; place-items: center; border-radius: 11px; background: var(--blue-soft); color: var(--blue); font-size: 10px; font-weight: 900; }
.activity-item p { min-width: 0; margin: 0; }
.activity-item strong,
.activity-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-item strong { color: var(--ink-strong); font-size: 11px; }
.activity-item small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.activity-item time { color: var(--muted-light); font-size: 9px; white-space: nowrap; }

.bar-list { display: grid; gap: 17px; }
.bar-item > div { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 10px; font-weight: 800; }
.bar-item > div span:last-child { color: var(--muted); }
.bar-track { overflow: hidden; height: 7px; border-radius: 20px; background: #edf1f2; }
.bar-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--coral), #f78b80); }

.loading-state,
.empty-state,
.error-state { display: grid; min-height: 130px; place-content: center; justify-items: center; gap: 9px; padding: 22px; color: var(--muted); text-align: center; }
.loading-state p,
.empty-state p,
.error-state p { max-width: 370px; margin: 0; font-size: 10px; line-height: 1.5; }
.loading-state-large { min-height: 310px; }
.state-icon { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 13px; background: var(--panel-alt); color: var(--muted); font-size: 18px; }
.error-state .state-icon { background: var(--danger-soft); color: var(--danger); }

/* Filters and tables */

.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filter-bar input,
.filter-bar select { min-height: 40px; }
.filter-bar select { min-width: 130px; }
.search-field { position: relative; display: flex; min-width: 260px; flex: 1 1 280px; align-items: center; }
.search-field > span { position: absolute; z-index: 1; left: 12px; color: var(--muted-light); font-size: 16px; }
.search-field input { width: 100%; padding-left: 36px; }

.table-card { overflow: hidden; }
.table-summary { display: flex; min-height: 48px; align-items: center; justify-content: space-between; padding: 0 16px; border-bottom: 1px solid var(--line); }
.table-summary p { margin: 0; color: var(--muted); font-size: 10px; font-weight: 750; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th { height: 42px; padding: 0 14px; border-bottom: 1px solid var(--line); background: #fafcfc; color: #7d8b8f; font-size: 9px; letter-spacing: .04em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { min-width: 105px; padding: 13px 14px; border-bottom: 1px solid #edf1f2; color: #4c5c61; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fcfdfd; }
.cell-main { max-width: 360px; }
.cell-main strong,
.cell-main small { display: block; }
.cell-main strong { overflow: hidden; color: var(--ink-strong); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.cell-main small { max-width: 360px; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.cell-person { display: flex; align-items: center; gap: 8px; }
.cell-person p { margin: 0; }
.cell-person strong,
.cell-person small { display: block; }
.cell-person strong { font-size: 10px; }
.cell-person small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.row-actions { display: flex; justify-content: flex-end; gap: 5px; white-space: nowrap; }
.row-actions .button { min-height: 32px; padding: 0 10px; font-size: 9px; }
.row-menu { width: 32px; height: 32px; }
.status-badge,
.role-badge,
.safe-badge { display: inline-flex; min-height: 23px; align-items: center; justify-content: center; padding: 0 8px; border-radius: 20px; font-size: 8px; font-weight: 850; text-transform: capitalize; white-space: nowrap; }
.status-badge { background: var(--blue-soft); color: var(--blue); }
.status-badge[data-status="draft"] { background: var(--amber-soft); color: var(--amber); }
.status-badge[data-status="exported"],
.status-badge[data-status="approved"],
.status-badge[data-status="active"] { background: var(--green-soft); color: var(--green); }
.status-badge[data-status="archived"],
.status-badge[data-status="inactive"] { background: #f0f2f3; color: #748186; }
.role-badge { background: var(--purple-soft); color: var(--purple); }
.safe-badge { background: var(--green-soft); color: var(--green); }
.pagination { display: flex; justify-content: center; gap: 5px; padding: 13px; border-top: 1px solid var(--line); }

/* Itinerary library */

.library-callout { display: flex; gap: 10px; margin-bottom: 14px; padding: 12px 14px; border: 1px solid #cae5d6; border-radius: 12px; background: var(--green-soft); }
.library-callout > span { display: grid; flex: 0 0 auto; width: 21px; height: 21px; place-items: center; border-radius: 50%; background: #d8efe2; color: var(--green); font-size: 11px; font-weight: 900; }
.library-callout p { margin: 1px 0 0; color: #426451; font-size: 10px; }
.library-grid { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 14px; }
.library-card { display: flex; overflow: hidden; min-height: 270px; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.library-card:hover { transform: translateY(-2px); border-color: #cdd8da; box-shadow: var(--shadow-md); }
.library-cover { position: relative; display: flex; min-height: 105px; align-items: flex-end; padding: 15px; background: linear-gradient(135deg, #31454a, #1c2a2e); color: #fff; }
.library-cover.has-image { background-position: center; background-size: cover; }
.library-cover.has-image::before { position: absolute; inset: 0; background: linear-gradient(to top, rgb(20 32 36 / 76%), rgb(20 32 36 / 8%)); content: ""; }
.library-cover > * { position: relative; z-index: 1; }
.library-cover p { margin: 0; }
.library-cover strong { display: block; font-size: 17px; letter-spacing: -.03em; }
.library-cover small { display: block; margin-top: 4px; color: rgb(255 255 255 / 72%); font-size: 9px; }
.library-cover .status-badge { position: absolute; top: 11px; right: 11px; }
.library-card-body { display: grid; gap: 12px; padding: 15px; flex: 1; }
.library-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.meta-chip { display: inline-flex; min-height: 22px; align-items: center; padding: 0 8px; border-radius: 20px; background: #f1f4f5; color: #65757a; font-size: 8px; font-weight: 800; }
.library-route { margin: 0; color: #4f6065; font-size: 10px; line-height: 1.55; }
.library-places { margin: -5px 0 0; color: var(--muted); font-size: 9px; }
.library-stats { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; color: var(--muted); font-size: 8px; }
.library-actions { display: flex; gap: 7px; padding: 0 15px 15px; }
.library-actions .button { min-height: 35px; flex: 1; font-size: 9px; }

/* Destination gallery */

.gallery-workspace { display: grid; overflow: hidden; min-height: 610px; grid-template-columns: 220px minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.gallery-folders { padding: 14px 10px; border-right: 1px solid var(--line); background: #fafcfc; }
.gallery-folder-heading { display: flex; height: 37px; align-items: center; justify-content: space-between; padding: 0 7px 9px; color: var(--ink-strong); font-size: 11px; }
.gallery-folder-heading .icon-button { width: 29px; height: 29px; background: transparent; }
.folder-item { display: grid; width: 100%; min-height: 40px; align-items: center; gap: 8px; padding: 0 8px; grid-template-columns: 21px minmax(0, 1fr) auto; border-radius: 9px; color: #596a6f; font-size: 10px; font-weight: 700; text-align: left; }
.folder-item:hover { background: #f1f5f6; }
.folder-item.is-active { background: var(--coral-soft); color: var(--coral-dark); }
.folder-item > span:first-child { color: #819095; font-size: 13px; }
.folder-item em { min-width: 20px; padding: 2px 5px; border-radius: 20px; background: #eef2f3; color: #859195; font-size: 8px; font-style: normal; text-align: center; }
.gallery-local-divider { display: flex; align-items: center; gap: 8px; margin: 16px 8px 7px; color: #9ca7aa; font-size: 7px; font-weight: 850; letter-spacing: .12em; }
.gallery-local-divider::after { height: 1px; flex: 1; background: var(--line); content: ""; }
.gallery-main { min-width: 0; padding: 15px; }
.gallery-toolbar { display: flex; gap: 7px; margin-bottom: 10px; }
.gallery-toolbar .search-field { min-width: 200px; }
.gallery-toolbar select { min-width: 125px; }
.gallery-summary { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 13px; color: var(--muted); font-size: 9px; }
.gallery-summary p { margin: 0; color: var(--ink); font-size: 11px; font-weight: 800; }
.image-grid { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)); gap: 10px; }
.image-card { position: relative; overflow: hidden; min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.image-card:hover { border-color: #bdc9cc; box-shadow: var(--shadow-sm); }
.image-card-image { position: relative; overflow: hidden; aspect-ratio: 4 / 3; background: #edf1f2; }
.image-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.image-card:hover img { transform: scale(1.025); }
.image-local-badge { position: absolute; top: 7px; left: 7px; padding: 4px 6px; border-radius: 6px; background: rgb(25 37 41 / 80%); color: #fff; font-size: 7px; font-weight: 800; }
.image-card-body { padding: 9px; }
.image-card-body strong,
.image-card-body small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-card-body strong { color: var(--ink-strong); font-size: 9px; }
.image-card-body small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.image-card-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 7px; color: #93a0a4; font-size: 7px; }

/* Employees and access */

.access-guide { display: grid; margin-bottom: 14px; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.access-guide article { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.access-guide article > span { display: grid; flex: 0 0 auto; width: 31px; height: 31px; place-items: center; border-radius: 9px; background: var(--panel-alt); color: var(--muted); font-size: 10px; font-weight: 900; }
.access-guide p { margin: 0; }
.access-guide strong,
.access-guide small { display: block; }
.access-guide strong { font-size: 10px; }
.access-guide small { margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.4; }

/* Learning */

.learning-explainer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 14px; padding: 14px 16px; border: 1px solid #dcd8f6; border-radius: 13px; background: var(--purple-soft); }
.learning-explainer > p { max-width: 330px; margin: 0; color: #7569a8; font-size: 9px; }
.learning-flow { display: flex; align-items: center; gap: 8px; color: #584b9d; font-size: 9px; font-weight: 800; }
.learning-flow span { padding: 7px 8px; border-radius: 8px; background: #fff; }
.learning-flow b { color: #9d94d0; }
.review-list { display: grid; gap: 8px; }
.review-item { display: grid; align-items: center; gap: 10px; padding: 12px; grid-template-columns: minmax(0, 1fr) auto; border: 1px solid var(--line); border-radius: 11px; }
.review-item h3 { margin: 0; font-size: 11px; }
.review-item p { margin: 3px 0 0; color: var(--muted); font-size: 8px; }
.review-item-actions { display: flex; gap: 5px; }
.review-item-actions .button { min-height: 31px; padding: 0 9px; font-size: 8px; }
.check-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.check-list li { position: relative; padding-left: 22px; color: #506166; font-size: 10px; }
.check-list li::before { position: absolute; left: 0; display: grid; width: 15px; height: 15px; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); content: "✓"; font-size: 8px; font-weight: 900; }
.muted-copy { margin: 17px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }

/* Templates and settings */

.protected-banner { display: flex; align-items: center; gap: 13px; margin-bottom: 16px; padding: 15px; border: 1px solid #f0dfba; border-radius: 13px; background: var(--amber-soft); }
.protected-banner > span { font-size: 18px; }
.protected-banner div { flex: 1; }
.protected-banner strong { color: #73501b; font-size: 11px; }
.protected-banner p { margin: 3px 0 0; color: #8d7247; font-size: 9px; }
.template-grid { display: grid; grid-template-columns: repeat(3, minmax(240px, 1fr)); gap: 14px; }
.template-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.template-preview { position: relative; display: grid; min-height: 180px; place-items: center; background: #edf1f2; }
.template-preview img { width: 100%; height: 180px; object-fit: cover; }
.template-preview-placeholder { display: grid; width: 84px; height: 120px; align-content: start; gap: 6px; padding: 12px; border: 1px solid #d8dfe1; background: #fff; box-shadow: 0 7px 18px rgb(35 53 58 / 12%); }
.template-preview-placeholder i { display: block; height: 5px; background: var(--coral); }
.template-preview-placeholder i:nth-child(2) { width: 65%; height: 8px; margin-top: 8px; background: #26373b; }
.template-preview-placeholder i:nth-child(n+3) { height: 3px; background: #dce2e4; }
.template-card-body { padding: 14px; }
.template-card-body h3 { margin: 0; font-size: 12px; }
.template-card-body p { margin: 5px 0 12px; color: var(--muted); font-size: 9px; }
.template-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.settings-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.settings-card { display: grid; align-content: start; gap: 15px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.switch-row span { min-width: 0; }
.switch-row strong,
.switch-row small { display: block; }
.switch-row strong { font-size: 10px; }
.switch-row small { margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.45; }
.switch-row input[role="switch"] { position: relative; width: 42px; height: 23px; min-height: 23px; flex: 0 0 auto; margin: 0; padding: 0; border: 0; border-radius: 20px; background: #d5dddf; appearance: none; transition: background .16s ease; }
.switch-row input[role="switch"]::after { position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgb(39 54 58 / 20%); content: ""; transition: transform .16s ease; }
.switch-row input[role="switch"]:checked { background: var(--green); }
.switch-row input[role="switch"]:checked::after { transform: translateX(19px); }
.settings-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; grid-column: 1 / -1; }
.settings-actions p { margin: 0; color: var(--green); font-size: 10px; }

/* Dialogs */

.dialog { width: min(94vw, 620px); max-height: 92vh; padding: 0; border: 0; border-radius: var(--radius-lg); background: transparent; box-shadow: var(--shadow-md); }
.dialog::backdrop { background: rgb(16 27 30 / 54%); backdrop-filter: blur(3px); }
.dialog-card { position: relative; overflow-y: auto; width: 100%; max-height: 92vh; padding: clamp(23px, 4vw, 34px); border-radius: var(--radius-lg); background: #fff; }
.dialog-card-small { max-width: 480px; margin: auto; }
.dialog-card-wide { width: min(94vw, 720px); }
.dialog-close { position: absolute; z-index: 2; top: 13px; right: 13px; border: 0; background: #f4f7f7; }
.dialog-card h2 { margin-bottom: 6px; font-size: 25px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }

.dropzone { display: grid; min-height: 180px; margin-top: 17px; padding: 24px; place-content: center; justify-items: center; border: 2px dashed #c7d4d7; border-radius: 14px; background: #f9fbfb; color: var(--muted); text-align: center; transition: border-color .16s ease, background .16s ease; }
.dropzone:hover,
.dropzone.is-dragging { border-color: var(--blue); background: var(--blue-soft); }
.dropzone input { position: absolute; overflow: hidden; width: 1px; height: 1px; opacity: 0; }
.dropzone-icon { display: grid; width: 43px; height: 43px; margin-bottom: 9px; place-items: center; border-radius: 12px; background: #fff; color: var(--blue); font-size: 20px; box-shadow: var(--shadow-sm); }
.dropzone strong { color: var(--ink); font-size: 11px; }
.dropzone small { margin-top: 5px; color: var(--muted); font-size: 9px; }
.upload-file-list { display: flex; overflow-x: auto; gap: 7px; margin: 10px 0; }
.upload-file { display: flex; min-width: 150px; align-items: center; gap: 7px; padding: 7px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.upload-file img { width: 38px; height: 38px; border-radius: 7px; object-fit: cover; }
.upload-file p { min-width: 0; margin: 0; }
.upload-file strong,
.upload-file small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-file strong { font-size: 8px; }
.upload-file small { margin-top: 2px; color: var(--muted); font-size: 7px; }

.itinerary-detail-grid { display: grid; margin: 18px 0; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.itinerary-detail-grid div { padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-alt); }
.itinerary-detail-grid small,
.itinerary-detail-grid strong { display: block; }
.itinerary-detail-grid small { color: var(--muted); font-size: 8px; }
.itinerary-detail-grid strong { margin-top: 4px; font-size: 10px; }
.detail-route { padding: 13px; border-left: 3px solid var(--coral); background: var(--coral-soft); color: #674945; font-size: 10px; line-height: 1.55; }

.toast-region { position: fixed; z-index: 100; right: 18px; bottom: 18px; display: grid; width: min(360px, calc(100vw - 36px)); gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 9px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-md); color: var(--ink); font-size: 10px; line-height: 1.45; pointer-events: auto; animation: toast-in .2s ease; }
.toast[data-tone="success"] { border-color: #c8e4d4; }
.toast[data-tone="error"] { border-color: #efcbc8; }
.toast strong { display: block; margin-bottom: 2px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .library-grid,
  .template-grid { grid-template-columns: repeat(2, minmax(250px, 1fr)); }
  .image-grid { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
  .learning-explainer { align-items: flex-start; flex-direction: column; }
  .learning-explainer > p { max-width: none; }
}

@media (max-width: 960px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-card-wrap { min-height: 100vh; padding: 20px; background: linear-gradient(145deg, #eff4f5, #fff); }
  .dashboard-app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; transform: translateX(-105%); box-shadow: 20px 0 40px rgb(23 36 40 / 15%); transition: transform .2s ease; }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-scrim { position: fixed; z-index: 35; inset: 0; display: block; background: rgb(16 27 30 / 38%); }
  .sidebar-close,
  .menu-button { display: inline-grid; }
  .workspace-header { height: 70px; }
  .content-grid,
  .content-grid-wide { grid-template-columns: 1fr; }
  .gallery-workspace { grid-template-columns: 190px minmax(0, 1fr); }
  .image-grid { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-actions { grid-column: auto; }
}

@media (max-width: 720px) {
  .workspace-main { padding: 18px 13px 28px; }
  .workspace-header { padding: 0 13px; }
  .workspace-header h1 { font-size: 19px; }
  .desktop-label { display: none; }
  .header-actions .button { min-height: 38px; padding: 0 11px; }
  .welcome-row,
  .section-header { align-items: stretch; flex-direction: column; gap: 13px; }
  .compact-filters { width: 100%; }
  .compact-filters label { min-width: 0; flex: 1; }
  .compact-filters input { width: 100%; }
  .metric-grid,
  .metric-grid-three { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 105px; padding: 15px; }
  .metric-icon { width: 37px; height: 37px; }
  .metric-card strong { font-size: 22px; }
  .quick-start-card { align-items: stretch; flex-direction: column; }
  .quick-start-actions { display: grid; grid-template-columns: 1fr; }
  .quick-start-actions .button { width: 100%; }
  .filter-bar { display: grid; grid-template-columns: 1fr 1fr; }
  .filter-bar .search-field { min-width: 0; grid-column: 1 / -1; }
  .filter-bar input,
  .filter-bar select,
  .filter-bar button { width: 100%; min-width: 0; }
  th,
  td { padding-right: 11px; padding-left: 11px; }
  .library-grid,
  .template-grid { grid-template-columns: 1fr; }
  .gallery-workspace { display: block; }
  .gallery-folders { display: flex; overflow-x: auto; gap: 5px; padding: 9px; border-right: 0; border-bottom: 1px solid var(--line); }
  .gallery-folder-heading,
  .gallery-local-divider { display: none; }
  #gallery-destination-folders { display: contents; }
  .folder-item { display: inline-flex; width: auto; min-width: max-content; padding: 0 11px; }
  .folder-item em { display: none; }
  .gallery-main { padding: 11px; }
  .gallery-toolbar { display: grid; grid-template-columns: 1fr 1fr; }
  .gallery-toolbar .search-field { min-width: 0; grid-column: 1 / -1; }
  .gallery-toolbar select,
  .gallery-toolbar button { width: 100%; min-width: 0; }
  .gallery-summary { align-items: flex-start; flex-direction: column; }
  .image-grid { grid-template-columns: repeat(2, minmax(110px, 1fr)); }
  .access-guide { grid-template-columns: 1fr; }
  .learning-flow { align-items: stretch; flex-direction: column; }
  .learning-flow b { transform: rotate(90deg); text-align: center; }
  .form-grid { grid-template-columns: 1fr; }
  .field-full { grid-column: auto; }
  .itinerary-detail-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 440px) {
  .workspace-header .eyebrow { display: none; }
  .workspace-header { gap: 8px; }
  .header-actions { gap: 5px; }
  .header-actions .button span:first-child[aria-hidden="true"] { display: none; }
  .metric-grid,
  .metric-grid-three { grid-template-columns: 1fr; }
  .metric-card { min-height: 92px; }
  .filter-bar { grid-template-columns: 1fr; }
  .filter-bar .search-field { grid-column: auto; }
  .image-grid { grid-template-columns: 1fr 1fr; gap: 7px; }
  .gallery-main { padding: 8px; }
  .image-card-body { padding: 7px; }
  .dialog { width: calc(100vw - 16px); }
  .dialog-card { padding: 23px 17px; }
  .dialog-actions { display: grid; grid-template-columns: 1fr; }
  .dialog-actions .button { width: 100%; }
  .itinerary-detail-grid { grid-template-columns: 1fr; }
}

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