/* =========================================
   ESSENCELAB ERP v2.0 — PREMIUM DARK DESIGN
   ========================================= */

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

/* ── CSS CUSTOM PROPERTIES ── */
:root {
  --bg-primary:     #080808;
  --bg-secondary:   #0f0f0f;
  --bg-card:        #141414;
  --bg-hover:       #1c1c1c;
  --bg-input:       #181818;
  --border:         #242424;
  --border-light:   #303030;

  --gold:           #c9a84c;
  --gold-light:     #e8c97a;
  --gold-dark:      #a07830;
  --gold-glow:      rgba(201, 168, 76, 0.12);
  --gold-glow-lg:   rgba(201, 168, 76, 0.22);

  --white:          #ffffff;
  --text-primary:   #f2f2f2;
  --text-secondary: #888888;
  --text-muted:     #505050;

  --success:        #2d6b4a;
  --success-light:  #4caf78;
  --warning:        #b87530;
  --warning-light:  #e0943a;
  --danger:         #7a2525;
  --danger-light:   #d04545;
  --info:           #2a5070;
  --info-light:     #4a90c8;

  --sidebar-width:  265px;
  --header-height:  60px;
  --radius-sm:      4px;
  --radius-md:      8px;
  --radius-lg:      14px;
  --radius-xl:      20px;

  --shadow-sm:      0 2px 8px rgba(0,0,0,0.5);
  --shadow-md:      0 4px 24px rgba(0,0,0,0.6);
  --shadow-lg:      0 12px 48px rgba(0,0,0,0.7);
  --shadow-gold:    0 0 32px rgba(201, 168, 76, 0.18);
  --shadow-glow:    0 0 0 1px rgba(201,168,76,0.15), 0 4px 24px rgba(0,0,0,0.6);

  --transition:     all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow:all 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html { font-size: 14px; scroll-behavior: smooth; }

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── CUSTOM SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dark); }

/* ── LAYOUT ── */
.app-shell { display: flex; min-height: 100vh; }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: var(--transition);
  box-shadow: 2px 0 20px rgba(0,0,0,0.3);
}

.sidebar::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent, var(--gold-dark) 40%, transparent);
  opacity: 0.3;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo img {
  width: 130px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  transition: var(--transition);
}

.sidebar-logo img:hover { filter: brightness(0) invert(1) sepia(1) saturate(2) hue-rotate(5deg); }

.sidebar-logo-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.35em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 6px;
}

.sidebar-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 18px 20px 6px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  margin-bottom: 2px;
  text-decoration: none;
  user-select: none;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  transform: translateX(2px);
}

.nav-item.active {
  background: var(--gold-glow);
  color: var(--gold);
  border: 1px solid rgba(201, 168, 76, 0.18);
  box-shadow: inset 0 0 20px rgba(201,168,76,0.04);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 65%;
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px rgba(201,168,76,0.4);
}

.nav-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

.sidebar-version {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.sidebar-gold-line {
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
  margin: 0 20px;
  opacity: 0.4;
}

/* ── MAIN CONTENT ── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg-primary);
}

/* ── TOPBAR ── */
.topbar {
  height: var(--header-height);
  background: rgba(15,15,15,0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.topbar-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

.topbar-spacer { flex: 1; }

.topbar-date {
  font-size: 12px;
  color: var(--text-muted);
  font-feature-settings: 'tnum';
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: var(--radius-md);
}

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.btn-icon {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 15px;
  transition: var(--transition);
  position: relative;
}

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

.alert-dot {
  position: absolute;
  top: 5px; right: 5px;
  width: 7px; height: 7px;
  background: var(--danger-light);
  border-radius: 50%;
  border: 1.5px solid var(--bg-card);
  animation: pulse 2s infinite;
}

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

/* ── PAGE CONTENT & TRANSITIONS ── */
.page-content {
  padding: 28px 32px;
  flex: 1;
}

.page-enter {
  animation: pageSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes pageSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 30px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.01em;
  line-height: 1.1;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: var(--transition);
  border-radius: inherit;
}

.btn:hover::after { background: rgba(255,255,255,0.04); }

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #0a0a0a;
  box-shadow: 0 2px 12px rgba(201,168,76,0.15);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  box-shadow: var(--shadow-gold);
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

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

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: var(--danger-light); box-shadow: 0 4px 16px rgba(208,69,69,0.25); }

.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid transparent; }
.btn-ghost:hover { border-color: var(--border-light); color: var(--text-primary); background: var(--bg-hover); }

.btn-sm { padding: 5px 12px; font-size: 12px; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ── CARDS ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
}

.card:hover { border-color: var(--border-light); }

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

.card-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.card-subtitle { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── KPI CARDS ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  transition: var(--transition-bounce);
  cursor: default;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
  opacity: 0;
  transition: var(--transition);
}

.kpi-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top left, rgba(201,168,76,0.04) 0%, transparent 70%);
  opacity: 0;
  transition: var(--transition);
}

