/* ============================================================
   FilamentLager – Design System
   Dark purple premium theme
   ============================================================ */

:root {
  --bg: #09090f;
  --bg-2: #111119;
  --bg-3: #1a1a26;
  --card: rgba(255, 255, 255, 0.04);
  --card-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(139, 92, 246, 0.6);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent: #8b5cf6;
  --accent-2: #a78bfa;
  --accent-glow: rgba(139, 92, 246, 0.3);
  --pink: #ec4899;
  --orange: #f97316;
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.15);
  --amber: #f59e0b;
  --amber-dim: rgba(245, 158, 11, 0.15);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.15);
  --sidebar-w: 250px;
  --radius: 14px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.3);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================ LOADING */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 1.5rem;
}

.logo-spinner svg {
  animation: spin 1.2s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  color: var(--text-muted);
  font-size: .9rem;
  letter-spacing: .05em;
}

/* ============================================================ LAYOUT */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition);
}

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  padding: 2rem;
}

/* ============================================================ SIDEBAR */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--pink));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-size: 1.05rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-2), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-logo-sub {
  font-size: .65rem;
  color: var(--text-dim);
  font-weight: 400;
  -webkit-text-fill-color: var(--text-dim);
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
  overflow-y: auto;
}

.nav-section {
  padding: .25rem .75rem;
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
  margin-top: .75rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 0;
  transition: all var(--transition);
  font-size: .875rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  text-decoration: none;
}

.nav-item:hover {
  color: var(--text);
  background: var(--card);
}

.nav-item.active {
  color: var(--accent-2);
  background: rgba(139, 92, 246, 0.1);
  border-left-color: var(--accent);
}

.nav-item .nav-icon {
  width: 20px;
  text-align: center;
  font-size: 1rem;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}

.user-badge {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem;
  border-radius: var(--radius-sm);
  background: var(--card);
  cursor: default;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--pink));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  overflow: hidden;
}

.user-name {
  font-size: .8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: .65rem;
  color: var(--text-dim);
}

.btn-logout {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1rem;
  padding: .25rem;
  transition: color var(--transition);
}

.btn-logout:hover {
  color: var(--red);
}

/* ============================================================ PAGE HEADER */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -.02em;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: .875rem;
  margin-top: .2rem;
}

.page-actions {
  display: flex;
  gap: .75rem;
  align-items: center;
  flex-wrap: wrap;
}

/* ============================================================ BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: white;
  box-shadow: 0 2px 12px var(--accent-glow);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-secondary {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--card-hover);
  border-color: var(--accent);
}

.btn-danger {
  background: var(--red-dim);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--red);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-ghost {
  background: none;
  border: none;
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--card);
}

.btn-sm {
  padding: .35rem .75rem;
  font-size: .8rem;
}

.btn-icon {
  padding: .5rem;
  border-radius: 8px;
}

/* ============================================================ CARDS */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all var(--transition);
}

.card:hover {
  border-color: rgba(139, 92, 246, 0.2);
}

.card-sm {
  padding: 1rem;
}

/* ============================================================ STATS GRID */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--pink));
}

.stat-card:hover {
  background: var(--card-hover);
  transform: translateY(-2px);
}

.stat-label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -.03em;
  margin: .35rem 0 .1rem;
}

.stat-sub {
  font-size: .75rem;
  color: var(--text-dim);
}

.stat-icon {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  opacity: 0.3;
}

/* ============================================================ FILAMENT CARDS */
.filament-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.filament-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.filament-card:hover {
  transform: translateY(-3px);
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: var(--shadow-card);
}

.filament-card-color {
  height: 8px;
  flex-shrink: 0;
}

