/* ==========================================================================
   BANGA SRBIJA - FINN BUSINESS PORTAL DESIGN SYSTEM
   GLOBAL INTER FONT ENFORCEMENT & PERFECT ZERO-GAP SIDEBAR POSITIONING
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --bg-topbar: #000000;
  --bg-app: #f4f5f7;
  --bg-surface: #ffffff;
  --bg-hover: #fafafa;

  --text-main: #000000;
  --text-muted: #666666;
  --text-light: #888888;

  --primary: #2563eb;
  --primary-light: #eff6ff;

  --accent-gold: #d97706;
  --border-light: #eaeaea;
  --font-inter: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Global 100% Inter Font Enforcement */
*, *::before, *::after, html, body, input, button, select, textarea, table, th, td, h1, h2, h3, h4, h5, h6, p, span, a, div, label, code {
  font-family: var(--font-inter) !important;
}

html, body {
  box-sizing: border-box;
  overflow-x: hidden !important;
  max-width: 100% !important;
  width: 100%;
  margin: 0;
  padding: 0;
  touch-action: manipulation;
}

html {
  scrollbar-gutter: stable;
}

button,
a,
.stepper-btn,
.mobile-nav-btn,
.sidebar-item-btn {
  touch-action: manipulation;
}

body {
  min-height: 100vh;
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   VIEW VISIBILITY & ZERO-FLICKER ENFORCEMENT
   ========================================================================== */
.portal-view {
  display: none !important;
}

.portal-view.active {
  display: block !important;
}

.admin-sec-panel {
  display: none !important;
}

.admin-sec-panel.active {
  display: block !important;
}

#adminSecOverview {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 100%;
  max-width: 1800px;
  margin-left: auto;
  margin-right: auto;
}

.admin-overview-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.2rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin: 0.45rem 0 0.55rem;
}

.admin-overview-tab {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.45rem 0.7rem;
  border-radius: 7px;
  cursor: pointer;
  line-height: 1.2;
}

.admin-overview-tab:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.65);
}

.admin-overview-tab.active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.admin-overview-tab-panel {
  display: none;
  flex-direction: column;
  gap: 0.85rem;
}

.admin-overview-tab-panel.active {
  display: flex;
}

.admin-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0;
}

#adminSecOverview strong,
#adminSecOverview b {
  font-weight: 600;
}

.admin-overview-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  box-shadow: none;
}

.admin-overview-card.clickable {
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.admin-overview-card.clickable:hover {
  border-color: #cbd5e1;
}

.admin-overview-card-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.admin-overview-card-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 0.15rem;
  line-height: 1.15;
}

.admin-overview-card-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  line-height: 1.25;
}

.admin-overview-card.warn .admin-overview-card-value {
  color: #b45309;
}

.admin-overview-card.danger .admin-overview-card-value {
  color: #dc2626;
}

.admin-overview-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin: 0 !important;
  min-width: 0;
}

.admin-overview-columns > * {
  min-width: 0;
}

.admin-overview-panel {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 0.55rem 0.7rem 0.65rem;
  min-width: 0;
  overflow: hidden;
}

.admin-overview-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.admin-overview-panel-head h3 {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
}

.admin-overview-panel-head .btn-finn-secondary {
  font-size: 0.68rem !important;
  padding: 0.22rem 0.5rem !important;
}

.admin-overview-table-scroll {
  max-height: 16rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.admin-overview-table-scroll .finn-table th,
.admin-overview-table-scroll .finn-table td {
  padding: 0.35rem 0.45rem;
  font-size: 0.78rem;
}

.admin-overview-feed {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  height: 17.5rem; /* fiksno ~5 redova */
  max-height: 17.5rem;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  min-width: 0;
  scrollbar-gutter: stable;
}

.admin-overview-feed-empty {
  padding: 0.7rem 0.35rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.admin-overview-feed-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem 0.55rem;
  align-items: center;
  padding: 0.35rem 0.45rem;
  border: 1px solid #eef2f7;
  border-radius: 7px;
  background: #f8fafc;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.admin-overview-feed-main {
  min-width: 0;
  overflow: hidden;
}

.admin-overview-feed-id {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-overview-feed-meta {
  font-size: 0.66rem;
  color: var(--text-muted);
  margin-top: 0.06rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-overview-feed-aside {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-shrink: 0;
  min-width: 0;
}

.admin-overview-feed-amt {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.admin-overview-feed-row .status-badge-btn {
  font-size: 0.64rem;
  padding: 0.15rem 0.4rem;
  white-space: nowrap;
  max-width: 7.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-overview-feed-row .btn-finn-secondary {
  font-size: 0.64rem !important;
  padding: 0.18rem 0.4rem !important;
  margin: 0 !important;
  flex-shrink: 0;
}

.admin-overview-blocked {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.admin-overview-blocked-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.45rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #991b1b;
}

.admin-overview-period {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

.admin-overview-chart-row {
  margin-bottom: 0;
  align-items: stretch;
}

.admin-overview-chart-row > .admin-overview-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.admin-overview-chart-panel {
  margin-bottom: 0;
  max-width: none;
}

.admin-overview-chart {
  width: 100%;
  max-width: none;
  min-height: 0;
  flex: 1;
  display: flex;
  align-items: flex-end;
}

.admin-overview-chart-empty {
  padding: 0.6rem 0.4rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  width: 100%;
  align-self: center;
}

.admin-sales-chart-svg {
  width: 100%;
  max-height: 120px;
  height: auto;
  display: block;
}

.admin-overview-blocked-panel .admin-overview-blocked {
  flex: 1;
  align-content: flex-start;
  overflow-y: auto;
  max-height: 9rem;
}

.admin-sales-chart-bar {
  fill: #1e293b;
  transition: fill 0.15s ease;
}

.admin-sales-chart-bar:hover {
  fill: #334155;
}

.admin-sales-chart-label {
  fill: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  text-anchor: middle;
}

.admin-sales-chart-value {
  fill: var(--text-muted);
  font-size: 9px;
  font-weight: 500;
  text-anchor: middle;
}

.admin-rank-list,
.admin-trend-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

#adminOverviewTopProducts,
#adminOverviewTopCustomers,
#adminOverviewFalling,
#adminOverviewGrowing {
  max-height: 16rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.1rem;
}

.admin-overview-alert-row {
  align-items: stretch;
}

.admin-overview-alert-row > .admin-overview-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.admin-overdue-list,
.admin-never-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 18rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 1;
  padding-right: 0.1rem;
}

.admin-overdue-card,
.admin-never-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 0.55rem;
  align-items: center;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
}

.admin-overdue-card {
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.admin-never-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.admin-overdue-icon,
.admin-never-icon {
  display: none;
}

.admin-overdue-main,
.admin-never-main {
  min-width: 0;
  grid-column: 1;
}

.admin-overdue-name,
.admin-never-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-overdue-meta,
.admin-never-meta {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.25;
  margin-top: 0.1rem;
}

.admin-overdue-late {
  font-size: 0.72rem;
  font-weight: 700;
  color: #b45309;
  white-space: nowrap;
  text-align: right;
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
}

.admin-overdue-phone,
.admin-never-phone {
  grid-column: 1 / -1;
  font-size: 0.68rem;
  font-weight: 500;
  margin-top: 0.05rem;
}

.admin-overdue-phone {
  color: #92400e;
}

.admin-never-phone {
  color: #334155;
}

.admin-overdue-empty,
.admin-never-empty {
  padding: 0.65rem 0.35rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.admin-rank-row,
.admin-trend-row {
  display: grid;
  grid-template-columns: 1.25rem 1fr auto;
  gap: 0.35rem;
  align-items: center;
  padding: 0.28rem 0.4rem;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
}

.admin-rank-row-bar-wrap {
  grid-column: 2 / -1;
  height: 3px;
  background: #e2e8f0;
  border-radius: 99px;
  overflow: hidden;
  margin-top: -0.05rem;
}

.admin-rank-row-bar {
  height: 100%;
  background: #1e293b;
  border-radius: 99px;
}

.admin-rank-idx {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
}

.admin-rank-name,
.admin-trend-name {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-main);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-rank-value {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
}

.admin-trend-row {
  grid-template-columns: 0.9rem 1fr auto;
}

.admin-trend-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  justify-self: center;
}

.admin-trend-dot.down {
  background: #dc2626;
}

.admin-trend-dot.up {
  background: #16a34a;
}

.admin-trend-pct {
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
}

.admin-trend-pct.down {
  color: #dc2626;
}

.admin-trend-pct.up {
  color: #16a34a;
}

.admin-rank-empty,
.admin-trend-empty {
  padding: 0.65rem 0.35rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
}

@media (max-width: 900px) {
  #adminSecOverview {
    gap: 0.5rem;
  }

  .admin-overview-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem;
  }

  .admin-overview-columns {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .admin-overview-chart-row > .admin-overview-panel {
    min-height: 0;
  }

  .admin-overview-chart-panel {
    max-width: 100%;
  }

  .admin-overview-chart {
    max-width: 100%;
  }

  .admin-sales-chart-svg {
    max-height: 100px;
  }

  .admin-overview-tabs {
    gap: 0.25rem;
  }

  .admin-overview-tab {
    font-size: 0.72rem;
    padding: 0.4rem 0.45rem;
  }

  .admin-overview-feed {
    height: 16rem;
    max-height: 16rem;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .admin-overview-feed-row {
    display: grid;
    width: 100%;
    max-width: none;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.25rem;
  }

  .admin-overview-feed-aside {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .admin-overview-feed-main {
    min-width: 0;
  }

  .admin-overview-table-scroll {
    max-height: 13rem;
  }

  #adminOverviewTopProducts,
  #adminOverviewTopCustomers,
  #adminOverviewFalling,
  #adminOverviewGrowing,
  .admin-overdue-list,
  .admin-never-list {
    max-height: 14rem;
  }

  .admin-overview-blocked-panel .admin-overview-blocked {
    max-height: 7rem;
  }
}

/* ==========================================================================
   LOGIN SCREEN STYLING
   ========================================================================== */
.login-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-app);
  padding: 1.5rem;
  box-sizing: border-box;
  z-index: 99999;
}

.login-card {
  background-color: #ffffff;
  border-radius: 12px;
  width: 100%;
  max-width: 420px;
  padding: 2.25rem 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
}

.login-header {
  text-align: center;
  margin-bottom: 1.35rem;
}

.login-logo-img {
  max-height: 52px;
  width: auto;
  object-fit: contain;
  margin-bottom: 0.2rem;
  display: inline-block;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  filter: contrast(1.15) brightness(1.05);
}

.login-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #000000;
  margin-top: 0;
  margin-bottom: 0.15rem;
}

.login-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.login-seo-line {
  margin: 0.65rem 0 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #9ca3af;
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label-title {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.4rem;
  text-align: left;
  user-select: none;
}

.login-input {
  width: 100%;
  box-sizing: border-box;
  height: 44px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 0 1rem;
  font-size: 0.9rem;
  text-align: left;
  outline: none;
  background-color: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-input:focus {
  border-color: #000000;
  box-shadow: 0 0 0 1px #000000;
}

.form-row-remember {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin-bottom: 1.5rem;
  font-size: 0.82rem;
  text-align: center;
}

.remember-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.remember-label input[type="checkbox"] {
  accent-color: #000000;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.forgot-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

.forgot-link:hover {
  text-decoration: underline;
}

.btn-login-submit {
  width: 100%;
  height: 46px;
  background-color: #000000;
  color: #ffffff;
  border: none;
  font-weight: 800;
  font-size: 0.95rem;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.btn-login-submit:hover {
  opacity: 0.88;
}

/* ==========================================================================
   MAIN APP STYLING
   ========================================================================== */
html.scroll-locked,
body.scroll-locked {
  overflow: hidden !important;
  overscroll-behavior: none;
}

body.scroll-locked {
  position: fixed;
  width: 100%;
  left: 0;
  right: 0;
  padding-right: var(--scrollbar-compensation, 0px);
}

html.scroll-locked {
  padding-right: var(--scrollbar-compensation, 0px);
}

.finn-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 54px;
  background-color: var(--bg-topbar);
  color: #ffffff;
  padding: 0 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 9999;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  box-sizing: border-box;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.topbar-logo-img {
  height: 32px;
  width: auto;
  object-fit: contain;
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  filter: contrast(1.15) brightness(1.05);
}

.topbar-brand {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #ffffff;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.topbar-notify {
  position: relative;
}

.topbar-notify-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  opacity: 0.92;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.topbar-notify-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.08);
}

.topbar-notify-badge {
  position: absolute;
  top: 2px;
  right: 1px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
  box-shadow: 0 0 0 2px #000;
}

.topbar-notify-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(360px, calc(100vw - 1.5rem));
  max-height: min(420px, 70vh);
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  z-index: 1200;
  overflow: hidden;
}

.topbar-notify-panel[hidden] {
  display: none !important;
}

.topbar-notify-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #eef2f7;
  background: #f8fafc;
}

.topbar-notify-head strong {
  font-size: 0.92rem;
  font-weight: 800;
}

.topbar-notify-markall {
  border: none;
  background: transparent;
  color: #2563eb;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.topbar-notify-markall:hover {
  text-decoration: underline;
}

.topbar-notify-list {
  overflow-y: auto;
  max-height: 340px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.topbar-notify-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 600;
}

.topbar-notify-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 0.7rem;
  width: 100%;
  text-align: left;
  border: none;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: background 0.12s ease;
}

.topbar-notify-item:hover {
  background: #f8fafc;
}

.topbar-notify-item.is-unread {
  background: #eff6ff;
}

.topbar-notify-item.is-unread:hover {
  background: #e0effe;
}

.topbar-notify-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 800;
  background: #e2e8f0;
  overflow: hidden;
  flex-shrink: 0;
}

