/* ────────────────────────────────────────────────────────────────────
 * Contenteam UI — design tokens + component overrides on top of Bootstrap 5.
 * Source: D:\test-redesign_done.html (validated against existing views).
 * ──────────────────────────────────────────────────────────────────── */

/* ── DESIGN TOKENS ─────────────────────────────────────────────── */
:root {
  --sidebar-bg:   #0f1117;
  --sidebar-w:    224px;

  --bg:           #f7f8fa;
  --surface:      #ffffff;
  --border:       #e3e6eb;
  --border-focus: #2b5ce6;

  --text-primary:   #0f1117;
  --text-secondary: #6b7280;
  --text-muted:     #9ca3af;

  --brand:        #2b5ce6;
  --brand-light:  #eff3ff;
  --brand-dark:   #1a3fb0;
  --accent:       #00cba9;
  --accent-light: #e6faf7;

  --radius:       8px;
  --radius-sm:    6px;
  --radius-lg:    12px;

  --shadow-card:  0 1px 3px rgba(15,17,23,.06), 0 0 0 1px var(--border);
  --shadow-hover: 0 4px 16px rgba(15,17,23,.10), 0 0 0 1px var(--border);
  --shadow-focus: 0 0 0 3px rgba(43,92,230,.18);

  --transition: 150ms ease;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6, .page-title { font-family: 'Outfit', sans-serif; }

/* ── LAYOUT ────────────────────────────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }
.app-main   { flex: 1; min-width: 0; }
.app-content {
  padding: 24px !important;        /* fixes the "content hugging the sidebar" issue */
}

/* ── SIDEBAR ───────────────────────────────────────────────────── */
.app-sidebar {
  width: var(--sidebar-w) !important;
  background: var(--sidebar-bg) !important;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 220ms cubic-bezier(.4,0,.2,1);
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.logo-icon {
  width: 30px; height: 30px;
  background: var(--brand);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #fff;
}
.logo-text {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  letter-spacing: -.01em;
  line-height: 1.2;
}
.logo-text .accent-text { color: var(--accent); }
.logo-text .role-text {
  color: rgba(255,255,255,.3);
  font-size: 10px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
}

.sidebar-section { padding: 8px 10px; }
.sidebar-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.28);
  padding: 12px 6px 6px;
}
.app-sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.5) !important;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 400;
  transition: background var(--transition), color var(--transition);
  position: relative;
}
.app-sidebar .nav-link i {
  font-size: 15px;
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}
.app-sidebar .nav-link:hover {
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.9) !important;
}
.app-sidebar .nav-link.active {
  background: rgba(43,92,230,.22) !important;
  color: #fff !important;
  font-weight: 500;
}
.app-sidebar .nav-link.active::before {
  content: '';
  position: absolute;
  left: -10px; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--brand);
  border-radius: 0 3px 3px 0;
}
.app-sidebar .nav-badge {
  margin-left: auto;
  background: var(--brand);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 99px;
}
.sidebar-divider {
  border-color: rgba(255,255,255,.07);
  margin: 4px 0;
}

