/* ========================================
   Apple-Inspired Dashboard CSS
   Sushant Technologies – Professional Edition
   (Final version)
   ======================================== */

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

/* Light mode (default) */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f7;
  --text-primary: #1d1d1f;
  --text-secondary: #86868b;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --border-light: #d2d2d7;
  --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --code-bg: #f6f6f8;
  --code-text: #1d1d1f;
  --progress-bg: #e9ecef;
  --progress-low: #27ae60;
  --progress-mid: #f39c12;
  --progress-high: #e74c3c;
  --success: #27ae60;
  --warning: #f39c12;
  --danger: #e74c3c;
  --info: #3498db;
}

/* Dark mode (system preference) */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #000000;
    --bg-secondary: #1c1c1e;
    --text-primary: #f5f5f7;
    --text-secondary: #98989d;
    --accent: #2997ff;
    --accent-hover: #3fa2ff;
    --border-light: #424245;
    --card-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    --code-bg: #2c2c2e;
    --code-text: #f5f5f7;
    --progress-bg: #2c2c2e;
    --success: #2ecc71;
    --warning: #f39c12;
    --danger: #e74c3c;
    --info: #3498db;
  }
}

/* Base */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.2s ease;
}

/* ========== LAYOUT ========== */
.app {
  display: flex;
  min-height: 100vh;
}

/* Sidebar (desktop) */
.sidebar {
  width: 260px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-light);
  padding: 2rem 1rem;
  transition: transform 0.3s ease;
}

.sidebar .logo {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 2rem;
  padding-left: 0.5rem;
}

.sidebar .logo i {
  margin-right: 0.5rem;
  color: var(--accent);
}

.sidebar nav ul {
  list-style: none;
}

.sidebar nav li {
  margin-bottom: 0.5rem;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
}

.sidebar nav a i {
  width: 1.25rem;
  text-align: center;
  font-size: 1.1rem;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  background-color: var(--accent);
  color: white;
}

.sidebar nav .separator {
  height: 1px;
  background: var(--border-light);
  margin: 1rem 0.5rem;
}

/* Main content */
.main {
  flex: 1;
  padding: 2rem;
  min-width: 0; /* prevents overflow */
}

/* Top bar */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.page-title {
  font-size: 2rem;
  font-weight: 600;
}

/* Time filter (dashboard) */
.time-filter {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-secondary);
  padding: 0.25rem;
  border-radius: 30px;
  border: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.time-filter a,
.time-filter button {
  padding: 0.5rem 1rem;
  border-radius: 30px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: all 0.2s;
  white-space: nowrap;
  background: transparent;
  border: none;
  cursor: pointer;
}

.time-filter a.active,
.time-filter button.active {
  background: var(--accent);
  color: white;
}

/* User dropdown */
.user-menu {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 30px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
}

.user-menu .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.user-menu span {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

.user-menu i {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.user-menu .dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  min-width: 180px;
  z-index: 1000;
  overflow: hidden;
}

.user-menu:hover .dropdown {
  display: block;
}

.dropdown a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: background 0.2s;
}

.dropdown a:hover {
  background: var(--bg-secondary);
}

.dropdown a i {
  width: 1.25rem;
  color: var(--text-secondary);
}

/* ========== MOBILE MENU (Hamburger) ========== */
/* Hidden checkbox */
#menu-checkbox {
  display: none;
}

/* Hamburger icon (hidden on desktop) */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 3px;
  background: var(--text-primary);
  border-radius: 3px;
  transition: 0.3s;
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#menu-checkbox:checked ~ .app .sidebar-overlay {
  opacity: 1;
}

/* ========== DASHBOARD COMPONENTS ========== */
/* KPI / Stats cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--border-light);
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.kpi-card i {
  font-size: 2.5rem;
  color: var(--accent);
}

.kpi-card .info h3 {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.kpi-card .info p {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

/* Stats grid (alternative) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-item {
  background: var(--bg-secondary);
  padding: 1.25rem 0.75rem;
  border-radius: 16px;
  text-align: center;
  border: 1px solid var(--border-light);
}

.stat-item .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.stat-item .value {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

/* Charts row */
.charts-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.chart-container {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--border-light);
  box-shadow: var(--card-shadow);
}

.chart-container h4 {
  margin-bottom: 1rem;
  font-size: 1rem;
  color: var(--text-secondary);
}