.topbar-notify-icon.has-image {
  background: #f8fafc;
  padding: 0;
}

.topbar-notify-icon.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.topbar-notify-icon.type-new_product,
.topbar-notify-icon.type-stock_in { background: #dcfce7; color: #15803d; }
.topbar-notify-icon.type-product_removed,
.topbar-notify-icon.type-stock_out { background: #fee2e2; color: #b91c1c; }
.topbar-notify-icon.type-rabat_changed { background: #fef3c7; color: #b45309; }
.topbar-notify-icon.type-store_code_changed,
.topbar-notify-icon.type-ean_changed { background: #e0e7ff; color: #4338ca; }
.topbar-notify-icon--bell { color: #475569; }
.topbar-notify-icon--bell svg { display: block; }

.topbar-notify-title {
  display: block;
  font-size: 0.84rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.15rem;
}

.topbar-notify-body {
  display: block;
  font-size: 0.78rem;
  color: #475569;
  line-height: 1.35;
}

.topbar-notify-time {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.7rem;
  color: #94a3b8;
  font-weight: 600;
}

.admin-product-image-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.admin-product-image-preview {
  width: 96px;
  height: 96px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.admin-product-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.admin-product-image-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  min-width: 0;
}

.admin-product-image-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  font-size: 0.8rem;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  width: auto;
}

.admin-product-image-hint {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.topbar-cart-btn {
  background: transparent;
  color: #ffffff;
  border: none;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
  opacity: 0.9;
  transition: opacity 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.topbar-cart-btn:hover {
  opacity: 1;
  background: transparent;
  transform: none;
}

.topbar-link {
  color: #ffffff;
  text-decoration: none;
  cursor: pointer;
  opacity: 0.9;
  transition: opacity 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.topbar-link:hover {
  opacity: 1;
}

.finn-layout {
  display: flex;
  flex: 1;
  width: 100%;
  margin-top: 54px;
  min-height: calc(100vh - 54px);
  background-color: #ffffff !important;
  overflow-x: hidden;
}

/* KOMPAKTNA 64px BO?NA TRAKA (FIKSNA DO SAMOG DNA EKRANA BEZ PRAZNOG BLOKA) */
.finn-sidebar {
  width: 64px;
  min-width: 64px;
  background-color: #ffffff;
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 !important;
  margin: 0 !important;
  position: fixed;
  top: 54px;
  bottom: 0;
  height: calc(100vh - 54px);
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), min-width 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  white-space: nowrap;
  z-index: 100;
}

.finn-sidebar.expanded {
  width: 250px;
  min-width: 250px;
  align-items: flex-start;
  padding: 0 !important;
}

.finn-sidebar.expanded ~ .finn-main-content {
  margin-left: 250px;
}

/* BURGER DUGME SADA POPUNJAVA SAMI VRH BO?NE TRAKE BEZ DUPLOG OFFSET-A */
.sidebar-burger-btn {
  width: 64px;
  height: 54px;
  min-height: 54px;
  border: none !important;
  background: #ffffff !important;
  box-shadow: none !important;
  outline: none !important;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0 !important;
  margin: 0 !important;
  border-bottom: 1px solid var(--border-light) !important;
  flex-shrink: 0;
}

.finn-sidebar.expanded .sidebar-burger-btn {
  width: 100%;
  justify-content: flex-start;
  padding: 0 1.25rem !important;
}

.sidebar-burger-btn:hover {
  background-color: var(--bg-app) !important;
}

.sidebar-burger-btn svg {
  width: 22px;
  height: 22px;
  min-width: 22px;
}

/* ITEM NAVIGATION BUTTONS */
.sidebar-item-btn {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 0.5rem 11px;
  transition: all 0.15s ease;
  padding: 0 10px;
  flex-shrink: 0;
}

.finn-sidebar.expanded .sidebar-item-btn {
  width: calc(100% - 1.5rem);
  justify-content: flex-start;
  margin: 0.4rem 0.75rem;
  padding: 0 0.85rem;
}

.sidebar-item-btn:hover {
  background-color: var(--bg-app);
  color: var(--text-main);
}

.sidebar-item-btn.active {
  background-color: var(--primary-light);
  color: var(--primary);
}

.sidebar-item-btn svg {
  width: 22px;
  height: 22px;
  min-width: 22px;
}

.sidebar-label {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  display: none;
}

.finn-sidebar.expanded .sidebar-label {
  display: inline-block;
}

.finn-main-content {
  flex: 1;
  background-color: #ffffff !important;
  padding: 2.25rem 3.5rem;
  margin-left: 64px;
  min-height: calc(100vh - 54px);
  box-sizing: border-box;
  overflow-x: hidden;
  transition: margin-left 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.finn-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.finn-title {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.finn-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ULTRA-PROFESSIONAL B2B CORPORATE BANER */
.store-info-banner {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  margin-top: 0.5rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  color: #0f172a;
}

.store-info-left {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  flex: 1;
  gap: 1rem;
  flex-wrap: wrap;
}

.store-info-block {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.store-info-divider {
  width: 1px;
  height: 24px;
  background-color: #e2e8f0;
}

.store-badge-label {
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.1rem;
}

.store-badge-value {
  color: #0f172a;
  font-weight: 700;
  font-size: 0.88rem;
}

.store-code-tag {
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #0f172a;
  font-family: inherit;
}

.store-discount-tag {
  background-color: #0f172a;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.15rem 0.65rem;
  border-radius: 4px;
  display: inline-block;
}

.btn-switch-store {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.btn-switch-store:hover {
  background-color: #f8fafc;
  border-color: #0f172a;
}

/* PRILAGO?ENI BIRA? ARTIKALA SA SLIKAMA PROIZVODA ZA POVRAT ROBE */
.custom-product-picker {
  position: relative;
  width: 100%;
}

.product-picker-trigger {
  width: 100%;
  box-sizing: border-box;
  min-height: 54px;
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.15s ease;
}

.product-picker-trigger:hover {
  border-color: var(--text-main);
  background-color: #fafafa;
}

.product-picker-selected {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 1;
  min-width: 0;
}

.picker-product-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 6px;
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  padding: 2px;
  flex-shrink: 0;
}

.picker-product-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  text-align: left;
}

.picker-product-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.picker-product-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.product-picker-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  overflow: hidden;
}

.product-picker-list {
  max-height: 250px;
  overflow-y: auto;
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.picker-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  background-color: #ffffff;
}

.picker-item-card:hover {
  background-color: var(--bg-app);
  border-color: var(--border-light);
}

.picker-item-card.selected {
  background-color: var(--primary-light);
  border-color: var(--primary);
}

.picker-price-badge {
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--text-main);
  background-color: var(--bg-hover);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  white-space: nowrap;
}

.finn-subtabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.75rem;
  overflow-x: auto;
  margin-left: -0.5rem;
}

.subtab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.5rem 1.1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

.subtab-btn:hover {
  color: var(--text-main);
  background-color: rgba(15, 23, 42, 0.04);
  transform: translateY(-1px);
}

.subtab-btn.active {
  background-color: var(--bg-app);
  color: var(--text-main);
}

.finn-filter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.history-filter-bar {
  flex-direction: column;
  align-items: stretch;
  gap: 0.85rem;
}

.history-filters-grid {
  display: grid;
  grid-template-columns: minmax(200px, 1.4fr) repeat(auto-fit, minmax(140px, 1fr));
  align-items: center;
  gap: 0.55rem;
  width: 100%;
}

.history-filter-search {
  width: 100% !important;
  max-width: none;
}

.history-filter-search:hover {
  transform: none;
}

.history-filter-search:hover .finn-search-input {
  border-color: var(--border-light);
  box-shadow: none;
}

.history-filter-search .finn-search-input,
.history-filter-select {
  height: 44px;
  box-sizing: border-box;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  margin: 0;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  box-shadow: none;
  background-color: #ffffff;
}

.history-filter-search .finn-search-input::placeholder {
  font-size: inherit;
  font-weight: 600;
  font-family: inherit;
  color: #64748b;
  opacity: 1;
}

.history-filter-search .finn-search-input:focus,
.history-filter-select:focus {
  border-color: #000000;
  box-shadow: 0 0 0 1px #000000;
}

.history-date-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  width: 100%;
  height: 44px;
  box-sizing: border-box;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%2364748b' stroke-width='2' viewBox='0 0 24 24'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 16px;
  overflow: hidden;
}

.history-date-wrap:focus-within {
  border-color: #000000;
  box-shadow: 0 0 0 1px #000000;
}

.history-date-input {
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 100%;
  margin: 0;
  border: 0 !important;
  border-radius: 0;
  box-shadow: none !important;
  outline: none;
  background: transparent;
  padding: 0 2.4rem 0 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-main);
  text-align: left;
  -webkit-appearance: none;
  appearance: none;
}

.history-date-placeholder {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  color: #64748b;
  pointer-events: none;
  z-index: 1;
}

.history-date-wrap.has-value .history-date-placeholder {
  display: none;
}

.history-date-wrap:not(.has-value) .history-date-input {
  color: transparent;
}

.history-date-wrap:not(.has-value) .history-date-input::-webkit-datetime-edit,
.history-date-wrap:not(.has-value) .history-date-input::-webkit-date-and-time-value {
  color: transparent;
}

.history-date-wrap.has-value .history-date-input::-webkit-date-and-time-value {
  text-align: left;
}

.history-date-wrap.has-value .history-date-input::-webkit-datetime-edit {
  padding: 0;
  text-align: left;
}

.history-date-input::-webkit-calendar-picker-indicator {
  position: absolute;
  right: 0;
  top: 0;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.history-filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.history-filter-action-btns {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.65rem;
  flex: 1 1 auto;
  min-width: 0;
}

.history-filter-action-btns .btn-finn-secondary,
.history-filter-action-btns .btn-finn-primary {
  margin: 0;
  width: auto;
  min-height: 42px;
  font-size: 0.82rem;
  padding: 0.5rem 0.9rem;
}

.history-filter-actions .finn-count-label {
  margin: 0;
}

.returns-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  flex-wrap: wrap;
  gap: 1rem;
}

.returns-new-btn {
  margin: 0;
  width: auto;
  font-size: 0.88rem;
  padding: 0.6rem 1.25rem;
  display: inline-flex;
  justify-content: center;
  text-align: center;
}

.returns-empty-cell {
  text-align: center;
  color: var(--text-muted);
  padding: 2.5rem;
}

.finn-search-box {
  position: relative;
  width: 300px;
  display: flex;
  align-items: center;
  transition: transform 0.2s ease;
}

.finn-search-box:hover {
  transform: translateY(-1px);
}

.finn-search-input {
  width: 100%;
  height: 42px;
  box-sizing: border-box !important;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding-left: 1rem;
  padding-right: 2.5rem;
  font-size: 0.88rem;
  outline: none;
  background-color: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.finn-search-box:hover .finn-search-input {
  border-color: #94a3b8;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.finn-search-input:focus {
  border-color: var(--text-main);
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
  background-color: #fff;
}

.finn-search-icon {
  position: absolute;
  right: 0.85rem !important;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.2s ease, transform 0.2s ease;
  width: 18px;
  height: 18px;
}

.finn-search-box:hover .finn-search-icon {
  color: var(--text-main);
  transform: translateY(-50%) scale(1.08);
}

.finn-search-input:focus + .finn-search-icon,
.finn-search-box:focus-within .finn-search-icon {
  color: var(--text-main);
}

.finn-count-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 0.5rem;
}

.finn-table-container {
  width: 100%;
  overflow-x: auto;
}

.finn-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.6rem;
  font-size: 0.92rem;
  text-align: center;
}

.finn-table th {
  color: var(--text-light);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.5rem 1rem;
  border: none;
  text-align: center;
}

.finn-table tbody tr {
  background-color: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.finn-table td {
  padding: 1rem 1.15rem;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  position: relative;
  text-align: center;
}

.finn-table--vcenter th,
.finn-table--vcenter td {
  vertical-align: middle;
  text-align: center;
}

.finn-table tbody tr td:first-child {
  border-left: 1px solid var(--border-light);
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
  padding-left: 1.25rem !important;
}

.finn-table tbody tr td:last-child {
  border-right: 1px solid var(--border-light);
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
  padding-right: 1.25rem !important;
}

/* Admin kupci ? isto centrirano */
.admin-stores-table th,
.admin-stores-table td {
  text-align: center !important;
  vertical-align: middle;
}

.admin-store-obj-name {
  color: var(--text-main);
  font-size: 0.88rem;
  display: block;
}

.admin-store-firm {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.28rem;
  margin: 0 auto;
  max-width: none;
}

.admin-store-firm-name {
  color: var(--text-main);
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1.2;
  white-space: nowrap;
}

.admin-store-firm-line {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
  white-space: nowrap;
  word-break: normal;
}

.admin-store-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.85rem;
}

.admin-store-k {
  display: inline-block;
  min-width: 2.6rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.admin-store-pass {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.admin-store-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}

/* Desktop (uklj. 1920¯1080): ne gu?i tabelu u visoke vi?elinijske redove ?
   ?ira tabela + horizontalni skrol umesto lomljenja ?elija. */
@media (min-width: 861px) {
  .finn-main-content {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .finn-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  .admin-stores-table {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
  }

  .admin-stores-table th,
  .admin-stores-table td {
    white-space: nowrap;
    padding: 0.75rem 0.7rem;
    font-size: 0.84rem;
  }

  .admin-stores-table th {
    font-size: 0.7rem;
    padding: 0.45rem 0.7rem;
  }

  /* Podaci / objekat ? uvek jedan red (tabela skroluje horizontalno ako treba) */
  .admin-stores-table td[data-label="Podaci"],
  .admin-stores-table td[data-label="Objekat"] {
    white-space: nowrap;
  }

  .admin-store-firm {
    max-width: none;
    align-items: center;
  }

  .admin-store-firm-line {
    white-space: nowrap;
  }

  .admin-store-obj-name {
    white-space: nowrap;
  }

  .admin-store-stack,
  .admin-store-stack > div {
    white-space: nowrap;
  }

  .admin-store-actions {
    flex-wrap: nowrap;
  }

  .admin-stores-table .admin-store-actions .btn-finn-secondary {
    white-space: nowrap;
  }
}

/* Jo? u?e: Full HD / laptop ? manji padding, tabela ostaje ?itljiva u jednom redu */
@media (min-width: 861px) and (max-width: 1600px) {
  .finn-main-content {
    padding-left: 1.1rem;
    padding-right: 1.1rem;
    padding-top: 1.5rem;
  }

  .admin-stores-table th,
  .admin-stores-table td {
    padding: 0.65rem 0.55rem;
    font-size: 0.8rem;
  }

  .admin-stores-table th {
    font-size: 0.68rem;
  }

  .admin-store-actions .btn-finn-secondary {
    font-size: 0.72rem !important;
    padding: 0.3rem 0.5rem !important;
  }
}

.finn-table tr.row-active {
  background-color: #f8fafc;
}

.finn-table tr.row-active td {
  border-top-color: #93c5fd;
  border-bottom-color: #93c5fd;
}

.finn-table tr.row-active td:first-child {
  border-left: 4px solid var(--primary) !important;
}

.finn-table tr.row-active td:last-child {
  border-right-color: #93c5fd;
}

.finn-table tbody tr.row-out-of-stock {
  background-color: #fee2e2 !important;
  box-shadow: 0 1px 4px rgba(185, 28, 28, 0.1);
}

.finn-table tbody tr.row-out-of-stock td {
  background-color: #fee2e2 !important;
  border-top-color: #fecaca;
  border-bottom-color: #fecaca;
}

.finn-table tbody tr.row-out-of-stock td:first-child {
  border-left-color: #fca5a5;
}

.finn-table tbody tr.row-out-of-stock td:last-child {
  border-right-color: #fca5a5;
}

.finn-table tbody tr.row-out-of-stock:hover {
  box-shadow: 0 4px 12px rgba(185, 28, 28, 0.12);
}

.finn-table tbody tr.row-out-of-stock:hover td {
  background-color: #fecaca !important;
}

.finn-table tbody tr:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
}

/* Kolone sa nazivom (artikal / kupac): naslov + sadr?aj levo */
.finn-table th.col-product,
.finn-table td.col-product,
.finn-table th.col-left,
.finn-table td.col-left,
.finn-table td:has(.product-info-cell) {
  text-align: left !important;
}

.product-info-cell {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  text-align: left;
}

.product-img {
  width: 54px;
  height: 54px;
  border-radius: 5px;
  object-fit: cover;
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.product-title {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text-main);
  line-height: 1.3;
}

.promo-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.12rem 0.45rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #9a3412;
  background: #ffedd5;
  border: 1px solid #fdba74;
  border-radius: 4px;
  vertical-align: middle;
  white-space: nowrap;
}

.stock-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.12rem 0.45rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  border-radius: 4px;
  vertical-align: middle;
  white-space: nowrap;
}

.stock-badge--in {
  color: #166534;
  background: #dcfce7;
  border: 1px solid #86efac;
}

.stock-badge--out {
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fca5a5;
}

.admin-stock-btn {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.admin-stock-btn.is-in {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.admin-stock-btn.is-out {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

.product-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.price-bold {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text-main);
}

.price-strike {
  text-decoration: line-through;
  color: var(--text-light);
  font-size: 0.8rem;
  margin-left: 0.3rem;
}

.catalog-qty-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  width: 100%;
}

.catalog-qty-hint {
  display: block;
  width: 100%;
  font-size: 0.7rem;
  color: var(--accent-gold);
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
}

.stepper-box {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-light);
  border-radius: 5px;
  overflow: hidden;
  flex-shrink: 0;
}

.stepper-box--disabled {
  opacity: 0.55;
  border-color: #cbd5e1;
  background: #f1f5f9;
  pointer-events: none;
}

.stepper-box--disabled .stepper-btn {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}

.stepper-box--disabled .stepper-btn:hover {
  background: #f1f5f9;
}

.stepper-box--disabled .stepper-val {
  color: #94a3b8;
}

.catalog-stock-badge {
  box-sizing: border-box;
  margin-left: 0;
  width: 124px;
  min-height: 36px;
  padding: 0.2rem 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: normal;
  line-height: 1.15;
}

.stepper-btn {
  background: #ffffff;
  border: none;
  color: var(--text-main);
  font-weight: 700;
  font-size: 1rem;
  width: 34px;
  height: 34px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease;
}

.stepper-btn:hover {
  background-color: var(--bg-app);
}

.stepper-val {
  width: 38px;
  text-align: center;
  border: none;
  background: transparent;
  font-weight: 700;
  font-size: 0.92rem;
}

.btn-remove-item {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.btn-remove-item:hover {
  background-color: #fee2e2;
  transform: scale(1.12);
}

.catalog-remove-cell {
  display: none;
}

.catalog-amount-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.catalog-remove-inline {
  display: inline-flex;
  flex-shrink: 0;
}

.catalog-remove-mobile {
  display: none;
}

/* SLIDING CART DRAWER (WITH PRODUCT THUMBNAILS & CLEAN FLEX GAP) */
.cart-drawer-overlay {
  position: fixed;
  top: 54px;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.3);
  z-index: 8999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.cart-drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.finn-side-panel {
  width: 460px;
  max-width: 90vw;
  border-left: 1px solid var(--border-light);
  padding: 1.5rem 1.75rem;
  background-color: #ffffff;
  position: fixed;
  top: 54px;
  right: 0;
  transform: translateX(100%);
  height: calc(100vh - 54px);
  max-height: calc(100vh - 54px);
  overflow: hidden;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.12);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.finn-side-panel.open {
  transform: translateX(0);
}

.side-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.75rem;
  margin-bottom: 0.85rem;
  flex-shrink: 0;
}

.side-panel-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0;
  flex: 1;
  text-align: left;
}

