/* =========================================================
   3 Meowsketeers — Internal management console
   Shares the design language of the marketing site:
   cream / beige / brown / terracotta, Fraunces + Google Sans.
   ========================================================= */

/* Restore the browser default for [hidden] — our component rules like
   `.btn { display: inline-flex }` and `.chat-popup { display: flex }`
   would otherwise win on specificity and keep "hidden" elements visible.
   This applies everywhere so we don't keep tripping on it. */
[hidden] { display: none !important; }

:root {
  /* Palette */
  --cream:        #FBF6EE;
  --cream-warm:   #F5ECDD;
  --beige:        #EBDCC4;
  --beige-soft:   #F0E4D0;
  --beige-line:   #E5D4B8;
  --terracotta:   #C97B5A;
  --terracotta-d: #A85F42;
  --terracotta-l: #E8A878;
  --peach:        #E8A878;
  --rose-clay:    #C98A7B;
  --sand:         #D9B98A;
  --cocoa:        #A87E5A;
  --brown-1:      #3D2B1F;
  --brown-2:      #5C3D2E;
  --brown-3:      #7A5230;
  --brown-soft:   #9A7E60;

  /* Type */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Layout */
  --sidebar-w:   268px;
  --radius-sm:   8px;
  --radius-md:   16px;
  --radius-lg:   24px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(61,43,31,0.06);
  --shadow-md: 0 6px 20px rgba(61,43,31,0.08);
  --shadow-lg: 0 20px 50px rgba(61,43,31,0.12);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--brown-1);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--brown-1);
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0 0 .4em 0;
}

a {
  color: var(--terracotta-d);
  text-decoration: none;
  transition: color .15s ease;
}
a:hover { color: var(--brown-1); }

.muted { color: var(--brown-soft); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--terracotta);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--terracotta-d);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--brown-2);
  border-color: var(--beige-line);
}
.btn-ghost:hover {
  background: var(--cream-warm);
  color: var(--brown-1);
  border-color: var(--brown-soft);
}

.btn-block { width: 100%; }

/* =========================================================
   LOGIN PAGE
   ========================================================= */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at top, rgba(232,168,120,0.18), transparent 60%),
    radial-gradient(ellipse at bottom right, rgba(201,123,90,0.12), transparent 55%),
    var(--cream);
}

.paw-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.paw-bg .paw {
  position: absolute;
  font-size: 64px;
  opacity: 0.08;
  user-select: none;
}
.paw-bg .paw-1 { top: 8%;  left: 6%;   transform: rotate(-18deg); font-size: 80px; }
.paw-bg .paw-2 { top: 18%; right: 9%;  transform: rotate(22deg); }
.paw-bg .paw-3 { bottom: 12%; left: 12%; transform: rotate(8deg); font-size: 72px; }
.paw-bg .paw-4 { bottom: 22%; right: 14%; transform: rotate(-25deg); }
.paw-bg .paw-5 { top: 48%; left: 3%;  transform: rotate(-10deg); font-size: 56px; }
.paw-bg .paw-6 { top: 52%; right: 4%; transform: rotate(15deg); font-size: 56px; }

.login-card {
  position: relative;
  width: min(440px, 100%);
  background: #fff;
  border: 1px solid var(--beige-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 36px 32px;
}

.login-brand {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  border-radius: 22px;
  box-shadow: var(--shadow-md);
  background: var(--cream-warm);
  padding: 6px;
}
.login-kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--terracotta-d);
  margin: 0 0 6px;
}
.login-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 30px;
  line-height: 1.1;
  margin: 0 0 6px;
  color: var(--brown-1);
}
.login-sub {
  color: var(--brown-2);
  font-size: 14px;
  margin: 0;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--brown-2);
}
.field input {
  font-family: var(--font-body);
  font-size: 15px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--beige-line);
  background: #fff;
  color: var(--brown-1);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus {
  outline: none;
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(201, 123, 90, 0.15);
}

.login-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin: 2px 0;
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--brown-2);
  font-weight: 500;
  cursor: pointer;
}
.checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--terracotta);
  cursor: pointer;
}
.login-forgot {
  color: var(--terracotta-d);
  font-weight: 600;
}
.login-forgot:hover { color: var(--brown-1); }

.login-error {
  display: none;
  background: rgba(168, 95, 66, 0.08);
  border: 1px solid rgba(168, 95, 66, 0.25);
  color: var(--terracotta-d);
  font-size: 13px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-top: 2px;
}
.login-error.is-shown { display: block; }

.login-foot {
  text-align: center;
  font-size: 13px;
  color: var(--brown-soft);
  margin: 24px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--beige-line);
}

/* =========================================================
   APP SHELL (sidebar + main)
   ========================================================= */
.app {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--cream-warm);
  border-right: 1px solid var(--beige-line);
  display: flex;
  flex-direction: column;
  padding: 22px 16px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 22px;
  border-bottom: 1px solid var(--beige-line);
  margin-bottom: 16px;
}
.sidebar-brand img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #fff;
  padding: 4px;
  box-shadow: var(--shadow-sm);
}
.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.sidebar-brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  color: var(--brown-1);
}
.sidebar-brand-sub {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--terracotta-d);
  margin-top: 2px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.nav-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brown-soft);
  padding: 0 12px;
  margin: 6px 0 8px;
}
/* Visual breathing room between groups so labels don't crowd the item
   above. First label keeps the original tight top margin. */
.nav-label ~ .nav-label {
  margin-top: 18px;
  position: relative;
}
.nav-label ~ .nav-label::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 12px;
  right: 12px;
  height: 1px;
  background: var(--beige-line);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--brown-2);
  font-weight: 500;
  font-size: 14.5px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  text-align: left;
  width: 100%;
}
.nav-item:hover {
  background: rgba(201, 123, 90, 0.08);
  color: var(--brown-1);
}
.nav-item.is-active {
  background: #fff;
  color: var(--terracotta-d);
  box-shadow: var(--shadow-sm);
}
.nav-item.is-active .nav-icon { color: var(--terracotta); }
.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--brown-3);
}
.nav-badge {
  margin-left: auto;
  background: var(--terracotta);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  line-height: 1.5;
}

