/* ============================================================
   MIDESA Steel Trade — SAP Fiori–Inspired Enterprise Theme
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
  --sap-blue:         #0064D9;
  --sap-blue-dark:    #003D8F;
  --sap-blue-hover:   #0058C0;
  --sap-blue-light:   #EBF4FF;
  --sap-blue-subtle:  #D1E8FF;

  --shell-bg:         #1B2A3B;
  --shell-bg-hover:   #243547;
  --shell-text:       #C8DDF0;
  --shell-text-muted: #7B9BB8;
  --shell-active-bg:  #0064D9;
  --shell-active-txt: #FFFFFF;
  --shell-section:    #4A6880;
  --shell-width:      240px;
  --shell-collapsed:  56px;

  --header-h:         56px;
  --header-bg:        #FFFFFF;
  --header-border:    #E2E5E9;
  --header-text:      #1D2129;
  --header-text-sub:  #5A6872;

  --bg-page:          #F0F2F4;
  --bg-card:          #FFFFFF;
  --bg-table-head:    #F5F6F7;
  --bg-row-alt:       #FAFBFC;
  --bg-row-hover:     #EBF4FF;
  --bg-row-selected:  #D1E8FF;

  --border:           #D1D5DA;
  --border-light:     #E8EAEC;

  --text-main:        #1D2129;
  --text-sub:         #5A6872;
  --text-label:       #6E788A;
  --text-link:        #0064D9;

  --positive:         #177A17;
  --positive-bg:      #EAFAEA;
  --negative:         #BB0000;
  --negative-bg:      #FFF0F0;
  --warning:          #C44800;
  --warning-bg:       #FFF3EB;
  --neutral:          #5A6872;
  --neutral-bg:       #F0F2F4;

  --radius-sm:        4px;
  --radius:           6px;
  --radius-lg:        8px;

  --shadow-sm:        0 1px 3px rgba(0,0,0,.08);
  --shadow:           0 2px 8px rgba(0,0,0,.10);
  --shadow-lg:        0 4px 20px rgba(0,0,0,.12);

  --font:             "72", Arial, "Helvetica Neue", sans-serif;
  --font-mono:        "SFMono-Regular", Consolas, monospace;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; }

body {
  font-family: var(--font);
  background: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text-link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Shell Header ---------- */
.shell-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--header-bg);
  display: flex;
  align-items: center;
  padding: 0 16px;
  z-index: 200;
  border-bottom: 1px solid var(--header-border);
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  gap: 12px;
}

.shell-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--header-text);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .3px;
  min-width: 0;
}

.shell-header .brand img {
  height: 44px;
  width: auto;
  object-fit: contain;
}

.shell-header .brand-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shell-header .header-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
}

.shell-header .page-context {
  flex: 1;
  color: var(--header-text-sub);
  font-size: 13px;
  font-weight: 400;
}

.shell-header .header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shell-header .btn-icon {
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius-sm);
  color: var(--text-sub);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: background .15s, border-color .15s;
}
.shell-header .btn-icon:hover {
  background: var(--bg-row-hover);
  border-color: var(--sap-blue);
  color: var(--sap-blue);
}

/* ---------- Collapsible Nav Groups ---------- */
.nav-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 4px;
  cursor: pointer;
  user-select: none;
}

.nav-group-header:hover .nav-section-label { color: #8CAEC8; }

.nav-chevron {
  font-size: 10px;
  color: var(--shell-section);
  transition: transform .22s ease;
  flex-shrink: 0;
}

.nav-group.open .nav-chevron { transform: rotate(180deg); }

.nav-group-body {
  overflow: hidden;
  max-height: 0;
  transition: max-height .25s ease;
}

.nav-group.open > .nav-group-body { max-height: 600px; }

/* Nested group body: only open when the nested group itself has .open */
.nav-group .nav-group > .nav-group-body { max-height: 0; }
.nav-group .nav-group.open > .nav-group-body { max-height: 300px; }

/* Collapsed state */
.nav-group-icon {
  display: none;           /* hidden in expanded mode */
  font-size: 18px;
  color: var(--shell-text-muted);
  min-width: 20px;
  text-align: center;
}

#sidenav.collapsed .nav-chevron      { display: none; }
#sidenav.collapsed .nav-section-label { display: none; }
#sidenav.collapsed .nav-group-icon   { display: block; }
#sidenav.collapsed .nav-group-body   { max-height: 0 !important; } /* sub-items hidden */
#sidenav.collapsed .nav-group-header {
  justify-content: center;
  padding: 12px 0;
}
#sidenav.collapsed .nav-group-header:hover .nav-group-icon { color: #fff; }

