/* =========================================================================
   style.css — Premium Glassmorphism Dark Theme Admin Panel
   ========================================================================= */

/* ─── Google Fonts ─────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/icon?family=Material+Icons');

/* ─── CSS Variables ────────────────────────────────────────────────────── */
:root {
  /* Color Palette */
  --bg-primary:        #0a0f1e;
  --bg-secondary:      #0d1328;
  --bg-card:           rgba(255, 255, 255, 0.05);
  --bg-card-hover:     rgba(255, 255, 255, 0.09);
  --border-color:      rgba(255, 255, 255, 0.10);
  --border-glow:       rgba(99, 179, 237, 0.30);

  /* Accent Colors */
  --accent-primary:    #63b3ed;
  --accent-secondary:  #9f7aea;
  --accent-gradient:   linear-gradient(135deg, #63b3ed 0%, #9f7aea 100%);
  --accent-online:     #48bb78;
  --accent-offline:    #fc8181;
  --accent-warning:    #f6ad55;
  --accent-danger:     #fc8181;

  /* Text */
  --text-primary:      rgba(255, 255, 255, 0.92);
  --text-secondary:    rgba(255, 255, 255, 0.55);
  --text-muted:        rgba(255, 255, 255, 0.35);

  /* Glassmorphism */
  --glass-bg:          rgba(13, 19, 40, 0.70);
  --glass-blur:        16px;
  --glass-border:      1px solid rgba(255, 255, 255, 0.10);

  /* Sidebar */
  --sidebar-width:     260px;
  --sidebar-bg:        rgba(9, 14, 30, 0.95);

  /* Topbar */
  --topbar-height:     64px;
  --topbar-bg:         rgba(10, 15, 30, 0.85);

  /* Shadows */
  --shadow-sm:         0 2px 8px rgba(0, 0, 0, 0.30);
  --shadow-md:         0 4px 20px rgba(0, 0, 0, 0.45);
  --shadow-lg:         0 8px 40px rgba(0, 0, 0, 0.60);
  --shadow-glow:       0 0 30px rgba(99, 179, 237, 0.15);

  /* Transitions */
  --transition-fast:   0.15s ease;
  --transition-med:    0.25s ease;
  --transition-slow:   0.40s ease;

  /* Border Radius */
  --radius-sm:         8px;
  --radius-md:         12px;
  --radius-lg:         16px;
  --radius-xl:         24px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ─── Animated Background ──────────────────────────────────────────────── */
.bg-animated {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(99, 179, 237, 0.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(159, 122, 234, 0.07) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

/* ─── Scrollbar ────────────────────────────────────────────────────────── */
::-webkit-scrollbar              { width: 6px; height: 6px; }
::-webkit-scrollbar-track        { background: transparent; }
::-webkit-scrollbar-thumb        { background: rgba(255,255,255,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover  { background: rgba(255,255,255,0.25); }

/* ─── Typography ───────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: var(--text-primary);
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover { color: var(--accent-secondary); }

.text-gradient {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Glass Card ───────────────────────────────────────────────────────── */
.glass-card {
  background: var(--bg-card);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-med), box-shadow var(--transition-med),
              border-color var(--transition-med);
}

.glass-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  border-color: var(--border-glow);
}

.glass-card-flat {
  background: var(--bg-card);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-sm);
}

/* ─── Login Page ───────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
}

/* Floating orbs */
.login-page::before,
.login-page::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.20;
  animation: floatOrb 8s ease-in-out infinite alternate;
  pointer-events: none;
}

.login-page::before {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #63b3ed, transparent);
  top: -100px; left: -100px;
}

.login-page::after {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #9f7aea, transparent);
  bottom: -150px; right: -150px;
  animation-direction: alternate-reverse;
  animation-delay: -4s;
}

@keyframes floatOrb {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(30px, 20px) scale(1.1); }
}

.login-container {
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
}

.login-logo {
  width: 72px; height: 72px;
  border-radius: 20px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  box-shadow: 0 8px 32px rgba(99, 179, 237, 0.30);
  animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { box-shadow: 0 8px 32px rgba(99, 179, 237, 0.30); }
  50%       { box-shadow: 0 8px 48px rgba(99, 179, 237, 0.55); }
}

.login-logo .material-icons { font-size: 36px; color: #fff; }

.login-card {
  background: rgba(13, 19, 40, 0.80);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg), 0 0 60px rgba(99, 179, 237, 0.08);
}

.login-card h1 {
  font-size: 1.75rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 4px;
}

.login-card .subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 32px;
}