/* ---------- User panel (bottom of sidebar) ---------- */
.user-panel {
  position: relative;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--beige-line);
}
.user-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
  font-family: var(--font-body);
  text-align: left;
}
.user-button:hover {
  background: #fff;
  border-color: var(--beige-line);
}
.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--terracotta);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.user-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  flex: 1;
  min-width: 0;
}
.user-name {
  font-weight: 600;
  color: var(--brown-1);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-email {
  font-size: 12px;
  color: var(--brown-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-chevron {
  width: 16px;
  height: 16px;
  color: var(--brown-soft);
  flex-shrink: 0;
  transition: transform .2s ease;
}
.user-panel.is-open .user-chevron { transform: rotate(180deg); }

.user-menu {
  position: absolute;
  bottom: calc(100% - 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--beige-line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: none;
  z-index: 20;
}
.user-panel.is-open .user-menu { display: block; }
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--brown-1);
  font-size: 14px;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background .12s ease, color .12s ease;
}
.user-menu-item:hover {
  background: var(--cream-warm);
}
.user-menu-item.is-danger {
  color: var(--terracotta-d);
}
.user-menu-item.is-danger:hover {
  background: rgba(168, 95, 66, 0.08);
}
.user-menu-item svg {
  width: 17px;
  height: 17px;
  color: currentColor;
  opacity: 0.8;
  flex-shrink: 0;
}
.user-menu-sep {
  height: 1px;
  background: var(--beige-line);
  margin: 4px 6px;
}

/* ---------- Main content ---------- */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 32px;
  border-bottom: 1px solid var(--beige-line);
  background: var(--cream);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-title h1 {
  font-size: 26px;
  margin: 0;
}
.topbar-title p {
  margin: 2px 0 0;
  color: var(--brown-soft);
  font-size: 13px;
}
.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.search {
  position: relative;
}
.search input {
  font-family: var(--font-body);
  font-size: 14px;
  padding: 10px 14px 10px 38px;
  width: 260px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--beige-line);
  background: #fff;
  color: var(--brown-1);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search input:focus {
  outline: none;
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(201, 123, 90, 0.15);
}
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 360px;
  max-width: calc(100vw - 40px);
  max-height: 60vh;
  overflow-y: auto;
  background: var(--cream);
  border: 1px solid var(--beige-line);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(60, 30, 10, 0.18);
  z-index: 40;
  padding: 6px;
}
.search-group + .search-group { border-top: 1px solid var(--beige-line); margin-top: 4px; padding-top: 4px; }
.search-group-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--brown-soft);
  padding: 6px 10px 2px;
}
.search-row {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 8px 10px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
}
.search-row:hover, .search-row:focus { background: var(--cream-warm); outline: none; }
.search-row-title { font-size: 13.5px; color: var(--brown-1); font-weight: 500; }
.search-row-sub { font-size: 11.5px; color: var(--brown-soft); }
.search-empty { padding: 16px 12px; font-size: 13px; color: var(--brown-soft); text-align: center; }
.search svg {
  position: absolute;
  top: 50%;
  left: 13px;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--brown-soft);
  pointer-events: none;
}

.content {
  flex: 1;
  padding: 28px 32px 48px;
  overflow-x: hidden;
}

.pane { display: none; }
.pane.is-active { display: block; animation: fade .25s ease; }
@keyframes fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Cards (dashboard) ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--beige-line);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--terracotta-l);
}
.stat-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brown-soft);
  margin: 0 0 8px;
}
.stat-value {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 30px;
  line-height: 1;
  color: var(--brown-1);
  letter-spacing: -0.02em;
}
.stat-delta {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--terracotta-d);
}
.stat-delta.is-down { color: var(--brown-soft); }

.split-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.panel {
  background: #fff;
  border: 1px solid var(--beige-line);
  border-radius: var(--radius-md);
  padding: 22px 24px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.panel-head h2 {
  font-size: 18px;
  margin: 0;
}
.panel-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--terracotta-d);
}

/* ---------- Activity / list rows ---------- */
.list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  border-radius: var(--radius-sm);
  transition: background .12s ease;
}
.list-row:hover { background: var(--cream-warm); }
.list-row + .list-row { border-top: 1px solid var(--beige-line); }
.list-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--beige-soft);
  color: var(--brown-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.list-main {
  flex: 1;
  min-width: 0;
}
.list-title {
  font-weight: 600;
  color: var(--brown-1);
  font-size: 14px;
}
.list-sub {
  font-size: 12.5px;
  color: var(--brown-soft);
}
.list-meta {
  font-size: 12px;
  color: var(--brown-soft);
  white-space: nowrap;
}

/* Upcoming-booking quick actions: three circular icon buttons sitting
   between the main info and the date/time meta. Each opens a draggable
   popup (booking / owner / pet). */
.upcoming-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.upcoming-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--beige-line);
  color: var(--brown-2);
  cursor: pointer;
  padding: 0;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}
.upcoming-action svg { width: 15px; height: 15px; display: block; }
.upcoming-action:hover {
  background: var(--terracotta);
  color: #fff;
  border-color: var(--terracotta);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(201, 123, 90, 0.25);
}
.upcoming-action:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 2px;
}
/* Keep the hover swap of the row from washing the buttons out. */
.list-row:hover .upcoming-action { background: #fff; }
.list-row:hover .upcoming-action:hover { background: var(--terracotta); }

@media (max-width: 720px) {
  .upcoming-action { width: 28px; height: 28px; }
  .upcoming-action svg { width: 14px; height: 14px; }
}

/* ---------- Tables (bookings) ---------- */
.table-wrap {
  background: #fff;
  border: 1px solid var(--beige-line);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table thead {
  background: var(--cream-warm);
}
.table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brown-soft);
  padding: 12px 18px;
  border-bottom: 1px solid var(--beige-line);
}
.table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--beige-line);
  color: var(--brown-1);
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr {
  transition: background .12s ease;
}
.table tbody tr:hover { background: var(--cream-warm); }
.table .cell-strong {
  font-weight: 600;
}
.table .cell-sub {
  display: block;
  font-size: 12px;
  color: var(--brown-soft);
  margin-top: 2px;
}

.tag {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.04em;
}
.tag-confirmed { background: rgba(201, 123, 90, 0.12); color: var(--terracotta-d); }
.tag-pending   { background: rgba(217, 185, 138, 0.25); color: var(--brown-3); }
.tag-done      { background: rgba(154, 126, 96, 0.18); color: var(--brown-2); }
.tag-cancelled { background: rgba(61, 43, 31, 0.08); color: var(--brown-soft); }
.tag-archived  { background: rgba(122,  82, 48, 0.12); color: var(--brown-3); border: 1px dashed rgba(122, 82, 48, 0.35); }

.tabs {
  display: inline-flex;
  background: var(--cream-warm);
  border: 1px solid var(--beige-line);
  border-radius: var(--radius-pill);
  padding: 4px;
  gap: 2px;
}
.tab {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--brown-2);
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.tab:hover { color: var(--brown-1); }
.tab.is-active {
  background: #fff;
  color: var(--terracotta-d);
  box-shadow: var(--shadow-sm);
}

/* ---------- Posts pane ---------- */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.post-card {
  background: #fff;
  border: 1px solid var(--beige-line);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--terracotta-l);
}
.post-cover {
  height: 124px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  background: linear-gradient(135deg, var(--cream-warm), var(--beige-soft));
  border-bottom: 1px solid var(--beige-line);
  filter: drop-shadow(0 2px 4px rgba(61,43,31,0.08));
}
.post-cover-thumb { padding: 0; background: var(--cream-warm); }
.post-cover-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Generic empty-state used across panes — replaces the inline "No X here"
   blocks with something more inviting. */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 24px;
  background: #fff;
  border: 1px dashed var(--beige-line);
  border-radius: var(--radius-md);
  color: var(--brown-soft);
}
.empty-state-grid { grid-column: 1 / -1; }
.empty-state-icon { font-size: 42px; margin-bottom: 12px; opacity: 0.7; }
.empty-state-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--brown-1);
  margin-bottom: 6px;
}
.empty-state-sub { font-size: 13.5px; line-height: 1.5; max-width: 320px; }
.empty-state-sub strong { color: var(--terracotta); font-weight: 600; }

