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

html {
  font-size: 14px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #0F172A;
  background-color: #F1F5F9;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: #2563EB;
  text-decoration: none;
  transition: all 0.15s ease;
}
a:hover {
  color: #1D4ED8;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-right {
  text-align: right !important;
}

.text-center {
  text-align: center !important;
}

.text-muted {
  color: #94A3B8 !important;
}

.font-medium {
  font-weight: 500 !important;
}

.font-semibold {
  font-weight: 600 !important;
}

.mt-4 {
  margin-top: 16px !important;
}

.mt-6 {
  margin-top: 24px !important;
}

.mb-3 {
  margin-bottom: 12px !important;
}

.mb-4 {
  margin-bottom: 16px !important;
}

.p-0 {
  padding: 0 !important;
}

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

.m-0 {
  margin: 0 !important;
}

.inline-form {
  display: inline;
}

.list-unstyled {
  list-style: none;
  padding: 0;
  margin: 0;
}

.link {
  color: #2563EB;
  text-decoration: none;
}
.link:hover {
  text-decoration: underline;
}
.link--muted {
  color: #94A3B8;
  font-size: 13px;
}
.link--muted:hover {
  color: #475569;
}

.code {
  font-family: "Courier New", monospace;
  font-size: 12px;
  background: #F1F5F9;
  padding: 2px 6px;
  border-radius: 4px;
  color: #2563EB;
}

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

.main-content {
  flex: 1;
  margin-left: 260px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
@media (max-width: 768px) {
  .main-content {
    margin-left: 0;
  }
}

.page-content {
  flex: 1;
  padding: 24px;
  background: #F1F5F9;
}
@media (max-width: 640px) {
  .page-content {
    padding: 16px;
  }
}

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

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.detail-grid__full {
  grid-column: 1/-1;
}
@media (max-width: 640px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}
@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

.document-form-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.document-view {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.document-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.document-title {
  font-size: 22px;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 6px;
}

.document-meta {
  text-align: right;
  line-height: 1.8;
  font-size: 13px;
  color: #475569;
}
.document-meta span.text-muted {
  color: #94A3B8;
}

.quick-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.quick-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  color: #0F172A;
  font-weight: 500;
  font-size: 13px;
  transition: all 0.2s ease;
  text-decoration: none;
}
.quick-action svg {
  color: #2563EB;
  flex-shrink: 0;
}
.quick-action:hover {
  background: #EFF6FF;
  border-color: #2563EB;
  color: #2563EB;
  text-decoration: none;
}

.totals-summary {
  max-width: 300px;
  margin-left: auto;
}

.totals-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #E2E8F0;
  font-size: 13px;
}
.totals-row--total {
  border-bottom: none;
  font-size: 15px;
  font-weight: 700;
  color: #2563EB;
  padding: 10px 0 0;
  margin-top: 4px;
}

.totals-box {
  width: 260px;
  flex-shrink: 0;
}
.totals-box .totals-row--total strong {
  color: #2563EB;
}

.items-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px;
  gap: 16px;
  flex-wrap: wrap;
}

.items-table-wrapper {
  overflow-x: auto;
}

.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  padding: 32px;
}

.error-code {
  font-size: 80px;
  font-weight: 800;
  color: #E2E8F0;
  line-height: 1;
  margin-bottom: 16px;
}

.error-title {
  font-size: 24px;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 8px;
}

