:root {
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent-color: #3b82f6;
  --accent-hover: #60a5fa;
  --danger: #ef4444;
  --success: #10b981;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Tajawal', sans-serif;
}

body {
  background: var(--bg-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.login-box {
  padding: 40px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  animation: slideUp 0.5s ease;
}

.logo-container svg {
  width: 60px;
  height: 60px;
  color: var(--accent-color);
  margin-bottom: 20px;
}

.login-box h2 {
  margin-bottom: 10px;
}

.login-box p {
  color: var(--text-secondary);
  margin-bottom: 25px;
  font-size: 0.9rem;
}

input {
  width: 100%;
  padding: 12px 15px;
  margin-bottom: 15px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  color: white;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.3s;
}

input:focus {
  border-color: var(--accent-color);
}

button {
  width: 100%;
  padding: 12px;
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  transition: background 0.3s, transform 0.1s;
}

button:hover {
  background: var(--accent-hover);
}

button:active {
  transform: scale(0.98);
}

.error-msg {
  color: var(--danger);
  margin-top: 15px;
  font-size: 0.9rem;
  min-height: 20px;
}

/* Dashboard Layout */
.dashboard-container {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: 260px;
  padding: 25px 20px;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  border-top: none;
  border-bottom: none;
  border-right: none;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 40px;
}

.main-icon {
  width: 30px;
  height: 30px;
  color: var(--accent-color);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.sidebar-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 12px 15px;
  border-radius: 8px;
  transition: all 0.3s;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-color);
}

.logout-btn {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
}

.logout-btn:hover {
  background: var(--danger);
  color: white;
}

.main-content {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
}

.top-header {
  margin-bottom: 30px;
}

.action-bar {
  display: flex;
  gap: 15px;
  padding: 20px;
  margin-bottom: 20px;
}

.action-bar input {
  margin-bottom: 0;
  flex: 1;
}

.action-bar button {
  width: auto;
  padding: 0 25px;
}

.alert-info {
  padding: 15px 20px;
  margin-bottom: 20px;
  color: var(--accent-hover);
  border-left: 4px solid var(--accent-color);
}

.table-container {
  padding: 20px;
  overflow-x: auto;
}

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

th, td {
  padding: 15px;
  text-align: right;
  border-bottom: 1px solid var(--glass-border);
}

th {
  color: var(--text-secondary);
  font-weight: 500;
}

td .del-btn {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  padding: 6px 12px;
  width: auto;
  font-size: 0.85rem;
}

td .del-btn:hover {
  background: var(--danger);
  color: white;
}

.tab-content {
  display: none;
  animation: fadeIn 0.4s ease;
}

.tab-content.active {
  display: block;
}

/* Health Grid */
.health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.health-card {
  padding: 25px;
  text-align: center;
}

.health-card h3 {
  color: var(--text-secondary);
  margin-bottom: 15px;
  font-size: 1rem;
}

.status-indicator {
  font-size: 1.5rem;
  font-weight: bold;
}

.status-up { color: var(--success); }
.status-down { color: var(--danger); }
.status-neutral { color: var(--accent-hover); }

/* Animations */
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

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

/* Filter Items & Toggle Switches */
.filter-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  margin-bottom: 8px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  transition: background 0.2s;
}

.filter-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.filter-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  padding-left: 10px;
}

.filter-item-title {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-primary);
  word-break: break-word;
}

.filter-item-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Custom Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .3s;
  border-radius: 24px;
  border: 1px solid var(--glass-border);
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 2px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--success);
}

input:checked + .slider:before {
  transform: translateX(20px);
}