/* ─── Form Controls ────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 20px;
  position: relative;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.form-control-glass {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  padding: 12px 16px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast),
              background var(--transition-fast);
  outline: none;
}

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

.form-control-glass:focus {
  border-color: var(--accent-primary);
  background: rgba(99, 179, 237, 0.05);
  box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.15);
}

.input-with-icon {
  position: relative;
}

.input-with-icon .form-control-glass {
  padding-left: 44px;
  padding-right: 44px;
}

.input-with-icon .input-icon-left,
.input-with-icon .input-icon-right {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.input-with-icon .input-icon-left  { left: 14px; }
.input-with-icon .input-icon-right {
  right: 14px;
  pointer-events: all;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  box-shadow: none;
}

.input-with-icon .input-icon-right:hover { color: var(--text-primary); }

/* ─── Buttons ──────────────────────────────────────────────────────────── */
.btn-glass {
  background: var(--accent-gradient);
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 13px 24px;
  cursor: pointer;
  transition: opacity var(--transition-fast), transform var(--transition-fast),
              box-shadow var(--transition-fast);
  box-shadow: 0 4px 20px rgba(99, 179, 237, 0.30);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

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

.btn-glass:hover::after    { background: rgba(255,255,255,0.08); }
.btn-glass:active          { transform: scale(0.97); }
.btn-glass:disabled        { opacity: 0.50; cursor: not-allowed; }

.btn-ghost {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 9px 18px;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.20);
}

.btn-danger-ghost {
  background: rgba(252, 129, 129, 0.08);
  border: 1px solid rgba(252, 129, 129, 0.25);
  border-radius: var(--radius-md);
  color: var(--accent-danger);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 9px 18px;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-danger-ghost:hover {
  background: rgba(252, 129, 129, 0.15);
  border-color: rgba(252, 129, 129, 0.45);
}

.btn-success-ghost {
  background: rgba(72, 187, 120, 0.08);
  border: 1px solid rgba(72, 187, 120, 0.25);
  border-radius: var(--radius-md);
  color: var(--accent-online);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 9px 18px;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-success-ghost:hover {
  background: rgba(72, 187, 120, 0.15);
  border-color: rgba(72, 187, 120, 0.45);
}

.btn-icon {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  width: 36px; height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.btn-icon:hover { background: rgba(255,255,255,0.12); color: var(--text-primary); }

/* ─── Topbar ───────────────────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-height);
  background: var(--topbar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  z-index: 900;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
}

.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-center { flex: 1; display: flex; justify-content: center; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.topbar-title {
  font-size: 1.1rem;
  font-weight: 700;
  white-space: nowrap;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.menu-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  width: 40px; height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
  flex-shrink: 0;
}

.menu-btn:hover { background: rgba(255,255,255,0.08); }

/* Topbar search */
.topbar-search {
  position: relative;
  width: 280px;
  max-width: 100%;
}

.topbar-search .form-control-glass {
  padding: 9px 14px 9px 40px;
  font-size: 0.875rem;
  border-radius: 20px;
}

.topbar-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 18px;
  pointer-events: none;
}

.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  cursor: pointer;
}

/* ─── Sidebar ──────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform var(--transition-slow) cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.sidebar.open { transform: translateX(0); }

/* Desktop: always visible sidebar */
@media (min-width: 1024px) {
  .sidebar { transform: translateX(0); }
  .main-wrapper { margin-left: var(--sidebar-width); }
  #menu-toggle { display: none; }
  .sidebar-overlay { display: none !important; }
}

.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--topbar-height);
}