.error-desc {
  color: #94A3B8;
  margin-bottom: 24px;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  background: #1E293B;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
  transition: transform 0.3s ease;
}
.sidebar::-webkit-scrollbar {
  width: 4px;
}
.sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.is-open {
    transform: translateX(0);
  }
}
.sidebar__logo {
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.sidebar__logo-img {
  max-height: 40px;
  max-width: 180px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}
.sidebar__logo-text {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}
.sidebar__nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar__section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.35);
  padding: 16px 12px 8px;
  margin-top: 8px;
}
.sidebar__section-label:first-child {
  margin-top: 0;
}
.sidebar__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.sidebar__item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
}
.sidebar__item.active {
  background: #2563EB;
  color: #fff;
}
.sidebar__item.active .sidebar__icon {
  color: #fff;
  opacity: 1;
}
.sidebar__item--logout {
  color: rgba(255, 255, 255, 0.45);
  margin-top: 8px;
}
.sidebar__item--logout:hover {
  background: rgba(220, 38, 38, 0.15);
  color: #fca5a5;
}
.sidebar__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.75;
  transition: opacity 0.15s;
}
.sidebar__footer {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.topbar {
  height: 64px;
  background: #FFFFFF;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.topbar__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  color: #475569;
  transition: all 0.2s ease;
}
.topbar__toggle:hover {
  background: #F1F5F9;
  color: #0F172A;
}
@media (max-width: 768px) {
  .topbar__toggle {
    display: flex;
  }
}
.topbar__title {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 600;
  color: #0F172A;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar__locale {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  max-width: 44%;
  flex-shrink: 1;
}
@media (max-width: 900px) {
  .topbar__locale {
    display: none;
  }
}
.topbar__locale-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 36px;
  height: 26px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #475569;
  text-decoration: none;
  border-radius: 6px;
  border: 1px solid transparent;
}
.topbar__locale-link:hover {
  background: #F1F5F9;
  color: #0F172A;
}
.topbar__locale-link.is-active {
  color: #2563EB;
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.06);
}
.topbar__locale-flag {
  display: block;
  width: 20px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}
.topbar__locale-code {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
}
.topbar__user {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
  border-radius: 6px;
  padding: 2px 6px 2px 2px;
  margin-right: -4px;
}
.topbar__user:hover {
  background: #F1F5F9;
}
.topbar__avatar {
  width: 32px;
  height: 32px;
  background: #2563EB;
  color: #fff;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  overflow: hidden;
  flex-shrink: 0;
}
.topbar__avatar--img-wrap {
  padding: 0;
  background: transparent;
}
.topbar__avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.topbar__username {
  font-size: 13px;
  font-weight: 500;
  color: #475569;
}
@media (max-width: 500px) {
  .topbar__username {
    display: none;
  }
}

.card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}
.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #E2E8F0;
  gap: 12px;
  flex-wrap: wrap;
  background: #FFFFFF;
}
.card__header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.card__title {
  font-size: 14px;
  font-weight: 600;
  color: #0F172A;
}
.card__body {
  padding: 20px;
}
.card__footer {
  padding: 12px 20px;
  border-top: 1px solid #E2E8F0;
  background: #F8FAFC;
}

.stat-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
}
.stat-card:hover {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}
.stat-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-card__icon svg {
  width: 22px;
  height: 22px;
}
.stat-card__icon--blue {
  background: #EFF6FF;
  color: #2563EB;
}
.stat-card__icon--green {
  background: #ECFDF5;
  color: #059669;
}
.stat-card__icon--amber {
  background: #FFFBEB;
  color: #D97706;
}
.stat-card__icon--purple {
  background: #F5F3FF;
  color: #7C3AED;
}
.stat-card__icon--info {
  background: #ECFEFF;
  color: #0891B2;
}
.stat-card__body {
  min-width: 0;
}
.stat-card__value {
  font-size: 22px;
  font-weight: 700;
  color: #0F172A;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-card__label {
  font-size: 12px;
  color: #94A3B8;
  margin-top: 2px;
}
.stat-card__label small {
  font-size: 11px;
  color: #D97706;
  font-weight: 500;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table thead tr {
  background: #F8FAFC;
  border-bottom: 2px solid #E2E8F0;
}
.table thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94A3B8;
  white-space: nowrap;
}
.table tbody tr {
  border-bottom: 1px solid #E2E8F0;
  transition: background 0.1s;
}
.table tbody tr:last-child {
  border-bottom: none;
}
.table tbody tr:hover {
  background: #F8FAFC;
}
.table tbody td {
  padding: 11px 14px;
  color: #0F172A;
  vertical-align: middle;
}
.table__empty {
  text-align: center;
  color: #94A3B8;
  padding: 40px 14px !important;
  font-style: italic;
}
.table__actions {
  text-align: right;
  white-space: nowrap;
  width: 1px;
}

