:root {
  --bg: #F6F4EF;
  --surface: #FFFFFF;
  --sidebar-bg: #1E1A15;
  --sidebar-text: #C9C2B4;
  --border: rgba(30, 26, 20, 0.12);
  --border-strong: rgba(30, 26, 20, 0.2);
  --text-primary: #211C15;
  --text-secondary: #6F6858;
  --text-tertiary: #9B9384;
  --accent: #B8703A;
  --accent-hover: #9C5D2C;
  --accent-soft: #F1E4D6;
  --success: #4B7F52;
  --success-soft: #E3EEE1;
  --danger: #B54A3F;
  --danger-soft: #F5E3DF;
  --font-sans: 'IBM Plex Sans', system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', Monaco, 'Courier New', monospace;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
}

h1, h2, h3 {
  margin: 0;
  font-weight: 600;
}

.mono {
  font-family: var(--font-mono);
}

/* App shell */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 28px 20px;
  gap: 32px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}

.brand-mark svg {
  width: 18px;
  height: 18px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-name {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

.brand-sub {
  font-size: 11px;
  color: #8A8272;
  letter-spacing: 0.02em;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 16px;
  color-scheme: dark;
}

.nav-label {
  font-size: 11px;
  color: #726B5C;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0 12px;
  margin-bottom: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--sidebar-text);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.active {
  background: var(--accent);
  color: #fff;
}

.nav-item svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 16px;
  border-top: 0.5px solid rgba(255, 255, 255, 0.12);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #3A3226;
  color: #E3DACC;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.user-name {
  font-size: 13px;
  color: #EDEAE2;
  font-weight: 500;
}

.user-role {
  font-size: 11px;
  color: #8A8272;
}

.content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  padding: 28px 40px 20px;
  border-bottom: 0.5px solid var(--border);
  background: var(--bg);
}

.topbar-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.breadcrumb a:hover {
  color: var(--text-secondary);
}

.breadcrumb .current {
  color: var(--text-secondary);
}

.breadcrumb svg {
  width: 12px;
  height: 12px;
}

.page-title {
  font-size: 22px;
  color: var(--text-primary);
}

.page-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.body-scroll {
  flex-grow: 1;
  padding: 24px 40px 40px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn svg {
  width: 14px;
  height: 14px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border: 0.5px solid var(--border-strong);
}

.btn-secondary:hover {
  background: #F1EEE6;
}

.btn-success-soft {
  background: var(--success-soft);
  color: var(--success);
  padding: 7px 12px;
  font-size: 12px;
}

.btn-success-soft:hover:not(:disabled) {
  background: #D4E5D1;
}

.btn-danger-soft {
  background: var(--danger-soft);
  color: var(--danger);
  padding: 7px 12px;
  font-size: 12px;
}

.btn-danger-soft:hover:not(:disabled) {
  background: #EFD5CE;
}

/* Stat + card grid */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
}

.stat-value {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.loc-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.15s;
}

.loc-card:hover {
  border-color: rgba(184, 112, 58, 0.5);
}

.loc-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

.loc-icon svg {
  width: 19px;
  height: 19px;
  color: var(--accent);
}

.loc-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.loc-address {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.loc-stats {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 12px 0;
  border-top: 0.5px solid var(--border);
  border-bottom: 0.5px solid var(--border);
}

.loc-stat b {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-weight: 600;
  display: block;
  font-size: 14px;
}

.loc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}

.loc-footer svg {
  width: 14px;
  height: 14px;
}

/* Tables */
.panel {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  font-weight: 600;
  padding: 12px 18px;
  border-bottom: 0.5px solid var(--border-strong);
  background: #FBFAF7;
}

tbody td {
  padding: 13px 18px;
  font-size: 13px;
  color: var(--text-primary);
  border-bottom: 0.5px solid var(--border);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: rgba(184, 112, 58, 0.03);
}

.vendor-name {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
}

.vendor-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vendor-icon svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.item-name {
  font-weight: 600;
}

.qty {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14px;
}

.actions {
  display: flex;
  gap: 8px;
}

.chev {
  width: 14px;
  height: 14px;
  color: var(--text-tertiary);
}

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--text-tertiary);
  background: transparent;
}

.icon-link:hover {
  background: rgba(184, 112, 58, 0.1);
  color: var(--accent);
}

.icon-link svg {
  width: 15px;
  height: 15px;
}

.result-count {
  font-size: 12px;
  color: var(--text-tertiary);
  padding: 12px 18px 4px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.badge svg {
  width: 11px;
  height: 11px;
}

.badge-in {
  background: var(--success-soft);
  color: var(--success);
}

.badge-out {
  background: var(--danger-soft);
  color: var(--danger);
}

.qty-in {
  color: var(--success);
  font-weight: 600;
}

.qty-out {
  color: var(--danger);
  font-weight: 600;
}

.note {
  color: var(--text-secondary);
  max-width: 260px;
}

.timestamp {
  color: var(--text-secondary);
}

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
}

/* Filters */
.filters {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.select {
  border: 0.5px solid var(--border-strong);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--surface);
  font-family: inherit;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0.5px solid var(--border-strong);
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--surface);
  max-width: 280px;
  flex-grow: 1;
}