/* Compact inline filter — "Label: <select>" sitting in a pane header. */
.inline-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--brown-soft);
}
.inline-select span { font-weight: 500; }
.inline-select select {
  border: 1px solid var(--beige-line);
  background: var(--cream-warm);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 13px;
  color: var(--brown-1);
  font-family: inherit;
  cursor: pointer;
  max-width: 220px;
}
.inline-select select:focus { outline: 2px solid var(--terracotta); outline-offset: -1px; }

/* Info modals (Profile / Settings / Notifications / Help / Shortcuts) */
.info-modal-body { padding: 20px 24px; line-height: 1.55; color: var(--brown-1); }
.info-modal-body p { margin: 0 0 12px; font-size: 14px; }
.info-modal-lead { color: var(--brown-1); }

/* Availability editor inside the user-menu modal */
.avail-form .form-field-label {
  display: block;
  font-size: 12.5px;
  color: var(--brown-soft);
  font-weight: 500;
  margin-bottom: 6px;
}
.avail-day-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 6px;
}
.avail-day-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  background: var(--cream-warm);
  border: 1px solid var(--beige-line);
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brown-2);
  cursor: pointer;
  transition: all 120ms ease;
  text-align: center;
}
.avail-day-pill:hover { border-color: var(--terracotta); color: var(--terracotta-d); }
.avail-day-pill.is-on {
  background: var(--terracotta);
  color: #fff;
  border-color: var(--terracotta);
  box-shadow: 0 4px 12px rgba(201, 123, 90, 0.22);
}
.avail-day-pill input { display: none; }
.avail-form input[type="time"] {
  width: 100%;
  border: 1px solid var(--beige-line);
  background: var(--cream-warm);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  color: var(--brown-1);
  font-family: inherit;
  box-sizing: border-box;
}
.avail-form input[type="time"]:focus {
  outline: 2px solid var(--terracotta);
  outline-offset: -1px;
}
.avail-error { margin-top: 12px; }
.avail-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}
.info-modal-foot { color: var(--brown-soft); font-size: 12.5px; margin-top: 12px; }
.info-modal-list {
  list-style: none;
  padding: 0;
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13.5px;
}
.info-modal-list li {
  padding: 8px 12px;
  background: var(--cream-warm);
  border-radius: 6px;
}
.info-modal-list strong { color: var(--brown-1); font-weight: 600; }
.profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--cream-warm);
  border-radius: 10px;
  margin-bottom: 16px;
}
.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--terracotta);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  flex: 0 0 auto;
}
.profile-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.profile-name { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--brown-1); }
.profile-email { font-size: 13px; color: var(--brown-soft); word-break: break-all; }
.profile-role {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--brown-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.profile-action { margin-top: 4px; }

.notifications-list { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow-y: auto; }
.notification-row {
  padding: 8px 12px;
  border: 1px solid var(--beige-line);
  border-radius: 6px;
  background: #fff;
}
.notification-event { font-size: 13.5px; color: var(--brown-1); font-weight: 500; }
.notification-meta { font-size: 11.5px; color: var(--brown-soft); margin-top: 2px; }

.shortcuts-table { width: 100%; border-collapse: collapse; }
.shortcuts-table th, .shortcuts-table td { text-align: left; padding: 8px 10px; font-size: 13px; }
.shortcuts-table th {
  font-family: var(--font-display);
  background: var(--cream-warm);
  border-radius: 5px;
  width: 38%;
  font-weight: 600;
  color: var(--brown-1);
}
.shortcuts-table td { color: var(--brown-2); }
.post-body {
  padding: 16px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.post-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.post-channel {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brown-soft);
}
.post-channel.is-fb { color: #1877F2; }
.post-channel.is-ig { color: var(--terracotta-d); }
.post-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  color: var(--brown-1);
  line-height: 1.25;
  margin: 0;
}
.post-text {
  font-size: 13.5px;
  color: var(--brown-2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}
.post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--beige-line);
  font-size: 12px;
  color: var(--brown-soft);
}
.post-stats {
  display: inline-flex;
  gap: 12px;
}
.post-stats span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ---------- Messages pane ---------- */
.messages {
  display: grid;
  grid-template-columns: 320px 1fr;
  background: #fff;
  border: 1px solid var(--beige-line);
  border-radius: var(--radius-md);
  overflow: hidden;
  min-height: 560px;
}
.msg-list {
  border-right: 1px solid var(--beige-line);
  background: var(--cream-warm);
  overflow-y: auto;
}
.msg-list-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--beige-line);
}
.msg-list-head h3 {
  font-size: 16px;
  margin: 0;
}
.msg-list-head p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--brown-soft);
}
.msg-row {
  display: flex;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--beige-line);
  cursor: pointer;
  transition: background .12s ease;
}
.msg-row:hover { background: #fff; }
.msg-row.is-active {
  background: #fff;
  box-shadow: inset 3px 0 0 var(--terracotta);
}
.msg-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--sand);
  color: var(--brown-1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
}
.msg-row:nth-child(odd) .msg-avatar { background: var(--rose-clay); color: #fff; }
.msg-row:nth-child(3n)  .msg-avatar { background: var(--cocoa); color: #fff; }
.msg-meta {
  flex: 1;
  min-width: 0;
}
.msg-meta-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.msg-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--brown-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msg-time {
  font-size: 11px;
  color: var(--brown-soft);
  white-space: nowrap;
}
.msg-preview {
  font-size: 13px;
  color: var(--brown-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}
.msg-row.is-unread .msg-name { color: var(--terracotta-d); }
.msg-row.is-unread .msg-preview { color: var(--brown-2); font-weight: 500; }

.msg-thread {
  display: flex;
  flex-direction: column;
}
.msg-thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--beige-line);
}
.msg-thread-head h3 {
  font-size: 17px;
  margin: 0;
}
.msg-thread-head p {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--brown-soft);
}
.msg-thread-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.msg-thread-actions .btn { padding: 6px 12px; font-size: 12.5px; }

/* Draggable chat profile popups */
.chat-popup {
  position: fixed;
  width: 320px;
  max-width: calc(100vw - 40px);
  background: var(--cream);
  border: 1px solid var(--beige-line);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(60, 30, 10, 0.18);
  z-index: 50;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
/* Our flex display would otherwise override the browser default
   `[hidden] { display: none }` rule. */
.chat-popup[hidden] { display: none; }
.chat-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--cream-warm);
  border-bottom: 1px solid var(--beige-line);
  cursor: move;
  user-select: none;
}
.chat-popup-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--brown-1);
}
.chat-popup-close {
  border: none;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  color: var(--brown-soft);
  cursor: pointer;
  padding: 0 4px;
}
.chat-popup-close:hover { color: var(--terracotta); }
.chat-popup-body {
  padding: 14px;
  max-height: 60vh;
  overflow-y: auto;
}
.chat-popup-empty {
  color: var(--brown-soft);
  font-size: 13px;
  font-style: italic;
  margin: 0 0 10px;
}

