/* ==========================================================================
   TV PRO - Dashboard & Device Management Styles
   Theme: Midnight Navy / Electric Cyan & Neon Magenta
   ========================================================================== */

/* Dashboard Layout */
.dashboard-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.dash-main {
  flex: 1;
  padding: 100px 0 60px;
  position: relative;
  z-index: 1;
}

/* Dashboard Header Nav Extras */
.dash-header-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-nav-pill {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(10, 22, 53, 0.75);
  border: 1px solid var(--border-glass);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  backdrop-filter: blur(12px);
}

.user-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-pink));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.4);
}

.user-nav-info {
  display: flex;
  flex-direction: column;
}

.user-nav-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.user-nav-email {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.btn-signout {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  font-size: 0.8rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-signout:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #ffffff;
}

/* Dashboard Hero Banner */
.dash-hero {
  margin-bottom: 2rem;
}

.dash-hero-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dash-badge-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.pro-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: linear-gradient(90deg, rgba(0, 210, 255, 0.15), rgba(255, 0, 127, 0.15));
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: 0 0 16px rgba(0, 210, 255, 0.3);
}

.pro-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neon-cyan);
  box-shadow: 0 0 8px var(--neon-cyan);
  animation: pulse-cyan 1.8s infinite;
}

@keyframes pulse-cyan {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.dash-hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.dash-hero-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 650px;
}

/* Stats Cards Grid */
.dash-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.4rem;
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: rgba(0, 210, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.stat-card-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(0, 210, 255, 0.12);
  color: var(--neon-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.stat-card-icon.pink-theme {
  background: rgba(255, 0, 127, 0.12);
  color: var(--neon-pink);
}

.stat-card-icon.green-theme {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-green);
}

.stat-card-value {
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--font-display);
  color: #ffffff;
  line-height: 1.1;
  margin-bottom: 0.35rem;
}

.stat-card-subtext {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Slots Progress Bar Card */
.slot-overview-card {
  background: linear-gradient(135deg, rgba(12, 24, 58, 0.75), rgba(7, 16, 38, 0.85));
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 2.25rem;
  backdrop-filter: blur(16px);
}

.slot-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.slot-bar-title {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.slot-bar-fraction {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--neon-cyan);
}

.slot-progress-track {
  height: 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  margin-bottom: 0.75rem;
}

.slot-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-pink));
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 12px rgba(0, 210, 255, 0.6);
}

.slot-bar-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Buy More Slots Banner */
.buy-slots-banner {
  background: radial-gradient(circle at 80% 50%, rgba(255, 0, 127, 0.15) 0%, transparent 60%),
              linear-gradient(135deg, rgba(16, 34, 80, 0.85), rgba(7, 16, 38, 0.95));
  border: 1px solid rgba(255, 0, 127, 0.35);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 0 30px rgba(255, 0, 127, 0.06);
  flex-wrap: wrap;
}

.buy-slots-info {
  flex: 1;
  min-width: 280px;
}

.buy-slots-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--neon-pink);
  margin-bottom: 0.4rem;
  letter-spacing: 0.05em;
}

.buy-slots-title {
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
  color: #ffffff;
}

.buy-slots-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.buy-slots-action {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.price-tag-badge {
  font-size: 1.75rem;
  font-weight: 900;
  font-family: var(--font-display);
  color: #ffffff;
  white-space: nowrap;
}

.price-tag-sub {
  font-size: 0.78rem;
  color: var(--neon-cyan);
  display: block;
}

/* 2-Column Main Workspace: Left = Add Device, Right = Devices List */
.dash-workspace-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.75rem;
  align-items: start;
}

/* Add Device Card */
.add-device-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  backdrop-filter: blur(16px);
  position: sticky;
  top: 90px;
}

.add-device-card .card-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.add-device-card .card-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.code-input-wrapper {
  position: relative;
}

.code-input {
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.15rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--neon-cyan) !important;
  text-align: center;
  background: rgba(4, 8, 22, 0.9) !important;
  border: 1.5px solid var(--border-glass) !important;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.6);
}

.code-input:focus {
  border-color: var(--neon-cyan) !important;
  box-shadow: 0 0 18px rgba(0, 210, 255, 0.4), inset 0 0 15px rgba(0, 0, 0, 0.6) !important;
}

