/* === Design System (shadcn-inspired) === */
:root {
  --bg: #ffffff;
  --bg-muted: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #0f172a;
  --bg-sidebar-hover: #1e293b;
  --bg-sidebar-active: #1e293b;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-sidebar: #94a3b8;
  --text-sidebar-active: #ffffff;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #eef2ff;
  --destructive: #ef4444;
  --destructive-light: #fef2f2;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --success: #22c55e;
  --success-light: #f0fdf4;
  --info: #3b82f6;
  --info-light: #eff6ff;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --transition: 150ms cubic-bezier(.4,0,.2,1);
  --sidebar-w: 256px;
  --sidebar-w-collapsed: 64px;
  --header-h: 56px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--bg-muted);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* === Layout === */
.app { display: flex; min-height: 100vh; }

/* === Sidebar === */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 40;
  transition: width var(--transition), transform var(--transition);
  overflow: hidden;
}

.sidebar.collapsed { width: var(--sidebar-w-collapsed); }

.sidebar-header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}

.sidebar-logo {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo svg { color: #fff; }

.sidebar-title {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar.collapsed .sidebar-title,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-group-title { display: none; }

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

.nav-group-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: rgba(255,255,255,.35);
  padding: 16px 12px 6px;
  white-space: nowrap;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  color: var(--text-sidebar);
  text-decoration: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  position: relative;
}

.nav-item:hover { background: var(--bg-sidebar-hover); color: #e2e8f0; }
.nav-item.active { background: var(--bg-sidebar-active); color: var(--text-sidebar-active); }

.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.nav-badge {
  margin-left: auto;
  background: var(--destructive);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.sidebar.collapsed .nav-badge {
  position: absolute;
  top: 4px; right: 4px;
  padding: 0 4px;
  font-size: 10px;
  min-width: 16px;
}

.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid rgba(255,255,255,.08);
}

/* === Main === */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  transition: margin-left var(--transition);
  min-width: 0;
}

.sidebar.collapsed ~ .main { margin-left: var(--sidebar-w-collapsed); }

/* === Header === */
.header {
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.btn-toggle {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition);
}

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

.header-title { font-size: 16px; font-weight: 600; }
.header-spacer { flex: 1; }

/* === Content === */
.content { padding: 24px; max-width: 1400px; }

/* === Cards === */
.stats-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: box-shadow var(--transition);
  cursor: default;
  flex: 1 1 auto;
  min-width: 150px;
}

.stat-card:hover { box-shadow: var(--shadow-md); }

.stat-card-header {
  display: none;
}

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

.stat-card-icon svg { width: 18px; height: 18px; }

.stat-card-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stat-card-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.1;
}

.stat-card-sub {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.stat-card-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

/* Color variants */
.stat-card.danger .stat-card-icon { background: var(--destructive-light); color: var(--destructive); }
.stat-card.danger .stat-card-value { color: var(--destructive); }
.stat-card.warning .stat-card-icon { background: var(--warning-light); color: var(--warning); }
.stat-card.warning .stat-card-value { color: var(--warning); }
.stat-card.info .stat-card-icon { background: var(--info-light); color: var(--info); }
.stat-card.info .stat-card-value { color: var(--info); }
.stat-card.success .stat-card-icon { background: var(--success-light); color: var(--success); }
.stat-card.success .stat-card-value { color: var(--success); }
.stat-card.purple .stat-card-icon { background: #f5f3ff; color: #8b5cf6; }

/* === Section === */
.section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
}

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

.section-title {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title svg { width: 18px; height: 18px; color: var(--text-muted); }

.section-body { padding: 0; }

/* === Task List === */
.task-list { list-style: none; }

.task-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
  cursor: pointer;
}

.task-item:last-child { border-bottom: none; }
.task-item:hover { background: var(--bg-muted); }

.task-priority-bar {
  width: 3px;
  height: 36px;
  border-radius: 2px;
  flex-shrink: 0;
}

.task-priority-bar.critical { background: var(--destructive); }
.task-priority-bar.high { background: var(--warning); }
.task-priority-bar.normal { background: var(--info); }
.task-priority-bar.low { background: #cbd5e1; }

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

.task-icon svg { width: 18px; height: 18px; }

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

.task-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 2px;
}

.task-meta-item {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.task-meta-item svg { width: 12px; height: 12px; }

/* === Badges === */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  white-space: nowrap;
}

.badge-overdue { background: var(--destructive-light); color: var(--destructive); }
.badge-pending { background: var(--warning-light); color: #b45309; }
.badge-in_progress { background: var(--info-light); color: var(--info); }
.badge-completed { background: var(--success-light); color: #15803d; }
.badge-cancelled { background: #f8fafc; color: #94a3b8; }

/* === Task Actions === */
.task-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.btn-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-icon:hover { background: var(--bg-muted); color: var(--text); }
.btn-icon svg { width: 16px; height: 16px; }

.btn-icon.success:hover { background: var(--success-light); color: var(--success); }
.btn-icon.danger:hover { background: var(--destructive-light); color: var(--destructive); }

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-hover); }

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

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

/* === Equipment Grid === */
.equipment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  padding: 20px;
}

.eq-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: all var(--transition);
  cursor: pointer;
}

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

