/* ================================================
   MachineCare Pro — Custom Stylesheet
   ================================================ */

:root {
  --sidebar-width: 260px;
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-active: #2563eb;
  --sidebar-hover: #1e293b;
  --navbar-height: 64px;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --body-bg: #f1f5f9;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --font: 'Inter', sans-serif;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; }
body {
  font-family: var(--font);
  background: var(--body-bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ── */
.app-wrapper { display: flex; min-height: 100vh; }
.layout-container { display: flex; flex: 1; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform 0.3s ease;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #334155; border-radius: 2px; }

/* Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid #1e293b;
}
.brand-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
  box-shadow: 0 4px 12px rgba(37,99,235,0.35);
  flex-shrink: 0;
}
.brand-text { display: flex; align-items: baseline; gap: 3px; }
.brand-name { font-size: 17px; font-weight: 800; color: #fff; letter-spacing: -0.3px; }
.brand-sub  { font-size: 11px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 1px; }

/* Nav */
.sidebar-nav { flex: 1; padding: 16px 0; }
.nav-section-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.2px;
  color: #475569;
  padding: 12px 20px 6px;
  margin-top: 4px;
}
.nav-list { list-style: none; padding: 0; margin: 0; }
.nav-item { position: relative; }
.nav-item .nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 14px; font-weight: 500;
  border-radius: 0;
  transition: all 0.15s ease;
  position: relative;
}
.nav-item .nav-link:hover {
  background: var(--sidebar-hover);
  color: #e2e8f0;
}
.nav-item.active .nav-link,
.nav-item .nav-link.active {
  background: rgba(37,99,235,0.12);
  color: #fff;
}
.nav-item.active .nav-link::before,
.nav-item .nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--primary);
  border-radius: 0 2px 2px 0;
}
.nav-icon { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }
.nav-text  { flex: 1; }
.nav-badge {
  background: var(--danger);
  color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
}
.nav-badge-warn { background: var(--warning); color: #1e293b; }

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid #1e293b;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-user { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.user-avatar-sm {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.user-name-sm { display: block; font-size: 13px; font-weight: 600; color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role-sm { display: block; font-size: 11px; color: #64748b; }
.sidebar-logout {
  color: #475569; font-size: 16px;
  padding: 6px; border-radius: 8px;
  text-decoration: none; transition: all .15s;
  flex-shrink: 0;
}
.sidebar-logout:hover { color: var(--danger); background: rgba(239,68,68,0.1); }
.sidebar-toggle-btn {
  background: none; border: none; color: #94a3b8;
  padding: 4px; cursor: pointer; margin-left: auto;
}

/* Overlay */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}

/* ── Main Content ── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Navbar ── */
.top-navbar {
  height: var(--navbar-height);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 0 var(--border);
}
.navbar-left { display: flex; align-items: center; gap: 16px; flex: 1; min-width: 0; }
.navbar-right { display: flex; align-items: center; gap: 8px; }
.sidebar-toggle {
  background: none; border: none;
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); cursor: pointer; font-size: 16px;
  transition: all .15s;
}
.sidebar-toggle:hover { background: var(--body-bg); color: var(--text); }
.page-heading { font-size: 18px; font-weight: 700; color: var(--text); margin: 0; }
.breadcrumb { margin: 0; font-size: 12px; }
.breadcrumb-item + .breadcrumb-item::before { content: "›"; color: var(--text-muted); }

/* Nav Dropdowns */
.navbar-dropdown { position: relative; }
.nav-icon-btn {
  background: none; border: none;
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); cursor: pointer; font-size: 16px;
  transition: all .15s; position: relative;
}
.nav-icon-btn:hover { background: var(--body-bg); color: var(--text); }
.notif-badge {
  position: absolute; top: 4px; right: 4px;
  width: 18px; height: 18px;
  background: var(--danger);
  color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}

