/* ============================================================
   TEMAX WATCH CONTROL — ADMIN PANEL CSS
   Dark Glassmorphism Design System with Dual RTL/LTR Support
   ============================================================ */

:root {
  --bg:           #070a13;
  --bg2:          #0c101d;
  --surface:      rgba(15, 23, 42, 0.75);
  --surface2:     rgba(30, 41, 59, 0.6);
  --glass:        rgba(255, 255, 255, 0.035);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-hover:  rgba(255, 255, 255, 0.06);
  --accent:       #6366f1;
  --accent-glow:  rgba(99, 102, 241, 0.35);
  --accent2:      #8b5cf6;
  --accent3:      #a78bfa;
  --success:      #10b981;
  --success-glow: rgba(16, 185, 129, 0.25);
  --warning:      #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.25);
  --danger:       #ef4444;
  --danger-glow:  rgba(239, 68, 68, 0.25);
  --info:         #3b82f6;
  --text:         #f1f5f9;
  --text-dim:     #cbd5e1;
  --text-muted:   #64748b;
  --sidebar-w:    260px;
  --sidebar-collapsed-w: 68px;
  --topbar-h:     64px;
  --radius:       16px;
  --radius-sm:    10px;
  --shadow:       0 10px 35px -5px rgba(0, 0, 0, 0.6);
  --glow:         0 0 35px rgba(99, 102, 241, 0.2);
}

* { margin:0; padding:0; box-sizing:border-box; }

html { font-size:15px; scroll-behavior:smooth; }

body {
  font-family: 'Cairo', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

[dir="ltr"] body {
  font-family: 'Inter', 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.35); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,0.65); }

/* ── AMBIENT BACKGROUND GLOW ── */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 15% 15%, rgba(99, 102, 241, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 60% at 85% 85%, rgba(139, 92, 246, 0.10) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 50% 50%, rgba(16, 185, 129, 0.04) 0%, transparent 70%),
    linear-gradient(135deg, #070a13 0%, #0c101d 50%, #080c18 100%);
}

/* ── GLASS CARD UTILITY ── */
.glass-card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
}

.login-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 20% 30%, rgba(99,102,241,0.2) 0%, transparent 60%),
    radial-gradient(ellipse 60% 60% at 80% 70%, rgba(139,92,246,0.16) 0%, transparent 60%),
    linear-gradient(135deg, #060911, #0c101d);
  overflow: hidden;
}

.login-particle {
  position: absolute; border-radius: 50%;
  animation: floatParticle 9s ease-in-out infinite;
}
.login-particle.p1 { width:320px;height:320px;top:-90px;right:-90px;background:radial-gradient(circle,rgba(99,102,241,0.18),transparent 70%);animation-delay:0s; }
.login-particle.p2 { width:220px;height:220px;bottom:-70px;left:-70px;background:radial-gradient(circle,rgba(139,92,246,0.14),transparent 70%);animation-delay:2.5s; }
.login-particle.p3 { width:160px;height:160px;top:40%;left:8%;background:radial-gradient(circle,rgba(99,102,241,0.12),transparent 70%);animation-delay:5s; }
.login-particle.p4 { width:130px;height:130px;top:18%;right:12%;background:radial-gradient(circle,rgba(139,92,246,0.12),transparent 70%);animation-delay:7s; }

@keyframes floatParticle {
  0%,100%{transform:translateY(0) scale(1);}
  50%{transform:translateY(-25px) scale(1.08);}
}

.login-card {
  position: relative; z-index: 10;
  width: 100%; max-width: 430px;
  padding: 2.5rem;
  background: rgba(12, 16, 29, 0.94);
  border: 1px solid rgba(99, 102, 241, 0.3);
  box-shadow: 0 25px 60px rgba(0,0,0,0.7), var(--glow);
  animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from{opacity:0;transform:translateY(35px);}
  to{opacity:1;transform:translateY(0);}
}

.login-logo { text-align: center; margin-bottom: 2rem; }

.login-watch-icon {
  width: 76px; height: 76px;
  margin: 0 auto 1.1rem;
  filter: drop-shadow(0 0 22px rgba(99,102,241,0.55));
  animation: watchPulse 3.5s ease-in-out infinite;
}
@keyframes watchPulse {
  0%,100%{filter:drop-shadow(0 0 22px rgba(99,102,241,0.55)); transform: scale(1);}
  50%{filter:drop-shadow(0 0 38px rgba(99,102,241,0.85)); transform: scale(1.03);}
}

.login-title { font-size: 1.55rem; font-weight: 800; color: var(--text); letter-spacing: -0.5px; }
.login-subtitle { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem; }
.login-hint {
  text-align: center; font-size: 0.76rem; color: var(--text-muted);
  margin-top: 1.5rem; padding: 0.6rem;
  background: rgba(255,255,255,0.03); border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.06);
}

/* ============================================================
   FORMS & INPUTS
   ============================================================ */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: 0.82rem; color: var(--text-dim); margin-bottom: 0.4rem; font-weight: 600; }

.input-wrapper { position: relative; display: flex; align-items: center; }
.input-icon { position: absolute; font-size: 1rem; color: var(--text-muted); pointer-events: none; }

[dir="rtl"] .input-icon { right: 0.95rem; }
[dir="ltr"] .input-icon { left: 0.95rem; }

.input-wrapper input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  color: var(--text); font-family: inherit; font-size: 0.9rem;
  transition: all 0.2s ease;
  outline: none;
}

[dir="rtl"] .input-wrapper input { padding: 0.75rem 2.6rem 0.75rem 0.95rem; }
[dir="ltr"] .input-wrapper input { padding: 0.75rem 0.95rem 0.75rem 2.6rem; }

.form-input {
  width: 100%; padding: 0.75rem 0.95rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  color: var(--text); font-family: inherit; font-size: 0.9rem;
  transition: all 0.2s ease; outline: none;
}

.form-input:focus, .input-wrapper input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.22);
  background: rgba(255,255,255,0.06);
}

.edit-preview-current-wrap { margin-bottom: 0.5rem; }
.edit-preview-current-img {
  display: block; width: 110px; height: 110px; object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.04);
}
.edit-file-current {
  display: inline-block; margin-bottom: 0.5rem;
  padding: 0.5rem 0.8rem; border-radius: 6px;
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.3);
  color: var(--text); font-size: 0.85rem; word-break: break-all;
}
.edit-file-empty { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 0.5rem; }
.edit-file-hint { color: var(--text-muted); font-size: 0.78rem; margin-top: 0.3rem; }

textarea.form-input { resize: vertical; min-height: 85px; }

select.form-input, select.filter-select {
  appearance: none; cursor: pointer;
  border: 1px solid rgba(255,255,255,0.1);
  background-color: rgba(18, 24, 40, 0.85);
  color: var(--text); font-family: inherit; font-size: 0.85rem;
  border-radius: var(--radius-sm);
  transition: border-color 0.2s;
}

[dir="rtl"] select.form-input, [dir="rtl"] select.filter-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 0.8rem center;
  padding-left: 2rem; padding-right: 0.9rem;
}

[dir="ltr"] select.form-input, [dir="ltr"] select.filter-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  padding-right: 2rem; padding-left: 0.9rem;
}

select.filter-select { padding-top: 0.55rem; padding-bottom: 0.55rem; }
select.form-input:focus, select.filter-select:focus { outline: none; border-color: var(--accent); }

.form-row-flex { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.checkbox-label { display: flex; align-items: center; gap: 0.45rem; font-size: 0.85rem; color: var(--text-dim); cursor: pointer; }
.checkbox-label input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }
.link-accent { font-size: 0.85rem; color: var(--accent3); text-decoration: none; font-weight: 500; }
.link-accent:hover { text-decoration: underline; color: var(--text); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.65rem 1.25rem; border: none; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  color: #fff; font-family: inherit; font-size: 0.88rem; font-weight: 600;
  cursor: pointer; transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 15px var(--accent-glow);
  text-decoration: none;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(99,102,241,0.55);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary.btn-full { width: 100%; padding: 0.8rem; font-size: 0.95rem; }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.65rem 1.2rem; border: 1px solid rgba(255,255,255,0.12); border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.05); color: var(--text-dim);
  font-family: inherit; font-size: 0.88rem; font-weight: 500; cursor: pointer;
  transition: all 0.25s;
}
.btn-secondary:hover { background: rgba(255,255,255,0.1); color: var(--text); border-color: rgba(255,255,255,0.2); }

.btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.65rem 1.2rem; border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.15); color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35); font-family: inherit; font-size: 0.88rem; font-weight: 600;
  cursor: pointer; transition: all 0.25s;
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.28); color: #fff; box-shadow: 0 4px 15px var(--danger-glow); }

.btn-warning {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.65rem 1.2rem; border-radius: var(--radius-sm);
  background: rgba(245, 158, 11, 0.15); color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.35); font-family: inherit; font-size: 0.88rem; font-weight: 600;
  cursor: pointer; transition: all 0.25s;
}
.btn-warning:hover { background: rgba(245, 158, 11, 0.28); color: #fff; box-shadow: 0 4px 15px var(--warning-glow); }

.btn-icon {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 1.15rem; padding: 0.45rem; border-radius: 8px; transition: all 0.2s;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: rgba(255,255,255,0.08); color: var(--text); }

.btn-icon-sm {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 0.95rem; padding: 0.35rem; border-radius: 6px; transition: all 0.2s;
}
.btn-icon-sm:hover { background: rgba(255,255,255,0.1); color: var(--text); }

.btn-link {
  background: none; border: none; color: var(--accent3); font-family: inherit;
  font-size: 0.85rem; font-weight: 600; cursor: pointer; padding: 0;
  transition: color 0.2s;
}
.btn-link:hover { color: #fff; }

/* ============================================================
   APP SHELL
   ============================================================ */
.app-shell { display: flex; min-height: 100vh; }
.hidden { display: none !important; }

/* ============================================================
   SIDEBAR (RTL & LTR)
   ============================================================ */
.sidebar {
  position: fixed; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: rgba(8, 12, 23, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex; flex-direction: column;
  z-index: 200; transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

[dir="rtl"] .sidebar { right: 0; border-left: 1px solid var(--glass-border); }
[dir="ltr"] .sidebar { left: 0; border-right: 1px solid var(--glass-border); }

.sidebar.collapsed { width: var(--sidebar-collapsed-w); }
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .sidebar-logo-text,
.sidebar.collapsed .user-info { display: none; }
.sidebar.collapsed .sidebar-collapse-btn { transform: rotate(180deg); }
.sidebar.collapsed .nav-item { justify-content: center; padding: 0.75rem; margin: 0.2rem 0.4rem; }
.sidebar.collapsed .nav-icon { margin: 0; font-size: 1.15rem; }

.sidebar-logo {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 1.25rem 1.1rem;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}
.sidebar-logo-icon { font-size: 1.6rem; filter: drop-shadow(0 0 10px rgba(99,102,241,0.6)); flex-shrink: 0; }
.sidebar-logo-text { display: flex; flex-direction: column; }
.logo-brand { font-weight: 800; font-size: 1.1rem; color: var(--text); line-height: 1.2; letter-spacing: -0.3px; }
.logo-sub { font-size: 0.72rem; color: var(--text-muted); font-weight: 500; }

.sidebar-collapse-btn {
  background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border);
  color: var(--text-muted); width: 28px; height: 28px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  font-size: 1.1rem; transition: all 0.3s; flex-shrink: 0;
}
[dir="rtl"] .sidebar-collapse-btn { margin-right: auto; }
[dir="ltr"] .sidebar-collapse-btn { margin-left: auto; }
.sidebar-collapse-btn:hover { background: rgba(255,255,255,0.1); color: var(--text); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 0.85rem 0; }

.nav-section-label {
  padding: 0.65rem 1.25rem 0.3rem;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em;
  color: var(--text-muted); text-transform: uppercase;
}

.nav-item {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.68rem 1rem; margin: 0.15rem 0.6rem;
  border-radius: var(--radius-sm); cursor: pointer;
  color: var(--text-dim); font-size: 0.88rem; font-weight: 500;
  text-decoration: none; transition: all 0.2s; position: relative;
}
.nav-item:hover { background: var(--glass-hover); color: var(--text); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(99,102,241,0.22) 0%, rgba(139,92,246,0.14) 100%);
  color: #fff;
  border: 1px solid rgba(99,102,241,0.3);
  box-shadow: 0 4px 15px rgba(99,102,241,0.18);
  font-weight: 600;
}

[dir="rtl"] .nav-item.active::before {
  content: ''; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 3.5px; height: 60%; background: var(--accent); border-radius: 2px 0 0 2px;
}
[dir="ltr"] .nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3.5px; height: 60%; background: var(--accent); border-radius: 0 2px 2px 0;
}

.nav-icon { font-size: 1.05rem; flex-shrink: 0; }
.nav-label { flex: 1; }
.nav-badge {
  font-size: 0.7rem; font-weight: 700; padding: 0.18rem 0.5rem; border-radius: 99px;
  background: rgba(99,102,241,0.2); color: var(--accent3);
}
.nav-badge-warning { background: rgba(245,158,11,0.2); color: var(--warning); }
.nav-badge-danger { background: rgba(239,68,68,0.2); color: var(--danger); }

.sidebar-footer {
  padding: 0.85rem 0.75rem;
  border-top: 1px solid var(--glass-border);
}
.sidebar-user {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.55rem; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
}
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.95rem; color: #fff;
  box-shadow: 0 2px 8px var(--accent-glow);
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 0.88rem; font-weight: 700; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.72rem; color: var(--text-muted); display: block; }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  flex: 1; min-height: 100vh;
  display: flex; flex-direction: column;
  transition: margin 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

[dir="rtl"] .main-content { margin-right: var(--sidebar-w); }
[dir="ltr"] .main-content { margin-left: var(--sidebar-w); }

[dir="rtl"] body.sidebar-collapsed .main-content { margin-right: var(--sidebar-collapsed-w); }
[dir="ltr"] body.sidebar-collapsed .main-content { margin-left: var(--sidebar-collapsed-w); }

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  height: var(--topbar-h); display: flex; align-items: center;
  justify-content: space-between; padding: 0 1.75rem;
  background: rgba(8, 12, 23, 0.85); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky; top: 0; z-index: 100;
}
.topbar-right, .topbar-left { display: flex; align-items: center; gap: 0.85rem; }
.breadcrumb { display: flex; align-items: center; gap: 0.4rem; font-size: 0.88rem; color: var(--text-muted); }
.bc-sep { color: rgba(255,255,255,0.25); }
.lang-toggle { display: flex; background: rgba(255,255,255,0.06); border-radius: 8px; padding: 3px; gap: 3px; }
.lang-btn {
  padding: 0.3rem 0.65rem; border: none; border-radius: 5px;
  background: transparent; color: var(--text-muted); font-size: 0.78rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s; font-family: inherit;
}
.lang-btn.active {
  background: var(--accent); color: #fff;
  box-shadow: 0 2px 8px var(--accent-glow);
}
.topbar-notif { position: relative; }
.notif-dot {
  position: absolute; top: 5px; width: 8px; height: 8px;
  background: var(--danger); border-radius: 50%; border: 2px solid var(--bg);
}
[dir="rtl"] .notif-dot { left: 5px; }
[dir="ltr"] .notif-dot { right: 5px; }

.topbar-clock { font-size: 0.92rem; color: var(--text-dim); font-variant-numeric: tabular-nums; letter-spacing: 0.05em; font-weight: 600; }

/* ============================================================
   PAGES CONTAINER & HEADER
   ============================================================ */