/* ── SIDEBAR COLLAPSE BUTTON ───────────────────────────────────── */
.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  background: rgba(255,255,255,.07);
  border: none;
  border-radius: 4px;
  color: rgba(255,255,255,.4);
  cursor: pointer;
  flex-shrink: 0;
  margin-left: auto;
  transition: background var(--transition), color var(--transition);
}
.sidebar-collapse-btn:hover { background: rgba(255,255,255,.14); color: #fff; }
.sidebar-collapse-btn i { font-size: 11px; transition: transform 220ms ease; }

/* ── SIDEBAR COLLAPSED STATE (desktop only) ────────────────────── */
@media (min-width: 769px) {
  .app-layout.sidebar-collapsed .app-sidebar { width: 52px !important; }

  /* icon-only links: zero out font-size so text nodes vanish; keep icon visible */
  .app-layout.sidebar-collapsed .app-sidebar .nav-link {
    font-size: 0;
    justify-content: center;
    padding: 8px 0;
    gap: 0;
  }
  .app-layout.sidebar-collapsed .app-sidebar .nav-link i {
    font-size: 16px;
    width: auto;
    margin: 0;
  }
  .app-layout.sidebar-collapsed .app-sidebar .nav-link.active::before {
    left: 0;
    top: 4px; bottom: 4px;
  }

  /* hide text-only elements */
  .app-layout.sidebar-collapsed .sidebar-label,
  .app-layout.sidebar-collapsed .sidebar-divider { display: none !important; }
  .app-layout.sidebar-collapsed .sidebar-logo .logo-text { display: none !important; }
  .app-layout.sidebar-collapsed .sidebar-logo {
    justify-content: center;
    padding: 18px 0 14px;
  }

  /* rotate chevron when collapsed */
  .app-layout.sidebar-collapsed .sidebar-collapse-btn i { transform: rotate(180deg); }
  .app-layout.sidebar-collapsed .sidebar-collapse-btn { margin-left: 0; margin-top: 2px; }

  /* sections with only padding become too tall — tighten */
  .app-layout.sidebar-collapsed .sidebar-section { padding: 6px 4px; }
}

/* hide collapse btn on mobile (overlay behaviour, collapse doesn't apply) */
@media (max-width: 768px) {
  .sidebar-collapse-btn { display: none; }
}

/* ── RIGHT SIDEBAR ─────────────────────────────────────────────── */
.app-sidebar-right {
  width: 44px;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: row;
  flex-shrink: 0;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: width 220ms cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}

.app-layout.right-sidebar-open .app-sidebar-right {
  width: 360px;
}

.sidebar-right-toggle {
  width: 44px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 12px;
  border-left: 1px solid rgba(255,255,255,.07);
  gap: 10px;
}

.sidebar-right-collapse-btn {
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: color var(--transition), background var(--transition);
}
.sidebar-right-collapse-btn:hover { color: #fff; background: rgba(255,255,255,.1); }
.sidebar-right-collapse-btn i { transition: transform 220ms ease; }

.sidebar-right-tab-icons {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-right-tab-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 15px;
  color: rgba(255,255,255,.45);
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
  text-decoration: none;
  border: none;
  background: transparent;
}
.sidebar-right-tab-icon:hover,
.sidebar-right-tab-icon.active {
  color: #fff;
  background: rgba(43,92,230,.28);
}

.sidebar-right-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-left: 1px solid rgba(255,255,255,.07);
}

/* hide right panel on mobile */
@media (max-width: 768px) {
  .app-sidebar-right { display: none; }
}

/* ── HEADER ────────────────────────────────────────────────────── */
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}
.breadcrumb-nav {
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.breadcrumb-nav a { color: var(--text-secondary); text-decoration: none; }
.breadcrumb-nav a:hover { color: var(--brand); }
.breadcrumb-sep { color: var(--border); font-size: 14px; }

.header-right { display: flex; align-items: center; gap: 10px; }
.header-avatar {
  width: 30px; height: 30px;
  background: var(--brand-light);
  color: var(--brand);
  border-radius: 50%;
  font-weight: 600;
  font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  user-select: none;
}
.header-user-name { font-size: 13px; color: var(--text-secondary); }
.header-role {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 1px 7px;
  border-radius: 99px;
}
.header-icon-btn {
  width: 32px; height: 32px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  padding: 0;
}
.header-icon-btn:hover {
  border-color: var(--border-focus);
  color: var(--brand);
}

/* ── PAGE TITLE ────────────────────────────────────────────────── */
.page-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 4px;
}

/* ── SECTION HEADER ────────────────────────────────────────────── */
.section-h {
  font-family: 'Outfit', sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 2rem 0 .75rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}