.btn-cart-back {
  display: none;
  align-items: center;
  gap: 0.15rem;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.35rem 0.4rem 0.35rem 0;
  margin: 0;
  border-radius: 6px;
  flex-shrink: 0;
}

.btn-cart-back:hover {
  color: var(--primary);
}

.btn-close-drawer {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  transition: color 0.15s ease, background-color 0.15s ease;
  flex-shrink: 0;
}

.btn-close-drawer:hover {
  color: #000000;
  background-color: var(--bg-app);
}

.cart-items-container {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none !important;
  overflow-y: auto;
  padding-right: 0.35rem;
  margin-bottom: 0.5rem;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.cart-item-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-light);
}

.cart-item-img {
  width: 44px;
  height: 44px;
  border-radius: 5px;
  object-fit: cover;
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  flex-shrink: 0;
}

.cart-summary-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.cart-summary-line.total {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 2px solid var(--text-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
  white-space: nowrap;
}

.btn-finn-primary {
  width: 100%;
  background-color: var(--text-main);
  color: #ffffff;
  border: none;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.85rem 1.25rem;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
}

#viewClientReturns .returns-new-btn {
  width: auto;
  max-width: max-content;
  flex: 0 0 auto;
  align-self: flex-start;
  margin-top: 0;
}

.btn-finn-primary:hover {
  opacity: 1;
  background-color: #1e293b;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.22);
}