.items-table thead th {
  background: #F8FAFC;
}
.items-table tbody td {
  padding: 8px 10px;
  vertical-align: middle;
}
.items-table .item-remove {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #E2E8F0;
  background: #FFFFFF;
  color: #94A3B8;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  cursor: pointer;
  margin: 0 auto;
}
.items-table .item-remove:hover {
  background: #FEF2F2;
  border-color: #DC2626;
  color: #DC2626;
}
.items-table .item-total {
  font-weight: 600;
  color: #0F172A;
}

.filter-tabs {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  color: #94A3B8;
  background: transparent;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}
.filter-tab:hover {
  background: #F1F5F9;
  color: #475569;
  text-decoration: none;
}
.filter-tab.active {
  background: #2563EB;
  color: #fff;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.form-group--full {
  grid-column: 1/-1;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  letter-spacing: 0.01em;
}
.form-label.required::after {
  content: " *";
  color: #DC2626;
}

.form-hint {
  font-size: 11px;
  color: #94A3B8;
  margin-top: 3px;
}

.form-error {
  font-size: 11px;
  color: #DC2626;
  margin-top: 2px;
}

.form-input, .form-select {
  width: 100%;
  padding: 8px 12px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  color: #0F172A;
  font-size: 13px;
  line-height: 1.5;
  transition: all 0.2s ease;
  outline: none;
  appearance: none;
}
.form-input::placeholder, .form-select::placeholder {
  color: #94A3B8;
}
.form-input:focus, .form-select:focus {
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.form-input.is-invalid, .is-invalid.form-select {
  border-color: #DC2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}
.form-input--sm {
  padding: 5px 9px;
  font-size: 12px;
}
.form-input--lg {
  padding: 10px 16px;
  font-size: 15px;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-select {
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394A3B8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 16px;
  flex-wrap: wrap;
}
.form-actions--sticky {
  position: sticky;
  bottom: 0;
  background: #FFFFFF;
  padding: 16px 20px;
  margin: 0 -20px -20px;
  border-top: 1px solid #E2E8F0;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
}

.search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.search-form .form-input, .search-form .form-select {
  width: 220px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.4;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn:hover {
  text-decoration: none;
}
.btn:focus-visible {
  outline: 2px solid #2563EB;
  outline-offset: 2px;
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}
.btn--primary {
  background: #2563EB;
  color: #fff;
  border-color: #2563EB;
}
.btn--primary:hover {
  background: #1D4ED8;
  border-color: #1D4ED8;
  color: #fff;
}
.btn--primary:active {
  background: #1E40AF;
}
.btn--secondary {
  background: #FFFFFF;
  color: #0F172A;
  border-color: #E2E8F0;
}
.btn--secondary:hover {
  background: #F1F5F9;
  color: #0F172A;
}
.btn--ghost {
  background: transparent;
  color: #475569;
  border-color: transparent;
}
.btn--ghost:hover {
  background: #F1F5F9;
  color: #0F172A;
}
.btn--danger {
  background: #DC2626;
  color: #fff;
  border-color: #DC2626;
}
.btn--danger:hover {
  background: rgb(187.0333333333, 30.1666666667, 30.1666666667);
  border-color: rgb(187.0333333333, 30.1666666667, 30.1666666667);
  color: #fff;
}
.btn--danger-ghost {
  background: transparent;
  color: #DC2626;
  border-color: transparent;
}
.btn--danger-ghost:hover {
  background: #FEF2F2;
  border-color: #DC2626;
}
.btn--success {
  background: #059669;
  color: #fff;
  border-color: #059669;
}
.btn--success:hover {
  background: #047857;
  color: #fff;
}
.btn--info {
  background: #0891B2;
  color: #fff;
  border-color: #0891B2;
}
.btn--info:hover {
  background: rgb(6.2451612903, 113.1935483871, 138.9548387097);
  color: #fff;
}
.btn--sm {
  padding: 5px 12px;
  font-size: 12px;
}
.btn--xs {
  padding: 3px 9px;
  font-size: 11px;
  border-radius: 4px;
}
.btn--lg {
  padding: 10px 22px;
  font-size: 14px;
}
.btn--full {
  width: 100%;
}

.btn-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  line-height: 1;
  border: 1px solid #E2E8F0;
  background: #FFFFFF;
  color: #94A3B8;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-icon:hover {
  background: #F1F5F9;
  color: #0F172A;
}
.btn-icon--danger:hover {
  background: #FEF2F2;
  border-color: #DC2626;
  color: #DC2626;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.badge--lg {
  padding: 4px 12px;
  font-size: 12px;
}
.badge--gray {
  background: #F1F5F9;
  color: #475569;
}
.badge--info {
  background: #ECFEFF;
  color: rgb(5.8064516129, 105.2419354839, 129.1935483871);
}
.badge--success {
  background: #ECFDF5;
  color: #047857;
}
.badge--warning {
  background: #FFFBEB;
  color: rgb(167.3721973094, 91.7847533632, 4.6278026906);
}
.badge--danger {
  background: #FEF2F2;
  color: rgb(178.25, 28.75, 28.75);
}
.badge--purple {
  background: #F5F3FF;
  color: #7C3AED;
}
.badge--blue {
  background: #EFF6FF;
  color: #1D4ED8;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 13px;
  margin: 16px 24px;
  position: relative;
  border: 1px solid transparent;
}
.alert svg {
  flex-shrink: 0;
  margin-top: 2px;
}
.alert__close {
  margin-left: auto;
  flex-shrink: 0;
  background: none;
  border: none;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s;
  padding: 0 0 0 12px;
}
.alert__close:hover {
  opacity: 1;
}
.alert--success {
  background: #ECFDF5;
  color: #047857;
  border-color: rgba(5, 150, 105, 0.2);
}
.alert--danger {
  background: #FEF2F2;
  color: rgb(200.2083333333, 32.2916666667, 32.2916666667);
  border-color: rgba(220, 38, 38, 0.2);
}
.alert--warning {
  background: #FFFBEB;
  color: rgb(142.5582959641, 78.1771300448, 3.9417040359);
  border-color: rgba(217, 119, 6, 0.2);
}
.alert--info {
  background: #ECFEFF;
  color: rgb(5.8064516129, 105.2419354839, 129.1935483871);
  border-color: rgba(8, 145, 178, 0.2);
}
.alert.mb-4 {
  margin-left: 0;
  margin-right: 0;
}

.auth-body {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #1a2744 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.auth-container {
  width: 100%;
  max-width: 420px;
}

.auth-card {
  background: #FFFFFF;
  border-radius: 12px;
  padding: 40px 36px;
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
}

.auth-logo {
  text-align: center;
  margin-bottom: 24px;
}
.auth-logo__name {
  display: block;
  font-size: 24px;
  font-weight: 800;
  color: #2563EB;
  letter-spacing: -0.5px;
}
.auth-logo__tagline {
  display: block;
  font-size: 12px;
  color: #94A3B8;
  margin-top: 4px;
}

.auth-title {
  font-size: 18px;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 20px;
  text-align: center;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.auth-form .form-group {
  gap: 6px;
}
.auth-form .btn--primary {
  padding: 11px;
  font-size: 14px;
  font-weight: 600;
}

.auth-locale {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #E2E8F0;
  text-align: center;
}
.auth-locale__label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94A3B8;
  margin-bottom: 12px;
}
.auth-locale__links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
}
.auth-locale__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 44px;
  height: 30px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  text-decoration: none;
  border-radius: 6px;
  border: 1px solid #E2E8F0;
}
.auth-locale__link:hover {
  background: #F1F5F9;
  color: #0F172A;
}
.auth-locale__link.is-active {
  color: #2563EB;
  border-color: rgba(37, 99, 235, 0.4);
  background: rgba(37, 99, 235, 0.08);
}
.auth-locale__flag {
  display: block;
  width: 22px;
  height: 16px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}
.auth-locale__code {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1;
}

.dashboard-charts {
  margin-top: 28px;
}

.dashboard-charts__head {
  margin-bottom: 4px;
}

.dashboard-charts__title {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}

.dashboard-charts__subtitle {
  font-size: 13px;
  color: #64748b;
  margin: 0 0 10px;
  max-width: 720px;
  line-height: 1.5;
}

.stat-card {
  border-left: 3px solid transparent;
}
.stat-card:nth-child(1) {
  border-left-color: #2563EB;
}
.stat-card:nth-child(2) {
  border-left-color: #7C3AED;
}
.stat-card:nth-child(3) {
  border-left-color: #059669;
}
.stat-card:nth-child(4) {
  border-left-color: #D97706;
}

.erp-intro {
  background: linear-gradient(135deg, #1e293b 0%, #32355c 100%);
  color: #f8fafc;
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}
.erp-intro .badge {
  vertical-align: middle;
}
.erp-intro strong {
  color: #fff;
  font-weight: 600;
}
.erp-intro a {
  color: #93c5fd;
  font-weight: 600;
}
.erp-intro a:hover {
  color: #bfdbfe;
}

.erp-intro__title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.erp-intro__text {
  font-size: 13px;
  line-height: 1.65;
  color: #cbd5e1;
  max-width: 920px;
}

.erp-modules {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.erp-module {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
}

.erp-module__head {
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.erp-module__code {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #64748b;
  text-transform: uppercase;
}

.erp-module__title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin-top: 6px;
  line-height: 1.3;
}

.erp-module__body {
  padding: 14px 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.erp-module__desc {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 12px;
  line-height: 1.55;
}

.erp-module__ul {
  list-style: none;
  margin: 0;
  padding: 0;
  margin-top: auto;
}

.erp-module__li {
  font-size: 13px;
  padding: 8px 0;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.erp-module__li:first-child {
  border-top: none;
  padding-top: 0;
}
.erp-module__li a {
  color: #2563eb;
  font-weight: 500;
}
.erp-module__li a:hover {
  text-decoration: underline;
}

.erp-module__li-main {
  flex: 1;
  min-width: 0;
  line-height: 1.45;
}

.erp-module__li-label {
  color: #475569;
}

.erp-module__badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  margin-top: 1px;
}

.erp-module__badge--ok {
  background: #ecfdf5;
  color: #047857;
}

.erp-module__badge--soon {
  background: #f1f5f9;
  color: #64748b;
}

.bi-dashboard {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}
.bi-dashboard .bi-kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.bi-dashboard .bi-charts-grid {
  width: 100%;
}

.bi-dashboard__intro {
  margin-bottom: 20px;
}

.bi-dashboard__title {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}

.bi-dashboard__subtitle {
  font-size: 13px;
  color: #64748b;
  margin: 0;
  max-width: 720px;
  line-height: 1.5;
}

.bi-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.bi-kpi-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.bi-kpi-card__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #0854a0;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bi-kpi-card__body {
  min-width: 0;
}

.bi-kpi-card__label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}

.bi-kpi-card__value {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
  margin-top: 4px;
}

.bi-kpi-card__hint {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}

.bi-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
  align-items: stretch;
}

.bi-chart-card {
  min-height: 0;
}
.bi-chart-card .card__header {
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.bi-chart-card__legend {
  font-size: 11px;
  color: #64748b;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.bi-legend {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}

.bi-legend--sales {
  background: #0854a0;
}

.bi-legend--po {
  background: #08979c;
}

.bi-legend--quotes {
  background: rgba(161, 0, 194, 0.35);
  border: 1px solid #a100c2;
}

.bi-chart-card__canvas-wrap {
  position: relative;
  height: 300px;
  padding: 20px 16px 0;
}
.bi-chart-card__canvas-wrap--donut {
  height: 280px;
}

.bi-table-card {
  margin-bottom: 8px;
}

.aps-embed-wrap {
  position: relative;
  width: 100%;
  min-height: 560px;
  background: #f1f5f9;
}

.aps-embed {
  display: block;
  width: 100%;
  min-height: 560px;
  border: 0;
  background: #fff;
}

.plan-editor-page {
  max-width: none;
}

.plan-editor__intro {
  margin-bottom: 20px;
}

.plan-editor__title {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.plan-editor__subtitle {
  font-size: 13px;
  color: #64748b;
  line-height: 1.55;
  max-width: 900px;
  margin: 0;
}

.plan-editor__toolbar {
  margin-bottom: 16px;
  padding: 16px 18px;
}

.plan-editor__toolbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px 20px;
}

.plan-editor__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}
.plan-editor__field--actions {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: auto;
}

.plan-editor__board {
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.plan-editor__head {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.plan-editor__head-label {
  flex: 0 0 260px;
  max-width: 40%;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  border-right: 1px solid #e2e8f0;
}

.plan-editor__buckets {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(var(--plan-cols, 8), minmax(0, 1fr));
  min-width: 0;
}

.plan-editor__bucket {
  padding: 10px 6px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  border-left: 1px solid #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plan-editor__bucket:first-child {
  border-left: none;
}

.plan-editor__row {
  display: flex;
  border-bottom: 1px solid #f1f5f9;
}
.plan-editor__row:last-child {
  border-bottom: none;
}

.plan-editor__meta {
  flex: 0 0 260px;
  max-width: 40%;
  padding: 12px 14px;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #fff;
}

.plan-editor__meta-product {
  font-size: 12px;
  color: #64748b;
  line-height: 1.35;
  word-break: break-word;
}

.plan-editor__badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 4px;
}
.plan-editor__badge--planned {
  background: #e0f2fe;
  color: #0369a1;
}
.plan-editor__badge--released {
  background: #ccfbf1;
  color: #0f766e;
}
.plan-editor__badge--completed {
  background: #dcfce7;
  color: #166534;
}
.plan-editor__badge--cancelled {
  background: #f1f5f9;
  color: #64748b;
}

.plan-editor__track-wrap {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  position: relative;
}

.plan-editor__track {
  position: relative;
  height: 36px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.plan-editor__track-grid {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  pointer-events: none;
  background-image: repeating-linear-gradient(90deg, transparent, transparent calc(100% / var(--plan-cols, 8) - 1px), rgba(226, 232, 240, 0.9) calc(100% / var(--plan-cols, 8) - 1px), rgba(226, 232, 240, 0.9) calc(100% / var(--plan-cols, 8)));
}

.plan-editor__bar {
  position: absolute;
  top: 4px;
  height: 28px;
  border-radius: 4px;
  min-width: 4px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  transition: filter 0.15s ease;
}
.plan-editor__bar:hover {
  filter: brightness(1.05);
}
.plan-editor__bar--planned {
  background: linear-gradient(180deg, #0284c7 0%, #0369a1 100%);
}
.plan-editor__bar--released {
  background: linear-gradient(180deg, #14b8a6 0%, #0d9488 100%);
}
.plan-editor__bar--completed {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
}
.plan-editor__bar--cancelled {
  background: linear-gradient(180deg, #94a3b8 0%, #64748b 100%);
}

.plan-editor__empty {
  padding: 24px;
}