/* ── CARDS ─────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: none !important;
}
.card-header {
  background: transparent !important;
  border-bottom: 1px solid var(--border) !important;
  padding: 14px 18px !important;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 13.5px;
}
.card-body { padding: 18px; }
.card-body > .row { margin-left: 0 !important; margin-right: 0 !important; }
.card-body > .row > [class*="col"] { padding-left: 8px; padding-right: 8px; }

/* ── ALERT ─────────────────────────────────────────────────────── */
.alert {
  border-radius: var(--radius) !important;
  border: 1px solid;
  font-size: 13.5px;
  padding: 11px 16px;
}
.alert-success {
  background: #edfaf5;
  border-color: #a7e8d2;
  color: #0d7055;
}
.alert-primary {
  background: var(--brand-light);
  border-color: #bfd0f8;
  color: var(--brand-dark);
}
.alert-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}
.alert-danger {
  background: #fff1f1;
  border-color: #fecaca;
  color: #991b1b;
}
.alert-info {
  background: #ecfeff;
  border-color: #a5f3fc;
  color: #155e75;
}
.alert-secondary {
  background: var(--bg);
  border-color: var(--border);
  color: var(--text-secondary);
}

/* ── STATUS PILLS ──────────────────────────────────────────────── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  font-size: 11.5px;
  font-weight: 500;
  border-radius: 99px;
  border: 1px solid transparent;
}
.status-pill::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-new      { background: var(--brand-light); border-color: #bfd0f8; color: var(--brand-dark); }
.status-new::before { background: var(--brand); }
.status-creating { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.status-creating::before { background: #f59e0b; }
.status-proofreading { background: #f5f0ff; border-color: #d8b4fe; color: #6d28d9; }
.status-proofreading::before { background: #8b5cf6; }
.status-review   { background: #fff4ed; border-color: #fed7aa; color: #9a3412; }
.status-review::before { background: #f97316; }
.status-clients-rev { background: #fffbeb; border-color: #fde68a; color: #854d0e; }
.status-clients-rev::before { background: #eab308; }
.status-delivered { background: var(--accent-light); border-color: #99e9da; color: #065f50; }
.status-delivered::before { background: var(--accent); }
.status-paid     { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.status-paid::before { background: #3b82f6; }

/* ── BADGES ────────────────────────────────────────────────────── */
.badge {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 99px;
}
.badge.bg-primary { background: var(--brand) !important; }
.badge.bg-success { background: var(--accent) !important; }

/* ── STAT CARDS ────────────────────────────────────────────────── */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  transition: box-shadow var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-hover); }
.stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1;
}
.stat-value.brand  { color: var(--brand); }
.stat-value.amber  { color: #d97706; }
.stat-value.teal   { color: var(--accent); }
.stat-value.green  { color: #059669; }

/* ── FORM CONTROLS ─────────────────────────────────────────────── */
.form-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 5px;
}
.form-control, .form-select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  color: var(--text-primary);
  background: var(--surface);
  padding: 8px 12px;
  height: auto;
  box-shadow: none !important;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus, .form-select:focus {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-focus) !important;
  outline: none;
}
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; }
.input-group-text {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13.5px;
}

/* ── CHECKBOX / SWITCH ─────────────────────────────────────────── */
.form-check-input {
  border: 1.5px solid var(--border);
  width: 15px; height: 15px;
  border-radius: 4px;
  cursor: pointer;
}
.form-check-input:checked {
  background-color: var(--brand);
  border-color: var(--brand);
}
.form-check-input:focus { box-shadow: var(--shadow-focus); }
.form-check-label { font-size: 13.5px; cursor: pointer; }
.form-switch .form-check-input {
  width: 34px; height: 18px;
  border-radius: 99px;
}
.form-switch .form-check-input:checked {
  background-color: var(--brand);
  border-color: var(--brand);
}

