/* =========================================================================
   VISIMOB DESIGN SYSTEM — Planejamento
   Based on /Downloads/Visimob Design System-4/
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap');

/* ---- VisbyCF font family ---- */
@font-face { font-family: 'VisbyCF'; src: url('../fonts/VisbyCF-Thin.otf') format('opentype'); font-weight: 100; font-style: normal; font-display: swap; }
@font-face { font-family: 'VisbyCF'; src: url('../fonts/VisbyCF-ThinOblique.otf') format('opentype'); font-weight: 100; font-style: italic; font-display: swap; }
@font-face { font-family: 'VisbyCF'; src: url('../fonts/VisbyCF-Light.otf') format('opentype'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'VisbyCF'; src: url('../fonts/VisbyCF-LightOblique.otf') format('opentype'); font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: 'VisbyCF'; src: url('../fonts/VisbyCF-Regular.otf') format('opentype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'VisbyCF'; src: url('../fonts/VisbyCF-RegularOblique.otf') format('opentype'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'VisbyCF'; src: url('../fonts/VisbyCF-Medium.otf') format('opentype'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'VisbyCF'; src: url('../fonts/VisbyCF-MediumOblique.otf') format('opentype'); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: 'VisbyCF'; src: url('../fonts/VisbyCF-DemiBold.otf') format('opentype'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'VisbyCF'; src: url('../fonts/VisbyCF-DemiBoldOblique.otf') format('opentype'); font-weight: 600; font-style: italic; font-display: swap; }
@font-face { font-family: 'VisbyCF'; src: url('../fonts/VisbyCF-Bold.otf') format('opentype'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'VisbyCF'; src: url('../fonts/VisbyCF-BoldOblique.otf') format('opentype'); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: 'VisbyCF'; src: url('../fonts/VisbyCF-ExtraBold.otf') format('opentype'); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'VisbyCF'; src: url('../fonts/VisbyCF-ExtraBoldOblique.otf') format('opentype'); font-weight: 800; font-style: italic; font-display: swap; }
@font-face { font-family: 'VisbyCF'; src: url('../fonts/VisbyCF-Heavy.otf') format('opentype'); font-weight: 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'VisbyCF'; src: url('../fonts/VisbyCF-HeavyOblique.otf') format('opentype'); font-weight: 900; font-style: italic; font-display: swap; }

/* ---- Design tokens ---- */
:root {
  /* Brand colors */
  --color-red:          #E8192C;
  --color-red-dark:     #C41020;
  --color-red-light:    #FF3B4E;
  --color-red-subtle:   rgba(232, 25, 44, 0.12);

  --color-ink:          #181414;
  --color-ink-medium:   #2C2626;
  --color-ink-muted:    #5A5050;

  --color-white:        #FFFFFF;
  --color-off-white:    #F8F5F5;
  --color-surface:      #F2EDED;
  --color-border:       #E5DEDE;

  /* Extended status palette (from _shared.css) */
  --green:       #22C55E;
  --green-sub:   rgba(34,197,94,.14);
  --green-text:  #15803D;
  --yellow:      #F59E0B;
  --yellow-sub:  rgba(245,158,11,.16);
  --yellow-text: #B45309;
  --blue:        #3B82F6;
  --blue-sub:    rgba(59,130,246,.14);
  --blue-text:   #1D4ED8;
  --purple:      #8B5CF6;
  --purple-sub:  rgba(139,92,246,.14);
  --purple-text: #6D28D9;

  /* Shortcut aliases (match design system snippets) */
  --red:         var(--color-red);
  --red-subtle:  var(--color-red-subtle);
  --ink:         var(--color-ink);
  --ink-med:     var(--color-ink-medium);
  --ink-muted:   var(--color-ink-muted);
  --off:         var(--color-off-white);
  --surface:     var(--color-surface);
  --border:      var(--color-border);

  /* Semantic fg/bg */
  --fg1: var(--color-ink);
  --fg2: var(--color-ink-medium);
  --fg3: var(--color-ink-muted);
  --fg-on-dark: var(--color-white);
  --fg-on-red:  var(--color-white);

  /* Typography */
  --font-brand:     'VisbyCF', 'Inter', system-ui, -apple-system, sans-serif;
  --font-body:      'VisbyCF', 'Inter', system-ui, -apple-system, sans-serif;
  --font-editorial: 'Cormorant Garamond', 'Georgia', serif;
  --f:  var(--font-brand);
  --fe: var(--font-editorial);

  --text-xs:    12px;
  --text-sm:    14px;
  --text-base:  16px;
  --text-md:    18px;
  --text-lg:    22px;
  --text-xl:    28px;
  --text-2xl:   36px;
  --text-3xl:   48px;
  --text-4xl:   64px;

  --weight-thin:      100;
  --weight-light:     300;
  --weight-regular:   400;
  --weight-medium:    500;
  --weight-demibold:  600;
  --weight-bold:      700;
  --weight-extrabold: 800;
  --weight-heavy:     900;

  --leading-tight:  1.1;
  --leading-snug:   1.25;
  --leading-normal: 1.5;
  --leading-loose:  1.75;

  /* Spacing */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px;  --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px;  --space-10: 40px;
  --space-12: 48px; --space-16: 64px; --space-20: 80px;

  /* Radii — sharp by default */
  --radius-sm:   4px;
  --radius-md:   4px;
  --radius-lg:   8px;
  --radius-xl:   12px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:    0 1px 3px rgba(24,20,20,0.08);
  --shadow-md:    0 4px 16px rgba(24,20,20,0.10);
  --shadow-lg:    0 12px 40px rgba(24,20,20,0.14);
  --shadow-brand: 0 8px 32px rgba(232,25,44,0.28);

  /* Motion */
  --motion-fast:   150ms ease;
  --motion-medium: 300ms ease;
}

/* ---- Bootstrap overrides ---- */
:root {
  --bs-primary: #E8192C;
  --bs-primary-rgb: 232, 25, 44;
  --bs-link-color: #E8192C;
  --bs-link-hover-color: #C41020;
  --bs-link-color-rgb: 232, 25, 44;
  --bs-link-hover-color-rgb: 196, 16, 32;
  --bs-body-font-family: var(--font-brand);
  --bs-body-font-size: 14px;
  --bs-body-color: var(--color-ink);
  --bs-body-bg: var(--color-off-white);
  --bs-border-color: var(--color-border);
  --bs-border-radius: 4px;
  --bs-border-radius-sm: 4px;
  --bs-border-radius-lg: 8px;
  --bs-focus-ring-color: rgba(232, 25, 44, 0.25);
}

/* ---- Base reset ---- */
* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: var(--font-brand);
  font-size: 14px;
  color: var(--color-ink);
  background: var(--color-off-white);
  line-height: var(--leading-normal);
}

a { color: var(--color-red); text-decoration: none; transition: color var(--motion-fast); }
a:hover { color: var(--color-red-dark); }

/* ---- Semantic type ---- */
h1, .h1 { font-family: var(--f); font-size: var(--text-xl); font-weight: var(--weight-heavy); line-height: var(--leading-tight); letter-spacing: -0.02em; color: var(--fg1); }
h2, .h2 { font-family: var(--f); font-size: var(--text-lg); font-weight: var(--weight-extrabold); line-height: var(--leading-tight); letter-spacing: -0.01em; color: var(--fg1); }
h3, .h3 { font-family: var(--f); font-size: var(--text-md); font-weight: var(--weight-bold); line-height: var(--leading-snug); color: var(--fg1); }
h4, .h4 { font-family: var(--f); font-size: var(--text-base); font-weight: var(--weight-demibold); line-height: var(--leading-snug); color: var(--fg1); }
h5, .h5 { font-family: var(--f); font-size: var(--text-sm); font-weight: var(--weight-demibold); line-height: var(--leading-snug); color: var(--fg1); }
h6, .h6 { font-family: var(--f); font-size: var(--text-xs); font-weight: var(--weight-demibold); line-height: var(--leading-snug); color: var(--fg1); }
p { color: var(--fg2); }

.eyebrow, .label-eyebrow {
  font-family: var(--f);
  font-size: 10px;
  font-weight: var(--weight-extrabold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-red);
}
.eyebrow-muted { color: var(--fg3); }

.editorial-i, em.brand {
  font-family: var(--fe);
  font-style: italic;
  font-weight: 300;
  color: var(--color-red);
}

.caption, .text-muted, small.text-muted {
  font-family: var(--f);
  font-size: 11.5px;
  color: var(--fg3) !important;
}

/* ---- App shell: sidebar + topbar ---- */
body.app-shell { margin: 0; padding: 0; background: var(--color-off-white); }
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }

/* Sidebar */
.sb {
  background: var(--color-ink);
  color: white;
  padding: 18px 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
}
.sb-brand {
  padding: 0 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: white;
}
.sb-logo-img {
  height: 20px;
  width: auto;
  filter: brightness(0) invert(1);
  flex-shrink: 0;
}
.sb-name { font-weight: 800; font-size: 13px; letter-spacing: -.01em; color: white; }
.sb-name em {
  font-family: var(--fe);
  font-style: italic;
  font-weight: 300;
  color: rgba(255,255,255,.5);
  font-size: 14px;
  margin-left: 4px;
}

.sb-search { padding: 14px 20px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sb-search-i {
  width: 100%;
  padding: 8px 10px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  color: white;
  font-size: 12px;
  font-family: var(--f);
  border-radius: 4px;
  outline: none;
  transition: border-color var(--motion-fast);
}
.sb-search-i::placeholder { color: rgba(255,255,255,.4); }
.sb-search-i:focus { border-color: var(--color-red); }

.sb-nav { padding: 12px 0; flex: 1; overflow-y: auto; }
.sb-nav::-webkit-scrollbar { width: 4px; }
.sb-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 2px; }

.sb-group-k {
  padding: 12px 20px 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
}
.sb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  color: rgba(255,255,255,.7);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  border-left: 2px solid transparent;
  text-decoration: none;
  transition: background var(--motion-fast), color var(--motion-fast);
}
.sb-item:hover { background: rgba(255,255,255,.04); color: white; }
.sb-item.active, .sb-item.on {
  background: rgba(232,25,44,.15);
  border-left-color: var(--color-red);
  color: white;
  font-weight: 700;
}
.sb-item-i { width: 14px; height: 14px; opacity: .7; flex-shrink: 0; }
.sb-item.active .sb-item-i, .sb-item.on .sb-item-i { opacity: 1; }
.sb-item-n {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  background: rgba(255,255,255,.1);
  padding: 2px 7px;
  border-radius: 9999px;
  color: white;
}
.sb-item.active .sb-item-n, .sb-item.on .sb-item-n { background: var(--color-red); }

.sb-user {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: white;
}
.sb-user:hover { background: rgba(255,255,255,.03); }
.sb-user-av {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg,#E8192C,#8B1016);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 11px;
  color: white;
  overflow: hidden;
  flex-shrink: 0;
}
.sb-user-av img { width: 100%; height: 100%; object-fit: cover; }
.sb-user-n { font-weight: 700; font-size: 12px; color: white; line-height: 1.2; }
.sb-user-r { font-size: 10px; color: rgba(255,255,255,.5); line-height: 1.2; margin-top: 2px; }

.sb-foot-actions { padding: 8px 16px 0; display: flex; flex-direction: column; gap: 2px; }
.sb-foot-actions a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  font-size: 11px;
  color: rgba(255,255,255,.55);
  border-radius: 3px;
  text-decoration: none;
  transition: all var(--motion-fast);
}
.sb-foot-actions a:hover { color: white; background: rgba(255,255,255,.04); }
.sb-foot-actions svg { width: 12px; height: 12px; }

