/* ==========================================================================
   PC GUARD PRO — PROFESSIONAL DARK SECURITY DASHBOARD THEME
   Palette: Dark Navy (#060B17, #0B132B), Cyan/Blue Accent (#00D2FF, #2563EB)
   Status: Green (#10B981), Amber (#F59E0B), Crimson (#EF4444)
   ========================================================================== */

:root {
  --bg-primary: #060b17;
  --bg-surface: #0b132b;
  --bg-card: rgba(16, 27, 56, 0.7);
  --bg-card-hover: rgba(22, 38, 79, 0.85);
  --bg-elevated: #152244;
  --border-subtle: rgba(56, 189, 248, 0.12);
  --border-focus: #00d2ff;
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --accent-cyan: #00d2ff;
  --accent-blue: #3b82f6;
  --accent-indigo: #6366f1;
  
  --status-green: #10b981;
  --status-green-glow: rgba(16, 185, 129, 0.25);
  --status-yellow: #f59e0b;
  --status-yellow-glow: rgba(245, 158, 11, 0.25);
  --status-red: #ef4444;
  --status-red-glow: rgba(239, 68, 68, 0.25);
  --status-purple: #a855f7;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, monospace;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(0, 210, 255, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(99, 102, 241, 0.04) 0%, transparent 45%);
}

/* App Container Layout */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* SIDEBAR (Section 20: 15 Sidebar items) */
.sidebar {
  width: 280px;
  min-width: 280px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 100;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
}

.brand-header {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #00d2ff 0%, #2563eb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 0 16px rgba(0, 210, 255, 0.35);
}

.brand-details h2 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #fff;
}

.brand-details span {
  font-size: 11px;
  color: var(--accent-cyan);
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-category {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 12px 10px 6px;
  letter-spacing: 1.2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  width: 100%;
  text-align: left;
}

.nav-link:hover {
  color: var(--text-main);
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.2);
}

.nav-link.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(0, 210, 255, 0.18) 0%, rgba(37, 99, 235, 0.12) 100%);
  border-color: rgba(0, 210, 255, 0.4);
  font-weight: 600;
  box-shadow: 0 0 12px rgba(0, 210, 255, 0.15);
}

.nav-icon {
  font-size: 16px;
  width: 22px;
  text-align: center;
}

.nav-badge {
  margin-left: auto;
  background: var(--status-red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(6, 11, 23, 0.6);
}

.server-pill {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pulsing-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--status-green);
  box-shadow: 0 0 10px var(--status-green);
  animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.server-info-title {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.server-info-sub {
  font-size: 10px;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

/* MAIN CONTENT AREA */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* TOPBAR */
.topbar {
  height: 64px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 90;
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-title h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}

.status-tag.tag-green {
  background: rgba(16, 185, 129, 0.15);
  color: var(--status-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, #00d2ff 0%, #2563eb 100%);
  color: #fff;
  box-shadow: 0 0 14px rgba(0, 210, 255, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 0 20px rgba(0, 210, 255, 0.5);
  transform: translateY(-1px);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--status-red);
  border-color: rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
  background: var(--status-red);
  color: #fff;
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--border-focus);
}

/* CONTENT VIEWPORT */
.viewport-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}

/* TAB PANES */
.tab-view {
  display: none;
  animation: fadeIn 0.25s ease-in-out;
}

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

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* METRICS GRID (Section 2) */
.metrics-grid-10 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 18px 20px;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.metric-card:hover {
  border-color: rgba(0, 210, 255, 0.35);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--border-focus), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.metric-card:hover::before {
  opacity: 1;
}

.metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.metric-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.metric-icon-bubble {
  font-size: 18px;
}

.metric-val {
  font-size: 26px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #fff;
  line-height: 1.1;
  margin-bottom: 6px;
}

.metric-val.val-cyan { color: var(--accent-cyan); text-shadow: 0 0 12px rgba(0, 210, 255, 0.3); }
.metric-val.val-green { color: var(--status-green); text-shadow: 0 0 12px var(--status-green-glow); }
.metric-val.val-yellow { color: var(--status-yellow); text-shadow: 0 0 12px var(--status-yellow-glow); }
.metric-val.val-red { color: var(--status-red); text-shadow: 0 0 12px var(--status-red-glow); }
.metric-val.val-purple { color: var(--status-purple); }

.metric-desc {
  font-size: 11px;
  color: var(--text-dim);
}

/* DATA PANELS / CARDS */
.panel-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  margin-bottom: 24px;
  overflow: hidden;
}

.panel-header {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(11, 19, 43, 0.6);
}

.panel-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-header-left h3 {
  font-size: 15px;
  font-weight: 700;
}

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

/* SEARCH & FILTER BAR */
.filter-bar {
  padding: 14px 24px;
  background: rgba(6, 11, 23, 0.4);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.search-input {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  min-width: 240px;
  outline: none;
  transition: border-color 0.2s;
}

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

.filter-select {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
  outline: none;
  cursor: pointer;
}

/* DATA TABLES */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}

table.data-table th {
  padding: 12px 18px;
  background: rgba(6, 11, 23, 0.7);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.7px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

table.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.07);
  color: var(--text-main);
  vertical-align: middle;
}

table.data-table tr:hover td {
  background: rgba(56, 189, 248, 0.04);
}

/* BADGES & PILLS */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-green { background: rgba(16, 185, 129, 0.15); color: var(--status-green); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-yellow { background: rgba(245, 158, 11, 0.15); color: var(--status-yellow); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-red { background: rgba(239, 68, 68, 0.15); color: var(--status-red); border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-cyan { background: rgba(0, 210, 255, 0.15); color: var(--accent-cyan); border: 1px solid rgba(0, 210, 255, 0.3); }
.badge-gray { background: rgba(148, 163, 184, 0.12); color: var(--text-muted); border: 1px solid rgba(148, 163, 184, 0.2); }

.code-pill {
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.4);
  padding: 3px 6px;
  border-radius: 4px;
  color: var(--accent-cyan);
  font-size: 11px;
}

/* MODAL OVERLAY */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 11, 23, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: var(--bg-surface);
  border: 1px solid rgba(0, 210, 255, 0.3);
  border-radius: 16px;
  width: 100%;
  max-width: 600px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(0, 210, 255, 0.15);
  overflow: hidden;
  animation: modalScale 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScale {
  from { transform: scale(0.94); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(16, 27, 56, 0.6);
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
}

.modal-close:hover {
  color: #fff;
}

.modal-body {
  padding: 24px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: rgba(6, 11, 23, 0.5);
}

/* FORM ELEMENTS */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

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

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

/* RESPONSIVENESS */
@media (max-width: 1024px) {
  .sidebar {
    width: 72px;
    min-width: 72px;
  }
  .brand-details, .nav-text, .nav-category, .nav-badge, .server-pill .server-info-title, .server-pill .server-info-sub {
    display: none;
  }
  .sidebar-nav {
    align-items: center;
  }
  .nav-link {
    justify-content: center;
    padding: 12px;
  }
}
