:root {
  --bg-dark: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-sidebar: #1e293b;
  --accent-cyan: #06b6d4;
  --accent-purple: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #06b6d4 0%, #3b82f6 50%, #8b5cf6 100%);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: rgba(255, 255, 255, 0.1);
  --border-active: rgba(6, 182, 212, 0.5);
  --radius-lg: 16px;
  --radius-md: 10px;
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', 'Segoe UI', Roboto, sans-serif;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
}

.sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  padding: 2rem 1.2rem;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.4rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 2.5rem;
}

.brand-icon {
  font-size: 1.8rem;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-item:hover, .nav-item.active {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.main-content {
  flex: 1;
  padding: 2.5rem;
  overflow-y: auto;
}

.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.header-title h1 {
  font-size: 1.8rem;
  font-weight: 700;
}

.header-title p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
  transition: transform 0.2s;
}

.btn-primary:hover {
  transform: translateY(-2px);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.stat-card h3 {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.stat-card .value {
  font-size: 2.2rem;
  font-weight: 700;
}

.content-section {
  display: none;
}

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

.table-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

th, td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
}

.logo-thumb {
  width: 45px;
  height: 45px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(6, 182, 212, 0.2);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.4);
}

.btn-edit {
  background: rgba(6, 182, 212, 0.2);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  margin-right: 6px;
  transition: background 0.2s;
}

.btn-edit:hover {
  background: rgba(6, 182, 212, 0.4);
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 500px;
  max-width: 90%;
  padding: 2rem;
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-close {
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
}

.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  outline: none;
}

.form-control:focus {
  border-color: var(--accent-cyan);
}

.api-preview {
  background: #090d16;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-family: monospace;
  color: #38bdf8;
  white-space: pre-wrap;
  max-height: 400px;
  overflow-y: auto;
}

.search-box {
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem;
  transition: all 0.2s ease;
}

.search-box:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

.search-box input {
  background: transparent;
  border: none;
  color: var(--text-main);
  outline: none;
  font-size: 0.95rem;
  width: 240px;
}

.select-filter {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 0.55rem 1rem;
  outline: none;
  font-size: 0.9rem;
  cursor: pointer;
}

.select-filter:focus {
  border-color: var(--accent-cyan);
}

/* Custom Scrollbars for Checkbox Containers */
#device-countries-container::-webkit-scrollbar,
#device-categories-container::-webkit-scrollbar {
  width: 6px;
}

#device-countries-container::-webkit-scrollbar-track,
#device-categories-container::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
  border-radius: 4px;
}

#device-countries-container::-webkit-scrollbar-thumb {
  background: #06b6d4;
  border-radius: 4px;
}

#device-categories-container::-webkit-scrollbar-thumb {
  background: #a855f7;
  border-radius: 4px;
}