.sidebar-logo {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo .material-icons { font-size: 22px; color: #fff; }

.sidebar-brand {
  font-size: 1rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-brand-sub {
  font-size: 0.70rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: -2px;
}

.nav-section {
  padding: 16px 12px 0;
  flex: 1;
}

.nav-section-label {
  font-size: 0.70rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0 8px;
  margin-bottom: 6px;
  margin-top: 16px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background var(--transition-fast), color var(--transition-fast);
  margin-bottom: 2px;
  cursor: pointer;
  position: relative;
  text-decoration: none;
}

.nav-link:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}

.nav-link.active {
  background: rgba(99, 179, 237, 0.12);
  color: var(--accent-primary);
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--accent-gradient);
  border-radius: 0 3px 3px 0;
}

.nav-link .material-icons { font-size: 20px; flex-shrink: 0; }

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

/* ─── Sidebar Overlay ──────────────────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 999;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.active { display: block; }

/* ─── Main Content Area ────────────────────────────────────────────────── */
.main-wrapper {
  min-height: 100vh;
  padding-top: var(--topbar-height);
  transition: margin-left var(--transition-slow) cubic-bezier(0.4, 0, 0.2, 1);
}

.page-content {
  padding: 28px 24px;
  max-width: 1400px;
  margin: 0 auto;
}

@media (max-width: 576px) { .page-content { padding: 20px 16px; } }

/* ─── Page Header ──────────────────────────────────────────────────────── */
.page-header {
  margin-bottom: 28px;
}

.page-header h1 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ─── Stat Cards ───────────────────────────────────────────────────────── */
.stat-cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-med), box-shadow var(--transition-med);
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity var(--transition-med);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.stat-card:hover::before { opacity: 0.04; }

.stat-card .stat-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.stat-card .stat-icon .material-icons { font-size: 22px; }

.stat-icon-blue   { background: rgba(99,  179, 237, 0.15); color: #63b3ed; }
.stat-icon-green  { background: rgba(72,  187, 120, 0.15); color: #48bb78; }
.stat-icon-red    { background: rgba(252, 129, 129, 0.15); color: #fc8181; }
.stat-icon-purple { background: rgba(159, 122, 234, 0.15); color: #9f7aea; }
.stat-icon-orange { background: rgba(246, 173,  85, 0.15); color: #f6ad55; }

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-trend {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 3px;
}

/* ─── Device Cards Grid ────────────────────────────────────────────────── */
.devices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 14px;
}

/* ── New Device Card (image-reference style) ── */
.device-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px 14px;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  cursor: pointer;
  transition: transform var(--transition-med), box-shadow var(--transition-med),
              border-color var(--transition-med);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.device-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.device-card.card-online {
  border-color: rgba(72, 187, 120, 0.22);
}
.device-card.card-online:hover {
  border-color: rgba(72, 187, 120, 0.45);
  box-shadow: var(--shadow-md), 0 0 20px rgba(72, 187, 120, 0.08);
}
.device-card.card-offline {
  border-color: rgba(252, 129, 129, 0.14);
}

/* Top section: avatar + info + star */
.dc-top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

/* Circular avatar */
.dc-avatar {
  position: relative;
  flex-shrink: 0;
  width: 64px;
  height: 64px;
}

.dc-avatar-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a1f36, #0d1128);
  border: 2.5px solid transparent;
  background-clip: padding-box;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-primary);
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 0 2.5px rgba(99,179,237,0.35);
  letter-spacing: -1px;
  text-transform: uppercase;
  font-style: italic;
}

/* Animated shimmer inside avatar */
.dc-avatar-ring::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(99,179,237,0.08) 0%,
    rgba(159,122,234,0.06) 100%);
}

