/* =====================================================
   HERMES DESIGN SYSTEM — v2.0
   Black/White Brand · shadcn/ui Minimal · Dark Mode
   ===================================================== */
:root {
  /* ── Brand Accent (single source — change here to rebrand) ── */
  --brand: #0a0a0a;
  --brand-light: #27272a;
  --brand-lighter: #f4f4f5;
  --brand-foreground: #ffffff;
  --brand-rgb: 10, 10, 10;

  /* ── Grayscale Color Palette (zinc scale) ── */
  --background: #fafafa;
  --foreground: #0a0a0a;

  --card: #ffffff;
  --card-foreground: #0a0a0a;
  --card-rgb: 255, 255, 255;

  --popover: #ffffff;
  --popover-foreground: #0a0a0a;

  --primary: #18181b;          /* zinc-900 — neutral dark */
  --primary-foreground: #fafafa;

  --secondary: #f4f4f5;        /* zinc-100 */
  --secondary-foreground: #18181b;

  --muted: #f4f4f5;
  --muted-foreground: #71717a; /* zinc-500 */

  --accent: #f4f4f5;
  --accent-foreground: #18181b;

  --destructive: #ef4444;
  --destructive-foreground: #fef2f2;

  --border: #e4e4e7;           /* zinc-200 */
  --input: #e4e4e7;
  --ring: var(--brand);

  /* ── Semantic Colors ── */
  --success-color: #22c55e;
  --warning-color: #f59e0b;
  --danger-color: var(--destructive);
  --info-color: #3b82f6;

  /* ── Spacing Scale (4px grid) ── */
  --space-0: 0;
  --space-0-5: 0.125rem;  /* 2px */
  --space-1: 0.25rem;     /* 4px */
  --space-1-5: 0.375rem;  /* 6px */
  --space-2: 0.5rem;      /* 8px */
  --space-2-5: 0.625rem;  /* 10px */
  --space-3: 0.75rem;     /* 12px */
  --space-4: 1rem;        /* 16px */
  --space-5: 1.25rem;     /* 20px */
  --space-6: 1.5rem;      /* 24px */
  --space-8: 2rem;        /* 32px */
  --space-10: 2.5rem;     /* 40px */
  --space-12: 3rem;       /* 48px */

  /* ── Border Radius Scale ── */
  --radius-sm: 0.375rem;  /* 6px  */
  --radius-md: 0.5rem;    /* 8px  */
  --radius-lg: 0.75rem;   /* 12px */
  --radius-xl: 1rem;      /* 16px */
  --radius-2xl: 1.25rem;  /* 20px */
  --radius-full: 9999px;

  /* ── Typography Scale ── */
  --text-xs: 0.75rem;     /* 12px */
  --text-sm: 0.875rem;    /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg: 1.125rem;    /* 18px */
  --text-xl: 1.25rem;     /* 20px */
  --text-2xl: 1.5rem;     /* 24px */
  --text-3xl: 2rem;       /* 32px */

  /* ── Shadows — Light Mode ── */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 2px 4px 0 rgb(0 0 0 / 0.06), 0 1px 2px 0 rgb(0 0 0 / 0.03);
  --shadow-lg: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -1px rgb(0 0 0 / 0.06);
  --shadow-xl: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.05);

  /* ── LEGACY aliases — point to canonical tokens (for chat-styles.css compat) ── */
  --primary-color: var(--foreground);
  --secondary-color: var(--muted-foreground);
  --accent-color: var(--brand);
  --surface-color: var(--background);
  --surface-elevated: var(--card);
  --text-primary: var(--card-foreground);
  --text-secondary: var(--muted-foreground);
  --text-tertiary: #a1a1aa;
  --border-color: var(--border);
  --border-accent: #d4d4d8;
}

/* ── Dark Mode ── */
html.dark {
  --background: #09090b;       /* zinc-950 */
  --foreground: #fafafa;

  --card: #111113;
  --card-foreground: #fafafa;
  --card-rgb: 17, 17, 19;

  --popover: #18181b;
  --popover-foreground: #fafafa;

  --primary: #fafafa;
  --primary-foreground: #09090b;

  --secondary: #27272a;         /* zinc-800 */
  --secondary-foreground: #fafafa;

  --muted: #27272a;
  --muted-foreground: #a1a1aa;  /* zinc-400 */

  --accent: #27272a;
  --accent-foreground: #fafafa;

  --destructive: #f87171;       /* red-400 (brighter on dark) */
  --destructive-foreground: #450a0a;

  --border: #27272a;
  --input: #27272a;
  --ring: #fafafa;              /* white ring for dark */

  --brand: #fafafa;
  --brand-light: #d4d4d8;
  --brand-lighter: #27272a;
  --brand-foreground: #09090b;
  --brand-rgb: 250, 250, 250;

  --success-color: #34d399;
  --warning-color: #fbbf24;
  --info-color: #60a5fa;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 2px 4px 0 rgb(0 0 0 / 0.35), 0 1px 2px 0 rgb(0 0 0 / 0.2);
  --shadow-lg: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -1px rgb(0 0 0 / 0.25);
  --shadow-xl: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -2px rgb(0 0 0 / 0.3);

  /* Legacy overrides for dark */
  --primary-color: var(--foreground);
  --accent-color: var(--brand);
  --text-tertiary: #71717a;
  --border-accent: #3f3f46;     /* zinc-700 */
}

/* Dark mode select caret — brighter arrow */
html.dark select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a1a1aa' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E");
}

/* Theme icon CSS toggling (dark mode shows moon, light shows sun) */
html.dark .theme-icon-light { display: none !important; }
html.dark .theme-icon-dark  { display: block !important; }

/* Smooth dark mode transitions for all surfaces */
html.dark *,
html.dark *::before,
html.dark *::after {
  transition-property: background-color, border-color, color, box-shadow;
  transition-duration: 0.3s;
  transition-timing-function: ease;
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  line-height: 1.6;
  color: var(--foreground);
  background-color: var(--background);
  font-size: 15px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: color 0.3s ease, background-color 0.3s ease;
}

.container {
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  padding: 0 2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

main.container {
  padding: 0;
  max-width: none;
  overflow: hidden;
}

/* Modern Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

h1 { font-size: 2.25rem; font-weight: 700; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

/* ── Global Form Fields — shadcn/ui style ─────────────────────────── */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="date"],
input[type="search"],
input[type="url"],
input[type="datetime-local"],
textarea,
select,
.form-control {
  width: 100%;
  padding: var(--space-2) var(--space-3);        /* 8px 12px */
  font-family: inherit;
  font-size: var(--text-sm);                     /* 14px */
  line-height: 1.5;
  color: var(--foreground);
  background-color: var(--card);
  border: 1px solid var(--input);
  border-radius: var(--radius-md);               /* 8px */
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease,
              box-shadow 0.15s ease,
              background-color 0.3s ease;
  -webkit-appearance: none;
  appearance: none;
}

/* Focus ring — brand-tinted */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
input[type="datetime-local"]:focus,
textarea:focus,
select:focus,
.form-control:focus {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.15);
  background-color: var(--card);
}

/* Placeholder styling */
input::placeholder,
textarea::placeholder,
.form-control::placeholder {
  color: var(--muted-foreground);
  opacity: 0.7;
}

/* Disabled / read-only state */
input:disabled,
textarea:disabled,
select:disabled,
.form-control:disabled,
input:read-only:not([type="checkbox"]):not([type="radio"]),
textarea:read-only {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: var(--muted);
}

/* Textarea — preserve resize handle */
textarea {
  resize: vertical;
  min-height: 72px;
}

/* Select — caret arrow */
select {
  padding-right: var(--space-8);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2371717a' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  background-size: 12px;
  cursor: pointer;
}

/* Auto-width selects (pagination, filters inline) keep natural width */
select.auto-w,
.pagination-settings select,
.filter-select {
  width: auto;
}

/* Form group — label + input pattern */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1-5);
  margin-bottom: var(--space-4);
}

/* Desktop release/update status */
.desktop-update-card {
  max-width: 760px;
}

.desktop-update-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--primary-color) 5%, var(--card));
}

.desktop-update-label,
.desktop-update-checked,
.desktop-update-note {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.desktop-update-label {
  display: block;
  margin-bottom: 0.25rem;
}

.desktop-update-badge {
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border-color);
  background: var(--background);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.desktop-update-badge[data-phase="ready"],
.desktop-update-badge[data-phase="up-to-date"] {
  color: #10b981;
  border-color: color-mix(in srgb, #10b981 45%, transparent);
}

.desktop-update-badge[data-phase="checking"],
.desktop-update-badge[data-phase="downloading"],
.desktop-update-badge[data-phase="blocked"] {
  color: #f59e0b;
  border-color: color-mix(in srgb, #f59e0b 45%, transparent);
}

.desktop-update-badge[data-phase="error"] {
  color: #ef4444;
  border-color: color-mix(in srgb, #ef4444 45%, transparent);
}

.desktop-update-message {
  margin: 1rem 0 0.35rem;
}

.desktop-update-checked,
.desktop-update-note {
  margin: 0.35rem 0 0;
}

.desktop-update-blockers {
  margin-top: 0.8rem;
  padding: 0.7rem 0.85rem;
  border-left: 3px solid #f59e0b;
  border-radius: 0.35rem;
  background: color-mix(in srgb, #f59e0b 10%, transparent);
  color: var(--foreground);
  font-size: 0.86rem;
}

.desktop-update-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.form-group label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--foreground);
}

/* Header — Frosted glass */
header {
  background-color: rgba(var(--card-rgb), 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-primary);
  padding: var(--space-2) 0;
  box-shadow: none;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.logo {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--brand);
  display: flex;
  align-items: center;
}

.logo #header-logo-img {
  max-height: 40px;
  max-width: 180px;
  object-fit: contain;
  border-radius: 8px;
  border: 1.5px solid var(--border-color);
  padding: 3px 8px;
  background: var(--card-bg);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.15s ease;
}

#notif-bell-btn {
  position: relative;
}

.nav-icon-btn:hover {
  background: var(--secondary);
  color: var(--foreground);
}

.nav-icon-btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* Text buttons with icons used by compact header actions. */
.nav-text-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  height: 36px;
  padding: 0 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--brand);
  background: transparent;
  color: var(--brand);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.nav-text-btn:hover {
  background: var(--brand);
  color: var(--brand-foreground);
}
.nav-text-btn svg {
  flex-shrink: 0;
}
/* Reuse loading states */
.nav-text-btn.nav-icon-btn--loading svg {
  animation: nav-btn-spin 0.8s linear infinite;
}
.nav-text-btn.nav-icon-btn--loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Loading spinner on nav button (eProc check) */
@keyframes nav-btn-spin {
  to { transform: rotate(360deg); }
}
.nav-icon-btn--loading svg {
  animation: nav-btn-spin 0.8s linear infinite;
}
.nav-icon-btn--loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Account dropdown */
.nav-dropdown-wrapper {
  position: relative;
}

