/* =========================================================
   DS TEXTILES — Design tokens
   ========================================================= */
:root {
  --dst-primary: #4F46E5;
  --dst-primary-dark: #3B32B8;
  --dst-primary-light: #EEF0FE;
  --dst-teal: #0EA5A5;
  --dst-amber: #F59E0B;
  --dst-danger: #E5484D;
  --dst-ink: #1E1B2E;
  --dst-ink-soft: #6B7280;
  --dst-bg: #F5F5FB;
  --dst-card: #FFFFFF;
  --dst-border: #E7E6F3;
  --dst-radius: 14px;
  --dst-radius-sm: 10px;
  --dst-shadow: 0 4px 20px rgba(31, 27, 63, 0.06);
  --dst-shadow-lg: 0 12px 34px rgba(46, 40, 110, 0.12);
  --dst-sidebar-w: 250px;
  --dst-topbar-h: 66px;
  --dst-mobilenav-h: 62px;
  --font-display: "Poppins", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--dst-bg);
  color: var(--dst-ink);
  font-size: 0.925rem;
}

h1, h2, h3, h4, h5, h6, .font-display {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--dst-ink);
}

a { text-decoration: none; }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--dst-primary);
  outline-offset: 2px;
}

/* =========================================================
   Auth (login) screen
   ========================================================= */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 15% 15%, #6a5ff2 0%, transparent 45%),
              radial-gradient(circle at 85% 85%, #0EA5A5 0%, transparent 40%),
              linear-gradient(160deg, #241E52 0%, #423A94 55%, #4F46E5 100%);
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 940px;
  background: var(--dst-card);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--dst-shadow-lg);
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}

.auth-side {
  background:
    repeating-linear-gradient(115deg, rgba(255,255,255,0.06) 0 18px, transparent 18px 36px),
    linear-gradient(150deg, #4F46E5, #302592 80%);
  color: #fff;
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-side .brand-mark {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
}

.auth-form-pane {
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (max-width: 860px) {
  .auth-side { display: none; }
  .auth-card { grid-template-columns: 1fr; }
}

/* =========================================================
   App shell — sidebar + topbar + mobile bottom nav
   ========================================================= */
.app-shell { min-height: 100vh; }

.dst-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--dst-sidebar-w);
  background: linear-gradient(195deg, #241E52 0%, #34299C 100%);
  color: #E7E5FA;
  z-index: 1030;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
}

.dst-sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 22px;
  color: #fff;
}

.dst-sidebar .brand .mark {
  width: 40px; height: 40px;
  border-radius: 11px;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
}

.dst-sidebar .brand .name { font-family: var(--font-display); font-weight: 600; line-height: 1.1; font-size: 1.02rem; }
.dst-sidebar .brand .tagline { font-size: 0.68rem; color: #B7B1EA; }

.dst-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--dst-radius-sm);
  color: #D4D0F5;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 4px;
  transition: background 0.15s ease, color 0.15s ease;
}

.dst-nav-link i { font-size: 1.05rem; width: 20px; text-align: center; }

.dst-nav-link:hover { background: rgba(255,255,255,0.08); color: #fff; }

.dst-nav-link.active {
  background: rgba(255,255,255,0.16);
  color: #fff;
  box-shadow: inset 3px 0 0 #fff;
}

.dst-sidebar .nav-section-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8E86CC;
  margin: 14px 10px 6px;
}

.dst-sidebar-footer {
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 14px;
}

.dst-main {
  margin-left: var(--dst-sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

@media (max-width: 991.98px) {
  .dst-sidebar { transform: translateX(-100%); transition: transform 0.25s ease; box-shadow: var(--dst-shadow-lg); }
  .dst-sidebar.show { transform: translateX(0); }
  .dst-main { margin-left: 0; padding-bottom: calc(var(--dst-mobilenav-h) + 10px); }
}

.dst-topbar {
  height: var(--dst-topbar-h);
  background: var(--dst-card);
  border-bottom: 1px solid var(--dst-border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.dst-topbar .menu-btn {
  display: none;
  border: none;
  background: var(--dst-primary-light);
  color: var(--dst-primary);
  width: 38px; height: 38px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
}

@media (max-width: 991.98px) {
  .dst-topbar .menu-btn { display: inline-flex; }
}

.dst-topbar .page-heading { font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; margin: 0; }

.dst-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--dst-primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  font-family: var(--font-display);
  font-size: 0.9rem;
}

.dst-content { padding: 24px; flex: 1; }

.dst-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15, 12, 40, 0.45);
  z-index: 1025;
}
.dst-overlay.show { display: block; }

/* Mobile bottom nav — mirrors the app's mobile reference design */
.dst-mobilenav {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: var(--dst-mobilenav-h);
  background: var(--dst-card);
  border-top: 1px solid var(--dst-border);
  z-index: 1030;
  align-items: stretch;
}

@media (max-width: 991.98px) {
  .dst-mobilenav { display: flex; }
}

.dst-mobilenav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--dst-ink-soft);
  font-size: 0.68rem;
  font-weight: 500;
}