.eq-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.eq-card-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.eq-card-icon svg { width: 20px; height: 20px; }

.eq-card-title { font-size: 14px; font-weight: 600; }
.eq-card-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

.eq-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.eq-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
}

.eq-status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
}

.eq-status-dot.active { background: var(--success); }
.eq-status-dot.maintenance { background: var(--warning); }
.eq-status-dot.broken { background: var(--destructive); }
.eq-status-dot.decommissioned { background: #94a3b8; }

/* === Filters bar === */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9999px;
  cursor: pointer;
  color: var(--text-muted);
  font-family: var(--font);
  transition: all var(--transition);
}

.filter-chip:hover { border-color: var(--primary); color: var(--primary); }
.filter-chip.active { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }

/* === Modal === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(2px);
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg);
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
}

.modal-title { font-size: 16px; font-weight: 600; }

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

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

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  font-family: var(--font);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  transition: border-color var(--transition);
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}

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

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* === Empty state === */
.empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}

.empty svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: .4; }
.empty-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; color: var(--text); }
.empty-text { font-size: 13px; }

/* === Responsive === */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-w);
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar.collapsed { transform: translateX(-100%); }
  .main { margin-left: 0 !important; }
  .content { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-card-value { font-size: 22px; }
  .equipment-grid { grid-template-columns: 1fr; padding: 12px; }
  .task-meta { flex-wrap: wrap; gap: 6px; }

  .mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 35;
    display: none;
  }
  .sidebar.mobile-open ~ .mobile-overlay { display: block; }
}

/* === Scrollbar === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* === Tab navigation === */
.page { display: none; }
.page.active { display: block; }

/* Loading shimmer */
.skeleton {
  background: linear-gradient(90deg, var(--bg-muted) 25%, #e2e8f0 50%, var(--bg-muted) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

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


/* === Login Screen === */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-sidebar);
  padding: 24px;
}