/* ---------- Side Navigation ---------- */
#sidenav {
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  width: var(--shell-width);
  background: var(--shell-bg);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 150;
  transition: width .22s ease;
  scrollbar-width: thin;
  scrollbar-color: #2d4a63 transparent;
}

#sidenav.collapsed { width: var(--shell-collapsed); }

#sidenav .nav-inner { padding: 8px 0 24px; }

.nav-section-label {
  padding: 16px 16px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--shell-section);
  white-space: nowrap;
  overflow: hidden;
  transition: opacity .15s;
}
#sidenav.collapsed .nav-section-label { opacity: 0; }

.nav-item-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  color: var(--shell-text);
  font-size: 13.5px;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  transition: background .15s, color .15s;
  cursor: pointer;
  border-left: 3px solid transparent;
}

.nav-item-link:hover {
  background: var(--shell-bg-hover);
  color: #fff;
  text-decoration: none;
}

.nav-item-link.active {
  background: rgba(0,100,217,.20);
  color: #fff;
  border-left-color: var(--sap-blue);
  font-weight: 600;
}

.nav-item-link .nav-icon {
  font-size: 16px;
  min-width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-item-link .nav-label {
  transition: opacity .15s;
}
#sidenav.collapsed .nav-label { opacity: 0; pointer-events: none; }

/* ---------- Page Wrapper ---------- */
#page-wrapper {
  margin-top: var(--header-h);
  margin-left: var(--shell-width);
  min-height: calc(100vh - var(--header-h));
  transition: margin-left .22s ease;
  display: flex;
  flex-direction: column;
}

#page-wrapper.nav-collapsed { margin-left: var(--shell-collapsed); }

/* ---------- Page Header (breadcrumb bar) ---------- */
.page-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  padding: 0 28px;
  display: flex;
  align-items: center;
  height: 52px;
  gap: 16px;
}

.page-header h1 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  flex: 1;
}

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

/* ---------- Flash Messages ---------- */
.flash-zone {
  padding: 0 28px;
  margin-top: 12px;
}

.flash-zone .alert {
  font-size: 13px;
  border-radius: var(--radius);
  border: none;
  padding: 10px 16px;
}

.alert-success { background: var(--positive-bg); color: var(--positive); }
.alert-danger   { background: var(--negative-bg); color: var(--negative); }
.alert-warning  { background: var(--warning-bg);  color: var(--warning);  }
.alert-info     { background: var(--sap-blue-light); color: var(--sap-blue-dark); }

/* ---------- Main Content ---------- */
.page-content {
  padding: 20px 28px 40px;
  flex: 1;
}

/* ---------- Section Card ---------- */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: visible;
  margin-bottom: 20px;
}

/* Keep rounded corners on header/first child without overflow:hidden on card */
.section-card > *:first-child { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.section-card > *:last-child  { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

.sap-table-wrap {
  overflow-x: auto;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.section-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-card);
}

.section-card-header .sc-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-card-header .sc-title i {
  color: var(--sap-blue);
  font-size: 15px;
}

.section-card-body { padding: 20px; }

/* ---------- SAP Table ---------- */
.sap-table-wrap { overflow-x: auto; }

.sap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.sap-table thead th {
  background: var(--bg-table-head);
  border-bottom: 2px solid var(--border);
  padding: 9px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-label);
  white-space: nowrap;
}

.sap-table thead th:first-child { border-radius: 0; }

.sap-table tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background .1s;
}

.sap-table tbody tr:nth-child(even) { background: var(--bg-row-alt); }

.sap-table tbody tr:hover { background: var(--bg-row-hover); }

.sap-table tbody td {
  padding: 9px 14px;
  color: var(--text-main);
  vertical-align: middle;
}

.sap-table tbody td.cell-muted { color: var(--text-sub); font-size: 12px; }
.sap-table tbody td.cell-right { text-align: right; }
.sap-table tbody td.cell-mono  { font-family: var(--font-mono); }
.sap-table .cell-primary { font-weight: 700; color: var(--text-main); }

/* Row actions — show on hover */
.sap-table .row-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity .15s;
}
.sap-table tbody tr:hover .row-actions { opacity: 1; }

/* ---------- Buttons ---------- */
.btn-sap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}

.btn-sap-emphasized {
  background: var(--sap-blue);
  color: #fff;
  border-color: var(--sap-blue);
}
.btn-sap-emphasized:hover {
  background: var(--sap-blue-hover);
  border-color: var(--sap-blue-hover);
  color: #fff;
  text-decoration: none;
}

