/*
 * "Atlas" theme — deep pine-teal with a marigold map-pin accent.
 * (Was red; before that navy/violet. Originals in .backups/before-atlas-theme-*
 * and .backups/before-red-theme-*.)
 * Loaded after app.css. Rules here are unlayered, so they win over app.css's
 * @layer rules regardless of specificity. Swap/remove the <link> in index.php
 * to revert.
 *
 * Teal carries actions and highlights; marigold is used sparingly (brand mark,
 * active nav marker, "scheduled" pills); red is kept for real errors only.
 * The --px-* names are historical (from the navy theme).
 */

@import url("https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&display=swap");

:root {
  color-scheme: light;

  --px-navy: #0c2b2e;
  --px-navy-2: #143b3e;
  --px-navy-active: #1c4d50;
  --px-navy-line: #ffffff14;
  --px-heading: #0f3537;
  --px-brand: #0e7471;
  --px-brand-hover: #0a5b59;
  --px-tint-bg: #e8f4f3;
  --px-tint-line: #b6ddd9;
  --px-tint-text: #0a5b59;
  --px-lav-bg: #eef7f6;
  --px-lav-line: #c8e5e1;
  --px-cyan-bg: #fff6e5;
  --px-cyan-line: #f6d49b;
  --px-cyan-text: #9a5a00;
  --px-line: #e2ebea;
  --px-line-strong: #d0dedd;
  --px-row-hover: #f4f9f8;
  --px-accent: #f2a33a;          /* marigold: map-pin accent */
  --px-accent-soft: #f2a33a33;

  --font-sans: "DM Sans", "Segoe UI", system-ui, sans-serif;

  --color-canvas: #fff;
  --color-surface: #fff;
  --color-surface-alt: #f5f9f8;
  --color-surface-hover: var(--px-row-hover);
  --color-glass: #fff;
  --color-sidebar-glass: var(--px-navy);
  --color-line: var(--px-line);
  --color-fg: #1f2b2c;
  --color-muted: #5f7071;
  --color-primary: var(--px-brand);
  --color-primary-dark: var(--px-brand-hover);
  --color-primary-darker: #084846;
  --color-primary-tint: var(--px-tint-bg);
  --color-primary-ink: #fff;
  --color-success-bg: #ecfdf5;
  --color-success-line: #a7f3d0;
  --color-danger: #d23b3b;
  --color-danger-bg: #fff5f5;
  --color-danger-line: #fed7d7;
  --color-idle: #dd6b20;
  --color-recent: #a3b3b3;
  --radius-card: 10px;
  --radius-lg: 8px;
  --radius-md: 6px;
}