/* Topbar */
.top {
  background: white;
  border-bottom: 1px solid var(--color-border);
  padding: 0 32px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.top-toggle { display: none; background: none; border: none; padding: 6px; color: var(--ink); cursor: pointer; }
.top-toggle svg { width: 20px; height: 20px; }

.crumbs { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-muted); flex-wrap: wrap; }
.crumbs a { color: var(--ink-muted); font-weight: 500; }
.crumbs a:hover { color: var(--color-red); }
.crumbs .sep { color: var(--color-border); }
.crumbs .cur { color: var(--ink); font-weight: 700; }

.top-r { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.top-ic {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  border-radius: 4px;
  position: relative;
  cursor: pointer;
  text-decoration: none;
  background: none;
  border: none;
  transition: all var(--motion-fast);
}
.top-ic:hover { background: var(--color-off-white); color: var(--ink); }
.top-ic i { font-size: 16px; }
.top-ic .dot {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-red);
  border: 1.5px solid white;
}
.top-ic .dot.count {
  width: auto; height: auto;
  min-width: 16px;
  padding: 1px 4px;
  top: 4px; right: 2px;
  font-size: 9px;
  font-weight: 800;
  color: white;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.top-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--ink);
  text-decoration: none;
  transition: background var(--motion-fast);
}
.top-user:hover { background: var(--color-off-white); color: var(--ink); }
.top-user-av { width: 26px; height: 26px; border-radius: 50%; overflow: hidden; background: var(--color-surface); flex-shrink: 0; }
.top-user-av img { width: 100%; height: 100%; object-fit: cover; }
.top-user-n { font-size: 12px; font-weight: 700; }