.slots-availability-banner {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.slots-availability-banner.available {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #a7f3d0;
}

.slots-availability-banner.full {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

/* Active Devices List & Grid */
.devices-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.devices-section-title {
  font-size: 1.35rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.active-devices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.device-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  backdrop-filter: blur(16px);
  position: relative;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.device-card:hover {
  border-color: rgba(0, 210, 255, 0.45);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.device-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.device-platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(0, 210, 255, 0.1);
  color: var(--neon-cyan);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 210, 255, 0.2);
}

.device-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  margin-top: 0.35rem;
}

.device-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-green);
  background: rgba(16, 185, 129, 0.12);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(16, 185, 129, 0.25);
  white-space: nowrap;
}

.device-code-box {
  background: rgba(4, 8, 22, 0.85);
  border: 1px dashed rgba(0, 210, 255, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.device-code-text {
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--neon-cyan);
  letter-spacing: 0.08em;
}

.btn-copy-mini {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  transition: var(--transition);
}

.btn-copy-mini:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.device-expiry-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-bottom: 0.85rem;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.device-expiry-row-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.device-expiry-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(0, 210, 255, 0.12);
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 210, 255, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.device-expiry-badge.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.35);
}

.device-expiry-badge.expired {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.4);
}

.device-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.btn-remove-device {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-remove-device:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #ffffff;
}

.btn-remove-confirm {
  background: #ef4444 !important;
  color: #ffffff !important;
  border-color: #ef4444 !important;
  animation: pulse-danger 1s infinite alternate;
}

/* Screen Seat & Swap Styling */
.device-seat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  font-weight: 700;
  background: rgba(0, 210, 255, 0.12);
  color: var(--neon-cyan);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(0, 210, 255, 0.3);
}

.swap-preserve-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.swap-preserve-pill i {
  color: var(--neon-cyan);
}

.vacant-seat-card {
  background: rgba(12, 24, 58, 0.35);
  border: 1.5px dashed rgba(0, 210, 255, 0.3);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
  position: relative;
}

.vacant-seat-card:hover {
  border-color: var(--neon-cyan);
  background: rgba(12, 24, 58, 0.55);
  box-shadow: 0 8px 20px rgba(0, 210, 255, 0.15);
}

.vacant-seat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(0, 210, 255, 0.1);
  color: var(--neon-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 0.8rem;
}

.vacant-seat-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.25rem;
}

.vacant-seat-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 1rem;
}

.btn-vacant-connect {
  background: rgba(0, 210, 255, 0.12);
  border: 1px solid rgba(0, 210, 255, 0.35);
  color: var(--neon-cyan);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: fit-content;
}

.btn-vacant-connect:hover {
  background: var(--neon-cyan);
  color: #040816;
  box-shadow: 0 0 12px rgba(0, 210, 255, 0.5);
}

/* Empty Devices State */
.empty-devices-card {
  background: var(--bg-card);
  border: 1px dashed var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  grid-column: 1 / -1;
}

.empty-devices-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(0, 210, 255, 0.1);
  color: var(--neon-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 1rem;
}

.empty-devices-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.empty-devices-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 450px;
  margin: 0 auto;
}

/* TV App Setup Guide Helper */
.app-guide-card {
  margin-top: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  backdrop-filter: blur(16px);
}

.guide-steps-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.guide-step-item {
  background: rgba(4, 8, 22, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  gap: 0.85rem;
}

.guide-step-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--neon-cyan);
  color: #040816;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.guide-step-body h5 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: #ffffff;
}

.guide-step-body p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* API Verification Simulator Box */
.api-tester-card {
  margin-top: 2rem;
  background: #020612;
  border: 1px solid rgba(0, 210, 255, 0.35);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  position: relative;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

.api-tester-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.api-tester-title {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--neon-cyan);
}

.api-tester-endpoint {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.8rem;
  background: rgba(0, 210, 255, 0.1);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  color: #ffffff;
}