.dst-mobilenav a i { font-size: 1.2rem; }
.dst-mobilenav a.active { color: var(--dst-primary); }

/* =========================================================
   Cards / widgets
   ========================================================= */
.dst-card {
  background: var(--dst-card);
  border-radius: var(--dst-radius);
  border: 1px solid var(--dst-border);
  box-shadow: var(--dst-shadow);
}

.stat-card {
  padding: 18px 20px;
  border-radius: var(--dst-radius);
  background: var(--dst-card);
  border: 1px solid var(--dst-border);
  box-shadow: var(--dst-shadow);
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-card .icon-box {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.stat-card .value { font-family: var(--font-display); font-size: 1.45rem; font-weight: 700; line-height: 1.1; }
.stat-card .label { color: var(--dst-ink-soft); font-size: 0.78rem; }

.icon-box.bg-indigo { background: var(--dst-primary-light); color: var(--dst-primary); }
.icon-box.bg-teal { background: #E2FAF7; color: var(--dst-teal); }
.icon-box.bg-amber { background: #FEF3E2; color: var(--dst-amber); }
.icon-box.bg-danger { background: #FDE9E9; color: var(--dst-danger); }

.firm-card {
  border-radius: 20px;
  padding: 28px;
  color: #fff;
  background:
    repeating-linear-gradient(120deg, rgba(255,255,255,0.05) 0 16px, transparent 16px 32px),
    linear-gradient(135deg, #4F46E5 0%, #3B32B8 55%, #241E52 100%);
  box-shadow: var(--dst-shadow-lg);
  position: relative;
  overflow: hidden;
}

.firm-card .firm-name { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; }
.firm-card .firm-tagline { color: #D4D0F5; font-size: 0.85rem; margin-bottom: 18px; }
.firm-card .firm-meta { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 18px; }
.firm-card .firm-meta div { font-size: 0.83rem; color: #EAE8FB; display: flex; align-items: center; gap: 8px; }

/* Slider */
.dst-slider {
  border-radius: var(--dst-radius);
  overflow: hidden;
  position: relative;
  box-shadow: var(--dst-shadow);
}

.dst-slider .slides { display: flex; transition: transform 0.5s ease; }
.dst-slider .slide { min-width: 100%; height: 450px; background-size: cover; background-position: center; }
.dst-slider .dots { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.dst-slider .dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.55); cursor: pointer; }
.dst-slider .dots span.active { background: #fff; width: 20px; border-radius: 4px; }

/* Product cards (catalog view) */
.product-card {
  background: var(--dst-card);
  border-radius: var(--dst-radius);
  border-left: 5px solid var(--dst-primary);
  box-shadow: var(--dst-shadow);
  padding: 18px 20px;
  height: 100%;
}

.product-card .lot { color: var(--dst-ink-soft); font-size: 0.78rem; display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.product-card .attr-pill { background: #F4F4FB; border-radius: 10px; padding: 8px; text-align: center; }
.product-card .attr-pill .lbl { font-size: 0.65rem; color: var(--dst-ink-soft); text-transform: uppercase; letter-spacing: 0.04em; }
.product-card .attr-pill .val { font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; }

.badge-stock { background: #E4F8EE; color: #1A9A5A; font-weight: 600; border-radius: 20px; padding: 6px 14px; font-size: 0.8rem; }
.badge-stock.low { background: #FEF3E2; color: #B5710A; }
.badge-stock.out { background: #FDE9E9; color: var(--dst-danger); }
.badge-color { background: var(--dst-primary); color: #fff; font-weight: 600; border-radius: 20px; padding: 6px 14px; font-size: 0.8rem; }

/* Buttons */
.btn-dst-primary {
  background: var(--dst-primary);
  border: none;
  color: #fff;
  font-weight: 600;
  border-radius: 12px;
  padding: 10px 20px;
}
.btn-dst-primary:hover { background: var(--dst-primary-dark); color: #fff; }

.btn-dst-outline {
  background: #fff;
  border: 1px solid var(--dst-border);
  color: var(--dst-ink);
  font-weight: 500;
  border-radius: 12px;
  padding: 9px 18px;
}
.btn-dst-outline:hover { border-color: var(--dst-primary); color: var(--dst-primary); }

.table-dst thead th {
  background: #F7F7FC;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--dst-ink-soft);
  border-bottom: none;
  font-weight: 600;
  padding: 12px 14px;
}
.table-dst tbody td { padding: 12px 14px; vertical-align: middle; border-color: var(--dst-border); }
.table-dst tbody tr:hover { background: #FAFAFF; }

.filter-bar { background: var(--dst-card); border: 1px solid var(--dst-border); border-radius: var(--dst-radius); padding: 16px; }

.page-title-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--dst-ink-soft); }
.empty-state i { font-size: 2.6rem; color: var(--dst-border); margin-bottom: 10px; }