/* Notifications dropdown */
.notif-dropdown { width: 360px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; }
.notif-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 13px; }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text); transition: background .15s; }
.notif-item:hover { background: var(--body-bg); }
.notif-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notif-danger .notif-icon { background: #fef2f2; color: var(--danger); }
.notif-warning .notif-icon { background: #fffbeb; color: var(--warning); }
.notif-info .notif-icon { background: #eff6ff; color: var(--primary); }
.notif-success .notif-icon { background: #f0fdf4; color: var(--success); }
.notif-title { font-size: 13px; font-weight: 600; margin: 0 0 2px; }
.notif-msg { font-size: 12px; color: var(--text-muted); margin: 0 0 4px; line-height: 1.4; }
.notif-time { font-size: 11px; color: #94a3b8; }
.notif-empty { padding: 32px 16px; text-align: center; color: var(--text-muted); }
.mark-all-read { font-size: 12px; }

/* Profile button */
.profile-btn {
  background: none; border: none;
  display: flex; align-items: center; gap: 8px;
  padding: 4px 8px; border-radius: 10px;
  cursor: pointer; transition: background .15s;
}
.profile-btn:hover { background: var(--body-bg); }
.profile-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
}
.profile-info { text-align: left; line-height: 1.2; }
.profile-name { display: block; font-size: 13px; font-weight: 600; color: var(--text); }
.profile-role { display: block; font-size: 11px; color: var(--text-muted); }
.profile-dropdown { min-width: 220px; }
.profile-dd-header { display: flex; gap: 12px; padding: 16px; align-items: center; }
.profile-avatar-lg {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

/* ── Content Area ── */
.content-area { padding: 24px; flex: 1; }

/* ── Page Header Row ── */
.page-header-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.page-section-title { font-size: 22px; font-weight: 800; color: var(--text); margin: 0; letter-spacing: -0.3px; }
.page-section-sub { font-size: 13px; color: var(--text-muted); margin: 4px 0 0; }

/* ── Filter Bar ── */
.filter-bar {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1; }
.filter-group { display: flex; align-items: center; gap: 6px; }
.filter-label { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.filter-select { min-width: 140px; font-size: 13px; }
.search-input-wrap { position: relative; }
.search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 12px; pointer-events: none; }
.search-input { padding-left: 32px; min-width: 200px; font-size: 13px; }

/* View Toggle */
.view-toggle { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.view-btn {
  background: none; border: none;
  padding: 7px 12px; cursor: pointer; color: var(--text-muted);
  font-size: 14px; transition: all .15s;
}
.view-btn.active { background: var(--primary); color: #fff; }

/* ── Stat Cards ── */
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform .15s, box-shadow .15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.stat-blue::before   { background: var(--primary); }
.stat-green::before  { background: var(--success); }
.stat-orange::before { background: var(--warning); }
.stat-red::before    { background: var(--danger); }
.stat-purple::before { background: #8b5cf6; }
.stat-teal::before   { background: #06b6d4; }

.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; margin-bottom: 12px;
}
.stat-blue .stat-icon   { background: #eff6ff; color: var(--primary); }
.stat-green .stat-icon  { background: #f0fdf4; color: var(--success); }
.stat-orange .stat-icon { background: #fffbeb; color: var(--warning); }
.stat-red .stat-icon    { background: #fef2f2; color: var(--danger); }
.stat-purple .stat-icon { background: #f5f3ff; color: #8b5cf6; }
.stat-teal .stat-icon   { background: #ecfeff; color: #06b6d4; }

.stat-number { display: block; font-size: 28px; font-weight: 800; color: var(--text); letter-spacing: -0.5px; line-height: 1; }
.stat-label  { display: block; font-size: 12px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }
.stat-link { display: inline-block; font-size: 12px; color: var(--primary); margin-top: 10px; text-decoration: none; font-weight: 600; }
.stat-link:hover { text-decoration: underline; }
.stat-sub { display: block; font-size: 11px; color: var(--text-muted); margin-top: 10px; }
.stat-progress { margin-top: 10px; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--success); border-radius: 2px; }

/* ── Card Panel ── */
.card-panel {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
}
.panel-title { font-size: 14px; font-weight: 700; color: var(--text); margin: 0; }
.panel-sub { font-size: 12px; color: var(--text-muted); margin: 2px 0 0; }
.panel-body { padding: 20px; }
.btn-sm-link { font-size: 12px; color: var(--primary); font-weight: 600; text-decoration: none; }
.btn-sm-link:hover { text-decoration: underline; }

/* ── Data Table ── */
.data-table { font-size: 13px; }
.data-table thead th {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted);
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  white-space: nowrap;
}
.data-table tbody td { padding: 12px 16px; vertical-align: middle; border-bottom: 1px solid var(--border); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #f8fafc; }
.table-warning-row { background: #fffbeb !important; }

/* ── Pagination ── */
.pagination-wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0; flex-wrap: wrap; gap: 12px;
}
.pagination-info { font-size: 13px; color: var(--text-muted); }
.pagination { margin: 0; }
.page-link { font-size: 13px; border-radius: 8px !important; margin: 0 2px; border: 1px solid var(--border); color: var(--text); }
.page-item.active .page-link { background: var(--primary); border-color: var(--primary); }

/* ── Machine Cards ── */
.machine-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.machine-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.machine-card-img { height: 160px; background: #f1f5f9; position: relative; }
.machine-card-img img { width: 100%; height: 100%; object-fit: cover; }
.machine-img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  color: var(--text-muted);
}
.machine-status-badge { position: absolute; top: 10px; right: 10px; }
.machine-card-body { padding: 16px; }
.machine-code { font-size: 11px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.machine-name { font-size: 15px; font-weight: 700; color: var(--text); margin: 0 0 10px; }
.machine-meta { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-muted); }
.machine-meta span { display: flex; align-items: center; gap: 6px; }
.machine-meta i { width: 14px; font-size: 11px; }
.machine-stats-row { display: flex; gap: 20px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.mstat-num   { display: block; font-size: 18px; font-weight: 800; color: var(--text); }
.mstat-label { display: block; font-size: 11px; color: var(--text-muted); }
.machine-card-actions {
  display: flex; gap: 6px; padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: #fafafa;
}
.action-btn {
  background: none; border: 1px solid var(--border);
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 13px; color: var(--text-muted);
  text-decoration: none; transition: all .15s;
}
.action-btn:hover { background: var(--body-bg); color: var(--primary); border-color: var(--primary); }
.action-btn-danger:hover { color: var(--danger) !important; border-color: var(--danger) !important; }
.action-btn-qr:hover { color: #0f172a !important; border-color: #0f172a !important; background: #f8fafc !important; }

/* QR Code modal box */
.qr-code-box {
  width: 200px; height: 200px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.qr-code-box canvas, .qr-code-box img { border-radius: 6px; display: block; }

/* ── Machine Detail Page ── */
.machine-detail-header {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.machine-detail-img {
  width: 120px; height: 120px;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid var(--border);
}
.machine-detail-img-placeholder {
  width: 120px; height: 120px;
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  border: 2px solid var(--border);
}
.machine-detail-code { font-size: 12px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.machine-detail-name { font-size: 24px; font-weight: 800; color: var(--text); margin: 0 0 8px; letter-spacing: -0.5px; }
.machine-detail-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--text-muted); }
.machine-detail-meta .sep { color: var(--border); }

/* ── Mini Stat Card ── */
.mini-stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow);
}
.mini-stat-icon { font-size: 20px; margin-bottom: 8px; }
.mini-stat-value { font-size: 16px; font-weight: 800; color: var(--text); display: block; }
.mini-stat-label { font-size: 11px; color: var(--text-muted); }

/* ── Detail List ── */
.detail-list { margin: 0; }
.detail-list dt { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 2px; }
.detail-list dd { font-size: 13px; color: var(--text); margin: 0 0 14px; }
.detail-section { background: var(--body-bg); border-radius: 8px; padding: 12px; }

/* ── Timeline ── */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-dot {
  position: absolute; left: -20px; top: 6px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 2px solid var(--border);
}
.timeline-dot-preventive  { border-color: #06b6d4; background: #06b6d4; }
.timeline-dot-corrective  { border-color: var(--warning); background: var(--warning); }
.timeline-dot-emergency   { border-color: var(--danger); background: var(--danger); }
.timeline-dot-predictive  { border-color: var(--primary); background: var(--primary); }
.timeline-content { background: #fafafa; border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.timeline-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.timeline-date { font-size: 12px; color: var(--text-muted); }
.timeline-cost { font-size: 14px; font-weight: 700; color: var(--primary); }
.timeline-problem, .timeline-solution { font-size: 13px; color: var(--text); margin: 6px 0; }
.timeline-footer { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }

/* ── Breakdown Tickets ── */
.ticket-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  overflow: hidden;
  transition: box-shadow .15s;
}
.ticket-card:hover { box-shadow: var(--shadow-lg); }
.ticket-priority-bar { width: 4px; flex-shrink: 0; }
.ticket-critical .ticket-priority-bar { background: var(--danger); }
.ticket-high .ticket-priority-bar     { background: var(--warning); }
.ticket-medium .ticket-priority-bar   { background: #06b6d4; }
.ticket-low .ticket-priority-bar      { background: #94a3b8; }
.ticket-content { flex: 1; padding: 16px 20px; }
.ticket-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; flex-wrap: wrap; gap: 8px; }
.ticket-number { font-family: monospace; font-size: 13px; font-weight: 700; color: var(--primary); }
.ticket-actions { display: flex; gap: 6px; }
.ticket-machine { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.ticket-issue { font-size: 14px; color: var(--text); margin: 0 0 10px; line-height: 1.5; }
.ticket-resolution { font-size: 13px; color: var(--success); background: #f0fdf4; border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; }
.ticket-footer { display: flex; gap: 20px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 10px; }

/* ── Technician Cards ── */
.tech-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.tech-card-header { display: flex; align-items: center; gap: 12px; padding: 16px 16px 12px; }
.tech-avatar {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; color: #fff; flex-shrink: 0;
}
.tech-name { font-size: 15px; font-weight: 700; color: var(--text); margin: 0 0 2px; }
.tech-spec { font-size: 12px; color: var(--text-muted); margin: 0; }
.tech-status { margin-left: auto; }
.tech-card-body { padding: 0 16px 14px; display: flex; flex-direction: column; gap: 6px; }
.tech-detail { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.tech-detail i { width: 16px; text-align: center; font-size: 12px; color: #94a3b8; }
.tech-card-footer { display: flex; padding: 12px 16px; border-top: 1px solid var(--border); background: #fafafa; }
.tech-stat { flex: 1; text-align: center; }
.tech-stat-num   { display: block; font-size: 20px; font-weight: 800; color: var(--text); }
.tech-stat-label { font-size: 11px; color: var(--text-muted); }

/* ── Spare Parts ── */
.stock-indicator {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 28px; border-radius: 6px;
  font-size: 13px; font-weight: 700;
}
.stock-ok  { background: #f0fdf4; color: var(--success); }
.stock-low { background: #fef2f2; color: var(--danger); }
.badge-sm { font-size: 10px; padding: 2px 6px; }

/* ── Image Upload ── */
.image-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: #fafafa;
  min-height: 140px;
  display: flex; align-items: center; justify-content: center;
}
.image-upload-area:hover { border-color: var(--primary); background: #eff6ff; }

/* ── Buttons ── */
.btn-primary-action {
  display: inline-flex; align-items: center;
  background: var(--primary); color: #fff;
  padding: 10px 20px; border-radius: 10px;
  font-size: 14px; font-weight: 600;
  text-decoration: none; border: none; cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.btn-primary-action:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,0.35); }

/* ── Empty State ── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state h5 { color: var(--text); margin: 0 0 8px; }
.empty-state p  { font-size: 14px; }

/* ── Chart Legend ── */
.chart-legend { display: flex; flex-direction: column; gap: 8px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend-item strong { margin-left: auto; font-weight: 700; }

/* ── Info Items ── */
.info-item .info-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 3px; }
.info-item .info-value { font-size: 14px; color: var(--text); }

/* ── Form Helpers ── */
.form-label { font-weight: 600; font-size: 13px; color: var(--text); }
.form-label.required::after { content: ' *'; color: var(--danger); }
.form-control, .form-select {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  padding: 9px 12px;
  transition: border-color .15s, box-shadow .15s;
  color: var(--text);
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ── Badges ── */
.badge { font-size: 11px; font-weight: 600; padding: 4px 8px; border-radius: 6px; }

/* ── Responsive ── */
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .main-content { margin-left: 0; }
  .top-navbar { padding: 0 16px; }
  .content-area { padding: 16px; }
}

@media (max-width: 575.98px) {
  .page-header-row { flex-direction: column; align-items: stretch; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-form { flex-direction: column; }
  .search-input { min-width: 100%; }
  .filter-select { min-width: 100%; }
  .notif-dropdown { width: 300px; }
  .machine-detail-header { flex-direction: column; }
}

/* ── Scrollbar ── */
* { scrollbar-width: thin; scrollbar-color: #e2e8f0 transparent; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 3px; }

/* ── Role badge colours ── */
.bg-purple { background-color: #7c3aed !important; color: #fff !important; }

/* ── Utilities ── */
code.text-primary { font-family: 'Courier New', monospace; font-size: 12px; font-weight: 700; background: #eff6ff; padding: 2px 6px; border-radius: 4px; }