.api-terminal-box {
  background: #000208;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85rem;
  color: #38bdf8;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* Auth Modal Styles (Shared between landing page & dashboard) */
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  background: rgba(4, 8, 22, 0.7);
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.65rem;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.auth-tab-btn.active {
  background: linear-gradient(90deg, rgba(0, 210, 255, 0.2), rgba(255, 0, 127, 0.2));
  color: #ffffff;
  border: 1px solid rgba(0, 210, 255, 0.4);
}

.demo-login-box {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.btn-demo {
  background: rgba(0, 210, 255, 0.1);
  border: 1px solid rgba(0, 210, 255, 0.35);
  color: var(--neon-cyan);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-demo:hover {
  background: rgba(0, 210, 255, 0.25);
  color: #ffffff;
  border-color: var(--neon-cyan);
}

/* Responsive Overrides */
@media (max-width: 1024px) {
  .dash-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dash-workspace-grid {
    grid-template-columns: 1fr;
  }
  .add-device-card {
    position: static;
  }
  .guide-steps-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .dash-stats-grid {
    grid-template-columns: 1fr;
  }
  .buy-slots-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .buy-slots-action {
    width: 100%;
    justify-content: space-between;
  }
  .dash-hero-title {
    font-size: 1.7rem;
  }
  .active-devices-grid {
    grid-template-columns: 1fr;
  }
}

/* Firebase Connection Pill & Modal */
.btn-firebase-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 152, 0, 0.12);
  border: 1px solid rgba(255, 152, 0, 0.35);
  color: #ffb74d;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-firebase-status:hover {
  background: rgba(255, 152, 0, 0.22);
  border-color: #ff9800;
  box-shadow: 0 0 12px rgba(255, 152, 0, 0.3);
}

.btn-firebase-status.connected {
  background: rgba(0, 230, 118, 0.12);
  border-color: rgba(0, 230, 118, 0.4);
  color: #00e676;
}

.btn-firebase-status.connected:hover {
  background: rgba(0, 230, 118, 0.22);
  border-color: #00e676;
  box-shadow: 0 0 12px rgba(0, 230, 118, 0.3);
}

.fb-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff9800;
  box-shadow: 0 0 8px #ff9800;
}

.btn-firebase-status.connected .fb-status-dot {
  background: #00e676;
  box-shadow: 0 0 8px #00e676;
}

.firebase-info-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.76rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

/* ==========================================================================
   Compact Screen Manager & High-Density Device Rows
   ========================================================================== */

.screens-manager-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  backdrop-filter: blur(16px);
  position: relative;
}

.screens-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.screens-filter-pills {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(4, 9, 22, 0.7);
  padding: 0.25rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.filter-pill {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.filter-pill:hover {
  color: #ffffff;
}

.filter-pill.active {
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.2), rgba(255, 0, 128, 0.2));
  color: #ffffff;
  border: 1px solid rgba(0, 210, 255, 0.4);
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.25);
}

.filter-count {
  font-size: 0.72rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--neon-cyan);
  font-weight: 700;
}

.filter-pill.active .filter-count {
  background: rgba(0, 210, 255, 0.3);
  color: #ffffff;
}

.screens-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.screens-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.screens-search-wrap i {
  position: absolute;
  left: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  pointer-events: none;
}

.screens-search-input {
  background: rgba(4, 9, 22, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: #ffffff;
  font-size: 0.78rem;
  padding: 0.35rem 0.75rem 0.35rem 2rem;
  width: 170px;
  transition: var(--transition);
}

.screens-search-input:focus {
  outline: none;
  border-color: var(--neon-cyan);
  width: 210px;
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.25);
}

.view-mode-group {
  display: flex;
  background: rgba(4, 9, 22, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.2rem;
  gap: 0.2rem;
}

.view-mode-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.view-mode-btn:hover {
  color: #ffffff;
}

.view-mode-btn.active {
  background: rgba(0, 210, 255, 0.18);
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 210, 255, 0.35);
}

/* Scroll Container for Screen Rows */
.screens-scroll-container {
  max-height: 560px;
  overflow-y: auto;
  padding-right: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.screens-scroll-container::-webkit-scrollbar {
  width: 6px;
}
.screens-scroll-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 999px;
}
.screens-scroll-container::-webkit-scrollbar-thumb {
  background: rgba(0, 210, 255, 0.25);
  border-radius: 999px;
}
.screens-scroll-container::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 210, 255, 0.5);
}