/* Body container */
.body-wrap { padding: 24px 32px 48px; }
.body-wrap.wide { max-width: 1720px; }

/* Page header (task header style from app_visimob_interno) */
.ph {
  background: white;
  border-bottom: 1px solid var(--color-border);
  padding: 24px 32px 20px;
  margin: 0 -32px 24px;
}
.ph-crumb {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--color-red);
  margin-bottom: 8px;
}
.ph-crumb span { color: var(--ink-muted); margin: 0 6px; }
.ph-title-row { display: flex; align-items: baseline; gap: 16px; margin-bottom: 10px; flex-wrap: wrap; }
.ph-title { font-weight: 900; font-size: 28px; letter-spacing: -.02em; line-height: 1.1; color: var(--ink); margin: 0; }
.ph-title em { font-family: var(--fe); font-weight: 300; font-style: italic; color: var(--color-red); font-size: 32px; }
.ph-id { font-size: 11px; color: var(--ink-muted); font-weight: 700; letter-spacing: .08em; font-family: ui-monospace, monospace; }
.ph-sub { font-size: 12.5px; color: var(--ink-muted); display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.ph-sub b { color: var(--ink); font-weight: 700; }
.ph-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ph-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }

/* ---- Buttons ---- */
.btn {
  font-family: var(--f);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 9px 18px;
  border-radius: 4px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all var(--motion-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  line-height: 1.2;
  white-space: nowrap;
}
.btn:focus { outline: none; box-shadow: 0 0 0 3px rgba(232,25,44,0.2); }

.btn-primary, .btn.btn-primary {
  background: var(--color-red) !important;
  border-color: var(--color-red) !important;
  color: white !important;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active,
.btn.btn-primary:hover, .btn.btn-primary:focus, .btn.btn-primary:active {
  background: var(--color-red-dark) !important;
  border-color: var(--color-red-dark) !important;
  color: white !important;
}

.btn-dark, .btn.btn-dark {
  background: var(--color-ink) !important;
  border-color: var(--color-ink) !important;
  color: white !important;
}
.btn-dark:hover, .btn-dark:focus, .btn.btn-dark:hover, .btn.btn-dark:focus {
  background: var(--color-ink-medium) !important;
  border-color: var(--color-ink-medium) !important;
  color: white !important;
}

.btn-outline, .btn-outline-primary, .btn.btn-outline-primary {
  background: transparent !important;
  border-color: var(--color-red) !important;
  color: var(--color-red) !important;
}
.btn-outline:hover, .btn-outline-primary:hover, .btn.btn-outline-primary:hover {
  background: var(--color-red) !important;
  color: white !important;
}

.btn-outline-dark, .btn.btn-outline-dark {
  background: transparent !important;
  border-color: var(--color-ink) !important;
  color: var(--color-ink) !important;
}
.btn-outline-dark:hover, .btn.btn-outline-dark:hover {
  background: var(--color-ink) !important;
  color: white !important;
}

.btn-outline-secondary, .btn.btn-outline-secondary {
  background: white;
  border-color: var(--color-border);
  color: var(--ink-medium);
}
.btn-outline-secondary:hover, .btn.btn-outline-secondary:hover {
  background: var(--color-off-white);
  border-color: var(--color-ink-muted);
  color: var(--color-ink);
}

/* Variant for dark backgrounds (admin header, dark cards) */
.btn-on-dark {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.24);
  color: white;
}
.btn-on-dark:hover, .btn-on-dark:focus {
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.4);
  color: white;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--color-red);
}
.btn-ghost:hover { background: var(--color-red-subtle); color: var(--color-red-dark); }