.kpi-card:hover {
  border-color: rgba(201,168,76,0.25);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(201,168,76,0.08);
}

.kpi-card:hover::before { opacity: 1; }
.kpi-card:hover::after { opacity: 1; }

.kpi-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
  position: relative;
}

.kpi-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 7px;
  font-feature-settings: 'tnum';
  position: relative;
}

.kpi-value.gold    { color: var(--gold); }
.kpi-value.danger  { color: var(--danger-light); }
.kpi-value.success { color: var(--success-light); }
.kpi-value.warning { color: var(--warning-light); }

.kpi-change {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
}

.kpi-change.up  { color: var(--success-light); }
.kpi-change.down{ color: var(--danger-light); }

.kpi-icon {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 36px;
  opacity: 0.04;
  transition: var(--transition);
}

.kpi-card:hover .kpi-icon { opacity: 0.07; transform: translateY(-50%) scale(1.1); }

/* ── GRID LAYOUTS ── */
.grid-2   { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3   { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 18px; }

/* ── DATA TABLE ── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
}

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

.data-table thead th {
  background: var(--bg-secondary);
  padding: 11px 14px;
  text-align: left;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table tbody tr {
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
}

.data-table tbody tr:hover { background: var(--bg-hover); }

.data-table tbody td {
  padding: 13px 14px;
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tbody td.muted { color: var(--text-muted); font-size: 12px; }

/* ── ROW SELECTION ── */
.row-checkbox {
  width: 15px; height: 15px;
  accent-color: var(--gold);
  cursor: pointer;
}
.row-selected { background: rgba(201,168,76,0.05) !important; }
.row-selected td { border-bottom-color: rgba(201,168,76,0.15) !important; }

/* ── BULK ACTION BAR ── */
.bulk-action-bar {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 200;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.bulk-count { font-size: 13px; font-weight: 700; color: var(--gold); }
.bulk-divider { width: 1px; height: 20px; background: var(--border-light); }

/* ── STATUS BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.8;
  flex-shrink: 0;
}

.badge-success { background: rgba(44,107,74,0.2);  color: var(--success-light); border: 1px solid rgba(76,175,120,0.2); }
.badge-warning { background: rgba(184,117,48,0.2); color: var(--warning-light); border: 1px solid rgba(224,148,58,0.2); }
.badge-danger  { background: rgba(122,37,37,0.2);  color: var(--danger-light);  border: 1px solid rgba(208,69,69,0.2); }
.badge-info    { background: rgba(42,80,112,0.2);  color: var(--info-light);    border: 1px solid rgba(74,144,200,0.2); }
.badge-gold    { background: rgba(201,168,76,0.12); color: var(--gold);         border: 1px solid rgba(201,168,76,0.25); }
.badge-muted   { background: rgba(70,70,70,0.2);   color: var(--text-secondary);border: 1px solid rgba(70,70,70,0.3); }

/* ── FORMS ── */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 13px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow), 0 0 0 1px rgba(201,168,76,0.3);
  background: var(--bg-secondary);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control option { background: var(--bg-secondary); color: var(--text-primary); }

.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

textarea.form-control { resize: vertical; min-height: 80px; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(24px) scale(0.96);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.03);
  opacity: 0;
}

