/* macOS 26+ Style - Sonoma/Spatial Design */
:root {
  --system-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --bg-app: rgba(20, 20, 20, 0.6);
  --bg-sidebar: rgba(30, 30, 30, 0.4);
  --bg-panel: rgba(40, 40, 40, 0.6);
  --bg-fill: rgba(60, 60, 60, 0.3);
  --bg-fill-secondary: rgba(80, 80, 80, 0.2);
  
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-tertiary: rgba(255, 255, 255, 0.4);
  
  --accent-blue: #0a84ff;
  --accent-blue-hover: #409cff;
  --accent-green: #30d158;
  --accent-orange: #ff9f0a;
  --accent-red: #ff453a;
  
  --separator: rgba(255, 255, 255, 0.1);
  --border-radius: 12px;
  --border-radius-lg: 20px;
  --glass-blur: 20px;
  --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.3);
}

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

body {
  font-family: var(--system-font);
  background-color: #101010;
  background-image: 
    radial-gradient(circle at 20% 20%, rgba(10, 132, 255, 0.15), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(88, 86, 214, 0.15), transparent 40%),
    linear-gradient(180deg, #0a0a0a 0%, #1a1a1a 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.app-layout {
  display: flex;
  height: 100vh;
  backdrop-filter: blur(var(--glass-blur));
}

/* Sidebar */
.sidebar {
  width: 240px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--separator);
  display: flex;
  flex-direction: column;
  padding: 16px;
  backdrop-filter: blur(var(--glass-blur));
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 24px;
}

.logo-mark {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #fff 0%, #ccc 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.logo-text {
  font-size: 16px;
  font-weight: 600;
}

.nav-section { flex: 1; display: flex; flex-direction: column; gap: 20px; }

.nav-label {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 12px;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-weight: 500;
  font-size: 13px;
}

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

.nav-item.active {
  background: var(--bg-fill);
  color: var(--text-primary);
  font-weight: 600;
}

.nav-icon { 
  width: 18px; 
  height: 18px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  opacity: 0.8;
}

.nav-item.active .nav-icon { opacity: 1; }

.user-profile {
  padding: 12px;
  border-top: 1px solid var(--separator);
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 28px;
  height: 28px;
  background: var(--bg-fill);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--separator);
  font-size: 14px;
  color: var(--text-secondary);
}

.user-name { font-weight: 500; font-size: 13px; }

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.top-bar {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--separator);
  background: rgba(0,0,0,0.2);
}

.breadcrumbs { font-size: 13px; color: var(--text-secondary); }
.crumb-main { color: var(--text-primary); font-weight: 500; }
.crumb-sep { margin: 0 8px; opacity: 0.5; }

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

.server-status { 
  font-size: 12px; 
  display: flex; 
  align-items: center; 
  gap: 6px; 
  color: var(--text-secondary);
  background: var(--bg-fill);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--separator);
}

.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-tertiary); }
.server-status.online .status-dot { background: var(--accent-green); box-shadow: 0 0 6px var(--accent-green); }
.server-status.online { color: var(--accent-green); }

/* Content */
.content-wrapper {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
  scroll-behavior: smooth;
}

.page-section { display: none; animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.page-section.active { display: block; }

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

.page-hero { margin-bottom: 32px; }
.hero-title { font-size: 28px; font-weight: 700; margin-bottom: 6px; letter-spacing: -0.02em; }
.hero-subtitle { color: var(--text-secondary); font-size: 15px; }

/* Stats */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-box {
  background: var(--bg-panel);
  border: 1px solid var(--separator);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-box:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.2);
}

.stat-icon { 
  width: 32px; 
  height: 32px; 
  border-radius: 8px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  font-size: 14px;
}

