/* ──────────────────────────────────────────────────────────────────────────
   Chas Everitt Studio — Design System
   Navy #182F58 | Blue #2C5697 | Red #E00034 | Ink #161B22 | Grey #68717D
   Off-white #F8F9FB | Font: Raleway
────────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@300;400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:      #182F58;
  --blue:      #2C5697;
  --red:       #E00034;
  --ink:       #161B22;
  --grey:      #68717D;
  --light-grey:#A8B0BB;
  --off-white: #F8F9FB;
  --white:     #FFFFFF;
  --border:    #E2E6ED;
  --shadow-sm: 0 1px 3px rgba(24,47,88,.08);
  --shadow:    0 4px 16px rgba(24,47,88,.12);
  --shadow-lg: 0 8px 32px rgba(24,47,88,.16);
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
  --transition:150ms ease;
  --sidebar-w: 260px;
  --topbar-h:  60px;
}

html { font-size: 14px; }
body {
  font-family: 'Raleway', system-ui, sans-serif;
  background: var(--off-white);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Typography ─────────────────────────────────────────────────────────── */
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.35rem; font-weight: 700; }
h3 { font-size: 1.1rem;  font-weight: 600; }
h4 { font-size: 0.95rem; font-weight: 600; }
p  { line-height: 1.6; color: var(--grey); }
a  { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout — Dashboard ──────────────────────────────────────────────────── */
#app { display: flex; flex-direction: column; height: 100vh; }

/* Top bar */
#topbar {
  height: var(--topbar-h);
  background: var(--navy);
  color: var(--white);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
  position: relative;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.topbar-logo {
  width: 32px; height: 32px;
  background: var(--red);
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: 1rem; font-weight: 800;
}
.topbar-brand span { color: var(--light-grey); font-weight: 400; font-size: .8rem; margin-left:4px; }
.topbar-spacer { flex: 1; }
.topbar-search {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  width: 220px;
  color: var(--white);
}
.topbar-search input {
  background: none; border: none; outline: none;
  color: var(--white); font-family: inherit; font-size: .85rem; width: 100%;
}
.topbar-search input::placeholder { color: rgba(255,255,255,.5); }
.topbar-search svg { opacity: .5; flex-shrink: 0; }
.topbar-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-family: inherit; font-size: .82rem; font-weight: 600;
  cursor: pointer; transition: background var(--transition);
  white-space: nowrap;
}
.topbar-btn:hover { background: rgba(255,255,255,.18); }
.topbar-btn.primary { background: var(--red); border-color: transparent; }
.topbar-btn.primary:hover { background: #c0002c; }
.topbar-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--blue); color: var(--white);
  display: grid; place-items: center;
  font-size: .75rem; font-weight: 700;
  cursor: pointer;
}

/* Main body area */
#main { flex: 1; overflow: hidden; display: flex; }

/* ── Sidebar (editor only) ─────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}
.sidebar-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: .8rem; text-transform: uppercase;
  letter-spacing: .07em; color: var(--grey);
}
.section-tree { flex: 1; overflow-y: auto; padding: 8px 0; }
.section-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px;
  cursor: pointer;
  border-radius: 0;
  transition: background var(--transition);
  font-size: .88rem; font-weight: 500;
  color: var(--ink);
  user-select: none;
}
.section-item:hover { background: var(--off-white); }
.section-item.active { background: #EBF0FB; color: var(--blue); font-weight: 700; border-left: 3px solid var(--blue); }
.section-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--light-grey); flex-shrink: 0;
}
.section-item.active .section-dot { background: var(--blue); }
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

/* ── Content area ─────────────────────────────────────────────────────── */
#content { flex: 1; overflow: hidden; display: flex; flex-direction: column; }

/* ── Pages Dashboard ─────────────────────────────────────────────────── */
#view-dashboard {
  flex: 1; overflow-y: auto; padding: 32px 36px;
}
.dash-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px;
}
.dash-header h1 { color: var(--ink); }
.dash-header p  { font-size: .9rem; margin-top: 4px; }
.dash-controls {
  display: flex; align-items: center; gap: 10px;
}