/* Serial badge — bottom-right of avatar */
.dc-serial-badge {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  background: #38a169;
  color: #fff;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 1px 7px;
  border: 2px solid var(--bg-primary);
  min-width: 22px;
  text-align: center;
  line-height: 1.4;
}

/* Info block beside avatar */
.dc-info {
  flex: 1;
  min-width: 0;
}

.dc-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.dc-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.dc-star {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  opacity: 0.6;
  font-size: 1.2rem;
  padding: 0;
  flex-shrink: 0;
  line-height: 1;
  transition: transform var(--transition-fast), color var(--transition-fast), opacity var(--transition-fast);
}
.dc-star:hover {
  transform: scale(1.2);
  color: #f6c90e;
  opacity: 1;
}
.dc-star.starred {
  color: #f6c90e;
  opacity: 1;
}

.dc-battery-android {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.dc-battery-android .material-icons {
  font-size: 15px;
  vertical-align: middle;
}

.dc-dot {
  color: var(--text-muted);
  font-size: 0.6rem;
  margin: 0 2px;
}

.dc-sim-row {
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
  line-height: 1.7;
}

.dc-sim-row .material-icons { font-size: 14px; color: var(--accent-secondary); }

/* Divider */
.dc-divider {
  height: 1px;
  background: var(--border-color);
  margin: 12px 0 10px;
}

/* Footer row */
.dc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.dc-status-online {
  font-size: 0.875rem;
  font-weight: 700;
  color: #48bb78;
  display: flex;
  align-items: center;
  gap: 5px;
}

.dc-status-offline {
  font-size: 0.875rem;
  font-weight: 700;
  color: #fc8181;
  display: flex;
  align-items: center;
  gap: 5px;
}

.dc-status-online .status-dot,
.dc-status-offline .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.dc-status-online .status-dot {
  animation: pulse 2s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(72, 187, 120, 0.6);
}

.dc-install-time {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── User Serial — top-right corner badge ── */
.dc-corner-serial {
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent-primary);
  background: rgba(99, 179, 237, 0.10);
  border: 1px solid rgba(99, 179, 237, 0.25);
  border-radius: 20px;
  padding: 2px 8px;
  letter-spacing: 0.3px;
  pointer-events: none;
  user-select: none;
}

/* ── Old device-meta (kept for compatibility) ── */
.device-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
}

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

.device-meta-label {
  font-size: 0.70rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.device-meta-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.device-meta-value .material-icons { font-size: 14px; }

/* ─── Status Badge ─────────────────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}

.status-online {
  background: rgba(72, 187, 120, 0.15);
  color: #48bb78;
  border: 1px solid rgba(72, 187, 120, 0.25);
}

.status-offline {
  background: rgba(252, 129, 129, 0.10);
  color: #fc8181;
  border: 1px solid rgba(252, 129, 129, 0.20);
}

.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.status-online .status-dot {
  animation: pulse 2s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(72, 187, 120, 0.6);
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0   rgba(72, 187, 120, 0.6); }
  70%  { box-shadow: 0 0 0 6px rgba(72, 187, 120, 0);   }
  100% { box-shadow: 0 0 0 0   rgba(72, 187, 120, 0);   }
}

/* ─── Section Header ───────────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title .material-icons { font-size: 20px; color: var(--accent-primary); }

/* ─── Search Bar ───────────────────────────────────────────────────────── */
.search-bar {
  position: relative;
  width: 100%;
  max-width: 360px;
}

.search-bar .form-control-glass {
  padding-left: 42px;
  border-radius: 20px;
  font-size: 0.875rem;
}

.search-bar .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 18px;
  pointer-events: none;
}