::selection { background: #0e747126; color: var(--px-heading); }

* { scrollbar-color: #c9d9d8 transparent; scrollbar-width: thin; }

/* ---------- Canvas: plain white ---------- */

body {
  font-family: var(--font-sans);
  background: #fff;
  color: var(--color-fg);
}

body::before, body::after { display: none; }

.sidebar, .card, .stat-card, .quick-action, .gmb-tabs, .searchable-select-panel {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* Content spans the full width beside the sidebar, like the dashboard */
.dashboard-main { max-width: none; }
.page { max-width: none; }

@media (min-width: 860px) {
  .sidebar { width: 264px; }
}

/* ---------- Type ---------- */

h1, h2, h3, .login-title { color: var(--px-heading); letter-spacing: -.01em; }

.page-header h1, .page-header-left h1, .login-title { font-weight: 700; }

.page-header p, .login-subtitle { color: #4d5f60; }

.card h2, .activity-history-header h2 { font-weight: 700; color: var(--px-heading); }

.stat-value { color: var(--px-heading); font-weight: 700; }

.stat-label, .field label { color: #4d5f60; font-weight: 500; }

a, .link-inline { color: var(--px-brand); }

/* ---------- Panels ---------- */

.card, .stat-card, .gmb-tabs, .quick-action, .login-card {
  background: #fff;
  border: 1px solid var(--px-line);
  border-radius: var(--radius-card);
  box-shadow: 0 1px 2px #0c2b2e0a;
}

.quick-action { transition: border-color .15s ease, box-shadow .15s ease; }
@media (hover: hover) {
  .quick-action:hover { border-color: var(--px-tint-line); box-shadow: 0 4px 14px #0e747114; }
}

/* Icon tiles: lavender square with brand-blue glyph (the "Updates" header tile) */
.quick-action-icon, .recent-item-icon, .gmb-post-thumb-empty {
  background: var(--px-tint-bg);
  border: none;
  color: var(--px-brand);
  border-radius: 10px;
  box-shadow: none;
}

.step {
  background: var(--px-tint-bg);
  color: var(--px-brand);
  border-radius: 8px;
  font-weight: 700;
  box-shadow: none;
}

/* Rows: table-like, separated by hairlines */
.recent-item, .history-item, .employee-row, .client-row, .gmb-post-item,
.gmb-lso-card, .gmb-linked-item, .gmb-match, .gmb-picker,
.card-title-hint, .generated-link-box, .gmb-info-banner {
  background: #fff;
  border-color: var(--px-line);
  box-shadow: none;
}

@media (hover: hover) {
  .recent-item:hover, .history-item:hover, .client-row:hover, .employee-row:hover,
  .gmb-post-item:hover, .gmb-linked-item:hover, .gmb-match:hover {
    background: var(--px-row-hover);
  }
}

.gmb-match.selected {
  background: var(--px-tint-bg);
  border-color: var(--px-brand);
  box-shadow: inset 0 0 0 1px var(--px-brand);
}

/* Team members: white pill with the green status dot, like the avatar rows */
.team-status-chip {
  background: #fff;
  border-color: var(--px-line);
  box-shadow: none;
}

/* Tags: lavender pill (Work Update style) */
.keyword-chip, .card-title-hint {
  background: var(--px-lav-bg);
  border: 1px solid var(--px-lav-line);
  color: var(--px-brand);
  border-radius: 999px;
  font-weight: 600;
}

.searchable-select-panel {
  background: #fff;
  border: 1px solid var(--px-line-strong);
  border-radius: 8px;
  box-shadow: 0 10px 30px #0c2b2e1f;
}
.searchable-select-option.highlighted { background: var(--px-tint-bg); color: var(--px-brand); }

/* ---------- Sidebar: dark navy ---------- */

.sidebar {
  background: var(--px-navy);
  border-right: none;
  box-shadow: none;
}

.sidebar-brand {
  padding-bottom: 1.25rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--px-navy-line);
}

.sidebar-brand-mark {
  background: var(--px-accent);
  color: var(--px-navy);
  border-radius: 8px;
  box-shadow: none;
}

.sidebar-brand-text {
  color: #fff;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: .01em;
}

.sidebar-brand-eyebrow { color: #f2b14c; }

.sidebar-link {
  color: #fff;
  text-transform: uppercase;
  font-size: .9rem;
  font-weight: 600;
  border-radius: 8px;
  transition: background .15s ease;
}
@media (hover: hover) {
  .sidebar-link:hover { background: var(--px-navy-2); color: #fff; }
}
.sidebar-link.active, .sidebar-link.active:hover {
  background: var(--px-navy-active);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--px-accent);
}
.sidebar-link.active .sidebar-link-icon { color: var(--px-accent); }

.sidebar-account { border-color: var(--px-navy-line); }
.sidebar-account-name { color: #fff; font-weight: 700; }

/* Log out styled like the outlined "Back to List" button */
.sidebar-account-logout {
  display: block;
  width: 100%;
  text-align: center;
  padding: .5rem .75rem;
  background: var(--px-navy-2);
  border: 1px solid #2a5c5f;
  border-radius: 6px;
  color: #fff;
  font-size: .82rem;
}
@media (hover: hover) {
  .sidebar-account-logout:hover { background: var(--px-navy-active); color: #fff; }
}

@media not all and (min-width: 860px) {
  .sidebar-brand { padding-bottom: 0; margin-bottom: 0; border-bottom: none; }
}

/* ---------- Inputs ---------- */

select,
.field input[type="text"], .field input[type="url"], .field input[type="password"],
.employee-row input[type="text"], .keyword-chip-add input, .keyword-row input,
.gmb-textarea, .field input.gmb-input,
.searchable-select-trigger, .searchable-select-search {
  background: #fff;
  border: 1px solid var(--px-line-strong);
  border-radius: 6px;
  color: #1f2b2c;
  box-shadow: none;
}

input::placeholder, textarea::placeholder { color: #9aabab; }

select:focus, .field input:focus, .searchable-select-trigger:focus,
.searchable-select-search:focus, :is(.gmb-textarea, .field input.gmb-input):focus,
.employee-row input:focus, .keyword-chip-add input:focus, .keyword-row input:focus {
  outline: none;
  border-color: var(--px-brand);
  box-shadow: 0 0 0 3px #0e74711f;
}

.keyword-chip-area { background: #fff; border-color: var(--px-line-strong); border-radius: 6px; }

.dropzone {
  background: #f7fbfb;
  border: 1.5px dashed var(--px-tint-line);
  border-radius: var(--radius-card);
}
@media (hover: hover) {
  .dropzone:hover { background: var(--px-tint-bg); border-color: var(--px-brand); }
}

/* ---------- Buttons ---------- */

.btn { border-radius: 8px; font-weight: 600; }

/* Solid brand ("+ Add Update") */
.btn.primary {
  background: var(--px-brand);
  color: #fff;
  border: 1px solid var(--px-brand);
  box-shadow: none;
}
@media (hover: hover) {
  .btn.primary:hover { background: var(--px-brand-hover); border-color: var(--px-brand-hover); box-shadow: 0 4px 12px #0e747133; }
}
.btn.primary:disabled {
  background: #9fcfcb;
  border-color: #9fcfcb;
  color: #fff;
  box-shadow: none;
}

/* Pale blue tint ("View" / "Clear Filters") */
.btn.secondary {
  background: var(--px-tint-bg);
  border: 1px solid var(--px-tint-line);
  color: var(--px-tint-text);
  box-shadow: none;
}
@media (hover: hover) {
  .btn.secondary:hover { background: #d6ecea; border-color: #8fcac4; color: var(--px-brand); }
}

.ripple-effect { background-color: #0e747126; }

/* ---------- Tabs / segmented / calendar ---------- */

.gmb-tabs { box-shadow: none; }
@media (hover: hover) { .gmb-tab:hover { background: var(--px-row-hover); } }
.gmb-tab.active {
  background: var(--px-tint-bg);
  color: var(--px-brand);
  box-shadow: inset 0 0 0 1px var(--px-tint-line);
}

.gmb-segmented { background: #f5f9f8; border-color: var(--px-line); border-radius: 8px; }
.gmb-segmented button { border-radius: 6px; }
.gmb-segmented button.active { background: var(--px-brand); color: #fff; box-shadow: none; }

.gmb-calendar-cell { background: #fff; border-color: var(--px-line); border-radius: 8px; box-shadow: none; }
@media (hover: hover) { .gmb-calendar-cell:hover { border-color: var(--px-tint-line); background: #f7fbfb; } }
.gmb-calendar-cell.outside { background: #f5f9f8; opacity: .6; }
.gmb-calendar-cell.today .gmb-calendar-date { background: var(--px-brand); color: #fff; }
.gmb-calendar-cell.selected { border-color: var(--px-brand); box-shadow: inset 0 0 0 1px var(--px-brand); }

/* ---------- Status ---------- */

.status-dot-active { background: #38a169; box-shadow: none; }
.activity-chart-track { background: #e8f0ef; }
.activity-chart-bar { background: var(--px-brand); box-shadow: none; }
.activity-history-dot { box-shadow: none; }

.success-box { background: var(--color-success-bg); border-color: var(--color-success-line); box-shadow: none; }
.success-heading, .success-text { color: #276749; }

.error-banner, .gmb-not-connected {
  background: var(--color-danger-bg);
  border-color: var(--color-danger-line);
  color: #c53030;
  box-shadow: none;
}

/* Status pills reuse the dashboard's tag colours */
.gmb-pill { border-radius: 999px; font-weight: 600; }
.gmb-pill-published, .gmb-event-published { background: #ecfdf5; border-color: #9ae6b4; color: #276749; }
.gmb-pill-failed, .gmb-event-failed { color: #c53030; }
.gmb-pill-failed { background: #fff5f5; border-color: #feb2b2; }
.gmb-pill-scheduled { background: var(--px-cyan-bg); border-color: var(--px-cyan-line); color: var(--px-cyan-text); }

.preview-thumb { border: 1px solid var(--px-line); border-radius: 8px; box-shadow: none; }

/* Recolour the green loader glyph to the brand teal */
.loader-icon { filter: hue-rotate(45deg) saturate(1.1) brightness(.85); }

/* ---------- Manage Clients: search (round icon button, like the chat button) ---------- */

.client-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.client-page-header > div:first-child { min-width: 0; }

.client-search-fab {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-primary-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(14, 116, 113, 0.35), 0 2px 6px rgba(12, 43, 46, 0.15);
  transition: background-color .15s, transform .15s;
}
.client-search-fab:hover { background: var(--color-primary-dark); transform: translateY(-1px); }
.client-search-fab:focus-visible { outline: 3px solid var(--color-primary-tint); outline-offset: 3px; }

.client-search {
  position: relative;
  flex: 0 1 340px;
  min-width: 0;
  animation: client-search-in .15s ease-out;
}
@keyframes client-search-in { from { opacity: 0; transform: scaleX(.92); transform-origin: right; } }

.client-search > .client-search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-primary);
  pointer-events: none;
}

.client-search-input {
  width: 100%;
  height: 52px;
  font: inherit;
  font-size: 1rem;
  padding: 0 3rem 0 2.6rem;
  background: #fff;
  border: 2px solid var(--color-primary);
  border-radius: 999px;
  color: #1f2b2c;
  box-shadow: 0 6px 20px rgba(14, 116, 113, 0.18);
}
.client-search-input::-webkit-search-cancel-button { display: none; }
.client-search-input:focus { outline: none; box-shadow: 0 0 0 4px #0e74711f, 0 6px 20px rgba(14, 116, 113, 0.18); }

.client-search-close {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-primary-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.client-search-close:hover { background: var(--color-primary-dark); }

/* Leave a little room above the client list when a search scrolls to it. */
.client-list-card, .client-form-card { scroll-margin-top: 1rem; }

mark.search-hit {
  background: var(--px-accent-soft);
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}

.client-search-empty {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px dashed var(--px-line-strong);
  border-radius: 10px;
  color: var(--color-muted);
}
.client-search-empty p { margin: 0; }

@media (max-width: 600px) {
  .client-page-header { flex-wrap: wrap; }
  .client-search { flex: 1 1 100%; }
}