.modal-overlay.active .modal { transform: translateY(0) scale(1); opacity: 1; }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 26px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 16px;
  transition: var(--transition);
}

.modal-close:hover { color: var(--text-primary); border-color: var(--border-light); background: var(--bg-hover); }

.modal-body { padding: 24px 26px; }

.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 18px 26px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ── ALERTS PANEL ── */
.alerts-list { display: flex; flex-direction: column; gap: 6px; }

.alert-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 15px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border-left: 3px solid;
  transition: var(--transition);
}

.alert-item:hover { background: var(--bg-hover); transform: translateX(2px); }
.alert-item.danger  { border-color: var(--danger-light); }
.alert-item.warning { border-color: var(--warning-light); }
.alert-item.info    { border-color: var(--info-light); }

.alert-icon { font-size: 16px; flex-shrink: 0; }
.alert-content { flex: 1; min-width: 0; }
.alert-title { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.alert-desc  { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.alert-time  { font-size: 10px; color: var(--text-muted); white-space: nowrap; }

/* ── PROGRESS BAR ── */
.progress-bar {
  height: 3px;
  background: var(--bg-secondary);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  bottom: 0;
  width: 30%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2));
  border-radius: 2px;
}

.progress-fill.success { background: linear-gradient(90deg, var(--success), var(--success-light)); }
.progress-fill.danger  { background: linear-gradient(90deg, var(--danger), var(--danger-light)); }
.progress-fill.warning { background: linear-gradient(90deg, var(--warning), var(--warning-light)); }

/* ── SEARCH BAR ── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 13px;
  transition: var(--transition);
  min-width: 230px;
}

.search-bar:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-glow); }

.search-bar input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  width: 100%;
}

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

/* ── CHART CONTAINER ── */
.chart-container {
  position: relative;
  width: 100%;
  height: 220px;
}

/* ── TABS ── */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  gap: 0;
}

.tab-btn {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  background: transparent;
  border-top: none; border-left: none; border-right: none;
  font-family: 'Inter', sans-serif;
  position: relative;
}

.tab-btn:hover { color: var(--text-primary); }

.tab-btn.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
  box-shadow: 0 0 8px rgba(201,168,76,0.4);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── LOADING STATES ── */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  gap: 16px;
  color: var(--text-muted);
  font-size: 13px;
}

.loading-spinner {
  width: 36px; height: 36px;
  border: 2px solid var(--border-light);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ── SKELETON LOADER ── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-hover) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

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

/* ── EMPTY STATE ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  text-align: center;
}

.empty-icon  { font-size: 40px; margin-bottom: 12px; opacity: 0.4; }
.empty-title { font-size: 14px; font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }
.empty-desc  { font-size: 12px; color: var(--text-muted); }

/* ── GOLD DIVIDER ── */
.gold-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dark), transparent);
  opacity: 0.3;
  margin: 10px 0;
}

/* ── STAT ROW ── */
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  font-size: 13px;
}

.stat-row:last-child { border-bottom: none; }
.stat-row-label { color: var(--text-muted); }
.stat-row-value { font-weight: 600; font-feature-settings: 'tnum'; }

/* ── TOASTS ── */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-width: 260px;
  max-width: 360px;
}

.toast.exit { animation: toastOut 0.25s ease forwards; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%) scale(0.9); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(100%); }
}

.toast.success { border-left: 3px solid var(--success-light); }
.toast.error   { border-left: 3px solid var(--danger-light); }
.toast.info    { border-left: 3px solid var(--info-light); }

.toast-icon { font-size: 16px; flex-shrink: 0; }
.toast-message { font-size: 13px; font-weight: 500; color: var(--text-primary); flex: 1; }

/* ── DROP ZONE ── */
.drop-zone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--gold);
  background: var(--gold-glow);
}

.drop-zone-icon  { font-size: 36px; margin-bottom: 12px; opacity: 0.5; }
.drop-zone-text  { font-size: 14px; font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }
.drop-zone-subtext { font-size: 12px; color: var(--text-muted); }

/* ── DOC FLOW CARDS ── */
.doc-flow-card {
  padding: 18px !important;
  cursor: pointer;
  transition: var(--transition-bounce) !important;
}