/* Map container */
.map-container {
  height: 350px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  margin: 1.5rem 0;
}

/* Site cards (for sites listing) */
.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.site-card {
  background: var(--bg-primary);
  border-radius: 20px;
  border: 1px solid var(--border-light);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.site-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.site-card .card-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-secondary);
}

.site-card .card-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  word-break: break-word;
}

.site-card .card-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  word-break: break-all;
}

.site-card .card-body {
  padding: 1.5rem;
}

.site-card .stats {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.site-card .stats span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.site-card .stats i {
  color: var(--accent);
}

.site-card .btn {
  display: block;
  width: 100%;
  padding: 0.75rem;
  text-align: center;
  background: var(--accent);
  color: white;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s;
}

.site-card .btn:hover {
  background: var(--accent-hover);
}

.site-card.add-new {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 2px dashed var(--border-light);
  cursor: pointer;
  color: var(--text-secondary);
  text-decoration: none;
  min-height: 200px;
}

.site-card.add-new i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--accent);
}

.site-card.add-new:hover {
  background: var(--bg-primary);
  border-color: var(--accent);
}

/* ========== EMPTY STATE ========== */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  background: var(--bg-secondary);
  border-radius: 16px;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.empty-state i {
  font-size: 3rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.empty-state p {
  margin-bottom: 1.5rem;
}

/* ========== FORMS ========== */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: border 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 1.2rem;
  height: 1.2rem;
  accent-color: var(--accent);
}

.form-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* Form actions */
.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.btn-primary {
  background: var(--accent);
  color: white;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.3);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.4);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  background: var(--bg-primary);
}

.btn-danger {
  background: var(--danger);
  color: white;
  border: none;
}

.btn-danger:hover {
  background: #c0392b;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.btn-block {
  display: block;
  width: 100%;
}

/* ========== TABLES ========== */
.table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-primary);
  min-width: 600px;
}

th {
  text-align: left;
  padding: 1rem;
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
}

tr:last-child td {
  border-bottom: none;
}

.table-actions {
  display: flex;
  gap: 0.5rem;
}

.table-actions a,
.table-actions button {
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem;
  transition: color 0.2s;
}

.table-actions a:hover,
.table-actions button:hover {
  color: var(--accent);
}

