:root {
  --primary:        #09090b;
  --primary-dark:   #000000;
  --primary-light:  rgba(9, 9, 11, 0.05);
  --primary-glow:   rgba(9, 9, 11, 0.1);
  --accent:         #71717a;
  --danger:         #ef4444;
  --danger-light:   rgba(239, 68, 68, 0.1);
  --warning:        #f59e0b;
  --warning-light:  rgba(245, 158, 11, 0.1);
  --success:        #10b981;
  --success-light:  rgba(16, 185, 129, 0.1);
  --bg:             #f4f4f5;
  --bg-2:           #e4e4e7;
  --surface:        #ffffff;
  --surface-2:      #fafafa;
  --border:         #e4e4e7;
  --text:           #09090b;
  --text-2:         #52525b;
  --text-muted:     #a1a1aa;
  --sidebar-w:      260px;
  --header-h:       64px;
  --radius:         10px;
  --radius-lg:      16px;
  --shadow-sm:      0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow:         0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg:      0 12px 32px rgba(0, 0, 0, 0.12);
  --transition:     0.2s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ═══════════════════════════════════════
   SCROLLBAR
═══════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ═══════════════════════════════════════
   LOGIN PAGE
═══════════════════════════════════════ */
.login-body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100dvh;
  background: linear-gradient(135deg, #f4f4f5 0%, #e4e4e7 100%);
  position: relative;
  overflow: hidden;
}

.login-body::before {
  content: '';
  position: absolute;
  top: -40%;
  left: -20%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(109,74,255,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.login-body::after {
  content: '';
  position: absolute;
  bottom: -30%;
  right: -15%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(167,139,250,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.login-card {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 44px 40px;
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
  animation: fadeUp 0.4s ease both;
}

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

.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}
.login-logo .logo-icon {
  width: 44px;
  height: 44px;
  background: var(--primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 12px var(--primary-glow);
}
.login-logo .logo-text { font-size: 20px; font-weight: 700; color: var(--primary); letter-spacing: -0.5px; }
.login-logo .logo-sub  { font-size: 12px; color: var(--text-2); }

.login-title { font-size: 24px; font-weight: 700; color: var(--text); margin-bottom: 6px; letter-spacing: -0.5px; }
.login-sub   { font-size: 14px; color: var(--text-2); margin-bottom: 28px; }

.error-msg {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  display: none;
}
.error-msg.show { display: block; }

/* ═══════════════════════════════════════
   FORMS
═══════════════════════════════════════ */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 500; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-control::placeholder { color: var(--text-muted); }

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

/* ═══════════════════════════════════════
   BUTTONS
═══════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 8px var(--primary-glow); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 14px var(--primary-glow); }

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

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

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

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-2);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  padding: 6px 10px;
}
.btn-ghost:hover { background: var(--bg); color: var(--primary); }

.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-icon { padding: 7px 9px; }

/* ═══════════════════════════════════════
   APP LAYOUT
═══════════════════════════════════════ */
.app-container { display: flex; min-height: 100dvh; }

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100dvh;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 3px 8px var(--primary-glow);
}
.sidebar-logo-text { font-size: 15px; font-weight: 700; color: var(--primary); letter-spacing: -0.3px; line-height: 1.2; }
.sidebar-logo-sub  { font-size: 10px; color: var(--text-muted); }

.nav-section { padding: 14px 12px 6px; }
.nav-section-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); padding: 0 8px 8px; }

.nav-links { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.nav-links li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-2);
  text-decoration: none;
  font-weight: 500;
  font-size: 13.5px;
  position: relative;
  transition: all var(--transition);
}
.nav-links li a .nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-links li a:hover { background: var(--bg); color: var(--primary); }
.nav-links li a.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}
.nav-links li a .badge-count {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
  min-width: 18px;
  text-align: center;
  display: none;
}
.nav-links li a .badge-count.show { display: block; }

.sidebar-footer {
  margin-top: auto;
  padding: 14px 12px;
  border-top: 1px solid var(--border);
}
.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius);
  margin-bottom: 8px;
}
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.user-name  { font-size: 13px; font-weight: 600; color: var(--text); }
.user-role  { font-size: 11px; color: var(--text-muted); }
.btn-logout {
  width: 100%;
  justify-content: center;
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-2);
  font-size: 13px;
  padding: 8px;
}
.btn-logout:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-light); }

