/* ============================================================
   Classic RH & SST — Design System v1.0
   Corporate HR/SST Light Theme
   Inspired by Convenia, BambooHR, Gusto
   ============================================================ */

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

/* ============================================================
   1. CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
  /* --- Brand / Primary --- */
  --primary: #2563EB;
  --primary-light: #3B82F6;
  --primary-dark: #1D4ED8;
  --primary-50: #EFF6FF;
  --primary-100: #DBEAFE;
  --primary-200: #BFDBFE;

  /* --- Semantic --- */
  --success: #059669;
  --success-light: #D1FAE5;
  --success-dark: #047857;
  --warning: #D97706;
  --warning-light: #FEF3C7;
  --warning-dark: #B45309;
  --danger: #DC2626;
  --danger-light: #FEE2E2;
  --danger-dark: #B91C1C;
  --info: #0891B2;
  --info-light: #CFFAFE;
  --info-dark: #0E7490;

  /* --- Surfaces --- */
  --bg: #F1F5F9;
  --bg-alt: #E2E8F0;
  --surface: #FFFFFF;
  --surface-hover: #F8FAFC;
  --surface-pressed: #F1F5F9;
  --surface-raised: #FFFFFF;

  /* --- Borders --- */
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --border-strong: #CBD5E1;
  --border-focus: #2563EB;

  /* --- Text --- */
  --text: #1E293B;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --text-inverse: #FFFFFF;
  --text-link: #2563EB;

  /* --- Typography --- */
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', monospace;

  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-md: 16px;
  --text-lg: 20px;
  --text-xl: 24px;
  --text-2xl: 30px;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;

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

  /* --- Radius --- */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* --- Shadows --- */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.04);

  /* --- Transitions --- */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;

  /* --- Z-index --- */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-toast: 500;

  /* --- Layout --- */
  --sidebar-width: 240px;
  --sidebar-collapsed: 64px;
  --topbar-height: 56px;
  --content-max-width: 1280px;
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--text-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-family);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

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

img { max-width: 100%; height: auto; display: block; }

/* Focus visible for accessibility */
:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

::selection {
  background: var(--primary-100);
  color: var(--primary-dark);
}

/* ============================================================
   3. LAYOUT
   ============================================================ */
.page-bg {
  background: var(--bg);
  min-height: 100vh;
  display: flex;
}

.main-content {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition-slow);
}

.content-area {
  flex: 1;
  padding: var(--space-6);
  max-width: var(--content-max-width);
  width: 100%;
  margin: 0 auto;
}

.page-header {
  margin-bottom: var(--space-6);
}
.page-header h1 {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--text);
  line-height: var(--leading-tight);
}
.page-header p {
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin-top: var(--space-1);
}

/* Grid helpers */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-4); }

.flex-row { display: flex; align-items: center; gap: var(--space-3); }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; gap: var(--space-3); }

.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

/* ============================================================
   4. SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: var(--z-sticky);
  overflow-y: auto;
  overflow-x: hidden;
  transition: width var(--transition-slow);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  min-height: var(--topbar-height);
}
.sidebar-brand img {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  object-fit: contain;
  flex-shrink: 0;
}
.sidebar-brand-text {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-3) 0;
}

.sidebar-group {
  margin-bottom: var(--space-1);
}

.sidebar-group-label {
  padding: var(--space-2) var(--space-5) var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-5);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 0;
  margin: 0 var(--space-2);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  position: relative;
  cursor: pointer;
  white-space: nowrap;
}
.sidebar-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}
.sidebar-item.active {
  background: var(--primary-50);
  color: var(--primary);
  font-weight: var(--weight-semibold);
}
.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--primary);
  border-radius: var(--radius-full);
}

.sidebar-item-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  opacity: 0.75;
}
.sidebar-item.active .sidebar-item-icon { opacity: 1; }

.sidebar-item-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-badge {
  background: var(--danger);
  color: var(--text-inverse);
  font-size: 10px;
  font-weight: var(--weight-bold);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
  line-height: 16px;
}

.sidebar-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Sidebar collapsed */
.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}
.sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed .sidebar-group-label,
.sidebar.collapsed .sidebar-item-label,
.sidebar.collapsed .sidebar-badge,
.sidebar.collapsed .sidebar-footer {
  display: none;
}
.sidebar.collapsed .sidebar-item {
  justify-content: center;
  padding: var(--space-2) var(--space-3);
  margin: 0 var(--space-1);
}
.sidebar.collapsed .sidebar-item-icon {
  width: 24px;
  height: 24px;
  font-size: 18px;
}
.sidebar.collapsed .sidebar-brand {
  justify-content: center;
  padding: var(--space-4) var(--space-2);
}
.sidebar.collapsed ~ .main-content {
  margin-left: var(--sidebar-collapsed);
}