.btn-sap-standard {
  background: #fff;
  color: var(--sap-blue);
  border-color: var(--sap-blue);
}
.btn-sap-standard:hover {
  background: var(--sap-blue-light);
  color: var(--sap-blue-dark);
  text-decoration: none;
}

.btn-sap-transparent {
  background: transparent;
  color: var(--text-sub);
  border-color: var(--border);
}
.btn-sap-transparent:hover {
  background: var(--bg-row-hover);
  color: var(--text-main);
  text-decoration: none;
}

.btn-sap-negative {
  background: #fff;
  color: var(--negative);
  border-color: var(--negative);
}
.btn-sap-negative:hover {
  background: var(--negative-bg);
  text-decoration: none;
}

.btn-sap-ghost {
  background: transparent;
  border: none;
  color: var(--text-sub);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
}
.btn-sap-ghost:hover { background: var(--bg-row-hover); color: var(--text-main); }

.btn-sap-sm { padding: 3px 10px; font-size: 12px; }

/* ---------- Status Chips ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
}

.chip-positive  { background: var(--positive-bg); color: var(--positive); }
.chip-negative  { background: var(--negative-bg); color: var(--negative); }
.chip-warning   { background: var(--warning-bg);  color: var(--warning);  }
.chip-neutral   { background: var(--neutral-bg);  color: var(--neutral);  }
.chip-blue      { background: var(--sap-blue-light); color: var(--sap-blue-dark); }
.chip-domestic  { background: #EBF5FF; color: #1457A8; }
.chip-export    { background: #EAFAEA; color: #0F5B0F; }

/* ---------- Forms (SAP SimpleForm) ---------- */
.form-section {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: visible;   /* must not clip autocomplete dropdowns */
  margin-bottom: 16px;
}

/* Clip only the header/title strip, not the whole card */
.form-section-title {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
}

.form-section-title {
  padding: 12px 20px;
  background: var(--bg-table-head);
  border-bottom: 1px solid var(--border-light);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-label);
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-section-body { padding: 20px; }

.form-grid {
  display: grid;
  gap: 16px;
}
.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-grid-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

.field-group { display: flex; flex-direction: column; gap: 4px; }

.field-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-label);
}

.field-required::after {
  content: ' *';
  color: var(--negative);
}

.form-control-sap {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font);
  color: var(--text-main);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}

.form-control-sap:focus {
  border-color: var(--sap-blue);
  box-shadow: 0 0 0 2px rgba(0,100,217,.15);
}