/* MAIN CONTENT */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.top-bar {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.top-bar-title { font-size: 16px; font-weight: 700; color: var(--text); flex: 1; }
.top-bar-actions { display: flex; align-items: center; gap: 8px; }

.page-body { padding: 24px 28px; flex: 1; }

/* ═══════════════════════════════════════
   STAT CARDS
═══════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--primary-light);
  transform: translate(25px, -30px);
}

.stat-icon {
  font-size: 24px;
  margin-bottom: 12px;
  display: inline-block;
}
.stat-label { font-size: 12px; color: var(--text-2); font-weight: 500; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { font-size: 32px; font-weight: 800; color: var(--primary); line-height: 1; letter-spacing: -1px; }
.stat-unit  { font-size: 14px; font-weight: 500; color: var(--text-2); margin-left: 2px; }
.stat-card.danger  .stat-value { color: var(--danger); }
.stat-card.warning .stat-value { color: var(--warning); }
.stat-card.success .stat-value { color: var(--success); }

/* ═══════════════════════════════════════
   CARD / PANEL
═══════════════════════════════════════ */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.panel-title { font-size: 15px; font-weight: 700; color: var(--text); }
.panel-body  { padding: 20px; }

/* ═══════════════════════════════════════
   TABLE CONTROLS
═══════════════════════════════════════ */
.table-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  align-items: center;
}
.table-controls .search-wrap { position: relative; flex: 1; min-width: 200px; }
.table-controls .search-wrap .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 14px; }
.table-controls .search-wrap input { padding-left: 36px; }
.table-controls-right { display: flex; gap: 8px; margin-left: auto; }

/* ═══════════════════════════════════════
   DATA TABLE
═══════════════════════════════════════ */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-2);
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--bg); }
.data-table .actions { display: flex; gap: 4px; }

/* ═══════════════════════════════════════
   BADGES
═══════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}
.badge-purple  { background: var(--primary-light); color: var(--primary); }
.badge-danger  { background: var(--danger-light);  color: var(--danger);  }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-gray    { background: var(--bg-2); color: var(--text-2); }

/* Status dot */
.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
}
.status-dot::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}
.status-dot.online::before  { background: var(--success); box-shadow: 0 0 0 3px var(--success-light); }
.status-dot.offline::before { background: var(--danger);  box-shadow: 0 0 0 3px var(--danger-light);  }

/* ═══════════════════════════════════════
   ALERT ITEMS
═══════════════════════════════════════ */
.alert-item {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
  position: relative;
}
.alert-item:last-child { border-bottom: none; }
.alert-item:hover { background: var(--bg); }
.alert-item.unread { background: var(--primary-light); }
.alert-item.unread::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--primary);
  border-radius: 0 2px 2px 0;
}
.alert-item.critical { background: var(--danger-light); }
.alert-item.critical::before { background: var(--danger); }

.alert-type-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.alert-type-icon.ram      { background: #ede9fe; }
.alert-type-icon.disk     { background: #fef3c7; }
.alert-type-icon.software { background: #fee2e2; }
.alert-type-icon.offline  { background: #f3f4f6; }

.alert-content { flex: 1; min-width: 0; }
.alert-headline { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.alert-pc   { font-size: 13.5px; font-weight: 600; color: var(--text); }
.alert-msg  { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert-meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ═══════════════════════════════════════
   TOAST NOTIFICATION
═══════════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  min-width: 280px;
  max-width: 380px;
  pointer-events: all;
  animation: slideIn 0.3s ease;
}
.toast.error   { border-left: 4px solid var(--danger);  }
.toast.success { border-left: 4px solid var(--success); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.info    { border-left: 4px solid var(--primary); }
.toast-icon    { font-size: 20px; flex-shrink: 0; }
.toast-msg     { flex: 1; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(40px); }
}

/* ═══════════════════════════════════════
   MODAL
═══════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 27, 75, 0.45);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90dvh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform var(--transition);
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal.modal-lg { max-width: 780px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--text); }
.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  cursor: pointer;
  font-size: 18px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--danger-light); color: var(--danger); }
.modal-body   { padding: 22px; }
.modal-footer { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ═══════════════════════════════════════
   EXPORT BUTTONS
═══════════════════════════════════════ */
.export-group { display: flex; gap: 8px; }

/* ═══════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state .empty-title { font-size: 16px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.empty-state .empty-sub   { font-size: 13px; }

/* ═══════════════════════════════════════
   TABS (trong trang)
═══════════════════════════════════════ */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ═══════════════════════════════════════
   TAG LIST (phần mềm)
═══════════════════════════════════════ */
.tag-list { display: flex; flex-wrap: wrap; gap: 4px; max-height: 80px; overflow: hidden; }
.tag {
  display: inline-block;
  background: var(--bg-2);
  color: var(--text-2);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
}

/* ═══════════════════════════════════════
   PC DETAIL MODAL
═══════════════════════════════════════ */
.pc-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
}
.pc-detail-row { display: flex; flex-direction: column; gap: 3px; }
.pc-detail-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.pc-detail-value { font-size: 13.5px; color: var(--text); font-weight: 500; }
.pc-detail-full  { grid-column: 1 / -1; }

/* ═══════════════════════════════════════
   LOADING / SKELETON
═══════════════════════════════════════ */
.skeleton {
  background: linear-gradient(90deg, var(--bg) 25%, var(--bg-2) 50%, var(--bg) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-260px); }
  .sidebar.open { transform: translateX(0); width: 260px; }
  .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .pc-detail-grid { grid-template-columns: 1fr; }
  .top-bar { padding: 0 16px; }
  .page-body { padding: 16px; }
  .table-controls-right { flex-wrap: wrap; }
  .user-stats-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .export-group { flex-direction: column; }
}

/* ═══════════════════════════════════════
   USER MANAGEMENT — Card Layout
═══════════════════════════════════════ */

/* Stats Summary Row */
.user-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.user-stat-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.user-stat-chip:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.user-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.02em;
}

.user-stat-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 6px;
}

/* Toolbar */
.user-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.user-toolbar .search-box {
  flex: 1;
  max-width: 300px;
}

/* Card List */
.user-card-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Individual User Card */
.user-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition), box-shadow var(--transition);
}

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