.doc-flow-card:hover {
  transform: translateY(-4px) !important;
  border-color: var(--gold) !important;
  box-shadow: var(--shadow-gold) !important;
}

/* ── FONT HELPERS ── */
.font-mono  { font-family: 'Space Grotesk', monospace; }
.fw-600     { font-weight: 600; }
.text-right { text-align: right; }
.text-success { color: var(--success-light); }
.text-danger  { color: var(--danger-light); }
.text-warning { color: var(--warning-light); }
.text-gold    { color: var(--gold); }
.text-muted   { color: var(--text-muted); }

/* ── CATEGORY CHIPS ── */
.category-chip {
  display: inline-block;
  padding: 2px 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  font-family: 'Space Grotesk', sans-serif;
}

/* ── TECH PACK CARDS ── */
.tp-card {
  cursor: pointer;
  transition: var(--transition-bounce);
}

.tp-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(201,168,76,0.3);
}

/* ── INVOICE PREVIEW ── */
.invoice-preview {
  background: #ffffff;
  padding: 40px;
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  color: #333;
  font-size: 13px;
  max-width: 800px;
  margin: 0 auto;
}

.inv-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 28px; padding-bottom: 18px; border-bottom: 2px solid #1a1a1a; }
.inv-label  { font-size: 26px; font-weight: 700; letter-spacing: 0.1em; color: #1a1a1a; }
.inv-meta   { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 16px; margin-bottom: 28px; }
.inv-meta label { font-size: 9px; text-transform: uppercase; letter-spacing: 0.1em; color: #999; font-weight: 700; display: block; margin-bottom: 4px; }
.inv-meta-group p { font-size: 13px; }
.inv-editable { width: 100%; border: none; border-bottom: 1px dashed #ddd; background: transparent; font-family: 'Inter', sans-serif; font-size: 13px; color: #333; padding: 2px 0; outline: none; }
.inv-editable:focus { border-bottom-color: #c9a84c; }
.inv-totals { display: flex; justify-content: flex-end; margin-top: 20px; }
.inv-totals-box { width: 280px; }
.inv-total-row { display: flex; justify-content: space-between; padding: 7px 0; font-size: 13px; color: #555; border-bottom: 1px solid #f0f0f0; }
.inv-total-row.grand { font-size: 17px; font-weight: 700; color: #1a1a1a; border-top: 2px solid #1a1a1a; border-bottom: none; padding-top: 10px; }
.inv-footer { margin-top: 40px; padding-top: 16px; border-top: 1px solid #eee; font-size: 11px; color: #999; text-align: center; }

/* ── FINANCIAL CHARTS AREA ── */
.charts-row { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; margin-bottom: 20px; }

/* ── KANBAN / ORDER CARDS ── */
.orden-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: var(--transition-bounce);
  position: relative;
  overflow: hidden;
}

.orden-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--gold), var(--gold-dark));
  opacity: 0;
  transition: var(--transition);
}

.orden-card:hover {
  border-color: rgba(201,168,76,0.25);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.orden-card:hover::before { opacity: 1; }

/* ── GLASS EFFECT VARIATION ── */
.glass-card {
  background: rgba(20,20,20,0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-lg);
}

/* ── TECH PACK VIEWER (inside ERP) ── */
.tp-viewer-frame {
  width: 100%;
  border: none;
  height: calc(100vh - 180px);
  border-radius: var(--radius-lg);
  background: white;
}

/* ── INLINE TECH PACK EDITOR ── */
.tp-hero-banner {
  background: linear-gradient(135deg, rgba(201,168,76,0.08) 0%, transparent 60%);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

/* =========================================
   RESPONSIVE — PC / Tablet / Mobile
   Mobile-first overrides layered by breakpoint.
   Sidebar becomes an off-canvas drawer below 1024px.
   ========================================= */

/* ── HAMBURGER TOGGLE (hidden on desktop) ── */
.sidebar-toggle-btn { display: none; }

/* ── SIDEBAR BACKDROP (mobile/tablet drawer scrim) ── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.sidebar-backdrop.active { opacity: 1; pointer-events: all; }

/* ── TABLET (≤1024px): sidebar becomes an off-canvas drawer ── */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .sidebar-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    min-width: 38px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
  }
  .sidebar-toggle-btn:active { background: var(--bg-hover); }
  .sidebar.open ~ .sidebar-backdrop,
  body.sidebar-open .sidebar-backdrop { display: block; }

  .grid-2, .grid-2-1, .grid-1-2, .grid-3 { grid-template-columns: 1fr; }
  .kanban-board { grid-template-columns: 1fr; }
}

/* ── MOBILE (≤768px) ── */
@media (max-width: 768px) {
  html { font-size: 13px; }

  .page-content { padding: 14px 14px 90px; }

  /* Topbar: stack title + collapse non-essential actions */
  .topbar {
    padding: 0 12px;
    gap: 10px;
    height: auto;
    min-height: 56px;
    flex-wrap: wrap;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .topbar-title { font-size: 17px; }
  .topbar-subtitle { display: none; }
  .topbar-date { display: none; }
  .topbar-search-inline { display: none; } /* use per-page search instead of cramming topbar */
  .topbar-actions { gap: 4px; }
  .btn-icon { width: 32px; height: 32px; }

  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .page-title { font-size: 22px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; justify-content: center; }

  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi-card { padding: 14px 14px; }
  .kpi-value { font-size: 20px; }
  .kpi-icon { display: none; }

  .form-row, .form-row-3 { grid-template-columns: 1fr; gap: 10px; }

  /* Tables: allow horizontal scroll with momentum, shrink density */
  .table-wrapper { -webkit-overflow-scrolling: touch; margin: 0 -2px; }
  .data-table { font-size: 12px; }
  .data-table thead th, .data-table tbody td { padding: 8px 10px; white-space: nowrap; }

  /* Modal: full-screen sheet instead of centered card */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    max-width: 100%;
    width: 100%;
    max-height: 92vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transform: translateY(100%);
  }
  .modal-overlay.active .modal { transform: translateY(0); }
  .modal-header { padding: 16px 18px; }
  .modal-body { padding: 16px 18px; }
  .modal-footer { padding: 12px 18px; flex-wrap: wrap; }
  .modal-footer .btn { flex: 1; justify-content: center; }

  /* Command palette: full width, anchored to top */
  #cmdPaletteOverlay { padding-top: 0 !important; align-items: flex-start !important; }
  #cmdPaletteOverlay .modal { border-radius: 0; max-height: 100vh; }

  /* Kanban: horizontal snap-scroll of full-width cards instead of 3 cramped columns */
  .kanban-board {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 12px;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }
  .kanban-col {
    min-width: 86vw;
    scroll-snap-align: start;
  }

  /* Buttons/inputs: minimum 44px touch target per WCAG/Apple HIG */
  .btn, .form-control, select.form-control, .nav-item { min-height: 44px; }
  .btn-sm { min-height: 36px; }

  /* Sidebar drawer takes full width on small phones so labels are legible */
  .sidebar { width: min(300px, 84vw); }
}

/* ── SMALL MOBILE (≤480px) ── */
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .page-title { font-size: 19px; }
  .topbar-title { font-size: 15px; }
  .card { padding: 14px; }
}

/* ── Respect safe-area insets on notched devices (PWA standalone) ── */
@supports (padding: max(0px)) {
  .topbar { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .page-content { padding-bottom: max(24px, env(safe-area-inset-bottom)); }
  .sidebar { padding-left: env(safe-area-inset-left); }
}

/* ── Touch devices: remove hover-only affordances that trap state ── */
@media (hover: none) {
  .kpi-card:hover { transform: none; }
  .btn-icon:hover { transform: none; }
}

/* ── UTILITY ANIMATIONS ── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}

.animate-fade  { animation: fadeIn 0.3s ease; }
.animate-scale { animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* ── KANBAN BOARD ── */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: start;
  min-height: 400px;
}

.kanban-col {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 12px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--border);
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: 300px;
}
.kanban-col.col-planificada  { border-top-color: var(--text-muted); }
.kanban-col.col-produccion   { border-top-color: var(--warning-light); }
.kanban-col.col-terminada    { border-top-color: var(--success); }
.kanban-col.col-cancelada    { border-top-color: var(--danger-light); }

.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 4px;
}
.kanban-col-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.kanban-col-count {
  font-size: 11px;
  background: var(--bg-hover);
  color: var(--text-muted);
  border-radius: 10px;
  padding: 2px 8px;
  font-weight: 600;
}

