:root {
  --brand: #4f46e5;
  --brand-dark: #3730a3;
  --bg: #f4f5f9;
  --card-bg: #ffffff;
  --text: #1f2333;
  --muted: #6b7280;
  --border: #e6e7ee;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: linear-gradient(180deg, #1e1b4b 0%, #312e81 100%);
  color: #e0e0f5;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  font-weight: 700;
  font-size: 1.05rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand i { font-size: 1.3rem; color: #a5b4fc; }

.sidebar-warehouse {
  padding: 14px 18px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-warehouse-label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #9294c9;
  font-weight: 700;
  margin-bottom: 6px;
}
.sidebar-warehouse select.form-select {
  background-color: rgba(255,255,255,0.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  font-size: 0.85rem;
}
.sidebar-warehouse select.form-select:focus {
  background-color: rgba(255,255,255,0.12);
  color: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 0.2rem rgba(79,70,229,0.35);
}
.sidebar-warehouse select.form-select option { color: #1f2333; }

.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav a {
  color: #c7c9f0;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background .15s ease, color .15s ease;
}
.sidebar-nav a i { width: 18px; text-align: center; }
.sidebar-nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar-nav a.active { background: var(--brand); color: #fff; font-weight: 600; }

.sidebar-footer {
  padding: 14px 18px;
  font-size: 0.75rem;
  color: #9294c9;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 14px 26px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-title { font-weight: 700; font-size: 1.15rem; }
.topbar-date { margin-left: auto; color: var(--muted); font-size: 0.85rem; }

.content-area { padding: 24px 26px 60px; }

.card-soft {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  height: 100%;
}
.stat-card .stat-label { color: var(--muted); font-size: 0.82rem; font-weight: 500; }
.stat-card .stat-value { font-size: 1.6rem; font-weight: 700; margin-top: 4px; }
.stat-card .stat-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: #eef0ff; color: var(--brand); font-size: 1.1rem;
}

.table-modern {
  background: var(--card-bg);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.table-modern table { margin-bottom: 0; }
.table-modern thead th {
  background: #fafafc;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.table-modern td, .table-modern th { padding: 12px 16px; vertical-align: middle; }

.badge-low { background: #fee2e2; color: var(--danger); font-weight: 600; }
.badge-ok { background: #dcfce7; color: var(--success); font-weight: 600; }
.badge-vat { background: #e0e7ff; color: var(--brand-dark); font-weight: 600; }
.badge-novat { background: #f1f5f9; color: #475569; font-weight: 600; }

.section-heading {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  font-weight: 700;
  margin: 22px 0 8px;
}

.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }

.btn { border-radius: 9px; }
.btn-sm { border-radius: 8px; }

/* pill-style button groups instead of fused square segments */
.btn-group > .btn {
  border-radius: 8px !important;
  margin-left: 5px !important;
}
.btn-group > .btn:first-child { margin-left: 0 !important; }

.form-select, .form-control { border-radius: 8px; }

.flash-stack { margin-bottom: 18px; }

.box-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  height: 100%;
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: box-shadow .15s ease, transform .15s ease;
}
.box-card:hover { box-shadow: 0 6px 18px rgba(79,70,229,0.12); transform: translateY(-2px); color: var(--text); }
.box-card .box-name { font-weight: 700; font-size: 1.05rem; margin-bottom: 6px; }
.box-card .box-meta { color: var(--muted); font-size: 0.85rem; }

.line-row input { min-width: 0; }

@media (max-width: 991px) {
  .sidebar { position: fixed; left: -240px; z-index: 1000; transition: left .2s ease; }
  .sidebar.open { left: 0; }
  .content-area { padding: 18px; }
}