.form-control-sap::placeholder { color: #B0B8C5; }

select.form-control-sap {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%235A6872'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

textarea.form-control-sap { resize: vertical; min-height: 72px; }

/* ---------- Input Groups ---------- */
.input-group-sap {
  display: flex;
  align-items: stretch;
}

.input-group-sap .ig-prefix,
.input-group-sap .ig-suffix {
  display: flex;
  align-items: center;
  padding: 0 10px;
  background: var(--bg-table-head);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
  white-space: nowrap;
}

.input-group-sap .ig-prefix { border-right: none; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group-sap .ig-suffix { border-left: none; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-group-sap .form-control-sap {
  border-radius: 0;
  flex: 1;
}
.input-group-sap .form-control-sap:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group-sap .form-control-sap:last-child  { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* ---------- Autocomplete Dropdown ---------- */
.autocomplete-wrap { position: relative; }

.autocomplete-list {
  position: absolute;
  top: calc(100% + 2px);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  max-height: 220px;
  overflow-y: auto;
  display: none;
}

.autocomplete-list .ac-item {
  padding: 9px 14px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid var(--border-light);
  transition: background .1s;
}

.autocomplete-list .ac-item:last-child { border-bottom: none; }
.autocomplete-list .ac-item:hover { background: var(--bg-row-hover); }
.autocomplete-list .ac-empty { padding: 12px 14px; color: var(--text-sub); font-style: italic; }

/* ---------- Dynamic List (emails/phones) ---------- */
.dynamic-list-item {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.dynamic-list-item .form-control-sap { flex: 1; }

/* ---------- Balance / KPI Strip ---------- */
.kpi-strip {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.kpi-tile {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px 22px;
  min-width: 180px;
  flex: 1;
  box-shadow: var(--shadow-sm);
}

.kpi-tile .kpi-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-label);
  margin-bottom: 6px;
}

.kpi-tile .kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1;
}

.kpi-tile .kpi-value.positive { color: var(--positive); }
.kpi-tile .kpi-value.negative { color: var(--negative); }
.kpi-tile .kpi-sub {
  font-size: 11px;
  color: var(--text-sub);
  margin-top: 4px;
}

/* ---------- SAP Dialog (Modal) ---------- */
.modal-backdrop { z-index: 1040 !important; }
.modal         { z-index: 1050 !important; }

.modal-content {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.modal-header, .sap-modal-header {
  background: var(--sap-blue);
  border-bottom: 1px solid var(--border-light);
  padding: 14px 20px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.modal-footer {
  background: var(--bg-table-head);
  border-top: 1px solid var(--border-light);
  padding: 12px 20px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  gap: 8px;
}

.modal-body { padding: 20px; }

/* ---------- File Upload / Attachments ---------- */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: var(--bg-page);
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--sap-blue);
  background: var(--sap-blue-light);
}

.drop-zone .dz-icon {
  font-size: 36px;
  color: var(--text-label);
  display: block;
  margin-bottom: 8px;
}

.drop-zone .dz-text {
  font-size: 13px;
  color: var(--text-sub);
}

.drop-zone .dz-link {
  color: var(--sap-blue);
  font-weight: 600;
  cursor: pointer;
}

.att-list { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }

.att-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  font-size: 12.5px;
}

.att-item .att-icon { font-size: 18px; color: var(--sap-blue); flex-shrink: 0; }
.att-item .att-icon.pdf-icon { color: #D9001B; }
.att-item .att-icon.img-icon { color: #1A7A1A; }
.att-item .att-name { flex: 1; font-weight: 600; color: var(--text-main); }
.att-item .att-meta { color: var(--text-sub); font-size: 11px; }
.att-item .att-actions { display: flex; gap: 4px; margin-left: auto; }

/* Attachment badge on tables */
.att-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  background: var(--sap-blue-light);
  color: var(--sap-blue);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
}

.att-badge-empty {
  background: transparent;
  color: var(--text-sub);
  border: 1px dashed var(--border);
  opacity: 0.6;
}
.att-badge-empty:hover {
  opacity: 1;
  background: var(--sap-blue-light);
  color: var(--sap-blue);
  border-style: solid;
}

/* ---------- Context Menu ---------- */
.context-menu {
  position: fixed;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 4px 0;
  z-index: 9999;
  min-width: 190px;
  display: none;
}

.context-menu.open { display: block; }

.ctx-item {
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
  transition: background .1s;
}

.ctx-item:hover { background: var(--bg-row-hover); }
.ctx-item i { color: var(--text-sub); font-size: 14px; width: 16px; text-align: center; }
.ctx-divider { height: 1px; background: var(--border-light); margin: 4px 0; }

/* ---------- PIN Screen ---------- */
.pin-screen {
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-page);
}

.pin-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px;
  width: 360px;
  text-align: center;
}

.pin-card .pin-lock {
  font-size: 44px;
  color: var(--sap-blue);
  margin-bottom: 16px;
}

.pin-card h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.pin-card p {
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 24px;
}

/* ---------- Reconciliation Rows ---------- */
.recon-complete { background: var(--positive-bg) !important; }
.recon-pending  { background: var(--warning-bg) !important; }

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 14px;
}

.toolbar-spacer { flex: 1; }

.toolbar .search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.toolbar .search-wrap input {
  padding-left: 32px;
  width: 220px;
}

.toolbar .search-wrap i {
  position: absolute;
  left: 10px;
  color: var(--text-label);
  font-size: 14px;
  pointer-events: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  #sidenav { width: var(--shell-collapsed); }
  #page-wrapper { margin-left: var(--shell-collapsed); }
  .nav-label, .nav-section-label { opacity: 0; pointer-events: none; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .page-content { padding: 16px; }
  .kpi-strip { flex-direction: column; }
}

/* ---------- Utility ---------- */
.text-positive { color: var(--positive) !important; }
.text-negative { color: var(--negative) !important; }
.text-warning  { color: var(--warning)  !important; }
.text-muted    { color: var(--text-sub) !important; }
.text-right    { text-align: right; }
.text-center   { text-align: center; }
.fw-bold       { font-weight: 700; }
.fw-semi       { font-weight: 600; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.gap-8 { gap: 8px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }

/* ---------- Modal Styles (SAP Dialog) ---------- */
.sap-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.sap-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.sap-modal-dialog {
  position: relative;
  background: var(--bg-card);
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  width: 90%;
  max-width: 700px;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.sap-modal-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-light);
  position: relative;
  background: var(--bg-page);
}

.sap-modal-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
}

.sap-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.sap-modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-page);
  text-align: center;
}