.btn-finn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
}

.btn-finn-secondary {
  background-color: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.btn-finn-secondary:hover {
  transform: translateY(-2px);
  border-color: #94a3b8;
  background-color: #f8fafc;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}

.btn-finn-secondary:active {
  transform: translateY(0);
  box-shadow: none;
}

.modal-btn-row {
  display: flex;
  gap: 0.75rem;
  width: 100%;
  align-items: stretch;
  margin-top: 0.25rem;
}

.modal-btn-row > .btn-finn-primary,
.modal-btn-row > .btn-finn-secondary {
  flex: 1 1 0;
  width: 50%;
  max-width: none;
  min-width: 0;
  margin: 0;
  box-sizing: border-box;
  text-align: center;
  white-space: normal;
  line-height: 1.25;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 0.65rem;
}

/* UNIFIED STATUS BUTTON & BADGE STYLING (EXACT PILL SHAPE FROM SCREENSHOT) */
.status-badge-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  height: 32px;
  padding: 0 1.25rem;
  border-radius: 20px !important;
  font-size: 0.85rem;
  font-weight: 800;
  color: #ffffff !important;
  text-align: center;
  box-sizing: border-box;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  line-height: 1;
  transition: all 0.15s ease;
  user-select: none;
}

.status-badge-btn.valid {
  background-color: #10b981 !important;
}

.status-badge-btn.pending {
  background-color: #f59e0b !important;
}

.status-badge-btn.cancelled {
  background-color: #94a3b8 !important;
}

.status-badge-btn.clickable {
  cursor: pointer;
}

.status-badge-btn.clickable:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.status-badge-btn.action-approve {
  background-color: #dcfce7 !important;
  color: #15803d !important;
  cursor: pointer;
}

.status-badge-btn.action-reject {
  background-color: #fee2e2 !important;
  color: #dc2626 !important;
  cursor: pointer;
}

.status-badge-btn.action-approve:hover,
.status-badge-btn.action-reject:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.return-actions-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.topbar-user-identity {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255,255,255,0.92);
  margin-right: 0.75rem;
  max-width: 360px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.active {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.modal-content {
  background-color: #ffffff;
  border-radius: 8px;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 2.5rem;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
  position: relative;
}

.order-doc-totals {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-app);
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
}

.order-doc-totals-value {
  text-align: right;
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: transparent;
  border: none;
  font-size: 1.6rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  z-index: 30;
  line-height: 1;
  touch-action: manipulation;
  pointer-events: auto;
}

.modal-close-btn:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

@media print {
  body {
    background-color: #fff !important;
  }
  .finn-topbar, .finn-sidebar, .btn-finn-primary {
    display: none !important;
  }
  .modal-backdrop {
    position: static;
    background: none;
    opacity: 1;
    pointer-events: auto;
  }
  .modal-content {
    box-shadow: none;
    padding: 0;
  }
}

/* CUSTOM TOAST NOTIFICATIONS (SLEEK CORPORATE DESIGN) */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.custom-toast {
  pointer-events: auto;
  min-width: 320px;
  max-width: 440px;
  background-color: #0f172a;
  color: #ffffff;
  padding: 0.9rem 1.25rem;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.88rem;
  font-weight: 600;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
  border-left: 5px solid var(--accent-gold);
}

.custom-toast.show {
  transform: translateX(0);
  opacity: 1;
}

.custom-toast.success {
  border-left-color: #10b981;
}

.custom-toast.error {
  border-left-color: #ef4444;
}

.custom-toast.info {
  border-left-color: #3b82f6;
}

.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ========== MOBILNI: portal naru?ivanje sa telefona ========== */
.mobile-cart-bar {
  display: none;
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 9500;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: #0f172a;
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.35);
  cursor: pointer;
}

.mobile-cart-bar-label {
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0.85;
}

.mobile-cart-bar-total {
  font-size: 1.05rem;
  font-weight: 900;
  margin-top: 0.1rem;
}