.login-card {
  background: var(--bg);
  border-radius: 12px;
  padding: 40px 36px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.login-logo {
  width: 48px; height: 48px;
  background: var(--primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
}

.login-logo svg { color: #fff; width: 24px; height: 24px; }

.login-title {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.login-subtitle {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.login-error {
  color: var(--destructive);
  font-size: 13px;
  text-align: center;
  margin-bottom: 12px;
  min-height: 20px;
}

.btn-full {
  width: 100%;
  justify-content: center;
  padding: 10px 16px;
  font-size: 14px;
  margin-top: 8px;
}

/* === Sidebar User === */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  color: var(--text-sidebar);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
}

.sidebar-user svg { width: 18px; height: 18px; flex-shrink: 0; }


/* === Equipment Detail Page === */
.detail-back { margin-bottom: 16px; }

.detail-header {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.detail-header-icon {
  width: 56px; height: 56px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.detail-header-icon svg { width: 28px; height: 28px; }

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

.detail-header-name {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.detail-header-sub {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 13px;
}

.detail-header-sub span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.detail-header-sub svg { width: 14px; height: 14px; }

.detail-header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
  align-items: start;
}

.detail-main { min-width: 0; }

/* Spec table */
.spec-table {
  width: 100%;
  border-collapse: collapse;
}

.spec-table tr { border-bottom: 1px solid var(--border-light); }
.spec-table tr:last-child { border-bottom: none; }

.spec-table td {
  padding: 12px 20px;
  font-size: 13px;
  vertical-align: top;
}

.spec-table td:first-child {
  color: var(--text-muted);
  font-weight: 500;
  width: 180px;
  white-space: nowrap;
}

.spec-table td:last-child {
  font-weight: 500;
}

/* Stats mini cards */
.mini-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border-light);
}

.mini-stat {
  background: var(--bg);
  padding: 16px 20px;
  text-align: center;
}

.mini-stat-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}

.mini-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .03em;
}

/* Timeline items */
.timeline-item {
  display: flex;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
}

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

.timeline-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}

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

.timeline-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

.timeline-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.timeline-notes {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .detail-header { flex-wrap: wrap; }
  .spec-table td:first-child { width: 140px; }
}


/* === Task detail actions === */
.btn-full { width: 100%; justify-content: center; }
.task-info[style*="cursor"] .task-title:hover { color: var(--primary); }
.btn.btn-outline.btn-full { display: flex; align-items: center; gap: 8px; }
.badge-cancelled { background: #fef2f2; color: #ef4444; }


/* === Checklist === */
.checklist-progress-bar {
  height: 4px;
  background: var(--border-light);
  border-radius: 2px;
  margin: 0 20px 8px;
  overflow: hidden;
}
.checklist-progress-fill {
  height: 100%;
  background: #22c55e;
  border-radius: 2px;
  transition: width .3s ease;
}
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-light);
  transition: background .15s;
}
.checklist-item:hover { background: var(--bg-muted); }
.checklist-item:last-child { border-bottom: none; }
.checklist-item.checked { opacity: .6; }
.checklist-checkbox {
  width: 22px; height: 22px;
  border: 2px solid var(--border);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all .15s;
}
.checklist-checkbox.checked {
  background: #22c55e;
  border-color: #22c55e;
  color: #fff;
}
.checklist-title {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}
.checklist-item.checked .checklist-title {
  text-decoration: line-through;
}
.checklist-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.checklist-text { flex: 1; min-width: 0; }

/* Schedule card cursor */
.task-item[style*="cursor"] .task-info:hover .task-title { color: var(--primary); }
.eq-card { cursor: pointer; transition: box-shadow .15s; }
.eq-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); }


/* === Inventory Grid === */
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  padding: 0 20px 20px;
}
.part-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all .15s;
}
.part-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); border-color: var(--border); }
.part-card.low-stock { border-color: #fecaca; background: #fef2f2; }
.part-card-header { margin-bottom: 12px; }
.part-card-name { font-size: 13px; font-weight: 600; line-height: 1.4; }
.part-card-article { font-size: 11px; color: var(--text-muted); margin-top: 2px; font-family: monospace; }
.part-card-stock { margin-bottom: 12px; }
.part-card-qty { display: flex; align-items: baseline; gap: 4px; margin-bottom: 6px; }
.part-card-qty-value { font-size: 24px; font-weight: 700; line-height: 1; }
.part-card-qty-unit { font-size: 12px; color: var(--text-muted); }
.part-card-qty-min { font-size: 11px; color: var(--text-muted); margin-left: auto; }
.part-stock-bar { height: 4px; background: var(--border-light); border-radius: 2px; overflow: hidden; }
.part-stock-fill { height: 100%; border-radius: 2px; transition: width .3s; }
.part-card-footer { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); }
.part-card-price { font-weight: 600; }

@media (max-width: 600px) { .inventory-grid { grid-template-columns: 1fr; } }


/* === Analytics responsive === */
@media (max-width: 900px) {
  #page-analytics > div[style*="grid-template-columns: 2fr"] { grid-template-columns: 1fr !important; }
  #page-analytics > div[style*="grid-template-columns: 1fr 1fr"] { grid-template-columns: 1fr !important; }
}


/* === Knowledge Base === */
#article-content h3 { font-size: 16px; }
#article-content h4 { font-size: 14px; }
#article-content table { border-collapse: collapse; }
#article-content ul { padding-left: 20px; }
#article-content li { margin: 4px 0; }
#article-content code { background: var(--bg-main); padding: 1px 6px; border-radius: 4px; font-family: monospace; font-size: 12px; }