/* ── PRICE SUMMARY ─────────────────────────────────────────────── */
.price-summary {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.price-summary .price-main {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: -.02em;
}

/* ── BUTTONS ───────────────────────────────────────────────────── */
.btn {
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 13.5px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: all var(--transition);
}
.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
}
.btn-outline-primary {
  background: transparent;
  border-color: var(--border);
  color: var(--text-primary);
}
.btn-outline-primary:hover {
  background: var(--brand-light);
  border-color: var(--brand);
  color: var(--brand-dark);
}
.btn-success {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-success:hover { background: #009e84; border-color: #009e84; color: #fff; }
.btn-outline-success {
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}
.btn-outline-success:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: #065f50;
}
.btn-warning {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #fff;
}
.btn-warning:hover { background: #d97706; border-color: #d97706; color: #fff; }
.btn-danger { background: #ef4444; border-color: #ef4444; color: #fff; }
.btn-outline-danger {
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}
.btn-outline-danger:hover {
  background: #fff1f1;
  border-color: #fca5a5;
  color: #991b1b;
}
.btn-secondary, .btn-outline-secondary {
  background: var(--bg);
  border-color: var(--border);
  color: var(--text-secondary);
}
.btn-outline-secondary:hover, .btn-secondary:hover {
  background: #edeef1;
  color: var(--text-primary);
}
.btn-info { background: #0ea5e9; border-color: #0ea5e9; color: #fff; }
.btn-link {
  color: var(--brand);
  text-decoration: none;
  background: none;
  border: none;
  padding-left: 4px;
  padding-right: 4px;
}
.btn-link:hover { color: var(--brand-dark); }
.btn-sm { padding: 5px 11px; font-size: 12.5px; }
.btn-lg { padding: 10px 22px; font-size: 15px; }

/* ── KANBAN ────────────────────────────────────────────────────── */
.kanban-col {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  min-height: 200px;
}
.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.kanban-col-title {
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.kanban-count {
  font-size: 11px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 1px 7px;
  border-radius: 99px;
}

.order-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.order-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: #d0d8f0;
  color: inherit;
}
.order-card .meta { font-size: 11.5px; color: var(--text-muted); }

/* Older planner-card class kept for backward-compat with crm/planner.blade.php */
.planner-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.planner-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: #d0d8f0;
  color: inherit;
}
.planner-card .meta { font-size: 11.5px; color: var(--text-muted); }
.planner-col {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  min-height: 200px;
}

/* ── TABLE ─────────────────────────────────────────────────────── */
.table {
  font-size: 13.5px;
  color: var(--text-primary);
}
.table thead th, .table-light > th, .table-light > td, thead.table-light th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg) !important;
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
}
.table tbody td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table-hover tbody tr:hover td { background: #fafbfd; }
.table a { color: var(--brand); text-decoration: none; font-weight: 500; }
.table a:hover { text-decoration: underline; }

/* ── DEFINITION LIST (opt-in via .brief-dl) ────────────────────── */
dl.brief-dl {
  margin: 0;
  display: grid;
  grid-template-columns: 180px 1fr;
}
dl.brief-dl dt {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 11px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
}
dl.brief-dl dd {
  font-size: 13.5px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--border);
  margin: 0;
  display: flex; align-items: center;
}
dl.brief-dl dt:last-of-type, dl.brief-dl dd:last-of-type { border-bottom: none; }

/* ── EDITOR (toolbar only — Tiptap renders its own surface) ────── */
.editor-toolbar {
  border: 1px solid var(--border) !important;
  border-bottom: none !important;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0 !important;
  background: var(--bg) !important;
  padding: 6px 10px !important;
}
.editor-toolbar .vr {
  background: var(--border);
  margin: 0 4px;
  width: 1px;
  align-self: stretch;
}
.editor-toolbar button {
  background: transparent !important;
  border: none !important;
  color: var(--text-secondary) !important;
}
.editor-toolbar button:hover {
  background: var(--surface) !important;
  color: var(--brand) !important;
}

/* Tiptap editing surface */
#task-content-editor {
  border: 1px solid var(--border) !important;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm) !important;
  background: var(--surface);
  line-height: 1.7;
  font-size: 14px;
  padding: 16px !important;
}
#task-content-editor .ProseMirror { outline: none; min-height: 300px; }
#task-content-editor h1 { font-size: 22px; font-weight: 600; margin: 8px 0; }
#task-content-editor h2 { font-size: 18px; font-weight: 600; margin: 8px 0; }
#task-content-editor h3 { font-size: 16px; font-weight: 600; margin: 8px 0; }

/* ── HISTORY ───────────────────────────────────────────────────── */
.history-item {
  border-left: 2px solid var(--border);
  padding-left: 14px;
  margin-left: 6px;
  padding-bottom: 14px;
  position: relative;
  font-size: 12.5px;
}
.history-item::before {
  content: '';
  position: absolute;
  left: -5px; top: 3px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--brand);
  border: 2px solid var(--surface);
}
.history-item:last-child { padding-bottom: 0; }