.mobile-cart-bar-cta {
  font-size: 0.82rem;
  font-weight: 800;
  background: #fff;
  color: #0f172a;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  html, body, #viewAppContent, .finn-layout {
    overflow-x: hidden !important;
    max-width: 100% !important;
  }

  .topbar-notify-panel {
    position: fixed;
    top: 58px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: calc(100vw - 1.5rem);
    max-width: 420px;
    max-height: min(70vh, 480px);
    z-index: 10050;
  }

  input,
  select,
  textarea {
    font-size: 16px !important;
  }

  .history-filters-grid .finn-search-input,
  .history-filters-grid .finn-search-input::placeholder,
  .history-filters-grid .history-filter-select,
  .history-filters-grid .history-date-input,
  .history-filters-grid .history-date-placeholder {
    font-size: 16px !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    line-height: 1.25;
  }

  .finn-layout {
    width: 100%;
    min-width: 0;
  }

  /* margin-left sidebar ne sme da ?iri layout preko 100% */
  .finn-main-content {
    flex: 1 1 auto;
    min-width: 0;
    width: calc(100% - 64px);
    max-width: calc(100% - 64px);
    margin-left: 64px;
    padding: 0.75rem 0.75rem 5.5rem;
    overflow-x: hidden !important;
    box-sizing: border-box;
  }

  .finn-table-container,
  .catalog-table-wrap,
  .admin-sec-panel,
  .finn-page-header,
  .finn-filter-row {
    overflow-x: hidden !important;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .custom-toast {
    min-width: 0;
    max-width: calc(100% - 1.5rem);
    width: calc(100% - 1.5rem);
    right: 0.75rem;
    left: 0.75rem;
  }

  .topbar-brand {
    font-size: 0.85rem;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-user-identity {
    max-width: 110px;
    font-size: 0.72rem;
    margin-right: 0.4rem;
  }

  .topbar-cart-btn span:not(#topbarCartCount),
  .topbar-link > span:last-child {
    display: none;
  }

  .topbar-right {
    gap: 0.85rem;
  }

  .finn-page-header {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
  }

  .finn-title {
    font-size: 1.35rem;
  }

  .finn-filter-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .finn-filter-row > div {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .finn-count-label {
    white-space: normal;
    word-break: break-word;
  }

  #tableCountLabel {
    text-align: center;
    width: 100%;
  }

  #viewClientPortal .finn-filter-row > div {
    width: 100%;
  }

  /* Izbor objekta ? puno ?irine, bez prelivanja (samo kad je vidljiv) */
  .store-selector-group.is-visible {
    display: flex !important;
    flex-direction: column;
    align-items: stretch !important;
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    gap: 0.35rem !important;
  }

  .store-selector-group:not(.is-visible) {
    display: none !important;
  }

  .store-selector-label {
    white-space: normal !important;
  }

  .header-store-selector,
  #headerStoreSelector {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }

  /* Admin: izbor Market Developera */
  .md-selector-row,
  #mdSelectorRow {
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 0.45rem;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .md-selector-select,
  #salesRepSelector {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }

  .finn-search-box {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .finn-search-input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Tabovi se lome u redove ? bez horizontalnog skrola */
  .finn-subtabs,
  #adminSubtabs {
    overflow-x: hidden !important;
    flex-wrap: wrap;
    margin-left: 0;
    max-width: 100%;
    padding-bottom: 0.25rem;
  }

  .finn-subtabs .subtab-btn,
  #adminSubtabs .subtab-btn {
    flex-shrink: 1;
  }

  /* Baner kupca ? dve kolone */
  .store-info-banner {
    padding: 0.65rem 0.75rem;
  }

  .store-info-left {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 0.5rem 0.85rem;
  }

  .store-info-divider {
    display: none;
  }

  .store-info-block {
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
  }

  .store-info-block--wide {
    grid-column: 1 / -1;
  }

  .store-info-block .store-badge-value,
  .store-info-block .store-code-tag {
    word-break: break-word;
  }

  .store-badge-label {
    min-width: 0;
  }

  /* Katalog kao kartice */
  .catalog-table {
    width: 100% !important;
    max-width: 100% !important;
    border-spacing: 0 !important;
    table-layout: fixed;
  }

  .catalog-table thead {
    display: none;
  }

  .catalog-table,
  .catalog-table tbody,
  .catalog-table tr,
  .catalog-table td {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  .catalog-table tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem 0.85rem;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    overflow: hidden;
  }

  .catalog-table tbody tr.row-active {
    border-color: #93c5fd;
    box-shadow: 0 0 0 1px #93c5fd;
  }

  .catalog-table tbody tr.row-out-of-stock {
    background: #fee2e2 !important;
    border-color: #fca5a5;
  }

  .catalog-table tbody tr.row-out-of-stock td {
    background: transparent !important;
  }

  .catalog-table td {
    border: none !important;
    padding: 0 !important;
    text-align: left !important;
    width: auto !important;
    max-width: 100% !important;
  }

  .catalog-table tbody tr td:first-child,
  .catalog-table tbody tr td:last-child {
    padding-left: 0 !important;
    padding-right: 0 !important;
    border-left: none !important;
    border-right: none !important;
  }

  .catalog-table tbody tr.row-active td:first-child {
    border-left: none !important;
  }

  .catalog-table td.col-desktop-only {
    display: none !important;
  }

  .catalog-table td[data-label="Proizvod"] {
    grid-column: 1 / -1;
    order: 0;
  }

  .catalog-table td[data-label="Pakovanje"] { order: 1; }
  .catalog-table td[data-label="Rabat"] { order: 2; }
  .catalog-table td[data-label="Katalo?ka cena"] { order: 3; }
  .catalog-table td[data-label="Nabavna"] { order: 4; }
  .catalog-table td[data-label="Koli?ina"] { order: 5; }
  .catalog-table td[data-label="Iznos"] { order: 6; }

  .catalog-table td[data-label]:not([data-label="Proizvod"]) {
    text-align: center !important;
  }

  .catalog-table td[data-label]:not([data-label="Proizvod"])::before {
    content: attr(data-label);
    display: block;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 0.2rem;
    text-align: center;
  }

  .catalog-table td[data-label="Proizvod"] {
    padding-bottom: 0.65rem !important;
    border-bottom: 1px solid var(--border-light) !important;
    margin-bottom: 0.35rem;
    text-align: left !important;
  }

  .catalog-table .product-info-cell {
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
    margin: 0;
  }

  .catalog-table .product-img {
    width: 56px;
    height: 56px;
    margin: 0 0.85rem 0 0;
    flex-shrink: 0;
  }

  .catalog-table td[data-label="Koli?ina"],
  .catalog-table td[data-label="Iznos"] {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center !important;
  }

  .catalog-table tbody tr {
    position: relative;
  }

  .catalog-table td.catalog-remove-cell {
    display: none !important;
  }

  .catalog-remove-inline {
    display: none !important;
  }

  .catalog-remove-mobile {
    display: inline-flex !important;
    margin-top: 0.15rem;
  }

  .catalog-qty-hint {
    margin-top: 0;
  }

  .catalog-amount-val {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
  }

  .catalog-stock-badge {
    width: 144px;
    min-height: 46px;
  }

  .stepper-btn {
    width: 44px;
    height: 44px;
    font-size: 1.25rem;
  }

  .stepper-val {
    width: 48px;
    font-size: 1rem;
  }

  /* Porud?bine / povrati / admin ? kartice */
  .table-cards-mobile {
    width: 100% !important;
    max-width: 100% !important;
    border-spacing: 0 !important;
    table-layout: fixed;
  }

  .table-cards-mobile thead {
    display: none;
  }

  .table-cards-mobile,
  .table-cards-mobile tbody,
  .table-cards-mobile tr,
  .table-cards-mobile td {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  .table-cards-mobile tbody tr {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    overflow: hidden;
    width: auto !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  .table-cards-mobile td {
    border: none !important;
    border-radius: 0 !important;
    padding: 0.4rem 0 !important;
    text-align: left !important;
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: normal !important;
    min-width: 0 !important;
  }

  .table-cards-mobile tbody tr td:first-child,
  .table-cards-mobile tbody tr td:last-child {
    padding-left: 0 !important;
    padding-right: 0 !important;
    border-left: none !important;
    border-right: none !important;
  }

  .table-cards-mobile td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 0.2rem;
  }

  .table-cards-mobile .table-actions-row,
  .table-cards-mobile .return-actions-stack {
    justify-content: flex-start !important;
    align-items: stretch !important;
    flex-wrap: wrap;
    width: 100%;
  }

  .table-cards-mobile .table-actions-row .btn-finn-secondary,
  .table-cards-mobile .table-actions-row .btn-finn-primary {
    flex: 1;
    min-width: 0;
  }

  .table-cards-mobile .admin-store-actions {
    display: flex !important;
    flex-wrap: wrap;
    gap: 0.4rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .table-cards-mobile .admin-store-actions .btn-finn-secondary,
  .table-cards-mobile .admin-store-actions .btn-finn-primary {
    flex: 1 1 calc(50% - 0.2rem);
    min-width: 0;
  }

  .table-cards-mobile .admin-store-firm,
  .table-cards-mobile .admin-store-stack {
    align-items: flex-start;
    margin: 0;
    max-width: none;
  }

  .history-orders-table tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem 0.75rem;
  }

  .history-orders-table td {
    width: auto !important;
    max-width: 100% !important;
    padding: 0 !important;
    text-align: left !important;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    justify-self: stretch;
    gap: 0.2rem;
  }

  .history-orders-table td[data-label]::before {
    width: 100%;
    text-align: left !important;
    margin-bottom: 0;
  }

  .history-orders-table td[data-label="Broj naloga"] { order: 1; }
  .history-orders-table td[data-label="Datum"] { order: 2; }
  .history-orders-table td[data-label="Radnja"] {
    order: 3;
    grid-column: 1 / -1;
  }
  .history-orders-table td[data-label="MD"] {
    order: 4;
    grid-column: 1 / -1;
  }
  .history-orders-table td[data-label="Rabat"] { order: 5; }
  .history-orders-table td[data-label="Status"] { order: 6; }
  .history-orders-table td[data-label="Koli?ina"] { order: 7; }
  .history-orders-table td[data-label="Masa"] { order: 8; }
  .history-orders-table td[data-label="Vrednost"] { order: 9; }
  .history-orders-table td[data-label="Moja zarada"] { order: 10; white-space: normal !important; }
  .history-orders-table td[data-label="Dokument"] {
    order: 11;
    grid-column: 1 / -1;
    align-items: stretch;
    justify-self: stretch;
    width: auto !important;
  }

  .table-cards-mobile .product-info-cell {
    max-width: 100%;
  }

  .table-cards-mobile .product-title,
  .table-cards-mobile .product-sub {
    white-space: normal;
    word-break: break-word;
  }

  .table-cards-mobile code,
  .table-cards-mobile .store-code-tag {
    white-space: normal;
    word-break: break-all;
  }

  #viewAdminDashboard .btn-finn-primary[style*="width: auto"],
  #viewAdminDashboard .btn-finn-secondary[style*="width: auto"],
  #viewRepDashboard .btn-finn-primary {
    width: 100% !important;
    box-sizing: border-box;
  }

  .status-badge-btn {
    max-width: 100%;
    min-width: 0;
  }

  /* Korpa full-width na telefonu ? iznad topbara da se vidi Nazad */
  .finn-side-panel {
    width: 100%;
    max-width: 100%;
    left: 0;
    right: 0;
    top: 0;
    height: 100%;
    max-height: 100%;
    padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
    box-sizing: border-box;
    z-index: 10050;
  }

  .cart-drawer-overlay {
    top: 0;
    z-index: 10040;
  }

  .btn-cart-back {
    display: inline-flex;
  }

  .side-panel-title {
    font-size: 1.05rem;
    text-align: center;
  }

  .btn-close-drawer {
    font-size: 1.75rem;
    color: var(--text-main);
    padding: 0.35rem 0.55rem;
    min-width: 44px;
    min-height: 44px;
  }

  /* Sidebar: kad se pro?iri, overlay preko sadr?aja */
  .finn-sidebar.expanded {
    width: min(280px, 85vw);
    min-width: min(280px, 85vw);
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.18);
    z-index: 9600;
  }

  .finn-sidebar.expanded ~ .finn-main-content {
    margin-left: 64px;
    width: calc(100% - 64px);
    max-width: calc(100% - 64px);
  }

  .mdEarningsSummary,
  #mdEarningsSummary {
    grid-template-columns: 1fr !important;
  }

  .login-card {
    margin: 0;
    width: 100%;
    max-width: 420px;
  }

  .login-wrapper {
    padding: 1rem;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Modali */
  .modal-backdrop {
    padding: 0.5rem;
    align-items: flex-end;
  }

  .modal-content {
    max-width: 100%;
    max-height: 92vh;
    padding: 1.25rem;
    border-radius: 12px 12px 0 0;
    margin: 0;
    width: 100% !important;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .modal-content .finn-table-container {
    overflow-x: hidden !important;
    max-width: 100%;
  }

  .modal-content [style*="grid-template-columns: 1fr 1fr"],
  .modal-content [style*="grid-template-columns: 1fr 1fr 1.4fr"],
  .modal-content [style*="grid-template-columns: 1fr 1fr auto"],
  .modal-content [style*="grid-template-columns: 1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  .modal-content [style*="display: flex"][style*="justify-content: space-between"] {
    flex-wrap: wrap;
    gap: 0.75rem;
    max-width: 100%;
    min-width: 0;
  }

  .order-doc-totals {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.65rem;
  }

  .order-doc-totals-value {
    text-align: center;
  }

  /* Globalni catch: ni?ta ne sme da ?iri viewport */
  .finn-main-content select,
  .finn-main-content .login-input,
  .finn-main-content .finn-search-input,
  .modal-content select,
  .modal-content .login-input,
  .modal-content .finn-search-input {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .finn-main-content select,
  .modal-content select {
    width: 100%;
  }

  .finn-filter-row .btn-finn-primary[style*="width: auto"],
  .finn-filter-row .btn-finn-secondary[style*="width: auto"],
  #viewClientHistory .btn-finn-primary[style*="width: auto"],
  .modal-content .btn-finn-primary[style*="width: auto"] {
    width: 100% !important;
    box-sizing: border-box;
  }

  .modal-btn-row > .btn-finn-primary,
  .modal-btn-row > .btn-finn-secondary {
    width: 50% !important;
    flex: 1 1 0 !important;
  }

  .finn-filter-row > div[style*="display: flex"] {
    flex-direction: column;
    align-items: stretch !important;
  }

  .finn-filter-row > div[style*="display: flex"] > div[style*="display: flex"] {
    width: 100%;
  }

  .finn-filter-row > div[style*="display: flex"] > div[style*="display: flex"] .btn-finn-primary,
  .finn-filter-row > div[style*="display: flex"] > div[style*="display: flex"] .btn-finn-secondary {
    flex: 1 1 100%;
    width: 100%;
    box-sizing: border-box;
  }

  #mdSelfIdentityText,
  #viewHeaderTitle,
  .finn-title {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .custom-product-picker,
  .product-picker-trigger,
  .product-picker-dropdown,
  .product-picker-list {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .product-picker-dropdown {
    left: 0;
    right: 0;
    width: 100%;
  }

  #storeModalOptionsContainer > div {
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  #storeModalOptionsContainer strong {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .cart-item-line {
    flex-wrap: wrap;
    max-width: 100%;
  }

  .cart-item-line [style*="white-space: nowrap"] {
    white-space: normal !important;
  }
}

@media (max-width: 480px) {
  .topbar-brand {
    max-width: 90px;
    font-size: 0.78rem;
  }

  .topbar-user-identity {
    display: none !important;
  }

  .finn-main-content {
    padding: 0.65rem 0.65rem 5.75rem;
    width: calc(100% - 64px);
    max-width: calc(100% - 64px);
  }

  .status-badge-btn {
    min-width: 0;
    max-width: 100%;
    height: 30px;
    font-size: 0.8rem;
  }
}

body:not(.app-open) .mobile-bottom-nav,
body:not(.app-open) .mobile-cart-bar {
  display: none !important;
}

.mobile-bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9800;
  background: #ffffff;
  border-top: 1px solid var(--border-light);
  padding: 0.2rem 0.15rem calc(0.25rem + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 20px rgba(15, 23, 42, 0.08);
  justify-content: space-around;
  align-items: stretch;
  gap: 0;
}

#mnavRep,
#mnavAdmin,
#sideBtnRep,
#sideBtnAdmin {
  display: none !important;
}

body.role-rep #mnavRep,
body.role-admin #mnavRep,
body.role-admin #mnavAdmin,
body.role-rep #sideBtnRep,
body.role-admin #sideBtnRep,
body.role-admin #sideBtnAdmin {
  display: flex !important;
}

.mobile-nav-btn {
  flex: 1 1 0;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.4rem 0.15rem;
  min-height: 52px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  border-radius: 8px;
}

.mobile-nav-btn svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
}