/* ─── Tabs ─────────────────────────────────────────────────────────────── */
.glass-tabs {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 6px;
  margin-bottom: 24px;
  overflow-x: auto;
  flex-wrap: nowrap;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}

.glass-tabs::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.glass-tab {
  flex: 0 0 auto;
  padding: 9px 16px;
  border-radius: 8px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.glass-tab .material-icons { font-size: 18px; }

.glass-tab.active {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 2px 12px rgba(99, 179, 237, 0.25);
}

.glass-tab:not(.active):hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}

/* ─── Info Row (device details) ────────────────────────────────────────── */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.info-item {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-item-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

.info-item-label .material-icons { font-size: 14px; }

.info-item-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-all;
}

/* ─── Apps List ────────────────────────────────────────────────────────── */
.apps-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.app-item {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background var(--transition-fast);
  animation: fadeSlideIn 0.3s ease;
}

.app-item:hover { background: rgba(255,255,255,0.07); }

.app-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: rgba(99,179,237,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent-primary);
}

.app-icon .material-icons { font-size: 20px; }

.app-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-all;
}

.app-index {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: auto;
  flex-shrink: 0;
}

/* ─── SMS Cards ────────────────────────────────────────────────────────── */
.sms-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sms-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  transition: transform var(--transition-fast), border-color var(--transition-fast);
  animation: fadeSlideIn 0.35s ease;
}

.sms-card:hover {
  transform: translateX(3px);
  border-color: rgba(99,179,237,0.25);
}

.sms-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 6px;
}

.sms-sender {
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-primary);
}

.sms-sender .material-icons { font-size: 16px; }

.sms-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.sms-date .material-icons { font-size: 13px; }

.sms-body {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  word-break: break-word;
  margin-bottom: 8px;
}

.sms-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.sms-sim-badge {
  background: rgba(159,122,234,0.12);
  border: 1px solid rgba(159,122,234,0.25);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 0.70rem;
  font-weight: 600;
  color: var(--accent-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.sms-device-badge {
  background: rgba(99,179,237,0.10);
  border: 1px solid rgba(99,179,237,0.20);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 0.70rem;
  font-weight: 600;
  color: var(--accent-primary);
  font-family: 'Courier New', monospace;
}

/* ─── Toast Notifications ──────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
  width: 100%;
}

.toast {
  background: rgba(13, 19, 40, 0.92) !important;
  border: 1px solid var(--border-color) !important;
  backdrop-filter: blur(16px);
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
}

.toast-success  { border-color: rgba(72, 187, 120, 0.35) !important; }
.toast-danger   { border-color: rgba(252, 129, 129, 0.35) !important; }
.toast-warning  { border-color: rgba(246, 173, 85, 0.35) !important; }
.toast-info     { border-color: rgba(99, 179, 237, 0.35) !important; }

.toast-icon { font-size: 20px; }
.toast-success .toast-icon  { color: #48bb78; }
.toast-danger .toast-icon   { color: #fc8181; }
.toast-warning .toast-icon  { color: #f6ad55; }
.toast-info .toast-icon     { color: #63b3ed; }

/* ─── Global Loader ────────────────────────────────────────────────────── */
#global-loader {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 30, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.loader-spinner {
  width: 52px; height: 52px;
  border: 3px solid rgba(99, 179, 237, 0.15);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loader-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
  animation: breathe 1.5s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 1; }
}

/* ─── Empty State ──────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-secondary);
}

.empty-state .material-icons {
  font-size: 64px;
  opacity: 0.25;
  display: block;
  margin: 0 auto 16px;
}

.empty-state h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ─── Skeleton Loaders ─────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

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

/* ─── Animations ───────────────────────────────────────────────────────── */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.animate-fade { animation: fadeIn 0.4s ease; }
.animate-slide { animation: fadeSlideIn 0.4s ease; }