/* Sidebar toggle button */
.sidebar-toggle {
  position: absolute;
  top: var(--space-4);
  right: -12px;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
  z-index: 10;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-xs);
}
.sidebar-toggle:hover {
  background: var(--primary-50);
  color: var(--primary);
  border-color: var(--primary-200);
}

/* ============================================================
   5. TOPBAR
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  height: var(--topbar-height);
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex: 1;
  min-width: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-shrink: 0;
}

.topbar-search {
  position: relative;
  width: 280px;
  max-width: 100%;
}
.topbar-search input {
  width: 100%;
  height: 36px;
  padding: 0 var(--space-4) 0 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface-hover);
  font-size: var(--text-sm);
  color: var(--text);
  font-family: var(--font-family);
  transition: all var(--transition-fast);
}
.topbar-search input::placeholder { color: var(--text-muted); }
.topbar-search input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.topbar-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}
.topbar-search-input {
  width: 100%;
  height: 36px;
  padding: 0 var(--space-4) 0 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface-hover);
  font-size: var(--text-sm);
  color: var(--text);
  font-family: var(--font-family);
  transition: all var(--transition-fast);
}
.topbar-search-input::placeholder { color: var(--text-muted); }
.topbar-search-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.topbar-center {
  flex: 0 1 360px;
  min-width: 0;
}
.topbar-search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-height: 360px;
  overflow-y: auto;
  z-index: var(--z-dropdown, 100);
}
.search-item {
  display: block;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition-fast);
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--surface-hover); }
.search-item-name { font-size: var(--text-sm); font-weight: 600; }
.search-item-meta { font-size: var(--text-xs); color: var(--text-muted); margin-top: 2px; }
.search-empty { padding: 20px; text-align: center; color: var(--text-muted); font-size: var(--text-sm); }

.topbar-notification {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 18px;
  transition: all var(--transition-fast);
}
.topbar-notification:hover {
  background: var(--surface-hover);
  color: var(--text);
}
.topbar-notification-count {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  background: var(--danger);
  color: var(--text-inverse);
  font-size: 10px;
  font-weight: var(--weight-bold);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-1) var(--space-3) var(--space-1) var(--space-1);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.topbar-user:hover { background: var(--surface-hover); }
.topbar-user-info {
  text-align: right;
}
.topbar-user-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text);
  line-height: 1.2;
}
.topbar-user-role {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.2;
}

/* ============================================================
   6. CARDS
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition-fast);
}
.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.card-header h2, .card-header h3 {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--text);
  margin: 0;
}
.card-header p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0;
}

.card-body {
  padding: var(--space-5) var(--space-6);
}

.card-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border);
  background: var(--surface-hover);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
}

.card-flat {
  box-shadow: none;
  border: 1px solid var(--border);
}
.card-flat:hover { box-shadow: none; }

/* ============================================================
   7. KPI CARDS
   ============================================================ */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: all var(--transition-fast);
  cursor: pointer;
}
.kpi-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-200);
  transform: translateY(-1px);
}

.kpi-value {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--text);
  line-height: 1;
}

.kpi-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: var(--space-2);
}

.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  margin-top: var(--space-2);
}
.kpi-trend.up { color: var(--success); }
.kpi-trend.down { color: var(--danger); }
.kpi-trend.neutral { color: var(--text-muted); }

.kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: var(--space-3);
}
.kpi-icon.blue { background: var(--primary-50); color: var(--primary); }
.kpi-icon.green { background: var(--success-light); color: var(--success); }
.kpi-icon.amber { background: var(--warning-light); color: var(--warning); }
.kpi-icon.red { background: var(--danger-light); color: var(--danger); }