/* Avatar */
.ucard-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.ucard-avatar.role-admin { background: #18181b; }
.ucard-avatar.role-viewer { background: #71717a; }
.ucard-avatar.role-agent { background: #d97706; }

/* Info Block — left side, grows to fill */
.ucard-info {
  flex: 1;
  min-width: 0;
}

.ucard-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.ucard-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.ucard-self-tag {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-2);
  padding: 1px 6px;
  border-radius: 4px;
}

.ucard-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ucard-meta-sep {
  width: 3px;
  height: 3px;
  background: var(--border);
  border-radius: 50%;
  flex-shrink: 0;
}

/* Role Badge */
.ucard-role {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.ucard-role.admin {
  background: #18181b;
  color: #fff;
}

.ucard-role.viewer {
  background: var(--bg-2);
  color: var(--text-2);
}

.ucard-role.agent {
  background: var(--warning-light);
  color: #92400e;
}

/* Action Buttons */
.ucard-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  margin-left: 8px;
}

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

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

.ucard-btn.danger:hover {
  background: var(--danger-light);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--danger);
}

.ucard-btn:disabled {
  opacity: 0.2;
  cursor: not-allowed;
  pointer-events: none;
}

/* Empty State */
.user-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
}

.user-empty-icon {
  color: var(--border);
  margin-bottom: 16px;
}

.user-empty-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 4px;
}

.user-empty-desc {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 280px;
}

/* Responsive */
@media (max-width: 600px) {
  .user-card { flex-wrap: wrap; gap: 12px; padding: 14px; }
  .ucard-actions { width: 100%; justify-content: flex-end; margin-left: 0; }
}

/* ═══════════════════════════════════════
   PRINTER TAB — uses global design system
   (stat-card / panel / data-table / badge)
═══════════════════════════════════════ */

/* Empty state shared across tabs */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════
   DOWNLOAD AGENT TAB STYLES
═══════════════════════════════════════ */
.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 24px;
}
.download-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
}
.download-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: #cbd5e1;
}
.download-card.card-lan {
  border-top: 4px solid var(--success);
}
.download-card.card-internet {
  border-top: 4px solid #2563eb;
}
.download-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.download-header .badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 99px;
}
.download-header .badge-success {
  background: var(--success-light);
  color: #059669;
}
.download-header .badge-primary {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
}
.download-icon {
  font-size: 24px;
}
.download-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.download-desc {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 16px;
  line-height: 1.5;
}
.download-meta {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.download-meta .meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
}
.download-meta .meta-label {
  color: var(--text-muted);
  font-weight: 500;
}
.download-meta .meta-code {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 5px 8px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 12px;
  color: var(--primary);
  word-break: break-all;
  font-weight: 600;
}
.download-meta .meta-val {
  color: var(--text);
  font-weight: 500;
}
.download-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}
.download-btn-main {
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  border-radius: var(--radius);
  transition: opacity 0.2s;
}
.download-btn-main:hover {
  opacity: 0.92;
}
.sub-downloads {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sub-downloads a {
  text-decoration: none;
}
.download-instructions {
  border-top: 1px dashed var(--border);
  padding-top: 16px;
  margin-top: auto;
}
.download-instructions .inst-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.download-instructions ol {
  padding-left: 18px;
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.6;
}
.download-instructions ol li {
  margin-bottom: 4px;
}

/* ═══════════════════════════════════════
   REMOTE ACTIONS TOOLBAR & SMART DISKS
═══════════════════════════════════════ */
.remote-actions-toolbar {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 20px;
}
.remote-actions-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-2);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.remote-actions-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.btn-action {
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.btn-action:hover {
  background: var(--surface-hover, #f1f5f9);
  border-color: #94a3b8;
  transform: translateY(-1px);
}
.btn-action-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-action-primary:hover {
  opacity: 0.92;
  color: #fff;
}
.btn-action-danger {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
}
.btn-action-danger:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: var(--danger);
}

/* SMART Disks */
.smart-disks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 10px;
}
.smart-disk-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.smart-disk-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.smart-disk-model {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
}
.smart-disk-type {
  font-size: 11px;
  color: var(--text-muted);
}
.smart-disk-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
}
.smart-badge-healthy {
  background: var(--success-light);
  color: #059669;
}
.smart-badge-warning {
  background: var(--warning-light, #fef3c7);
  color: #d97706;
}
.smart-badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}
.smart-disk-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  font-size: 11px;
  color: var(--text-2);
  margin-top: 8px;
  border-top: 1px dashed var(--border);
  padding-top: 8px;
}
.smart-gauge-bar {
  height: 6px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
  margin-top: 4px;
}
.smart-gauge-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.3s ease;
}

/* Security indicators */
.tampered-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.3);
}


