/* Core Variable Tokens & Theme Settings */
:root {
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* HSL Tailored Color Palette */
  --bg-color: hsl(222, 47%, 6%);
  --panel-bg: hsla(222, 47%, 10%, 0.55);
  --panel-border: hsla(222, 100%, 100%, 0.06);
  --text-primary: hsl(210, 40%, 98%);
  --text-secondary: hsl(215, 20%, 65%);
  --text-muted: hsl(215, 12%, 45%);

  --color-primary: hsl(244, 97%, 66%);
  --color-primary-hover: hsl(244, 97%, 72%);
  --color-emerald: hsl(150, 76%, 42%);
  --color-emerald-hover: hsl(150, 76%, 48%);
  --color-amber: hsl(38, 92%, 50%);
  --color-amber-hover: hsl(38, 92%, 56%);
  --color-rose: hsl(346, 84%, 61%);
  --color-rose-hover: hsl(346, 84%, 67%);

  --glow-primary: hsla(244, 97%, 66%, 0.15);
  --glow-emerald: hsla(150, 76%, 42%, 0.15);
  --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Background Glow Elements */
.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
}

.bg-glow-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--color-primary) 0%, transparent 80%);
  top: -100px;
  right: -50px;
}

.bg-glow-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--color-emerald) 0%, transparent 80%);
  bottom: -150px;
  left: -100px;
}

/* Glassmorphism Panel Class */
.glass {
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow-lg);
}

/* Layout Utilities */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 24px;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

.mt-4 { margin-top: 16px; }
.w-full { width: 100%; }
.flex-grow { flex-grow: 1; }
.font-semibold { font-weight: 600; }
.text-primary { color: var(--color-primary); }
.text-emerald { color: var(--color-emerald); }
.text-amber { color: var(--color-amber); }
.text-rose { color: var(--color-rose); }
.text-muted { color: var(--text-muted); }
.hidden { display: none !important; }

/* Navbar Styling */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-brand {
  width: 32px;
  height: 32px;
}

.brand-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.weight-light {
  font-weight: 300;
  color: var(--text-secondary);
}

.text-gradient {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-emerald) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.device-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-xl);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid hsla(150, 76%, 42%, 0.15);
}

.icon-badge {
  width: 16px;
  height: 16px;
}

/* Workspace Grid System */
.workspace {
  display: grid;
  grid-template-columns: 450px 1fr;
  gap: 24px;
  flex-grow: 1;
  min-height: 0; /* Important for inner scroll control */
}

.workspace-left, .workspace-right {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* General Card Design */
.card {
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--panel-border);
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title i {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.card-body {
  padding: 24px;
  overflow-y: auto;
}

/* Forms & Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background-color: var(--color-primary);
  color: white;
  box-shadow: 0 0 20px var(--glow-primary);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--color-primary-hover);
  box-shadow: 0 0 25px hsla(244, 97%, 66%, 0.3);
}

.btn-emerald {
  background-color: var(--color-emerald);
  color: white;
  box-shadow: 0 0 20px var(--glow-emerald);
}

.btn-emerald:hover:not(:disabled) {
  background-color: var(--color-emerald-hover);
  box-shadow: 0 0 25px hsla(150, 76%, 42%, 0.3);
}

.btn-icon {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: var(--radius-md);
  color: var(--text-primary);
}

.btn-icon:hover {
  background: hsla(222, 100%, 100%, 0.08);
  border-color: hsla(222, 100%, 100%, 0.15);
}

.btn-close {
  background: transparent;
  color: var(--text-muted);
  padding: 6px;
  border-radius: 50%;
}

.btn-close:hover {
  background: hsla(0, 100%, 100%, 0.05);
  color: var(--text-primary);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* File Upload Area */
.drop-zone {
  border: 2px dashed var(--panel-border);
  border-radius: var(--radius-md);
  padding: 32px 24px;
  text-align: center;
  position: relative;
  cursor: pointer;
  transition: all 0.25s ease;
  background: rgba(0, 0, 0, 0.1);
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--color-primary);
  background: hsla(244, 97%, 66%, 0.03);
  box-shadow: inset 0 0 20px hsla(244, 97%, 66%, 0.05);
}

.file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.drop-zone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}