/* ============================================================
   8. BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  height: 36px;
  font-family: var(--font-family);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  text-decoration: none;
  line-height: 1;
}
.btn:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--primary);
  color: var(--text-inverse);
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: var(--text-inverse); }
.btn-primary:active { background: #1e40af; }

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

.btn-danger {
  background: var(--danger);
  color: var(--text-inverse);
  border-color: var(--danger);
}
.btn-danger:hover { background: var(--danger-dark); border-color: var(--danger-dark); color: var(--text-inverse); }

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

.btn-link {
  background: transparent;
  color: var(--primary);
  border-color: transparent;
  padding: 0;
  height: auto;
}
.btn-link:hover { color: var(--primary-dark); text-decoration: underline; }

.btn-sm {
  height: 28px;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
}

.btn-lg {
  height: 44px;
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-base);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
}
.btn-icon.btn-sm { width: 28px; height: 28px; }

.btn:disabled, .btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================================
   9. FORM INPUTS
   ============================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text);
}
.form-label .required { color: var(--danger); margin-left: 2px; }

.form-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.form-input, .form-select, .form-textarea {
  height: 38px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-family: var(--font-family);
  font-size: var(--text-base);
  color: var(--text);
  transition: all var(--transition-fast);
  width: 100%;
}
.form-textarea {
  height: auto;
  padding: var(--space-3);
  min-height: 80px;
  resize: vertical;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.form-input::placeholder { color: var(--text-muted); }
.form-input.error, .form-select.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220,38,38,0.1);
}

.form-select {
  appearance: none;
  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='%2364748B' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-checkbox-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
}
.form-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.form-error {
  font-size: var(--text-xs);
  color: var(--danger);
  margin-top: 2px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
}

/* ============================================================
   10. DATA TABLE
   ============================================================ */
.data-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.data-table thead {
  background: var(--surface-hover);
  border-bottom: 1px solid var(--border);
}
.data-table th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-weight: var(--weight-semibold);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  user-select: none;
}
.data-table th.sortable { cursor: pointer; }
.data-table th.sortable:hover { color: var(--text); }
.data-table th.sorted { color: var(--primary); }

.data-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background var(--transition-fast);
}
.data-table tbody tr:hover {
  background: var(--surface-hover);
}
.data-table tbody tr:nth-child(even) {
  background: var(--surface-hover);
}
.data-table tbody tr:nth-child(even):hover {
  background: var(--bg);
}

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

.data-table .cell-mono {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}
.data-table .cell-right { text-align: right; }
.data-table .cell-center { text-align: center; }

.table-empty {
  padding: var(--space-10) var(--space-6);
  text-align: center;
  color: var(--text-muted);
}

/* ============================================================
   11. BADGES / STATUS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  border-radius: var(--radius-full);
  line-height: 1.4;
  white-space: nowrap;
}

.badge-success { background: var(--success-light); color: var(--success-dark); }
.badge-warning { background: var(--warning-light); color: var(--warning-dark); }
.badge-danger  { background: var(--danger-light); color: var(--danger-dark); }
.badge-info    { background: var(--info-light); color: var(--info-dark); }
.badge-gray    { background: var(--bg); color: var(--text-secondary); }
.badge-primary { background: var(--primary-50); color: var(--primary-dark); }

.badge-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ============================================================
   12. CHIPS (tags/filters)
   ============================================================ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  cursor: default;
  transition: all var(--transition-fast);
}
.chip.active, .chip:hover {
  background: var(--primary-50);
  border-color: var(--primary-200);
  color: var(--primary);
}
.chip-remove {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  color: currentColor;
  font-size: 10px;
  opacity: 0.6;
}
.chip-remove:hover { opacity: 1; background: rgba(0,0,0,0.08); }

/* ============================================================
   13. ALERTS
   ============================================================ */
.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}
.alert-icon {
  flex-shrink: 0;
  font-size: 16px;
  margin-top: 1px;
}

.alert-info    { background: var(--info-light); border-color: #A5F3FC; color: var(--info-dark); }
.alert-warning { background: var(--warning-light); border-color: #FDE68A; color: var(--warning-dark); }
.alert-danger  { background: var(--danger-light); border-color: #FCA5A5; color: var(--danger-dark); }
.alert-success { background: var(--success-light); border-color: #A7F3D0; color: var(--success-dark); }

/* ============================================================
   14. TABS
   ============================================================ */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  gap: 0;
  overflow-x: auto;
}
.tab-item {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  text-decoration: none;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--font-family);
}
.tab-item:hover { color: var(--text); }
.tab-item.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: var(--weight-semibold);
}

/* ============================================================
   15. MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: translateY(20px);
  transition: transform var(--transition-base);
}
.modal-overlay.active .modal { transform: translateY(0); }

.modal-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h2 {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--text);
  margin: 0;
}
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 18px;
  transition: all var(--transition-fast);
}
.modal-close:hover { background: var(--surface-hover); color: var(--text); }

.modal-body {
  padding: var(--space-6);
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
}

.modal-lg { max-width: 720px; }
.modal-xl { max-width: 960px; }

/* ============================================================
   16. DRAWER
   ============================================================ */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.4);
  z-index: var(--z-modal);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}
.drawer-overlay.active { opacity: 1; visibility: visible; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 90vw;
  background: var(--surface);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  z-index: calc(var(--z-modal) + 1);
  transform: translateX(100%);
  transition: transform var(--transition-slow);
}
.drawer.active { transform: translateX(0); }

