:root {
  --bg-primary: #121214;
  --bg-secondary: #1c1c22;
  --bg-active: #2a2a35;
  --accent: #c5a059;
  --accent-hover: #b38e47;
  --accent-light: rgba(197, 160, 89, 0.15);
  --text-primary: #f3f4f6;
  --text-muted: #9ca3af;
  --border: rgba(197, 160, 89, 0.2);
  --border-focus: #c5a059;
  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.15);
  --danger: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.15);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-title: 'Outfit', 'Inter', system-ui, sans-serif;
  --radius: 8px;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-active);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Button styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.btn.primary {
  background-color: var(--accent);
  color: #121214;
}
.btn.primary:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
}
.btn.primary:active {
  transform: translateY(0);
}

.btn.secondary {
  background-color: transparent;
  border-color: var(--border);
  color: var(--accent);
}
.btn.secondary:hover {
  background-color: var(--accent-light);
  border-color: var(--accent);
}

.btn.danger {
  background-color: transparent;
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--danger);
}
.btn.danger:hover {
  background-color: var(--danger-light);
  border-color: var(--danger);
}

.btn.compact {
  padding: 6px 12px;
  font-size: 12px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

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

.form-label {
  display: block;
  font-family: var(--font-title);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--accent);
}

.form-control {
  width: 100%;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 10px 14px;
  transition: all 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.15);
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 768px) {
  .form-row {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

/* Badge / Pills */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid transparent;
}
.badge.ok {
  background-color: var(--success-light);
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.2);
}
.badge.alert {
  background-color: var(--accent-light);
  color: var(--accent);
  border-color: rgba(197, 160, 89, 0.2);
}
.badge.danger {
  background-color: var(--danger-light);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.2);
}

/* Login Screen */
.login-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background-image: radial-gradient(circle at center, rgba(197, 160, 89, 0.05) 0%, transparent 70%);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 24px;
  box-shadow: var(--shadow);
  text-align: center;
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-logo {
  font-family: var(--font-title);
  color: var(--accent);
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 32px;
}

/* App Header & Navigation */
.app-header {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 18px;
  color: var(--accent);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-info {
  text-align: right;
  display: none;
}
@media (min-width: 768px) {
  .user-info {
    display: block;
  }
}
.user-name {
  font-size: 14px;
  font-weight: 600;
}
.user-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* Nav Tabs */
.nav-tabs {
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
}

.nav-container {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-container::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  background-color: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-title);
  font-weight: 500;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

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

.nav-tab.active {
  color: var(--accent);
  background-color: var(--bg-secondary);
  border-color: var(--border);
}

/* Dashboard Content */
.main-content {
  flex: 1;
  padding: 24px 0 40px;
}

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

/* Metric Cards */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.metric-title {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.metric-value {
  font-family: var(--font-title);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
}

.metric-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Panels */
.panel {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

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

.panel-header h2 {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 600;
}

.panel-header p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Table Design */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

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

th, td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
  background-color: var(--bg-active);
  font-family: var(--font-title);
  font-weight: 600;
  color: var(--accent);
}

tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}

/* Image preview lists */
.image-previews-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.image-preview-wrapper {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  background-color: #000;
}

.image-preview-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background-color: rgba(0, 0, 0, 0.7);
  border: none;
  color: var(--danger);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}
.image-preview-remove:hover {
  background-color: var(--danger);
  color: #fff;
}

/* Loading overlays */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(197, 160, 89, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-muted);
  gap: 12px;
}

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

.toast {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  color: var(--text-primary);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 13px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 280px;
  max-width: 450px;
}

.toast.success {
  border-left-color: var(--success);
}

.toast.error {
  border-left-color: var(--danger);
}

/* Editor Grid layout */
.editor-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 992px) {
  .editor-layout {
    grid-template-columns: 2fr 1fr;
  }
}

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

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

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