.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 10px;
  cursor: grab;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  user-select: none;
  position: relative;
}
.kanban-card:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  border-color: var(--gold);
}
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging {
  opacity: 0.4;
  transform: scale(0.97);
}

.kanban-col.drag-over {
  background: rgba(201,168,76,0.06);
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(201,168,76,0.2);
}

.kanban-card-ref    { font-size: 10px; color: var(--gold); font-family: 'Space Grotesk', monospace; margin-bottom: 4px; }
.kanban-card-title  { font-size: 13px; font-weight: 600; margin-bottom: 6px; line-height: 1.3; }
.kanban-card-meta   { font-size: 11px; color: var(--text-muted); display: flex; gap: 10px; flex-wrap: wrap; }

.kanban-empty {
  text-align: center;
  padding: 32px 12px;
  color: var(--text-muted);
  font-size: 12px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
}

@keyframes kanbanDrop {
  from { opacity: 0; transform: scale(0.95) translateY(-8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.kanban-card-new { animation: kanbanDrop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* ── TECH PACK HERO BANNER ── */
.tp-hero-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(201,168,76,0.08) 0%, rgba(201,168,76,0.02) 100%);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
}

/* ── TP CARD ── */
.tp-card {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}
.tp-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}

/* ── KPI SPARKLINE mini chart ── */
.kpi-sparkline {
  width: 100%;
  height: 30px;
  margin-top: 8px;
  opacity: 0.7;
  transition: opacity 0.2s;
  display: block;
}
.kpi-card:hover .kpi-sparkline { opacity: 1; }

/* ── ACTIVITY FEED timeline ── */
#activityFeed > div {
  animation: fadeIn 0.25s ease;
}