/* ─── Pagination ───────────────────────────────────────────────────────── */
.pagination-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.page-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  width: 36px; height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.page-btn:hover       { background: rgba(255,255,255,0.12); color: var(--text-primary); }
.page-btn.active      { background: var(--accent-gradient); color: #fff; border-color: transparent; }
.page-btn:disabled    { opacity: 0.35; cursor: not-allowed; }

/* ─── Badge ────────────────────────────────────────────────────────────── */
.badge-count {
  background: var(--accent-gradient);
  color: #fff;
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 700;
}

/* ─── Divider ──────────────────────────────────────────────────────────── */
.glass-divider {
  height: 1px;
  background: var(--border-color);
  margin: 20px 0;
}

/* ─── Filter Pills ─────────────────────────────────────────────────────── */
.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-pill {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.80rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast),
              border-color var(--transition-fast);
}

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

.filter-pill.active {
  background: rgba(99,179,237,0.15);
  border-color: rgba(99,179,237,0.35);
  color: var(--accent-primary);
}

/* ─── Device Details Header ────────────────────────────────────────────── */
.device-header-card {
  background: var(--bg-card);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  backdrop-filter: blur(var(--glass-blur));
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.device-header-icon {
  width: 68px; height: 68px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.device-header-icon .material-icons { font-size: 34px; }

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

.device-header-name {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.device-header-id {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: 'Courier New', monospace;
  word-break: break-all;
}

.device-header-actions {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  margin-top: 14px;
}

/* ─── Settings ─────────────────────────────────────────────────────────── */
.settings-section {
  background: var(--bg-card);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(var(--glass-blur));
  margin-bottom: 20px;
}

.settings-section h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-section h4 .material-icons { font-size: 20px; color: var(--accent-primary); }

.settings-section p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* ─── Badge Dot ────────────────────────────────────────────────────────── */
.dot-badge {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-primary);
  animation: pulse 2s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(99, 179, 237, 0.6);
}

/* ─── Responsive Overrides ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .stat-cards-row { grid-template-columns: repeat(2, 1fr); }
  .devices-grid   { grid-template-columns: 1fr; }
  .info-grid      { grid-template-columns: repeat(2, 1fr); }
  .device-header-card { flex-direction: column; align-items: flex-start; }
  .topbar-search { width: 200px; }
}

@media (max-width: 480px) {
  .stat-cards-row  { grid-template-columns: 1fr 1fr; }
  .topbar-title    { display: none; }
  .topbar-search   { display: block; width: 100%; }
  .topbar-right    { flex: 1; }
  .glass-tabs      { gap: 4px; padding: 4px; }
  .glass-tab       { font-size: 0.82rem; padding: 8px 12px; }
  .info-grid       { grid-template-columns: 1fr; }
  .page-header h1  { font-size: 1.3rem; }
}

/* ─── Glassmorphism Modal Styles ───────────────────────────────────────── */
.glass-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.glass-modal {
  background: var(--glass-bg);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: var(--text-primary);
}

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

.glass-modal-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.glass-modal-header h3 .material-icons {
  color: var(--accent-primary);
}

.btn-close-modal {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: color var(--transition-fast);
}

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

.form-select-glass {
  width: 100%;
  background: rgba(13, 19, 40, 0.95);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  padding: 12px 16px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast),
              background var(--transition-fast);
  outline: none;
  cursor: pointer;
}

.form-select-glass:focus {
  border-color: var(--accent-primary);
  background: rgba(99, 179, 237, 0.05);
  box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.15);
}

.form-select-glass option {
  background: #0a0f1e;
  color: var(--text-primary);
}

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

/* ─── SMS Card Status Dot ──────────────────────────────────────────────── */
.sms-status-dot {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  z-index: 2;
}

.sms-status-dot.online {
  background-color: #48bb78;
  box-shadow: 0 0 8px #48bb78;
}

.sms-status-dot.offline {
  background-color: #fc8181;
  box-shadow: 0 0 6px #fc8181;
}
