html {
  font-size: 14px;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin-bottom: 0;
  background: #f3f6f8;
  color: #1f2937;
}

a {
  color: #1d4ed8;
}

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

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.18);
}

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

.app-sidebar {
  width: 260px;
  min-height: 100vh;
  flex: 0 0 260px;
}

.app-content {
  min-height: 100vh;
  min-width: 0;
}

aside.bg-dark {
  background: #111827 !important;
  box-shadow: 8px 0 24px rgba(17, 24, 39, 0.12);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #f8fafc;
  font-weight: 800;
  letter-spacing: 0;
}

.sidebar-brand-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
}

aside .nav-link {
  border-radius: 8px;
  color: #e5e7eb !important;
}

aside .nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
}

aside .sidebar-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
}

aside .sidebar-toggle::after {
  content: "v";
  float: right;
  transition: transform 0.18s ease;
}

aside .sidebar-toggle[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

aside .sidebar-submenu {
  list-style: none;
  margin: 4px 0 8px;
  padding: 0 0 0 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
}

aside .sidebar-submenu .nav-link {
  padding: 0.42rem 0.75rem;
  font-size: 0.94rem;
  color: #d1d5db !important;
}

aside .text-secondary {
  color: #9ca3af !important;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.navbar {
  min-height: 64px;
}

main.p-4 {
  padding: 28px !important;
}

h1,
h2,
h3 {
  color: #111827;
  letter-spacing: 0;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.page-heading h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
}

.page-heading p {
  margin: 6px 0 0;
  color: #64748b;
}

.period-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
}

.period-filter label {
  color: #64748b;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.metric-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-left: 4px solid #2563eb;
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.metric-card span {
  display: block;
  color: #64748b;
  font-size: 0.92rem;
  margin-bottom: 8px;
}

.metric-card strong {
  display: block;
  color: #111827;
  font-size: 2rem;
  line-height: 1;
}

.metric-warning {
  border-left-color: #d97706;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 18px;
}

.dashboard-grid.single-chart {
  grid-template-columns: minmax(0, 1fr);
}

.chart-panel {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.chart-panel h2 {
  font-size: 1.05rem;
  margin-bottom: 12px;
}

.chart-panel p {
  margin: 6px 0 0;
  color: #64748b;
}

.chart-toolbar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 18px;
}

.chart-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.chart-filter-grid label {
  display: block;
  margin-bottom: 6px;
  color: #475569;
  font-weight: 600;
}

.chart-filter-actions {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}

.filter-panel {
  padding: 16px 18px;
}

.chart-panel canvas {
  width: 100%;
  display: block;
}

table {
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
}

.table th {
  background-color: #eef2f7;
  color: #334155;
  font-weight: 700;
}

.table td,
.table th {
  vertical-align: middle;
}

.table-hover tbody tr:hover {
  background-color: #f8fafc;
}

.table-search {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
}

.table-search input {
  max-width: 420px;
  background: #ffffff;
}

.table-search-count {
  color: #64748b;
  white-space: nowrap;
}

.nav-link.active {
  background-color: #2563eb !important;
}

.auth-page {
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(15, 23, 42, 0.94), rgba(17, 24, 39, 0.86)),
    repeating-linear-gradient(90deg, rgba(148, 163, 184, 0.08) 0, rgba(148, 163, 184, 0.08) 1px, transparent 1px, transparent 72px),
    #111827;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.72fr);
  min-height: 100vh;
}

.auth-visual {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  padding: 48px;
  color: #f8fafc;
}

.auth-brand,
.auth-card-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-brand-icon {
  width: 52px;
  height: 52px;
}

.auth-brand span,
.auth-brand strong {
  display: block;
}

.auth-brand span {
  font-size: 1.12rem;
  font-weight: 800;
}

.auth-brand strong {
  color: #93c5fd;
  font-size: 0.9rem;
}

.auth-visual-content {
  max-width: 680px;
}

.auth-kicker {
  color: #67e8f9;
  font-weight: 700;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.auth-visual h1 {
  color: #ffffff;
  font-size: clamp(2.25rem, 4vw, 4.8rem);
  line-height: 1.02;
  margin-bottom: 20px;
  max-width: 760px;
}

.auth-visual-content p {
  color: #cbd5e1;
  font-size: 1.08rem;
  line-height: 1.7;
  max-width: 620px;
}

.auth-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 140px));
  gap: 14px;
}

.auth-stats div {
  border: 1px solid rgba(203, 213, 225, 0.18);
  border-radius: 8px;
  padding: 14px;
  background: rgba(15, 23, 42, 0.42);
}

.auth-stats span,
.auth-stats small {
  display: block;
}

.auth-stats span {
  color: #ffffff;
  font-size: 1.45rem;
  font-weight: 800;
}

.auth-stats small {
  color: #a7f3d0;
  margin-top: 4px;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: #f8fafc;
}

.auth-card {
  width: min(100%, 440px);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  padding: 32px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

.auth-card-icon {
  width: 48px;
  height: 48px;
}

.auth-card-heading {
  margin-bottom: 24px;
}

.auth-card-heading h2 {
  margin: 0;
  font-size: 1.55rem;
}

.auth-card-heading p {
  margin: 4px 0 0;
  color: #64748b;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-form label {
  display: block;
  margin-bottom: 7px;
  color: #334155;
  font-weight: 700;
}

.auth-input {
  min-height: 46px;
  background: #f8fafc;
}

.auth-submit {
  min-height: 46px;
  margin-top: 4px;
  font-weight: 700;
}

.auth-register {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #e2e8f0;
  color: #64748b;
}

.auth-register a {
  font-weight: 700;
  text-decoration: none;
}

.supplier-auth-shell {
  grid-template-columns: minmax(360px, 0.55fr) minmax(0, 1fr);
}

.supplier-auth-visual {
  position: sticky;
  top: 0;
}

.supplier-auth-panel {
  align-items: flex-start;
  justify-content: flex-start;
  min-height: 100vh;
  padding: 44px;
}

.supplier-register-card {
  width: min(100%, 920px);
}

.supplier-register-form {
  gap: 22px;
}

.validation-summary:empty {
  display: none;
}

.supplier-form-section {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px;
  background: #ffffff;
}

.supplier-form-section-heading {
  margin-bottom: 18px;
}

.supplier-form-section-heading h3 {
  margin: 0;
  font-size: 1.08rem;
  color: #111827;
}

.supplier-form-section-heading p {
  margin: 5px 0 0;
  color: #64748b;
}

.supplier-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.supplier-field-wide {
  grid-column: 1 / -1;
}

.supplier-field .text-danger {
  display: block;
  margin-top: 5px;
  font-size: 0.86rem;
}

.supplier-register-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.supplier-register-actions .btn {
  min-height: 46px;
  padding-left: 22px;
  padding-right: 22px;
}

@media (max-width: 992px) {
  .metric-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    min-height: auto;
    padding: 32px 24px;
    gap: 42px;
  }

  .supplier-auth-visual {
    position: static;
  }

  .auth-panel {
    padding: 28px 18px 40px;
  }

  .supplier-auth-panel {
    padding: 28px 18px 40px;
  }

  .chart-filter-grid {
    grid-template-columns: 1fr 1fr;
  }

  .page-heading {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .chart-filter-grid {
    grid-template-columns: 1fr;
  }

  .auth-stats {
    grid-template-columns: 1fr;
  }

  .auth-register {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-card {
    padding: 24px;
  }

  .supplier-form-section {
    padding: 16px;
  }

  .supplier-form-grid {
    grid-template-columns: 1fr;
  }

  .supplier-register-actions .btn {
    width: 100%;
  }
}