/* =========================================
   PHASE 6 — SVG NAV + SIDEBAR USER
   ========================================= */

/* SVG icon in nav items */
.nav-icon-svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color 0.2s;
}
.nav-item:hover .nav-icon-svg,
.nav-item.active .nav-icon-svg {
  color: var(--gold);
}

/* Sidebar footer: session user block */
.sidebar-footer {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border);
  margin-top: auto;
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  margin-bottom: 10px;
  transition: var(--transition);
}
.sidebar-user:hover { border-color: var(--gold-dark); }

.sidebar-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #0a0a0b;
  flex-shrink: 0;
  letter-spacing: 0;
}
.sidebar-user-info {
  flex: 1;
  min-width: 0;
}
.sidebar-user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.sidebar-logout-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.sidebar-logout-btn:hover {
  color: var(--danger-light);
  background: rgba(208,69,69,0.1);
}

.sidebar-version-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
}
.sidebar-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success-light);
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
.sidebar-version {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}
.sidebar-db-label {
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  opacity: 0.7;
}

/* Topbar alert button wrapper */
.topbar-alert-btn-wrap {
  position: relative;
}

/* Command palette input row */
.cmd-palette-input-row {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.cmd-kbd {
  font-size: 10px;
  padding: 2px 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.cmd-results {
  max-height: 320px;
  overflow-y: auto;
  padding: 8px;
}

/* ── Fix: backdrop-filter vendor prefix order ── */
/* (applied where glassmorphism is used) */

/* ── Fix: user-select webkit prefix ── */
.kanban-card,
[draggable] {
  -webkit-user-select: none;
  user-select: none;
}

/* ── INVENTARIO module ── */
.inv-stock-bar {
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}
.inv-stock-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.inv-stock-fill.ok      { background: var(--success-light); }
.inv-stock-fill.warning { background: var(--warning-light); }
.inv-stock-fill.danger  { background: var(--danger-light); }

/* ── CONTRATOS status chips ── */
.contrato-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.contrato-chip.borrador  { background: rgba(80,80,100,0.2); color: #888; border: 1px solid #333; }
.contrato-chip.activo    { background: rgba(45,107,74,0.25); color: var(--success-light); border: 1px solid var(--success); }
.contrato-chip.firmado   { background: rgba(201,168,76,0.15); color: var(--gold); border: 1px solid var(--gold-dark); }
.contrato-chip.vencido   { background: rgba(122,37,37,0.25); color: var(--danger-light); border: 1px solid var(--danger); }
.contrato-chip.cancelado { background: rgba(50,50,50,0.3); color: #666; border: 1px solid #333; }

/* ── COLABORADORES cards ── */
.colab-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition);
  position: relative;
}
.colab-card:hover { border-color: var(--gold-dark); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.colab-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a1a1a, #242424);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800;
  color: var(--gold);
  margin-bottom: 12px;
}
.colab-disp-badge {
  position: absolute; top: 14px; right: 14px;
  font-size: 9px; padding: 2px 8px;
  border-radius: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.colab-disp-badge.disponible { background: rgba(45,107,74,0.25); color: var(--success-light); }
.colab-disp-badge.ocupado    { background: rgba(184,117,48,0.25); color: var(--warning-light); }
.colab-disp-badge.inactivo   { background: rgba(50,50,60,0.4); color: #555; }

/* ===========================================
   PHASE 8 — Intelligent Dashboard Components
   =========================================== */

/* ── Quick Actions Bar ── */
.dash-quick-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.dash-qa-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; color: var(--gold);
  text-transform: uppercase; letter-spacing: 0.08em;
  white-space: nowrap; flex-shrink: 0;
}
.dash-qa-buttons {
  display: flex; gap: 6px; flex-wrap: wrap; flex: 1;
}
.dash-qa-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 8px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 11px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  white-space: nowrap;
}
.dash-qa-btn:hover {
  background: rgba(201,168,76,0.1);
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-1px);
}
.dash-qa-btn svg { opacity: 0.6; flex-shrink: 0; }
.dash-qa-btn:hover svg { opacity: 1; stroke: var(--gold); }

/* ── Intelligent Suggestions ── */
.dash-suggestions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.dash-suggest-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  cursor: pointer; transition: all 0.25s;
}
.dash-suggest-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.dash-suggest-card.danger  { border-left: 3px solid var(--danger-light); }
.dash-suggest-card.warning { border-left: 3px solid var(--warning-light); }
.dash-suggest-card.info    { border-left: 3px solid var(--info-light, #60a5fa); }
.dash-suggest-card.success { border-left: 3px solid var(--success-light); cursor: default; }
.dash-suggest-card.success:hover { transform: none; box-shadow: none; }

.dash-suggest-icon { font-size: 20px; flex-shrink: 0; }
.dash-suggest-body { flex: 1; min-width: 0; }
.dash-suggest-title { font-size: 12px; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.dash-suggest-desc  { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-suggest-action {
  font-size: 10px; font-weight: 700; color: var(--gold);
  white-space: nowrap; flex-shrink: 0;
  opacity: 0; transition: opacity 0.2s;
}
.dash-suggest-card:hover .dash-suggest-action { opacity: 1; }

/* ── Charts row ── */
.dash-charts-row { margin-bottom: 20px; }

/* ── Activity feed items ── */
.activity-feed-item {
  display: flex; gap: 12px; padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.activity-feed-item:last-child { border-bottom: none; }
.activity-feed-icon {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; flex-shrink: 0;
}
.activity-feed-body { flex: 1; min-width: 0; }
.activity-feed-title { font-size: 12px; font-weight: 600; }
.activity-feed-meta  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.activity-feed-time  { font-size: 10px; color: var(--text-muted); white-space: nowrap; }

/* ── Topbar Search ── */
.topbar-search-input {
  width: 160px;
  border-radius: 20px;
  padding: 4px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  transition: width 0.2s, box-shadow 0.2s;
}
.topbar-search-input:focus {
  width: 220px;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(201,168,76,0.2);
}