.drawer-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.drawer-body {
  flex: 1;
  padding: var(--space-6);
  overflow-y: auto;
}
.drawer-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* ============================================================
   17. EMPTY STATE
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-6);
  text-align: center;
}
.empty-state-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--bg);
  font-size: 28px;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}
.empty-state-title {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--text);
  margin-bottom: var(--space-2);
}
.empty-state-text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  max-width: 360px;
  margin-bottom: var(--space-5);
}

/* ============================================================
   18. LOADING: SKELETON & SPINNER
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--bg) 25%, var(--bg-alt) 37%, var(--bg) 63%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
  height: 20px;
}
.skeleton-text { height: 14px; width: 60%; margin-bottom: var(--space-2); }
.skeleton-title { height: 22px; width: 40%; margin-bottom: var(--space-3); }
.skeleton-card { height: 120px; border-radius: var(--radius-lg); }

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spinner-rotate 0.6s linear infinite;
}
.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.spinner-lg { width: 36px; height: 36px; border-width: 4px; }

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

.loading-center {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-10);
}

/* ============================================================
   19. BREADCRUMB
   ============================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb-separator {
  font-size: 10px;
  color: var(--text-muted);
}
.breadcrumb-current {
  color: var(--text);
  font-weight: var(--weight-medium);
}

/* ============================================================
   20. AVATAR
   ============================================================ */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--primary-100);
  color: var(--primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 28px; height: 28px; font-size: var(--text-xs); }
.avatar-lg { width: 48px; height: 48px; font-size: var(--text-md); }
.avatar-xl { width: 64px; height: 64px; font-size: var(--text-lg); }

.avatar-group {
  display: flex;
}
.avatar-group .avatar {
  border: 2px solid var(--surface);
  margin-left: -8px;
}
.avatar-group .avatar:first-child { margin-left: 0; }

/* ============================================================
   21. TOOLTIP
   ============================================================ */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-1) var(--space-2);
  background: var(--text);
  color: var(--text-inverse);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: var(--z-dropdown);
}
[data-tooltip]:hover::after { opacity: 1; }

/* ============================================================
   22. PROGRESS BAR
   ============================================================ */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--primary);
  transition: width var(--transition-slow);
}
.progress-bar-fill.success { background: var(--success); }
.progress-bar-fill.warning { background: var(--warning); }
.progress-bar-fill.danger  { background: var(--danger); }

.progress-bar-sm { height: 4px; }
.progress-bar-lg { height: 12px; }

/* ============================================================
   23. TIMELINE
   ============================================================ */
.timeline {
  position: relative;
  padding-left: var(--space-8);
}
.timeline::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: var(--space-5);
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: calc(-1 * var(--space-8) + 6px);
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 2px var(--primary-200);
}
.timeline-dot.success { background: var(--success); box-shadow: 0 0 0 2px var(--success-light); }
.timeline-dot.warning { background: var(--warning); box-shadow: 0 0 0 2px var(--warning-light); }
.timeline-dot.danger  { background: var(--danger); box-shadow: 0 0 0 2px var(--danger-light); }
.timeline-dot.gray    { background: var(--text-muted); box-shadow: 0 0 0 2px var(--bg); }

.timeline-time {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: 2px;
}
.timeline-content {
  font-size: var(--text-sm);
  color: var(--text);
}

/* ============================================================
   24. DROPDOWN
   ============================================================ */
.dropdown {
  position: relative;
  display: inline-block;
}
.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-1) 0;
  z-index: var(--z-dropdown);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all var(--transition-fast);
}
.dropdown-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition-fast);
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  font-family: var(--font-family);
}
.dropdown-item:hover { background: var(--surface-hover); }
.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-1) 0;
}

/* ============================================================
   25. SECTION TITLE
   ============================================================ */
.section-title {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
}

/* ============================================================
   26. DIVIDER
   ============================================================ */
.divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-4) 0;
}

/* ============================================================
   27. TEXT UTILITIES
   ============================================================ */
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-md { font-size: var(--text-md); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }

.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