/* ── DOTS ──────────────────────────────────────────────────────── */
.dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; vertical-align: middle; }
.dot-on  { background: var(--accent); box-shadow: 0 0 0 3px rgba(0,203,169,.15); }
.dot-off { background: var(--text-muted); }

/* ── CODE BADGE ────────────────────────────────────────────────── */
code {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--brand-dark);
}

/* ── HELPERS ───────────────────────────────────────────────────── */
.text-brand   { color: var(--brand) !important; }
.text-accent  { color: var(--accent) !important; }
.text-muted   { color: var(--text-muted) !important; }
.fw-medium    { font-weight: 500; }
.text-muted-small {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* ── CLIENT NAVBAR (keeps horizontal layout, gets new tokens) ──── */
nav.navbar.bg-dark {
  background: var(--sidebar-bg) !important;
  border-bottom: 1px solid rgba(255,255,255,.07);
  padding: 8px 16px;
}
nav.navbar.bg-dark .navbar-brand,
nav.navbar.bg-dark .nav-link {
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  color: rgba(255,255,255,.7);
}
nav.navbar.bg-dark .nav-link.active,
nav.navbar.bg-dark .nav-link:hover { color: #fff; }

/* ── MOBILE BURGER ─────────────────────────────────────────────── */
.burger-btn {
  display: none;
  width: 36px; height: 36px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,17,23,.45);
  z-index: 99;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* ── RESPONSIVE ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .app-sidebar {
    position: fixed !important;
    top: 0; left: 0;
    height: 100% !important;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 220ms cubic-bezier(.4,0,.2,1);
    box-shadow: 4px 0 24px rgba(0,0,0,.25);
  }
  .app-sidebar.open { transform: translateX(0); }
  .burger-btn { display: flex; }
  .app-header { padding: 0 14px; height: 48px; }
  .header-user-name, .header-role { display: none; }
  .app-content { padding: 14px !important; }
  .page-title { font-size: 18px; }
  .kanban-col { min-height: 160px; }
  .alerts-row { flex-direction: column !important; }
  .alerts-row > .col { width: 100%; flex: none; }
  .section-h { margin-top: 1.5rem; }
}
@media (max-width: 480px) {
  .app-content { padding: 12px !important; }
}

/* x-cloak helper for Alpine */
[x-cloak] { display: none !important; }

/* ── Utility: spin animation for refresh icons ─── */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin .8s linear infinite; }

/* ── Prompt-tag palette (cheat-sheet panel next to prompt textareas) ─── */
.prompt-tag-palette {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 6rem);
    overflow-y: auto;
    background: #fafbfc;
    border: 1px solid #eceff3;
    border-radius: .4rem;
    padding: .65rem .55rem;
    font-size: .72rem;
}
.prompt-tag-palette .ptp-section + .ptp-section { margin-top: .8rem; }
.prompt-tag-palette .ptp-section-title {
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #495057;
    user-select: none;
    margin-bottom: .35rem;
    font-size: .66rem;
    display: flex;
    align-items: center;
}
.prompt-tag-palette .ptp-section-title::after {
    content: "▾";
    margin-left: auto;
    font-size: .65rem;
    color: #adb5bd;
    transition: transform .12s ease;
}
.prompt-tag-palette .ptp-section-title.collapsed::after { transform: rotate(-90deg); }
.prompt-tag-palette .ptp-section-title.collapsed + .ptp-section-body { display: none; }
.prompt-tag-palette .ptp-group + .ptp-group { margin-top: .55rem; }
.prompt-tag-palette .ptp-group-title {
    font-size: .6rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6c757d;
    margin: .3rem 0 .2rem;
}
.prompt-tag-chip {
    display: inline-block;
    margin: .12rem .18rem .12rem 0;
    padding: .12rem .4rem;
    border-radius: .25rem;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #2b5ce6;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: .68rem;
    cursor: pointer;
    user-select: none;
    line-height: 1.35;
}
.prompt-tag-chip:hover {
    background: #f0f4ff;
    border-color: #2b5ce6;
}
.prompt-tag-palette .ptp-hint {
    margin-left: .3rem;
    color: #adb5bd;
    cursor: help;
    font-weight: normal;
}