.drop-icon {
  width: 48px;
  height: 48px;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.drop-zone:hover .drop-icon {
  color: var(--color-primary);
}

.drop-text {
  font-size: 14px;
  color: var(--text-secondary);
}

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

/* Selected File Bar */
.selected-file-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: hsla(222, 100%, 100%, 0.04);
  border: 1px solid var(--panel-border);
  margin-bottom: 16px;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-icon {
  width: 24px;
  height: 24px;
}

.file-details {
  display: flex;
  flex-direction: column;
}

.file-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

/* Log Terminal Panel */
.console-body {
  padding: 16px;
  background-color: rgba(3, 7, 18, 0.95);
  border-top: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
}

.console {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  max-height: 100%;
}

.log-line {
  display: block;
  white-space: pre-wrap;
  word-break: break-all;
}

.log-info { color: var(--text-secondary); }
.log-success { color: var(--color-emerald); }
.log-warn { color: var(--color-amber); }
.log-error { color: var(--color-rose); }

/* Data Preview Table CSS */
.table-body {
  padding: 0;
  position: relative;
}

.table-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  color: var(--text-muted);
}

.placeholder-icon {
  width: 56px;
  height: 56px;
  stroke-width: 1px;
  margin-bottom: 16px;
}

.placeholder-subtext {
  font-size: 12px;
  margin-top: 6px;
}

.table-container {
  overflow: auto;
  max-height: 100%;
  height: 100%;
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.preview-table th {
  position: sticky;
  top: 0;
  background: var(--bg-color);
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 2px solid var(--panel-border);
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 10;
}

.preview-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--panel-border);
  vertical-align: top;
  white-space: normal;
}

.preview-table tbody tr:hover {
  background: hsla(222, 100%, 100%, 0.02);
}

/* Custom Preview Alignments & Weights */
.col-date { text-align: right; font-family: var(--font-sans); }
.col-ledger { font-weight: 700; }
.col-cheque { font-style: italic; font-size: 11px; color: var(--text-secondary); padding-left: 20px !important; max-width: 250px; }
.col-vchtype { font-size: 11px; }
.col-vchno { font-size: 11px; }
.col-debit { text-align: right; font-weight: 700; }
.col-credit { text-align: right; font-weight: 700; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
}

.badge-primary {
  background: hsla(244, 97%, 66%, 0.1);
  color: var(--color-primary);
  border: 1px solid hsla(244, 97%, 66%, 0.15);
}

.badge-emerald {
  background: hsla(150, 76%, 42%, 0.1);
  color: var(--color-emerald);
  border: 1px solid hsla(150, 76%, 42%, 0.15);
}

.flex-row { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--panel-border);
}

/* Device Manager Panel */
.devices-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.device-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: hsla(222, 100%, 100%, 0.02);
  border: 1px solid var(--panel-border);
}

.device-item-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.device-item-icon {
  width: 20px;
  height: 20px;
}

.device-item-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.device-item-name {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.device-item-name .badge-current {
  font-size: 9px;
  padding: 1px 6px;
  background: hsla(244, 97%, 66%, 0.15);
  color: var(--color-primary);
  border-radius: 4px;
}

.device-item-meta {
  font-size: 10px;
  color: var(--text-muted);
}

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

.status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.status-approved {
  background: hsla(150, 76%, 42%, 0.1);
  color: var(--color-emerald);
  border: 1px solid hsla(150, 76%, 42%, 0.2);
}

.status-pending {
  background: hsla(38, 92%, 50%, 0.1);
  color: var(--color-amber);
  border: 1px solid hsla(38, 92%, 50%, 0.2);
  animation: pulse-border 2s infinite;
}

.status-revoked {
  background: hsla(346, 84%, 61%, 0.1);
  color: var(--color-rose);
  border: 1px solid hsla(346, 84%, 61%, 0.2);
}

/* Modals & Overlays */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 7, 18, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  width: 100%;
  max-width: 400px;
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.modal-header {
  padding: 32px 32px 16px 32px;
  text-align: center;
}

.modal-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 16px auto;
}

.modal-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.modal-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
}

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

/* Forms controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.form-group label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.input-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.form-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 12px 12px 12px 44px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

.form-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 15px var(--glow-primary);
  background: rgba(0, 0, 0, 0.4);
}

.text-center {
  text-align: center;
  padding-left: 12px;
}

.form-input.text-center {
  padding-left: 12px;
}

.letter-spacing-lg {
  letter-spacing: 6px;
}

.error-msg {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: hsla(346, 84%, 61%, 0.1);
  color: var(--color-rose);
  border: 1px solid hsla(346, 84%, 61%, 0.15);
  font-size: 12px;
  margin-top: 8px;
}

.error-msg i {
  width: 16px;
  height: 16px;
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  margin: 20px 0;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--panel-border);
}

.divider:not(:empty)::before {
  margin-right: 12px;
}

.divider:not(:empty)::after {
  margin-left: 12px;
}

.pending-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: 20px;
  text-align: center;
}

.waiting-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--panel-border);
  border-top-color: var(--color-amber);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Tooltips */