.mobile-nav-btn.active {
  color: var(--text-main);
  background: var(--bg-app);
}

@media (min-width: 901px) {
  .mobile-cart-bar {
    display: none !important;
  }
  .mobile-bottom-nav {
    display: none !important;
  }
}

@media (max-width: 900px) {
  .finn-sidebar {
    display: none !important;
  }

  .finn-main-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0.85rem 0.85rem calc(5.5rem + env(safe-area-inset-bottom)) !important;
  }

  .mobile-bottom-nav {
    display: flex;
  }

  .mobile-cart-bar {
    left: 10px;
    right: 10px;
    bottom: calc(62px + env(safe-area-inset-bottom));
    border-radius: 10px;
  }

  .finn-title {
    font-size: 1.2rem !important;
    line-height: 1.25;
    width: 100%;
    text-align: center;
  }

  .finn-page-header > div:first-child {
    justify-content: center;
  }

  #viewHeaderTitle {
    width: 100%;
    text-align: center;
  }

  .finn-page-header {
    margin-bottom: 0.85rem;
  }

  .store-info-banner {
    padding: 0.7rem 0.85rem;
    gap: 0.65rem;
  }

  .history-filters-grid {
    grid-template-columns: 1fr 1fr;
  }

  .history-filter-search {
    grid-column: 1 / -1;
  }

  .history-filter-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .history-filter-action-btns {
    width: 100%;
  }

  .history-filter-action-btns .btn-finn-secondary,
  .history-filter-action-btns .btn-finn-primary {
    flex: 1 1 0;
    width: 50%;
    min-height: 44px;
  }

  .history-filter-actions .finn-count-label {
    width: 100%;
    text-align: center;
  }

  .finn-title {
    width: 100%;
    text-align: center;
  }

  .returns-toolbar {
    flex-direction: column;
    align-items: center;
  }

  .returns-toolbar-search {
    width: 100%;
  }

  #viewClientReturns .finn-search-box {
    width: 100%;
    max-width: 100%;
  }

  #viewClientReturns .finn-count-label {
    width: 100%;
    text-align: center;
    margin-top: 0.45rem;
  }

  .returns-new-btn {
    width: fit-content !important;
    max-width: 100%;
    margin: 0.15rem auto 0 !important;
    justify-content: center;
    text-align: center;
    white-space: normal;
    line-height: 1.25;
  }

  .table-cards-mobile td.returns-empty-cell {
    text-align: center !important;
    padding: 1.5rem 0.5rem !important;
  }

  .finn-subtabs,
  #adminSubtabs {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
  }

  .subtab-btn {
    min-height: 40px;
  }

  .stepper-btn {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 600px) {
  .history-filters-grid {
    grid-template-columns: 1fr;
  }

  .topbar-brand {
    font-size: 0.78rem;
    max-width: 140px;
  }

  .login-card {
    padding: 1.25rem 1rem;
  }
}

/* ==========================================================================
   ADMIN ERP WORKSPACE ? Bikezy / ACME style (samo Uprava)
   ========================================================================== */
body.admin-dashboard-active {
  --erp-bg: #eef1f5;
  --erp-card: #ffffff;
  --erp-border: #e2e8f0;
  --erp-text: #0f172a;
  --erp-muted: #64748b;
  --erp-accent: #2563eb;
  --erp-accent-soft: #eff6ff;
  --erp-radius: 16px;
  --erp-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --erp-sidebar: 248px;
}

/* Bez animacije ¯irine pri loginu (spre?ava zoom flash) */
body.erp-shell-boot .finn-sidebar,
body.erp-shell-boot .finn-main-content {
  transition: none !important;
}

/* Sakrij stari page header samo na Uprava (admin ima svoj workspace header) */
body.admin-section-active .finn-page-header {
  display: none !important;
}

body.admin-dashboard-active .finn-page-header {
  margin-bottom: 1rem;
  padding: 1rem 1.2rem;
  background: #fff;
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius);
  box-shadow: var(--erp-shadow);
}

body.admin-dashboard-active .finn-title {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--erp-text);
}

body.admin-dashboard-active .store-info-banner {
  border-radius: 12px;
  border-color: #e2e8f0;
  background: #f8fafc;
  box-shadow: none;
}

body.admin-dashboard-active .finn-layout {
  background-color: var(--erp-bg) !important;
  overflow-x: auto !important;
}

body.admin-dashboard-active {
  overflow-x: auto !important;
}

html.admin-dashboard-active {
  overflow-x: auto !important;
}

/* Sidebar uvek pro?iren sa labelama */
body.admin-dashboard-active .finn-sidebar {
  width: var(--erp-sidebar) !important;
  min-width: var(--erp-sidebar) !important;
  align-items: flex-start !important;
  background: #f8fafc !important;
  border-right: 1px solid #e2e8f0 !important;
  box-shadow: inset -1px 0 0 rgba(15, 23, 42, 0.02);
}

body.admin-dashboard-active .finn-sidebar .sidebar-burger-btn {
  width: 100% !important;
  justify-content: flex-start !important;
  padding: 0 1.25rem !important;
  background: #f8fafc !important;
  border-bottom-color: #e2e8f0 !important;
}

body.admin-dashboard-active .finn-sidebar .sidebar-label {
  display: inline-block !important;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
}

body.admin-dashboard-active .finn-sidebar .sidebar-item-btn {
  width: calc(100% - 1.5rem) !important;
  justify-content: flex-start !important;
  margin: 0.28rem 0.75rem !important;
  padding: 0 0.9rem !important;
  height: 44px;
  border-radius: 12px;
  color: #64748b;
}

/* Kontakt / Podr?ka uvek pri dnu (kao ranije) */
body.admin-dashboard-active .finn-sidebar #sideBtnContact {
  margin-top: auto !important;
  margin-bottom: 0.85rem !important;
  margin-left: 0.75rem !important;
  margin-right: 0.75rem !important;
}

.finn-sidebar #sideBtnContact {
  margin-top: auto !important;
  margin-bottom: 0.85rem !important;
}

body.admin-dashboard-active .finn-sidebar .sidebar-item-btn:hover {
  background: #fff !important;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

body.admin-dashboard-active .finn-sidebar .sidebar-item-btn.active {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  box-shadow: inset 0 0 0 1px #bfdbfe;
}

body.admin-dashboard-active .finn-main-content {
  margin-left: var(--erp-sidebar) !important;
  background-color: var(--erp-bg) !important;
  padding: 1.35rem 1.5rem 2.5rem !important;
  overflow-x: auto !important;
  min-width: 0;
  max-width: 100%;
}

body.admin-dashboard-active #viewAdminDashboard.active {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.admin-erp-workspace {
  max-width: 100%;
  width: 100%;
  min-width: 0;
  margin: 0;
  box-sizing: border-box;
}

.admin-erp-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding: 1.15rem 1.35rem;
  background: #fff;
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius);
  box-shadow: var(--erp-shadow);
}