/* Compact Row Item */
.screen-row {
  background: rgba(10, 22, 53, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  transition: all 0.2s ease;
  position: relative;
}

.screen-row:hover {
  border-color: rgba(0, 210, 255, 0.35);
  background: rgba(14, 28, 68, 0.85);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.screen-row.vacant-row-item {
  background: rgba(10, 22, 53, 0.35);
  border: 1.5px dashed rgba(0, 210, 255, 0.25);
}

.screen-row.vacant-row-item:hover {
  border-color: var(--neon-cyan);
  background: rgba(12, 26, 62, 0.55);
}

/* Left Group */
.screen-row-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 190px;
}

.screen-seat-pill {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--neon-cyan);
  background: rgba(0, 210, 255, 0.12);
  border: 1px solid rgba(0, 210, 255, 0.3);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.screen-seat-pill.vacant {
  color: var(--accent-green);
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
}

.screen-info-block {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.screen-name-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.screen-platform-text {
  font-size: 0.74rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Center Group: Code & Expiry */
.screen-row-center {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex: 1;
  justify-content: center;
}

.screen-code-pill-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(4, 8, 22, 0.85);
  border: 1px solid rgba(0, 210, 255, 0.25);
  border-radius: 6px;
  padding: 0.25rem 0.55rem;
}

.screen-code-mono {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--neon-cyan);
  letter-spacing: 0.06em;
}

.btn-mini-copy {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.15rem 0.3rem;
  border-radius: 4px;
  font-size: 0.75rem;
  transition: var(--transition);
}

.btn-mini-copy:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.screen-expiry-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.72rem;
}

.screen-expiry-label {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.screen-expiry-countdown {
  font-weight: 700;
  color: var(--accent-green);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.screen-expiry-countdown.warning {
  color: #fbbf24;
}

.screen-expiry-countdown.expired {
  color: #f87171;
}

/* Status Pill */
.screen-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

.screen-status-pill.active {
  color: var(--accent-green);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.screen-status-pill.vacant {
  color: var(--neon-cyan);
  background: rgba(0, 210, 255, 0.1);
  border: 1px solid rgba(0, 210, 255, 0.3);
}

/* Right Group: Action Buttons */
.screen-row-right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.btn-row-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.32rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.btn-row-action:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-row-remove {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
}

.btn-row-remove:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #ffffff;
}

.btn-row-connect {
  background: rgba(0, 210, 255, 0.15);
  border: 1px solid rgba(0, 210, 255, 0.4);
  color: var(--neon-cyan);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-row-connect:hover {
  background: var(--neon-cyan);
  color: #040916;
  box-shadow: 0 0 12px rgba(0, 210, 255, 0.5);
}

/* Empty filtered results */
.screens-empty-filter {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

@media (max-width: 900px) {
  .screen-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }
  .screen-row-center {
    width: 100%;
    justify-content: space-between;
  }
  .screen-row-right {
    width: 100%;
    justify-content: flex-end;
  }
}

/* Portrait Mobile Viewport Optimizations (320px - 480px) */
@media (max-width: 480px) {
  .dash-main {
    padding: 1rem 0.5rem;
    overflow-x: hidden;
  }
  .container {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  .dash-hero-title, h3, .card-title {
    font-size: 1.25rem !important;
    word-break: break-word;
    overflow-wrap: break-word;
  }
  p, label, .card-subtitle, .stat-card-subtext {
    word-break: break-word;
    overflow-wrap: break-word;
  }
  .form-input, .code-input {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .dash-stats-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
  .stat-card, .device-card, .vacant-seat-card, .slot-overview-card, .add-device-card {
    padding: 1.15rem 0.85rem;
    overflow: hidden;
    word-break: break-word;
    box-sizing: border-box;
  }
  .device-card-top, .device-card-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .device-card-footer {
    width: 100%;
  }
  .device-card-footer .btn, .device-card-footer button {
    width: 100%;
    justify-content: center;
  }
  .screen-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 1rem 0.75rem;
  }
  .screen-row-left, .screen-row-center, .screen-row-right {
    width: 100%;
    justify-content: space-between;
  }
  .screen-row-right {
    justify-content: flex-end;
  }
  .buy-slots-banner {
    padding: 1.25rem 1rem;
    text-align: center;
    align-items: center;
    flex-direction: column;
  }
  .buy-slots-content {
    text-align: center;
  }
  .buy-slots-action {
    width: 100%;
    justify-content: center;
  }
  .modal-card {
    width: 95% !important;
    margin: 1rem auto;
    padding: 1.25rem 0.85rem;
    max-height: 90vh;
    overflow-y: auto;
  }
  .nav-container {
    padding: 0 0.5rem;
  }
  .dash-header-user {
    gap: 0.35rem;
  }
  .user-nav-pill {
    padding: 0.25rem 0.5rem;
  }
  .user-nav-email {
    display: none;
  }
  .btn-signout {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
  }
}