.font-medium { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-bold { font-weight: var(--weight-bold); }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   28. STATUS DOT (inline indicator)
   ============================================================ */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.status-dot.online { background: var(--success); }
.status-dot.offline { background: var(--text-muted); }
.status-dot.warning { background: var(--warning); }
.status-dot.error { background: var(--danger); }

/* ============================================================
   29. RESPONSIVE BREAKPOINTS
   ============================================================ */

/* Tablet: < 1024px */
@media (max-width: 1024px) {
  .sidebar {
    width: var(--sidebar-collapsed);
  }
  .sidebar .sidebar-brand-text,
  .sidebar .sidebar-group-label,
  .sidebar .sidebar-item-label,
  .sidebar .sidebar-badge,
  .sidebar .sidebar-footer {
    display: none;
  }
  .sidebar .sidebar-item {
    justify-content: center;
    padding: var(--space-2) var(--space-3);
    margin: 0 var(--space-1);
  }
  .sidebar .sidebar-brand {
    justify-content: center;
    padding: var(--space-4) var(--space-2);
  }
  .main-content {
    margin-left: var(--sidebar-collapsed);
  }
  .sidebar-toggle { display: none; }

  .content-area {
    padding: var(--space-4);
  }

  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile: < 768px */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width);
    z-index: var(--z-modal);
    box-shadow: var(--shadow-xl);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .sidebar .sidebar-brand-text,
  .sidebar .sidebar-group-label,
  .sidebar .sidebar-item-label,
  .sidebar .sidebar-badge,
  .sidebar .sidebar-footer {
    display: block;
  }
  .sidebar .sidebar-item {
    justify-content: flex-start;
    padding: var(--space-2) var(--space-5);
    margin: 0 var(--space-2);
  }
  .sidebar .sidebar-brand {
    justify-content: flex-start;
    padding: var(--space-4) var(--space-5);
  }

  .main-content {
    margin-left: 0;
  }

  .content-area {
    padding: var(--space-3);
  }

  .topbar {
    padding: 0 var(--space-3);
  }
  .topbar-search { display: none; }

  .grid-2, .grid-3, .grid-4, .grid-auto {
    grid-template-columns: 1fr;
  }
  .kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal { max-width: 95vw; }
  .drawer { width: 100vw; max-width: 100vw; }
}

/* Large screens: > 1280px */
@media (min-width: 1280px) {
  .content-area {
    padding: var(--space-8);
  }
}

/* Mobile sidebar overlay */
.sidebar-mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.4);
  z-index: calc(var(--z-modal) - 1);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}
.sidebar-mobile-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Mobile menu button */
.mobile-menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text);
  font-size: 20px;
  border-radius: var(--radius-md);
}
.mobile-menu-btn:hover { background: var(--surface-hover); }

@media (max-width: 768px) {
  .mobile-menu-btn { display: flex; }
}

/* ============================================================
   30. PRINT STYLES
   ============================================================ */
@media print {
  .sidebar,
  .topbar,
  .sidebar-mobile-overlay,
  .sidebar-toggle,
  .btn,
  .mobile-menu-btn {
    display: none !important;
  }
  .main-content {
    margin-left: 0 !important;
  }
  .content-area {
    padding: 0 !important;
    max-width: none !important;
  }
  body {
    background: white !important;
    color: black !important;
  }
  .card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
    break-inside: avoid;
  }
  .kpi-card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
}

/* ============================================================
   31. WELCOME / GREETING
   ============================================================ */
.welcome-section {
  margin-bottom: var(--space-6);
}
.welcome-greeting {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--text);
  margin-bottom: var(--space-1);
}
.welcome-date {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* ============================================================
   32. DASHBOARD COLUMNS
   ============================================================ */
.dash-columns {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: var(--space-4);
}
@media (max-width: 1024px) {
  .dash-columns { grid-template-columns: 1fr; }
}

/* ============================================================
   33. PRIORITY / ACTION LIST
   ============================================================ */
.priority-list {
  list-style: none;
}
.priority-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition-fast);
}
.priority-item:last-child { border-bottom: none; }
.priority-item:hover { background: var(--surface-hover); }

.priority-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-size: 14px;
  flex-shrink: 0;
}
.priority-icon.high { background: var(--danger-light); color: var(--danger); }
.priority-icon.medium { background: var(--warning-light); color: var(--warning); }
.priority-icon.low { background: var(--info-light); color: var(--info); }

.priority-content {
  flex: 1;
  min-width: 0;
}
.priority-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.priority-meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ============================================================
   34. INTEGRATION STATUS CARDS
   ============================================================ */
.integ-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.integ-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.integ-info {
  flex: 1;
  min-width: 0;
}
.integ-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text);
}
.integ-detail {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ============================================================
   35. SCROLLBAR STYLING
   ============================================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}