/* Keep Bootstrap semantic btns but harmonize with Visimob */
.btn-success, .btn.btn-success { background: var(--green) !important; border-color: var(--green) !important; color: white !important; }
.btn-success:hover, .btn.btn-success:hover { background: #1aa14e !important; border-color: #1aa14e !important; color: white !important; }
.btn-danger, .btn.btn-danger { background: var(--color-red) !important; border-color: var(--color-red) !important; color: white !important; }
.btn-danger:hover, .btn.btn-danger:hover { background: var(--color-red-dark) !important; border-color: var(--color-red-dark) !important; color: white !important; }
.btn-warning, .btn.btn-warning { background: var(--yellow) !important; border-color: var(--yellow) !important; color: var(--ink) !important; }
.btn-warning:hover, .btn.btn-warning:hover { background: #d98706 !important; border-color: #d98706 !important; color: var(--ink) !important; }
.btn-info, .btn.btn-info { background: var(--blue) !important; border-color: var(--blue) !important; color: white !important; }
.btn-info:hover, .btn.btn-info:hover { background: #2563eb !important; border-color: #2563eb !important; color: white !important; }
.btn-secondary, .btn.btn-secondary { background: var(--ink-muted) !important; border-color: var(--ink-muted) !important; color: white !important; }
.btn-secondary:hover, .btn.btn-secondary:hover { background: var(--ink-medium) !important; border-color: var(--ink-medium) !important; color: white !important; }
.btn-light, .btn.btn-light { background: white !important; border-color: var(--color-border) !important; color: var(--ink) !important; }
.btn-light:hover, .btn.btn-light:hover { background: var(--color-off-white) !important; color: var(--ink) !important; }

.btn-sm, .btn.btn-sm { padding: 6px 12px; font-size: 11px; }
.btn-lg, .btn.btn-lg { padding: 12px 24px; font-size: 13px; }

.btn-icon {
  width: 32px; height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---- Cards ---- */
.card {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  box-shadow: none;
  overflow: hidden;
  transition: border-color var(--motion-fast), box-shadow var(--motion-fast);
}
.card:hover {
  box-shadow: var(--shadow-sm);
}
.card-header, .card-h {
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border);
  background: white;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
}
.card-h-k, .card-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.card-h-t, .card-title-strong {
  font-weight: 800;
  font-size: 13.5px;
  letter-spacing: -.01em;
  color: var(--ink);
}
.card-h em, .card-header em {
  font-family: var(--fe);
  font-style: italic;
  font-weight: 300;
  color: var(--color-red);
  font-size: 15px;
}
.card-h-r, .card-h-right {
  margin-left: auto;
  font-size: 11px;
  color: var(--ink-muted);
  display: flex;
  gap: 8px;
  align-items: center;
}
.card-body, .card-b { padding: 16px 18px; }
.card-footer, .card-f {
  padding: 12px 18px;
  border-top: 1px solid var(--color-border);
  background: var(--color-off-white);
  font-size: 12px;
  color: var(--ink-muted);
}

/* Card variants */
.card.card-red { background: var(--color-red); border-color: var(--color-red); color: white; }
.card.card-red .card-header, .card.card-red .card-h { color: white; border-color: rgba(255,255,255,.2); }
.card.card-ink { background: var(--color-ink); border-color: var(--color-ink); color: white; }

/* Card hover highlight (for tool cards etc) */
.card-hover:hover { border-color: var(--color-red); transform: translateY(-1px); box-shadow: var(--shadow-md); }

/* ---- Bootstrap card-header variants (legacy bg-*) ---- */
.card-header.bg-primary, .card-header.bg-danger { background: var(--color-red) !important; color: white !important; border-bottom-color: var(--color-red) !important; }
.card-header.bg-dark { background: var(--color-ink) !important; color: white !important; }
.card-header.bg-success { background: var(--green) !important; color: white !important; }
.card-header.bg-warning { background: var(--yellow) !important; color: var(--ink) !important; }
.card-header.bg-info { background: var(--blue) !important; color: white !important; }
.card-header.bg-light { background: var(--color-off-white) !important; color: var(--ink) !important; border-bottom-color: var(--color-border) !important; }
.card-header.bg-secondary { background: var(--color-surface) !important; color: var(--ink) !important; }

.card.border-primary, .card.border-danger { border-color: var(--color-red) !important; }
.card.border-success { border-color: var(--green) !important; }
.card.border-warning { border-color: var(--yellow) !important; }
.card.border-info { border-color: var(--blue) !important; }

/* ---- Pills / Badges ---- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 9999px;
  font-family: var(--f);
  white-space: nowrap;
}
.pill.red { background: var(--color-red); color: white; }
.pill.ink { background: var(--color-ink); color: white; }
.pill.g { background: var(--green-sub); color: var(--green-text); }
.pill.y { background: var(--yellow-sub); color: var(--yellow-text); }
.pill.b { background: var(--blue-sub); color: var(--blue-text); }
.pill.p { background: var(--purple-sub); color: var(--purple-text); }
.pill.l { background: var(--color-surface); color: var(--ink-med); }
.pill.outline { background: transparent; border: 1.5px solid var(--color-red); color: var(--color-red); }
.pill.dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }

/* Bootstrap badge override */
.badge {
  font-family: var(--f);
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  padding: 4px 9px;
  border-radius: 9999px;
}
.badge.bg-primary, .badge.bg-danger { background: var(--color-red) !important; color: white !important; }
.badge.bg-success { background: var(--green) !important; color: white !important; }
.badge.bg-warning { background: var(--yellow) !important; color: var(--ink) !important; }
.badge.bg-info { background: var(--blue) !important; color: white !important; }
.badge.bg-secondary { background: var(--color-surface) !important; color: var(--ink-med) !important; }
.badge.bg-dark { background: var(--color-ink) !important; color: white !important; }
.badge.bg-light { background: var(--color-off-white) !important; color: var(--ink) !important; border: 1px solid var(--color-border); }

/* ---- Avatars ---- */
.av {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  background: var(--color-surface);
  color: var(--ink-med);
  font-weight: 800;
  font-family: var(--f);
  position: relative;
  flex-shrink: 0;
}
.av img { width: 100%; height: 100%; object-fit: cover; }
.av-xs  { width: 22px; height: 22px; font-size: 8px; }
.av-sm  { width: 28px; height: 28px; font-size: 10px; }
.av-md  { width: 36px; height: 36px; font-size: 12px; }
.av-lg  { width: 48px; height: 48px; font-size: 14px; }
.av-xl  { width: 64px; height: 64px; font-size: 18px; }
.av-2xl { width: 96px; height: 96px; font-size: 28px; }

.av.red { background: linear-gradient(135deg,#E8192C,#8B1016); color: white; }
.av.ink { background: linear-gradient(135deg,#181414,#5A5050); color: white; }
.av.blue { background: linear-gradient(135deg,#3B82F6,#1D4ED8); color: white; }
.av.gold { background: linear-gradient(135deg,#F59E0B,#B45309); color: white; }

.av-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid white;
  background: var(--ink-muted);
}
.av-dot.on { background: var(--green); }
.av-dot.away { background: var(--yellow); }
.av-dot.busy { background: var(--color-red); }

/* ---- Forms ---- */
.form-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
  margin-bottom: 6px;
  font-family: var(--f);
}
.form-text { font-size: 11px; color: var(--ink-muted); }

.form-control, .form-select, textarea.form-control, input.form-control {
  font-family: var(--f);
  font-size: 13px;
  padding: 9px 12px;
  border: 1.5px solid var(--color-border);
  border-radius: 4px;
  background: white;
  color: var(--ink);
  transition: border-color var(--motion-fast), box-shadow var(--motion-fast);
}
.form-control:focus, .form-select:focus {
  border-color: var(--color-red);
  box-shadow: 0 0 0 3px rgba(232,25,44,0.12);
  outline: none;
}
.form-control::placeholder { color: var(--ink-muted); }
.form-control.is-invalid { border-color: var(--color-red); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(232,25,44,0.12); }
.invalid-feedback {
  font-size: 11px;
  color: var(--color-red);
  margin-top: 4px;
  font-weight: 600;
}

.input-group-text {
  background: var(--color-off-white);
  border: 1.5px solid var(--color-border);
  color: var(--ink-muted);
  font-size: 12px;
}

.form-check-input { border-color: var(--color-border); border-radius: 3px; }
.form-check-input:checked { background-color: var(--color-red); border-color: var(--color-red); }
.form-check-input:focus { border-color: var(--color-red); box-shadow: 0 0 0 3px rgba(232,25,44,0.12); }

/* ---- Tables ---- */
.table {
  --bs-table-bg: white;
  --bs-table-color: var(--ink);
  --bs-table-border-color: var(--color-border);
  font-size: 13px;
  font-family: var(--f);
  margin-bottom: 0;
}
.table > thead { background: var(--color-off-white); }
.table > thead th {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}
.table > tbody td {
  padding: 14px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.table > tbody tr:hover { background: var(--color-off-white); }
.table-light { background: var(--color-off-white) !important; }

/* Card-wrapped tables: no outer border since card has one */
.card .table { border: none; }
.card .table > thead th:first-child,
.card .table > tbody td:first-child { padding-left: 18px; }
.card .table > thead th:last-child,
.card .table > tbody td:last-child { padding-right: 18px; }

/* ---- Alerts (legacy) + Toast stack (new) ---- */
.alert {
  border-radius: 4px;
  border-width: 0 0 0 3px;
  border-style: solid;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
}
.alert-success { background: var(--green-sub); border-color: var(--green); color: var(--green-text); }
.alert-danger, .alert-error { background: var(--color-red-subtle); border-color: var(--color-red); color: var(--color-red-dark); }
.alert-warning { background: var(--yellow-sub); border-color: var(--yellow); color: var(--yellow-text); }
.alert-info { background: var(--blue-sub); border-color: var(--blue); color: var(--blue-text); }
.alert-dismissible .btn-close { padding: 14px; }

.toast-stack {
  position: fixed;
  z-index: 1080;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast-stack.stack-tr { top: 72px; right: 24px; }
.toast-stack.stack-br { bottom: 24px; right: 24px; }
.toast-stack.stack-tc { top: 72px; left: 50%; transform: translateX(-50%); }

.toast-msg {
  min-width: 280px;
  max-width: 420px;
  background: white;
  border-left: 3px solid var(--ink);
  padding: 12px 14px 12px 16px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  box-shadow: var(--shadow-md);
  border-radius: 4px;
  pointer-events: auto;
  animation: toast-in var(--motion-medium);
}
.toast-msg.success { border-left-color: var(--green); }
.toast-msg.danger, .toast-msg.error { border-left-color: var(--color-red); }
.toast-msg.warning { border-left-color: var(--yellow); }
.toast-msg.info { border-left-color: var(--blue); }

.toast-msg-ic { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; }
.toast-msg.success .toast-msg-ic { color: var(--green-text); }
.toast-msg.danger .toast-msg-ic, .toast-msg.error .toast-msg-ic { color: var(--color-red); }
.toast-msg.warning .toast-msg-ic { color: var(--yellow-text); }
.toast-msg.info .toast-msg-ic { color: var(--blue-text); }

.toast-msg-body { flex: 1; font-size: 12.5px; line-height: 1.4; color: var(--ink); font-weight: 500; }
.toast-msg-x {
  background: none;
  border: none;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 0;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
  transition: color var(--motion-fast);
}
.toast-msg-x:hover { color: var(--ink); }

@keyframes toast-in {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ---- Dropdowns (Bootstrap override) ---- */
.dropdown-menu {
  font-family: var(--f);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  box-shadow: var(--shadow-md);
  padding: 6px;
  font-size: 12.5px;
}
.dropdown-item {
  padding: 7px 12px;
  border-radius: 3px;
  color: var(--ink);
  font-weight: 500;
}
.dropdown-item:hover, .dropdown-item:focus { background: var(--color-off-white); color: var(--ink); }
.dropdown-item.active, .dropdown-item:active {
  background: var(--color-red-subtle);
  color: var(--color-red);
  font-weight: 700;
}
.dropdown-item i, .dropdown-item .bi { color: var(--ink-muted); margin-right: 6px; }
.dropdown-divider { border-color: var(--color-border); margin: 4px 0; }

/* ---- Modals (Bootstrap override) ---- */
.modal-content {
  border: 1px solid var(--color-border);
  border-radius: 4px;
  box-shadow: var(--shadow-lg);
  font-family: var(--f);
}
.modal-header {
  border-bottom: 1px solid var(--color-border);
  padding: 16px 20px;
  border-radius: 4px 4px 0 0;
  background: white;
}
.modal-header .modal-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.modal-body { padding: 20px; font-size: 13px; color: var(--ink); }
.modal-body p { color: var(--fg2); }
.modal-footer {
  border-top: 1px solid var(--color-border);
  padding: 14px 20px;
  background: var(--color-off-white);
  border-radius: 0 0 4px 4px;
}

/* ---- Tabs ---- */
.tabs, .nav-tabs {
  display: flex;
  border-bottom: 1px solid var(--color-border);
  gap: 0;
  background: white;
  padding: 0 18px;
  margin-bottom: 20px;
}
.tabs .tab, .nav-tabs .nav-link {
  padding: 14px 2px;
  margin-right: 22px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  border-radius: 0;
}
.tabs .tab.on, .tabs .tab.active, .nav-tabs .nav-link.active {
  color: var(--color-red);
  border-bottom-color: var(--color-red);
  background: none;
  font-weight: 800;
}
.tabs .tab:hover, .nav-tabs .nav-link:hover { color: var(--ink); }
.nav-tabs .nav-link.active:hover { color: var(--color-red); }
.tabs .tab .c {
  font-size: 10px;
  background: var(--color-off-white);
  color: var(--ink-muted);
  padding: 1px 7px;
  border-radius: 9999px;
  font-weight: 700;
}
.tabs .tab.on .c { background: var(--color-red-subtle); color: var(--color-red); }

/* ---- List groups ---- */
.list-group {
  border-radius: 4px;
  border-color: var(--color-border);
}
.list-group-item {
  border-color: var(--color-border);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--ink);
  background: white;
}
.list-group-item:first-child { border-top-left-radius: 4px; border-top-right-radius: 4px; }
.list-group-item:last-child { border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; }
.list-group-item:hover { background: var(--color-off-white); }

/* ---- Breadcrumb (Bootstrap) ---- */
.breadcrumb {
  font-size: 12px;
  color: var(--ink-muted);
  padding: 0;
  margin-bottom: 16px;
  font-weight: 500;
}
.breadcrumb-item { color: var(--ink-muted); }
.breadcrumb-item a { color: var(--ink-muted); }
.breadcrumb-item a:hover { color: var(--color-red); }
.breadcrumb-item.active { color: var(--ink); font-weight: 700; }
.breadcrumb-item + .breadcrumb-item::before { color: var(--color-border); }

/* ---- Page section / empty state ---- */
.sec { margin-bottom: 32px; }
.sec-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.sec-title {
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
}
.sec-desc { font-size: 12.5px; color: var(--ink-muted); }
.sec-actions { margin-left: auto; display: flex; gap: 8px; }

.empty {
  padding: 48px 24px;
  text-align: center;
  background: white;
  border: 1px dashed var(--color-border);
  border-radius: 4px;
}
.empty-ic {
  width: 48px;
  height: 48px;
  background: var(--color-off-white);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  margin-bottom: 12px;
}
.empty-ic i, .empty-ic .bi { font-size: 20px; }
.empty-t { font-size: 15px; font-weight: 800; color: var(--ink); margin-bottom: 4px; }
.empty-d { font-size: 12.5px; color: var(--ink-muted); margin-bottom: 16px; }

/* ---- Grid helpers ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Split body with aside (project detail pattern) */
.split-body { display: grid; grid-template-columns: 1fr 340px; gap: 24px; }
.split-body .main > * + * { margin-top: 20px; }
.split-body .aside > * + * { margin-top: 16px; }
@media (max-width: 1100px) { .split-body { grid-template-columns: 1fr; } }

/* ---- Tool cards (navigation grid) ---- */
.tool-card {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 20px;
  transition: all var(--motion-fast);
  text-decoration: none;
  color: var(--ink);
  display: block;
}
.tool-card:hover {
  border-color: var(--color-red);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: var(--ink);
}
.tool-card-ic {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-red-subtle);
  color: var(--color-red);
  font-size: 18px;
  border-radius: 4px;
  margin-bottom: 12px;
}
.tool-card-t { font-size: 14px; font-weight: 800; margin-bottom: 4px; color: var(--ink); }
.tool-card-d { font-size: 12px; color: var(--ink-muted); line-height: 1.45; }
.tool-card-n {
  margin-top: 12px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--color-red);
}

.responsavel-card:hover {
  border-color: var(--color-red) !important;
  transform: translateY(-2px);
  box-shadow: 0 .5rem 1rem rgba(232,25,44,.14);
}

/* ---- SWOT boxes (4 quadrants) ---- */
.swot-box {
  padding: 14px 16px;
  border-radius: 4px;
  background: var(--color-off-white);
  border-left: 3px solid var(--ink-muted);
  height: 100%;
}
.swot-box h6 {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.swot-strengths { background: var(--green-sub); border-left-color: var(--green); }
.swot-strengths h6 { color: var(--green-text); }
.swot-weaknesses { background: var(--color-red-subtle); border-left-color: var(--color-red); }
.swot-weaknesses h6 { color: var(--color-red-dark); }
.swot-opportunities { background: var(--blue-sub); border-left-color: var(--blue); }
.swot-opportunities h6 { color: var(--blue-text); }
.swot-threats { background: var(--yellow-sub); border-left-color: var(--yellow); }
.swot-threats h6 { color: var(--yellow-text); }

.swot-item { animation: fade-in var(--motion-medium) ease-out; }
@keyframes fade-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- OKR ---- */
.okr-card {
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: white;
  transition: border-color var(--motion-fast);
}
.okr-card:hover { border-color: var(--color-red); }
.okr-header {
  background: var(--color-off-white);
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border);
}
.key-result-item {
  padding: 10px 12px;
  background: var(--color-off-white);
  border-radius: 4px;
  margin-bottom: 8px;
  border: 1px solid var(--color-border);
}
.key-result-item:last-child { margin-bottom: 0; }
.kr-badge {
  display: inline-block;
  background: var(--color-red-subtle);
  color: var(--color-red);
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 800;
  margin-right: 8px;
  letter-spacing: 0.04em;
}
.kr-text { color: var(--ink); font-size: 13px; }
.kr-author {
  display: block;
  margin-top: 4px;
  margin-left: 0;
  font-size: 11px;
  color: var(--ink-muted);
}
.key-result-input { animation: fade-in var(--motion-medium) ease-out; }

/* ---- 5W2H ---- */
.fivew2h-card {
  border: 1px solid var(--color-border);
  border-radius: 4px;
  transition: border-color var(--motion-fast);
}
.fivew2h-card:hover { border-color: var(--color-red); }
.fivew2h-box {
  background: var(--color-off-white);
  border-radius: 4px;
  padding: 14px 16px;
  height: 100%;
  border-left: 3px solid var(--ink-muted);
}
.fivew2h-label { margin-bottom: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fivew2h-label .badge {
  background: var(--ink-muted) !important;
  color: white !important;
  font-size: 10px;
  padding: 3px 8px;
  letter-spacing: 0.08em;
  font-weight: 800;
}
.fivew2h-label small { color: var(--ink-muted); font-size: 11px; font-weight: 600; }
.fivew2h-content { color: var(--ink); white-space: pre-line; font-size: 13px; }

.fivew2h-what { border-left-color: var(--blue); }
.fivew2h-what .badge { background: var(--blue) !important; color: white !important; }
.fivew2h-why { border-left-color: var(--purple); }
.fivew2h-why .badge { background: var(--purple) !important; color: white !important; }
.fivew2h-where { border-left-color: var(--green); }
.fivew2h-where .badge { background: var(--green) !important; color: white !important; }
.fivew2h-when { border-left-color: var(--yellow); }
.fivew2h-when .badge { background: var(--yellow) !important; color: var(--ink) !important; }
.fivew2h-who { border-left-color: var(--color-red); }
.fivew2h-who .badge { background: var(--color-red) !important; color: white !important; }
.fivew2h-how { border-left-color: var(--ink); }
.fivew2h-how .badge { background: var(--ink) !important; color: white !important; }
.fivew2h-howmuch { border-left-color: #14B8A6; }
.fivew2h-howmuch .badge { background: #14B8A6 !important; color: white !important; }

/* ---- Strategic Dashboard ---- */
.strategic-dashboard-card {
  border: 1px solid var(--color-border);
  border-radius: 4px;
  transition: border-color var(--motion-fast);
}
.strategic-dashboard-card:hover { border-color: var(--color-red); }
.dashboard-area {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  height: 100%;
  overflow: hidden;
}
.area-header {
  background: var(--color-off-white);
  padding: 12px 16px;
  border-bottom: 2px solid var(--color-red);
}
.area-header strong {
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.14em;
  font-weight: 800;
  color: var(--color-red);
}
.area-metrics { padding: 12px; min-height: 100px; }
.metric-item {
  background: var(--color-off-white);
  border-radius: 4px;
  padding: 8px 12px;
  margin-bottom: 8px;
  transition: background var(--motion-fast);
  border: 1px solid transparent;
}
.metric-item:hover { background: white; border-color: var(--color-border); }
.metric-item:last-child { margin-bottom: 0; }
.metric-stale {
  border-left: 3px solid var(--color-red);
  background: var(--color-red-subtle) !important;
}
.metric-content { display: flex; align-items: flex-start; gap: 8px; }
.metric-icon { font-size: 13px; flex-shrink: 0; }
.metric-description { font-size: 12.5px; color: var(--ink); line-height: 1.45; }
.metric-responsible { font-size: 11px; color: var(--ink-muted); margin-left: 1.4rem; display: block; margin-top: 2px; }
.metric-icon.text-success { color: var(--green-text) !important; }
.metric-icon.text-danger { color: var(--color-red) !important; }
.metric-icon.text-warning { color: var(--yellow-text) !important; }

/* ---- Canvas Disrupt ---- */
.canvas-disrupt-card {
  border: 1px solid var(--color-border);
  border-radius: 4px;
  transition: border-color var(--motion-fast);
}
.canvas-disrupt-card:hover { border-color: var(--color-ink); }
.canvas-section { border: 1px solid var(--color-border); border-radius: 4px; }
.canvas-section-body {
  min-height: 120px;
  max-height: 300px;
  overflow-y: auto;
  padding: 10px;
}
.canvas-item {
  background: var(--color-off-white);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 12.5px;
  border: 1px solid transparent;
  margin-bottom: 6px;
  transition: all var(--motion-fast);
}
.canvas-item:hover { background: white; border-color: var(--color-border); }
.canvas-item-actions { opacity: 0; transition: opacity var(--motion-fast); }
.canvas-item:hover .canvas-item-actions { opacity: 1; }
.hypothesis-card { border: 1px solid var(--color-red); }
.hypothesis-card .card-header { border-bottom: 2px solid var(--color-red); }
.hypothesis-card .card-footer { border-top: 2px solid var(--yellow); }

/* ---- Comments ---- */
.comments-list { margin-top: 16px; }
.comment {
  background: white;
  border-radius: 4px;
  padding: 14px 16px;
  margin-bottom: 12px;
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-red);
}
.comment-reply {
  background: var(--color-off-white);
  border-left-color: var(--ink-muted);
  border-left-width: 2px;
  margin-left: 3rem;
  margin-top: 8px;
  margin-bottom: 8px;
  padding: 12px 14px;
  font-size: 13px;
  box-shadow: none;
  position: relative;
}
.comment-reply::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 1rem;
  width: 1rem;
  height: 2px;
  background: var(--color-border);
}
.comment-replies {
  margin-top: 8px;
  padding-left: 0;
  border-left: 2px solid var(--color-border);
  margin-left: 1rem;
}
.comment-header { margin-bottom: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.comment-header .author-name { font-weight: 800; font-size: 13px; color: var(--ink); }
.comment-header .author-role { font-size: 10px; color: var(--ink-muted); font-weight: 600; }
.comment-header .comment-time { font-size: 11px; color: var(--ink-muted); margin-left: auto; }
.comment-reply .comment-header img,
.comment-reply .avatar-placeholder {
  width: 28px !important;
  height: 28px !important;
  font-size: 11px !important;
}
.comment-content { line-height: 1.55; color: var(--ink-med); font-size: 13px; }
.comment-content p { margin-bottom: 6px; }
.comment-content p:last-child { margin-bottom: 0; }
.comment-content .mention { color: var(--color-red); font-weight: 700; }
.comment-attachments { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.comment-attachments .badge { background: var(--color-off-white) !important; color: var(--ink-med) !important; border: 1px solid var(--color-border); font-weight: 600; padding: 4px 8px; }
.comment-actions { margin-top: 8px; display: flex; gap: 14px; font-size: 11px; color: var(--ink-muted); font-weight: 600; }
.comment-actions a, .comment-actions button {
  color: var(--ink-muted);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color var(--motion-fast);
}
.comment-actions a:hover, .comment-actions button:hover { color: var(--color-red); }

.avatar-placeholder {
  font-weight: 800;
  background: linear-gradient(135deg,#E8192C,#8B1016);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.reply-form {
  background: white;
  padding: 12px;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  margin-top: 10px;
}

/* ---- Quill editor ---- */
.quill-editor, .quill-editor-small {
  background: white;
  border-radius: 4px;
}
.quill-editor .ql-editor { min-height: 100px; font-family: var(--f); }
.quill-editor-small .ql-editor { min-height: 60px; font-family: var(--f); }
.ql-toolbar.ql-snow {
  border-radius: 4px 4px 0 0;
  border-color: var(--color-border);
  background: var(--color-off-white);
}
.ql-container.ql-snow {
  border-radius: 0 0 4px 4px;
  border-color: var(--color-border);
  font-family: var(--f);
  font-size: 13px;
}
.ql-snow .ql-picker { font-family: var(--f); }

/* ---- Navbar link (light header on public pages) ---- */
.public-nav {
  background: white;
  border-bottom: 1px solid var(--color-border);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.public-nav-logo { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; text-decoration: none; font-size: 13px; }
.public-nav-logo img { height: 22px; }
.public-nav-logo em { font-family: var(--fe); font-style: italic; font-weight: 300; color: var(--color-red); font-size: 16px; line-height: 1; }

/* ---- Login shell ---- */
body.login-shell {
  background: var(--color-ink);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}
.login-card {
  background: white;
  width: 100%;
  max-width: 380px;
  border-radius: 4px;
  padding: 32px;
  box-shadow: var(--shadow-lg);
}
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--color-border); }
.login-brand-logo-img { height: 22px; width: auto; }
.login-brand-name { font-family: var(--fe); font-style: italic; font-weight: 300; color: var(--color-red); font-size: 18px; line-height: 1; }
.login-title { font-size: 20px; font-weight: 900; letter-spacing: -0.02em; margin-bottom: 4px; }
.login-sub { font-size: 12.5px; color: var(--ink-muted); margin-bottom: 20px; }

/* ---- Utilities ---- */
.text-red, .text-primary, .text-danger { color: var(--color-red) !important; }
.text-ink { color: var(--ink) !important; }
.text-success { color: var(--green-text) !important; }
.text-warning { color: var(--yellow-text) !important; }
.text-info { color: var(--blue-text) !important; }
.text-muted { color: var(--ink-muted) !important; }

.bg-red, .bg-primary, .bg-danger { background-color: var(--color-red) !important; color: white; }
.bg-ink, .bg-dark { background-color: var(--color-ink) !important; color: white; }
.bg-off { background-color: var(--color-off-white) !important; }
.bg-light { background-color: var(--color-off-white) !important; }
.bg-success { background-color: var(--green) !important; color: white; }
.bg-warning { background-color: var(--yellow) !important; color: var(--ink); }
.bg-info { background-color: var(--blue) !important; color: white; }

.shadow-sm, .shadow { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }

.rounded { border-radius: 4px !important; }
.rounded-pill { border-radius: 9999px !important; }

hr { border: 0; border-top: 1px solid var(--color-border); margin: 20px 0; }

/* Fix dropdown overflow in tables */
.table-responsive { overflow: visible; }
@media (max-width: 767.98px) {
  .table-responsive { overflow-x: auto; }
}

/* Focus ring consistency */
*:focus-visible { outline: 2px solid var(--color-red); outline-offset: 2px; }
button:focus-visible, a:focus-visible, .btn:focus-visible { outline-offset: 2px; }

/* ---- Mobile offcanvas backdrop: fixed by default so it doesn't steal the grid cell ---- */
.sb-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(24,20,20,0.5);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--motion-medium);
}
.sb-backdrop.on { opacity: 1; pointer-events: auto; }

/* ---- Mobile: sidebar offcanvas behavior ---- */
@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; }
  .sb {
    position: fixed;
    top: 0;
    left: 0;
    width: 232px;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform var(--motion-medium);
    box-shadow: var(--shadow-lg);
  }
  .sb.open { transform: translateX(0); }
  .top-toggle { display: inline-flex; }
  .body-wrap { padding: 16px; }
  .ph { padding: 20px 16px 16px; margin: 0 -16px 16px; }
}

/* ---- Print ---- */
@media print {
  .sb, .top, .toast-stack, .sb-backdrop { display: none !important; }
  .app { grid-template-columns: 1fr; }
  body { background: white; }
}