.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 200;
  overflow: hidden;
  animation: dropdownFadeIn 0.12s ease;
}

.nav-dropdown.open {
  display: block;
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.nav-dropdown-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
}

.nav-dropdown-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.nav-dropdown-user {
  flex: 1;
  min-width: 0;
}

.nav-dropdown-name {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-dropdown-email {
  display: block;
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-dropdown-divider {
  height: 1px;
  background: var(--border);
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.6rem 1rem;
  background: none;
  border: none;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.1s ease;
  font-family: inherit;
}

.nav-dropdown-item:hover {
  background: var(--secondary);
  color: var(--text-primary);
}

.nav-dropdown-danger {
  color: var(--destructive);
}

.nav-dropdown-danger:hover {
  background: rgba(239,68,68,.08);
  color: var(--destructive);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 0.5rem;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.nav-links a:hover {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
}

.nav-links a#logout-btn {
    color: var(--danger-color);
}

.nav-links a#logout-btn:hover {
    background-color: var(--destructive-foreground);
    color: var(--danger-color);
}

.nav-links svg {
  opacity: 0.8;
}

/* Asymmetrical Dashboard Layout */
.dashboard {
  display: flex;
  flex: 1;
  margin: 0;
  min-height: 0;
  max-height: calc(100vh - 70px);
  overflow: hidden;
}

.dashboard-sidebar {
  background: var(--card);
  border-radius: 0;
  border-right: 1px solid var(--border);
  box-shadow: none;
  padding: var(--space-3);
  width: 58px;
  min-width: 58px;
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              min-width 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              padding 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              background-color 0.3s ease,
              border-color 0.3s ease;
}

.dashboard-sidebar:hover {
  width: 240px;
  min-width: 240px;
  padding: var(--space-3) var(--space-4);
}

.dashboard-sidebar h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.dashboard-main {
  flex: 1;
  padding: 2rem 2.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-height: 0;
}

.dashboard-main.chat-active {
  padding: 0;
  overflow: hidden;
}

.dashboard-main.criar-doc-active {
  padding: 0;
  overflow: hidden;
  gap: 0;
}

.dashboard-main.np-active {
  padding: 0;
  overflow: hidden;
  gap: 0;
}

/* Modern Sidebar Menu */
.sidebar-menu {
  list-style: none;
}

.sidebar-menu li {
  margin-bottom: 0.25rem;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: var(--space-2-5);
  color: var(--muted-foreground);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
  font-size: var(--text-sm);
  position: relative;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-menu a span {
  width: 0;
  opacity: 0;
  overflow: hidden;
  transition: width 0.2s ease, opacity 0.15s ease;
}

.dashboard-sidebar:hover .sidebar-menu a {
  justify-content: flex-start;
  gap: 0.75rem;
  padding: var(--space-2-5) 0.85rem;
}

.dashboard-sidebar:hover .sidebar-menu a span {
  width: auto;
  opacity: 1;
}

.sidebar-menu a:hover {
  background-color: var(--brand-lighter);
  color: var(--brand);
  transform: translateX(0);
}

.sidebar-menu a:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.sidebar-menu a.active {
  background: var(--brand);
  color: var(--brand-foreground);
  box-shadow: var(--shadow-sm);
}

.sidebar-menu svg {
  width: 18px;
  height: 18px;
  min-width: 18px;
  opacity: 0.9;
}

/* Modern Card Design */
.card {
  background: var(--card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--space-8);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.card-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
  background: transparent;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.card-body {
  padding: 2rem;
}

/* Modern Dashboard Overview - Asymmetrical Grid */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.dashboard-header h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.dashboard-overview {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 0;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.dashboard-overview.collapsed {
  max-height: 0;
  opacity: 0;
  transform: translateY(-20px);
  margin-bottom: 0;
  overflow: hidden;
}

.overview-card {
  background: var(--card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: var(--space-6);
  min-height: auto;
  border: 1px solid var(--border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.overview-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--info-color));
}

.overview-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* Billing Stats Container */
.billing-stats-container {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.billing-stat-card {
  flex: 1;
  min-width: 200px;
  text-align: center;
  padding: var(--space-6);
  background: var(--card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.billing-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--info-color));
}

.billing-stat-card:hover {
  background: var(--background);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
  line-height: 1;
  display: block;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
  line-height: 1.2;
}

/* Responsive Billing Stats */
@media (max-width: 1024px) {
  .billing-stats-container {
    gap: 1rem;
  }
  
  .billing-stat-card {
    min-width: 180px;
    padding: 1.25rem;
  }
}

@media (max-width: 768px) {
  .billing-stats-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .billing-stat-card {
    min-width: unset;
    padding: 1rem;
  }
  
  .stat-number {
    font-size: 1.25rem;
  }
}

@media (max-width: 480px) {
  .billing-stats-container {
    grid-template-columns: 1fr;
  }
  
  .billing-stat-card {
    padding: 1rem;
  }
  
  .stat-number {
    font-size: 1.125rem;
  }
  
  .stat-label {
    font-size: 0.6875rem;
  }
}

.overview-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.overview-title svg {
  color: var(--brand);
  opacity: 0.8;
}

/* Modern Button Design */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-lg);
  font-weight: 500;
  font-size: var(--text-sm);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--brand);
  color: var(--brand-foreground);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--brand);
}

.btn-primary:hover {
  background: var(--brand-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface-color);
  color: var(--text-secondary);
  border: 1px solid var(--border-accent);
}

.btn-secondary:hover {
  background: var(--border-color);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.btn svg {
  width: 16px;
  height: 16px;
}

/* Modern Table Design */
.table-responsive {
  overflow-x: auto;
  border-radius: 0.75rem;
  border: 1px solid var(--border-color);
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface-elevated);
}

.table th {
  padding: 1rem 1.5rem;
  text-align: left;
  background: var(--surface-color);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
}

.table td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.table tbody tr {
  transition: all 0.2s ease;
}

.table tbody tr.table-row-clickable {
  cursor: pointer;
}

.table tbody tr.table-row-clickable:hover {
  background-color: rgba(113, 128, 150, 0.08);
}

