
:root {
  --primary-blue: #1565c0;
  --primary-orange: #f57c00;
  --bg-light: #f5f7fb;
  --border-light: #e0e4ef;
  --text-dark: #1f2933;
  --text-muted: #6b7280;
  --radius-lg: 14px;
  --shadow-soft: 0 10px 25px rgba(15, 23, 42, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #ffffff;
  color: var(--text-dark);
}

body {
  min-height: 100vh;
  display: flex;
}

.layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: #ffffff;
  border-right: 1px solid var(--border-light);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary-blue);
}

.sidebar-logo-badge {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-orange));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 12px 8px 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-dark);
  font-size: 0.9rem;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.nav-link span.icon {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.nav-link.active,
.nav-link:hover {
  background: rgba(21,101,192,0.06);
  color: var(--primary-blue);
  transform: translateX(1px);
}

.nav-link.active span.icon {
  border-color: rgba(21,101,192,0.3);
}

/* Main content */
.main {
  flex: 1;
  background: var(--bg-light);
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Top bar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.topbar-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

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

/* Buttons - only blue & orange */
.btn {
  border-radius: 999px;
  border: none;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.08s ease, box-shadow 0.08s ease, opacity 0.1s ease;
}

.btn:active {
  transform: translateY(1px);
  box-shadow: 0 4px 10px rgba(15,23,42,0.18);
}

.btn-primary {
  background: var(--primary-blue);
  color: #ffffff;
}

.btn-secondary {
  background: var(--primary-orange);
  color: #ffffff;
}

.btn-ghost {
  background: #ffffff;
  color: var(--primary-blue);
  box-shadow: none;
  border: 1px solid rgba(21,101,192,0.18);
}

/* Cards */
.card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-light);
}

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

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

.card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

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

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

@media (max-width: 1024px) {
  .sidebar {
    display: none;
  }
  .main {
    padding: 12px;
  }
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
}

@media (max-width: 768px) {
  .grid-3, .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Tags & pills */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  background: rgba(21,101,192,0.08);
  color: var(--primary-blue);
}

/* Tables */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

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

.table thead {
  background: #f1f4ff;
}

.table th,
.table td {
  padding: 8px 10px;
  border-bottom: 1px solid #edf0fa;
  text-align: left;
  white-space: nowrap;
}

.table th {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Drag & drop panels */
.dnd-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 14px;
}

@media (max-width: 768px) {
  .dnd-columns {
    grid-template-columns: minmax(0,1fr);
  }
}

.dnd-column {
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-light);
  background: #fcfdff;
  min-height: 160px;
  padding: 10px;
}

.dnd-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.dnd-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dnd-item {
  background: #ffffff;
  border-radius: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  cursor: grab;
}

.dnd-item.dragging {
  opacity: 0.6;
  border-style: dashed;
}

/* Field ordering drag list */
.sortable-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sortable-item {
  background: #ffffff;
  border-radius: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  cursor: grab;
}

.sortable-item span.handle {
  font-size: 1.1rem;
  opacity: 0.6;
}

/* Filters */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.input,
.select {
  border-radius: 999px;
  border: 1px solid var(--border-light);
  padding: 6px 12px;
  font-size: 0.8rem;
  outline: none;
  min-width: 120px;
}

.input:focus,
.select:focus {
  border-color: var(--primary-blue);
}

/* Tabs (for uploads & modules) */
.tabs {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: #e8edf9;
}

.tab {
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.8rem;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
}

.tab.active {
  background: #ffffff;
  color: var(--primary-blue);
  box-shadow: var(--shadow-soft);
}

/* Chart container */
.chart-container {
  width: 100%;
  max-width: 600px;
}

/* Export buttons row */
.export-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

/* Simple modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.35);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.modal {
  background: #ffffff;
  border-radius: 16px;
  padding: 18px 20px;
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-soft);
}

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

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

.modal-body {
  display: grid;
  gap: 10px;
}

.modal-footer {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