.tooltip {
  position: relative;
}

.tooltip::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: -32px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.85);
  color: var(--text-primary);
  font-size: 10px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 100;
}

.tooltip:hover::before {
  opacity: 1;
}

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

.animate-spin-slow {
  animation: spin 4s linear infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.animate-bounce {
  animation: bounce 2s infinite ease-in-out;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fade-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes scale-up {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.animate-scale-up {
  animation: scale-up 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes pulse-border {
  0%, 100% { border-color: hsla(38, 92%, 50%, 0.2); }
  50% { border-color: var(--color-amber); }
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--panel-border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ===================== DEVICE MANAGEMENT DRAWER ===================== */

/* Navbar pending badge */
.pending-nav-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--color-amber);
  color: #000;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse-amber 2s ease-in-out infinite;
}

@keyframes pulse-amber {
  0%, 100% { box-shadow: 0 0 0 0 hsla(38, 92%, 50%, 0.6); }
  50% { box-shadow: 0 0 0 6px hsla(38, 92%, 50%, 0); }
}

/* Drawer Overlay */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 500;
  display: flex;
  justify-content: flex-end;
}

/* Drawer Panel */
.drawer {
  width: 100%;
  max-width: 700px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-xl) 0 0 var(--radius-xl);
  overflow: hidden;
}

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

.animate-slide-in {
  animation: slide-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Drawer Header */
.drawer-header {
  padding: 24px 28px 0 28px;
  border-bottom: 1px solid var(--panel-border);
  flex-shrink: 0;
}

.drawer-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.drawer-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.drawer-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.drawer-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.drawer-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.drawer-header-actions {
  display: flex;
  gap: 8px;
}

/* Stats Row */
.device-stats-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-xl);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--panel-border);
  background: rgba(255,255,255,0.03);
}

.stat-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pill-total  .stat-pill-dot { background: var(--text-secondary); }
.pill-approved .stat-pill-dot { background: var(--color-emerald); }
.pill-pending  .stat-pill-dot { background: var(--color-amber); }
.pill-revoked  .stat-pill-dot { background: var(--color-rose); }

/* Filter Tabs */
.device-filter-tabs {
  display: flex;
  gap: 4px;
  padding-bottom: 0;
  border-bottom: none;
  margin-bottom: -1px;
}

.filter-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.filter-tab:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.03);
}

.filter-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

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

.dot-approved { background: var(--color-emerald); }
.dot-pending  { background: var(--color-amber); }
.dot-revoked  { background: var(--color-rose); }

/* Drawer Body */
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}

/* Empty State */
.devices-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 80px 24px;
  text-align: center;
  color: var(--text-muted);
}

.empty-icon {
  width: 52px;
  height: 52px;
  stroke-width: 1.25px;
  margin-bottom: 8px;
  opacity: 0.5;
}

.devices-empty p {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.devices-empty span {
  font-size: 12px;
}

/* Devices Grid */
.devices-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Device Card */
.device-card {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: background 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.device-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
}

.device-card.card-approved::before { background: var(--color-emerald); }
.device-card.card-pending::before  { background: var(--color-amber); }
.device-card.card-revoked::before  { background: var(--color-rose); opacity: 0.5; }

.device-card:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.1);
}

.device-card-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.device-card-icon-wrap i {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
}

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

.device-card-name {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.device-card-name .badge-current {
  font-size: 9px;
  padding: 2px 7px;
  background: hsla(244, 97%, 66%, 0.12);
  color: var(--color-primary);
  border-radius: 4px;
  border: 1px solid hsla(244, 97%, 66%, 0.2);
  flex-shrink: 0;
}

.device-card-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.device-card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.device-card-meta i {
  width: 11px;
  height: 11px;
}

.device-card-dates {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  opacity: 0.7;
}

.device-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.device-card-actions {
  display: flex;
  gap: 6px;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-rose {
  background: hsla(346, 84%, 61%, 0.15);
  color: var(--color-rose);
  border: 1px solid hsla(346, 84%, 61%, 0.25);
}

.btn-rose:hover:not(:disabled) {
  background: var(--color-rose);
  color: white;
}

.stats-badge-container {
  display: flex;
  gap: 8px;
}

/* Device Role Badges */
.device-card-name .badge-role {
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-left: 6px;
  font-weight: 600;
  text-transform: uppercase;
}

.device-card-name .badge-admin {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.device-card-name .badge-user {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.25);
}