/* ============================================================
   36. PAGE HEADER (titulo + subtitulo + acoes contextuais)
   ============================================================ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.page-header-text { flex: 1; min-width: 0; }
.page-header-title {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--text);
  line-height: var(--leading-tight);
  margin: 0;
}
.page-header-subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-1);
}
.page-header-actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}
@media (max-width: 640px) {
  .page-header { flex-direction: column; }
  .page-header-actions { width: 100%; }
  .page-header-actions .btn { flex: 1; }
}

/* ============================================================
   37. ACTION BAR (barra de acoes padrao ERP)
   ============================================================ */
.action-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}
.action-bar .btn { font-size: var(--text-sm); }
.action-bar-spacer { flex: 1; }
.action-bar-group {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}
.action-bar-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 var(--space-1);
}

/* ============================================================
   38. FILTER BAR (filtros colapsaveis)
   ============================================================ */
.filter-bar {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  align-items: flex-end;
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
}
.filter-bar.collapsed { display: none; }
.filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 160px;
}
.filter-group label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.filter-group input,
.filter-group select {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-family: var(--font-family);
  background: var(--bg);
  color: var(--text);
}
.filter-group input:focus,
.filter-group select:focus {
  border-color: var(--border-focus);
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-100);
}
.filter-actions {
  display: flex;
  gap: var(--space-2);
  align-self: flex-end;
}
@media (max-width: 640px) {
  .filter-group { min-width: 100%; }
}

/* ============================================================
   39. FORM SECTION (agrupamento de campos)
   ============================================================ */
.form-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}
.form-section-title {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--text);
  margin: 0 0 var(--space-4) 0;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-light);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-4);
}
.form-field { display: flex; flex-direction: column; gap: var(--space-1); }
.form-field label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-field input,
.form-field select,
.form-field textarea {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-family: var(--font-family);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--border-focus);
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-100);
}
.form-field textarea { resize: vertical; min-height: 80px; }
.form-field .field-error {
  font-size: var(--text-xs);
  color: var(--danger);
  margin-top: var(--space-1);
}
.form-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-light);
  margin-top: var(--space-4);
}
.form-field-full { grid-column: 1 / -1; }

/* ============================================================
   40. PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
  margin-top: var(--space-2);
}
.pagination-info {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.pagination-controls {
  display: flex;
  gap: var(--space-1);
}
.pagination-btn {
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-size: var(--text-sm);
  font-family: var(--font-family);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.pagination-btn:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.pagination-btn.active { background: var(--primary); color: var(--text-inverse); border-color: var(--primary); }
.pagination-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============================================================
   41. CONFIRM DIALOG (overlay modal)
   ============================================================ */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.15s;
}
.confirm-dialog {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  max-width: 420px;
  width: 90%;
  box-shadow: var(--shadow-xl);
}
.confirm-dialog-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--text);
  margin: 0 0 var(--space-2) 0;
}
.confirm-dialog-message {
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin: 0 0 var(--space-5) 0;
  line-height: var(--leading-normal);
}
.confirm-dialog-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
}

/* ============================================================
   42. KPI GRID (wrapper responsivo)
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}
.kpi-grid-compact {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-3);
}

/* ============================================================
   43. LOGIN / AUTH PAGES
   Centered card layout — claim: corporate, clean, professional
   ============================================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background:
    radial-gradient(circle at 20% 0%, rgba(37, 99, 235, 0.08), transparent 45%),
    radial-gradient(circle at 80% 100%, rgba(37, 99, 235, 0.06), transparent 50%),
    var(--bg);
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 400px;
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-align: center;
  margin-bottom: var(--space-2);
}
.auth-brand-mark {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
  margin-bottom: var(--space-2);
}
.auth-brand-mark svg { width: 28px; height: 28px; }
.auth-brand-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--text);
  letter-spacing: -0.01em;
}
.auth-brand-subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.auth-form .btn-primary {
  width: 100%;
  justify-content: center;
  padding: 10px 16px;
  font-weight: var(--weight-semibold);
}

.auth-alert {
  display: none;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--danger-light);
  border: 1px solid #FCA5A5;
  color: var(--danger-dark);
  font-size: var(--text-sm);
  align-items: flex-start;
  gap: var(--space-2);
}
.auth-alert.visible { display: flex; }

.auth-footer {
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-light);
  text-align: center;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ============================================================
   44. HUB / LANDING GRID
   Corporate home with module cards + tags
   ============================================================ */
.hub-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.hub-topbar {
  height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}
.hub-topbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: var(--weight-bold);
  color: var(--text);
  font-size: var(--text-md);
  letter-spacing: -0.01em;
}
.hub-topbar-brand img {
  height: 28px;
  width: auto;
  border-radius: var(--radius-sm);
}
.hub-topbar-brand .brand-accent { color: var(--primary); font-weight: var(--weight-semibold); }
.hub-topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.hub-topbar-user {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}
.hub-topbar-user .name {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text);
}
.hub-topbar-user .role {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.hub-topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--primary-50);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
}