.search svg {
  width: 15px;
  height: 15px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.search input {
  border: none;
  outline: none;
  font-size: 13px;
  font-family: inherit;
  flex-grow: 1;
  background: transparent;
}

.type-tabs {
  display: flex;
  gap: 4px;
  background: #EDEAE1;
  border-radius: 9px;
  padding: 3px;
}

.type-tab {
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
}

.type-tab.active {
  background: #fff;
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 17, 13, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal {
  background: var(--surface);
  border-radius: 14px;
  width: 420px;
  max-width: 100%;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
}

.modal-item {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-tertiary);
}

.modal-close:hover {
  background: #F1EEE6;
}

.modal-close svg {
  width: 15px;
  height: 15px;
}

.mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  width: fit-content;
}

.mode-pill svg {
  width: 12px;
  height: 12px;
}

.mode-add {
  background: var(--success-soft);
  color: var(--success);
}

.mode-decrease {
  background: var(--danger-soft);
  color: var(--danger);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.field input,
.field select,
.field textarea {
  border: 0.5px solid var(--border-strong);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary);
  background: #FBFAF7;
  width: 100%;
}

.field input:disabled {
  color: var(--text-tertiary);
  background: #F1EEE6;
}

.field textarea {
  resize: none;
  min-height: 56px;
}

.field .error {
  font-size: 12px;
  color: var(--danger);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

#blazor-error-ui {
  background: #B54A3F;
  color: #fff;
  bottom: 0;
  box-shadow: 0 -1px 10px rgba(0, 0, 0, 0.2);
  display: none;
  left: 0;
  padding: 0.9rem 1.25rem 0.6rem 1.25rem;
  position: fixed;
  width: 100%;
  z-index: 1000;
  font-size: 13px;
}

#blazor-error-ui .dismiss {
  cursor: pointer;
  position: absolute;
  right: 0.75rem;
  top: 0.5rem;
}

/*login*/
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F4D8BD; 
    padding: 24px;
}

.login-panel {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    padding: 42px;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(30, 26, 20, 0.25);
    text-align: center;
}

.login-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    border-radius: 16px;
    font-size: 30px;
}

.login-panel h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.login-subtitle {
    margin: 8px 0 32px;
    color: var(--text-secondary);
    font-size: 15px;
}

.login-panel .field {
    text-align: left;
    margin-bottom: 20px;
}

.login-panel .field label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);

}

.login-panel .field input {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 14px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    color: var(--text-primary);
    background: #FBFAF7;
  transition: border-color 0.2s, box-shadow 0.2s;

}
  .login-panel .field input:focus {
        border-color: var(--accent);
        box-shadow: 0 0 0 3px rgba(184, 112, 58, 0.15);
  }

.login-button {
    width: 100%;
    margin-top: 8px;
    padding: 14px;
    border: none;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.login-button:hover {
  background: var(--accent-hover);
}

.login-button:active {
  transform: scale(0.98);
}

.login-panel .error {
    margin-bottom: 16px;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--danger-soft);
    color: var(--danger);
    font-size: 14px;
    text-align: left;
}
.login-icon svg {
    width: 30px;
    height: 30px;
    color: var(--accent);
}

.logout-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.08);
    color: #EDEAE2;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}
.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.logout-button {
    padding: 7px 10px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.08);
    color: #EDEAE2;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}
.logout-button:hover {
   background: rgba(255, 255, 255, 0.15);
   color: #fff;
}

/*forms*/
.google-page {
    min-height: 100vh;
    background: var(--bg);
    padding: 32px 16px 60px;
}

.google-form {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
}

.form-header {
    background: var(--surface);
    border-radius: 10px;
    padding: 24px 28px;
    margin-bottom: 12px;
    border: 0.5px solid var(--border);
    border-top: 7px solid var(--accent);
    box-shadow: 0 1px 2px rgba(30, 26, 20, 0.08);
}

.form-title {
    font-size: 26px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 10px;
}

.form-description {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
}

.form-card {
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: 10px;
    padding: 24px 28px;
    margin-bottom: 12px;
    box-shadow: 0 1px 2px rgba(30, 26, 20, 0.06);
}

.question-title {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 12px;
    font-weight: 600;
}

.required {
    color: var(--danger);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    box-sizing: border-box;
    border: none;
    border-bottom: 1px solid var(--border-strong);
    padding: 10px 2px;
    font-size: 14px;
    color: var(--text-primary);
    background: transparent;
    outline: none;
    font-family: var(--font-sans);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-bottom: 2px solid var(--accent);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
    border-bottom-color: var(--accent);

}

.form-textarea {
    min-height: 90px;
    resize: vertical;
}

.section-card {
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: 10px 10px 0 0;
    margin-bottom: 0;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(30, 26, 20, 0.06);
}