/* ========== ALERTS & NOTIFICATIONS ========== */
.alert {
  padding: 1rem 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert i {
  font-size: 1.25rem;
}

.alert-success {
  background: rgba(39, 174, 96, 0.1);
  color: var(--success);
  border-color: var(--success);
}

.alert-warning {
  background: rgba(243, 156, 18, 0.1);
  color: var(--warning);
  border-color: var(--warning);
}

.alert-danger {
  background: rgba(231, 76, 60, 0.1);
  color: var(--danger);
  border-color: var(--danger);
}

.alert-info {
  background: rgba(52, 152, 219, 0.1);
  color: var(--info);
  border-color: var(--info);
}

/* ========== PROFILE PAGE ========== */
.profile-header {
  display: flex;
  gap: 2rem;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.profile-avatar {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--accent);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar .avatar-upload {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  text-align: center;
  padding: 0.5rem;
  font-size: 0.8rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}

.profile-avatar:hover .avatar-upload {
  opacity: 1;
}

.profile-info h2 {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.profile-info p {
  color: var(--text-secondary);
}

/* ========== SETTINGS PAGE ========== */
.settings-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 2rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.settings-tab {
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.settings-tab:hover {
  color: var(--text-primary);
}

.settings-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.settings-section {
  display: none;
}

.settings-section.active {
  display: block;
}

/* ========== PAGINATION ========== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  text-decoration: none;
  border: 1px solid var(--border-light);
  transition: all 0.2s;
}

.pagination a:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.pagination .current {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* ========== LOADING SPINNER ========== */
.spinner {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  border: 3px solid var(--border-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ========== UPGRADE PAGE ========== */
.upgrade-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  align-items: stretch;
}

.plan-card {
  background: var(--bg-secondary);
  border-radius: 24px;
  padding: 2rem 1.8rem;
  border: 1px solid var(--border-light);
  box-shadow: var(--card-shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  display: flex;
  flex-direction: column;
}

.plan-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 30px rgba(0, 0, 0, 0.1);
}

.plan-card.popular {
  border: 2px solid var(--accent);
  background: var(--bg-primary);
}

.popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 1rem;
  border-radius: 30px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.current-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-secondary);
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 1rem;
  border-radius: 30px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.plan-name {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.plan-price {
  margin-bottom: 1.5rem;
}

.price {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
}

.period {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-left: 0.25rem;
}

.plan-limit {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.plan-limit strong {
  color: var(--text-primary);
  font-weight: 600;
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem 0;
  flex-grow: 1;
}

.plan-features li {
  color: var(--text-secondary);
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.plan-features li::before {
  content: "✓";
  color: var(--accent);
  font-weight: 600;
  display: inline-block;
  width: 1.2rem;
}

.plan-form {
  margin-top: auto;
}

.plan-button {
  width: 100%;
  padding: 0.9rem;
  font-size: 1.1rem;
  border-radius: 14px;
  background: var(--accent);
  color: white;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.plan-button:hover {
  background: var(--accent-hover);
  transform: scale(1.02);
}

.plan-button.current {
  background: var(--text-secondary);
  cursor: default;
}

.plan-button.current:hover {
  transform: none;
}

/* ========== FOOTER STYLES ========== */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
  padding: 3rem 2rem 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}

.footer-col h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
  color: var(--text-primary);
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col li {
  margin-bottom: 0.7rem;
}

.footer-col a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--accent);
}

.footer-logo {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.footer-tagline {
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.social-links {
  display: flex;
  gap: 0.8rem;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 50%;
  color: var(--text-primary);
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}

.social-icon:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: translateY(-2px);
}

.footer-bottom {
  margin-top: 3rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border-light);
}

.footer-bottom-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.back-to-top {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.back-to-top:hover {
  text-decoration: underline;
}

/* ========== MOBILE RESPONSIVE (All breakpoints) ========== */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    transform: translateX(-100%);
    width: 260px;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
  }

  .menu-toggle {
    display: flex;
  }

  #menu-checkbox:checked ~ .app .sidebar {
    transform: translateX(0);
  }

  #menu-checkbox:checked ~ .app .sidebar-overlay {
    display: block;
  }

  #menu-checkbox:checked ~ .app .menu-toggle span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  #menu-checkbox:checked ~ .app .menu-toggle span:nth-child(2) {
    opacity: 0;
  }
  #menu-checkbox:checked ~ .app .menu-toggle span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }

  .main {
    padding: 1rem;
    width: 100%;
  }

  .top-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .top-bar-right {
    width: 100%;
    justify-content: space-between;
  }

  .page-title {
    font-size: 1.8rem;
  }

  .time-filter {
    width: 100%;
    justify-content: center;
  }

  .time-filter a,
  .time-filter button {
    flex: 1;
    text-align: center;
    font-size: 0.8rem;
    padding: 0.5rem 0.3rem;
  }

  .user-menu {
    margin-left: auto;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .charts-row {
    grid-template-columns: 1fr;
  }

  .map-container {
    height: 250px;
  }

  .sites-grid {
    grid-template-columns: 1fr;
  }

  .profile-header {
    flex-direction: column;
    text-align: center;
  }

  .settings-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .site-footer {
    padding: 2rem 1rem 0;
  }

  .footer-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    text-align: center;
  }

  .footer-col ul {
    align-items: center;
    display: flex;
    flex-direction: column;
  }

  .footer-col h4 {
    margin-bottom: 0.8rem;
  }

  .social-links {
    justify-content: center;
    gap: 0.8rem;
  }

  .footer-bottom {
    margin-top: 2rem;
    padding: 1.2rem 0;
  }

  .footer-bottom-container {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

@media (max-width: 600px) {
  .plan-card {
    padding: 1.5rem;
  }
  .plan-name {
    font-size: 1.8rem;
  }
  .price {
    font-size: 2rem;
  }
}

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

  .form-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .site-footer {
    padding: 1.5rem 0.8rem 0;
    font-size: 0.85rem;
  }

  .footer-logo {
    font-size: 1.3rem;
  }

  .social-icon {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }
}
/* ========== CONNECTION STATUS BADGES ========== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.75rem;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}
.status-badge i {
    font-size: 0.6rem;
}
.status-active {
    background: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
    border: 1px solid #2ecc71;
}
.status-today {
    background: rgba(241, 196, 15, 0.1);
    color: #f39c12;
    border: 1px solid #f39c12;
}
.status-inactive {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border: 1px solid #e74c3c;
}