.stat-icon.blue { background: rgba(10, 132, 255, 0.2); color: var(--accent-blue); }
.stat-icon.green { background: rgba(48, 209, 88, 0.2); color: var(--accent-green); }
.stat-icon.orange { background: rgba(255, 159, 10, 0.2); color: var(--accent-orange); }
.stat-icon.purple { background: rgba(88, 86, 214, 0.2); color: #a78bfa; }

.stat-val { font-size: 24px; font-weight: 700; }
.stat-lbl { font-size: 13px; color: var(--text-secondary); }

/* Tables */
.section-title { font-size: 18px; font-weight: 600; margin-bottom: 16px; }

.table-card {
  background: var(--bg-panel);
  border: 1px solid var(--separator);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  margin-bottom: 32px;
}

.data-table { width: 100%; border-collapse: collapse; }
.data-table th { 
  text-align: left; 
  padding: 14px 20px; 
  color: var(--text-tertiary); 
  font-size: 11px; 
  text-transform: uppercase; 
  font-weight: 600; 
  background: rgba(0,0,0,0.1); 
  border-bottom: 1px solid var(--separator);
}
.data-table td { padding: 14px 20px; border-bottom: 1px solid var(--separator); font-size: 13px; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-fill-secondary); }
.empty-row td { text-align: center; color: var(--text-tertiary); padding: 40px; }

/* Forms */
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.form-card, .settings-card {
  background: var(--bg-panel);
  border: 1px solid var(--separator);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.form-card h3, .settings-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 20px; }

.card-icon {
  width: 36px;
  height: 36px;
  background: var(--bg-fill);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--accent-blue);
  font-size: 16px;
}

.input-group { margin-bottom: 16px; }
.input-group label { display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; font-weight: 500; }

input[type="text"], input[type="email"], input[type="password"] {
  width: 100%;
  padding: 10px 14px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--separator);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  transition: all 0.2s;
}

input:focus { 
  outline: none; 
  border-color: var(--accent-blue); 
  background: rgba(0,0,0,0.3); 
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.15); 
}

.mono-input { font-family: "SF Mono", monospace; letter-spacing: 0.15em; font-size: 16px !important; text-align: center; }

.checkbox-group { margin-bottom: 20px; }
.checkbox-container { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--text-secondary); }
.checkbox-container input { width: 16px; height: 16px; accent-color: var(--accent-blue); }

.btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary { background: var(--accent-blue); color: white; box-shadow: 0 2px 10px rgba(10, 132, 255, 0.3); }
.btn-primary:hover { background: var(--accent-blue-hover); transform: translateY(-1px); }
.btn-outline { background: var(--bg-fill-secondary); border: 1px solid var(--separator); color: var(--text-primary); }
.btn-outline:hover { background: var(--bg-fill); }
.full-width { width: 100%; }

.form-actions { display: flex; gap: 12px; margin-top: auto; }

/* Results */
.result-card {
  background: var(--bg-panel);
  border: 1px solid var(--separator);
  border-radius: var(--border-radius-lg);
  display: none;
}

.result-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--separator);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-tertiary);
}

.status-badge { font-size: 11px; padding: 3px 8px; border-radius: 4px; font-weight: 600; text-transform: uppercase; }
.badge-success { background: rgba(48, 209, 88, 0.15); color: var(--accent-green); }
.badge-error { background: rgba(255, 69, 58, 0.15); color: var(--accent-red); }

.result-content {
  padding: 20px;
  font-family: "SF Mono", monospace;
  font-size: 12px;
  white-space: pre-wrap;
  color: var(--text-secondary);
  max-height: 250px;
  overflow-y: auto;
}
.result-content.success { color: var(--accent-green); }
.result-content.error { color: var(--accent-red); }

/* Settings */
.settings-wrapper { max-width: 500px; }

/* Help */
.help-card { display: flex; flex-direction: column; gap: 16px; max-width: 700px; }

.help-step {
  background: var(--bg-panel);
  border: 1px solid var(--separator);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  display: flex;
  gap: 20px;
}

.step-num {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-tertiary);
  line-height: 1;
  font-family: "SF Pro Display", sans-serif;
}

.step-content h4 { font-size: 15px; margin-bottom: 6px; font-weight: 600; color: var(--text-primary); }
.step-content p { color: var(--text-secondary); line-height: 1.5; font-size: 13px; }

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: rgba(40, 40, 40, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid var(--separator);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 13px;
}

.toast-success { border-left: 3px solid var(--accent-green); }
.toast-error { border-left: 3px solid var(--accent-red); }

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

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* Mobile */
@media (max-width: 768px) {
  .sidebar { position: fixed; left: -240px; z-index: 50; transition: 0.3s; }
  .sidebar.open { left: 0; }
  .grid-form { grid-template-columns: 1fr; }
  .content-wrapper { padding: 20px; }
  .stats-container { grid-template-columns: 1fr 1fr; }
}