.hub-body {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
}
.hub-welcome {
  margin-bottom: var(--space-6);
}
.hub-welcome-title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-1);
}
.hub-welcome-subtitle {
  font-size: var(--text-md);
  color: var(--text-secondary);
}

.hub-section {
  margin-bottom: var(--space-8);
}
.hub-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}
.hub-section-title {
  font-size: 11px;
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.hub-section-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-4);
}

.hub-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  text-decoration: none;
  color: inherit;
  position: relative;
  min-height: 160px;
}
.hub-card:hover {
  border-color: var(--primary-200);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  color: inherit;
}
.hub-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-3);
}
.hub-card-icon svg { width: 22px; height: 22px; }
.hub-card-icon.blue    { background: var(--primary-50);   color: var(--primary-dark); }
.hub-card-icon.emerald { background: var(--success-light); color: var(--success-dark); }
.hub-card-icon.red     { background: var(--danger-light);  color: var(--danger-dark); }
.hub-card-icon.amber,
.hub-card-icon.orange  { background: var(--warning-light); color: var(--warning-dark); }
.hub-card-icon.cyan    { background: var(--info-light);    color: var(--info-dark); }
.hub-card-icon.violet  { background: #EDE9FE;             color: #6D28D9; }
.hub-card-icon.pink    { background: #FCE7F3;             color: #BE185D; }
.hub-card-icon.slate   { background: #E2E8F0;             color: #475569; }
.hub-card-title {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--text);
  margin-bottom: var(--space-1);
  letter-spacing: -0.01em;
}
.hub-card-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-normal);
  flex: 1;
}
.hub-card-tag {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  font-size: 10px;
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--bg);
  color: var(--text-muted);
}
.hub-card-tag.tag-rh     { background: var(--primary-50);   color: var(--primary-dark); }
.hub-card-tag.tag-cq     { background: var(--success-light); color: var(--success-dark); }
.hub-card-tag.tag-sst    { background: var(--danger-light);  color: var(--danger-dark); }
.hub-card-tag.tag-fin    { background: var(--warning-light); color: var(--warning-dark); }
.hub-card-tag.tag-nr1    { background: var(--info-light);    color: var(--info-dark); }
.hub-card-tag.tag-lid    { background: #FCE7F3;             color: #BE185D; }
.hub-card-tag.tag-int    { background: #E2E8F0;             color: #475569; }
.hub-card-tag.tag-ia     { background: #EDE9FE;             color: #6D28D9; }
.hub-card-tag.tag-bi     { background: var(--primary-50);   color: var(--primary-dark); }
.hub-card-tag.tag-fiscal { background: #E2E8F0;             color: #475569; }
.hub-card-tag.tag-novo   { background: var(--success); color: var(--text-inverse); }

.hub-footer {
  text-align: center;
  padding: var(--space-6);
  color: var(--text-muted);
  font-size: var(--text-xs);
  border-top: 1px solid var(--border-light);
}

@media (max-width: 640px) {
  .hub-body { padding: var(--space-5) var(--space-4); }
  .hub-welcome-title { font-size: var(--text-xl); }
  .hub-topbar { padding: 0 var(--space-4); }
  .hub-topbar-user { display: none; }
}

/* ============================================================
   45. PENDENCIAS / EXECUTIVE ALERTS PANEL
   Painel executivo de decisao — contratos, ASO, treinamento, ferias
   ============================================================ */
.pend-refresh-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}
.pend-refresh-info { display: flex; align-items: center; gap: var(--space-2); }
.pend-refresh-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-light);
  animation: pendPulse 2s ease-in-out infinite;
}
@keyframes pendPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

.pend-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}
.pend-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  transition: all var(--transition-base);
}
.pend-kpi:hover { box-shadow: var(--shadow-md); }
.pend-kpi-num {
  font-size: 32px;
  font-weight: var(--weight-bold);
  line-height: 1;
  letter-spacing: -0.02em;
  min-width: 48px;
}
.pend-kpi-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: var(--weight-medium);
}
.pend-kpi-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}
.pend-kpi.urgente     { border-left-color: var(--danger); }
.pend-kpi.urgente .pend-kpi-num   { color: var(--danger); }
.pend-kpi.atencao     { border-left-color: var(--warning); }
.pend-kpi.atencao .pend-kpi-num   { color: var(--warning); }
.pend-kpi.ok          { border-left-color: var(--success); }
.pend-kpi.ok .pend-kpi-num        { color: var(--success); }

