/* Panel CSS - Modern Zinc Dark Theme */
/* Last updated: 2026-04-11 */

:root {
  --bg: #09090b;
  --surface: #18181b;
  --surface-2: #1f1f23;
  --surface-3: #27272a;
  --border: #27272a;
  --border-hover: #3f3f46;
  --text: #fafafa;
  --text-2: #a1a1aa;
  --text-3: #71717a;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-soft: rgba(59, 130, 246, 0.1);
  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.1);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.1);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.1);
  --radius-sm: 6px;
  --radius: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --transition: 150ms ease;
  --sidebar-width: 240px;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

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

h1, h2, h3, h4, h5, h6 {
  color: var(--text);
  font-weight: 600;
  line-height: 1.3;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p {
  color: var(--text-2);
}

/* Layout */
.layout {
  display: flex;
  min-height: 100vh;
}

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 32px;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-header h1 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sidebar-header .subtitle {
  font-size: 0.75rem;
  color: var(--text-3);
  margin-top: 4px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
}

.nav-section {
  margin-bottom: 24px;
}

.nav-section-title {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  padding: 0 12px;
  margin-bottom: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 450;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
  position: relative;
}

.nav-item:hover {
  color: var(--text);
  background: var(--surface-2);
}

.nav-item.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding-left: 9px;
}

.nav-item .icon {
  width: 18px;
  height: 18px;
  opacity: 0.7;
  flex-shrink: 0;
}

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

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
  border-color: var(--border-hover);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
}

.card-description {
  font-size: 0.85rem;
  color: var(--text-3);
  margin-top: 4px;
}

.card-body {
  color: var(--text-2);
}

.card-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* Grid */
.grid {
  display: grid;
  gap: 24px;
}

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

/* Stat Cards */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 8px;
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  line-height: 1;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--surface-3);
  border-color: var(--border-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.btn-danger:hover {
  background: #dc2626;
  box-shadow: 0 0 0 3px var(--danger-soft);
}

.btn-success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}

.btn-success:hover {
  background: #16a34a;
  box-shadow: 0 0 0 3px var(--success-soft);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 0.95rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Form Elements */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea,
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
  transition: all var(--transition);
  outline: none;
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover,
input:hover,
select:hover,
textarea:hover {
  border-color: var(--border-hover);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-input::placeholder,
input::placeholder,
textarea::placeholder {
  color: var(--text-3);
}

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

.form-select,
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2371717a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-3);
  margin-top: 4px;
}

.form-error {
  font-size: 0.75rem;
  color: var(--danger);
  margin-top: 4px;
}

/* Checkbox & Radio */
.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

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

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  gap: 0;
  margin-bottom: 24px;
}

button.tab, .tab {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  outline: none;
  font-family: inherit;
  padding: 12px 20px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  border: none;
  background: none;
  position: relative;
  transition: color var(--transition);
}

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

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

.tab.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}

.tab-content {
  display: none;
}

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

/* Tables */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

thead {
  background: var(--surface-2);
}

th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-2);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 12px 16px;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
}

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

tbody tr {
  transition: background var(--transition);
}

tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.01);
}

tbody tr:hover {
  background: var(--surface-2);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-default {
  background: var(--surface-3);
  color: var(--text-2);
}

.badge-primary {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge-success {
  background: var(--success-soft);
  color: var(--success);
}

.badge-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

/* Alerts */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  border: 1px solid;
}

.alert-info {
  background: var(--accent-soft);
  border-color: rgba(59, 130, 246, 0.2);
  color: var(--accent);
}

.alert-success {
  background: var(--success-soft);
  border-color: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.alert-danger {
  background: var(--danger-soft);
  border-color: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.alert-warning {
  background: var(--warning-soft);
  border-color: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

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

.modal-title {
  font-size: 1.15rem;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-3);
  transition: all var(--transition);
  border: none;
  background: none;
}

.modal-close:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* Progress Bar */
.progress {
  height: 6px;
  background: var(--surface-3);
  border-radius: 100px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 100px;
  transition: width 300ms ease;
}

.progress-bar.success { background: var(--success); }
.progress-bar.danger { background: var(--danger); }
.progress-bar.warning { background: var(--warning); }

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all var(--transition);
  z-index: 50;
}

.dropdown-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--text-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.dropdown-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.85rem;
  animation: slideIn 200ms ease;
}

.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-info { border-left: 3px solid var(--accent); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Charts Container */
.chart-container {
  width: 100%;
  height: 300px;
  position: relative;
}

/* Avatar */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.avatar-sm { width: 28px; height: 28px; }
.avatar-lg { width: 48px; height: 48px; }

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-3);
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 8px;
}

/* Loading */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 600ms linear infinite;
}

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

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 100px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

/* Tooltip */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 10px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.72rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
  pointer-events: none;
}

.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
}

/* Page Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 0.85rem;
  color: var(--text-3);
  margin-top: 4px;
}

/* Divider */
.divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

/* Toggle Switch */
.toggle {
  position: relative;
  width: 40px;
  height: 22px;
  cursor: pointer;
  display: inline-block;
}

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

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--surface-3);
  border-radius: 100px;
  transition: background var(--transition);
}

.toggle-slider::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: var(--text);
  border-radius: 50%;
  transition: transform var(--transition);
}

.toggle input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

/* Account Status Indicator */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.online { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-dot.offline { background: var(--text-3); }
.status-dot.error { background: var(--danger); box-shadow: 0 0 6px var(--danger); }

/* Schedule Timeline */
.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 24px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent);
}

.timeline-item.completed::before {
  background: var(--success);
  border-color: var(--success);
}

/* Log viewer */
.log-viewer {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 0.75rem;
  line-height: 1.8;
  max-height: 400px;
  overflow-y: auto;
  color: var(--text-2);
}