/* Stats row */
.stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.stat-card .stat-val { font-size: 1.8rem; font-weight: 800; color: var(--navy); line-height: 1; }
.stat-card .stat-label { font-size: .8rem; color: var(--grey); margin-top: 4px; font-weight: 500; }
.stat-card .stat-delta { font-size: .78rem; color: #16a34a; margin-top: 6px; font-weight: 600; }

/* Table */
.table-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}
.table-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.table-toolbar h3 { font-size: 1rem; }
.filter-tabs { display: flex; gap: 4px; }
.filter-tab {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: none;
  font-family: inherit; font-size: .8rem; font-weight: 600;
  cursor: pointer; color: var(--grey);
  transition: all var(--transition);
}
.filter-tab.active { background: var(--navy); color: var(--white); border-color: var(--navy); }
.filter-tab:hover:not(.active) { background: var(--off-white); }

table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 11px 16px;
  text-align: left; font-size: .75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--grey); background: var(--off-white);
  border-bottom: 1px solid var(--border);
}
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  cursor: default;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #F5F7FB; }
tbody td { padding: 13px 16px; font-size: .88rem; vertical-align: middle; }

/* Status pills */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: .75rem; font-weight: 700; white-space: nowrap;
}
.pill::before { content:''; width:6px; height:6px; border-radius:50%; }
.pill-draft       { background:#F0F2F5; color:#68717D; }
.pill-draft::before { background:#68717D; }
.pill-intest      { background:#FFF3CD; color:#92640A; }
.pill-intest::before { background:#F59E0B; }
.pill-scheduled   { background:#EDE9FE; color:#5B21B6; }
.pill-scheduled::before { background:#7C3AED; }
.pill-live        { background:#DCFCE7; color:#166534; }
.pill-live::before { background:#16A34A; }

/* Row actions */
.row-actions { display: flex; gap: 6px; }
.btn-icon {
  padding: 5px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: none;
  font-family: inherit; font-size: .78rem; font-weight: 600;
  cursor: pointer; color: var(--grey);
  transition: all var(--transition); white-space: nowrap;
}
.btn-icon:hover { border-color: var(--blue); color: var(--blue); background: #EBF0FB; }
.btn-icon.btn-edit { background: var(--navy); color: var(--white); border-color: var(--navy); }
.btn-icon.btn-edit:hover { background: var(--blue); border-color: var(--blue); }
.btn-icon.btn-deploy { background: var(--red); color: var(--white); border-color: var(--red); }
.btn-icon.btn-deploy:hover { background: #c0002c; }

/* Empty state */
.empty-state {
  padding: 48px 24px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.empty-state .empty-icon { font-size: 2.5rem; opacity: .4; }
.empty-state h3 { color: var(--grey); }
.empty-state p  { max-width: 300px; font-size: .85rem; }

/* ── Editor layout ─────────────────────────────────────────────────────── */
#view-editor { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* Editor top bar */
.editor-topbar {
  height: 52px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 16px; gap: 12px;
  flex-shrink: 0;
}
.editor-page-name { font-weight: 700; font-size: 1rem; }
.editor-page-name .unsaved { color: var(--red); font-size: .75rem; margin-left: 6px; }
.editor-spacer { flex: 1; }
.device-toggle { display: flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.device-btn {
  padding: 5px 10px; border: none; background: none;
  cursor: pointer; font-size: .82rem; color: var(--grey);
  font-family: inherit; font-weight: 600;
  transition: all var(--transition);
}
.device-btn.active { background: var(--navy); color: var(--white); }
.editor-action-btn {
  padding: 6px 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: none; font-family: inherit; font-size: .82rem; font-weight: 600;
  cursor: pointer; color: var(--ink);
  transition: all var(--transition); white-space: nowrap;
}
.editor-action-btn:hover { background: var(--off-white); }
.editor-action-btn:disabled { opacity: .4; cursor: not-allowed; }
.editor-action-btn.save { background: var(--navy); color: var(--white); border-color: var(--navy); }
.editor-action-btn.save:hover { background: var(--blue); }
.deploy-dropdown { position: relative; }
.deploy-btn-main {
  padding: 6px 14px;
  background: var(--red); color: var(--white); border: none;
  border-radius: var(--radius-sm);
  font-family: inherit; font-size: .82rem; font-weight: 700;
  cursor: pointer; transition: background var(--transition);
  white-space: nowrap;
}
.deploy-btn-main:hover { background: #c0002c; }
.deploy-menu {
  position: absolute; top: calc(100% + 4px); right: 0;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  min-width: 180px; z-index: 200; overflow: hidden;
  display: none;
}
.deploy-menu.open { display: block; }
.deploy-menu-item {
  padding: 10px 16px; cursor: pointer; font-size: .86rem; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
  transition: background var(--transition); color: var(--ink);
}
.deploy-menu-item:hover { background: var(--off-white); }
.deploy-menu-item .dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }

/* Editor body */
.editor-body { flex: 1; display: flex; overflow: hidden; }

/* Preview pane */
#preview-pane {
  flex: 1; overflow-y: auto;
  background: #E8ECF1;
  display: flex; justify-content: center; padding: 20px;
}
.preview-frame {
  background: var(--white);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius);
  overflow: hidden;
  transition: width .3s ease;
  width: 100%;
  max-width: 1200px;
}
.preview-frame.tablet  { max-width: 768px; }
.preview-frame.mobile  { max-width: 390px; }

/* Real-page iframe preview: fill the pane height and scroll inside the iframe */
#preview-pane:has(.cms-live-iframe) { padding: 0; }
.preview-frame:has(.cms-live-iframe) {
  max-width: 100%;
  height: 100%;
  align-self: stretch;
  border-radius: 0;
}
.preview-frame.tablet:has(.cms-live-iframe) { max-width: 768px; border-radius: var(--radius); }
.preview-frame.mobile:has(.cms-live-iframe) { max-width: 390px; border-radius: var(--radius); }
.cms-live-iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 640px;
  border: 0;
  background: var(--white);
}

/* Inspector pane */
#inspector-pane {
  width: 280px; flex-shrink: 0;
  background: var(--white);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.inspector-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: .8rem; text-transform: uppercase;
  letter-spacing: .07em; color: var(--grey);
  display: flex; justify-content: space-between; align-items: center;
}
.inspector-body { padding: 16px; flex: 1; }
.inspector-empty { color: var(--light-grey); font-size: .85rem; text-align: center; padding: 32px 16px; }
.field-group { margin-bottom: 18px; }
.field-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--grey); margin-bottom: 6px; }
.field-input {
  width: 100%; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: .86rem; color: var(--ink);
  background: var(--off-white); resize: vertical;
  transition: border-color var(--transition);
}
.field-input:focus { outline: none; border-color: var(--blue); background: var(--white); }
.field-textarea { min-height: 80px; }
.field-image-preview { width: 100%; border-radius: var(--radius-sm); margin-top: 8px; display: block; }
.inspector-apply-btn {
  width: 100%; padding: 9px;
  background: var(--navy); color: var(--white);
  border: none; border-radius: var(--radius-sm);
  font-family: inherit; font-size: .86rem; font-weight: 700;
  cursor: pointer; transition: background var(--transition);
  margin-top: 8px;
}
.inspector-apply-btn:hover { background: var(--blue); }
.pick-image-btn {
  width: 100%; padding: 8px;
  border: 1px dashed var(--border); border-radius: var(--radius-sm);
  background: none; font-family: inherit; font-size: .82rem;
  color: var(--blue); cursor: pointer; margin-top: 8px;
  transition: all var(--transition);
}
.pick-image-btn:hover { background: #EBF0FB; border-color: var(--blue); }

/* ── Preview content sections ─────────────────────────────────────────── */
.preview-section {
  cursor: pointer; position: relative;
  transition: outline var(--transition);
}
.preview-section:hover { outline: 2px dashed rgba(44,86,151,.3); outline-offset: -2px; }
.preview-section.selected { outline: 2px solid var(--blue); outline-offset: -2px; }
.preview-section .section-label {
  position: absolute; top: 8px; left: 8px;
  background: var(--blue); color: var(--white);
  font-size: .65rem; font-weight: 700; padding: 2px 7px;
  border-radius: 4px; opacity: 0; pointer-events: none;
  transition: opacity var(--transition); z-index: 10;
}
.preview-section:hover .section-label,
.preview-section.selected .section-label { opacity: 1; }

/* Hero section in preview */
.prev-hero {
  min-height: 420px;
  background: linear-gradient(135deg, var(--navy) 0%, #1a3b6e 100%);
  padding: 60px 48px;
  display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden;
  color: var(--white);
}
.prev-hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: .35;
}
.prev-hero-content { position: relative; z-index: 1; max-width: 600px; }
.prev-hero h1 { font-size: 2.2rem; font-weight: 800; line-height: 1.15; margin-bottom: 16px; color: var(--white); }
.prev-hero p  { font-size: 1.1rem; color: rgba(255,255,255,.85); margin-bottom: 28px; }
.prev-hero-cta {
  display: inline-block; padding: 12px 28px;
  background: var(--red); color: var(--white);
  border-radius: var(--radius-sm); font-weight: 700; font-size: .9rem;
}
.prev-chas-bar {
  background: var(--navy); padding: 8px 48px;
  display: flex; align-items: center; gap: 16px;
  color: rgba(255,255,255,.6); font-size: .75rem;
}
.prev-chas-bar-logo { color: var(--white); font-weight: 800; font-size: .9rem; margin-right: auto; }

/* Selling section */
.prev-selling { padding: 48px 48px; background: var(--white); }
.prev-selling h2 { color: var(--navy); font-size: 1.6rem; margin-bottom: 6px; }
.prev-selling .sub { color: var(--grey); margin-bottom: 28px; }
.prev-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.prev-card {
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid var(--border);
}
.prev-card img { width: 100%; height: 120px; object-fit: cover; display: block; }
.prev-card-body { padding: 12px 14px; }
.prev-card-body h4 { color: var(--navy); }
.prev-card-body p { font-size: .8rem; color: var(--grey); margin-top: 2px; }

/* Why Chas */
.prev-why {
  padding: 52px 48px;
  background: linear-gradient(135deg, var(--navy) 0%, #1a3b6e 100%);
  position: relative; overflow: hidden; color: var(--white);
}
.prev-why-bg { position:absolute; inset:0; background-size:cover; background-position:center; opacity:.15; }
.prev-why-content { position:relative; z-index:1; }
.prev-why h2 { color: var(--white); font-size: 1.6rem; margin-bottom: 12px; }
.prev-why p  { color: rgba(255,255,255,.8); max-width: 640px; margin-bottom: 28px; }
.prev-stats { display: flex; gap: 32px; }
.prev-stat .val { font-size: 1.8rem; font-weight: 800; color: var(--white); }
.prev-stat .lbl { font-size: .8rem; color: rgba(255,255,255,.6); }

/* Paths */
.prev-paths { padding: 48px 48px; background: var(--off-white); }
.prev-paths h2 { color: var(--navy); text-align: center; margin-bottom: 28px; font-size: 1.5rem; }
.prev-path-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.prev-path-card {
  background: var(--white); border-radius: var(--radius);
  padding: 24px 20px; text-align: center;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.prev-path-card:hover { box-shadow: var(--shadow); }
.prev-path-card .icon { font-size: 1.8rem; margin-bottom: 10px; }
.prev-path-card h4 { color: var(--navy); margin-bottom: 6px; }
.prev-path-card p  { font-size: .8rem; }

/* Testimonials */
.prev-testimonials { padding: 48px 48px; background: var(--white); }
.prev-testimonials h2 { color: var(--navy); font-size: 1.5rem; margin-bottom: 24px; }
.prev-testimonial-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.prev-testimonial {
  background: var(--off-white); border-radius: var(--radius);
  padding: 18px 16px; border: 1px solid var(--border);
}
.prev-testimonial p  { font-size: .88rem; color: var(--ink); font-style: italic; margin-bottom: 10px; }
.prev-testimonial .author { font-size: .78rem; font-weight: 700; color: var(--navy); }
.prev-testimonial .location { font-size: .72rem; color: var(--grey); }

/* News */
.prev-news { padding: 48px 48px; background: var(--off-white); }
.prev-news h2 { color: var(--navy); font-size: 1.5rem; margin-bottom: 20px; }
.prev-news-items { display: flex; gap: 14px; }
.prev-news-item { flex: 1; background: var(--white); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.prev-news-item-img { height: 90px; background: var(--navy); }
.prev-news-item-body { padding: 10px 12px; }
.prev-news-item-body h4 { font-size: .85rem; color: var(--navy); }
.prev-news-item-body p { font-size: .75rem; margin-top: 4px; }

/* Contact */
.prev-contact { padding: 48px 48px; background: var(--navy); color: var(--white); }
.prev-contact h2 { color: var(--white); font-size: 1.5rem; margin-bottom: 8px; }
.prev-contact p  { color: rgba(255,255,255,.7); margin-bottom: 20px; }
.prev-contact-row { display: flex; gap: 20px; }
.prev-contact-item { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: rgba(255,255,255,.8); }
.prev-contact-item .ci { font-weight: 700; color: var(--white); }

/* Footer */
.prev-footer { background: var(--ink); padding: 24px 48px; color: rgba(255,255,255,.5); font-size: .8rem; }
.prev-footer-row { display: flex; justify-content: space-between; align-items: center; }
.prev-footer-brand { font-weight: 800; color: var(--white); }
.prev-footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.prev-footer-links a { color: rgba(255,255,255,.5); font-size: .78rem; }
.prev-footer-links a:hover { color: var(--white); }

/* ── Media Library Modal ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(22,27,34,.55);
  z-index: 900;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 900px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.modal-header h2 { font-size: 1.1rem; }
.modal-close {
  width: 30px; height: 30px; border-radius: 50%;
  border: none; background: var(--off-white);
  cursor: pointer; font-size: 1.1rem; color: var(--grey);
  display: grid; place-items: center;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--border); color: var(--ink); }
.modal-toolbar {
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
}
.modal-search {
  flex: 1; padding: 7px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: .86rem;
  background: var(--off-white);
}
.modal-search:focus { outline: none; border-color: var(--blue); }
.tag-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.tag-btn {
  padding: 4px 10px; border-radius: 20px;
  border: 1px solid var(--border); background: none;
  font-family: inherit; font-size: .75rem; font-weight: 600;
  cursor: pointer; color: var(--grey); transition: all var(--transition);
}
.tag-btn.active { background: var(--blue); color: var(--white); border-color: var(--blue); }
.tag-btn:hover:not(.active) { background: var(--off-white); }
.modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.media-item {
  border-radius: var(--radius); border: 2px solid var(--border);
  overflow: hidden; cursor: pointer;
  transition: all var(--transition); background: var(--off-white);
}
.media-item:hover { border-color: var(--blue); box-shadow: var(--shadow); }
.media-item.selected { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(44,86,151,.3); }
.media-item img { width: 100%; height: 110px; object-fit: cover; display: block; }
.media-item-info { padding: 8px 10px; }
.media-item-info .fname { font-size: .75rem; font-weight: 600; color: var(--ink); word-break: break-all; }
.media-item-info .dims  { font-size: .7rem; color: var(--grey); }
.media-item-info .tags  { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.media-item-info .mtag  { background: #EBF0FB; color: var(--blue); font-size: .65rem; padding: 1px 5px; border-radius: 3px; font-weight: 600; }
.media-item-info .usage { font-size: .68rem; color: var(--grey); margin-top: 3px; }
.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.upload-drop-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 24px; text-align: center; cursor: pointer;
  transition: all var(--transition); margin-bottom: 16px;
  color: var(--grey); font-size: .85rem;
}
.upload-drop-zone:hover, .upload-drop-zone.drag-over { border-color: var(--blue); background: #EBF0FB; color: var(--blue); }
.upload-drop-zone input[type=file] { display: none; }

/* ── Version History Modal ───────────────────────────────────────────── */
.version-timeline { padding: 0; list-style: none; }
.version-item {
  padding: 14px 0; display: flex; gap: 14px; align-items: flex-start;
  border-bottom: 1px solid var(--border); position: relative;
}
.version-item:last-child { border-bottom: none; }
.version-dot {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--off-white); border: 2px solid var(--border);
  display: grid; place-items: center; flex-shrink: 0; font-size: .8rem;
}
.version-dot.current { background: var(--blue); border-color: var(--blue); color: var(--white); }
.version-body { flex: 1; }
.version-meta { font-size: .78rem; color: var(--grey); margin-top: 2px; }
.version-note { font-size: .86rem; font-weight: 600; color: var(--ink); }
.version-actions { display: flex; gap: 6px; margin-top: 6px; }
.ver-btn {
  padding: 3px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: none;
  font-family: inherit; font-size: .75rem; font-weight: 600;
  cursor: pointer; color: var(--grey); transition: all var(--transition);
}
.ver-btn:hover { border-color: var(--blue); color: var(--blue); }
.ver-btn.rollback-btn { color: var(--red); }
.ver-btn.rollback-btn:hover { border-color: var(--red); background: #FFF0F3; }

/* Diff view */
.diff-table { width: 100%; font-size: .78rem; border-collapse: collapse; margin-top: 10px; }
.diff-table th { padding: 6px 10px; text-align: left; background: var(--off-white); font-size: .72rem; color: var(--grey); border: 1px solid var(--border); }
.diff-table td { padding: 6px 10px; border: 1px solid var(--border); vertical-align: top; }
.diff-before { background: #FFF0F3; color: #9B1C1C; font-family: monospace; }
.diff-after  { background: #F0FDF4; color: #166534; font-family: monospace; }
.diff-field  { color: var(--grey); font-size: .7rem; word-break: break-all; }

/* ── Schedule Modal ──────────────────────────────────────────────────── */
.schedule-form { padding: 20px 0; display: flex; flex-direction: column; gap: 16px; }
.schedule-form label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--grey); display: block; margin-bottom: 6px; }
.schedule-form input[type=datetime-local] {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: .9rem;
  background: var(--off-white);
}
.schedule-form input:focus { outline: none; border-color: var(--blue); }
.countdown-badge {
  background: #EDE9FE; color: #5B21B6;
  border-radius: var(--radius-sm); padding: 8px 12px;
  font-size: .85rem; font-weight: 600; text-align: center;
}

/* ── Deploy Log ──────────────────────────────────────────────────────── */
.deploy-log-list { list-style: none; padding: 0; }
.deploy-log-item {
  padding: 12px 16px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--white);
  margin-bottom: 8px; display: flex; gap: 12px; align-items: center;
}
.deploy-log-env { width: 70px; flex-shrink: 0; }
.deploy-log-body { flex: 1; }
.deploy-log-body .log-note { font-size: .88rem; font-weight: 600; }
.deploy-log-body .log-meta { font-size: .75rem; color: var(--grey); margin-top: 2px; }
.deploy-log-actions { display: flex; gap: 6px; }

/* ── Confirm Dialog ──────────────────────────────────────────────────── */
.confirm-overlay {
  position: fixed; inset: 0;
  background: rgba(22,27,34,.6);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.confirm-dialog {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 28px 32px; max-width: 420px; width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.confirm-dialog .confirm-icon { font-size: 2.5rem; margin-bottom: 12px; }
.confirm-dialog h3 { margin-bottom: 8px; color: var(--ink); }
.confirm-dialog p  { font-size: .88rem; margin-bottom: 24px; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }
.btn-confirm {
  padding: 9px 24px; border-radius: var(--radius-sm);
  border: none; font-family: inherit; font-size: .88rem; font-weight: 700;
  cursor: pointer; transition: all var(--transition);
}
.btn-confirm.danger  { background: var(--red); color: var(--white); }
.btn-confirm.danger:hover  { background: #c0002c; }
.btn-confirm.primary { background: var(--navy); color: var(--white); }
.btn-confirm.primary:hover { background: var(--blue); }
.btn-confirm.cancel  { background: var(--off-white); color: var(--grey); border: 1px solid var(--border); }
.btn-confirm.cancel:hover  { background: var(--border); }

/* ── Toast ───────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 2000;
}
.toast {
  padding: 12px 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: .86rem; font-weight: 600;
  display: flex; align-items: center; gap: 10px;
  min-width: 260px; max-width: 360px;
  animation: slideIn .25s ease;
  color: var(--white);
}
.toast.success { background: #16a34a; }
.toast.error   { background: var(--red); }
.toast.info    { background: var(--navy); }
.toast.warning { background: #d97706; }
@keyframes slideIn {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes slideOut {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(40px); opacity: 0; }
}
.toast.hiding { animation: slideOut .25s ease forwards; }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  padding: 9px 20px; border-radius: var(--radius-sm);
  border: none; font-family: inherit; font-size: .88rem; font-weight: 700;
  cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
  transition: all var(--transition); white-space: nowrap;
}
.btn-primary   { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--blue); }
.btn-danger    { background: var(--red);  color: var(--white); }
.btn-danger:hover  { background: #c0002c; }
.btn-secondary { background: var(--off-white); color: var(--ink); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-ghost     { background: none; color: var(--blue); border: none; padding: 0; font-weight: 600; font-size: .86rem; cursor: pointer; }
.btn-ghost:hover { text-decoration: underline; }

/* ── Deploy Log page ─────────────────────────────────────────────────── */
#view-deploylog { flex: 1; overflow-y: auto; padding: 32px 36px; }

/* ── Search highlights ───────────────────────────────────────────────── */
.search-result-item {
  padding: 10px 14px; border-radius: var(--radius-sm);
  cursor: pointer; display: flex; gap: 10px; align-items: center;
  transition: background var(--transition);
}
.search-result-item:hover { background: var(--off-white); }
.search-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  max-height: 320px; overflow-y: auto; z-index: 500;
}

/* ── Scrollbars ──────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--light-grey); }

/* ── Misc helpers ─────────────────────────────────────────────────────── */
.hidden   { display: none !important; }
.text-red { color: var(--red); }
.text-blue { color: var(--blue); }
.text-grey { color: var(--grey); }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8 { gap: 8px; }
.mb-0 { margin-bottom: 0; }
.mt-8 { margin-top: 8px; }
.fw-700 { font-weight: 700; }
.fs-sm  { font-size: .82rem; }
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  #inspector-pane { width: 240px; }
  .prev-hero { padding: 40px 24px; }
  .prev-selling, .prev-why, .prev-paths, .prev-testimonials, .prev-news, .prev-contact, .prev-footer { padding: 36px 24px; }
}
@media (max-width: 900px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .prev-cards, .prev-path-cards, .prev-testimonial-grid { grid-template-columns: 1fr 1fr; }
  .prev-news-items { flex-direction: column; }
}