.table tbody tr:hover {
  background-color: var(--surface-color);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* Modern Status Badges */
.status {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  border-radius: 2rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-active {
  background-color: rgba(56, 161, 105, 0.1);
  color: var(--success-color);
  border: 1px solid rgba(56, 161, 105, 0.2);
}

.status-pending {
  background-color: rgba(214, 158, 46, 0.1);
  color: var(--warning-color);
  border: 1px solid rgba(214, 158, 46, 0.2);
}

.status-closed, .status-inactive {
  background-color: rgba(229, 62, 62, 0.1);
  color: var(--danger-color);
  border: 1px solid rgba(229, 62, 62, 0.2);
}

/* Modern Search & Filters */
.search-bar {
  display: flex;
  margin-bottom: 1.5rem;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.search-bar input {
  flex: 1;
  padding: 0.875rem 1.25rem;
  border-right: none;
  border-radius: 0;                 /* flush with adjacent button */
  border-top-left-radius: var(--radius-lg);
  border-bottom-left-radius: var(--radius-lg);
}

.search-bar input::placeholder {
  color: var(--text-tertiary);
}

.search-bar button {
  padding: 0.875rem 1.25rem;
  background: var(--brand);
  color: var(--brand-foreground);
  border: 1px solid var(--brand);
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-bar button:hover {
  background: var(--brand-light);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.filter-select {
  /* inherits global select styling — just keep layout specifics */
  padding: 0.75rem 1rem;
  min-width: 160px;
  width: auto;
}

/* Modern Tabs */
.tabs {
  display: flex;
  list-style: none;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--border-color);
}

.tabs a {
  display: block;
  padding: 1rem 1.5rem;
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  border-bottom: 3px solid transparent;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tabs a.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  background: linear-gradient(180deg, transparent, rgba(45, 55, 72, 0.05));
}

.tabs a:hover {
  color: var(--text-primary);
}

/* Modern Pagination */
.pagination {
  display: flex;
  justify-content: center;
  list-style: none;
  margin-top: 2rem;
  gap: 0.5rem;
}

.pagination a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  text-decoration: none;
  color: var(--text-secondary);
  background: var(--surface-elevated);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
  font-weight: 500;
}

.pagination a:hover {
  background: var(--surface-color);
  color: var(--text-primary);
}

.pagination a.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Dashboard Enhancements */
#toggle-dashboard {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

/* Priority Deadlines Styling */
.deadline-item {
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 0.75rem;
  background: var(--surface-color);
  border-left: 4px solid var(--accent-color);
  transition: all 0.2s ease;
}

.deadline-item:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

.deadline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.deadline-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.deadline-days {
  background: var(--accent-color);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.deadline-case {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.deadline-date {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

/* Flow Statistics */
.flow-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.flow-stat {
  text-align: center;
  padding: 1.25rem;
  background: var(--surface-color);
  border-radius: 0.75rem;
  border: 1px solid var(--border-color);
}

.flow-stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
  line-height: 1;
}

.flow-stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* Attorney Workload */
.attorney-workloads {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.attorney-workload {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem;
  background: var(--surface-color);
  border-radius: 0.5rem;
}

.attorney-info {
  display: flex;
  flex-direction: column;
}

.attorney-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.attorney-cases {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.workload-bar {
  height: 8px;
  background: var(--border-color);
  border-radius: 1rem;
  overflow: hidden;
}

.workload-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-color), var(--info-color));
  border-radius: inherit;
}

.utilization {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 40px;
  text-align: right;
}

/* Money Flow Enhancements */
.money-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.money-stat {
  text-align: center;
  padding: 1.25rem;
  background: var(--surface-color);
  border-radius: 0.75rem;
  border: 1px solid var(--border-color);
}

.money-stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
}

.money-stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.progress-bar {
  height: 6px;
  background: var(--border-color);
  border-radius: 1rem;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: var(--success-color);
  border-radius: inherit;
}

.progress-text {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

/* Recent Transactions */
.recent-transactions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.transaction-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  background: var(--surface-color);
  border-radius: 0.75rem;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.transaction-item:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.transaction-info {
  display: flex;
  flex-direction: column;
}

.transaction-client {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.transaction-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.transaction-amount {
  font-weight: 700;
  font-size: 0.875rem;
}

.transaction-amount.payment {
  color: var(--success-color);
}

.transaction-amount.expense {
  color: var(--danger-color);
}

.transaction-date {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  text-align: right;
}

/* Footer */
footer {
  background: var(--primary-color);
  color: rgba(255, 255, 255, 0.8);
  padding: 2rem 0;
  margin-top: 4rem;
  text-align: center;
}

/* Responsive Design */
@media screen and (max-width: 1200px) {
  .dashboard {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .dashboard-sidebar {
    position: static;
  }
  
  .flow-stats, .money-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
  
  .navbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .nav-links {
    flex-wrap: wrap;
  }
  
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .flow-stats, .money-stats {
    grid-template-columns: 1fr;
  }
  
  .attorney-workload {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

/* Lazy Loading Styles */
img[data-src], [data-bg] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img.loading, [data-bg].loading {
    opacity: 0.6;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

img.loaded, [data-bg].loaded {
    opacity: 1;
}

img.error {
    opacity: 0.5;
    filter: grayscale(100%);
}

/* Content Lazy Loading */
[data-lazy-content] {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.content-loading {
    opacity: 0.8;
    position: relative;
}

.content-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    );
    animation: shimmer 2s infinite;
    z-index: 1;
}

.content-loaded {
    opacity: 1;
}

/* Shimmer animation for loading states */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Progressive enhancement for tables */
.table tbody tr {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Cards animation enhancement */
.overview-card, .card {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Performance optimization - reduce repaints */
.lazy-container {
    will-change: opacity, transform;
    backface-visibility: hidden;
    perspective: 1000;
}

/* Intersection observer fallback */
.no-js img[data-src] {
    opacity: 1;
}

/* Preload critical resources */
.critical-resource {
    display: none;
}

/* Calendar full-height no-scroll layout */
#calendar-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ── Calendar topbar (compact header + filters + action) ─────────── */
.calendar-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 10px 0;
  flex-shrink: 0;
}

.calendar-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.calendar-topbar-title {
  font-size: .85rem;
  font-weight: 700;
  color: var(--text-secondary, #64748b);
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}

.cal-filter-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cal-filter-btn {
  padding: 4px 11px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: var(--surface-color);
  color: var(--text-muted, #888);
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}

.cal-filter-btn:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

#cfbtn-eventos.active {
  background: rgba(72, 187, 120, .15);
  color: #276749;
  border-color: rgba(72, 187, 120, .5);
}

#cfbtn-compromissos.active {
  background: rgba(245, 158, 11, .15);
  color: #92400e;
  border-color: rgba(245, 158, 11, .5);
}

.calendar-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.calendar-layout {
  display: flex;
  gap: 20px;
  flex: 1;
  min-height: 0;
  align-items: stretch;
}

.calendar-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.calendar-main > .card {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.calendar-main > .card > .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0;
}

.calendar-main .calendar-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.calendar-main .calendar-grid {
  flex: 1;
  min-height: 0;
}

.calendar-sidebar {
  width: 340px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  gap: 16px;
}

/* Day events overlay - expands from clicked cell to fill calendar */
.day-events-overlay {
  position: absolute;
  z-index: 50;
  background: var(--surface-elevated);
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition:
    left   0.32s cubic-bezier(0.4,0,0.2,1),
    top    0.32s cubic-bezier(0.4,0,0.2,1),
    width  0.32s cubic-bezier(0.4,0,0.2,1),
    height 0.32s cubic-bezier(0.4,0,0.2,1),
    opacity 0.28s ease,
    border-radius 0.32s ease;
}

.day-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  background: var(--card);
  flex-shrink: 0;
}

.day-overlay-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--card-foreground);
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.day-overlay-close {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
  margin-left: 12px;
}

.day-overlay-close:hover {
  color: var(--foreground);
  background: var(--accent);
}

.day-overlay-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Day hover popup ──────────────────────────────────────────────── */
.day-hover-popup {
  position: absolute;
  z-index: 60;
  width: 240px;
  max-height: 280px;
  background: var(--surface-elevated, #fff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  animation: dhp-appear .15s ease;
}

@keyframes dhp-appear {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dhp-header {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-secondary, #64748b);
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 8px 12px 6px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  flex-shrink: 0;
}

.dhp-body {
  overflow-y: auto;
  flex: 1;
  padding: 6px 0;
}

.dhp-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 12px;
  border-left: 3px solid #10b981;
  margin: 2px 8px;
  border-radius: 0 5px 5px 0;
  background: var(--muted);
}

.dhp-compromisso {
  border-left-color: #f59e0b;
}

.dhp-time {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 38px;
}

.dhp-label {
  font-size: .8rem;
  color: var(--text-primary, #1e293b);
  line-height: 1.3;
  word-break: break-word;
}

/* ── Generic Modal (JS-created .modal-overlay) ───────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, .5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(4px);
  animation: modal-fade-in .18s ease;
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-overlay .modal-content {
  background: var(--card);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
  width: 100%;
  max-width: 550px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modal-slide-in .2s cubic-bezier(.4, 0, .2, 1);
  overflow: hidden;
}

@keyframes modal-slide-in {
  from { opacity: 0; transform: translateY(-16px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-overlay .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-overlay .modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.modal-overlay .modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--muted-foreground);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
}
.modal-overlay .modal-close:hover {
  background: var(--accent);
  color: var(--foreground);
}

.modal-overlay .modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-overlay .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

/* ── Novo Compromisso Modal ───────────────────────────────────────── */
.comp-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: comp-overlay-in .18s ease;
}

@keyframes comp-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.comp-modal {
  background: var(--surface-elevated, #fff);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
  width: 100%;
  max-width: 540px;
  display: flex;
  flex-direction: column;
  animation: comp-modal-in .2s cubic-bezier(.4, 0, .2, 1);
  overflow: hidden;
}

@keyframes comp-modal-in {
  from { opacity: 0; transform: translateY(-16px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.comp-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.comp-modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--card-foreground);
  margin: 0;
}

.comp-modal-close {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}

.comp-modal-close:hover {
  color: var(--foreground);
  background: var(--accent);
}

.comp-modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.comp-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 16px;
}

.comp-row {
  display: flex;
  gap: 14px;
}

.comp-row .comp-field {
  flex: 1;
}

.comp-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* comp-input inherits global form field style; just add specifics */
.comp-input {
  /* sizing override */
  padding: 9px 12px;
  font-size: var(--text-sm);
}

.comp-input:focus {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.15);
}

.comp-textarea {
  /* inherits global textarea styles */
  font-family: inherit;
}

.comp-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color, #e2e8f0);
}

/* Convert Lead modal — mode toggle & client list */
.convert-mode-btn.active {
  background: var(--brand);
  color: var(--brand-foreground);
  border-color: var(--brand);
}
.convert-client-option:hover {
  background: var(--accent);
}

/* ── Global loading states ────────────────────────────────────────── */

/* Button inline spinner */
.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: _btn-spin .65s linear infinite;
  vertical-align: middle;
}

/* For outline/secondary buttons — dark spinner */
.btn-secondary .btn-spinner,
.btn-outline .btn-spinner {
  border-color: rgba(0,0,0,.15);
  border-top-color: var(--text-primary, #1e293b);
}

@keyframes _btn-spin {
  to { transform: rotate(360deg); }
}

/* Disabled state */
button:disabled {
  opacity: .65;
  cursor: not-allowed !important;
  pointer-events: none;
}

/* Item-level overlay (document row, compromisso card, table row) */
.item-load-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: inherit;
  backdrop-filter: blur(1px);
}

.item-load-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color, #e2e8f0);
  border-top-color: var(--primary-color, #2d3748);
  border-radius: 50%;
  animation: _btn-spin .7s linear infinite;
}

/* Calendar section loading overlay */
.cal-load-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: rgba(255,255,255,.82);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: inherit;
  backdrop-filter: blur(2px);
}

.cal-load-spinner {
  display: inline-block;
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-color, #e2e8f0);
  border-top-color: var(--primary-color, #2d3748);
  border-radius: 50%;
  animation: _btn-spin .8s linear infinite;
}

.cal-load-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.calendar-sidebar .mt-4 {
  margin-top: 0 !important;
}

@media (max-width: 1000px) {
  .calendar-layout {
    flex-direction: column;
  }
  .calendar-sidebar {
    width: 100%;
    max-height: 400px;
  }
}

/* Enhanced Calendar Styles */
.calendar-container {
    background: var(--surface-elevated);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.calendar-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.calendar-controls h4 {
    margin: 0;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 150px;
    text-align: center;
}

.calendar-controls .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    border-radius: 8px;
}

/* Calendar Header (Days of Week) */
.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: linear-gradient(135deg, var(--brand), var(--muted-foreground));
    color: var(--brand-foreground);
    margin: 0;
}

.calendar-header > div {
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(5, 1fr);
    background: var(--surface-elevated);
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Calendar Day Cells */
.calendar-day {
    min-height: 0;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    background: var(--surface-elevated);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.calendar-day:hover {
    background: rgba(49, 130, 206, 0.08);
    border-color: var(--info-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Day Number Styling */
.calendar-day .day-number {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    z-index: 2;
}

/* Different Month States */
.calendar-day.current-month {
    color: var(--text-primary);
    background: var(--surface-elevated);
}

.calendar-day.other-month {
    color: var(--muted-foreground);
    background: var(--muted);
}

.calendar-day.other-month:hover {
    background: var(--accent);
}

/* Today Highlighting */
.calendar-day.today {
    background: linear-gradient(135deg, var(--info-color), #2563eb);
    color: white;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(49, 130, 206, 0.3);
}

.calendar-day.today:hover {
    background: linear-gradient(135deg, #1e40af, #1d4ed8);
}

/* Selected Day */
.calendar-day.selected {
    background: linear-gradient(135deg, var(--brand), var(--muted-foreground));
    color: var(--brand-foreground);
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.2);
}

/* Event Indicators */
.calendar-day.has-events::before {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--success-color);
    border-radius: 50%;
    border: 2px solid var(--card);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    z-index: 3;
}

.calendar-day.has-multiple-events::before {
    background: var(--warning-color);
}

.calendar-day.has-important-events::before {
    background: var(--danger-color);
    animation: pulse-event 2s infinite;
}

@keyframes pulse-event {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

/* Event Preview in Calendar Cell */
.calendar-day .event-preview {
    font-size: 10px;
    color: var(--secondary-foreground);
    background: var(--secondary);
    padding: 2px 4px;
    border-radius: 4px;
    margin-top: 2px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-day.today .event-preview,
.calendar-day.selected .event-preview {
    background: var(--card);
    color: var(--card-foreground);
}

/* Event Styles */
.day-events {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.event-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    color: var(--card-foreground);
    background: var(--card);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 0.5rem;
}

.event-item:hover {
    background: var(--accent);
    border-color: var(--ring);
    transform: translateX(2px);
}

.event-time {
    font-weight: 600;
    color: var(--foreground);
    font-size: 0.875rem;
    min-width: 80px;
}

.event-details {
    flex: 1;
}

.event-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.event-client {
    font-size: 0.875rem;
    color: var(--text-secondary, #64748b);
}

.event-type-badge {
    padding: 0.25rem 0.75rem;
    max-width: 220px;
    background: var(--secondary);
    color: var(--secondary-foreground);
    border: 1px solid var(--border);
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}

.event-hearing { border-left: 4px solid #ef4444; }
.event-meeting { border-left: 4px solid #3b82f6; }
.event-deposition { border-left: 4px solid #f59e0b; }
.event-deadline { border-left: 4px solid #dc2626; }
.event-consultation { border-left: 4px solid #10b981; }
.event-other { border-left: 4px solid #6b7280; }

.no-events {
    text-align: center;
    color: var(--text-secondary, #64748b);
    font-style: italic;
    padding: 2rem;
}

/* ── Compromisso calendar indicators ────────────────────────────────── */
.calendar-day.has-compromissos .compromisso-dot {
    display: inline-block;
    position: absolute;
    bottom: 5px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: #f59e0b;            /* amber — distinct from evento green */
    border-radius: 50%;
    border: 2px solid var(--card);
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    z-index: 3;
}

.calendar-day .event-preview.compromisso-preview {
    background: rgba(245, 158, 11, .15);
    color: var(--warning-color);
}

/* ── Compromisso list items ─────────────────────────────────────────── */
.event-item.event-compromisso {
    border-left: 4px solid #f59e0b;
    background: rgba(245, 158, 11, .05);
}
.event-item.event-compromisso.compromisso-done {
    border-left-color: #10b981;
    opacity: .7;
}
.event-item.event-compromisso.compromisso-cancelled {
    border-left-color: #94a3b8;
    opacity: .55;
    text-decoration: line-through;
}

.badge-compromisso {
    background: #f59e0b !important;
    color: #fff !important;
}

/* ── Upcoming compromissos panel ────────────────────────────────────── */
.compromisso-item {
    padding: .75rem 1rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-left: 4px solid #f59e0b;
    border-radius: .5rem;
    margin-bottom: .6rem;
    color: var(--card-foreground);
    background: var(--card);
}
.compromisso-item.compromisso-overdue {
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, .08);
}
.compromisso-item .compromisso-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
    margin-bottom: .3rem;
    font-size: .8rem;
}
.compromisso-tipo-badge {
    background: rgba(245,158,11,.15);
    color: var(--warning-color);
    padding: 1px 8px;
    border-radius: 999px;
    font-weight: 600;
    font-size: .75rem;
}
.compromisso-date { color: var(--text-secondary, #64748b); }
.compromisso-processo {
    font-family: monospace;
    font-size: .75rem;
    color: var(--primary-color, #4f46e5);
}
.compromisso-titulo {
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    font-size: .9rem;
    margin-bottom: .2rem;
}
.compromisso-descricao {
    font-size: .8rem;
    color: var(--text-secondary, #64748b);
    margin-bottom: .4rem;
}
.compromisso-actions {
    display: flex;
    gap: .4rem;
    margin-top: .4rem;
}
.btn-xs {
    padding: 2px 10px;
    font-size: .75rem;
    border-radius: .25rem;
    cursor: pointer;
    border: none;
    font-weight: 500;
}
.btn-xs.btn-success { background: #10b981; color: #fff; }
.btn-xs.btn-success:hover { background: #059669; }
.btn-xs.btn-danger  { background: #ef4444; color: #fff; }
.btn-xs.btn-danger:hover  { background: #dc2626; }
.btn-xs.btn-outline-danger { background: transparent; color: #ef4444; border: 1px solid #ef4444; }
.btn-xs.btn-outline-danger:hover { background: #ef4444; color: #fff; }

/* Upcoming Events Sidebar */
.upcoming-event {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    color: var(--card-foreground);
    background: var(--card);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 0.5rem;
}

.upcoming-event:hover {
    background: var(--accent);
    border-color: var(--ring);
}

.event-date {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.75rem;
    text-transform: uppercase;
    min-width: 40px;
    text-align: center;
}

.event-summary {
    flex: 1;
}

.event-summary .event-title {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.125rem;
}

.event-summary .event-time {
    font-size: 0.75rem;
    color: var(--text-secondary, #64748b);
}

/* Event Details Modal */
.event-detail-item {
    display: grid;
    grid-template-columns: minmax(120px, 160px) minmax(0, 1fr);
    gap: 1rem;
    margin-bottom: 0;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    color: var(--foreground);
    overflow-wrap: anywhere;
}

.event-detail-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.event-detail-item strong {
    color: var(--text-primary);
    display: block;
    min-width: 0;
}

.event-modal-content {
    max-width: 760px !important;
}

.event-edit-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.event-edit-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.event-edit-field.event-edit-wide {
    grid-column: 1 / -1;
}

.event-edit-field label {
    color: var(--muted-foreground);
    font-size: 0.78rem;
    font-weight: 600;
}

.event-edit-field textarea {
    min-height: 110px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    color: var(--card-foreground);
    background: var(--card);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 0.75rem;
    transition: all 0.2s ease;
}

.stat-card:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: var(--primary-foreground);
    border-radius: 0.75rem;
}

.stat-content h4 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.stat-content p {
    font-size: 0.875rem;
    color: var(--text-secondary, #64748b);
    margin: 0;
}

/* Calendar Responsive Design */
@media screen and (max-width: 768px) {
    .calendar-day {
        min-height: 60px;
        font-size: 0.875rem;
    }
    
    .weekday {
        padding: 0.75rem 0.25rem;
        font-size: 0.75rem;
    }
    
    .calendar-navigation {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .event-item {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    
    .event-time {
        min-width: auto;
    }

    .event-detail-item,
    .event-edit-form {
        grid-template-columns: 1fr;
    }

    .event-detail-item {
        gap: 0.35rem;
    }

    .event-edit-field.event-edit-wide {
        grid-column: auto;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
    }

    .stat-content h4 {
        font-size: 1.5rem;
    }

  .transaction-item {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

/* Animation & Interaction Enhancements */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.overview-card {
  animation: fadeInUp 0.6s ease-out;
}

.overview-card:nth-child(2) {
  animation-delay: 0.1s;
}

.overview-card:nth-child(3) {
  animation-delay: 0.2s;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Focus states for accessibility */
.btn:focus,
.search-bar input:focus,
.filter-select:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* Loading states */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Additional modern touches */
.card-body > *:last-child {
  margin-bottom: 0;
}

.sidebar-menu a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--primary-color);
  border-radius: 0 2px 2px 0;
  transition: height 0.3s ease;
}

.sidebar-menu a.active::before {
  height: 60%;
}

/* Section Management Styles */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.section-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* Make section content containers fill available height */
#clients-content,
#processos-content,
#leads-content,
#documentos-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

#documents-explorer-content {
  height: 100%;
  overflow-y: auto;
}

.table-container {
  background: var(--surface-elevated);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  overflow-y: auto;
  border: 1px solid var(--border-color);
  flex: 1;
  min-height: 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  table-layout: fixed;
}

.data-table th {
  background: var(--surface-color);
  padding: 0.65rem 0.75rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  position: sticky;
  top: 0;
  z-index: 2;
}

.data-table td {
  padding: 0 0.75rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  height: 48px;
  max-height: 48px;
  overflow: hidden;
  white-space: nowrap;
}

/* Per-column widths */
#processos-table .col-tipo     { width: 45px;  text-align: center; }
#processos-table .col-numero   { width: 130px; }
#processos-table .col-cliente  { width: 150px; }
#processos-table .col-assunto  { width: 200px; }
#processos-table .col-status   { width: 60px; }
#processos-table .col-data     { width: 60px; }

/* Clients table column widths */
#clients-table th:nth-child(1),
#clients-table td:nth-child(1) { min-width: 200px; }       /* Nome */
#clients-table th:nth-child(2),
#clients-table td:nth-child(2) { width: 80px; }             /* Tipo */

/* Truncating text inside cells */
.cell-truncate {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Source type badges */
.source-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
}
.source-eproc {
  background: rgba(66, 153, 225, 0.15);
  color: #3182ce;
  border: 1px solid rgba(66, 153, 225, 0.4);
}
.source-pje {
  background: rgba(72, 187, 120, 0.15);
  color: #276749;
  border: 1px solid rgba(72, 187, 120, 0.4);
}

/* Source filter toggle buttons (next to search bar) */
.source-filter-group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.source-filter-btn {
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: var(--surface-color);
  color: var(--text-muted, #888);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.source-filter-btn:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

#sfbtn-eproc.active {
  background: rgba(66, 153, 225, 0.15);
  color: #3182ce;
  border-color: rgba(66, 153, 225, 0.5);
}

#sfbtn-pje1g.active,
#sfbtn-pje2g.active {
  background: rgba(72, 187, 120, 0.15);
  color: #276749;
  border-color: rgba(72, 187, 120, 0.5);
}

.data-table tr.table-row-clickable {
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.data-table tr.table-row-clickable:hover {
  background: rgba(113, 128, 150, 0.08);
}

.data-table tr.table-row-clickable:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: -2px;
  background: rgba(113, 128, 150, 0.12);
}

.data-table tr:hover:not(.table-row-clickable) {
  background: var(--surface-color);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.status-ativo,
.status-badge.status-active {
  background: rgba(56, 161, 105, 0.1);
  color: var(--success-color);
}

.status-badge.status-pendente,
.status-badge.status-pending {
  background: rgba(229, 62, 62, 0.1);
  color: var(--danger-color);
}

.status-badge.status-aguardo {
  background: rgba(214, 158, 46, 0.1);
  color: var(--warning-color);
}

.status-badge.status-baixado {
  background: rgba(56, 161, 105, 0.1);
  color: var(--success-color);
}

.status-badge.status-encerrado,
.status-badge.status-inactive {
  background: rgba(229, 62, 62, 0.1);
  color: var(--danger-color);
}

.status-badge.status-recebido,
.status-badge.status-pago {
  background: rgba(56, 161, 105, 0.1);
  color: var(--success-color);
}

.status-badge.status-cancelado {
  background: rgba(229, 62, 62, 0.1);
  color: var(--danger-color);
}

/* Type badges for resumo table */
.type-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.type-badge.type-receita {
  background: rgba(56, 161, 105, 0.1);
  color: var(--success-color);
}

.type-badge.type-despesa {
  background: rgba(229, 62, 62, 0.1);
  color: var(--danger-color);
}

/* Resumo stats container */
.resumo-stats {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.resumo-stat-card {
  flex: 1;
  min-width: 150px;
  text-align: center;
  padding: 1rem;
  background: var(--surface-color);
  border-radius: 0.75rem;
  border: 1px solid var(--border-color);
}

.date-range-filter {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
}

.date-range-filter input[type="date"] {
  /* inherits global input styling — just override padding */
  padding: var(--space-2);
  width: auto;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge.badge-fisica {
  background: rgba(49, 130, 206, 0.1);
  color: var(--info-color);
}

.badge.badge-juridica {
  background: rgba(128, 90, 213, 0.1);
  color: #805ad5;
}

/* ── Lead stage badges ─────────────────────────────────────── */
.lead-stage-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
  white-space: nowrap;
}

/* Actions cell in leads table */
#leads-table .actions-cell {
  display: flex;
  gap: 6px;
  align-items: center;
}
#leads-table .btn-sm {
  padding: 3px 8px;
  font-size: 11px;
  border-radius: 6px;
}
.btn-success {
  background: var(--success-color, #10b981);
  color: #fff;
  border: none;
  cursor: pointer;
}
.btn-success:hover {
  opacity: .85;
}
.btn-danger {
  background: var(--danger-color, #ef4444);
  color: #fff;
  border: none;
  cursor: pointer;
}
.btn-danger:hover {
  opacity: .85;
}

/* Editable field styles */
.editable-field {
  display: block;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: border-color .2s;
  outline: none;
  min-width: 120px;
}
.editable-field:hover {
  border-color: var(--border-color);
}
.editable-field:focus {
  border-color: var(--accent-blue, #3b82f6);
  background: var(--card-bg);
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--text-secondary);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

html.dark .spinner {
  border-color: var(--border-accent);
  border-top-color: var(--foreground);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.error-state {
  text-align: center;
  padding: 2rem;
  color: var(--danger-color);
}

.error-state .btn {
  margin-top: 1rem;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 12px;
  line-height: 1.4;
  border-radius: 6px;
}

.btn-sm + .btn-sm {
  margin-left: 0.5rem;
}

/* Hide sections by default */
#clients-content,
#processos-content {
  display: none;
}

/* Process Detail Styles */
.processo-detail-header {
  background: linear-gradient(135deg, var(--brand) 0%, var(--muted-foreground) 100%);
  color: var(--brand-foreground);
  border-bottom: none;
}

.processo-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.processo-breadcrumb .btn-link {
  color: var(--brand-foreground);
  opacity: 0.9;
  text-decoration: none;
  padding: 0.5rem 0;
  border: none;
  background: none;
  font-size: 0.875rem;
  transition: opacity 0.2s;
}

.processo-breadcrumb .btn-link:hover {
  opacity: 1;
  text-decoration: underline;
}

.breadcrumb-divider {
  color: var(--brand-foreground);
  opacity: 0.6;
  margin: 0 0.25rem;
}

.processo-status {
  margin-left: auto;
}

.status-badge {
  background: var(--surface-elevated);
  color: var(--primary-color);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: var(--shadow-sm);
}

/* Process Summary Grid */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: start;
}

.summary-grid > div {
  background: var(--surface-elevated);
  padding: 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}

.summary-grid > div:hover {
  box-shadow: var(--shadow-md);
}

.summary-grid h4 {
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.summary-grid p {
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 500;
  margin: 0;
}

.summary-assunto {
  background: var(--surface-elevated);
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.summary-assunto-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

/* Process Meta Information Grid */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.5rem;
  margin-top: 0.75rem;
  align-items: start;
}

.meta-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0.5rem 0.75rem;
  background: var(--surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  transition: all 0.2s;
}

.meta-item-wide {
  grid-column: 1 / -1;
}

.meta-item:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-sm);
}

.meta-label {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.2rem;
}

.meta-value {
  color: var(--text-primary);
  font-size: 0.82rem;
  text-align: left;
  word-break: break-word;
}

.meta-sub {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.7rem;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border-radius: 0.25rem;
  padding: 0.1rem 0.4rem;
}

/* Timeline Styles */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 1rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-color), var(--border-accent));
  border-radius: 1px;
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
  padding-left: 2rem;
}

.timeline-marker {
  position: absolute;
  left: -2.25rem;
  top: 0.75rem;
  width: 1rem;
  height: 1rem;
  background: var(--accent-color);
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  z-index: 10;
}

.timeline-content {
  background: var(--surface-elevated);
  padding: 1.5rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.timeline-content:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.timeline-title {
  font-weight: 600;
  color: var(--primary-color);
  font-size: 1.125rem;
}

.timeline-date {
  color: var(--text-secondary);
  font-size: 0.875rem;
  background: var(--surface-color);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  border: 1px solid var(--border-color);
}

.timeline-description {
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.timeline-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.timeline-meta span {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.timeline-tag {
  background: var(--surface-color);
  color: var(--text-secondary);
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
}

.timeline-tag.status {
  background: var(--info-color);
  color: white;
  border-color: var(--info-color);
}

/* Process Detail Cards Spacing */
#processo-detail-content .card {
  margin-bottom: 2rem;
}

#processo-detail-content .card:last-child {
  margin-bottom: 0;
}

/* Client Detail Page */
#client-detail-content .card {
  margin-bottom: 2rem;
}

#client-detail-content .card:last-child {
  margin-bottom: 0;
}

.client-detail-profile {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.client-profile-pic {
  flex-shrink: 0;
}

.client-avatar-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2.5rem;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.client-avatar-placeholder.client-avatar-juridica {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  font-size: 2rem;
}

.client-detail-info {
  flex: 1;
  min-width: 0;
}

.client-detail-data {
  margin-top: 1rem;
}

@media (max-width: 768px) {
  .client-detail-profile {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .client-detail-info > div {
    justify-content: center;
  }
}

/* Pagination Styles */
.pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 1rem;
}

.pagination-info {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.page-numbers {
  display: flex;
  gap: 0.25rem;
}

.page-number {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  background: var(--surface-elevated);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  transition: all 0.2s;
  cursor: pointer;
  min-width: 40px;
  text-align: center;
}

.page-number:hover {
  background: var(--surface-color);
  border-color: var(--border-accent);
}

.page-number.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.page-number.ellipsis {
  border: none;
  background: none;
  cursor: default;
}

.page-number.ellipsis:hover {
  background: none;
  border: none;
}

.pagination-settings {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.pagination-settings label {
  color: var(--text-secondary);
  white-space: nowrap;
}

.pagination-settings select {
  min-width: 80px;
  width: auto;
}

/* Responsive Design for Process Details */
@media (max-width: 480px) {
  .summary-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .meta-grid {
    grid-template-columns: 1fr;
  }
  
  .meta-item {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .meta-label {
    flex: none;
  }
  
  .meta-value {
    text-align: left;
  }
  
  .timeline {
    padding-left: 1.5rem;
  }
  
  .timeline-item {
    padding-left: 1.5rem;
  }
  
  .timeline-marker {
    left: -1.75rem;
  }
  
  .timeline-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  /* Pagination responsive */
  .pagination-container {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  
  .pagination-controls {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .pagination-info,
  .pagination-settings {
    text-align: center;
  }
  
  .page-numbers {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Enhanced Search Interface */
.search-container {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

/* Search Input Styling */
#processos-search {
  position: relative;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 40px 10px 16px;
  font-size: 14px;
  transition: all 0.3s ease;
  background: var(--surface-elevated);
  width: 100%;
}

#processos-search:focus,
#clients-search:focus,
#search-documents:focus {
  border-color: var(--info-color);
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
  outline: none;
}

#processos-search::placeholder,
#clients-search::placeholder,
#search-documents::placeholder {
  color: var(--text-tertiary);
  font-style: italic;
}

/* Search Icon */
.search-container::before {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background: var(--text-tertiary);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='currentColor'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='currentColor'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
  pointer-events: none;
  z-index: 1;
}

/* AI Toggle Styling */
.search-mode-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface-elevated);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.3s ease;
  min-width: 160px;
}

.search-mode-toggle:hover {
  border-color: var(--info-color);
  color: var(--text-primary);
  background: rgba(49, 130, 206, 0.05);
}

.search-mode-toggle.active {
  background: linear-gradient(135deg, var(--info-color), #2c5282);
  border-color: var(--info-color);
  color: white;
  box-shadow: var(--shadow-md);
}

.search-mode-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--info-color);
  cursor: pointer;
}

/* Filter Dropdown Styles */
.filter-dropdown-wrapper {
  position: relative;
}

.btn-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 500;
  background: var(--surface-elevated);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: inherit;
}

.btn-filter:hover {
  border-color: var(--accent-color);
  background: var(--surface-color);
}

.btn-filter.has-filters {
  border-color: var(--info-color);
  background: rgba(49, 130, 206, 0.06);
  color: var(--info-color);
}

.filter-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--info-color);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.filter-dropdown-panel {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 380px;
  background: var(--card, var(--surface-elevated));
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0,0,0,.15);
  z-index: 200;
  animation: filterFadeIn 0.15s ease;
  overflow: hidden;
}

.filter-dropdown-panel.open {
  display: block;
}

@keyframes filterFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.filter-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
}

.filter-dropdown-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.filter-clear-btn {
  background: none;
  border: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--info-color);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
  font-family: inherit;
}

.filter-clear-btn:hover {
  background: rgba(49, 130, 206, 0.08);
}

.filter-dropdown-body {
  padding: 14px 18px;
  max-height: 380px;
  overflow-y: auto;
}

.filter-group {
  margin-bottom: 16px;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-group-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: 1.5px solid var(--border-color);
  border-radius: 20px;
  background: var(--surface-elevated);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  white-space: nowrap;
}

.filter-chip:hover {
  border-color: var(--accent-color);
  color: var(--text-primary);
  background: var(--surface-color);
}

.filter-chip.active {
  border-color: var(--info-color);
  background: rgba(49, 130, 206, 0.1);
  color: var(--info-color);
  font-weight: 600;
}

.filter-date-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-date-input {
  /* inherits global input styling */
  flex: 1;
  padding: 8px 10px;
  font-size: 13px;
}

.filter-date-input:focus {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.15);
}

.filter-date-sep {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.filter-dropdown-footer {
  display: flex;
  justify-content: flex-end;
  padding: 12px 18px;
  border-top: 1px solid var(--border-color);
  background: var(--surface-color);
}

/* Active filter tags displayed below main header */
.active-filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0;
}

.active-filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 16px;
  background: rgba(49, 130, 206, 0.1);
  color: var(--info-color);
  font-size: 12px;
  font-weight: 600;
}

.active-filter-tag button {
  background: none;
  border: none;
  color: var(--info-color);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.active-filter-tag button:hover {
  opacity: 1;
}

@media (max-width: 768px) {
  .filter-dropdown-panel {
    width: calc(100vw - 32px);
    right: -16px;
  }
}

/* Search Status Icon */
#search-status-icon {
  color: var(--info-color);
  font-size: 16px;
  animation: pulse 1.5s infinite;
  margin-left: 4px;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Section Header Enhancement */
.section-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 8px 0;
}

/* Responsive Search */
@media (max-width: 1024px) {
  .search-container {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  #processos-search {
    width: 100% !important;
  }
  
  .search-mode-toggle {
    min-width: unset;
  }
}

@media (max-width: 768px) {
  .section-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .search-container {
    order: 2;
  }
  
  .btn.btn-primary {
    order: 1;
    width: 100%;
  }
}

/* Similarity Badges */
.similarity-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  min-width: 40px;
}

.similarity-badge.high-similarity {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.similarity-badge.medium-similarity {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.similarity-badge.low-similarity {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Row highlighting for similarity */
tr.high-similarity {
  background-color: rgba(212, 237, 218, 0.15);
  border-left: 3px solid var(--success-color);
}

tr.medium-similarity {
  background-color: rgba(255, 243, 205, 0.15);
  border-left: 3px solid var(--warning-color);
}

tr.low-similarity {
  background-color: rgba(248, 215, 218, 0.15);
  border-left: 3px solid var(--danger-color);
}

tr.high-similarity:hover,
tr.medium-similarity:hover,
tr.low-similarity:hover {
  background-color: rgba(45, 55, 72, 0.05);
}

/* Enhanced Calendar Navigation and Responsive Design */
.month-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-color);
    border-radius: 8px;
    padding: 4px 6px;
}

.cal-nav-select {
    /* inherits global select styling */
    font-weight: 600;
    font-size: 14px;
    padding: 5px 10px 5px 8px;
    width: auto;
    line-height: 1.4;
}

.cal-nav-select:hover {
    border-color: var(--ring);
}

.cal-nav-select:focus {
    border-color: var(--ring);
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.15);
}

#cal-year-select {
    width: 80px;
}

#today-btn {
    font-size: 13px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 6px;
}

/* Calendar Controls Enhancement */
.calendar-controls {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    justify-content: center;
}

.calendar-controls .btn {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.calendar-controls .btn:hover {
    background: var(--brand);
    color: var(--brand-foreground);
    border-color: var(--brand);
    transform: scale(1.05);
}

/* Weekend Styling — no distinct background, same as weekdays */

/* Calendar Loading State */
.calendar-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 300px;
    color: var(--text-secondary);
}

.calendar-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Calendar Responsive Design */
@media (max-width: 768px) {
    .calendar-container {
        border-radius: 8px;
    }
    
    .calendar-day {
        height: 70px;
        padding: 4px;
        font-size: 14px;
    }
    
    .calendar-day .day-number {
        font-size: 14px;
    }
    
    .calendar-header > div {
        padding: 8px 4px;
        font-size: 12px;
    }
    
    .calendar-day .event-preview {
        display: none; /* Hide event previews on mobile */
    }
    
    .calendar-controls {
        padding: 12px;
    }
    
    .calendar-controls h4 {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .calendar-day {
        height: 50px;
        padding: 2px;
    }
    
    .calendar-day .day-number {
        font-size: 12px;
    }
    
    .calendar-controls h4 {
        font-size: 14px;
        min-width: 120px;
    }
    
    .calendar-controls .btn {
        min-width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .calendar-header > div {
        padding: 6px 2px;
        font-size: 10px;
    }
}

/* ==============================
   PLACEHOLDER CONTENT STYLES
   ============================== */
.placeholder-content {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.placeholder-content .placeholder-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.placeholder-content h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 600;
}

.placeholder-content p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.placeholder-content ul {
    background: var(--surface-color);
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.placeholder-content ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.placeholder-content ul li:last-child {
    border-bottom: none;
}

/* ================================
   PROCESSO TABS STYLES
   ================================ */

.processo-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.tab-button {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    position: relative;
}

.tab-button:hover {
    color: var(--primary-color);
    background: var(--surface-hover);
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: var(--surface-elevated);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ================================
   DOCUMENTS STYLES
   ================================ */

.documents-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.documents-search {
    flex: 1;
    max-width: 400px;
}

.documents-search .form-control {
    /* Override: slightly larger padding for search field */
    padding: 0.75rem 1rem;
}

.documents-stats {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.documents-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.document-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.document-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.document-item.clickable-document {
    cursor: pointer;
}

.document-item.clickable-document:hover {
    background: var(--primary-color-light);
}

.document-item.clickable-document:active {
    transform: translateY(0);
}

.document-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color-light);
    border-radius: 8px;
}

.document-details {
    flex: 1;
    min-width: 0;
}

.document-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.document-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.document-type {
    background: var(--primary-color-light);
    color: var(--primary-color);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 600;
}

.document-actions {
    flex-shrink: 0;
}

.document-actions .btn {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.document-actions .btn-outline-primary {
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.document-actions .btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

/* ================================
   PAGINATION STYLES
   ================================ */

.pagination-nav {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 0.25rem;
}

.pagination li {
    display: flex;
}

.page-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    background: var(--surface-elevated);
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.page-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.page-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ================================
   RESPONSIVE DOCUMENTS
   ================================ */

@media (max-width: 768px) {
    .documents-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .documents-search {
        max-width: none;
    }
    
    .document-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .document-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .documento-actions {
        align-self: stretch;
    }
    
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ================================
   DOCUMENT LOADING OVERLAY
   ================================ */

.document-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.document-loading-overlay.show {
    opacity: 1;
}

.document-loading-overlay.hide {
    opacity: 0;
}

.document-loading-content {
    background: var(--surface-elevated);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    min-width: 320px;
    max-width: 90vw;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.document-loading-spinner {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.document-loading-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.document-loading-document {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-weight: 500;
    word-break: break-word;
}

.document-loading-message {
    font-size: 0.875rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-weight: 500;
    min-height: 1.2em;
}

.document-loading-cancel {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.document-loading-cancel:hover {
    background: var(--surface-hover);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Text utility classes */
.text-success {
    color: var(--success-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.text-info {
    color: var(--info-color) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

.text-muted {
    color: var(--text-tertiary) !important;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .document-loading-overlay {
        background: rgba(0, 0, 0, 0.85);
    }
    
    .spinner {
        border-color: rgba(255, 255, 255, 0.2);
        border-top-color: var(--primary-color);
    }
}

/* Document Manager Styles */
.documents-view {
    width: 100%;
}

.processo-folder {
    margin-bottom: 1rem;
}

.folder-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--surface-elevated);
    border-radius: 8px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.folder-header:hover {
    background: var(--surface-color);
    box-shadow: var(--shadow-md);
    border-color: var(--border-color);
    transform: translateY(-2px);
}

.folder-icon {
    color: #d69e2e;
    transform: rotate(-90deg);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.folder-info {
    flex: 1;
    min-width: 0;
}

.folder-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.folder-client {
    margin: 0.25rem 0 0 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.folder-badge {
    padding: 0.35rem 0.85rem;
    background: var(--surface-color);
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

.folder-content {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
    padding: 0 1.25rem 0.5rem 1.25rem;
    transition: all 0.3s ease;
}

.document-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.25rem 1rem;
    background: var(--surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.document-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

/* Loading Spinner */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner {
    border: 4px solid var(--surface-elevated);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    animation: spin 1s linear infinite;
}
/* Context Menu */
.context-menu {
    position: absolute;
    background: var(--surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    z-index: 10000;
    padding: 0.5rem 0;
    animation: contextMenuFadeIn 0.15s ease-out;
}

@keyframes contextMenuFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.context-menu-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s ease;
    user-select: none;
}

.context-menu-item:hover {
    background: var(--surface-color);
}

.context-menu-item svg {
    flex-shrink: 0;
}

.context-menu-item.context-menu-danger {
    color: var(--danger-color);
}

.context-menu-item.context-menu-danger:hover {
    background: rgba(229, 62, 62, 0.1);
}

/* Dashboard Cards Loading Animation */
.kpi-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: var(--card);
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    border: 1px solid var(--border);
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--foreground);
}

.kpi-icon {
    width: 56px;
    height: 56px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--secondary) !important;
}

.kpi-icon svg {
    color: var(--foreground) !important;
    fill: var(--foreground) !important;
}

.kpi-content {
    flex: 1;
}

.kpi-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    transition: filter 0.3s ease;
}

.kpi-value.blurred {
    filter: blur(8px);
    user-select: none;
    cursor: pointer;
}

.kpi-value.blurred:hover {
    filter: blur(0);
}

.privacy-toggle {
    background: none;
    border: none;
    padding: 4px;
    margin-left: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    opacity: 0.6;
    transition: opacity 0.2s ease;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

.privacy-toggle:hover {
    opacity: 1;
}

.privacy-toggle svg {
    width: 16px;
    height: 16px;
}

.card-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    gap: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.card-loading p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Pending Actions Card Styles */
.pending-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--surface-color);
    border-radius: 8px;
}

.stat-item {
    flex: 1;
    text-align: center;
    padding: 1rem;
    border-radius: 6px;
    transition: transform 0.2s;
}

.stat-item:hover {
    transform: translateY(-2px);
}

.stat-item.urgent {
    background: rgba(229, 62, 62, 0.1);
    border: 1px solid rgba(229, 62, 62, 0.3);
}

.stat-item.warning {
    background: rgba(214, 158, 46, 0.1);
    border: 1px solid rgba(214, 158, 46, 0.3);
}

.stat-item.normal {
    background: rgba(56, 161, 105, 0.1);
    border: 1px solid rgba(56, 161, 105, 0.3);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pending-list {
    max-height: 300px;
    overflow-y: auto;
}

.pending-item {
    padding: 1rem;
    background: var(--surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 0.75rem;
    transition: all 0.2s;
}

.pending-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.pending-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.pending-item-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.pending-item-deadline {
    font-size: 0.85rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 500;
}

.pending-item-deadline.urgent {
    background: rgba(229, 62, 62, 0.15);
    color: var(--danger-color);
}

.pending-item-deadline.warning {
    background: rgba(214, 158, 46, 0.15);
    color: var(--warning-color);
}

.pending-item-deadline.normal {
    background: rgba(56, 161, 105, 0.15);
    color: var(--success-color);
}

.pending-item-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Revenue Card Styles */
.revenue-summary {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-item {
    padding: 1rem;
    background: var(--surface-color);
    border-radius: 6px;
    border-left: 4px solid var(--border-color);
}

.summary-item.positive {
    border-left-color: var(--success-color);
}

.summary-item.negative {
    border-left-color: var(--danger-color);
}

.summary-item .summary-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.summary-item .summary-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.summary-item.positive .summary-value {
    color: var(--success-color);
}

.summary-item.negative .summary-value {
    color: var(--danger-color);
}

#revenue-chart {
    margin: 1rem 0;
    max-height: 250px;
}

.chart-legend {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* Appointments Card Styles */
.appointments-list {
    max-height: 350px;
    overflow-y: auto;
}

.appointment-item {
    padding: 1rem;
    background: var(--surface-elevated);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--info-color);
    border-radius: 6px;
    margin-bottom: 0.75rem;
    transition: all 0.2s;
}

.appointment-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.appointment-item.upcoming {
    border-left-color: var(--warning-color);
}

.appointment-item.today {
    border-left-color: var(--danger-color);
    background: rgba(229, 62, 62, 0.05);
}

.appointment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.appointment-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.appointment-time {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.appointment-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.appointment-location {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-tertiary);
}

.empty-state svg {
    opacity: 0.3;
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 0.9rem;
}

/* =====================================================
   PRAZO WARNING BANNERS
   ===================================================== */

.prazo-banner {
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border-left: 4px solid;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.prazo-expired {
    background: rgba(229, 62, 62, 0.08);
    border-left-color: #e53e3e;
}

.prazo-urgent {
    background: rgba(237, 137, 54, 0.08);
    border-left-color: #ed8936;
}

.prazo-warning {
    background: rgba(214, 158, 46, 0.08);
    border-left-color: #d69e2e;
}

.prazo-normal {
    background: rgba(56, 161, 105, 0.08);
    border-left-color: #38a169;
}

.prazo-banner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.prazo-banner-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.prazo-banner-title i {
    font-size: 1.1rem;
}

.prazo-expired .prazo-banner-title i { color: #e53e3e; }
.prazo-urgent .prazo-banner-title i { color: #ed8936; }
.prazo-warning .prazo-banner-title i { color: #d69e2e; }
.prazo-normal .prazo-banner-title i { color: #38a169; }

.prazo-badge {
    font-size: 0.8rem;
    padding: 0.15rem 0.5rem;
    border-radius: 1rem;
    font-weight: 600;
}

.prazo-expired .prazo-badge {
    background: rgba(229, 62, 62, 0.15);
    color: #e53e3e;
}

.prazo-urgent .prazo-badge {
    background: rgba(237, 137, 54, 0.15);
    color: #ed8936;
}

.prazo-warning .prazo-badge {
    background: rgba(214, 158, 46, 0.15);
    color: #d69e2e;
}

.prazo-normal .prazo-badge {
    background: rgba(56, 161, 105, 0.15);
    color: #38a169;
}

.prazo-banner-actions .btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 0.375rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--text-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline:hover {
    background: var(--surface-color);
    border-color: var(--text-secondary);
}

.prazo-banner-body {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.prazo-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.5rem;
}

.prazo-detail {
    display: flex;
    gap: 0.4rem;
    align-items: baseline;
}

.prazo-detail-label {
    white-space: nowrap;
    font-size: 0.82rem;
}

.prazo-detail-value {
    font-size: 0.88rem;
}

.prazo-event-ref {
    margin-top: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

.prazo-closed-section {
    margin-bottom: 1rem;
}

.prazo-closed-summary {
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--text-tertiary);
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
}

.prazo-closed-summary:hover {
    color: var(--text-secondary);
}

.prazo-closed-list {
    padding: 0.5rem 0;
}

.prazo-closed-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.prazo-closed-item:last-child {
    border-bottom: none;
}

/* =====================================================
   REVAMPED DASHBOARD - Card Grid System
   ===================================================== */

/* KPI Row — 4 compact stat cards */
.dash-top-row {
    display: flex;
    gap: var(--space-5);
    align-items: stretch;
}

.dash-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-5);
    flex: 1;
    min-width: 0;
}

.dash-financial-side {
    width: 260px;
    min-width: 260px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.dash-financial-side #dash-financial-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: filter 0.3s ease;
}

#dash-financial-content.finance-blurred {
    filter: blur(8px);
    user-select: none;
    cursor: pointer;
}

#dash-financial-content.finance-blurred:hover {
    filter: blur(0);
}

.finance-privacy-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.finance-privacy-toggle:hover {
    color: var(--text-primary);
}

.dash-kpi {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-5);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    min-height: 64px;
}

.dash-kpi:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-accent);
}

.dash-kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dash-kpi-body {
    flex: 1;
    min-width: 0;
}

.dash-kpi-label {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--text-xs);
    color: var(--muted-foreground);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: var(--space-0-5);
}

.dash-kpi-value {
    display: block;
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--foreground);
    line-height: 1.2;
    transition: filter 0.3s ease;
}

.dash-kpi-value.blurred {
    filter: blur(8px);
    user-select: none;
    cursor: pointer;
}

.dash-kpi-value.blurred:hover {
    filter: blur(0);
}

/* 2-col grid */
.dash-grid-2col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
    gap: var(--space-6);
}

/* Shared dash-card */
.dash-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6) var(--space-6);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.dash-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-accent);
}

.dash-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border);
}

.dash-card-header span {
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--foreground);
}

.dash-card-header svg {
    color: var(--muted-foreground);
    opacity: 0.6;
}

.dash-see-all {
    font-size: var(--text-xs);
    color: var(--brand);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

.dash-see-all:hover {
    color: var(--brand-light);
    text-decoration: underline;
}

/* Financial summary grid */
.dash-finance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
    margin-bottom: var(--space-2-5);
}

.dash-finance-item {
    padding: var(--space-2) var(--space-2-5);
    background: var(--background);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.dash-finance-item.full-width {
    grid-column: 1 / -1;
    text-align: center;
    background: var(--brand);
    color: var(--brand-foreground);
    border: none;
    padding: var(--space-2) var(--space-2-5);
}

.dash-finance-item.full-width .dash-finance-label {
    color: var(--brand-foreground);
    opacity: 0.7;
}

.dash-finance-item.full-width .dash-finance-value {
    color: var(--brand-foreground);
    font-size: 1.05rem;
}

.dash-finance-label {
    display: block;
    font-size: 0.68rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.1rem;
}

.dash-finance-value {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.dash-finance-value.positive { color: var(--success-color); }
.dash-finance-value.negative { color: var(--destructive); }

.dash-finance-extra {
    display: flex;
    justify-content: space-around;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
}

.dash-finance-extra > div {
    text-align: center;
}

.dash-finance-extra span {
    display: block;
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.dash-finance-extra strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 0.1rem;
}

/* Mini deadline list */
.dash-mini-list {
    max-height: 280px;
    overflow-y: auto;
}

.dash-deadline-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border);
}

.dash-deadline-item:last-child {
    border-bottom: none;
}

.dash-deadline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dash-deadline-dot.urgent { background: var(--destructive); }
.dash-deadline-dot.warning { background: var(--warning-color); }
.dash-deadline-dot.normal { background: var(--success-color); }

.dash-deadline-info {
    flex: 1;
    min-width: 0;
}

.dash-deadline-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-deadline-processo {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-deadline-date {
    font-size: var(--text-xs);
    font-weight: 600;
    white-space: nowrap;
    padding: var(--space-0-5) var(--space-2);
    border-radius: var(--radius-sm);
}

.dash-deadline-date.urgent {
    color: var(--destructive);
    background: rgba(239,68,68,.1);
}

.dash-deadline-date.warning {
    color: var(--warning-color);
    background: rgba(245,158,11,.1);
}

.dash-deadline-date.normal {
    color: var(--success-color);
    background: rgba(34,197,94,.1);
}

/* Timeline */
.dash-timeline {
    max-height: 280px;
    overflow-y: auto;
}

.dash-timeline-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.5rem 0;
    position: relative;
}

.dash-timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 13px;
    top: 30px;
    bottom: -4px;
    width: 2px;
    background: var(--border);
}

.dash-timeline-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.78rem;
    z-index: 1;
}

.dash-timeline-icon svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
}

.dash-timeline-icon.evento { background: rgba(99,102,241,.12); color: #6366f1; }
.dash-timeline-icon.cliente { background: rgba(16,185,129,.12); color: #10b981; }
.dash-timeline-icon.processo { background: rgba(59,130,246,.12); color: #3b82f6; }
.dash-timeline-icon.despesa { background: rgba(245,158,11,.12); color: #f59e0b; }

.dash-timeline-body {
    flex: 1;
    min-width: 0;
    padding-bottom: 0.4rem;
}

.dash-timeline-text {
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.dash-timeline-text strong {
    font-weight: 600;
}

.dash-timeline-date {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

/* Status distribution bars */
.dash-status-bars {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.dash-status-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dash-status-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    width: clamp(180px, 24vw, 320px);
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-status-bar-bg {
    flex: 1;
    height: 24px;
    background: var(--background);
    border-radius: 6px;
    overflow: visible;
    border: 1px solid var(--border);
    position: relative;
}

.dash-status-bar-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.5s ease;
    min-width: 2px;
    position: relative;
    cursor: pointer;
}

.dash-status-bar-fill::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    transform: none;
    background: var(--primary);
    color: var(--primary-foreground);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    width: max-content;
    max-width: min(420px, 70vw);
    white-space: normal;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.dash-status-bar-fill:hover::after {
    opacity: 1;
}

.dash-status-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    width: 32px;
    text-align: right;
    flex-shrink: 0;
}

.dash-status-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    padding: 0.5rem;
    margin-top: 0.35rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.dash-status-toggle:hover {
    background: var(--background);
    color: var(--text-primary);
}

/* Empty state for dashboard cards */
.dash-empty-state {
    text-align: center;
    padding: 1.75rem 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-style: italic;
}

/* =====================================================
   AÇÕES PENDENTES - Full SPA Tab
   ===================================================== */

.acoes-pendentes-content {
    animation: fadeIn 0.2s ease;
}

.acoes-header {
    margin-bottom: 1.25rem;
}

.acoes-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
}

.acoes-toolbar {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.acoes-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    flex: 1;
    min-width: 200px;
}

.acoes-search svg {
    color: var(--text-secondary);
    flex-shrink: 0;
}

.acoes-search input {
    /* Inside search wrapper — strip global border/bg */
    border: none;
    background: transparent;
    font-size: 0.88rem;
    color: var(--foreground);
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

.acoes-search input:focus {
    border: none;
    box-shadow: none;
}

.acoes-filters {
    display: flex;
    gap: 0.35rem;
}

.acoes-filter-btn {
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    background: var(--card);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.acoes-filter-btn:hover {
    background: var(--background);
    border-color: var(--text-secondary);
}

.acoes-filter-btn.active {
    background: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
}

/* Summary counters */
.acoes-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.acoes-counter {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 0.625rem;
    border: 1px solid var(--border);
    background: var(--card);
}

.acoes-counter.urgent { border-left: 4px solid var(--destructive); }
.acoes-counter.warning { border-left: 4px solid #f59e0b; }
.acoes-counter.normal { border-left: 4px solid #22c55e; }
.acoes-counter.total { border-left: 4px solid #6366f1; }

.acoes-counter-num {
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.acoes-counter.urgent .acoes-counter-num { color: var(--destructive); }
.acoes-counter.warning .acoes-counter-num { color: #f59e0b; }
.acoes-counter.normal .acoes-counter-num { color: #22c55e; }
.acoes-counter.total .acoes-counter-num { color: #6366f1; }

.acoes-counter-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    line-height: 1.3;
}

.acoes-counter-label small {
    font-weight: 400;
    color: var(--text-tertiary);
}

/* Full action list */
.acoes-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.acoes-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.15rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 0.625rem;
    transition: all 0.15s ease;
}

.acoes-item:hover {
    border-color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
}

.acoes-item.urgent { border-left: 4px solid var(--destructive); }
.acoes-item.warning { border-left: 4px solid #f59e0b; }
.acoes-item.normal { border-left: 4px solid #22c55e; }

.acoes-item-body {
    flex: 1;
    min-width: 0;
}

.acoes-item-title {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.acoes-item-processo {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.acoes-item-processo a {
    color: #6366f1;
    text-decoration: none;
}

.acoes-item-processo a:hover {
    text-decoration: underline;
}

.acoes-item-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.acoes-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    flex-shrink: 0;
}

.acoes-item-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    white-space: nowrap;
}

.acoes-item-badge.urgent {
    background: rgba(239,68,68,.12);
    color: var(--destructive);
}

.acoes-item-badge.warning {
    background: rgba(245,158,11,.12);
    color: #f59e0b;
}

.acoes-item-badge.normal {
    background: rgba(34,197,94,.12);
    color: #22c55e;
}

.acoes-item-actions {
    display: flex;
    gap: 0.35rem;
}

.acoes-item-actions .btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
}

.acoes-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.acoes-empty p {
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive — Dashboard KPI row */
.dash-download-status {
    margin-top: 0.6rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--border-color);
    border-radius: 0.55rem;
    background: var(--muted);
}

.dash-download-status[hidden] {
    display: none;
}

.dash-download-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.dash-download-label {
    min-width: 0;
    overflow: hidden;
    color: var(--text-primary);
    font-size: 0.78rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-download-pct,
.dash-download-size {
    color: var(--muted-foreground);
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
}

.dash-download-pct {
    flex: 0 0 auto;
}

.dash-download-track {
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--border-color);
}

.dash-download-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: #3b82f6;
    transition: width 0.25s ease, background-color 0.2s ease;
}

.dash-download-size {
    margin-top: 0.3rem;
}

.dash-download-status[data-state="completed"] .dash-download-bar {
    background: #22c55e;
}

.dash-download-status[data-state="paused"] .dash-download-bar,
.dash-download-status[data-state="interrupted"] .dash-download-bar {
    background: #f59e0b;
}

.dash-download-status[data-state="cancelled"] .dash-download-bar {
    background: #ef4444;
}

@media (max-width: 1100px) {
    .dash-top-row {
        flex-direction: column;
    }
    .dash-financial-side {
        width: 100%;
        min-width: 0;
    }
    .dash-kpi-row {
        grid-template-columns: repeat(3, 1fr);
    }
    .dash-grid-2col {
        grid-template-columns: 1fr !important;
    }
    .dash-status-label {
        width: 110px;
    }
    .acoes-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .dash-kpi-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-main {
        padding: 1rem;
    }
    .dash-kpi-value {
        font-size: 1.3rem;
    }
    .acoes-summary {
        grid-template-columns: 1fr;
    }
    .acoes-toolbar {
        flex-direction: column;
    }
    .acoes-filters {
        flex-wrap: wrap;
    }
}

/* Evidence-first case dossier */
.evidence-dossier { display: grid; gap: 1rem; color: var(--text-primary); }
.evidence-hero, .evidence-section {
    border: 1px solid var(--border-color);
    border-radius: 0.8rem;
    background: var(--card-background, var(--surface-color));
    padding: 1rem;
}
.evidence-hero { display: flex; justify-content: space-between; gap: 1rem; border-left: 5px solid #22c55e; }
.evidence-health-attention { border-left-color: #f59e0b; }
.evidence-health-critical { border-left-color: #ef4444; }
.evidence-eyebrow, .evidence-kind { text-transform: uppercase; letter-spacing: .06em; font-size: .7rem; color: var(--text-secondary); }
.evidence-hero h3, .evidence-section h3 { margin: .25rem 0 .65rem; }
.evidence-hero p, .evidence-section p { margin: .25rem 0; }
.evidence-health-metrics { display: flex; gap: .65rem; flex-wrap: wrap; align-items: center; }
.evidence-health-metrics span { padding: .5rem .7rem; border-radius: .55rem; background: rgba(127,127,127,.11); font-size: .8rem; }
.evidence-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.evidence-section-heading, .evidence-claim-head, .evidence-review-footer { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.evidence-filter { width: auto; min-width: 9rem; }
.evidence-change, .evidence-claim, .evidence-deadline, .evidence-alert, .evidence-timeline-row {
    padding: .75rem 0; border-top: 1px solid var(--border-color);
}
.evidence-change:first-of-type, .evidence-claim:first-of-type, .evidence-deadline:first-of-type,
.evidence-alert:first-of-type, .evidence-timeline-row:first-of-type { border-top: 0; }
.evidence-change { display: grid; grid-template-columns: 6rem minmax(12rem, 1fr) auto; gap: .75rem; align-items: center; }
.evidence-change small { display: block; color: var(--text-secondary); margin-top: .2rem; }
.evidence-claim { border-left: 3px solid #22c55e; padding-left: .75rem; }
.evidence-claim.evidence-unsupported, .evidence-claim.evidence-insufficient { border-left-color: #f59e0b; }
.evidence-claim.evidence-conflicted { border-left-color: #ef4444; }
.evidence-claim-head { color: var(--text-secondary); font-size: .75rem; }
.evidence-citations { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .45rem; }
.evidence-citation { border: 1px solid rgba(99,102,241,.45); background: rgba(99,102,241,.1); color: var(--text-primary); border-radius: 999px; padding: .25rem .55rem; cursor: pointer; font-size: .72rem; max-width: 24rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evidence-citation:hover { background: rgba(99,102,241,.22); }
.evidence-no-source, .evidence-empty { color: var(--text-secondary); font-style: italic; font-size: .8rem; }
.evidence-timeline-row { display: grid; grid-template-columns: 10.5rem minmax(12rem, 1fr) minmax(10rem, auto); gap: .75rem; align-items: center; }
.evidence-timeline-row time { color: var(--text-secondary); font-size: .78rem; }
.evidence-timeline-row strong { display: block; margin-top: .2rem; }
.evidence-deadline { display: grid; gap: .35rem; font-size: .85rem; }
.evidence-deadline > label { justify-self: end; font-weight: 600; }
.evidence-alert { border-left: 3px solid #f59e0b; padding-left: .75rem; }
.evidence-severity-high { border-left-color: #ef4444; }
.evidence-why summary { cursor: pointer; font-size: 1rem; font-weight: 700; }
.evidence-why h4 { margin: .85rem 0 .3rem; }
.evidence-why li { margin: .25rem 0; }
.evidence-review-footer { position: sticky; bottom: .5rem; padding: .8rem 1rem; border: 1px solid var(--border-color); border-radius: .7rem; background: color-mix(in srgb, var(--background-color, #111) 88%, transparent); backdrop-filter: blur(14px); z-index: 2; }
.evidence-source-highlight { outline: 2px solid #6366f1; outline-offset: 4px; transition: outline .2s; }

@media (max-width: 900px) {
    .evidence-grid { grid-template-columns: 1fr; }
    .evidence-hero, .evidence-review-footer { flex-direction: column; align-items: stretch; }
    .evidence-change, .evidence-timeline-row { grid-template-columns: 1fr; }
}