/* === Checklist Photos === */
.checklist-photo-btn { cursor:pointer; display:flex; align-items:center; padding:4px; border-radius:6px; color:var(--text-muted); transition:all .15s; }
.checklist-photo-btn:hover { color:var(--primary); background:var(--bg-main); }
.checklist-photos { display:flex; flex-wrap:wrap; gap:6px; padding:6px 0 2px 34px; }
.checklist-photo-thumb { position:relative; width:64px; height:64px; border-radius:8px; overflow:hidden; border:1px solid var(--border-light); cursor:pointer; transition:transform .15s; }
.checklist-photo-thumb:hover { transform:scale(1.05); }
.checklist-photo-thumb img { width:100%; height:100%; object-fit:cover; }
.checklist-photo-del { position:absolute; top:2px; right:2px; background:rgba(0,0,0,.6); color:#fff; border:none; border-radius:50%; width:18px; height:18px; font-size:10px; cursor:pointer; display:none; align-items:center; justify-content:center; }
.checklist-photo-thumb:hover .checklist-photo-del { display:flex; }

/* === Photo Viewer === */
.photo-viewer-overlay { position:fixed; inset:0; background:rgba(0,0,0,.85); z-index:10000; display:flex; align-items:center; justify-content:center; cursor:pointer; }
.photo-viewer-content { max-width:90vw; max-height:90vh; position:relative; }
.photo-viewer-content img { max-width:90vw; max-height:85vh; object-fit:contain; border-radius:8px; }
.photo-viewer-note { text-align:center; color:#fff; padding:8px; font-size:13px; }
.photo-viewer-close { position:absolute; top:-12px; right:-12px; background:#fff; color:#000; border:none; border-radius:50%; width:32px; height:32px; font-size:18px; cursor:pointer; box-shadow:0 2px 8px rgba(0,0,0,.3); display:flex; align-items:center; justify-content:center; }

/* === Calendar Widget === */
.btn-icon { background:none; border:none; cursor:pointer; padding:4px; border-radius:6px; color:var(--text-secondary); display:flex; align-items:center; transition:all .15s; }
.btn-icon:hover { background:var(--bg-main); color:var(--primary); }

/* === Dashboard responsive calendar === */
@media (max-width: 900px) {
  #page-dashboard > div[style*="grid-template-columns: 340px"] { grid-template-columns: 1fr !important; }
}

/* === Data Tables === */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead th {
  background: var(--bg-muted);
  padding: 8px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
.data-table-row:hover {
  background: var(--bg-muted);
}
.data-table-row.row-warning {
  background: #fef2f2;
}
.data-table-row.row-warning:hover {
  background: #fee2e2;
}
.data-table-row { cursor: pointer; transition: background .1s; }
.data-table-row td:first-child { font-weight: 500; }
.data-table .td-wrap { white-space: normal; max-width: 280px; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.status-dot.active { background: #22c55e; }
.status-dot.maintenance { background: #f59e0b; }
.status-dot.broken { background: #ef4444; }
.status-dot.decommissioned { background: #94a3b8; }
.filter-chip .chip-count {
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.08); font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px; margin-left: 2px;
}
.filter-chip.active .chip-count { background: rgba(99,102,241,.15); }
.eq-detail-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border-light); padding: 0 20px; }
.eq-detail-tab {
  padding: 10px 16px; font-size: 13px; font-weight: 500; color: var(--text-muted);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .15s;
  background: none; border-top: none; border-left: none; border-right: none; font-family: var(--font);
}
.eq-detail-tab:hover { color: var(--text); }
.eq-detail-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.eq-detail-panel { display: none; padding: 16px 20px; }
.eq-detail-panel.active { display: block; }

/* Equipment table groups */
.eq-table-group {
  border-bottom: 2px solid var(--border);
}
.eq-table-group:last-child {
  border-bottom: none;
}
.eq-table-group-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: #f1f5f9;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.eq-table-group-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  padding: 0 6px;
}

/* Form row for modals */
.form-row {
  display: flex;
  gap: 12px;
}
.form-row .form-group {
  flex: 1;
}

/* Fix modal display */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
}
.modal-overlay.open {
  display: flex;
}
