/* ============================================================
   MikroTik Monitor Pro — Complete Design System
   Dark Mode · Glassmorphism · RTL · v2.0
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;900&family=Inter:wght@300;400;600;700&family=JetBrains+Mono:wght@400;600&display=swap');

/* ─── CSS Variables ─────────────────────────────────────── */
:root {
  --bg-primary:    #050d1a;
  --bg-secondary:  #0a1628;
  --bg-card:       rgba(10, 22, 40, 0.88);
  --bg-glass:      rgba(255, 255, 255, 0.04);
  --bg-glass-hover:rgba(255, 255, 255, 0.08);

  --accent-blue:   #00c2ff;
  --accent-green:  #00ff88;
  --accent-purple: #a855f7;
  --accent-orange: #f97316;
  --accent-red:    #ff4757;
  --accent-yellow: #fbbf24;

  --text-primary:  #e8f4ff;
  --text-secondary:#8fafc7;
  --text-muted:    #4a6785;

  --border-color:  rgba(0, 194, 255, 0.12);
  --border-glow:   rgba(0, 194, 255, 0.4);

  --gradient-blue: linear-gradient(135deg, #00c2ff, #0066ff);
  --gradient-green:linear-gradient(135deg, #00ff88, #00c27a);

  --shadow-card:   0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow:   0 0 20px rgba(0, 194, 255, 0.3);
  --shadow-green:  0 0 20px rgba(0, 255, 136, 0.3);

  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --radius-xl:  28px;

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-ar:   'Cairo', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --sidebar-width: 260px;
  --header-height: 64px;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-ar);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  direction: rtl;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 20%, rgba(0, 194, 255, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(168, 85, 247, 0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

a  { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ─── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar        { width: 5px; height: 5px; }
::-webkit-scrollbar-track  { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb  { background: var(--border-color); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-blue); }

/* ─── Layout Shell ──────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ─── Sidebar ───────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(5, 13, 26, 0.97);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  transition: var(--transition);
}

.sidebar-logo {
  padding: 22px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo .logo-icon {
  width: 42px; height: 42px;
  background: var(--gradient-blue);
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-glow);
  flex-shrink: 0;
}

.sidebar-logo .logo-text h2 { font-size: 13px; font-weight: 700; }
.sidebar-logo .logo-text span { font-size: 11px; color: var(--accent-blue); }

.sidebar-nav { flex: 1; padding: 14px 10px; overflow-y: auto; }

.nav-section-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 12px 8px 5px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 1px;
  position: relative;
  cursor: pointer;
}

.nav-item:hover  { background: var(--bg-glass-hover); color: var(--text-primary); }

.nav-item.active {
  background: rgba(0, 194, 255, 0.12);
  color: var(--accent-blue);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--accent-blue);
  border-radius: 2px 0 0 2px;
}

.nav-icon { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; }

.nav-badge {
  margin-right: auto;
  background: var(--accent-red);
  color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 18px; text-align: center;
}

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

.user-profile {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: var(--radius-md);
  background: var(--bg-glass); cursor: pointer;
  transition: var(--transition);
}
.user-profile:hover { background: var(--bg-glass-hover); }

.user-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--gradient-blue); display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.user-info h4   { font-size: 12px; font-weight: 600; }
.user-info span { font-size: 11px; color: var(--text-muted); }

/* ─── Main Content ──────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-right: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─── Top Header ────────────────────────────────────────── */
.top-header {
  height: var(--header-height);
  background: rgba(5, 13, 26, 0.92);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(20px);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px;
  position: sticky; top: 0; z-index: 50;
}

.header-title h1 { font-size: 17px; font-weight: 700; }
.header-title p  { font-size: 11px; color: var(--text-muted); }

.header-actions { display: flex; align-items: center; gap: 10px; }

.header-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; color: var(--text-secondary);
  transition: var(--transition);
  position: relative;
}
.header-btn:hover { background: var(--bg-glass-hover); border-color: var(--accent-blue); color: var(--accent-blue); }

.header-btn .badge {
  position: absolute; top: -4px; left: -4px;
  width: 16px; height: 16px;
  background: var(--accent-red); border-radius: 50%;
  font-size: 9px; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}

.connection-status {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 13px;
  background: rgba(0, 255, 136, 0.08);
  border: 1px solid rgba(0, 255, 136, 0.2);
  border-radius: 20px;
  font-size: 12px; color: var(--accent-green);
  font-weight: 600;
}

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  animation: pulse 2s infinite;
}

/* ─── Page Content ──────────────────────────────────────── */
.page-content { flex: 1; padding: 26px; }

/* ─── Stats Grid ────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 18px;
  margin-bottom: 26px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex; align-items: center; gap: 15px;
  transition: var(--transition);
  backdrop-filter: blur(10px);
  position: relative; overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 100%; height: 2px;
  background: var(--gradient-blue);
  opacity: 0.6;
}

.stat-card:hover { border-color: var(--border-glow); box-shadow: var(--shadow-glow); transform: translateY(-2px); }
.stat-card.green::before  { background: var(--gradient-green); }
.stat-card.green:hover    { box-shadow: var(--shadow-green); border-color: rgba(0,255,136,0.4); }
.stat-card.purple::before { background: linear-gradient(135deg,#a855f7,#7c3aed); }
.stat-card.orange::before { background: linear-gradient(135deg,#f97316,#ef4444); }

.stat-icon {
  width: 50px; height: 50px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
  background: rgba(0, 194, 255, 0.1);
}
.stat-card.green .stat-icon  { background: rgba(0,255,136,0.1); }
.stat-card.purple .stat-icon { background: rgba(168,85,247,0.1); }
.stat-card.orange .stat-icon { background: rgba(249,115,22,0.1); }

.stat-info h3  { font-size: 26px; font-weight: 700; line-height: 1; }
.stat-info p   { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

.stat-trend            { font-size: 11px; font-weight: 600; margin-top: 4px; display: flex; align-items: center; gap: 3px; }
.stat-trend.up         { color: var(--accent-green); }
.stat-trend.down       { color: var(--accent-red); }

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

.device-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: var(--transition);
  backdrop-filter: blur(10px);
}

.device-card:hover         { border-color: var(--border-glow); box-shadow: var(--shadow-glow); transform: translateY(-3px); }
.device-card.offline       { border-color: rgba(255,71,87,0.3); }
.device-card.offline:hover { box-shadow: 0 0 20px rgba(255,71,87,0.2); }

.device-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }

.device-info h3           { font-size: 14px; font-weight: 700; }
.device-info .device-ip   { font-family: var(--font-mono); font-size: 11px; color: var(--accent-blue); margin-top: 3px; }
.device-info .device-model{ font-size: 10px; color: var(--text-muted); margin-top: 2px; }

.device-status-badge       { display: flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.device-status-badge.online  { background: rgba(0,255,136,0.1); color: var(--accent-green); border: 1px solid rgba(0,255,136,0.2); }
.device-status-badge.warning { background: rgba(251,191,36,0.1); color: var(--accent-yellow); border: 1px solid rgba(251,191,36,0.2); }
.device-status-badge.offline { background: rgba(255,71,87,0.1);  color: var(--accent-red);   border: 1px solid rgba(255,71,87,0.2); }
.device-status-badge .dot   { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.device-status-badge.online .dot { animation: pulse 2s infinite; }

.device-metrics { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 12px; }

.metric-item   { background: var(--bg-glass); border-radius: var(--radius-sm); padding: 9px 7px; text-align: center; }
.metric-label  { font-size: 9px; color: var(--text-muted); margin-bottom: 3px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.metric-value  { font-size: 17px; font-weight: 700; font-family: var(--font-mono); }
.metric-value.normal  { color: var(--accent-green); }
.metric-value.warning { color: var(--accent-yellow); }
.metric-value.danger  { color: var(--accent-red); }

/* ─── Progress Bars ─────────────────────────────────────── */
.progress-bar-wrap { display: flex; flex-direction: column; gap: 7px; }

.progress-item        { display: flex; align-items: center; gap: 8px; }
.progress-label       { font-size: 10px; color: var(--text-secondary); width: 32px; flex-shrink: 0; }
.progress-track       { flex: 1; height: 4px; background: rgba(255,255,255,0.06); border-radius: 10px; overflow: hidden; }
.progress-fill        { height: 100%; border-radius: 10px; transition: width 1s ease; }
.progress-fill.cpu    { background: var(--gradient-blue); }
.progress-fill.ram    { background: linear-gradient(90deg,#a855f7,#7c3aed); }
.progress-fill.disk   { background: linear-gradient(90deg,#f97316,#ef4444); }
.progress-pct         { font-size: 10px; font-family: var(--font-mono); color: var(--text-secondary); width: 28px; text-align: left; flex-shrink: 0; }

.device-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px; padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

.uptime-info { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }

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

.icon-btn {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--text-secondary);
  transition: var(--transition); cursor: pointer;
}
.icon-btn:hover { background: rgba(0,194,255,0.1); border-color: var(--accent-blue); color: var(--accent-blue); }

/* ─── Bandwidth Display ──────────────────────────────────── */
.bandwidth-display { display: flex; gap: 12px; }

.bw-item  { flex: 1; background: var(--bg-glass); border-radius: var(--radius-md); padding: 10px; text-align: center; }
.bw-label { font-size: 10px; color: var(--text-muted); font-weight: 600; margin-bottom: 5px; }
.bw-value { font-size: 16px; font-weight: 700; font-family: var(--font-mono); }
.bw-value.up   { color: var(--accent-green); }
.bw-value.down { color: var(--accent-blue); }

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

.section-title { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.title-icon    { font-size: 19px; }

/* ─── Charts ────────────────────────────────────────────── */
.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  backdrop-filter: blur(10px);
  margin-bottom: 22px;
}

.chart-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.chart-title  { font-size: 14px; font-weight: 700; }

.chart-legend { display: flex; gap: 14px; }
.legend-item  { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-secondary); }
.legend-dot   { width: 7px; height: 7px; border-radius: 50%; }

/* ─── Table ─────────────────────────────────────────────── */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: blur(10px);
}

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

.data-table { width: 100%; border-collapse: collapse; }

.data-table th {
  padding: 11px 20px;
  font-size: 10px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .8px;
  text-align: right;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 13px 20px;
  font-size: 13px; color: var(--text-secondary);
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: background .15s;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--bg-glass); color: var(--text-primary); }

/* ─── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 13px; font-weight: 600;
  font-family: var(--font-ar);
  transition: var(--transition);
  cursor: pointer; border: none;
}

.btn-primary   { background: var(--gradient-blue); color: #fff; box-shadow: 0 4px 15px rgba(0,194,255,0.3); }
.btn-primary:hover   { box-shadow: 0 6px 25px rgba(0,194,255,0.5); transform: translateY(-1px); }
.btn-secondary { background: var(--bg-glass); color: var(--text-secondary); border: 1px solid var(--border-color); }
.btn-secondary:hover { background: var(--bg-glass-hover); color: var(--text-primary); border-color: var(--border-glow); }
.btn-danger    { background: rgba(255,71,87,0.15); color: var(--accent-red); border: 1px solid rgba(255,71,87,0.3); }
.btn-danger:hover    { background: rgba(255,71,87,0.25); }

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

/* ─── Badges ────────────────────────────────────────────── */
.badge         { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge-success { background: rgba(0,255,136,0.12); color: var(--accent-green); }
.badge-danger  { background: rgba(255,71,87,0.12);  color: var(--accent-red); }
.badge-warning { background: rgba(251,191,36,0.12); color: var(--accent-yellow); }
.badge-info    { background: rgba(0,194,255,0.12);  color: var(--accent-blue); }
.badge-purple  { background: rgba(168,85,247,0.12); color: var(--accent-purple); }
/* Aliases from old system */
.badge-online  { background: rgba(0,255,136,0.12); color: var(--accent-green); }
.badge-offline { background: rgba(255,71,87,0.12);  color: var(--accent-red); }

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

.alert-item {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}
.alert-item:hover { background: var(--bg-glass-hover); }

.alert-item.danger  { border-color: rgba(255,71,87,0.3);  background: rgba(255,71,87,0.06); }
.alert-item.warning { border-color: rgba(251,191,36,0.3); background: rgba(251,191,36,0.06); }
.alert-item.info    { border-color: rgba(0,194,255,0.3);  background: rgba(0,194,255,0.06); }
.alert-item.success { border-color: rgba(0,255,136,0.3);  background: rgba(0,255,136,0.06); }

.alert-icon { font-size: 19px; flex-shrink: 0; margin-top: 2px; }
.alert-body { flex: 1; }
.alert-body h4 { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.alert-body p  { font-size: 12px; color: var(--text-secondary); }
.alert-time    { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

/* ─── Form Elements ─────────────────────────────────────── */
.form-group  { margin-bottom: 16px; }
.form-label  { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 7px; }

.form-control {
  width: 100%;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 13px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-ar);
  transition: var(--transition);
  direction: rtl;
}
.form-control:focus      { outline: none; border-color: var(--accent-blue); box-shadow: 0 0 0 3px rgba(0,194,255,0.1); }
.form-control::placeholder { color: var(--text-muted); }

/* ─── Modal ─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .3s;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 30px;
  width: 90%; max-width: 480px;
  transform: scale(.9) translateY(20px);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.modal-overlay.active .modal { transform: scale(1) translateY(0); }

.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.modal-title  { font-size: 17px; font-weight: 700; }

.modal-close {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--text-secondary);
  cursor: pointer; transition: var(--transition);
}
.modal-close:hover { background: rgba(255,71,87,0.1); border-color: var(--accent-red); color: var(--accent-red); }

/* ─── Login Page ────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-primary);
  position: relative; overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(0,194,255,0.08) 0%, transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(168,85,247,0.06) 0%, transparent 40%),
    radial-gradient(circle at 60% 80%, rgba(0,255,136,0.05) 0%, transparent 40%);
}

.login-card {
  background: rgba(10,22,40,0.92);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 44px 38px;
  width: 90%; max-width: 400px;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0,0,0,.5), var(--shadow-glow);
  position: relative; z-index: 1;
}

.login-logo       { text-align: center; margin-bottom: 30px; }
.login-logo .logo-circle {
  width: 68px; height: 68px;
  background: var(--gradient-blue);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  margin: 0 auto 14px;
  box-shadow: 0 0 40px rgba(0,194,255,0.4);
}
.login-logo h1 {
  font-size: 22px; font-weight: 900;
  background: var(--gradient-blue);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.login-logo p { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

.login-form .btn-primary { width: 100%; justify-content: center; padding: 12px; font-size: 14px; margin-top: 6px; }

.login-divider {
  text-align: center; position: relative;
  margin: 18px 0; color: var(--text-muted); font-size: 12px;
}
.login-divider::before, .login-divider::after {
  content: ''; position: absolute; top: 50%;
  width: 40%; height: 1px; background: var(--border-color);
}
.login-divider::before { right: 0; }
.login-divider::after  { left: 0; }

/* ─── Sidebar Toggle ────────────────────────────────────── */
.sidebar-toggle {
  display: none;
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  align-items: center; justify-content: center;
  font-size: 19px; color: var(--text-secondary);
  cursor: pointer; transition: var(--transition);
}

/* ─── Notifications Panel ───────────────────────────────── */
.notifications-panel {
  position: fixed;
  top: var(--header-height); left: 18px;
  width: 340px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0,0,0,.5);
  z-index: 200; display: none;
  backdrop-filter: blur(20px);
}
.notifications-panel.active { display: block; }

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

.notif-list { max-height: 380px; overflow-y: auto; }

.notif-item {
  display: flex; gap: 11px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background .15s; cursor: pointer;
}
.notif-item:hover { background: var(--bg-glass); }
.notif-item.unread { background: rgba(0,194,255,0.04); }

.notif-icon { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }

/* ─── Toast Notifications ───────────────────────────────── */
.toast-container { position: fixed; bottom: 22px; left: 22px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  display: flex; align-items: center; gap: 11px;
  min-width: 260px; max-width: 340px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
  animation: slideInUp .3s ease;
  font-size: 13px; color: var(--text-secondary);
}
.toast.success { border-color: rgba(0,255,136,0.3); }
.toast.danger  { border-color: rgba(255,71,87,0.3); }
.toast.info    { border-color: rgba(0,194,255,0.3); }
.toast.warning { border-color: rgba(251,191,36,0.3); }

/* ─── Grid Helpers ──────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }

/* ─── Utilities ─────────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.text-green  { color: var(--accent-green) !important; }
.text-blue   { color: var(--accent-blue) !important; }
.text-red    { color: var(--accent-red) !important; }
.text-yellow { color: var(--accent-yellow); }
.text-bold   { font-weight: 700; }
.mono        { font-family: var(--font-mono); }
.mb-4  { margin-bottom: 16px; }
.mb-6  { margin-bottom: 24px; }
.mt-4  { margin-top: 16px; }
.mt-6  { margin-top: 24px; }
.flex  { display: flex; }
.items-center     { align-items: center; }
.justify-between  { justify-content: space-between; }
.gap-3 { gap: 12px; }
.w-full { width: 100%; }

/* ─── Animations ────────────────────────────────────────── */
@keyframes pulse        { 0%,100%{opacity:1} 50%{opacity:.35} }
@keyframes slideInUp    { from{transform:translateY(20px);opacity:0} to{transform:translateY(0);opacity:1} }
@keyframes fadeIn       { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
@keyframes spin         { to{transform:rotate(360deg)} }
@keyframes glow-pulse   { 0%,100%{box-shadow:0 0 10px rgba(0,194,255,.3)} 50%{box-shadow:0 0 25px rgba(0,194,255,.6)} }

.fade-in { animation: fadeIn .4s ease; }
.spin    { animation: spin 1s linear infinite; display:inline-block; }

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }

  .sidebar               { transform: translateX(100%); width: 260px; }
  .sidebar.open          { transform: translateX(0); }
  .sidebar-toggle        { display: flex; }
  .main-content          { margin-right: 0; }
  .page-content          { padding: 14px; }
  .stats-grid            { grid-template-columns: repeat(2,1fr); }
  .devices-grid          { grid-template-columns: 1fr; }
  .grid-2, .grid-3       { grid-template-columns: 1fr; }
  .top-header            { padding: 0 14px; }
  .notifications-panel   { left: 8px; right: 8px; width: auto; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .login-card { padding: 28px 20px; }
}