/* Recent-messages popup — same draggable shell, scrollable bubble list */
.chat-popup-messages {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
  padding: 4px 2px 10px;
  margin-bottom: 10px;
  border-bottom: 1px dashed var(--beige-line);
}
.chat-popup-messages .bubble {
  max-width: 85%;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.chat-popup-messages .bubble-time {
  font-size: 10.5px;
  opacity: 0.75;
  align-self: flex-end;
}
.chat-popup-jump {
  width: 100%;
  justify-content: center;
  padding: 8px 12px;
  font-size: 13px;
}
.chat-popup-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--brown-1);
  margin-bottom: 10px;
}
.chat-popup-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  font-size: 13px;
  border-bottom: 1px dashed var(--beige-line);
}
.chat-popup-row:last-of-type { border-bottom: none; }
.chat-popup-label { color: var(--brown-soft); font-weight: 500; }
.chat-popup-value { color: var(--brown-1); text-align: right; max-width: 60%; word-break: break-word; }
.chat-popup-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--beige-line);
}
.chat-popup-tab {
  border: 1px solid var(--beige-line);
  background: var(--cream-warm);
  color: var(--brown-1);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.chat-popup-tab.is-active {
  background: var(--terracotta);
  color: white;
  border-color: var(--terracotta);
}
.chat-popup-notes {
  margin-top: 10px;
  padding: 8px 10px;
  background: var(--cream-warm);
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--brown-2);
  white-space: pre-wrap;
  line-height: 1.4;
}
.msg-thread-body {
  flex: 1;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  background: var(--cream);
}
.bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  box-shadow: var(--shadow-sm);
}
.bubble-them {
  background: #fff;
  border: 1px solid var(--beige-line);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  color: var(--brown-1);
}
.bubble-me {
  background: var(--terracotta);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.bubble-time {
  font-size: 10.5px;
  color: var(--brown-soft);
  margin-top: 4px;
  display: block;
}
.bubble-me .bubble-time { color: rgba(255,255,255,0.75); }

.msg-thread-input {
  display: flex;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--beige-line);
  background: #fff;
}
.msg-thread-input input {
  flex: 1;
  font-family: var(--font-body);
  font-size: 14px;
  padding: 11px 16px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--beige-line);
  background: var(--cream-warm);
  color: var(--brown-1);
}
.msg-thread-input input:focus {
  outline: none;
  border-color: var(--terracotta);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(201, 123, 90, 0.15);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .split-grid { grid-template-columns: 1fr; }
  .search input { width: 200px; }
}

@media (max-width: 720px) {
  .sidebar {
    position: fixed;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 50;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open { transform: translateX(0); }
  .menu-btn { display: inline-flex !important; }
  .topbar { padding: 16px 20px; }
  .content { padding: 20px; }
  .stat-grid { grid-template-columns: 1fr; }
  .messages { grid-template-columns: 1fr; min-height: auto; }
  .msg-list { max-height: 240px; }
  .search input { width: 150px; }
}

.menu-btn {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--cream-warm);
  border: 1px solid var(--beige-line);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--brown-2);
}