.admin-erp-eyebrow {
  display: block;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 0.35rem;
}

.admin-erp-page-title {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--erp-text);
  line-height: 1.15;
}

.admin-erp-page-sub {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  color: var(--erp-muted);
  font-weight: 500;
}

body.admin-dashboard-active #adminSubtabs.admin-erp-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0;
  padding: 0.28rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f1f5f9;
  box-shadow: none;
  overflow-x: auto;
}

body.admin-dashboard-active #adminSubtabs .subtab-btn {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.55rem 1rem;
  border-radius: 9px;
  transform: none;
  white-space: nowrap;
}

body.admin-dashboard-active #adminSubtabs .subtab-btn:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.7);
  transform: none;
}

body.admin-dashboard-active #adminSubtabs .subtab-btn.active {
  background: #fff;
  color: #1d4ed8;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), inset 0 0 0 1px #dbeafe;
}

body.admin-dashboard-active #adminSecOverview {
  max-width: none;
  margin: 0;
  gap: 1rem;
}

body.admin-dashboard-active #adminSecOverview.admin-sec-panel.active {
  display: flex !important;
  flex-direction: column;
}

body.admin-dashboard-active .admin-overview-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.85rem;
}

body.admin-dashboard-active .admin-overview-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--erp-card);
  border: 1px solid var(--erp-border);
  border-radius: 14px;
  padding: 1rem 1.05rem;
  box-shadow: var(--erp-shadow);
  position: relative;
  overflow: hidden;
}

body.admin-dashboard-active .admin-overview-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #cbd5e1;
}

body.admin-dashboard-active .admin-overview-card.tone-blue::before { background: #3b82f6; }
body.admin-dashboard-active .admin-overview-card.tone-indigo::before { background: #6366f1; }
body.admin-dashboard-active .admin-overview-card.tone-teal::before { background: #14b8a6; }
body.admin-dashboard-active .admin-overview-card.tone-slate::before { background: #475569; }
body.admin-dashboard-active .admin-overview-card.tone-amber::before { background: #f59e0b; }
body.admin-dashboard-active .admin-overview-card.tone-rose::before { background: #f43f5e; }

body.admin-dashboard-active .admin-overview-card-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #eef2f7;
}

body.admin-dashboard-active .admin-overview-card.tone-blue .admin-overview-card-icon {
  background: #eff6ff; color: #2563eb; border-color: #dbeafe;
}
body.admin-dashboard-active .admin-overview-card.tone-indigo .admin-overview-card-icon {
  background: #eef2ff; color: #4f46e5; border-color: #e0e7ff;
}
body.admin-dashboard-active .admin-overview-card.tone-teal .admin-overview-card-icon {
  background: #f0fdfa; color: #0d9488; border-color: #ccfbf1;
}
body.admin-dashboard-active .admin-overview-card.tone-slate .admin-overview-card-icon {
  background: #f1f5f9; color: #475569; border-color: #e2e8f0;
}
body.admin-dashboard-active .admin-overview-card.tone-amber .admin-overview-card-icon {
  background: #fffbeb; color: #d97706; border-color: #fde68a;
}
body.admin-dashboard-active .admin-overview-card.tone-rose .admin-overview-card-icon {
  background: #fff1f2; color: #e11d48; border-color: #fecdd3;
}

body.admin-dashboard-active .admin-overview-card-body {
  min-width: 0;
  flex: 1;
}

body.admin-dashboard-active .admin-overview-card.clickable:hover {
  border-color: #cbd5e1;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.1);
  transform: translateY(-1px);
}

body.admin-dashboard-active .admin-overview-card-label {
  font-size: 0.68rem;
  font-weight: 750;
  color: var(--erp-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body.admin-dashboard-active .admin-overview-card-value {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--erp-text);
  margin-top: 0.28rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

body.admin-dashboard-active .admin-overview-card.warn .admin-overview-card-value {
  color: #b45309;
}

body.admin-dashboard-active .admin-overview-card.danger .admin-overview-card-value {
  color: #be123c;
}

body.admin-dashboard-active .admin-overview-card-sub {
  font-size: 0.74rem;
  color: var(--erp-muted);
  margin-top: 0.28rem;
}

body.admin-dashboard-active .admin-overview-tabs {
  display: inline-flex;
  width: auto;
  max-width: 100%;
  background: #fff;
  border: 1px solid var(--erp-border);
  border-radius: 12px;
  padding: 0.28rem;
  margin: 0.1rem 0 0.15rem;
  box-shadow: var(--erp-shadow);
  gap: 0.25rem;
}

body.admin-dashboard-active .admin-overview-tab {
  flex: 0 1 auto;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.55rem 1rem;
  border-radius: 9px;
  color: var(--erp-muted);
}

body.admin-dashboard-active .admin-overview-tab:hover {
  background: #f8fafc;
  color: var(--erp-text);
}

body.admin-dashboard-active .admin-overview-tab.active {
  background: var(--erp-accent-soft);
  color: #1d4ed8;
  box-shadow: inset 0 0 0 1px #bfdbfe;
}

body.admin-dashboard-active .admin-overview-tab-panel {
  gap: 0.95rem;
}

body.admin-dashboard-active .admin-overview-columns {
  gap: 0.95rem;
}

body.admin-dashboard-active .admin-overview-panel {
  background: var(--erp-card);
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius);
  padding: 1.05rem 1.15rem 1.15rem;
  box-shadow: var(--erp-shadow);
}

body.admin-dashboard-active .admin-overview-panel-head {
  margin-bottom: 0.85rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid #f1f5f9;
}

body.admin-dashboard-active .admin-overview-panel-head h3 {
  font-size: 0.95rem;
  font-weight: 750;
  color: var(--erp-text);
  letter-spacing: -0.01em;
}

body.admin-dashboard-active .admin-overview-period {
  font-size: 0.7rem;
  font-weight: 650;
  color: var(--erp-muted);
  background: #f8fafc;
  border: 1px solid var(--erp-border);
  border-radius: 999px;
  padding: 0.22rem 0.65rem;
}

body.admin-dashboard-active .admin-overview-panel-head .btn-finn-secondary {
  font-size: 0.72rem !important;
  padding: 0.35rem 0.75rem !important;
  border-radius: 8px !important;
  border-color: var(--erp-border) !important;
  background: #fff !important;
  color: #334155 !important;
}

body.admin-dashboard-active .admin-overview-feed {
  height: 19rem;
  max-height: 19rem;
  gap: 0;
}

body.admin-dashboard-active .admin-overview-feed-row {
  background: transparent;
  border: none;
  border-bottom: 1px solid #f1f5f9;
  border-radius: 0;
  padding: 0.7rem 0.15rem;
}

body.admin-dashboard-active .admin-overview-feed-row:last-child {
  border-bottom: none;
}

body.admin-dashboard-active .admin-overview-feed-row:hover {
  background: #f8fafc;
  border-color: #f1f5f9;
  border-radius: 10px;
  padding-left: 0.55rem;
  padding-right: 0.55rem;
}

body.admin-dashboard-active .admin-overview-feed-id {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--erp-text);
}

body.admin-dashboard-active .admin-overview-feed-meta {
  font-size: 0.72rem;
  color: var(--erp-muted);
}

body.admin-dashboard-active .admin-overview-feed-amt {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--erp-text);
}

body.admin-dashboard-active .admin-overview-feed-row .status-badge-btn {
  min-width: auto;
  height: auto;
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  padding: 0.3rem 0.7rem !important;
  border-radius: 999px !important;
  border: none !important;
  color: inherit !important;
}

body.admin-dashboard-active .admin-overview-feed-row .status-badge-btn.pending {
  background: #fff7ed !important;
  color: #c2410c !important;
}

body.admin-dashboard-active .admin-overview-feed-row .status-badge-btn.valid {
  background: #ecfdf5 !important;
  color: #047857 !important;
}

body.admin-dashboard-active .admin-overview-feed-row .status-badge-btn.cancelled {
  background: #f1f5f9 !important;
  color: #64748b !important;
}

body.admin-dashboard-active .admin-overview-feed-row .btn-finn-secondary {
  font-size: 0.7rem !important;
  padding: 0.3rem 0.65rem !important;
  border-radius: 8px !important;
}

body.admin-dashboard-active .admin-rank-row,
body.admin-dashboard-active .admin-trend-row {
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
}

body.admin-dashboard-active .admin-overdue-card,
body.admin-dashboard-active .admin-never-card {
  border-radius: 12px;
  padding: 0.65rem 0.8rem;
  background: #fff;
  border: 1px solid #eef2f7;
}

body.admin-dashboard-active .admin-overview-blocked-chip {
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
}

/* Kupci / MD / Proizvodi ? JEDAN panel (bez kartice u kartici) */
body.admin-dashboard-active .admin-erp-panel {
  background: #fff;
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius);
  box-shadow: var(--erp-shadow);
  padding: 1rem 1.15rem 1.15rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: visible;
}

body.admin-dashboard-active #adminSecStores .finn-filter-row,
body.admin-dashboard-active #adminSecReps .finn-filter-row,
body.admin-dashboard-active #adminSecProducts .finn-filter-row {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0 0 0.85rem;
  margin-bottom: 0.85rem !important;
  border-bottom: 1px solid #f1f5f9;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

body.admin-dashboard-active #adminSecStores .finn-table-container,
body.admin-dashboard-active #adminSecReps .finn-table-container,
body.admin-dashboard-active #adminSecProducts .finn-table-container {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: touch;
  display: block;
}

/* horizontalni scroll uvek vidljiv kad treba */
body.admin-dashboard-active #adminSecStores .finn-table-container::-webkit-scrollbar,
body.admin-dashboard-active #adminSecReps .finn-table-container::-webkit-scrollbar,
body.admin-dashboard-active #adminSecProducts .finn-table-container::-webkit-scrollbar {
  height: 10px;
}

body.admin-dashboard-active #adminSecStores .finn-table-container::-webkit-scrollbar-thumb,
body.admin-dashboard-active #adminSecReps .finn-table-container::-webkit-scrollbar-thumb,
body.admin-dashboard-active #adminSecProducts .finn-table-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

body.admin-dashboard-active #adminSecStores .finn-table,
body.admin-dashboard-active #adminSecReps .finn-table,
body.admin-dashboard-active #adminSecProducts .finn-table {
  margin: 0;
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
}

body.admin-dashboard-active #adminSecStores .finn-table th,
body.admin-dashboard-active #adminSecReps .finn-table th,
body.admin-dashboard-active #adminSecProducts .finn-table th {
  background: #f8fafc;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.85rem 0.85rem;
}