.section-title {
    margin: 0;
    padding: 12px 28px;
    background: var(--accent);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

.section-description {
    margin: 0;
    padding: 16px 28px 20px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

.section-card + .form-card {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-top: none;
}

.expected-hint {
    margin-top: 8px;
    color: var(--text-tertiary);
    font-size: 12px;
}

.error-box {
    background: var(--danger-soft);
    color: var(--danger);
    border: 0.5px solid rgba(181, 74, 63, 0.2);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
    font-size: 13px;
}

.form-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.form-button {
    border: none;
    border-radius: 8px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-sans);
}

.next-button {
    background: var(--accent);
    color: #fff;
}

.next-button:hover {
    background: var(--accent-hover);
}

.back-button {
    background: var(--surface);
    color: var(--text-primary);
    border: 0.5px solid var(--border-strong);
}

    .back-button:hover {
        background: #F1EEE6;
    }

.form-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.progress-container {
    flex: 1;
    height: 6px;
    background: #EDEAE1;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 0.2s ease;
}

.page-number {
    color: var(--text-secondary);
    font-size: 12px;
    white-space: nowrap;
}

.submitted-card {
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: 10px;
    padding: 40px 28px;
    text-align: center;
    box-shadow: 0 1px 2px rgba(30, 26, 20, 0.06);
}

.submitted-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.submitted-text {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 24px;
}

@media (max-width: 600px) {

    .google-page {
        padding: 16px 8px 40px;
    }

    .form-header,
    .form-card,
    .submitted-card {
        padding: 20px;
    }

    .section-title,
    .section-description {
        padding-left: 20px;
        padding-right: 20px;
    }

    .form-title {
        font-size: 22px;
    }

    .form-footer {
        flex-wrap: wrap;
    }

    .progress-container {
        order: 3;
        flex-basis: 100%;
    }
}
/*Links*/
.generated-link-card {
    margin-top: 16px;
    padding: 18px;
    background: var(--success-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.generated-link-title {
    font-weight: 600;
    color: var(--text-primary);
    margin: 4px 0;
}

.generated-link-text,
.generated-link-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}
.generated-link-box {
    display: flex;
    gap: 8px;
}

.generated-link-input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.copy-link-button {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    background: #35633B;
    color: white;
    cursor: pointer;
}
.copy-link-button:hover {
   background: #294F2F;
}
/*dashbaord*/
.dashboard-page {
    padding: 24px 40px 40px;
}

.dashboard-header {
    margin-bottom: 22px;
}

.dashboard-breadcrumb {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 7px;
}

.dashboard-title {
    font-size: 22px;
    color: var(--text-primary);
}

.dashboard-subtitle {
    margin-top: 5px;
    font-size: 13px;
    color: var(--text-secondary);
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.dashboard-stat {
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: 10px;
    padding: 15px 18px;
}

.dashboard-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.dashboard-stat-value {
    margin-top: 5px;
    font-size: 23px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.dashboard-stat.submitted {
    border-left: 3px solid var(--success);
}

.dashboard-stat.pending {
    border-left: 3px solid var(--accent);
}

.dashboard-filters {
    display: flex;
    align-items: end;
    gap: 12px;
    padding: 15px 18px;
    margin-bottom: 18px;
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: 10px;
}
.dashboard-filter {
    min-width: 170px;
}

.dashboard-filter label {
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);

}
.dashboard-filter .form-control,
.dashboard-filter .form-select {
   
    height: 38px;
    border: 0.5px solid var(--border-strong);
    border-radius: 7px;
    padding: 7px 10px;
    background: #FBFAF7;
    color: var(--text-primary);
    font-size: 13px;
}
 .dashboard-filter .form-control:focus,
 .dashboard-filter .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(184, 112, 58, 0.12);
    outline: none;
 }
.dashboard-table {
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.dashboard-table-scroll {
    overflow-x: auto;
}
.report-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}
.report-status.submitted {
    background: var(--success-soft);
    color: var(--success);
}
.report-status.pending {
    background: var(--accent-soft);
    color: var(--accent);

}

.report-view-button {
    padding: 6px 12px;
    border-radius: 6px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
}
.report-edit-button {
    padding: 6px 12px;
    border-radius: 6px;
    background: #ECE9E2;
    color: #5C554A;
    font-size: 12px;
    font-weight: 600;
}

.report-edit-button:hover {
    background: #5C554A;
    color: white;
}

.report-view-button:hover {
    background: var(--accent);
    color: white;
}

@media (max-width: 900px) {

    .dashboard-page {
        padding: 20px;
    }

    .dashboard-filters {
        flex-wrap: wrap;
    }

    .dashboard-filter {
        flex: 1;
        min-width: 180px;
    }
}

@media (max-width: 600px) {

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .dashboard-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-filter {
        width: 100%;
    }
}
.wizard-item {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    align-items: center;
}

.wizard-item .form-control {
        flex: 1;
}

.review-section h4 {
    margin-top: 22px;
    margin-bottom: 10px;
}

.vendor-modal {
    width: min(900px, 95vw);
    height: 650px;
    max-height: 90vh;
    padding: 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.vendor-modal .vendor-details {
     flex: 1;
     min-height: 0;
     overflow-y: auto;
     padding: 18px 24px;

}

.vendor-modal .modal-header {
     flex-shrink: 0;

}

.vendor-modal > div[style*="padding:18px 24px 0"] {
     flex-shrink: 0;

}

.vendor-modal .modal-footer {
     flex-shrink: 0;

}

 .vendor-modal .detail-section h3 {
      margin-top: 0;
      margin-bottom: 18px;
 }

.vendor-modal .detail-section h4 
{
     margin-top: 20px;
     margin-bottom: 10px;

}  
.vendor-modal .detail-row {
      margin-bottom: 12px;
}

.add-vendor-modal {
    width: min(900px, 95vw);
    height: 650px;
    max-height: 90vh;
}

 .add-vendor-modal .form-control {
        width: 100%;
        border: none;
        border-bottom: 1px solid var(--border-strong);
        border-radius: 0;
        padding: 9px 2px;
        background: transparent;
        outline: none;
        font-size: 14px;
 }
 .add-vendor-modal .form-control:focus {
        border-bottom: 2px solid var(--accent);
 }

 .add-vendor-modal textarea.form-control {
        resize: vertical;
        min-height: 40px;
 }

@media (max-width: 600px) {
    .vendor-modal {
        width: 95vw;
        height: 90vh;
        max-height: 90vh;
    }

    .vendor-modal .vendor-details {
        padding: 16px 18px;
    }
}
.loc-card {
    position: relative;
}

.loc-code {
    position: absolute;
    top: 14px;
    right: 14px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    background: #f1eee8;
}
/* ===== Deliveries ===== */
.dl-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: currentColor; }
.dl-badge { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.dl-s-preparing { background: #F1E4D6; color: #7A4416; }
.dl-s-sending { background: #E1EBF3; color: #2B5780; }
.dl-s-received { background: #E3EEE1; color: #2F6034; }
.dl-s-rejected { background: #F5E3DF; color: #8E3329; }
.dl-s-cancelled { background: #ECE9E2; color: #5C554A; }
.dl-c-preparing { color: #B8703A; }
.dl-c-sending { color: #3F6E9A; }
.dl-c-received { color: #4B7F52; }
.dl-c-rejected { color: #B54A3F; }
.dl-c-cancelled { color: #8A8275; }

.dl-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.dl-chip { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 999px; border: 0.5px solid var(--border-strong); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--text-primary); cursor: pointer; }
.dl-chip.active { background: var(--text-primary); color: #fff; border-color: var(--text-primary); }
.dl-chip .n { font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.dl-chip.active .n { color: #D9D3C6; }

.dl-board { display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; padding-bottom: 8px; }
.dl-col { background: #EEEAE0; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; flex: 1 0 216px; min-width: 216px; }
.dl-colh { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; padding: 2px 2px 4px; }
.dl-colh .n { margin-left: auto; font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.dl-card { background: var(--surface); border: 0.5px solid var(--border); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 6px; color: var(--text-primary); text-decoration: none; }
.dl-card:hover { border-color: var(--accent); }
.dl-card-top { display: flex; justify-content: space-between; align-items: center; }
.dl-no { font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--accent-hover); }
.dl-muted { font-size: 12px; color: var(--text-secondary); }
.dl-vendor { font-weight: 600; font-size: 14px; }
.dl-meta { font-size: 12px; color: var(--text-secondary); border-top: 0.5px solid var(--border); padding-top: 6px; margin-top: 2px; }
.dl-more { font-size: 13px; color: var(--text-secondary); text-align: center; padding: 6px; background: transparent; cursor: pointer; }
.dl-col-empty { font-size: 12px; color: var(--text-tertiary); text-align: center; padding: 18px 0; }

.dl-form { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.dl-main { flex: 1 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.dl-side { flex: 0 0 340px; max-width: 100%; }
.dl-card-panel { background: var(--surface); border: 0.5px solid var(--border); border-radius: 12px; padding: 20px 22px; }
.dl-card-panel h2 { margin: 0 0 14px; font-size: 16px; font-weight: 600; }
.dl-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.dl-span2 { grid-column: span 2; }
.dl-hint { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.dl-addrow { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.dl-addrow select { flex: 1 1 240px; }
.dl-trow { display: grid; grid-template-columns: 170px minmax(0, 1fr) 100px 120px 36px; gap: 12px; align-items: start; padding: 12px 0; border-top: 0.5px solid var(--border); font-size: 13px;}.dl-trow.head { border-top: 0; padding: 0 0 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-tertiary); }
.dl-trow input, .dl-trow select { border: 0.5px solid var(--border-strong); border-radius: 8px; padding: 8px 10px; font-size: 13px; font-family: inherit; width: 100%; background: var(--surface); }
.dl-trow input.num { text-align: right; font-family: var(--font-mono); }
.dl-trow input.invalid { border-color: var(--danger); background: var(--danger-soft); }
.dl-trow.ro { grid-template-columns: minmax(0, 2fr) 120px; }
.dl-rm { width: 34px; height: 34px; border-radius: 8px; border: 0.5px solid var(--border-strong); background: var(--surface); color: var(--danger); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.dl-rm svg { width: 14px; height: 14px; }
.dl-sub { font-size: 11px; color: var(--text-secondary); }
.dl-sumline { display: flex; justify-content: space-between; align-items: center; font-size: 14px; padding: 5px 0; }
.dl-sumline span:first-child { color: var(--text-secondary); }
.dl-total { background: var(--bg); border-radius: 10px; padding: 14px; margin: 14px 0; }
.dl-total .big { font-family: var(--font-mono); font-size: 24px; font-weight: 500; }
.dl-check { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text-secondary); padding: 3px 0; }
.dl-check.ok { color: var(--success); }
.dl-check svg { width: 15px; height: 15px; flex: none; }
.dl-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.dl-actions .btn { justify-content: center; }
.dl-error { background: var(--danger-soft); color: var(--danger); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.dl-info { background: #E1EBF3; color: #2B5780; border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 10px; }
.dl-stepper { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.dl-step { display: flex; align-items: center; gap: 10px; }
.dl-step-c { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; background: #ECE9E2; color: #5C554A; flex: none; }
.dl-step-c svg { width: 16px; height: 16px; }
.dl-step.done .dl-step-c { background: #2F6034; color: #fff; }
.dl-step.current .dl-step-c { background: #2B5780; color: #fff; }
.dl-step.ended .dl-step-c { background: #8E3329; color: #fff; }
.dl-bar { height: 2px; flex: 1 1 24px; min-width: 24px; background: var(--border-strong); border-radius: 2px; }
.dl-bar.done { background: #2F6034; }
.dl-kv { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; font-size: 14px; margin: 0; }
.dl-kv dt { color: var(--text-secondary); }
.dl-kv dd { margin: 0; font-weight: 500; }
.dl-tl { display: flex; gap: 12px; }
.dl-tl .d { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex: none; background: var(--accent); }
.dl-btn-ok { background: #2F6034; color: #fff; }
.dl-btn-ok:hover:not(:disabled) { background: #264F2B; }
.dl-actionbar { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 720px) {
  .dl-trow { grid-template-columns: 1fr 1fr; }
  .dl-trow.head { display: none; }
  .dl-grid2 { grid-template-columns: 1fr; }
  .dl-span2 { grid-column: auto; }
}

.stock-warning {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    background: #fce8e6;
    color: #b42318;
}

.btn-delivery {
    background: var(--accent-soft);
    color: var(--accent);
}
.btn-delivery:hover:not(:disabled) {
   background: #E8D5C2;
   color: var(--accent-hover);
}

/*delivery forms*/
.do-stage {
    background: var(--bg); 
    padding: 24px;
}
.do-sheet {
    background: #fff;
    color: #222;
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    padding: 14mm 14mm 12mm;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    line-height: 1.45;
    box-shadow: 0 2px 12px rgba(0,0,0,.12);
}

.do-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.do-logo {
    height: 52px;
}

.do-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f3864;
    margin-top: 6px;
    letter-spacing: .3px;
}

.do-cols {
    display: flex;
    justify-content: space-between;
    margin-top: 14px;
}

.do-label {
    font-weight: 1000;
    color: #7f7f7f;
}

.do-from-right {
    text-align: right;
}

.do-meta b {
    margin-right: 4px;
}

.do-ph {
    color: #7f7f7f;
    font-style: italic;
}

.do-to {
    margin-top: 16px;
}

.do-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

 .do-table th {
      background: #1f3864;
      color: #fff;
      font-weight: 500;
      border: 1px solid #1f3864;
      padding: 5px 4px;
      text-align: center;
      font-size: 10.5px;
 }

  .do-table td {
       border: 1px solid #1f3864;
       padding: 6px 5px;
       vertical-align: middle;
       height: 34px;
  }

  .do-table tbody tr:nth-child(odd):not(.do-total) td {
      background: #dce6f1;
  }

  .do-table .c {
      text-align: center;
  }
 
 .do-table .r {
     text-align: right;
     font-weight: 700;
     border: 0;
     border-left: 1px solid var(--sidebar-bg); 
     background: #fff !important;
 }

.do-table .do-total td {
    height: 22px;
}

.do-table .do-total td:nth-child(n+2) {
    background: #fff;
}
    .do-table tbody tr:last-child td {
        border-bottom: 1px solid #1f3864;
    }

.do-sku {
    color: #7f7f7f;
    font-size: 9.5px;
    margin-left: 4px;
}

.do-note {
    margin-top: 12px;
    color: #7f7f7f;
    font-style: italic;
    min-height: 30px;
}

.do-sign {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    margin-top: 36px;
}
.do-sign > div {
     flex: 1;
}

.do-signby {
    font-weight: 700;
    margin-bottom: 18px;
}

.do-line-row {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    margin-top: 4px;
}

.do-line {
    flex: 1;
    border-bottom: 1px solid #222;
    height: 14px;
}

.do-sp {
    margin-top: 26px;
}

@page {
    size: A4;
    margin: 0;
}

@media print {
    body * {
        visibility: hidden;
    }

    .do-sheet, .do-sheet * {
        visibility: visible;
    }
    .do-sheet {
        position: absolute;
        left: 0;
        top: 0;
        width: 210mm;
        min-height: 0;
        margin: 0;
        box-shadow: none;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
.do-noprint {
        display: none !important;
}
}
/*invoice*/
.invoice-stage {
    background: var(--bg);
    padding: 24px;
}

.invoice-sheet {
    width: 297mm;
    min-height: 210mm;
    margin: 0 auto;
    padding: 14mm;
    box-sizing: border-box;
    background: #fff;
    color: #222;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10px;
    line-height: 1.4;
    box-shadow: 0 2px 12px rgba(0,0,0,.12);
}

.invoice-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.invoice-logo {
    width: 90px;
    height: auto;
}

.invoice-title {
    font-size: 20px;
    font-weight: 700;
    margin-top: 5px;
}

.invoice-top {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
}

.invoice-from {
    line-height: 1.7;
    font-size:11px;
}

.invoice-small-label {
    font-size: 12px;
    font-weight: 700;
    color: #777;
    margin-bottom: 2px;
}

.invoice-right {
    width: 180px;
    font-size:11px;
    line-height: 1.8;
}
 
.invoice-right div {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.invoice-right b {
    font-weight: 600;

}

.invoice-billto {
    margin-top: 12px;
    line-height: 1.6;
    font-size:11px;
}

.invoice-billto strong {
    font-size: 12px;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.invoice-table th {
    background: #1f3864;
    color: #fff;
    font-weight: 500;
    border: 1px solid #1f3864;
    padding: 4px;
    font-size: 12px;
    text-align: left;
}
.invoice-table td {
      border: 1px solid #1f3864;
    padding: 4px;
    height: 18px;
}

.invoice-table tbody tr:nth-child(odd) td {
    background: #dce6f1;
}

.invoice-table tbody tr:last-child td {
    border-bottom: 1px solid #1f3864;
}

.invoice-section-title {
    color: #1f3864;
    font-weight: 700;
    font-size: 12px;
    margin-bottom: 3px;
}

.invoice-table th:nth-child(2),
 .invoice-table th:nth-child(3) {
    width: 60px;
    text-align: center;
}

.invoice-table th:nth-child(4),
  .invoice-table th:nth-child(5) {
    width: 95px;
    text-align: right;

}

.invoice-table td {
     border: 1px solid #bbb;
     padding: 4px;
     height: 18px;
}

.invoice-table tbody tr:nth-child(odd) td {
    background: #dce6f1;
}
.invoice-table tbody tr:last-child td {
    border-bottom: 1px solid var(--sidebar-bg);
    background: #dce6f1; }

.invoice-table .center {
    text-align: center;
}
    
.invoice-table .right {
    text-align: right;}

.invoice-sku {
    color: #777;
    font-size: 8px;
}

.invoice-empty-row td {
    height: 18px;
}

.invoice-totals {
    width: 22%;
    margin-left: auto;
    margin-top: 10px;
    font-size:11px;
}

.invoice-totals > div {
    display: flex;
    justify-content: space-between;
    padding: 2px 4px; }

.invoice-grand-total {
    font-weight: 700;
}

.invoice-payment {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 14px;
    font-size: 12px;
}

.invoice-section-title {
    color: #1739a6;
    font-weight: 700;
    font-size:12px;
    margin-bottom: 3px;
}


@page {
    size: A4 landscape;
    margin: 0;
}

@media print {

    body * {
        visibility: hidden;
    }

    .invoice-sheet,
    .invoice-sheet * {
        visibility: visible;
    }

    .invoice-sheet {
        position: absolute;
        left: 0;
        top: 0;
        width: 297mm;
        min-height: 210mm;
        margin: 0;
        box-shadow: none;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .do-noprint {
        display: none !important;
    }
}
/*location tab */
.location-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    overflow-x: auto;
    border-bottom: 0.5px solid var(--border);
}

.location-tab {
    min-width: 150px;
    padding: 13px 18px;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 8px 8px 0 0;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
}
.location-tab:hover {
    background: var(--accent-soft);
}

.location-tab.active {
    background: var(--accent);
    color: #fff;
    border-bottom-color: var(--accent);
}

.location-tab-name {
    font-size: 14px;
    font-weight: 600;
}

.location-tab-packs {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-tertiary);
}

.location-tab.active .location-tab-packs {
    color: rgba(255, 255, 255, 0.8);
}

.location-heading {
    margin-bottom: 16px;
}

.location-stat-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    display: grid; gap: 12px;
}

.location-stock-panel {
    margin-top: 20px;
}

.panel-header {
    padding: 16px 18px;
    border-bottom: 0.5px solid var(--border);
}

.panel-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.location-packs-header,
.location-packs-cell {
    text-align: right;
}

.location-table-scroll {
    overflow-x: auto;
}

@media (max-width: 700px) {
    .location-stat-row {
        grid-template-columns: 1fr;
    }

    .location-tab {
        min-width: 135px;
        padding: 12px 14px;
    }
}
.location-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: #F1E4D6;
    border-bottom: 0.5px solid var(--border);
}

.location-filter label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.location-filter select {
    min-width: 300px;
    padding: 8px 32px 8px 10px;
    border: 0.5px solid var(--border-strong);
    border-radius: 7px;
    background: var(--surface);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

.location-filter select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(184, 112, 58, 0.12);
}

.stock-tally {
    margin-top: 12px;
    padding: 12px;
    border: 0.5px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.8;
}

    .stock-tally strong {
        font-family: var(--font-mono);
    }

.success {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    background: var(--success-soft);
    color: var(--success);
    font-weight: 600;
}

.warning {
    margin-top: 8px;
    padding: 10px;
    border: 1px solid rgba(181, 74, 63, 0.2);
    border-radius: 6px;
    background: var(--danger-soft);
    color: var(--danger);
    font-weight: 600;
}
.vendor-dashboard-stat-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}  
@media (max-width: 1000px) {
    .vendor-dashboard-stat-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 600px) {
    .vendor-dashboard-stat-row {
        grid-template-columns: 1fr;
    }
}

.dashboard-section {
    margin-top: 20px;
}

.dashboard-section summary {
    cursor: pointer;
    font-weight: 600;
    padding: 12px;
    background: #FBFAF7;
    border: 1px solid #E7E2DA;
    border-radius: 6px;
}

.dashboard-section-content {
    margin-top: 12px;
}

.invoice-status {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.invoice-status.drafted {
    background: #fef3c7;
    color: #92400e;

}
.invoice-status.approved {
    background: #dbeafe;
    color: #1d4ed8; }

.invoice-status.sent {
    background: #dcfce7;
    color: #166534;

}

.popup.modal {
    width: 100%;
    max-width: 650px;
    height: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.popup .modal-header {
    flex-shrink: 0;
}

.popup .modal-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg);
}

.popup .popup-card {
    background: var(--surface);
    border: 0.5px solid var(--border);
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
}

.popup .popup-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px;
    background: var(--accent-soft);
    border-bottom: 0.5px solid var(--border);
}

.popup .popup-card-title {
    font-weight: 600;
    color: var(--text-primary);
}

.popup .popup-card-subtitle,.popup .popup-card-count {
    font-size: 15px;
    color: var(--text-secondary);
}

.popup .popup-card-body {
    padding: 0 14px;
}

.popup .quick-view-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 0.5px solid var(--border);
}

.popup .quick-view-item:last-child {
    border-bottom: none;
}

.popup .dl-sub,.popup .dl-muted {
    font-size: 10px;
    color: var(--text-secondary);
}

/*po*/
.po-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.6);
}

.po-modal {
    width: 100%;
    max-width: 1000px;
    max-height: 95vh;
    overflow: auto;
    padding: 24px;
    background: #fff;
    border-radius: 12px;
}
.po-sheet {
    box-sizing: border-box;
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    padding: 20mm;
    display: flex;
    flex-direction: column;
    background: #fff;
    color: #000;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10pt;
    line-height: 1.4;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}
.po-row {
    display: flex;
    align-items: flex-start;
    gap: 12pt;
    margin-bottom: 10pt;
}

    .po-row > div {
        flex: 1;
        min-width: 0;
    }

    .po-row > .po-logo {
        flex: 0 0 25%;
    }

    .po-row > .po-order {
        flex: 0 0 120pt;
    }

.po-logo img {
    display: block;
    height: 60pt;
    max-width: 100%;
    object-fit: contain;
}
.po-title {
    padding: 12pt 0;
    text-align: center;
    font-size: 16pt;
    font-weight: 700;
}

.po-sheet table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.po-sheet th,
.po-sheet td {
    padding: 5pt;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10pt;
    text-align: left;
    vertical-align: top;
    background: #fff;
    color: #000;
    border: 0;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 400;
    overflow-wrap: anywhere;
}

.po-sheet th {
    font-weight: 700;
}

.po-sheet .bd {
    border: 1px solid #000;
}

.po-sheet .c {
    text-align: center;
}

.po-sheet .r {
    text-align: right;
}

.po-sheet b {
    font-weight: 700;
}

.po-terms {
    border: 1px solid #000;
    padding: 8pt;
    margin: 12pt 0;
    font-size: 9pt;
}

.po-sign {
    padding-top: 20pt;
}

.po-footer {
    margin-top: auto;
    padding-top: 30pt;
    text-align: center;
    font-size: 9pt;
}

@page {
    size: A4 portrait;
    margin: 0;
}

@media print {
    html,
    body {
        width: 210mm !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
    }

        body * {
            visibility: hidden !important;
        }

    .po-overlay {
        position: static !important;
        display: block !important;
        width: 210mm !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
    }

    .po-modal {
        position: static !important;
        width: 210mm !important;
        max-width: none !important;
        max-height: none !important;
        height: auto !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 0 !important;
        background: #fff !important;
        box-shadow: none !important;
    }

    .po-sheet,
    .po-sheet * {
        visibility: visible !important;
    }

    .po-sheet {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 210mm !important;
        min-height: 297mm !important;
        margin: 0 !important;
        padding: 20mm !important;
        box-shadow: none !important;
        background: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .po-noprint,
    .do-noprint {
        display: none !important;
    }
}
.po-status {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.po-status.created {
    background: #fef3c7;
    color: #92400e;
}

.po-status.delivered {
    background: var(--success-soft);
    color: var(--success);
}

.po-status.cancelled {
    background: var(--danger-soft);
    color: var(--danger);
}
.dl-step.cancelled .dl-step-c {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

.dl-bar.cancelled {
    background-color: #dc3545;
}

.sm-page {
    min-width: 0;
    color: var(--text-primary);
    background: var(--bg);
    min-height: 100%;
}

.sm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.sm-breadcrumb {
    color: var(--text-tertiary);
    font-size: 12px;
    margin-bottom: 8px;
}

.sm-header h1 {
    color: var(--text-primary);
    font-size: 27px;
    font-weight: 750;
    margin: 0;
}

.sm-header p,
.sm-section-heading p,
.sm-detail-heading p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 6px 0 0;
}

.sm-header-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    color: var(--accent);
    background: var(--accent-soft);
    font-size: 27px;
}

.sm-filter-card,
.sm-summary-card,
.sm-table-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.sm-filter-card {
    padding: 20px;
    margin-bottom: 20px;
}

.sm-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.sm-filter-grid label {
    display: block;
    font-size: 12px;
    font-weight: 650;
    color: var(--text-secondary);
    margin-bottom: 7px;
}

.sm-filter-grid .form-control,
.sm-filter-grid .form-select {
    min-height: 42px;
    border-color: var(--border);
    background-color: var(--surface);
    color: var(--text-primary);     font-size: 14px; }

.sm-filter-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.sm-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.sm-summary-card {
    padding: 19px;
}

.sm-summary-label {
    color: var(--text-secondary);
    font-size: 13px;
}

.sm-summary-value {
    color: var(--text-primary);
    font-size: 28px;
    font-weight: 750;
    margin: 7px 0 4px;
}

.sm-summary-note {
    color: var(--text-tertiary);
    font-size: 12px;
}

.sm-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 15px;
}

.sm-section-heading h2 {
   color: var(--text-primary);font-size: 20px;
   font-weight: 750;
   margin: 0;
}

.sm-count {
    background: var(--accent-soft);
    border-radius: 20px;
    padding: 6px 12px;
    color: var(--text-secondary);
    font-size: 12px;
}

.sm-table-card {
    overflow: hidden;
}

.sm-table-scroll,
.sm-history-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.sm-table {
    min-width: 850px;
    margin: 0;
    color: var(--text-primary);
}

.sm-history-table {
    min-width: 850px;
    margin: 0;
    color: var(--text-primary);
}

.sm-table thead th,.sm-history-table thead th {
    background: var(--bg);
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .035em;
    white-space: nowrap;
    padding: 15px 16px;
    border-bottom: 1px solid var(--border);
}

.sm-table tbody td,.sm-history-table tbody td {
    padding: 15px 16px;
    vertical-align: middle;
    border-color: var(--border);
    font-size: 13px;
    white-space: nowrap;
}

.sm-item-button {
    border: 0;
    background: transparent;
    display: flex;
    gap: 11px;
    align-items: center;
    text-align: left;
    padding: 0;
    color: var(--text-primary);
}

.sm-item-button strong {
    display: block;
    font-size: 14px;
}

.sm-item-button small {
    display: block;
    color: var(--text-tertiary);    
    font-size: 11px;
    margin-top: 4px;
}

.sm-expand {
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 18px;
    flex-shrink: 0;
}

.sm-item-button:hover .sm-expand {
    border-color: var(--accent);
    color: var(--accent);
}

.sm-detail-row > td {
    padding: 0 !important;
    background: var(--bg);
}

.sm-detail-panel {
    padding: 22px;
}

.sm-detail-heading h3 {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 750;
    margin: 0;
}

.sm-history-scroll {
    margin-top: 17px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
}

.sm-history-table thead th {
    background: var(--accent-soft);
}

.sm-status {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 650;
}

.sm-status-ok {
    color: var(--success);
    background: var(--success-soft);
}

.sm-status-warning {
    color: var(--danger);
    background: var(--danger-soft);
}

.sm-negative {
    color: var(--danger);
    font-weight: 700;
}

.sm-positive {
    color: var(--success);
    font-weight: 700;
}

.sm-formula {
    margin-top: 15px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.7;
}

.sm-empty {
    text-align: center;
    padding: 45px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text-secondary);
}

@@media (max-width: 1000px) {
    .sm-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sm-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@@media (max-width: 600px) {
    .sm-page {
        padding: 14px;
    }

    .sm-filter-grid {
        grid-template-columns: 1fr;
    }

    .sm-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .sm-summary-card {
        padding: 13px;
    }

    .sm-summary-value {
        font-size: 23px;
    }

    .sm-detail-panel {
        padding: 14px;
    }
}
.sa-tabs {
    margin-bottom: 20px;
    width: fit-content;
    max-width: 100%;
    overflow-x: auto;
    padding: 4px;
    background: var(--accent-soft);
    border-radius: 12px;
}

.sa-tabs .type-tab {
   padding: 10px 20px;
   border-radius: 9px;
   font-size: 13px;
   white-space: nowrap;
}
 
.sa-tabs .type-tab.active {
   background: var(--accent);
   color: #fff;
}

.sa-gap {
    margin-top: 28px;
}

.sa-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

.sa-status-low {
    color: #92400e;
    background: #fef3c7;
}

.sa-status-idle {
    color: var(--text-secondary);
    background: #ECE9E2;
}

.sa-bars {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sa-bar-row {
    display: grid;
    grid-template-columns: 160px 1fr 70px;
    gap: 12px;
    align-items: center;
    font-size: 13px;
}

.sa-bar-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sa-bar-track {
    height: 10px;
    background: var(--accent-soft);
    border-radius: 6px;
    overflow: hidden;
}

.sa-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 6px;
}

.sa-bar-val {
    text-align: right;
    font-family: var(--font-mono);
    font-weight: 600;
}

@@media (max-width: 600px) {
    .sa-bar-row {
        grid-template-columns: 100px 1fr 55px;
    }
}