/* ---------- Docs pane ---------- */
.docs {
  display: grid;
  grid-template-columns: 280px 1fr;
  background: #fff;
  border: 1px solid var(--beige-line);
  border-radius: var(--radius-md);
  overflow: hidden;
  min-height: 560px;
}
.docs-list {
  border-right: 1px solid var(--beige-line);
  background: var(--cream-warm);
  overflow-y: auto;
}
.docs-list-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--beige-line);
}
.docs-list-head h3 { font-size: 16px; margin: 0; }
.docs-list-head p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--brown-soft);
}
.docs-group-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--brown-soft);
  padding: 14px 18px 4px;
}
.docs-row {
  display: flex;
  gap: 10px;
  padding: 10px 18px;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--brown-1);
  align-items: center;
  transition: background .12s ease;
}
.docs-row:hover { background: #fff; }
.docs-row.is-active {
  background: #fff;
  box-shadow: inset 3px 0 0 var(--terracotta);
  font-weight: 600;
}
.docs-row-icon { width: 18px; text-align: center; font-size: 14px; }
.docs-view { display: flex; flex-direction: column; }
.docs-view-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--beige-line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.docs-view-head-main { flex: 1 1 auto; min-width: 0; }
.docs-view-head-actions { flex: 0 0 auto; display: flex; gap: 8px; }
.docs-view-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
}
.docs-view-head p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--brown-soft);
}
.docs-title-input {
  width: 100%;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  border: 1px solid var(--beige-line);
  background: var(--cream-warm);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--brown-1);
}
.docs-title-input:focus { outline: 2px solid var(--terracotta); outline-offset: -1px; }
.docs-cat-input {
  margin-top: 6px;
  font-size: 13px;
  border: 1px solid var(--beige-line);
  background: var(--cream-warm);
  border-radius: 6px;
  padding: 4px 8px;
  color: var(--brown-1);
  min-width: 200px;
}
.docs-cat-input:focus { outline: 2px solid var(--terracotta); outline-offset: -1px; }
.docs-body {
  padding: 22px 28px;
  overflow-y: auto;
  line-height: 1.6;
  color: var(--brown-1);
}
.docs-placeholder { color: var(--brown-soft); }
.docs-body h1, .docs-body h2, .docs-body h3 {
  font-family: var(--font-display);
  margin-top: 22px;
  margin-bottom: 8px;
}
.docs-body h1 { font-size: 22px; }
.docs-body h2 { font-size: 18px; }
.docs-body h3 { font-size: 16px; }
.docs-body p { margin: 8px 0; }
.docs-body ul, .docs-body ol { margin: 8px 0; padding-left: 22px; }
.docs-body li { margin: 4px 0; }
.docs-body .docs-divider {
  border: none;
  border-top: 1px solid var(--beige-line);
  margin: 18px 0;
}
.docs-body .docs-quote {
  border-left: 3px solid var(--terracotta);
  padding-left: 12px;
  color: var(--brown-2);
  font-style: italic;
  margin: 10px 0;
}
.docs-todo {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 4px 0;
}
.docs-todo input[type="checkbox"] {
  margin-top: 4px;
  width: 16px;
  height: 16px;
  accent-color: var(--terracotta);
  cursor: pointer;
}
.docs-todo.is-checked label {
  text-decoration: line-through;
  color: var(--brown-soft);
}
.docs-todo.is-editing {
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}
.docs-todo.is-editing input[type="checkbox"] {
  opacity: 0.4;
  cursor: default;
  margin-top: 0;
}
.docs-todo-input {
  flex: 1 1 auto;
  border: 1px solid var(--beige-line);
  background: var(--cream-warm);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 14px;
  color: var(--brown-1);
  min-width: 0;
}
.docs-todo-input:focus { outline: 2px solid var(--terracotta); outline-offset: -1px; }
.docs-todo-delete {
  flex: 0 0 auto;
  border: 1px solid var(--beige-line);
  background: var(--cream);
  color: var(--brown-soft);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.docs-todo-delete:hover {
  background: var(--terracotta);
  color: white;
  border-color: var(--terracotta);
}
.docs-add-step {
  margin-top: 14px;
  border: 1px dashed var(--beige-line);
  background: transparent;
  color: var(--brown-soft);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  cursor: pointer;
  width: 100%;
  text-align: left;
}
.docs-add-step:hover {
  border-color: var(--terracotta);
  color: var(--terracotta);
  background: var(--cream-warm);
}

/* Inline edit rows for non-step blocks (paragraphs, headings, lists, quotes) */
.docs-edit-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
}
.docs-edit-tag {
  flex: 0 0 auto;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--brown-soft);
  background: var(--cream-warm);
  border-radius: 4px;
  padding: 2px 6px;
  min-width: 22px;
  text-align: center;
  font-family: var(--font-display);
}
.docs-block-input {
  flex: 1 1 auto;
  border: 1px solid var(--beige-line);
  background: var(--cream-warm);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 14px;
  color: var(--brown-1);
  min-width: 0;
  font-family: inherit;
  resize: vertical;
}
.docs-block-input:focus { outline: 2px solid var(--terracotta); outline-offset: -1px; }
.docs-heading-input { font-family: var(--font-display); font-weight: 700; }
.docs-heading-input.docs-h1 { font-size: 20px; }
.docs-heading-input.docs-h2 { font-size: 17px; }
.docs-heading-input.docs-h3 { font-size: 15px; }
.docs-paragraph-input { line-height: 1.5; min-height: 40px; }
.docs-quote-input { font-style: italic; border-left: 3px solid var(--terracotta); min-height: 40px; }
/* contenteditable variants — same look as the old inputs but accept HTML */
.docs-editable {
  white-space: pre-wrap;
  word-break: break-word;
  caret-color: var(--terracotta);
}
.docs-editable[contenteditable="true"]:empty:before {
  content: attr(data-placeholder);
  color: var(--brown-soft);
  pointer-events: none;
}
.docs-editable a { color: var(--terracotta); text-decoration: underline; }
.docs-editable code {
  background: var(--cream);
  border: 1px solid var(--beige-line);
  border-radius: 3px;
  padding: 0 4px;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Floating rich-text toolbar that follows the focused contenteditable */
.docs-rich-toolbar {
  position: absolute;
  z-index: 70;
  display: flex;
  gap: 2px;
  background: var(--brown-1);
  color: #fff;
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 6px 20px rgba(60, 30, 10, 0.25);
}
.docs-rich-toolbar button {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 5px;
  cursor: pointer;
  min-width: 28px;
}
.docs-rich-toolbar button:hover { background: rgba(255,255,255,0.12); }
.docs-rich-toolbar button code { background: transparent; color: #fff; padding: 0; border: none; font-size: 12px; }
.docs-edit-note {
  font-size: 11px;
  color: var(--brown-soft);
  margin-top: 4px;
  font-style: italic;
}

/* Step move arrows */
.docs-step-arrows {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 0 0 auto;
}
.docs-step-arrow {
  border: 1px solid var(--beige-line);
  background: var(--cream);
  color: var(--brown-soft);
  border-radius: 4px;
  width: 22px;
  height: 16px;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.docs-step-arrow:hover:not(:disabled) {
  background: var(--terracotta);
  color: white;
  border-color: var(--terracotta);
}
.docs-step-arrow:disabled { opacity: 0.3; cursor: not-allowed; }
.docs-unsupported {
  font-size: 12px;
  color: var(--brown-soft);
  background: var(--cream-warm);
  padding: 6px 10px;
  border-radius: 8px;
  display: inline-block;
}
.docs-body img {
  max-width: 100%;
  border-radius: 10px;
  margin: 10px 0;
}

@media (max-width: 900px) {
  .docs { grid-template-columns: 1fr; min-height: auto; }
  .docs-list { max-height: 240px; }
}

/* ===== Docs (Notion-link cards) ===== */
.docs-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 20px;
}
.docs-head-title {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 0 0 4px;
  color: var(--brown-1);
}
.docs-head-sub {
  font-size: 13px;
  color: var(--brown-soft);
  margin: 0;
}
.docs-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
  padding: 12px 14px;
  background: var(--cream-warm);
  border: 1px solid var(--beige-line);
  border-radius: 12px;
}
.docs-search {
  flex: 1 1 220px;
  min-width: 160px;
  border: 1px solid var(--beige-line);
  background: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--brown-1);
}
.docs-search::placeholder { color: var(--brown-soft); opacity: 0.7; }
.docs-search:focus {
  outline: 2px solid var(--terracotta);
  outline-offset: -1px;
}
.docs-toolbar .inline-select { flex: 0 0 auto; }
.docs-reset {
  flex: 0 0 auto;
  font-size: 12.5px;
  padding: 6px 12px;
}

.docs-grid { display: flex; flex-direction: column; gap: 22px; }
.docs-cards-flat {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.docs-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brown-soft);
  margin: 0 0 10px;
}
.docs-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.docs-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 12px;
  background: #fff;
  border: 1px solid var(--beige-line);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}
.docs-card:hover {
  border-color: var(--terracotta);
  box-shadow: 0 6px 20px rgba(60, 30, 10, 0.07);
  transform: translateY(-1px);
}
.docs-card-icon {
  font-size: 20px;
  width: 28px;
  text-align: center;
  flex: 0 0 auto;
}
.docs-card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}
.docs-card-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--brown-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.docs-card-meta {
  font-size: 11.5px;
  color: var(--brown-soft);
}
.docs-card-arrow {
  font-size: 14px;
  color: var(--brown-soft);
  flex: 0 0 auto;
  opacity: 0.6;
}
.docs-card:hover .docs-card-arrow { opacity: 1; color: var(--terracotta); }

/* ===== Doc cards (read-only — click to open in Notion) ===== */
.doc-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px 14px 12px;
  background: #fff;
  border: 1px solid var(--beige-line);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}
.doc-card:hover {
  border-color: var(--terracotta);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(60, 30, 10, 0.08);
}
.doc-card-icon {
  font-size: 20px;
  width: 28px;
  text-align: center;
  flex: 0 0 auto;
  line-height: 1.2;
}
.doc-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}
.doc-card-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--brown-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc-card-subtitle {
  font-size: 11.5px;
  color: var(--brown-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}
.doc-tag-chip {
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  background: rgba(201, 123, 90, 0.12);
  color: var(--terracotta-d);
}
.doc-card-arrow {
  font-size: 14px;
  color: var(--brown-soft);
  flex: 0 0 auto;
  opacity: 0.55;
  margin-top: 2px;
}
.doc-card:hover .doc-card-arrow { opacity: 1; color: var(--terracotta); }

/* ---------- Quick actions (above user panel) ---------- */
.quick-actions {
  position: relative;
  margin-top: 12px;
}
.quick-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--terracotta);
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  transition: filter .12s ease, transform .12s ease;
}
.quick-button:hover { filter: brightness(1.05); }
.quick-button:active { transform: translateY(1px); }
.quick-button svg { width: 16px; height: 16px; }
.quick-menu {
  position: absolute;
  bottom: calc(100% - 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--beige-line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: none;
  z-index: 20;
}
.quick-actions.is-open .quick-menu { display: block; }
.quick-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--brown-1);
  font-size: 14px;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background .12s ease;
}
.quick-menu-item:hover { background: var(--cream-warm); }
.quick-menu-item svg { width: 16px; height: 16px; color: var(--brown-2); flex-shrink: 0; }