.pend-tabs {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  width: fit-content;
}
.pend-tab {
  padding: 8px 14px;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}
.pend-tab:hover { color: var(--text); background: var(--surface-hover); }
.pend-tab.active {
  background: var(--primary);
  color: var(--text-inverse);
}
.pend-tab .count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  font-size: 10px;
  font-weight: var(--weight-bold);
  border-radius: var(--radius-full);
  background: var(--bg-alt);
  color: var(--text-secondary);
}
.pend-tab.active .count {
  background: rgba(255, 255, 255, 0.25);
  color: var(--text-inverse);
}

.pend-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
  overflow: hidden;
  transition: all var(--transition-base);
}
.pend-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast);
}
.pend-section-header:hover { background: var(--surface-hover); }
.pend-section-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.pend-section-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-md);
  flex-shrink: 0;
}
.pend-section-icon.orange { background: var(--warning-light); color: var(--warning-dark); }
.pend-section-icon.red    { background: var(--danger-light);  color: var(--danger-dark); }
.pend-section-icon.blue   { background: var(--primary-50);    color: var(--primary-dark); }
.pend-section-icon.green  { background: var(--success-light); color: var(--success-dark); }
.pend-section-icon.violet { background: #EDE9FE;              color: #6D28D9; }
.pend-section-title {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--text);
  letter-spacing: -0.01em;
}
.pend-section-subtitle {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}
.pend-section-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.pend-section-badges {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}
.pend-section-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.pend-section-badge.urgente { background: var(--danger-light); color: var(--danger-dark); }
.pend-section-badge.atencao { background: var(--warning-light); color: var(--warning-dark); }
.pend-section-badge.ok      { background: var(--success-light); color: var(--success-dark); }
.pend-section-chevron {
  color: var(--text-muted);
  transition: transform var(--transition-base);
  font-size: 10px;
}
.pend-section.open .pend-section-chevron { transform: rotate(180deg); }

.pend-section-body {
  display: none;
  border-top: 1px solid var(--border);
  background: var(--surface-hover);
}
.pend-section.open .pend-section-body { display: block; }
.pend-section-content { padding: var(--space-4) var(--space-5); }

.pend-empty {
  padding: var(--space-6);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}
.pend-empty-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--success-light);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--weight-bold);
}

.pend-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.pend-item {
  display: grid;
  grid-template-columns: 56px 1fr auto auto;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}
.pend-item:hover { box-shadow: var(--shadow-sm); border-color: var(--primary-200); }
.pend-item.urgente { border-left-color: var(--danger); }
.pend-item.atencao { border-left-color: var(--warning); }
.pend-item.ok      { border-left-color: var(--success); }

.pend-item-level {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  color: var(--text-inverse);
  flex-shrink: 0;
}
.pend-item.urgente .pend-item-level { background: var(--danger); }
.pend-item.atencao .pend-item-level { background: var(--warning); }
.pend-item.ok      .pend-item-level { background: var(--success); }

.pend-item-body { min-width: 0; }
.pend-item-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pend-item-detail {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}
.pend-item-decision {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.pend-item-decision.renovar      { background: var(--success-light); color: var(--success-dark); }
.pend-item-decision.avaliar      { background: var(--info-light);    color: var(--info-dark); }
.pend-item-decision.ressalva     { background: var(--warning-light); color: var(--warning-dark); }
.pend-item-decision.nao-renovar  { background: var(--danger-light);  color: var(--danger-dark); }

.pend-item-meta {
  text-align: right;
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.pend-item-days {
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  line-height: 1;
}
.pend-item.urgente .pend-item-days { color: var(--danger); }
.pend-item.atencao .pend-item-days { color: var(--warning); }
.pend-item.ok      .pend-item-days { color: var(--success); }
.pend-item-date { margin-top: 2px; }

.pend-item-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}
.pend-item-action {
  padding: 6px 10px;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--primary);
  background: var(--primary-50);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.pend-item-action:hover {
  background: var(--primary);
  color: var(--text-inverse);
}
.pend-item-action.secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}
.pend-item-action.secondary:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--border-strong);
}

@media (max-width: 900px) {
  .pend-kpis { grid-template-columns: 1fr; }
  .pend-item {
    grid-template-columns: 48px 1fr;
    grid-template-areas:
      "level body"
      "level meta"
      "actions actions";
    gap: var(--space-2) var(--space-3);
  }
  .pend-item-level   { grid-area: level; }
  .pend-item-body    { grid-area: body; }
  .pend-item-meta    { grid-area: meta; text-align: left; }
  .pend-item-actions { grid-area: actions; justify-content: flex-end; }
}