body.admin-dashboard-active #adminSecStores .finn-table td,
body.admin-dashboard-active #adminSecReps .finn-table td,
body.admin-dashboard-active #adminSecProducts .finn-table td {
  padding: 0.85rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.86rem;
  vertical-align: top;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

body.admin-dashboard-active #adminSecStores .finn-table tbody tr:last-child td,
body.admin-dashboard-active #adminSecReps .finn-table tbody tr:last-child td,
body.admin-dashboard-active #adminSecProducts .finn-table tbody tr:last-child td {
  border-bottom: none;
}

body.admin-dashboard-active #adminSecStores .finn-table tbody tr:hover,
body.admin-dashboard-active #adminSecReps .finn-table tbody tr:hover,
body.admin-dashboard-active #adminSecProducts .finn-table tbody tr:hover {
  background: #f8fafc;
}

body.admin-dashboard-active #adminSecStores .btn-finn-primary,
body.admin-dashboard-active #adminSecReps .btn-finn-primary,
body.admin-dashboard-active #adminSecProducts .btn-finn-primary {
  border-radius: 10px;
  background: #0f172a;
  border-color: #0f172a;
}

body.admin-dashboard-active #adminSecStores .btn-finn-secondary,
body.admin-dashboard-active #adminSecReps .btn-finn-secondary,
body.admin-dashboard-active #adminSecProducts .btn-finn-secondary {
  border-radius: 10px;
}

body.admin-dashboard-active .finn-search-input {
  border-radius: 10px !important;
  border-color: #e2e8f0 !important;
  background: #f8fafc !important;
}

@media (max-width: 1200px) {
  body.admin-dashboard-active .admin-overview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  body.admin-dashboard-active {
    --erp-sidebar: 0px;
  }

  /* Telefon: sidebar sakriven (bottom nav), content full-width — bez praznog levog ruba */
  body.admin-dashboard-active .finn-sidebar,
  body.admin-dashboard-active .finn-sidebar.expanded {
    display: none !important;
    width: 0 !important;
    min-width: 0 !important;
  }

  body.admin-dashboard-active .finn-main-content,
  body.admin-dashboard-active .finn-sidebar.expanded ~ .finn-main-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0.85rem 0.85rem calc(5.5rem + env(safe-area-inset-bottom)) !important;
    overflow-x: hidden !important;
  }

  body.admin-dashboard-active .finn-layout {
    overflow-x: hidden !important;
  }

  body.admin-dashboard-active .finn-page-header {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0.85rem;
  }

  body.admin-dashboard-active #viewClientPortal.active,
  body.admin-dashboard-active #viewClientHistory.active,
  body.admin-dashboard-active #viewClientReturns.active,
  body.admin-dashboard-active #viewRepDashboard.active,
  body.admin-dashboard-active .admin-erp-panel,
  body.admin-dashboard-active .admin-erp-workspace,
  body.admin-dashboard-active .admin-erp-top {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Na telefonu tabele ne smeju da guraju ceo layout u desno */
  body.admin-dashboard-active #viewClientPortal .finn-table,
  body.admin-dashboard-active #viewClientHistory .finn-table,
  body.admin-dashboard-active #viewClientReturns .finn-table,
  body.admin-dashboard-active #viewRepDashboard .finn-table,
  body.admin-dashboard-active #adminSecStores .finn-table,
  body.admin-dashboard-active #adminSecReps .finn-table,
  body.admin-dashboard-active #adminSecProducts .finn-table {
    width: 100% !important;
    min-width: 0 !important;
  }

  body.admin-dashboard-active .admin-overview-grid {
    grid-template-columns: 1fr;
  }

  body.admin-dashboard-active .admin-overview-feed {
    height: 16.5rem;
    max-height: 16.5rem;
  }

  body.admin-dashboard-active .admin-overview-card-value {
    font-size: 1.2rem;
  }

  .admin-erp-top {
    padding: 1rem;
  }

  .admin-erp-page-title {
    font-size: 1.3rem;
  }
}

@media (max-width: 560px) {
  body.admin-dashboard-active .admin-overview-grid {
    grid-template-columns: 1fr;
  }
}


/* ==========================================================================
   ERP shell ¯ Katalog / Porudzbine / Povrat / MD (admin, kupac, komercijalista)
   ========================================================================== */
body.admin-dashboard-active #categorySubtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0 0 1rem;
  padding: 0.28rem;
  border: 1px solid var(--erp-border);
  border-radius: 12px;
  background: #f1f5f9;
  box-shadow: none;
}

body.admin-dashboard-active #categorySubtabs .subtab-btn {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.5rem 0.9rem;
  border-radius: 9px;
  transform: none;
}

body.admin-dashboard-active #categorySubtabs .subtab-btn:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.75);
  transform: none;
}

body.admin-dashboard-active #categorySubtabs .subtab-btn.active {
  background: #fff;
  color: #1d4ed8;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), inset 0 0 0 1px #dbeafe;
}

body.admin-dashboard-active #viewClientPortal.active,
body.admin-dashboard-active #viewClientHistory.active,
body.admin-dashboard-active #viewClientReturns.active,
body.admin-dashboard-active #viewRepDashboard.active {
  background: #fff;
  border: 1px solid var(--erp-border);
  border-radius: var(--erp-radius);
  box-shadow: var(--erp-shadow);
  padding: 1rem 1.15rem 1.25rem;
  box-sizing: border-box;
}

body.admin-dashboard-active #viewClientPortal .finn-filter-row,
body.admin-dashboard-active #viewClientHistory .finn-filter-row,
body.admin-dashboard-active #viewClientReturns .finn-filter-row,
body.admin-dashboard-active #viewRepDashboard .md-selector-row,
body.admin-dashboard-active #viewRepDashboard #mdSelfIdentity {
  background: transparent;
  border: none;
  box-shadow: none;
  margin-bottom: 0.85rem !important;
  padding-bottom: 0.85rem !important;
  border-bottom: 1px solid #f1f5f9 !important;
}

body.admin-dashboard-active #viewClientPortal .finn-table-container,
body.admin-dashboard-active #viewClientHistory .finn-table-container,
body.admin-dashboard-active #viewClientReturns .finn-table-container,
body.admin-dashboard-active #viewRepDashboard .finn-table-container {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: auto !important;
}

body.admin-dashboard-active #viewClientPortal .finn-table,
body.admin-dashboard-active #viewClientHistory .finn-table,
body.admin-dashboard-active #viewClientReturns .finn-table,
body.admin-dashboard-active #viewRepDashboard .finn-table {
  border-spacing: 0;
  margin: 0;
  width: max-content;
  min-width: 100%;
}

body.admin-dashboard-active #viewClientPortal .finn-table th,
body.admin-dashboard-active #viewClientHistory .finn-table th,
body.admin-dashboard-active #viewClientReturns .finn-table th,
body.admin-dashboard-active #viewRepDashboard .finn-table th {
  background: #f8fafc;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.85rem 0.85rem;
}

body.admin-dashboard-active #viewClientPortal .finn-table td,
body.admin-dashboard-active #viewClientHistory .finn-table td,
body.admin-dashboard-active #viewClientReturns .finn-table td,
body.admin-dashboard-active #viewRepDashboard .finn-table td {
  padding: 0.85rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.86rem;
  vertical-align: middle;
}

body.admin-dashboard-active #viewClientPortal .finn-table tbody tr:hover,
body.admin-dashboard-active #viewClientHistory .finn-table tbody tr:hover,
body.admin-dashboard-active #viewClientReturns .finn-table tbody tr:hover,
body.admin-dashboard-active #viewRepDashboard .finn-table tbody tr:hover {
  background: #f8fafc;
}

body.admin-dashboard-active #viewClientPortal .finn-table tbody tr:last-child td,
body.admin-dashboard-active #viewClientHistory .finn-table tbody tr:last-child td,
body.admin-dashboard-active #viewClientReturns .finn-table tbody tr:last-child td,
body.admin-dashboard-active #viewRepDashboard .finn-table tbody tr:last-child td {
  border-bottom: none;
}

body.admin-dashboard-active #viewClientPortal .btn-finn-primary,
body.admin-dashboard-active #viewClientHistory .btn-finn-primary,
body.admin-dashboard-active #viewClientReturns .btn-finn-primary,
body.admin-dashboard-active #viewRepDashboard .btn-finn-primary {
  border-radius: 10px;
  background: #0f172a;
  border-color: #0f172a;
}

body.admin-dashboard-active #viewClientPortal .btn-finn-secondary,
body.admin-dashboard-active #viewClientHistory .btn-finn-secondary,
body.admin-dashboard-active #viewClientReturns .btn-finn-secondary,
body.admin-dashboard-active #viewRepDashboard .btn-finn-secondary {
  border-radius: 10px;
}

body.admin-dashboard-active #viewClientHistory .status-badge-btn,
body.admin-dashboard-active #viewClientReturns .status-badge-btn {
  border-radius: 999px !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  padding: 0.3rem 0.7rem !important;
  height: auto !important;
  min-width: auto !important;
  border: none !important;
}

body.admin-dashboard-active #viewClientHistory .status-badge-btn.pending {
  background: #fff7ed !important;
  color: #c2410c !important;
}

body.admin-dashboard-active #viewClientHistory .status-badge-btn.valid {
  background: #ecfdf5 !important;
  color: #047857 !important;
}

body.admin-dashboard-active #viewClientHistory .status-badge-btn.cancelled {
  background: #f1f5f9 !important;
  color: #64748b !important;
}

body.admin-dashboard-active #mdEarningsSummary > div,
body.admin-dashboard-active #mdTeamSummary > div {
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 14px !important;
  box-shadow: var(--erp-shadow) !important;
  padding: 0.95rem 1rem !important;
}

body.admin-dashboard-active #viewRepDashboard #mdTeamOverviewWrap.admin-overview-panel {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: none;
  padding: 1rem;
}

body.admin-dashboard-active #viewClientPortal .finn-search-input,
body.admin-dashboard-active #viewClientHistory .finn-search-input,
body.admin-dashboard-active #viewClientReturns .finn-search-input,
body.admin-dashboard-active #viewRepDashboard .finn-search-input,
body.admin-dashboard-active #viewClientHistory .history-filter-select,
body.admin-dashboard-active #viewClientHistory .history-date-input,
body.admin-dashboard-active #viewRepDashboard .md-selector-select {
  border-radius: 10px !important;
  border-color: #e2e8f0 !important;
  background: #f8fafc !important;
}