/* ---------- Format tag on post cards ---------- */
.post-format {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.post-format.fmt-story { background: #fff1e2; color: #b15512; }
.post-format.fmt-reel { background: #ffe2e2; color: #b11a1a; }
.post-format.fmt-carousel { background: #e2ecff; color: #1a3fb1; }
.post-format.fmt-text { background: var(--cream-warm); color: var(--brown-2); }

/* ---------- Modals ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(48, 28, 18, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  overflow-y: auto;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: #fff;
  border-radius: var(--radius-lg, 14px);
  width: 100%;
  max-width: 560px;
  box-shadow: 0 24px 60px rgba(48, 28, 18, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 40px);
}
.modal[hidden] { display: none; }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--beige-line);
}
.modal-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
}
.modal-close {
  background: transparent;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: var(--brown-soft);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 8px;
}
.modal-close:hover { background: var(--cream-warm); }
.modal-body {
  padding: 18px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--beige-line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--cream-warm);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-field { display: flex; flex-direction: column; gap: 4px; }
.form-field-full { grid-column: 1 / -1; }
.form-field span {
  font-size: 12px;
  color: var(--brown-soft);
  font-weight: 600;
}
.form-field input,
.form-field select,
.form-field textarea {
  font-family: var(--font-body);
  font-size: 14px;
  padding: 9px 11px;
  border: 1px solid var(--beige-line);
  border-radius: var(--radius-sm, 8px);
  background: #fff;
  color: var(--brown-1);
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(176, 84, 36, 0.12);
}
.form-error {
  font-size: 13px;
  color: #a71a1a;
  background: #ffeaea;
  border-radius: 8px;
  padding: 8px 12px;
  display: none;
}
.form-error.is-shown { display: block; }

/* "+ New" inline-add button next to a field label */
.form-field-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.form-field-label span {
  font-size: 12px;
  color: var(--brown-soft);
  font-weight: 600;
}
.form-field-add {
  background: transparent;
  border: none;
  color: var(--terracotta);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
}
.form-field-add:hover { background: var(--cream-warm); }
.form-field-add.is-active { background: var(--cream-warm); color: var(--terracotta-d, var(--terracotta)); }

/* Inline mini-form (collapses inside the modal body) */
.inline-form {
  background: var(--cream-warm);
  border: 1px dashed var(--beige-line);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.inline-form[hidden] { display: none; }
.inline-form-head {
  font-size: 13px;
  font-weight: 700;
  color: var(--brown-1);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.inline-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.btn-small {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 8px;
}

@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ---------- Toast notifications ---------- */
.toast-stack {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: calc(100vw - 40px);
}
.toast {
  pointer-events: auto;
  background: #fff;
  border: 1px solid var(--beige-line);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: 0 12px 32px rgba(48, 28, 18, .18);
  font-size: 14px;
  color: var(--brown-1);
  width: 320px;
  cursor: pointer;
  animation: toast-in .18s ease;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.toast::before {
  content: "";
  width: 4px;
  align-self: stretch;
  border-radius: 4px;
  background: var(--terracotta);
  flex-shrink: 0;
}
.toast.toast-error::before { background: #c54040; }
.toast.toast-error { color: #6e1a1a; }
.toast.toast-success::before { background: #2e9a4e; }
@keyframes toast-in {
  from { transform: translateX(12px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Floating progress card — persistent (no auto-dismiss while busy).
   Lives bottom-right so it doesn't conflict with the toast stack
   (top-right). One element per session; state changes in place. */
.float-progress {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 210;
  width: 340px;
  max-width: calc(100vw - 40px);
  background: #fff;
  border: 1px solid var(--beige-line);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(48, 28, 18, 0.22);
  padding: 14px 14px 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: fp-in 0.2s ease;
}
.float-progress[hidden] { display: none; }
@keyframes fp-in {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Left-edge accent stripe color shifts with state. */
.float-progress::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 4px;
  border-radius: 4px;
  background: var(--terracotta);
}
.float-progress.is-success::before { background: #2e9a4e; }
.float-progress.is-error::before { background: #c54040; }

/* Icon swaps between spinner (busy), check (success), x (error). */
.float-progress-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.float-progress.is-busy .float-progress-icon::before {
  content: '';
  width: 18px;
  height: 18px;
  border: 2.5px solid var(--terracotta);
  border-top-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.8s linear infinite;
}
.float-progress.is-success .float-progress-icon::before {
  content: '✓';
  color: #2e9a4e;
  font-weight: 800;
  font-size: 18px;
  line-height: 1;
}
.float-progress.is-error .float-progress-icon::before {
  content: '!';
  color: #fff;
  background: #c54040;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.float-progress-body {
  flex: 1 1 auto;
  min-width: 0;
}
.float-progress-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--brown-1);
  line-height: 1.3;
}
.float-progress-sub {
  font-size: 12.5px;
  color: var(--brown-soft);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.float-progress-sub:empty { display: none; }

.float-progress-close {
  background: transparent;
  border: none;
  color: var(--brown-soft);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  flex: 0 0 auto;
}
.float-progress-close:hover { background: var(--cream-warm); color: var(--brown-1); }

@media (max-width: 540px) {
  .float-progress {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
  }
}

/* Optimistic / saving rows */
.is-pending {
  opacity: .65;
  font-style: italic;
}
.post-card.is-pending { background: var(--cream-warm); }

/* Booking rows are clickable (open detail modal) */
tr[data-booking-id] { cursor: pointer; }
tr[data-booking-id]:hover { background: var(--cream-warm); }

/* Record rows are clickable too */
tr[data-record-id] { cursor: pointer; }
tr[data-record-id]:hover { background: var(--cream-warm); }

/* Task rows clickable */
tr[data-task-id] { cursor: default; }
tr[data-task-id]:hover { background: var(--cream-warm); }
tr[data-task-id].is-overdue td:first-child { box-shadow: inset 3px 0 0 var(--terracotta); }

/* ===== Inline-editable task rows ===== */
tr.task-row.is-pending { opacity: 0.55; pointer-events: none; }
tr.task-row td { vertical-align: middle; }

.task-cell-title { min-width: 200px; max-width: 360px; }
.task-title-input,
.task-notes-input {
  display: block;
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 4px 6px;
  font-family: inherit;
  color: inherit;
  box-sizing: border-box;
}
.task-title-input { font-size: 14px; font-weight: 600; color: var(--brown-1); }
.task-notes-input { font-size: 12px; color: var(--brown-soft); margin-top: 2px; }
.task-title-input::placeholder,
.task-notes-input::placeholder { color: var(--brown-soft); opacity: 0.5; }
.task-title-input:hover,
.task-notes-input:hover { background: var(--cream-warm); }
.task-title-input:focus,
.task-notes-input:focus {
  outline: none;
  background: #fff;
  border-color: var(--terracotta);
}

/* Pill-shaped selects keep their status/priority chip colors */
.task-select {
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid transparent;
  cursor: pointer;
  padding-right: 20px !important;
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M0 0l5 6 5-6z' fill='%23625040'/></svg>");
  font-family: inherit;
}
.task-select:focus { outline: 2px solid var(--terracotta); outline-offset: 1px; }

.task-select-assignee,
.task-input-due {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 4px 6px;
  color: inherit;
  font-family: inherit;
  font-size: 13px;
  width: 100%;
  cursor: pointer;
  box-sizing: border-box;
}
.task-select-assignee:hover,
.task-input-due:hover { background: var(--cream-warm); }
.task-select-assignee:focus,
.task-input-due:focus {
  outline: none;
  background: #fff;
  border-color: var(--terracotta);
}

.task-tags-inline { display: flex; flex-wrap: wrap; gap: 4px; }
.task-tags-inline .tag-chip {
  cursor: pointer;
  border: 1px solid transparent;
  transition: opacity 120ms ease;
  font-family: inherit;
  font-size: 10px;
  text-transform: lowercase;
}
.task-tags-inline .tag-chip.is-off { opacity: 0.35; }
.task-tags-inline .tag-chip:hover {
  opacity: 1;
  border-color: rgba(60, 30, 10, 0.18);
}

/* Priority pills */
.priority-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.priority-pill.p-high { background: #ffe2e2; color: #b11a1a; }
.priority-pill.p-medium { background: #fff1d2; color: #8a5a00; }
.priority-pill.p-low { background: #e2ecff; color: #1a3fb1; }

/* Tag chips (in task table) */
.tag-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}
.tag-chip {
  font-size: 10px;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--cream-warm);
  color: var(--brown-2);
  font-weight: 600;
}
.tag-chip.c-clinic { background: #e2ecff; color: #1a3fb1; }
.tag-chip.c-admin { background: var(--cream-warm); color: var(--brown-2); }
.tag-chip.c-marketing { background: #ffe2f3; color: #a4196e; }
.tag-chip.c-finance { background: #e6f4e8; color: #2a6b2a; }
.tag-chip.c-inventory { background: #fff1d2; color: #8a5a00; }
.tag-chip.c-follow-up { background: #fff5d8; color: #82691a; }

.visibility-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
}
.visibility-pill.is-visible { background: #e6f4e8; color: #2a6b2a; }
.visibility-pill.is-hidden { background: var(--cream-warm); color: var(--brown-soft); }

/* Checkbox-with-label-on-same-row inside a form field */
.checkbox-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--brown-soft);
  font-weight: 600;
}
.checkbox-label-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--terracotta);
}
.form-field-hint {
  font-size: 11px;
  color: var(--brown-soft);
  font-style: italic;
  margin-top: 4px;
}

/* ---------- View toggle (Table/Calendar, Grid/Calendar) ---------- */
.view-toggle {
  display: inline-flex;
  background: var(--cream-warm);
  border: 1px solid var(--beige-line);
  border-radius: 999px;
  padding: 3px;
}
.view-toggle button {
  background: transparent;
  border: none;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--brown-soft);
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-body);
}
.view-toggle button.is-active {
  background: #fff;
  color: var(--brown-1);
  box-shadow: var(--shadow-sm);
}

/* ---------- Month calendar ---------- */
.cal {
  background: #fff;
  border: 1px solid var(--beige-line);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--beige-line);
  background: var(--cream-warm);
}
.cal-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}
.cal-nav {
  display: flex;
  gap: 6px;
}
.cal-nav button {
  height: 32px;
  min-width: 32px;
  padding: 0 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--beige-line);
  cursor: pointer;
  font-size: 14px;
  color: var(--brown-2);
  font-family: var(--font-body);
}
.cal-nav button:hover { background: var(--cream-warm); }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.cal-dow {
  padding: 8px 10px;
  font-size: 11px;
  color: var(--brown-soft);
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--cream-warm);
  border-bottom: 1px solid var(--beige-line);
  border-right: 1px solid var(--beige-line);
}
.cal-dow:nth-child(7n) { border-right: none; }
.cal-cell {
  min-height: 96px;
  padding: 6px 8px;
  border-right: 1px solid var(--beige-line);
  border-bottom: 1px solid var(--beige-line);
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #fff;
  overflow: hidden;
}
.cal-cell:nth-child(7n + 7) { border-right: none; }
.cal-cell.is-other { background: var(--cream-warm); color: var(--brown-soft); }
.cal-cell.is-other .cal-day { color: var(--brown-soft); opacity: .6; }
.cal-day {
  font-size: 12px;
  font-weight: 600;
  color: var(--brown-2);
}
.cal-today-badge {
  display: inline-block;
  background: var(--terracotta);
  color: #fff;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 700;
}
.cal-item {
  font-size: 11px;
  background: var(--brown-2);
  color: #fff;
  border-radius: 6px;
  padding: 3px 7px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: filter .12s ease;
  font-weight: 500;
}
.cal-item:hover { filter: brightness(1.1); }
.cal-item.cs-confirmed { background: #3b6eb5; }
.cal-item.cs-pending { background: #b88404; }
.cal-item.cs-done { background: #5b8a47; }
.cal-item.cs-cancelled { background: #888; opacity: .7; }
.cal-item.cs-published { background: #5b8a47; }
.cal-item.cs-scheduled { background: #b88404; }
.cal-item.cs-draft { background: #888; }

/* ---------- Checkbox group (used in Post Edit modal) ---------- */
.checkbox-group {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  padding: 8px 0;
}
.checkbox-group label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--brown-1);
  cursor: pointer;
}
.checkbox-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--terracotta);
  cursor: pointer;
}

@media (max-width: 700px) {
  .cal-cell { min-height: 72px; }
  .cal-item { font-size: 10px; }
}

/* ---------- Week / N-day calendar ---------- */
.cal-week-grid {
  display: grid;
  grid-template-columns: repeat(var(--cal-cols, 7), 1fr);
  min-height: 420px;
}
.cal-week-col {
  border-right: 1px solid var(--beige-line);
  background: #fff;
  display: flex;
  flex-direction: column;
}
.cal-week-col:last-child { border-right: none; }
.cal-week-col.is-today { background: #fff8ee; }
.cal-week-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--beige-line);
  background: var(--cream-warm);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cal-week-col.is-today .cal-week-head { background: #ffe7c8; }
.cal-week-dow {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--brown-soft);
  letter-spacing: .05em;
  font-weight: 600;
}
.cal-week-day {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--brown-1);
}
.cal-week-items {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  flex: 1;
}
.cal-item .cal-item-time {
  font-size: 10px;
  opacity: .9;
  font-weight: 700;
}
.cal-item .cal-item-label {
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
  white-space: normal;
}
.cal-item .cal-item-sub {
  font-size: 10px;
  opacity: .85;
  margin-top: 1px;
  white-space: normal;
}
/* Week-view items get richer pills (multi-line). Override the single-line month-view defaults. */
.cal-week-items .cal-item {
  white-space: normal;
  padding: 6px 8px;
}

/* ---------- Detail modal: view mode ---------- */
.detail-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.detail-view-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  align-items: baseline;
}
.detail-view-label {
  font-size: 11px;
  color: var(--brown-soft);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.detail-view-value {
  font-size: 14px;
  color: var(--brown-1);
  white-space: pre-wrap;
  word-break: break-word;
}
.detail-view-value.is-empty {
  color: var(--brown-soft);
  font-style: italic;
}
.detail-view-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* View/edit toggle inside a modal */
.modal.is-editing .modal-view-body,
.modal.is-editing .modal-view-foot { display: none; }
.modal:not(.is-editing) .modal-edit-body,
.modal:not(.is-editing) .modal-edit-foot { display: none; }

/* ---------- Media list + uploader in post modal ---------- */
/* Responsive grid: cards grow to fill the container width, each item is a
   square frame holding the image/video edge-to-edge (no inner padding). */
.media-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 4px;
}
.media-item {
  position: relative;
  border-radius: 10px;
  border: 1px solid var(--beige-line);
  overflow: hidden;
  background: var(--cream-warm);
  aspect-ratio: 1 / 1;
}
.media-item img,
.media-item video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Darkening gradient appears on hover so the overlay buttons stay readable
   against any photo. */
.media-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0) 55%);
  opacity: 0;
  transition: opacity 150ms ease;
  pointer-events: none;
}
.media-item:hover::after,
.media-item:focus-within::after { opacity: 1; }

/* File fallback when we can't render a thumbnail. */
.media-item-file {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px;
  color: var(--brown-2);
}
.media-file-icon { font-size: 28px; }
.media-file-name {
  font-size: 11px;
  text-align: center;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Play badge centered on video thumbnails. */
.media-video-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* Filename chip — top-left, only visible on hover. */
.media-label {
  position: absolute;
  top: 8px;
  left: 8px;
  max-width: calc(100% - 16px);
  padding: 3px 8px;
  font-size: 10.5px;
  font-weight: 500;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 150ms ease;
  pointer-events: none;
  z-index: 2;
}
.media-item:hover .media-label,
.media-item:focus-within .media-label { opacity: 1; }

/* Download button — bottom-right, only visible on hover. */
.media-download {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  color: var(--brown-1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: opacity 150ms ease, background 120ms ease, color 120ms ease, transform 120ms ease;
  z-index: 2;
}
.media-download svg { width: 14px; height: 14px; display: block; }
.media-item:hover .media-download,
.media-download:focus-visible { opacity: 1; }
.media-download:hover {
  background: var(--terracotta);
  color: #fff;
  transform: translateY(-1px);
}
/* Touch devices have no real "hover" state — keep the download button
   visible so the action is still discoverable. */
@media (hover: none) {
  .media-download { opacity: 1; }
  .media-label { opacity: 1; }
  .media-item::after { opacity: 1; }
}

.media-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  border-radius: 999px;
  width: 24px;
  height: 24px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 3;
}
.media-empty {
  font-size: 12px;
  color: var(--brown-soft);
  font-style: italic;
}
.file-picker-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.file-picker-row input[type="file"] {
  font-size: 13px;
  font-family: var(--font-body);
  color: var(--brown-2);
}
.file-picker-row .file-picker-hint {
  font-size: 11px;
  color: var(--brown-soft);
}

/* ---------- Drag-and-drop upload zone (multi-file) ---------- */
.upload-zone {
  border: 2px dashed var(--beige-line);
  border-radius: var(--radius-md);
  padding: 24px 18px;
  text-align: center;
  background: var(--cream-warm);
  transition: border-color .15s ease, background .15s ease;
  cursor: pointer;
  margin-top: 8px;
}
.upload-zone:hover {
  border-color: var(--terracotta-l, var(--terracotta));
}
.upload-zone.is-dragover {
  border-color: var(--terracotta);
  background: #fff5ec;
}
.upload-zone-icon {
  width: 36px;
  height: 36px;
  color: var(--brown-soft);
  margin: 0 auto 6px;
  display: block;
}
.upload-zone-title {
  margin: 4px 0 0;
  font-weight: 700;
  color: var(--brown-1);
  font-size: 14px;
}
.upload-zone-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--brown-soft);
}
.upload-zone-sub button {
  background: transparent;
  border: none;
  color: var(--terracotta);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.upload-zone-hint {
  margin-top: 6px;
  font-size: 11px;
  color: var(--brown-soft);
  font-style: italic;
}
.upload-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  justify-content: center;
}
.upload-preview:empty { display: none; }

/* "X files queued · 12 MB · will upload on Save" — green checkmark style
   so it's immediately obvious that files have been picked up. */
.upload-summary {
  margin: 10px auto 0;
  padding: 8px 12px;
  background: rgba(42, 107, 42, 0.10);
  color: #2a6b2a;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  display: inline-block;
}
.upload-summary::before {
  content: '✓';
  margin-right: 6px;
  font-weight: 700;
}
.upload-zone.has-queue {
  border-color: rgba(42, 107, 42, 0.45);
  background: rgba(42, 107, 42, 0.04);
}

/* Save button progress state — spinner + slight opacity dip so it's
   obvious the form is busy. */
button.is-busy {
  position: relative;
  pointer-events: none;
}
button.is-busy::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  vertical-align: -2px;
  animation: btn-spin 0.8s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
.upload-preview-item {
  position: relative;
  width: 78px;
  height: 78px;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--beige-line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--brown-2);
  text-align: center;
  padding: 4px;
  word-break: break-word;
}
.upload-preview-item img,
.upload-preview-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.upload-preview-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  background: rgba(0, 0, 0, .7);
  color: #fff;
  border: none;
  border-radius: 999px;
  width: 20px;
  height: 20px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}
.upload-preview-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 9px;
  padding: 2px 4px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

/* ---------- Copy buttons in the detail modal ---------- */
.detail-view-row {
  grid-template-columns: 100px 1fr auto;
}
.detail-copy-btn {
  background: transparent;
  border: 1px solid var(--beige-line);
  color: var(--brown-soft);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  align-self: start;
  font-family: var(--font-body);
  transition: background .12s ease, color .12s ease, border-color .12s ease;
  white-space: nowrap;
}
.detail-copy-btn:hover {
  background: var(--cream-warm);
  color: var(--brown-1);
}
.detail-copy-btn.is-copied {
  background: #e0f3e1;
  color: #1f7a31;
  border-color: #aad5af;
}
.modal-head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.modal-head-actions .detail-copy-btn {
  font-size: 12px;
  padding: 5px 12px;
}
.copy-all-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--beige-line);
}