.log-line {
  display: flex;
  gap: 12px;
}

.log-time {
  color: var(--text-3);
  flex-shrink: 0;
}

.log-level-info { color: var(--accent); }
.log-level-success { color: var(--success); }
.log-level-error { color: var(--danger); }
.log-level-warn { color: var(--warning); }

/* Tag/Chip */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.72rem;
  color: var(--text-2);
}

.tag-remove {
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--transition);
}

.tag-remove:hover {
  opacity: 1;
}

/* Code Block */
.code-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 0.8rem;
  overflow-x: auto;
  color: var(--text-2);
}

/* List Group */
.list-group {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.list-group-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.list-group-item:last-child {
  border-bottom: none;
}

.list-group-item:hover {
  background: var(--surface-2);
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination-item {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: none;
}

.pagination-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.pagination-item.active {
  background: var(--accent);
  color: #fff;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-3);
  margin-bottom: 16px;
}

.breadcrumb-separator {
  color: var(--border-hover);
}

.breadcrumb a {
  color: var(--text-3);
}

.breadcrumb a:hover {
  color: var(--text);
}

/* Container width control */
.container {
  max-width: 1280px;
  margin: 0 auto;
}

.container-sm { max-width: 640px; }
.container-md { max-width: 960px; }

/* Utility Classes */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.p-8 { padding: 8px; }
.p-16 { padding: 16px; }
.p-24 { padding: 24px; }
.p-32 { padding: 32px; }
.px-16 { padding-left: 16px; padding-right: 16px; }
.py-8 { padding-top: 8px; padding-bottom: 8px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 0.8rem; }
.text-xs { font-size: 0.7rem; }
.text-lg { font-size: 1.1rem; }
.text-muted { color: var(--text-3); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none; }
.relative { position: relative; }
.overflow-hidden { overflow: hidden; }
.rounded { border-radius: var(--radius); }
.rounded-md { border-radius: var(--radius-md); }
.border { border: 1px solid var(--border); }
.opacity-50 { opacity: 0.5; }
.pointer { cursor: pointer; }
.select-none { user-select: none; }

/* Responsive */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 200ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    padding: 20px 16px;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .tabs {
    overflow-x: auto;
  }
}

/* Print */
@media print {
  .sidebar,
  .toast-container {
    display: none;
  }

  .main-content {
    margin-left: 0;
  }

  body {
    background: #fff;
    color: #000;
  }
}

/* SVG icon sizing fix */
.sidebar svg, .sidebar-nav svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-brand svg { width: 28px; height: 28px; }
.sidebar-toggle svg { width: 20px; height: 20px; }
.sidebar-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: var(--text-2, #a1a1aa); text-decoration: none; font-size: 14px; border-radius: 8px; margin: 2px 8px; transition: all 150ms ease; }
.sidebar-nav a:hover { background: var(--surface-2, #1f1f23); color: var(--text, #fafafa); }
.sidebar-nav a.active { background: rgba(59,130,246,0.1); color: var(--accent, #3b82f6); border-left: 3px solid var(--accent, #3b82f6); }
.sidebar { width: 240px; position: fixed; top: 0; left: 0; bottom: 0; background: var(--surface, #18181b); border-right: 1px solid var(--border, #27272a); display: flex; flex-direction: column; z-index: 100; overflow-y: auto; }
.sidebar-brand { padding: 20px 16px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border, #27272a); }
.sidebar-brand .brand-text { font-weight: 700; font-size: 15px; }
.sidebar-brand small { display: block; font-size: 11px; color: var(--text-3, #71717a); }
.sidebar-footer { margin-top: auto; padding: 16px; border-top: 1px solid var(--border, #27272a); }
.main-content { margin-left: 240px; padding: 24px; min-height: 100vh; }
.topbar { padding: 16px 24px; border-bottom: 1px solid var(--border, #27272a); margin: -24px -24px 24px; background: var(--surface, #18181b); }
.topbar h1, .page-title { font-size: 22px; font-weight: 700; margin: 0; }

/* Card grid fix */
.stat-card, .card { background: var(--surface, #18181b); border: 1px solid var(--border, #27272a); border-radius: 12px; padding: 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

/* Account cards */
.acc-card { display: block; text-decoration: none; color: inherit; padding: 16px; border: 1px solid var(--border, #27272a); border-radius: 10px; background: var(--surface, #18181b); transition: border-color 150ms; }
.acc-card:hover { border-color: var(--accent, #3b82f6); }

/* Flash messages */
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }
.flash-success { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3); color: #22c55e; }
.flash-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: #ef4444; }

/* Stats */
.stat-value, .stat-num { font-size: 28px; font-weight: 700; }
.stat-label { font-size: 12px; color: var(--text-3, #71717a); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }
/* Tab override - force styling */
.tabs { display:flex !important; border-bottom:2px solid #27272a !important; gap:0 !important; margin-bottom:24px !important; background:transparent !important; }
.tabs .tab, .tabs button.tab, button.tab { padding:12px 24px !important; font-size:14px !important; font-weight:500 !important; color:#71717a !important; cursor:pointer !important; border:none !important; background:none !important; position:relative !important; transition:color .15s !important; font-family:inherit !important; outline:none !important; -webkit-appearance:none !important; appearance:none !important; }
.tabs .tab:hover, .tabs button.tab:hover { color:#fafafa !important; }
.tabs .tab.active, .tabs button.tab.active { color:#3b82f6 !important; }
.tabs .tab.active::after, .tabs button.tab.active::after { content:'' !important; position:absolute !important; bottom:-2px !important; left:0 !important; right:0 !important; height:2px !important; background:#3b82f6 !important; border-radius:2px 2px 0 0 !important; }