.pages-container { flex: 1; padding: 1.75rem; overflow-y: auto; }
.page { display: none; animation: pageFade 0.35s cubic-bezier(0.16, 1, 0.3, 1); }
.page.active { display: block; }
@keyframes pageFade { from{opacity:0;transform:translateY(12px);}to{opacity:1;transform:translateY(0);} }

.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 1.75rem; flex-wrap: wrap; gap: 1rem;
}
.page-title { font-size: 1.65rem; font-weight: 800; color: var(--text); letter-spacing: -0.5px; }
.page-subtitle { font-size: 0.88rem; color: var(--text-muted); margin-top: 0.25rem; }
.page-actions { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }

/* ============================================================
   KPI CARDS
   ============================================================ */
.kpi-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.15rem;
  margin-bottom: 1.75rem;
}
@media(max-width:1200px){.kpi-grid{grid-template-columns:repeat(2,1fr);}}
@media(max-width:640px){.kpi-grid{grid-template-columns:1fr;}}

.kpi-card {
  padding: 1.35rem; display: flex; align-items: center; gap: 1.1rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.kpi-card:hover { transform: translateY(-4px); box-shadow: 0 15px 40px rgba(0,0,0,0.55); border-color: rgba(99,102,241,0.3); }

.kpi-icon {
  width: 56px; height: 56px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; flex-shrink: 0;
}
.kpi-icon-users  { background: rgba(99,102,241,0.18); color: #818cf8; }
.kpi-icon-devices{ background: rgba(139,92,246,0.18); color: #a78bfa; }
.kpi-icon-health { background: rgba(239,68,68,0.18); color: #f87171; }
.kpi-icon-active { background: rgba(16,185,129,0.18); color: #34d399; }

.kpi-value { font-size: 1.9rem; font-weight: 800; color: var(--text); line-height: 1.1; }
.kpi-label { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.25rem; font-weight: 500; }
.kpi-change { font-size: 0.76rem; margin-top: 0.35rem; font-weight: 700; }
.kpi-up     { color: var(--success); }
.kpi-down   { color: var(--danger); }
.kpi-neutral{ color: var(--text-muted); }

/* ============================================================
   CHARTS ROW
   ============================================================ */
.charts-row { display: grid; grid-template-columns: 1fr 340px; gap: 1.15rem; margin-bottom: 1.75rem; }
@media(max-width:1100px){.charts-row{grid-template-columns:1fr;}}

.chart-card { padding: 1.35rem; }
.chart-wide { grid-column: auto; }
.chart-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.1rem; flex-wrap: wrap; gap: 0.6rem; }
.chart-header h3 { font-size: 1rem; font-weight: 700; color: var(--text); }
.chart-legend { display: flex; align-items: center; gap: 0.85rem; font-size: 0.8rem; color: var(--text-muted); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.chart-legend-center { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 0.85rem; font-size: 0.82rem; color: var(--text-muted); }
.chart-legend-center div { display: flex; align-items: center; gap: 0.5rem; }

.chart-stats { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.stat-pill { font-size: 0.78rem; padding: 0.25rem 0.65rem; border-radius: 99px; background: rgba(99,102,241,0.16); color: var(--accent3); font-weight: 600; }
.stat-pill.stat-danger { background: rgba(239,68,68,0.16); color: var(--danger); }

.chart-tabs { display: flex; gap: 3px; background: rgba(255,255,255,0.06); border-radius: 7px; padding: 3px; }
.chart-tab { padding: 0.25rem 0.65rem; border: none; border-radius: 5px; background: transparent; color: var(--text-muted); font-family: inherit; font-size: 0.78rem; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.chart-tab.active { background: var(--accent); color: #fff; }

/* ============================================================
   DASHBOARD BOTTOM
   ============================================================ */
.dashboard-bottom { display: grid; grid-template-columns: 1fr 340px; gap: 1.15rem; }
@media(max-width:1100px){.dashboard-bottom{grid-template-columns:1fr;}}

.firebase-card { padding: 1.35rem; }
.firebase-status { display: flex; flex-direction: column; gap: 0.7rem; margin-bottom: 1.1rem; }
.fb-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.84rem; }
.fb-row > span:first-child { color: var(--text-muted); }
.fb-val { color: var(--text-dim); font-weight: 600; }
.firebase-usage-bar { margin-top: 0.85rem; }
.usage-label { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.4rem; font-weight: 600; }
.usage-track { height: 7px; background: rgba(255,255,255,0.08); border-radius: 99px; overflow: hidden; }
.usage-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 99px; transition: width 0.8s ease; }

/* ============================================================
   STATUS BADGES
   ============================================================ */
.status-badge { font-size: 0.74rem; padding: 0.22rem 0.65rem; border-radius: 99px; font-weight: 700; display: inline-flex; align-items: center; gap: 0.35rem; }
.status-online  { background: rgba(16,185,129,0.18); color: #34d399; }
.status-offline { background: rgba(100,116,139,0.18); color: var(--text-muted); }
.status-info    { background: rgba(59,130,246,0.18); color: #60a5fa; }
.status-active  { background: rgba(16,185,129,0.18); color: #34d399; }
.status-inactive{ background: rgba(100,116,139,0.18); color: var(--text-muted); }
.status-banned  { background: rgba(239,68,68,0.18); color: #f87171; }
.status-stable  { background: rgba(16,185,129,0.18); color: #34d399; }
.status-beta    { background: rgba(245,158,11,0.18); color: #fbbf24; }

/* ============================================================
   TABLES
   ============================================================ */
.table-card { padding: 0; overflow: hidden; }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid var(--glass-border);
}
.card-header h3 { font-size: 1rem; font-weight: 700; }

.table-responsive { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: start; }
.data-table thead tr { border-bottom: 1px solid var(--glass-border); }
.data-table th {
  padding: 0.85rem 1.1rem; font-size: 0.78rem; font-weight: 700;
  color: var(--text-muted); letter-spacing: 0.04em; white-space: nowrap;
  background: rgba(255,255,255,0.02);
}
[dir="rtl"] .data-table th, [dir="rtl"] .data-table td { text-align: right; }
[dir="ltr"] .data-table th, [dir="ltr"] .data-table td { text-align: left; }

.data-table th.sortable { cursor: pointer; user-select: none; }
.data-table th.sortable:hover { color: var(--text); }
.data-table td { padding: 0.85rem 1.1rem; font-size: 0.85rem; color: var(--text-dim); border-bottom: 1px solid rgba(255,255,255,0.04); vertical-align: middle; }
.data-table tbody tr:hover { background: rgba(255,255,255,0.035); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }

.table-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 1.35rem; font-size: 0.82rem; color: var(--text-muted);
  border-top: 1px solid var(--glass-border);
}

.pagination { display: flex; gap: 0.3rem; }
.pag-btn {
  padding: 0.35rem 0.7rem; border: 1px solid rgba(255,255,255,0.1); border-radius: 6px;
  background: rgba(255,255,255,0.04); color: var(--text-dim); font-size: 0.8rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.pag-btn:hover, .pag-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 2px 8px var(--accent-glow); }

/* ============================================================
   BATTERY BAR
   ============================================================ */
.battery-bar { display: flex; align-items: center; gap: 0.5rem; }
.battery-track { width: 56px; height: 8px; background: rgba(255,255,255,0.1); border-radius: 99px; overflow: hidden; }
.battery-fill { height: 100%; border-radius: 99px; }
.battery-label { font-size: 0.78rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
  display: flex; align-items: center; gap: 0.85rem; padding: 0.85rem 1.15rem;
  margin-bottom: 1.15rem; flex-wrap: wrap;
}
.search-wrapper { display: flex; align-items: center; gap: 0.6rem; flex: 1; min-width: 220px; }
.search-wrapper span { color: var(--text-muted); font-size: 1rem; }
.search-wrapper input { flex: 1; background: transparent; border: none; color: var(--text); font-family: inherit; font-size: 0.9rem; outline: none; }

/* ============================================================
   DEVICE MODEL CARDS
   ============================================================ */
.device-model-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.15rem; margin-bottom: 1.75rem; }
@media(max-width:960px){.device-model-cards{grid-template-columns:1fr 1fr;}}
@media(max-width:640px){.device-model-cards{grid-template-columns:1fr;}}

.model-card { padding: 1.6rem; display: flex; flex-direction: column; align-items: center; gap: 1.1rem; transition: all 0.25s; }
.model-card:hover { transform: translateY(-4px); box-shadow: 0 15px 40px rgba(0,0,0,0.5); }

.watch-preview-wrap { display: flex; justify-content: center; }
.wp-bezel-round { width: 86px; height: 86px; border-radius: 50%; border: 3px solid rgba(99,102,241,0.4); background: rgba(8,12,23,0.85); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 24px rgba(99,102,241,0.25); }
.wp-screen-round { width: 68px; height: 68px; border-radius: 50%; background: linear-gradient(135deg,#161c2c,#0b0f19); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.wp-bezel-square { width: 86px; height: 86px; border-radius: 16px; border: 3px solid rgba(139,92,246,0.4); background: rgba(8,12,23,0.85); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 24px rgba(139,92,246,0.25); }
.wp-screen-square { width: 68px; height: 68px; border-radius: 12px; background: linear-gradient(135deg,#161c2c,#0b0f19); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.wp-screen-round span, .wp-screen-square span { font-size: 0.62rem; color: #cbd5e1; font-weight: 700; }
.wp-screen-round small, .wp-screen-square small { font-size: 0.5rem; color: #64748b; }

.model-stats { text-align: center; }
.model-count { font-size: 2.1rem; font-weight: 800; color: var(--text); line-height: 1.1; }
.model-name { font-size: 0.95rem; font-weight: 700; color: var(--text-dim); }
.model-desc { font-size: 0.78rem; color: var(--text-muted); margin: 0.2rem 0; }
.model-online { font-size: 0.78rem; color: var(--success); display: flex; align-items: center; justify-content: center; gap: 0.45rem; margin-top: 0.35rem; font-weight: 600; }

.model-tx17 { border: 1px solid rgba(99,102,241,0.25); }
.model-tx10 { border: 1px solid rgba(139,92,246,0.25); }
.model-stats-card { justify-content: center; gap: 0.7rem; border: 1px solid var(--glass-border); }

.ms-row { display: flex; justify-content: space-between; width: 100%; font-size: 0.86rem; padding: 0.35rem 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.ms-row:last-child { border-bottom: none; }
.ms-row span { color: var(--text-muted); }

.dot-pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--success);
  box-shadow: 0 0 10px var(--success);
  animation: dotPulse 1.6s ease-in-out infinite;
  display: inline-block;
}
@keyframes dotPulse { 0%,100%{opacity:1; transform:scale(1);} 50%{opacity:0.4; transform:scale(0.8);} }

/* ============================================================
   HEALTH & ACTIVITY SECTIONS
   ============================================================ */
.health-kpi-grid, .activity-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.15rem; margin-bottom: 1.75rem; }
@media(max-width:1000px){.health-kpi-grid, .activity-kpis{grid-template-columns:repeat(2,1fr);}}
@media(max-width:540px){.health-kpi-grid, .activity-kpis{grid-template-columns:1fr;}}

.health-kpi { padding: 1.35rem; text-align: center; }
.health-kpi-icon { font-size: 2rem; margin-bottom: 0.4rem; }
.health-kpi-value { font-size: 1.9rem; font-weight: 800; color: var(--text); }
.health-kpi-value small { font-size: 1.05rem; font-weight: 500; color: var(--text-muted); }
.health-kpi-label { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.3rem; font-weight: 600; }
.health-heart  { border-top: 3px solid #ef4444; }
.health-oxygen { border-top: 3px solid #3b82f6; }
.health-bp     { border-top: 3px solid #f59e0b; }
.health-total  { border-top: 3px solid #6366f1; }

.activity-kpi { padding: 1.35rem; }
.act-icon { font-size: 2rem; margin-bottom: 0.4rem; }
.act-val { font-size: 1.75rem; font-weight: 800; color: var(--text); }
.act-val small { font-size: 0.95rem; font-weight: 500; color: var(--text-muted); }
.act-label { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.25rem; font-weight: 600; }
.act-avg { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.35rem; }

/* ============================================================
   WATCHFACES GALLERY
   ============================================================ */
.watchface-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1.25rem; }

.wf-card {
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--glass-border);
  background: rgba(13, 18, 32, 0.8);
  transition: all 0.25s ease; cursor: pointer;
}
.wf-card:hover { transform: translateY(-5px); box-shadow: 0 16px 45px rgba(0,0,0,0.6); border-color: rgba(99,102,241,0.4); }

.wf-preview {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.wf-preview-round { width: 118px; height: 118px; border-radius: 50%; border: 3px solid rgba(99,102,241,0.35); display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg,#1b2234,#0f1523); box-shadow: 0 0 20px rgba(0,0,0,0.5); }
.wf-preview-square { width: 108px; height: 108px; border-radius: 14px; border: 3px solid rgba(139,92,246,0.35); display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg,#1b2234,#0f1523); box-shadow: 0 0 20px rgba(0,0,0,0.5); }
.wf-preview-time { font-size: 1.15rem; font-weight: 800; color: #f1f5f9; display: block; line-height: 1.1; }
.wf-preview-date { font-size: 0.58rem; color: #64748b; display: block; margin-top: 0.15rem; }
.wf-preview-steps{ font-size: 0.54rem; color: #818cf8; display: block; margin-top: 0.25rem; font-weight: 600; }

.wf-preview-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.wf-preview-name { position: relative; z-index: 2; }
.wf-card-actions { display: flex; gap: 0.4rem; margin-top: 0.6rem; }
.wf-action-btn { flex: 1; padding: 0.32rem; font-size: 0.74rem; font-weight: 600; border-radius: 6px; border: none; cursor: pointer; font-family: inherit; background: rgba(99,102,241,0.18); color: var(--accent3); transition: all 0.2s; }
.wf-action-danger { background: rgba(239,68,68,0.18); color: #f87171; }
.wf-action-btn:hover { background: rgba(99,102,241,0.32); color: #fff; }
.wf-action-danger:hover { background: rgba(239,68,68,0.32); color: #fff; }

.wf-badge { position: absolute; top: 0.6rem; font-size: 0.65rem; padding: 0.2rem 0.5rem; border-radius: 99px; background: rgba(99,102,241,0.25); color: var(--accent3); font-weight: 700; }
[dir="rtl"] .wf-badge { right: 0.6rem; }
[dir="ltr"] .wf-badge { left: 0.6rem; }
.wf-badge-popular { background: rgba(245,158,11,0.25); color: #fbbf24; }

.wf-info { padding: 0.85rem; }
.wf-name { font-size: 0.9rem; font-weight: 700; color: var(--text); }
.wf-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 0.35rem; font-size: 0.76rem; color: var(--text-muted); }
.wf-installs { color: var(--accent3); font-weight: 600; }
.wf-actions { display: flex; gap: 0.4rem; margin-top: 0.65rem; }
.wf-actions button { flex: 1; padding: 0.35rem; font-size: 0.74rem; font-weight: 600; border-radius: 6px; border: none; cursor: pointer; font-family: inherit; transition: all 0.2s; }
.wf-btn-edit { background: rgba(99,102,241,0.18); color: var(--accent3); }
.wf-btn-del  { background: rgba(239,68,68,0.18); color: #f87171; }
.wf-btn-edit:hover { background: rgba(99,102,241,0.32); color: #fff; }
.wf-btn-del:hover  { background: rgba(239,68,68,0.32); color: #fff; }

.wf-model-tabs, .notif-type-tabs, .log-filter-tabs { display: flex; gap: 4px; }
.model-tab, .notif-tab, .log-tab {
  padding: 0.45rem 0.85rem; border: none; background: rgba(255,255,255,0.05); border-radius: 8px;
  color: var(--text-muted); font-family: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.model-tab.active, .notif-tab.active, .log-tab.active { background: var(--accent); color: #fff; box-shadow: 0 2px 8px var(--accent-glow); }
.model-tab:hover, .notif-tab:hover, .log-tab:hover { background: rgba(255,255,255,0.1); color: var(--text); }

.tab-count { font-size: 0.72rem; background: rgba(255,255,255,0.12); padding: 0.12rem 0.35rem; border-radius: 99px; margin-inline-start: 0.3rem; }

/* ============================================================
   FIRMWARE SECTION
   ============================================================ */
.fw-current-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.15rem; margin-bottom: 1.75rem; }
@media(max-width:960px){.fw-current-grid{grid-template-columns:1fr;}}

.fw-current-card { padding: 1.35rem; }
.fw-model-label { font-size: 0.82rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.5rem; }
.fw-version { font-size: 2.1rem; font-weight: 800; color: var(--text); line-height: 1.1; }
.fw-date { font-size: 0.8rem; color: var(--text-muted); margin: 0.35rem 0; }
.fw-stats { display: flex; justify-content: space-between; font-size: 0.82rem; margin: 0.6rem 0; font-weight: 600; }
.fw-up-pct { color: var(--success); }
.fw-pending-card { border: 1px solid rgba(245,158,11,0.3); }

/* ============================================================
   NOTIFICATIONS LIST
   ============================================================ */
.notifications-list { padding: 0; }
.notif-item {
  display: flex; align-items: flex-start; gap: 0.85rem;
  padding: 0.95rem 1.35rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.2s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: rgba(255,255,255,0.035); }
.notif-item.unread { background: rgba(99,102,241,0.05); }
.notif-icon-wrap { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.notif-social { background: rgba(59,130,246,0.18); }
.notif-call   { background: rgba(16,185,129,0.18); }
.notif-sms    { background: rgba(139,92,246,0.18); }
.notif-content { flex: 1; }
.notif-title { font-size: 0.88rem; font-weight: 700; color: var(--text); }
.notif-detail { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.18rem; }
.notif-time { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 0.35rem; flex-shrink: 0; box-shadow: 0 0 8px var(--accent); }

/* ============================================================
   BLE LOG TERMINAL
   ============================================================ */
.log-terminal {
  padding: 0.85rem; min-height: 420px; max-height: 600px; overflow-y: auto;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.8rem;
  background: rgba(4, 7, 14, 0.94); border: 1px solid rgba(255,255,255,0.06);
}
.log-entry {
  display: flex; gap: 0.85rem; padding: 0.3rem 0.4rem;
  border-radius: 4px; margin-bottom: 2px;
}
.log-entry:hover { background: rgba(255,255,255,0.04); }
.log-time { color: #64748b; flex-shrink: 0; min-width: 75px; }
.log-dir { flex-shrink: 0; min-width: 22px; font-weight: 700; }
.log-hex { color: #cbd5e1; flex: 1; word-break: break-all; }
.log-msg { color: #64748b; font-size: 0.74rem; }

.log-out .log-dir { color: #818cf8; }
.log-out .log-hex { color: #a5b4fc; }
.log-in  .log-dir { color: #34d399; }
.log-in  .log-hex { color: #6ee7b7; }
.log-error .log-dir { color: #f87171; }
.log-error .log-hex { color: #fca5a5; }

/* ============================================================
   SETTINGS
   ============================================================ */
.settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.15rem; }
@media(max-width:960px){.settings-grid{grid-template-columns:1fr;}}

.settings-section { padding: 1.6rem; }
.settings-header { display: flex; align-items: center; gap: 0.85rem; margin-bottom: 1.35rem; padding-bottom: 0.85rem; border-bottom: 1px solid var(--glass-border); }
.settings-header h3 { font-size: 1.05rem; font-weight: 700; }
.settings-icon { font-size: 1.4rem; }
.settings-body { display: flex; flex-direction: column; gap: 0.85rem; }

.toggle-group { display: flex; align-items: center; justify-content: space-between; padding: 0.45rem 0; }
.toggle-group label { font-size: 0.88rem; color: var(--text-dim); font-weight: 500; }
.toggle { width: 44px; height: 24px; border-radius: 99px; background: rgba(255,255,255,0.12); cursor: pointer; position: relative; transition: background 0.3s; }
.toggle::after { content: ''; position: absolute; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); }

[dir="rtl"] .toggle::after { right: 2px; }
[dir="rtl"] .toggle.active::after { transform: translateX(-20px); }

[dir="ltr"] .toggle::after { left: 2px; }
[dir="ltr"] .toggle.active::after { transform: translateX(20px); }

.toggle.active { background: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }

.sys-info-row { display: flex; justify-content: space-between; padding: 0.45rem 0; border-bottom: 1px solid rgba(255,255,255,0.04); font-size: 0.88rem; }
.sys-info-row:last-child { border-bottom: none; }
.sys-info-row > span:first-child { color: var(--text-muted); }
.sys-info-row > span:last-child { color: var(--text-dim); font-weight: 600; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0, 0, 0, 0.65); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.modal {
  width: 100%; max-width: 500px; max-height: 90vh;
  overflow-y: auto; animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  background: rgba(13, 18, 32, 0.98);
  border: 1px solid rgba(99, 102, 241, 0.3);
  box-shadow: 0 25px 65px rgba(0,0,0,0.7), var(--glow);
}
.modal-wide { max-width: 720px; }
@keyframes modalIn { from{opacity:0;transform:scale(0.94) translateY(10px);}to{opacity:1;transform:scale(1) translateY(0);} }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1.35rem; border-bottom: 1px solid var(--glass-border); }
.modal-header h3 { font-size: 1.1rem; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.2rem; padding: 0.25rem; border-radius: 6px; transition: all 0.2s; }
.modal-close:hover { background: rgba(255,255,255,0.1); color: var(--text); }
.modal-body { padding: 1.35rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: 0.6rem; padding: 1.1rem 1.35rem; border-top: 1px solid var(--glass-border); }
.modal-desc { color: var(--text-muted); font-size: 0.9rem; }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed; top: 1.25rem; z-index: 1000;
  display: flex; flex-direction: column; gap: 0.6rem;
  pointer-events: none;
}
[dir="rtl"] .toast-container { left: 1.25rem; }
[dir="ltr"] .toast-container { right: 1.25rem; }

.toast {
  padding: 0.85rem 1.35rem; border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.96); border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(16px); font-size: 0.88rem; color: var(--text); font-weight: 600;
  display: flex; align-items: center; gap: 0.65rem; min-width: 290px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.55);
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}
.toast.toast-success { border-color: rgba(16,185,129,0.4); box-shadow: 0 10px 30px var(--success-glow); }
.toast.toast-error   { border-color: rgba(239,68,68,0.4); box-shadow: 0 10px 30px var(--danger-glow); }
.toast.toast-warning { border-color: rgba(245,158,11,0.4); box-shadow: 0 10px 30px var(--warning-glow); }
.toast.toast-info    { border-color: rgba(99,102,241,0.4); box-shadow: 0 10px 30px var(--accent-glow); }

@keyframes toastIn { from{opacity:0;transform:translateY(-15px) scale(0.95);}to{opacity:1;transform:translateY(0) scale(1);} }
@keyframes toastOut { to{opacity:0;transform:translateY(-15px) scale(0.95);} }

/* ============================================================
   RESPONSIVE OVERRIDES
   ============================================================ */
/* Old 768px static rule neutralized: See mobile-responsive.css */
/*   .sidebar { width: var(--sidebar-collapsed-w); } */
/*   .sidebar .nav-label, .sidebar .nav-badge, .sidebar .nav-section-label, */
/*   .sidebar .sidebar-logo-text, .sidebar .user-info { display: none; } */
/*   .sidebar .nav-item { justify-content: center; padding: 0.75rem; margin: 0.2rem 0.4rem; } */
/*   [dir="rtl"] .main-content { margin-right: var(--sidebar-collapsed-w); } */
/*   [dir="ltr"] .main-content { margin-left: var(--sidebar-collapsed-w); } */
/*   .pages-container { padding: 1.15rem; } */
/*   .charts-row { grid-template-columns: 1fr; } */
/*   .dashboard-bottom { grid-template-columns: 1fr; } */
/*   .filter-bar { flex-direction: column; align-items: stretch; } */
/*   .search-wrapper { min-width: unset; } */
/* } */
/* ===== Temax added component styles ===== */
.text-center { text-align: center; }
.battery-mini { display: flex; align-items: center; gap: .5rem; }
.battery-mini .battery-track { flex: 1; max-width: 70px; height: 7px; background: rgba(255,255,255,.1); border-radius: 99px; overflow: hidden; }
.battery-mini .battery-fill { height: 100%; border-radius: 99px; }
.battery-mini span { font-size: .8rem; color: var(--text-muted); min-width: 34px; }

.user-cell { display: flex; align-items: center; gap: .6rem; }
.user-thumb { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(99,102,241,.5); }

.row-actions { display: flex; gap: .35rem; }

.status-warning { background: rgba(245,158,11,.15); color: #f59e0b; border: 1px solid rgba(245,158,11,.35); }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem 1.25rem; }
.detail-row { display: flex; justify-content: space-between; padding: .55rem .75rem; background: rgba(255,255,255,.03); border-radius: 10px; border: 1px solid rgba(255,255,255,.06); }
.detail-row span { color: var(--text-muted); }
.detail-row strong { color: var(--text); }

.notif-empty { padding: 2.5rem; text-align: center; color: var(--text-muted); }

.login-error { background: rgba(239,68,68,.15); border: 1px solid rgba(239,68,68,.4); color: #fecaca; padding: .7rem 1rem; border-radius: 12px; margin-bottom: 1rem; text-align: center; }

.wf-round { border-radius: 50% !important; aspect-ratio: 1; width: 120px; height: 120px; }
.wf-square { border-radius: 22px !important; width: 120px; height: 120px; }
.wf-preview { display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 30px rgba(0,0,0,.45); }
.wf-preview-name { font-weight: 700; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.5); font-size: 1rem; text-align: center; padding: .5rem; }
.wf-sub { color: var(--text-muted); font-size: .82rem; margin-top: .15rem; }

/* ===== Watchfaces per-device sections ===== */
.wf-section { padding: 1.25rem 1.4rem 1.6rem; margin-bottom: 1.6rem; }
.wf-section-note { color: var(--text-muted); font-size: .9rem; }
.wf-section-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.wf-section-icon { width: 46px; height: 46px; flex: 0 0 auto; background: linear-gradient(135deg, #6366f1, #8b5cf6); box-shadow: inset 0 0 14px rgba(0,0,0,.4); }
.wf-round-sm { border-radius: 50%; }
.wf-square-sm { border-radius: 12px; background: linear-gradient(135deg, #3b82f6, #14b8a6); }
.wf-section-titles { flex: 1; min-width: 200px; }
.wf-section-title { margin: 0; font-size: 1.15rem; font-weight: 700; color: var(--text); }
.wf-section-sub { margin: .2rem 0 0; font-size: .85rem; color: var(--text-muted); }
.wf-section-count { background: rgba(99,102,241,.15); color: #a5b4fc; border: 1px solid rgba(99,102,241,.35); padding: .35rem .8rem; border-radius: 99px; font-size: .85rem; font-weight: 600; }
.wf-empty { grid-column: 1 / -1; text-align: center; color: var(--text-muted); padding: 2rem; }

/* ===== Redesigned watchface cards (professional) ===== */
.wf-card {
  display: flex; flex-direction: column;
  border-radius: 18px; overflow: hidden;
  border: 1px solid var(--glass-border);
  background: rgba(13, 18, 32, 0.85);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  cursor: default;
}
.wf-card:hover { transform: translateY(-6px); box-shadow: 0 18px 50px rgba(0,0,0,.55); border-color: rgba(99,102,241,.5); }
.wf-inactive { opacity: .55; filter: grayscale(.25); }

.wf-thumb {
  position: relative; width: 100%; aspect-ratio: 1; overflow: hidden;
  display: grid; place-items: center;
}
.wf-thumb--round { border-radius: 50%; }
.wf-thumb--square { border-radius: 20px; }
.wf-thumb .wf-preview-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 1; transition: transform .4s ease;
}
.wf-card:hover .wf-preview-img { transform: scale(1.06); }

.wf-badge {
  position: absolute; z-index: 3; font-size: .66rem; font-weight: 700;
  padding: .22rem .55rem; border-radius: 99px;
  background: rgba(15,23,42,.6); border: 1px solid rgba(255,255,255,.14); color: #e2e8f0;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
[dir="rtl"] .wf-badge-model { top: .6rem; right: .6rem; }
[dir="ltr"] .wf-badge-model { top: .6rem; left: .6rem; }
[dir="rtl"] .wf-badge-cat { top: .6rem; left: .6rem; }
[dir="ltr"] .wf-badge-cat { top: .6rem; right: .6rem; }
.wf-badge-model { background: rgba(99,102,241,.4); color: #c7d2fe; border-color: rgba(129,140,248,.55); }

.wf-status {
  position: absolute; z-index: 3; bottom: .6rem; font-size: .64rem; font-weight: 700;
  padding: .2rem .5rem; border-radius: 99px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
[dir="rtl"] .wf-status { left: .6rem; }
[dir="ltr"] .wf-status { right: .6rem; }
.wf-status--on { background: rgba(16,185,129,.32); color: #6ee7b7; border: 1px solid rgba(16,185,129,.5); }
.wf-status--off { background: rgba(148,163,184,.3); color: #cbd5e1; border: 1px solid rgba(148,163,184,.45); }

.wf-thumb-overlay {
  position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; gap: .6rem;
  background: rgba(8,12,22,.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .25s ease;
}
.wf-card:hover .wf-thumb-overlay { opacity: 1; }
.wf-ico-btn {
  width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer;
  font-size: 1rem; display: grid; place-items: center; color: #fff;
  background: rgba(99,102,241,.85); transition: transform .15s ease, background .2s ease;
}
.wf-ico-btn:hover { transform: scale(1.1); background: #6366f1; }
.wf-ico-danger { background: rgba(239,68,68,.85); }
.wf-ico-danger:hover { background: #ef4444; }

.wf-body { padding: .85rem .9rem 1rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.wf-title-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.wf-name { font-size: .92rem; font-weight: 700; color: var(--text); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wf-version { flex: 0 0 auto; font-size: .68rem; font-weight: 700; color: #c7d2fe; background: rgba(99,102,241,.18); padding: .15rem .45rem; border-radius: 6px; }
.wf-stats { font-size: .76rem; color: var(--text-muted); }
.wf-installs { color: var(--accent3); font-weight: 600; }
.wf-install-btn {
  margin-top: auto; width: 100%; padding: .55rem; font-size: .82rem; font-weight: 700; font-family: inherit;
  border: none; border-radius: 10px; cursor: pointer; color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6); transition: filter .2s ease, transform .15s ease;
}
.wf-install-btn:hover { filter: brightness(1.12); transform: translateY(-1px); }

/* ===================== Safe Area (notch / status bar) ===================== */
.sidebar {
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
.topbar {
  top: env(safe-area-inset-top);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
.main-content {
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* ===================== Page preloader (masks reload flash) ===================== */
.page-preloader {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg, #0b0e1a);
  transition: opacity .3s ease;
}
.page-preloader.hide { opacity: 0; pointer-events: none; }
.preloader-spinner {
  width: 46px; height: 46px; border-radius: 50%;
  border: 4px solid rgba(255,255,255,.15);
  border-top-color: var(--accent, #6366f1);
  animation: preloader-spin .8s linear infinite;
}
@keyframes preloader-spin { to { transform: rotate(360deg); } }

/* ===================== Button loading state ===================== */
.btn-primary.btn-loading { opacity: .75; pointer-events: none; position: relative; }
.btn-primary.btn-loading span { visibility: hidden; }
.btn-primary.btn-loading::after {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border: 2px solid rgba(255,255,255,.5); border-top-color: #fff;
  border-radius: 50%; animation: preloader-spin .7s linear infinite;
}

/* ===================== Upload progress bar ===================== */
.wf-progress {
  height: 12px; background: rgba(255,255,255,.10);
  border-radius: 999px; overflow: hidden; margin-top: 14px;
}
.wf-progress.hidden { display: none; }
.wf-progress-bar {
  height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  transition: width .15s ease;
}
.wf-progress-text {
  text-align: center; font-size: 12px; margin-top: 6px;
  color: var(--text-muted, #94a3b8); font-variant-numeric: tabular-nums;
}
.wf-progress-text.hidden { display: none; }


/* ===================== Banners ===================== */
.banner-filter-tabs { display: flex; gap: .5rem; flex-wrap: wrap; }
.banner-tab {
  padding: .5rem 1rem; border-radius: 999px; border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04); color: var(--text-muted, #94a3b8);
  font-family: inherit; font-size: 13px; cursor: pointer;
}
.banner-tab.active { background: linear-gradient(90deg,#6366f1,#8b5cf6); color: #fff; border-color: transparent; }
.banner-drag-hint { font-size: 12px; color: var(--text-muted, #94a3b8); margin-right: auto; }

.banner-card {
  border-radius: 16px; overflow: hidden; cursor: grab;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.banner-card.dragging { opacity: .55; transform: scale(.97); cursor: grabbing; box-shadow: 0 12px 30px rgba(0,0,0,.4); }
.banner-card.banner-inactive { opacity: .6; }
.banner-thumb {
  position: relative; height: 150px; border-radius: 12px 12px 0 0; overflow: hidden;
}
.banner-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.banner-order-badge {
  position: absolute; top: 8px; right: 8px; min-width: 26px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.6); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 999px; padding: 0 8px; backdrop-filter: blur(4px);
}
.banner-thumb-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  opacity: 0; transition: opacity .2s ease;
}
.banner-card:hover .banner-thumb-overlay { opacity: 1; }
.banner-body { padding: 12px 14px; }
.banner-title { font-size: 14px; font-weight: 700; margin: 0 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.banner-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.banner-badge {
  font-size: 11px; padding: 3px 8px; border-radius: 999px; font-weight: 600;
  background: rgba(255,255,255,.08); color: var(--text-muted, #94a3b8);
}
.badge-loc { background: rgba(99,102,241,.18); color: #a5b4fc; }
.badge-loc.badge-health { background: rgba(239,68,68,.18); color: #fca5a5; }
.badge-target { background: rgba(16,185,129,.15); color: #6ee7b7; }
.banner-empty {
  width: 100%; text-align: center; color: var(--text-muted, #94a3b8);
  padding: 3rem; font-size: 14px;
}
.banner-preview-wrap { margin-top: 10px; }
.banner-preview-img { width: 100%; max-height: 180px; object-fit: cover; border-radius: 10px; border: 1px solid rgba(255,255,255,.10); }
.banner-dim-hint { font-size: 12px; color: var(--text-muted, #94a3b8); background: rgba(255,255,255,.05); padding: 8px 10px; border-radius: 8px; }
.modal-progress { padding: 0 24px; }
.modal-progress.hidden { display: none; }
.modal-progress .progress-track { height: 10px; background: rgba(255,255,255,.10); border-radius: 999px; overflow: hidden; }
.modal-progress .progress-bar { height: 100%; background: linear-gradient(90deg,#6366f1,#8b5cf6); border-radius: 999px; transition: width .15s ease; }
.modal-progress .progress-text { text-align: center; font-size: 12px; margin-top: 6px; color: var(--text-muted,#94a3b8); }

/* ==================== FITNESS PLAN ENHANCED STYLES ==================== */
.fp-card {
  position: relative;
  width: 320px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: none;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  display: flex;
  flex-direction: column;

}
.fp-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px -4px rgba(0, 0, 0, 0.6), 0 0 24px var(--fp-glow, rgba(225, 29, 72, 0.25));
  border-color: rgba(255, 255, 255, 0.25);
}
.fp-card.banner-inactive {
  opacity: .55;
  filter: grayscale(0.4);
}
.fp-banner-preview {
  position: relative;
  height: 130px;
  padding: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 20px 20px 0 0;
}
.fp-banner-bg-orb {
  position: absolute;
  top: -25px;
  left: -25px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
}
.fp-banner-img {
  position: absolute;
  right: -5px;
  top: 0;
  bottom: 0;
  width: 150px;
  height: 100%;
  object-fit: cover;
  mask-image: linear-gradient(to right, transparent, black 40%);
  -webkit-mask-image: linear-gradient(to right, transparent, black 40%);
  pointer-events: none;
}
.fp-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fff;
  width: fit-content;
  backdrop-filter: blur(6px);
}
.fp-content-title {
  font-size: 16px;
  font-weight: 900;
  color: #fff;
  line-height: 1.2;
  margin: 0 0 4px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.6);
  max-width: 190px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fp-content-sub {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  max-width: 190px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fp-action-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  width: fit-content;
}
.fp-footer-bar {
  padding: 10px 14px;
  background: rgba(10, 15, 28, 0.9);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.fp-meta-tags {
  display: flex;
  align-items: center;
  gap: 6px;
}
.fp-actions-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Color Presets */
.fp-presets-wrap {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.fp-preset-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease;
  outline: none;
}
.fp-preset-btn:hover, .fp-preset-btn.active {
  transform: scale(1.18);
  border-color: #fff;
  box-shadow: 0 0 10px rgba(255,255,255,0.4);
}

/* Live Mobile Simulator in Modal */
.fp-live-preview-box {
  background: #020617;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 14px;
  margin-bottom: 18px;
}
.fp-live-preview-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #94a3b8;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Position picker buttons */
.fp-pos-btn {
  padding: 5px 6px;
  font-size: 13px;
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 7px;
  color: #94a3b8;
  cursor: pointer;
  transition: all .15s ease;
  text-align: center;
  line-height: 1;
  user-select: none;
}
.fp-pos-btn:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-color: rgba(255,255,255,0.3);
}
.fp-pos-btn.fp-pos-active {
  background: rgba(225, 29, 72, 0.28);
  border-color: #E11D48;
  color: #fff;
  box-shadow: 0 0 8px rgba(225,29,72,0.35);
}
/* Text alignment position buttons (horizontal row) */
.fp-align-btn {
  flex: 1;
  padding: 7px 10px;
  font-size: 15px;
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: #94a3b8;
  cursor: pointer;
  transition: all .15s ease;
  text-align: center;
}
.fp-align-btn:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.fp-align-btn.fp-pos-active {
  background: rgba(225, 29, 72, 0.28);
  border-color: #E11D48;
  color: #fff;
  box-shadow: 0 0 8px rgba(225,29,72,0.35);
}



/* ============================================================
   ADMIN PUSH NOTIFICATIONS PAGE (admin/notifications)
   ============================================================ */
.notif-page { padding: 1.5rem 2rem 3rem; max-width: 1240px; margin: 0 auto; }

/* ---- Hero header ---- */
.notif-hero {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 1.25rem; padding: 1.5rem 1.75rem;
  border-radius: var(--radius); border: 1px solid var(--glass-border);
  background:
    radial-gradient(ellipse 60% 120% at 90% 0%, rgba(99,102,241,0.18) 0%, transparent 60%),
    radial-gradient(ellipse 50% 120% at 10% 100%, rgba(16,185,129,0.10) 0%, transparent 55%),
    var(--surface);
  backdrop-filter: blur(20px);
}
.notif-topbar { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.notif-heading { font-size: 1.55rem; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: .6rem; margin-bottom: .3rem; }
.notif-heading-icon {
  width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); box-shadow: 0 6px 18px var(--accent-glow); font-size: 1.25rem;
}
.notif-heading-sub { color: var(--text-muted); font-size: .92rem; }

/* ---- Alerts ---- */
.notif-alert { margin-bottom: 1rem; padding: .85rem 1.1rem; border-radius: var(--radius-sm); font-size: .92rem; display: flex; align-items: center; gap: .6rem; }
.alert-success { background: var(--success-glow); border: 1px solid rgba(16,185,129,.4); color: #a7f3d0; }
.alert-danger { background: var(--danger-glow); border: 1px solid rgba(239,68,68,.4); color: #fecaca; }

/* ---- Stats ---- */
.notif-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
@media (max-width: 900px) { .notif-stats { grid-template-columns: repeat(2, 1fr); } }
.notif-stat {
  display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem;
  background: var(--surface); border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
}
.notif-stat-ico { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.notif-stat-ico--fcm  { background: linear-gradient(135deg, rgba(59,130,246,.25), rgba(59,130,246,.05)); border: 1px solid rgba(59,130,246,.35); }
.notif-stat-ico--all  { background: linear-gradient(135deg, rgba(99,102,241,.25), rgba(99,102,241,.05)); border: 1px solid rgba(99,102,241,.35); }
.notif-stat-ico--sent { background: linear-gradient(135deg, rgba(139,92,246,.25), rgba(139,92,246,.05)); border: 1px solid rgba(139,92,246,.35); }
.notif-stat-ico--ok   { background: linear-gradient(135deg, rgba(16,185,129,.25), rgba(16,185,129,.05)); border: 1px solid rgba(16,185,129,.35); }
.notif-stat-ico--list { background: linear-gradient(135deg, rgba(245,158,11,.25), rgba(245,158,11,.05)); border: 1px solid rgba(245,158,11,.35); }
.notif-stat-num { font-size: 1.45rem; font-weight: 800; color: var(--text); line-height: 1.1; }
.notif-stat-label { font-size: .78rem; color: var(--text-muted); }

/* ---- Layout ---- */
.notif-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 1.5rem; align-items: start; }
@media (max-width: 900px) { .notif-grid { grid-template-columns: 1fr; } }
.notif-card { padding: 1.5rem; }
.notif-card .card-header { margin-bottom: 1.25rem; display: flex; align-items: center; justify-content: space-between; }
.card-header-title { display: flex; align-items: center; gap: .6rem; font-weight: 700; color: var(--text); }
.card-header-ico { width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; background: var(--glass); border: 1px solid var(--glass-border); }
.card-header-em { font-style: normal; font-size: .78rem; font-weight: 500; color: var(--text-muted); }

/* ---- Form ---- */
.notif-form { display: flex; flex-direction: column; gap: 1.1rem; }
.notif-field { display: flex; flex-direction: column; gap: .45rem; }
.notif-label { font-size: .85rem; font-weight: 600; color: var(--text-dim); }
.notif-label .req { color: var(--danger); }
.notif-input-wrap { position: relative; display: flex; }
.notif-input {
  width: 100%; background: var(--surface2); border: 1px solid var(--glass-border); color: var(--text);
  border-radius: var(--radius-sm); padding: .75rem .95rem; font-size: .92rem; font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
}
.notif-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.notif-textarea { resize: vertical; min-height: 100px; }
.notif-counter { position: absolute; top: .85rem; left: .8rem; font-size: .72rem; color: var(--text-muted); background: rgba(15,23,42,.6); padding: .1rem .45rem; border-radius: 6px; direction: ltr; }
.notif-select { appearance: none; }

/* ---- Target cards ---- */
.notif-target-cards { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }
@media (max-width: 480px) { .notif-target-cards { grid-template-columns: 1fr; } }
.notif-target-card {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .25rem;
  padding: 1.1rem .9rem; border-radius: var(--radius-sm); cursor: pointer;
  background: var(--surface2); border: 1.5px solid var(--glass-border);
  transition: border-color .2s, background .2s, transform .15s;
}
.notif-target-card:hover { background: rgba(255,255,255,.05); }
.notif-target-card.is-active { border-color: var(--accent); background: rgba(99,102,241,.12); box-shadow: 0 0 0 3px var(--accent-glow); }
.notif-target-card input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.ntc-ico { font-size: 1.5rem; margin-bottom: .25rem; }
.ntc-title { font-weight: 700; color: var(--text); font-size: .92rem; }
.ntc-sub { font-size: .75rem; color: var(--text-muted); }
.notif-target-card.is-active .ntc-sub { color: var(--accent3); }

/* ---- Single device panel ---- */
.notif-single-panel { padding: 1rem; border-radius: var(--radius-sm); background: var(--surface2); border: 1px solid var(--glass-border); }
.notif-divider { text-align: center; color: var(--text-muted); font-size: .78rem; margin: .55rem 0; }

/* ---- Send button ---- */
.notif-send-btn { margin-top: .25rem; position: relative; overflow: hidden; }
.notif-send-spinner { display: none; }

/* ---- History filter tabs ---- */
.notif-filter-tabs { display: flex; gap: .5rem; margin-bottom: 1rem; }
.notif-filter-tab {
  display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .9rem; border-radius: 99px; cursor: pointer;
  background: var(--surface2); border: 1px solid var(--glass-border); color: var(--text-dim); font-size: .82rem; font-family: inherit;
  transition: all .2s;
}
.notif-filter-tab b { background: rgba(255,255,255,.1); border-radius: 99px; padding: 0 .45rem; font-size: .72rem; }
.notif-filter-tab.is-active { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 2px 10px var(--accent-glow); }
.notif-filter-tab.is-active b { background: rgba(255,255,255,.18); }

/* ---- History list ---- */
.notif-history { display: flex; flex-direction: column; gap: .85rem; max-height: 620px; overflow-y: auto; padding-left: 4px; }
.notif-item {
  display: flex; gap: .85rem; position: relative; overflow: hidden;
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
  transition: border-color .2s;
}
.notif-item:hover { border-color: rgba(255,255,255,.16); }
.notif-item-rail { width: 4px; flex-shrink: 0; }
.rail-ok { background: linear-gradient(var(--success), transparent); }
.rail-fail { background: linear-gradient(var(--danger), transparent); }
.notif-item-content { flex: 1; padding: .9rem 0 .9rem .9rem; }
.notif-item-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; margin-bottom: .3rem; }
.notif-item-title { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.notif-item-title strong { color: var(--text); font-size: .95rem; }
.notif-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-ok { background: var(--success); box-shadow: 0 0 8px var(--success-glow); }
.dot-fail { background: var(--danger); box-shadow: 0 0 8px var(--danger-glow); }
.notif-item-date { display: inline-flex; align-items: center; gap: .3rem; font-size: .73rem; color: var(--text-muted); white-space: nowrap; }
.notif-item-date .nic { width: 13px; height: 13px; }
.notif-item-body { color: var(--text-dim); font-size: .88rem; margin-bottom: .65rem; }
.notif-item-meta { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; }
.notif-tag {
  display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; padding: .26rem .65rem; border-radius: 99px;
  background: var(--surface2); color: var(--text-dim); border: 1px solid var(--glass-border);
}
.tag-ico { font-size: .8rem; }
.notif-tag-ok { background: var(--success-glow); color: #a7f3d0; border-color: rgba(16,185,129,.4); }
.notif-tag-err { background: var(--danger-glow); color: #fecaca; border-color: rgba(239,68,68,.4); }
.notif-device-id { font-size: .72rem; color: var(--accent3); background: rgba(99,102,241,.12); padding: .18rem .5rem; border-radius: 6px; direction: ltr; }

/* ---- Empty ---- */
.notif-empty { text-align: center; color: var(--text-muted); padding: 3rem 1rem; }
.notif-empty-ico { font-size: 2.6rem; margin-bottom: .5rem; }
.notif-empty p { font-size: 1rem; font-weight: 600; color: var(--text-dim); }
.notif-empty span { font-size: .82rem; }