.filament-card-body {
  padding: 1.1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.filament-card-header {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
}

.filament-color-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.filament-card-name {
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.3;
}

.filament-card-sub {
  font-size: .75rem;
  color: var(--text-muted);
}

.filament-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .55rem;
  border-radius: 20px;
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.badge-material {
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-2);
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.badge-prop {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.badge-low {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-good {
  background: var(--green-dim);
  color: var(--green);
}

.stock-bar-wrap {
  margin-top: .25rem;
}

.stock-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: .72rem;
  color: var(--text-muted);
  margin-bottom: .3rem;
}

.stock-bar-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  overflow: hidden;
}

.stock-bar-fill {
  height: 100%;
  border-radius: 10px;
  transition: width .5s ease;
}

.stock-bar-fill.high {
  background: linear-gradient(90deg, var(--green), #4ade80);
}

.stock-bar-fill.medium {
  background: linear-gradient(90deg, var(--amber), #fcd34d);
}

.stock-bar-fill.low {
  background: linear-gradient(90deg, var(--red), #f87171);
}

.filament-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .6rem 1.1rem;
  border-top: 1px solid var(--border);
  gap: .4rem;
}

/* ============================================================ FORMS */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-grid.full {
  grid-template-columns: 1fr;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

.form-group.span-2 {
  grid-column: span 2;
}

label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .02em;
}

.required::after {
  content: ' *';
  color: var(--red);
}

input,
select,
textarea {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: .875rem;
  padding: .65rem .85rem;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

select option {
  background: var(--bg-3);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

input[type="color"] {
  padding: .3rem;
  height: 40px;
  cursor: pointer;
}

.input-group {
  position: relative;
}

.input-group input {
  padding-right: 3rem;
}

.input-group-suffix {
  position: absolute;
  right: .75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: .8rem;
  pointer-events: none;
}

.color-preview-row {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.color-preview-swatch {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .4rem;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  font-size: .8rem;
  color: var(--text-muted);
  user-select: none;
}

.checkbox-item:hover {
  border-color: var(--accent);
  color: var(--text);
}

.checkbox-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  padding: 0;
  margin: 0;
  flex-shrink: 0;
}

.checkbox-item.checked {
  border-color: rgba(139, 92, 246, 0.5);
  background: rgba(139, 92, 246, 0.1);
  color: var(--accent-2);
}

.form-row-inline {
  display: flex;
  gap: .75rem;
  align-items: flex-end;
}

.form-row-inline .form-group {
  flex: 1;
}

.photo-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition);
}

.photo-upload-area:hover {
  border-color: var(--accent);
}

.photo-upload-area.has-photo {
  padding: .5rem;
}

.photo-preview {
  max-height: 180px;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

/* ============================================================ MANUFACTURER SELECT */
.mfr-select-wrap {
  position: relative;
}

.mfr-add-btn {
  position: absolute;
  right: .4rem;
  top: 50%;
  transform: translateY(-50%);
  background: var(--accent);
  border: none;
  color: white;
  border-radius: 6px;
  padding: .2rem .5rem;
  font-size: .7rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .25rem;
}

/* ============================================================ SEARCH & FILTER BAR */
.filter-bar {
  display: flex;
  gap: .75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-wrap input {
  padding-left: 2.25rem;
}

.search-icon {
  position: absolute;
  left: .75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  pointer-events: none;
  color: var(--text-dim);
}

.filter-select {
  max-width: 160px;
}

/* ============================================================ TABLE */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  padding: .75rem 1rem;
  text-align: left;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: .85rem 1rem;
  font-size: .875rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* ============================================================ USAGE HISTORY */
.usage-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.usage-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .65rem .85rem;
  background: var(--card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: .8rem;
}

.usage-amount {
  font-weight: 700;
  color: var(--red);
}

.usage-note {
  flex: 1;
  color: var(--text-muted);
}

.usage-date {
  color: var(--text-dim);
  font-size: .72rem;
}

/* ============================================================ LOW STOCK ALERT */
.low-stock-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.low-stock-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem .85rem;
  background: var(--red-dim);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  font-size: .8rem;
}

.low-stock-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.low-stock-name {
  flex: 1;
  font-weight: 500;
}

.low-stock-weight {
  color: var(--red);
  font-weight: 700;
}

/* ============================================================ CHARTS */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.chart-title {
  font-size: .875rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.chart-container {
  position: relative;
  height: 220px;
}

/* ============================================================ LABEL / QR */
.label-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.5rem;
}

.label-preview-card {
  background: white;
  border-radius: 12px;
  padding: 1.25rem;
  color: #111;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.label-preview-card .label-top {
  display: flex;
  gap: .75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.label-preview-card .label-name {
  font-size: 1rem;
  font-weight: 800;
  color: #111;
}

.label-preview-card .label-meta {
  font-size: .72rem;
  color: #555;
}

.label-preview-card .label-color-strip {
  height: 8px;
  border-radius: 4px;
  margin: .5rem 0;
}

.label-preview-card .label-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.label-qr-canvas {
  border-radius: 8px;
}

.nfc-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.nfc-bytes-bar {
  margin: .75rem 0;
}

.nfc-chip-label {
  font-size: .72rem;
  color: var(--text-dim);
  margin-bottom: .25rem;
}

.nfc-bar-track {
  height: 10px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  overflow: hidden;
}

.nfc-bar-fill {
  height: 100%;
  border-radius: 10px;
}

.nfc-bar-fill.ok {
  background: linear-gradient(90deg, var(--green), #4ade80);
}

.nfc-bar-fill.warn {
  background: linear-gradient(90deg, var(--amber), #fcd34d);
}

.nfc-bar-fill.over {
  background: linear-gradient(90deg, var(--red), #f87171);
}

/* ============================================================ AUTH */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 1rem;
}

.auth-box {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow);
}

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto .75rem;
  background: linear-gradient(135deg, var(--accent), var(--pink));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

.auth-logo h1 {
  font-size: 1.5rem;
  font-weight: 800;
}

.auth-logo p {
  font-size: .875rem;
  color: var(--text-muted);
  margin-top: .25rem;
}

.auth-tabs {
  display: flex;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  padding: .25rem;
  margin-bottom: 1.75rem;
}

.auth-tab {
  flex: 1;
  text-align: center;
  padding: .5rem;
  border-radius: 6px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-muted);
}

.auth-tab.active {
  background: var(--accent);
  color: white;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-switch {
  text-align: center;
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

.auth-switch a {
  color: var(--accent-2);
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.form-error {
  background: var(--red-dim);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  padding: .65rem .85rem;
  font-size: .8rem;
  color: var(--red);
}

/* ============================================================ MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  animation: fadeIn .15s ease;
}

.modal-box {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 201;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp .2s ease;
  box-shadow: var(--shadow);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.modal-actions {
  display: flex;
  gap: .75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.hidden {
  display: none !important;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translate(-50%, -45%);
    opacity: 0;
  }

  to {
    transform: translate(-50%, -50%);
    opacity: 1;
  }
}

/* ============================================================ TOAST */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.toast {
  padding: .75rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  animation: slideInRight .25s ease, fadeOut .3s 2.7s ease forwards;
  display: flex;
  align-items: center;
  gap: .5rem;
  max-width: 320px;
}

.toast.success {
  background: #14532d;
  border: 1px solid #166534;
  color: #86efac;
}

.toast.error {
  background: #450a0a;
  border: 1px solid #7f1d1d;
  color: #fca5a5;
}

.toast.info {
  background: #1e1b4b;
  border: 1px solid #3730a3;
  color: #a5b4fc;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ============================================================ EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  opacity: .5;
}

.empty-state h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: .5rem;
  color: var(--text);
}

.empty-state p {
  font-size: .875rem;
  margin-bottom: 1.5rem;
}

/* ============================================================ TABS */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.75rem;
}

.tab {
  padding: .75rem 1.25rem;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--accent-2);
  border-bottom-color: var(--accent);
}

/* ============================================================ ACTIVITY FEED */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem;
  border-radius: var(--radius-sm);
  font-size: .8rem;
  transition: background var(--transition);
}

.activity-item:hover {
  background: var(--card);
}

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.activity-text {
  flex: 1;
  color: var(--text-muted);
}

.activity-text strong {
  color: var(--text);
}

.activity-time {
  color: var(--text-dim);
  font-size: .7rem;
}

/* ============================================================ MOBILE HEADER & LOGO */
.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 101;
}

.mobile-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.1rem;
}

.mobile-logo-img,
.sidebar-logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 6px;
  background: white;
  /* contrast base */
}

.sidebar-logo-img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.mobile-menu-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ============================================================ RESPONSIVE */
@media (max-width: 900px) {
  .mobile-header {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.6);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-group.span-2 {
    grid-column: unset;
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }

  .label-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .main-content {
    padding: 1rem;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .filament-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================ SCROLLBAR */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* ============================================================ MISC */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

.text-muted {
  color: var(--text-muted);
}

.text-green {
  color: var(--green);
}

.text-red {
  color: var(--red);
}

.text-amber {
  color: var(--amber);
}

.text-accent {
  color: var(--accent-2);
}

.flex {
  display: flex;
}

.gap-1 {
  gap: .5rem;
}

.gap-2 {
  gap: 1rem;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.mt-1 {
  margin-top: .5rem;
}

.mt-2 {
  margin-top: 1rem;
}

.mb-1 {
  margin-bottom: .5rem;
}

.mb-2 {
  margin-bottom: 1rem;
}

.w-full {
  width: 100%;
}

.font-bold {
  font-weight: 700;
}

.text-sm {
  font-size: .8rem;
}

a {
  color: var(--accent-2);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}