/* Fonts loaded via <link> in base.html — no @import here (link is faster) */

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

:root {
  /* ── Canvas ── */
  --bg:           #F0F4FA;
  --surface:      #FFFFFF;
  --surface-2:    #E8EEF5;
  --card-bg:      #FFFFFF;
  --border:       #E8E6E0;
  --border-2:     #D6D2CB;

  /* ── Text ── */
  --text:         #14120F;
  --text-2:       #5B5651;
  --text-3:       #8E8882;

  /* ── Brand accent ── */
  --accent:       #2B4ADB;
  --accent-light: #EEF1FD;
  --accent-dark:  #1E35A8;

  /* ── Semantic colors ── */
  --green:        #1A7F5A;
  --green-light:  #E8F5F0;
  --red:          #B5372A;
  --red-light:    #FBEAE7;
  --amber:        #A65F0A;
  --amber-light:  #FCF1DF;
  --purple:       #6F3DB8;
  --purple-light: #F1EAFA;

  /* ── Peroviq brand (logo only — do NOT use as general accent) ── */
  --brand-orange:       #DC4405;
  --brand-orange-light: #FDEEE8;
  --brand-blue:         #2C3DA8;

  /* ── Sidebar tokens ── */
  --side-bg:          #ffffff;
  --side-bg-2:        #F3F6FF;
  --side-border:      #E0E7F0;
  --side-text:        #546078;
  --side-text-strong: #1A202C;
  --side-accent:      #2B4ADB;
  --sidebar-w:        224px;

  /* ── Layout ── */
  --header-h: 52px;

  /* ── Border radius (tighter) ── */
  --radius-sm:   4px;
  --radius:      6px;
  --radius-lg:   10px;
  --radius-full: 9999px;

  /* ── Shadows ── */
  --shadow:        0 1px 2px rgba(0,0,0,0.05), 0 1px 0 rgba(0,0,0,0.03);
  --shadow-md:     0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:     0 8px 24px rgba(0,0,0,0.10);
  --shadow-inset:  inset 0 1px 3px rgba(0,0,0,0.06);

  /* ── Spacing scale (8 pt grid) ── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;

  /* ── Typography scale ── */
  --text-xs:      10px;
  --text-hint:    11px;
  --text-sm:      12px;
  --text-base:    13px;
  --text-lg:      15px;
  --text-xl:      17px;
  --text-2xl:     22px;
  --text-3xl:     32px;
  --text-display: 28px;

  /* ── Font weights ── */
  --fw-normal:   400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;

  /* ── Letter spacing ── */
  --tracking-wide:  0.4px;
  --tracking-wider: 1.5px;

  /* ── Font families ── */
  --font-sans:     'Inter', 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-display:  'Oswald', 'DM Sans', sans-serif;
  --font-mono:     'JetBrains Mono', 'DM Mono', ui-monospace, monospace;
  --font-fraunces: 'Fraunces', serif;

  /* ── Density (override via data-density="compact" on <html> or .shell) ── */
  --row-h:  36px;
  --pad-y:  10px;
  --pad-x:  14px;

  /* ── Line heights ── */
  --leading-tight: 1.25;
  --leading:       1.5;
  --leading-loose: 1.75;

  /* ── Motion ── */
  --transition:      0.12s ease;
  --transition-fast: 0.07s ease;
  --transition-slow: 0.25s ease;

  /* ── Z-index scale ── */
  --z-dropdown: 10;
  --z-topbar:   50;
  --z-sidebar:  100;
  --z-modal:    200;
  --z-toast:    300;

  /* ── Backwards-compat aliases — keep existing templates working ── */
  --canvas:              var(--bg);
  --brand-primary:       var(--accent);
  --brand-primary-dark:  var(--accent-dark);
  --brand-primary-light: var(--accent-light);
  --color-primary:       var(--accent);
  --surface2:            var(--surface-2);
  --border2:             var(--border-2);
  --text2:               var(--text-2);
  --text3:               var(--text-3);
}

/* Compact density override */
[data-density="compact"] {
  --row-h:     30px;
  --pad-y:     6px;
  --pad-x:     10px;
  --text-base: 12px;
  --text-sm:   11px;
  --text-xs:   10px;
}

body { font-family: var(--font-sans); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; min-height: 100vh; }

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

/* SIDEBAR — layout only; light theme in shell.css */
.sidebar { width: var(--sidebar-w); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; }
.sidebar-logo { padding: 20px 20px 16px; }
.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 20px; cursor: pointer; transition: all 0.15s; font-size: 13.5px; text-decoration: none; }
.nav-item .icon { width: 16px; text-align: center; font-size: 14px; }
.sidebar-user { padding: 14px 20px; display: flex; align-items: center; gap: 10px; cursor: pointer; text-decoration: none; }
.user-avatar { width: 32px; height: 32px; background: var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0; }
.user-avatar.green { background: var(--green); }

/* MAIN */
.main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: var(--header-h); background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; position: sticky; top: 0; z-index: 50; box-shadow: var(--shadow); }
.topbar-title-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.topbar-role-badge {
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-light); padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border); white-space: nowrap;
}
.topbar-title { font-family: var(--font-display); font-size: 17px; font-weight: 500; letter-spacing: 0.2px; text-transform: uppercase; }
.topbar-title span { color: var(--accent); font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--radius); font-size: 13px; font-weight: 500; cursor: pointer; border: none; transition: all 0.15s; font-family: inherit; white-space: nowrap; text-decoration: none; }
.btn i { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: transparent; color: var(--text2); border: 1px solid var(--border2); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-success { background: var(--green); color: #fff; }
.btn-danger { background: transparent; color: var(--red); border: 1px solid #f0c4c0; font-size: 12px; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 6px; width: 30px; height: 30px; justify-content: center; }

/* PAGES */
.page { padding: 24px 28px; display: none; }
.page.active { display: block; }

/* CARDS */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { padding: 14px 20px 12px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 12px; font-weight: 600; color: var(--text2); letter-spacing: 0.4px; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 20px; }

/* FORM */
.form-grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: 1fr 1fr 1fr; }
.g4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; font-weight: 500; color: var(--text2); }
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 5px;
}
.req { color: var(--red); }

input[type=text], input[type=number], input[type=date], input[type=email], input[type=tel], input[type=password], select, textarea {
  padding: 8px 11px; border: 1px solid var(--border2); border-radius: 6px;
  font-size: 13.5px; font-family: inherit; color: var(--text);
  background: var(--surface); transition: border-color 0.15s, box-shadow 0.15s; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
input[readonly] { background: var(--bg); color: var(--text3); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239C958E' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
textarea { resize: vertical; min-height: 58px; }

.divider { height: 1px; background: var(--border); margin: 16px 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* OFFER LAYOUT — minmax(0) sprečava grid overflow (ponuda, JSW) */
.offer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
  gap: 20px;
  align-items: start;
}
.offer-layout > * {
  min-width: 0;
}

/* CAPSULE SEARCH */
.capsule-search-wrap { position: relative; }
.search-box { display: flex; gap: 8px; }
.search-box input { flex: 1; }
#capsule-search-section { position: relative; }
.search-dropdown { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border2); border-radius: var(--radius); box-shadow: var(--shadow-md); z-index: 200; max-height: 260px; overflow-y: auto; display: none; }
.search-dropdown.open { display: block; }
.search-item { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; transition: background 0.1s; }
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--accent-light); }
.sri-icon { width: 30px; height: 30px; background: var(--accent-light); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.sri-name { font-weight: 500; font-size: 13px; }
.sri-sub { font-size: 11.5px; color: var(--text3); margin-top: 1px; }
.sri-badge { font-size: 10px; padding: 2px 6px; border-radius: 3px; font-weight: 600; background: var(--accent-light); color: var(--accent); margin-left: auto; flex-shrink: 0; }

/* CLIENT LOADED */
.client-loaded { background: var(--accent-light); border: 1px solid #c5d4f8; border-radius: var(--radius); padding: 12px 16px; display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.client-logo { width: 38px; height: 38px; background: var(--accent); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 15px; font-weight: 700; flex-shrink: 0; }
.client-details { flex: 1; }
.client-name { font-weight: 600; font-size: 14px; }
.client-addr { font-size: 12px; color: var(--text2); margin-top: 1px; }
.client-clear { color: var(--text3); cursor: pointer; font-size: 16px; }
.client-clear:hover { color: var(--red); }

/* CONTACT PICKER */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.contact-card { border: 2px solid var(--border); border-radius: var(--radius); padding: 9px 12px; cursor: pointer; transition: all 0.15s; display: flex; align-items: center; gap: 10px; }
.contact-card:hover { border-color: var(--accent); }
.contact-card.selected { border-color: var(--accent); background: var(--accent-light); }
.c-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--border); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--text2); flex-shrink: 0; }
.c-name { font-size: 13px; font-weight: 500; }
.c-job { font-size: 11px; color: var(--text3); }
.c-check { color: var(--accent); font-size: 15px; margin-left: auto; display: none; }
.contact-card.selected .c-check { display: block; }

.salutation-preview { background: #fffdf7; border: 1px solid #e8dfc0; border-radius: 6px; padding: 9px 14px; font-size: 13px; font-style: italic; margin-top: 10px; }
.salutation-preview strong { font-style: normal; color: var(--text3); font-size: 10px; display: block; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 3px; }

/* ITEMS TABLE */
.items-wrap { overflow-x: auto; }
.items-table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.items-table th { background: var(--bg); color: var(--text2); font-size: 11px; font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase; padding: 9px 8px; text-align: left; border-bottom: 2px solid var(--border); white-space: nowrap; }
.items-table th.r { text-align: right; }
.items-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.items-table input { padding: 5px 7px; font-size: 13px; }
.items-table select { padding: 5px 22px 5px 7px; font-size: 13px; }
.col-num { width: 35px; }
.col-code { width: 92px; }
.col-desc { width: auto; min-width: 320px; }
.col-qty { width: 74px; }
.col-unit { width: 70px; }
.col-buy { width: 100px; }
.col-sell { width: 112px; }
.col-total { width: 108px; }
.col-del { width: 40px; }
.price-buy { text-align: right; font-family: var(--font-mono); font-size: 12px; color: var(--red); font-weight: 500; }
.price-sell input { text-align: right; font-family: var(--font-mono); }
.price-total { text-align: right; font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; }
.search-row td { background: #fffbea; border-bottom: 2px solid var(--amber); padding-top: 8px; padding-bottom: 8px; vertical-align: middle; }
.search-row .sr-btn-td { 
  text-align: center; 
  vertical-align: middle; 
  padding-left: 4px; 
  padding-right: 4px;
}
.search-row .sr-btn-td .btn {
  margin: 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.search-row td:last-child {
  text-align: center;
  vertical-align: middle;
  font-size: 10px;
  color: var(--text3);
  line-height: 1.2;
  white-space: nowrap;
  padding-left: 4px;
  padding-right: 8px;
}

/* AC */
.ac-wrap { position: relative; }
.ac-dd { 
  position: fixed; 
  min-width: 360px; 
  max-width: 520px; 
  background: var(--surface); 
  border: 1.5px solid var(--accent); 
  border-radius: var(--radius); 
  box-shadow: 0 8px 32px rgba(0,0,0,0.18); 
  z-index: 9999; 
  max-height: 260px; 
  overflow-y: auto; 
  display: none; 
}
.ac-dd.open { display: block; }
.ac-item { padding: 9px 14px; cursor: pointer; border-bottom: 1px solid var(--border); transition: background 0.1s; }
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item.selected { background: var(--accent-light); }
.ac-code { font-family: var(--font-mono); font-size: 13px; color: var(--accent); font-weight: 600; }
.ac-desc-text { font-size: 12px; color: var(--text2); margin-top: 1px; }

/* LANG SELECTOR */
.lang-options { display: flex; gap: 10px; }
.lang-opt { display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 6px; border: 2px solid var(--border2); font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.15s; }
.lang-opt input { display: none; }
.lang-opt.checked { border-color: var(--accent); background: var(--accent-light); color: var(--accent); }

/* TOTALS */
.totals-card { position: sticky; top: calc(var(--header-h) + 16px); }
.t-row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.t-row:last-child { border-bottom: none; }
.t-row.grand { padding-top: 10px; font-size: 15px; font-weight: 700; color: var(--accent); }
.t-row.disc { color: var(--red); }
.t-amt { font-family: var(--font-mono); font-size: 12.5px; }
.t-row.grand .t-amt { font-size: 15px; }
.profit-box { background: var(--green-light); border: 1px solid #b8e0d0; border-radius: 6px; padding: 12px 14px; margin-top: 12px; }
.profit-label { font-size: 10px; color: var(--green); font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; }
.profit-value { font-size: 22px; font-weight: 700; color: var(--green); font-family: var(--font-mono); margin-top: 3px; }
.profit-pct { font-size: 12px; color: var(--green); opacity: 0.75; }

/* GENERATE */
.gen-section { background: var(--text); border-radius: var(--radius); padding: 16px 18px; margin-top: 14px; }
.gen-title { color: rgba(255,255,255,0.4); font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 10px; font-family: var(--font-mono); }
.gen-opts { display: flex; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.gen-cb { display: flex; align-items: center; gap: 6px; color: rgba(255,255,255,0.75); font-size: 13px; cursor: pointer; }
.gen-cb input { accent-color: var(--accent); width: 14px; height: 14px; }
.gen-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-gen { background: var(--accent); color: #fff; border: none; border-radius: var(--radius); padding: 9px 18px; font-size: 13.5px; font-weight: 600; cursor: pointer; font-family: inherit; display: flex; align-items: center; gap: 7px; }
.btn-gen:hover { background: var(--accent-dark); }
.btn-dark { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.75); border: 1px solid rgba(255,255,255,0.12); border-radius: var(--radius); padding: 9px 14px; font-size: 13px; font-weight: 500; cursor: pointer; font-family: inherit; display: flex; align-items: center; gap: 6px; }
.btn-dark:hover { background: rgba(255,255,255,0.14); color: #fff; }

/* BADGE */
.badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.b-sent { background: var(--amber-light); color: var(--amber); }
.b-accepted { background: var(--green-light); color: var(--green); }
.b-draft { background: var(--border); color: var(--text3); }
.b-rejected { background: var(--red-light); color: var(--red); }
.b-waiting { background: #EEF1FF; color: #4255BB; }

/* PG-CHIP — compact 20px height pill (quote count, tag badges) */
.pg-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  min-width: 20px;
  padding: 0 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  font-family: var(--font-mono);
  white-space: nowrap;
}
.pg-chip--count {
  background: var(--accent-light);
  color: var(--accent);
  text-decoration: none;
  border: 1px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}
.pg-chip--count:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ─── ANALYTICS PAGE ─── */
.analytics-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.list-header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.list-header-actions.stacked { flex-direction: column; align-items: flex-end; }
.list-filter-form { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-start; }
.list-filter-form.single-line { flex-wrap: nowrap; }
.list-filter-form.single-line-scroll { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; padding-bottom: 2px; }
.list-filter-form .filter-input {
  width: 200px;
  height: 32px;
  font-size: 12px;
  padding: 0 8px;
}
.list-filter-form .filter-select {
  height: 32px;
  min-width: 118px;
  font-size: 12px;
  padding: 0 34px 0 8px;
}
.list-filter-form .filter-select.is-compact {
  min-width: 92px;
  width: auto;
}
.list-filter-form .btn { height: 32px; }
.user-toggle { display: flex; gap: 6px; background: var(--surface); border: 1px solid var(--border2); border-radius: 6px; padding: 4px; }
.ut-btn { padding: 6px 14px; border-radius: 4px; font-size: 13px; cursor: pointer; font-weight: 500; color: var(--text2); transition: all 0.15s; border: none; background: transparent; font-family: inherit; display: flex; align-items: center; gap: 6px; }
.ut-btn.active { background: var(--accent); color: #fff; }
.ut-avatar { width: 18px; height: 18px; border-radius: 50%; font-size: 9px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stats-grid > .stat-card { min-width: 0; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat-label { font-size: 10px; font-weight: 700; color: var(--text3); letter-spacing: 0.6px; text-transform: uppercase; }
.stat-value { font-size: 28px; font-weight: 700; font-family: var(--font-mono); margin: 5px 0 3px; }
.stat-sub { font-size: 11.5px; color: var(--text3); }
.sa { color: var(--accent); }
.sg { color: var(--green); }
.sr { color: var(--red); }

/* CHARTS GRID */
.charts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.charts-grid > * { min-width: 0; }
.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.chart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.chart-title { font-size: 13px; font-weight: 600; color: var(--text); }
.chart-toggle { display: flex; gap: 4px; }
.ct-btn { padding: 4px 10px; font-size: 11px; border: 1px solid var(--border2); background: var(--surface); cursor: pointer; border-radius: 4px; font-family: inherit; color: var(--text2); transition: all 0.12s; }
.ct-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* SVG CHARTS */
.chart-svg { width: 100%; }

/* BAR CHART */
.bar-chart { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-label { font-size: 12px; color: var(--text2); width: 110px; flex-shrink: 0; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { flex: 1; height: 22px; background: var(--bg); border-radius: 3px; overflow: hidden; position: relative; }
.bar-fill { height: 100%; border-radius: 3px; display: flex; align-items: center; padding-left: 8px; font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.9); transition: width 0.4s ease; font-family: var(--font-mono); }
.bar-val { font-size: 11.5px; font-family: var(--font-mono); color: var(--text2); width: 70px; text-align: right; flex-shrink: 0; }

/* PIE CHART */
.pie-container { display: flex; align-items: center; gap: 20px; }
.pie-legend { display: flex; flex-direction: column; gap: 8px; }
.pie-legend-item { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.pie-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.pie-lname { color: var(--text2); flex: 1; }
.pie-lpct { font-family: var(--font-mono); font-size: 12px; font-weight: 600; }

/* SALES FUNNEL */
.funnel-section { margin-bottom: 20px; }
.funnel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.funnel-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.funnel-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.funnel-card-title { font-size: 12px; font-weight: 700; color: var(--text3); letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.funnel-user-avatar { width: 20px; height: 20px; border-radius: 50%; font-size: 9px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; color: #fff; }

.funnel-stage { margin-bottom: 6px; }
.funnel-stage-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.funnel-stage-name { font-size: 12px; font-weight: 500; color: var(--text2); }
.funnel-stage-meta { font-size: 11px; font-family: var(--font-mono); color: var(--text3); }
.funnel-bar-track { height: 28px; background: var(--bg); border-radius: 4px; overflow: hidden; position: relative; margin-bottom: 3px; }
.funnel-bar-fill { height: 100%; border-radius: 4px; display: flex; align-items: center; padding: 0 10px; font-size: 11.5px; font-weight: 600; color: rgba(255,255,255,0.95); transition: width 0.5s ease; font-family: var(--font-mono); }
.funnel-conversion { font-size: 11px; color: var(--text3); text-align: right; margin-bottom: 8px; }
.conversion-arrow { color: var(--text3); font-size: 10px; }

.funnel-summary { background: var(--bg); border-radius: 6px; padding: 10px 12px; margin-top: 12px; }
.fs-row { display: flex; justify-content: space-between; font-size: 12px; padding: 3px 0; }
.fs-label { color: var(--text2); }
.fs-val { font-family: var(--font-mono); font-weight: 600; }
.fs-val.green { color: var(--green); }
.fs-val.accent { color: var(--accent); }

/* COMPETITION BANNER */
.competition-banner { background: linear-gradient(135deg, #1a1714 0%, #2d2520 100%); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 20px; display: flex; align-items: center; gap: 20px; }
.comp-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,0.4); margin-bottom: 6px; font-family: var(--font-mono); }
.comp-user { flex: 1; }
.comp-name { font-size: 16px; font-weight: 600; color: #fff; }
.comp-stats { display: flex; gap: 20px; margin-top: 8px; }
.comp-stat-val { font-size: 20px; font-weight: 700; font-family: var(--font-mono); }
.comp-stat-label { font-size: 10px; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 0.5px; }
.comp-vs { font-size: 20px; font-weight: 700; color: rgba(255,255,255,0.2); flex-shrink: 0; }
.comp-winner { background: rgba(26,127,90,0.2); border: 1px solid rgba(26,127,90,0.4); border-radius: 4px; padding: 2px 8px; font-size: 10px; font-weight: 700; color: #4ee8a8; letter-spacing: 0.5px; text-transform: uppercase; display: inline-block; margin-top: 4px; }

/* HISTORY TABLE */
.filter-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.f-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.f-tab { padding: 5px 13px; border-radius: 20px; font-size: 12.5px; font-weight: 500; cursor: pointer; border: 1px solid var(--border2); color: var(--text2); transition: all 0.15s; background: var(--surface); }
.f-tab:hover { border-color: var(--accent); color: var(--accent); }
.f-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.date-range { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.date-range span { font-size: 12px; color: var(--text3); }
.date-range input { width: 130px; }

.hist-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.hist-table th { background: var(--bg); color: var(--text2); font-size: 11px; font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase; padding: 9px 14px; text-align: left; border-bottom: 2px solid var(--border); }
.hist-table th.r { text-align: right; }
.hist-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.hist-table tr:hover td { background: var(--surface2); }
.mono { font-family: var(--font-mono); font-size: 12px; }
.q-num { font-weight: 700; color: var(--accent); font-family: var(--font-mono); font-size: 12.5px; }
.prof-pos { color: var(--green); font-weight: 600; font-family: var(--font-mono); }
.action-icons { display: flex; gap: 5px; }
.kanban-card {
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
  will-change: transform, box-shadow;
}
.kanban-card:hover {
  border-color: var(--kanban-color, var(--accent)) !important;
  box-shadow: 0 14px 28px rgba(0,0,0,0.16), 0 4px 10px rgba(0,0,0,0.08);
  transform: translateY(-5px);
}

.equipment-table tbody tr td {
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.equipment-table tbody tr:hover td {
  background: #f9f8f6;
}
.pgv2-page .equipment-main-card:hover {
  transform: none !important;
  box-shadow: var(--shadow) !important;
}

/* ─── Pilot v2 styles (scoped to selected pages) ─────────────── */
.pgv2-page .analytics-header {
  margin-bottom: 14px !important;
}
.pgv2-page {
  --bg: var(--canvas);
  --surface: #FFFFFF;
  --border: #E2E8F4;
  --text: #0D1B2A;
  --text2: #4B5563;
  --text3: #9CA3AF;
  --green: #16A34A;
  --amber: #D97706;
  --red: #DC2626;
  background: var(--bg);
  min-height: calc(100vh - 120px);
  margin: -24px -28px -40px;
  padding: 24px 28px 40px;
}
.pgv2-page .analytics-header > div:first-child > div:first-child {
  font-size: 28px;
  line-height: 1.1;
}
.pgv2-page .analytics-header > div:first-child > div:last-child {
  color: var(--text3);
}
.pgv2-page .list-filter-form .filter-input,
.pgv2-page .list-filter-form .filter-select {
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.pgv2-page .list-filter-form .btn.btn-ghost {
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.pgv2-page .db-filterbar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  padding: 6px 10px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
}
.pgv2-page .db-filter-form {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}
.pgv2-page .db-daterange {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  background: var(--bg);
  white-space: nowrap;
  transition: border-color 0.15s;
  min-width: 200px;
}
.pgv2-page .db-daterange:hover { border-color: var(--accent); }
.pgv2-page .db-date-ico { font-size: 13px; }
.pgv2-page .db-date-label { font-size: 12px; font-weight: 500; color: var(--text2); }
.pgv2-page .db-datepicker {
  display: none;
  align-items: center;
  gap: 4px;
}
.pgv2-page .db-preset-group { display: flex; gap: 2px; }
.pgv2-page .db-filter-sep {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 2px;
}
.pgv2-page .dp-input {
  height: 28px;
  padding: 0 6px;
  font-size: 12px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text2);
  width: 130px;
}
.pgv2-page .db-preset {
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface);
  color: var(--text3);
  transition: all 0.12s;
  font-family: var(--font-sans);
}
.pgv2-page .db-preset:hover { border-color: var(--accent); color: var(--accent); }
.pgv2-page .db-preset.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.pgv2-page .db-select {
  height: 28px;
  padding: 0 34px 0 8px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  appearance: none;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239C958E' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  color: var(--text2);
  cursor: pointer;
  width: auto;
  max-width: 140px;
}
.pgv2-page .db-apply-btn {
  height: 28px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background 0.12s;
}
.pgv2-page .db-apply-btn:hover {
  background: var(--accent-dark);
}

/* ── Dashboard topbar period chips ── */
.db-topbar-chips {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
}
.db-topbar-chip {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  color: var(--text3);
  letter-spacing: 0.3px;
  transition: background 0.1s, color 0.1s;
}
.db-topbar-chip:hover { background: var(--surface); color: var(--text2); }
.db-topbar-chip.is-active { background: var(--accent); color: #fff; }

/* List page header */
.pgv2-page .pgv2-list-title {
  font-size: 20px;
  font-family: var(--font-sans);
  font-weight: 600;
}
.pgv2-page .pgv2-list-subtitle {
  font-size: 12px;
  color: var(--text3);
  margin-top: 2px;
}
.pgv2-page .pgv2-list-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.pgv2-page .pgv2-stat-card--muted {
  background: var(--bg);
}
.pgv2-page .pgv2-progress-track {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  margin: 8px 0;
  overflow: hidden;
}
.pgv2-page .pgv2-progress-fill {
  height: 100%;
  border-radius: 4px;
}
.pgv2-page .pgv2-progress-fill--accent {
  background: var(--accent);
}
.pgv2-page .pgv2-progress-fill--green {
  background: var(--green);
}
.pgv2-page .stat-value--progress {
  font-size: 20px;
  font-weight: 700;
}
.pgv2-page .stat-value--accent {
  color: var(--accent);
}
.pgv2-page .stat-value--green {
  color: var(--green);
}
.pgv2-page .pgv2-chart-legend {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: var(--text3);
}
.pgv2-page .pgv2-chart-legend-item {
  display: flex;
  align-items: center;
  gap: 3px;
}
.pgv2-page .pgv2-chart-legend-swatch {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}
.pgv2-page .pgv2-card-body-compact {
  padding: 12px 16px;
}
.pgv2-page .pgv2-card-body-tight {
  padding: 8px 16px;
}
.pgv2-page .pgv2-chart-wrap {
  position: relative;
  height: 160px;
}
.pgv2-page .pgv2-form-wrap {
  max-width: 780px;
}
.pgv2-page .form-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text3);
  margin-bottom: 10px;
  padding-top: 4px;
  border-top: 0.5px solid var(--border);
}
.pgv2-page .btn-primary {
  background: var(--accent);
}
.pgv2-page .btn-primary:hover {
  background: var(--accent-dark);
}
.pgv2-page .competition-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.pgv2-page .competition-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
}
.pgv2-page .comp-title {
  color: var(--text3);
}
.pgv2-page .comp-name {
  color: var(--text);
}
.pgv2-page .comp-vs {
  color: rgba(13,27,42,0.18);
}
.pgv2-page .comp-stat-label {
  color: var(--text3);
}
.pgv2-page .comp-stat-val {
  color: var(--text);
}
.pgv2-page .comp-winner {
  background: var(--accent-light);
  border-color: color-mix(in srgb, var(--accent) 25%, var(--border));
  color: var(--accent-dark);
}
.pgv2-page .funnel-card,
.pgv2-page .chartjs-card {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.pgv2-page:not(.pgv2-page--no-card-hover) .funnel-card:hover,
.pgv2-page:not(.pgv2-page--no-card-hover) .chartjs-card:hover,
.pgv2-page:not(.pgv2-page--no-card-hover) .card:hover,
.pgv2-page:not(.pgv2-page--no-card-hover) .pv-card:hover,
.pgv2-page:not(.pgv2-page--no-card-hover) .stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
}
.pgv2-page .card,
.pgv2-page .pv-card,
.pgv2-page .stat-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.pgv2-card {
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.pgv2-card:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}
.pgv2-page .supplier-main-card:hover {
  transform: none !important;
  box-shadow: var(--shadow) !important;
}
.pgv2-page .contacts-main-card:hover {
  transform: none !important;
  box-shadow: var(--shadow) !important;
}
.pgv2-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

/* Dashboard — eksplicitne mreže (bez inline style) + minmax(0) da nema horizontalnog overflow-a */
.pgv2-stats--kpi5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

/* ── Unified KPI strip (prototype style) ──────────────────────────────
   Single card with 5 cells separated by internal border-right dividers.
   Replace pgv2-stats--kpi5 on the dashboard for the unified look.
   Responsive: collapses to 2-col on tablet, 1-col on mobile.
────────────────────────────────────────────────────────────────────── */
.pgv2-kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  overflow: hidden;
}
.pgv2-kpi-strip__cell {
  padding: 14px 16px;
  border-right: 1px solid var(--border);
  position: relative;
}
.pgv2-kpi-strip__cell:last-child {
  border-right: none;
}
.pgv2-kpi-strip__label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text3);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.pgv2-kpi-strip__value {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1.1;
  font-family: var(--font-mono);
  margin-bottom: 5px;
}
.pgv2-kpi-strip__sub {
  font-size: 11px;
  color: var(--text3);
  line-height: 1.35;
}
.pgv2-kpi-strip__sub--up   { color: var(--green); font-weight: 500; }
.pgv2-kpi-strip__sub--down { color: var(--red);   font-weight: 500; }
.pgv2-kpi-strip__sub--warn { color: var(--amber);  font-weight: 500; }

@media (max-width: 1100px) {
  .pgv2-kpi-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .pgv2-kpi-strip__cell:nth-child(3) { border-right: none; }
  .pgv2-kpi-strip__cell:nth-child(4),
  .pgv2-kpi-strip__cell:nth-child(5) { border-top: 1px solid var(--border); }
}
@media (max-width: 640px) {
  .pgv2-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pgv2-kpi-strip__cell:nth-child(odd):not(:last-child)  { border-right: 1px solid var(--border); }
  .pgv2-kpi-strip__cell:nth-child(even) { border-right: none; }
  .pgv2-kpi-strip__cell:nth-child(n+3)  { border-top: 1px solid var(--border); }
}

.pgv2-stats--row3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pgv2-dash-chart-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 260px);
  gap: 12px;
  margin-bottom: 12px;
  align-items: stretch;
}

.pgv2-dash-chart-row > * {
  min-width: 0;
}

.pgv2-dash-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.pgv2-dash-two-col > * {
  min-width: 0;
}

/* ── Dashboard main row: action queue (2fr) + sales rhythm (1fr) ── */
.db-dash-main-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 12px;
  align-items: stretch;
}

/* ── Action queue (B1) ── */
.db-aq-section {
  padding: 0;
}
.db-aq-section--overdue .db-aq-section__hdr {
  color: var(--red);
  background: rgba(180,30,30,0.04);
}
.db-aq-section__hdr {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 16px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text2);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
}
.db-aq-section__hdr--muted {
  color: var(--text3);
}
.db-aq-section__count {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  padding: 0 6px;
  border-radius: 8px;
  font-weight: 600;
}
.db-aq-task {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 16px;
  border-bottom: 0.5px solid var(--border);
  transition: background 0.1s;
}
.db-aq-task:hover {
  background: var(--bg);
}
.db-aq-task--overdue {
  background: rgba(180,30,30,0.025);
}
.db-aq-checkbox {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
  border: 1.5px solid var(--border2);
  cursor: pointer;
  background: transparent;
  transition: border-color 0.15s, background 0.15s;
}
.db-aq-checkbox:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}
.db-aq-task__body {
  flex: 1;
  min-width: 0;
}
.db-aq-task__title {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.db-aq-task__title a {
  color: var(--text1);
  text-decoration: none;
}
.db-aq-task__title a:hover {
  color: var(--accent);
}
.db-aq-task__sub {
  font-size: 11px;
  color: var(--text3);
  margin-top: 1px;
}
.db-aq-task__due {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  background: var(--bg);
  color: var(--text3);
  flex-shrink: 0;
  margin-top: 3px;
  white-space: nowrap;
  border: 1px solid var(--border);
}
.db-aq-task__due--overdue {
  background: #FCEBEB;
  color: #A32D2D;
  font-weight: 600;
  border-color: #f5c2c2;
}
.db-aq-task__due--today {
  background: #E6F1FB;
  color: #185FA5;
  font-weight: 500;
  border-color: #b8d4f0;
}

/* ── Sales Rhythm (B2) ── */
.db-pipeline-total {
  font-size: 26px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1;
  margin-bottom: 4px;
}
.db-pipeline-trend {
  font-size: 12px;
  font-family: var(--font-sans);
  font-weight: 500;
  margin-left: 6px;
  vertical-align: middle;
}
.db-pipeline-trend.up   { color: var(--green); }
.db-pipeline-trend.down { color: var(--red); }
.db-mini-funnel {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.db-mini-funnel__row {
  display: grid;
  grid-template-columns: 58px 1fr 22px;
  align-items: center;
  gap: 6px;
  border-radius: 3px;
  padding: 2px 0;
  transition: background 0.1s;
}
.db-mini-funnel__row:hover {
  background: var(--bg);
}
.db-mini-funnel__label {
  font-size: 11px;
  color: var(--text3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.db-mini-funnel__bar-wrap {
  height: 14px;
  background: var(--bg);
  border-radius: 2px;
  overflow: hidden;
}
.db-mini-funnel__bar {
  height: 100%;
  border-radius: 2px;
  min-width: 2px;
  transition: width 0.35s ease;
}
.db-mini-funnel__count {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text2);
  text-align: right;
}

/* Activity grid in full-width card (2 cols on wide screens) */
.db-act-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
}

/* ── Recent quotes table (B3) ── */
.db-rq-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.db-rq-table th {
  padding: 8px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--bg);
}
.db-rq-table td {
  padding: 8px 12px;
  border-bottom: 0.5px solid var(--border);
  vertical-align: middle;
}
.db-rq-table tbody tr:hover td {
  background: var(--bg);
}
.db-rq-table tbody tr:last-child td {
  border-bottom: none;
}
.db-rq-table .text-right { text-align: right; }

@media (max-width: 1100px) {
  .db-dash-main-row {
    grid-template-columns: 1fr;
  }
  .db-act-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  .db-rq-hide-sm { display: none; }
}

/* Pipeline: gornji blok KPI (2×3 na mobilnom), ispod blok kolona — isti grid za poravnanje širina */
.pipeline-page {
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.pipeline-blocks {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pipeline-page__header {
  margin-bottom: 16px;
}
.pipeline-page__title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.25;
}
.pipeline-page__title-row.pgv2-list-title {
  font-family: inherit;
  font-weight: inherit;
  font-size: inherit;
}
.pipeline-page__title-ico {
  font-size: 22px;
  color: var(--accent);
}
.pipeline-page__title-accent {
  color: var(--accent);
  font-weight: 600;
}
.pipeline-page__breadcrumb {
  font-size: 12px;
  color: var(--text3);
  margin-top: 4px;
  padding-left: 30px;
}

.pipeline-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
.pipeline-kpi-card {
  padding: 8px 10px;
  box-sizing: border-box;
  min-width: 0;
}
.pipeline-kpi-card-head {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 2px;
}
.pipeline-kpi-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.2;
  min-width: 0;
}
.pipeline-kpi-count {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.1;
  flex-shrink: 0;
}
.pipeline-kpi-value {
  font-size: 11px;
  line-height: 1.2;
}

.pipeline-kanban-scroll {
  width: 100%;
  min-width: 0;
  overflow-x: visible;
}
.pipeline-kanban-inner {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
}
.pipeline-kanban-col {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.pipeline-kanban-col-head {
  padding: 8px 10px;
  border-radius: 8px 8px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.pipeline-kanban-col-head-title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  flex: 1;
}
.pipeline-kanban-col-head-badge {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 8px;
  flex-shrink: 0;
}
.pipeline-kanban-col-body {
  border-radius: 0 0 8px 8px;
  padding: 8px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}
.pipeline-kanban-card {
  display: block;
  text-decoration: none;
  color: var(--text);
  background: var(--card-bg);
  border: 0.5px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  box-sizing: border-box;
  min-width: 0;
  overflow-wrap: anywhere;
}
.pipeline-page a.pipeline-kanban-card,
.pipeline-page a.pipeline-kanban-card:visited,
.pipeline-page a.pipeline-kanban-card:hover {
  color: var(--text);
  text-decoration: none;
}
.pipeline-kanban-card__name {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 3px;
}
.pipeline-kanban-card__client {
  font-size: 11px;
  color: var(--text3);
  margin-bottom: 5px;
}
.pipeline-kanban-card__value {
  font-size: 12px;
  font-weight: 600;
}
.pipeline-kanban-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 5px;
}
.pipeline-kanban-card__avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 600;
}
.pipeline-kanban-card__date {
  font-size: 10px;
}
.pipeline-kanban-empty {
  padding: 12px 8px;
  text-align: center;
  font-size: 11px;
  color: var(--text3);
  font-style: italic;
}

/* ── Pipeline filter bar ── */
.pipeline-filterbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 7px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
/* ── Pipeline meta bar (stage flow left · values right) ── */
.pipeline-metabar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text3);
  padding: 0 2px;
}
.pipeline-metabar__sep { color: var(--border); }
.pipeline-metabar__stages { color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.pipeline-metabar__arrow { color: var(--border); margin: 0 1px; }
.pipeline-metabar__values { display: flex; align-items: center; gap: 6px; white-space: nowrap; flex-shrink: 0; }

/* Tablet + mobilni: oba bloka 2×3, ista mapa ćelija kao na slici */
@media (max-width: 1100px), ((hover: none) and (pointer: coarse) and (max-width: 1200px)) {
  .pipeline-page__header {
    margin-bottom: 10px;
  }
  .pipeline-page__breadcrumb {
    padding-left: 0;
  }
  .pipeline-kpi-grid,
  .pipeline-kanban-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .pipeline-kpi-card {
    padding: 6px 8px;
  }
  .pipeline-kpi-label {
    font-size: 10px;
    letter-spacing: 0.35px;
  }
  .pipeline-kpi-count {
    font-size: 16px;
  }
  .pipeline-kpi-value {
    font-size: 10px;
  }
  .pipeline-kanban-col-head {
    padding: 6px 8px;
  }
  .pipeline-kanban-col-head-title {
    font-size: 11px;
  }
  .pipeline-kanban-col-head-badge {
    font-size: 10px;
    padding: 1px 5px;
  }
  .pipeline-kanban-col-body {
    flex-direction: column;
    padding: 6px;
    min-height: 72px;
    gap: 5px;
  }
  .pipeline-kanban-card {
    padding: 6px 8px;
  }
  .pipeline-kanban-card:hover {
    transform: none;
  }

  .pipeline-kpi-grid .stage-lead,
  .pipeline-kanban-inner .stage-lead {
    grid-column: 1;
    grid-row: 1;
  }
  .pipeline-kpi-grid .stage-qualified,
  .pipeline-kanban-inner .stage-qualified {
    grid-column: 2;
    grid-row: 1;
  }
  .pipeline-kpi-grid .stage-proposal,
  .pipeline-kanban-inner .stage-proposal {
    grid-column: 1;
    grid-row: 2;
  }
  .pipeline-kpi-grid .stage-negotiation,
  .pipeline-kanban-inner .stage-negotiation {
    grid-column: 2;
    grid-row: 2;
  }
  .pipeline-kpi-grid .stage-won,
  .pipeline-kanban-inner .stage-won {
    grid-column: 1;
    grid-row: 3;
  }
  .pipeline-kpi-grid .stage-lost,
  .pipeline-kanban-inner .stage-lost {
    grid-column: 2;
    grid-row: 3;
  }
}

/* Pipeline — samo gornjih 6 summary kartica na mobilnom (2×3), ne dira kanban */
@media (max-width: 768px) {
  .pipeline-kpi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
    min-width: 0;
  }
  .pipeline-kpi-card {
    padding: 10px 12px;
    min-height: 0;
  }
  .pipeline-kpi-card-head {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 2px;
  }
  .pipeline-kpi-value {
    display: block;
    line-height: 1.2;
  }

  .pipeline-filterbar { flex-wrap: wrap; }
  .pipeline-metabar { font-size: 11px; }
  .pipeline-metabar__stages { display: none; }

  /* Kanban — vertikalni stack na mobilnom (bez horizontal scroll) */
  .pipeline-kanban-scroll {
    overflow-x: visible;
  }
  .pipeline-kanban-inner {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }
  .pipeline-kanban-col {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
  .pipeline-kanban-col-body {
    min-height: 0;
    max-height: 400px;
    overflow-y: auto;
  }
}

/* Klijent — detalj (/clients/<id>): grid + tabovi kao dashboard */
.client-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.client-detail-layout > .client-detail-sidebar,
.client-detail-layout > .client-detail-main {
  min-width: 0;
}
.client-detail-sidebar {
  overflow-wrap: anywhere;
}
.client-detail-sidebar-kpi {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.client-detail-card-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 0.5px solid var(--border);
}
.client-detail-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}
.client-detail-tabs {
  display: flex;
  gap: 0;
  padding: 0 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  flex-wrap: nowrap;
  scrollbar-width: thin;
}
.client-detail-tab {
  flex: 0 0 auto;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--text3);
  transition: color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
  touch-action: manipulation;
}
.client-detail-tab:hover {
  color: var(--text2);
}
.client-detail-tab--active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
@media (max-width: 1024px) {
  .client-detail-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}
@media (max-width: 480px) {
  .client-detail-tab {
    padding: 8px 10px;
    font-size: 11px;
  }
  .client-detail-card-top {
    padding: 10px 12px;
  }
}

/* Kontakt — detalj (/contact/<id>): ista pgv2 pozadina i kartice kao ostatak app-a */
.contact-view {
  max-width: min(720px, 100%);
  min-width: 0;
}
.contact-detail-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

/* Dobavljači (/dobavljaci) — bez horizontalnog „bežanja“ */
.suppliers-page {
  min-width: 0;
  max-width: 100%;
}
.suppliers-page .supplier-main-card {
  min-width: 0;
  max-width: 100%;
}
.suppliers-dobavljacki-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  max-width: 100%;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 16px;
}
.suppliers-dobavljacki-tabs > a {
  flex: 0 0 auto;
  white-space: nowrap;
  touch-action: manipulation;
}
.supplier-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}
.supplier-card-header__lead {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1 1 200px;
}
.supplier-info-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 0;
  border-left: 1px solid var(--border);
  min-width: 0;
  flex: 3 1 260px;
}
.supplier-info-strip__cell {
  padding: 8px 12px;
  border-right: 1px solid var(--border);
  min-width: 0;
  overflow-wrap: anywhere;
}
.supplier-info-strip__cell:last-child {
  border-right: none;
}
@media (max-width: 900px) {
  .supplier-info-strip {
    flex-basis: 100%;
    border-left: none;
    border-top: 1px solid var(--border);
    padding-top: 8px;
  }
}
.supplier-card-header__actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
  margin-left: auto;
}
@media (max-width: 600px) {
  .supplier-card-header__actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
  }
}
.supplier-subtabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  padding: 0 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex-wrap: nowrap;
  max-width: 100%;
  min-width: 0;
}
.supplier-subtabs > a {
  flex: 0 0 auto;
  white-space: nowrap;
  touch-action: manipulation;
}
.supplier-kpi-grid,
.supplier-order-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.supplier-kpi-grid > .stat-card,
.supplier-order-stats > .stat-card {
  min-width: 0;
}
.supplier-upload-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: end;
}
@media (min-width: 900px) {
  .supplier-upload-grid {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
  }
}
.supplier-cenovnik-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
  min-width: 0;
}
.supplier-ulazne-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  min-width: 0;
}
@media (min-width: 900px) {
  .supplier-ulazne-split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.suppliers-page .hist-table {
  min-width: 520px;
}

#supplier-subtab-panel[aria-busy='true'],
#suppliers-spa-region[aria-busy='true'] {
  opacity: 0.68;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

/* Kalendar: leva kolona ne sme biti fiksna 340px na uskom ekranu */
.pgv2-page .calendar-grid {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.pgv2-page .calendar-new-task-form {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr 0.7fr auto;
  gap: 8px;
  align-items: end;
}

/* Istorija ponuda (lista) — padding se na mobilnom uklapa u .pgv2-page */
.lq-page-pad {
  padding: 0 28px 28px;
}
.lq-reserved-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--amber) 35%, var(--border));
  background: var(--amber-light);
}
.lq-reserved-banner__text {
  flex: 1;
  font-size: 13px;
  color: var(--amber);
  line-height: 1.45;
}
.lq-reserved-banner__link {
  font-weight: 600;
  color: var(--amber);
  margin-left: 6px;
  text-decoration: none;
}
.lq-reserved-banner__link:hover {
  text-decoration: underline;
}
.lq-filter-bar {
  padding: 12px 14px;
}
.lq-filter-bar .card-body,
.lq-filter-bar .pv-card__body,
.lq-filter-bar.card,
.lq-filter-bar.pv-card {
  margin-bottom: 0;
}
.lq-filter-form {
  gap: 8px;
}
.lq-date-range {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.lq-search-input {
  width: 180px;
  min-width: 0;
}
.pgv2-page .lq-filter-bar .f-tab {
  background: var(--surface);
}
.pgv2-page .settings-nav .sn-item {
  border-radius: 8px;
}
.pgv2-page .settings-nav {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}
.pgv2-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.03);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.pgv2-page .pgv2-stat-card .stat-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text2);
  margin-bottom: 8px;
}
.pgv2-page .pgv2-stat-card .stat-value {
  font-size: 22px;
  line-height: 1.15;
  margin: 0 0 6px;
}
.pgv2-page .pgv2-stat-card .stat-sub {
  font-size: 11px;
  line-height: 1.35;
}
.pgv2-page .pgv2-stat-card--muted .stat-label {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pgv2-page .pgv2-stat-card--muted .stat-label .ph {
  font-size: 13px;
  opacity: 0.85;
}
.pgv2-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
}
.pgv2-table th {
  background: #f8fafc;
}
.pgv2-table tr:hover td {
  background: #f8fbff;
}
.contacts-main-table tr:hover td {
  background: transparent !important;
}

/* Unified list-row pattern (tasks, service, leads) */
.pg-list-cell { min-width: 0; }
.pg-list-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s ease, transform 0.15s ease;
}
.pg-list-company {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  font-size: 11px;
  color: var(--text3);
  text-decoration: none;
  transition: color 0.15s ease;
}
.pg-list-note {
  margin-top: 3px;
  font-size: 11px;
  color: var(--text2);
}
.pg-row-entry:hover .pg-list-title { color: var(--accent); transform: translateY(-1px); }
.pg-row-entry:hover .pg-list-company { color: var(--text2); }

/* Shared tabs style for task sections */
.pg-task-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); overflow-x: auto; }
.pg-task-tab-btn {
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text3);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  white-space: nowrap;
}
.pg-task-tab-btn:hover { color: var(--text2); }
.pg-task-tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.pg-task-pane { display: none; }
.pg-task-pane.active { display: block; }

/* SETTINGS */
.settings-layout { display: grid; grid-template-columns: 210px 1fr; gap: 20px; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; }
.sn-item { padding: 8px 12px; border-radius: 8px; cursor: pointer; font-size: 13.5px; color: var(--text2); transition: all 0.15s; display: flex; align-items: center; gap: 9px; }
.sn-item:hover { background: var(--surface2); color: var(--text); }
.sn-item.active { background: var(--accent-light); color: var(--accent); font-weight: 500; }
.sn-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.settings-sec { display: none; }
.settings-sec.active { display: block; }
.sg-title { font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.sg { margin-bottom: 24px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border); gap: 16px; }
.toggle-row:last-child { border-bottom: none; }
.tl { font-size: 13.5px; font-weight: 500; }
.td { font-size: 12px; color: var(--text3); margin-top: 2px; }
.toggle { position: relative; width: 38px; height: 21px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-sl { position: absolute; inset: 0; background: var(--border2); border-radius: 21px; cursor: pointer; transition: background 0.2s; }
.toggle-sl::before { content: ''; position: absolute; width: 15px; height: 15px; border-radius: 50%; background: white; left: 3px; top: 3px; transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.toggle input:checked + .toggle-sl { background: var(--accent); }
.toggle input:checked + .toggle-sl::before { transform: translateX(17px); }

.lang-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lang-card { border: 2px solid var(--border); border-radius: var(--radius); padding: 10px 12px; cursor: pointer; transition: all 0.15s; display: flex; align-items: center; gap: 9px; }
.lang-card:hover { border-color: var(--accent); }
.lang-card.selected { border-color: var(--accent); background: var(--accent-light); }
.lang-card.disabled { opacity: 0.4; cursor: default; }

.perm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.perm-table th { background: var(--bg); color: var(--text2); font-size: 11px; font-weight: 600; padding: 8px 12px; text-align: left; border-bottom: 2px solid var(--border); letter-spacing: 0.4px; text-transform: uppercase; }
.perm-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }

/* CENOVNICI */
.supp-row { display: flex; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); gap: 12px; flex-wrap: wrap; }
.supp-row:last-child { border-bottom: none; }
.supp-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.supp-name { font-size: 13.5px; font-weight: 500; }
.supp-file { font-size: 11.5px; color: var(--text3); font-family: var(--font-mono); }

/* ═══════════════════════════════
   RESPONSIVE — TABLET 1024px
═══════════════════════════════ */
@media (max-width: 1200px) {
  /* Sidebar collapse retired — shell.css owns .shell sidebar at all breakpoints */
  .offer-layout { grid-template-columns: 1fr; }
  .totals-card { position: static; }
  #quote-totals-column { position: static; max-height: none; overflow-y: visible; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .charts-grid { grid-template-columns: 1fr; }
  .funnel-grid { grid-template-columns: 1fr; }
  .competition-banner { flex-direction: column; gap: 12px; }
  .comp-vs { transform: rotate(90deg); }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
  .form-grid.g4 { grid-template-columns: 1fr 1fr; }
  .form-grid.g3 { grid-template-columns: 1fr 1fr; }
  .items-table { font-size: 12px; }
  .col-buy, .col-total { width: 88px; }
  .col-sell { width: 96px; }
  .col-code { width: 84px; }
  .col-desc { min-width: 260px; }
  .col-qty { width: 68px; }
  .col-unit { width: 64px; }
}

/* ═══════════════════════════════
   RESPONSIVE — MOBILE 768px
═══════════════════════════════ */
@media (max-width: 768px) {
  :root { --header-h: 50px; }

  /* Main adjusts (shell.css handles sidebar/mobile nav) */
  .main { margin-left: 0; }
  .topbar { padding: 0 16px; }
  .page { padding: 14px 14px 70px; }

  /* Form grids collapse */
  .form-grid.g4, .form-grid.g3, .form-grid.g2 { grid-template-columns: 1fr; }
  .offer-layout { grid-template-columns: 1fr; gap: 12px; }
  .totals-card { position: static; }

  /* Stats */
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-value { font-size: 22px; }

  /* Charts */
  .charts-grid { grid-template-columns: 1fr; }
  .funnel-grid { grid-template-columns: 1fr; }

  /* Competition banner */
  .competition-banner { flex-direction: column; gap: 10px; padding: 14px; }
  .comp-vs { transform: rotate(90deg); align-self: center; }
  .comp-stats { gap: 12px; }
  .comp-stat-val { font-size: 16px; }

  /* Ponuda (jedini .items-wrap): mobilne kartice u quote-form.css — ne forsirati min-width na .items-table (druga tabela .table-follow je inače ~580px i seče red). */
  .items-table { font-size: 12px; }
  .col-num { width: 25px; }
  .col-code { width: 78px; }
  .col-qty { width: 64px; }
  .col-unit { width: 58px; }
  .col-buy { width: 88px; }
  .col-sell { width: 96px; }
  .col-total { width: 92px; }
  .col-del { width: 30px; }

  /* Search row na mobile */
  .sr-code, .sr-desc { min-width: 100%; width: 100%; }
  .sr-hint { white-space: normal; text-align: center; width: 100%; }

  /* Settings */
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .sn-item { font-size: 12px; padding: 6px 10px; }

  /* Analytics header */
  .analytics-header { flex-direction: column; align-items: flex-start; }
  .list-header-actions { width: 100%; align-items: flex-start; justify-content: flex-start; }
  .list-header-actions.stacked { align-items: flex-start; }
  .list-filter-form { width: 100%; justify-content: flex-start; }
  .list-filter-form.single-line { flex-wrap: wrap; }
  .list-filter-form.single-line-scroll { flex-wrap: wrap; overflow-x: visible; }
  .list-filter-form .filter-input,
  .list-filter-form .filter-select { width: 100%; min-width: 0; }
  .pgv2-page {
    margin: -12px -12px -72px;
    padding: 12px 12px 72px;
    min-height: calc(100vh - 90px);
    overflow-x: hidden;
    max-width: 100%;
  }

  /* Dashboard / izveštaji — jedna kolona na telefonu; KPI u 2 kolone (5. kartica preko cele širine) */
  .pgv2-stats--kpi5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pgv2-stats--kpi5 .pgv2-stat-card:nth-child(5) {
    grid-column: 1 / -1;
  }
  .pgv2-stats--row3 {
    grid-template-columns: 1fr;
  }
  .pgv2-dash-chart-row {
    grid-template-columns: 1fr;
  }
  .pgv2-dash-two-col {
    grid-template-columns: 1fr;
  }
  .db-dash-main-row {
    grid-template-columns: 1fr;
  }
  .db-act-grid {
    grid-template-columns: 1fr;
  }

  .pgv2-page .calendar-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .pgv2-page .calendar-new-task-form {
    grid-template-columns: 1fr;
  }

  .lq-page-pad {
    padding: 0 0 20px;
  }

  /* Široke tabele u kartici — scroll unutar kartice, ne ceo dokument */
  .pgv2-page .card .card-body:has(> table.hist-table),
  .pgv2-page .pv-card .pv-card__body:has(> table.hist-table),
  .pgv2-page .pv-card .pv-card__body:has(> table.pv-table) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .lq-date-range { margin-left: 0; width: 100%; }
  .lq-search-input { width: 100%; }
  .lq-filter-bar .f-tab { min-height: 36px; padding: 8px 14px; }

  .user-toggle { flex-wrap: wrap; }
  .date-range { flex-wrap: wrap; }
  .date-range input { width: 100%; }

  /* Filter bar */
  .filter-bar { flex-wrap: wrap; }
  .date-range { margin-left: 0; width: 100%; }

  /* Perm table scroll */
  .perm-table { font-size: 11px; }

  /* Gen section */
  .gen-opts { gap: 10px; }
  .gen-btns { flex-direction: column; }
  .btn-gen, .btn-dark { width: 100%; justify-content: center; }

  /* Funnel */
  .funnel-header { flex-direction: column; gap: 6px; }
  .comp-user { width: 100%; }

  /* Bar chart labels */
  .bar-label { width: 80px; font-size: 11px; }
  .bar-val { width: 55px; font-size: 11px; }

  /* Pie container */
  .pie-container { flex-direction: column; align-items: center; gap: 12px; }

  /* History table scroll */
  .hist-table { font-size: 11px; }
  .hist-table th, .hist-table td { padding: 7px 8px; }
  .action-icons { flex-wrap: wrap; gap: 3px; }

  /* Supp rows */
  .supp-row { flex-wrap: wrap; }

  /* User toggle */
  .ut-btn { padding: 5px 10px; font-size: 12px; }

  /* Card */
  .card-body,
  .pv-card__body { padding: 14px; }
  .card-header,
  .pv-card__head { padding: 12px 14px; }

  /* Lang grid */
  .lang-grid { grid-template-columns: 1fr 1fr; }
}

/* ═══════════════════════════════
   RESPONSIVE — SMALL MOBILE 480px
═══════════════════════════════ */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat-value { font-size: 20px; }
  .stat-label { font-size: 9px; }
  .funnel-bar-fill { font-size: 10px; padding: 0 6px; }
  .comp-stats { gap: 8px; }
  .competition-banner { padding: 12px; }
  .topbar-title { font-size: 15px; }
  .lang-options { flex-wrap: wrap; }
  .lang-grid { grid-template-columns: 1fr 1fr; }
  .user-toggle { width: 100%; justify-content: stretch; }
  .ut-btn { flex: 1; text-align: center; justify-content: center; }
}

/* ─────────────────────────────────────────
   Additional Flask app styles
───────────────────────────────────────── */
.page-content { padding: 24px 28px 40px; }

/* Login — see login.css for light theme */

/* Flash messages */
.flash { padding: 10px 16px; border-radius: 6px; font-size: 13px; margin-bottom: 8px; }
.flash-success { background: var(--green-light); color: var(--green); border: 1px solid #b8e0d0; }
.flash-error   { background: var(--red-light); color: var(--red); border: 1px solid #f0c4c0; }
.flash-warning { background: var(--amber-light); color: var(--amber); border: 1px solid #e8d0a0; }
.flash-info    { background: var(--accent-light); color: var(--accent); border: 1px solid #c5d4f8; }

/* Settings */
.toggle-sl { position: absolute; inset: 0; background: var(--border2); border-radius: 21px; cursor: pointer; transition: background 0.2s; }
.toggle-sl::before { content: ''; position: absolute; width: 15px; height: 15px; border-radius: 50%; background: white; left: 3px; top: 3px; transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
input:checked + .toggle-sl { background: var(--accent); }
input:checked + .toggle-sl::before { transform: translateX(17px); }

/* Nav links */
a.nav-item { text-decoration: none; display: flex; align-items: center; gap: 10px; }
a.nav-item span:not(.icon) { color: inherit; }

.b-draft    { background: var(--border); color: var(--text3); }
.b-sent     { background: var(--amber-light); color: var(--amber); }
.b-waiting  { background: #EEF1FF; color: #4255BB; }
.b-accepted { background: var(--green-light); color: var(--green); }
.b-rejected { background: var(--red-light); color: var(--red); }

code { font-family: var(--font-mono); font-size: 12px; }

/* ─── Missing styles ──────────────────────────────────────── */
.field-error { font-size: 11px; color: var(--red); margin-top: 3px; }
.page-content { padding: 24px 28px; }
.hist-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.hist-table th { background: var(--bg); color: var(--text2); font-size: 11px; font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase; padding: 9px 14px; text-align: left; border-bottom: 2px solid var(--border); }
.hist-table th.r { text-align: right; }
.hist-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.hist-table tr:hover td { background: var(--surface2); }
.q-num { font-weight: 700; color: var(--accent); font-family: var(--font-mono); font-size: 12.5px; }
.prof-pos { color: var(--green); font-weight: 600; font-family: var(--font-mono); }
.action-icons { display: flex; gap: 5px; }
.filter-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.f-tab { padding: 5px 13px; border-radius: 20px; font-size: 12.5px; font-weight: 500; cursor: pointer; border: 1px solid var(--border2); color: var(--text2); background: var(--surface); text-decoration: none; transition: all 0.15s; }
.f-tab:hover { border-color: var(--accent); color: var(--accent); }
.f-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.date-range { display: flex; gap: 8px; align-items: center; }
.date-range span { font-size: 12px; color: var(--text3); }
.mono { font-family: var(--font-mono); font-size: 12px; }
.r { text-align: right; }

/* ─── Responsive (duplicate sidebar block retired — shell.css) ── */
@media (max-width: 1200px) {
  .offer-layout { grid-template-columns: 1fr; }
  .totals-card { position: static !important; }
  .form-grid.g4 { grid-template-columns: 1fr 1fr; }
  .form-grid.g3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root { --header-h: 50px; }
  .main { margin-left: 0; }
  .page-content { padding: 14px 14px 70px; }
  .topbar { padding: 0 16px; }
  .form-grid.g4, .form-grid.g3, .form-grid.g2 { grid-template-columns: 1fr; }
  .offer-layout { grid-template-columns: 1fr; gap: 12px; }
  .gen-btns { flex-direction: column; }
  .btn-gen, .btn-dark { width: 100%; justify-content: center; }
  .filter-bar .date-range { margin-left: 0; width: 100%; flex-wrap: wrap; }
  .hist-table th, .hist-table td { padding: 7px 8px; font-size: 12px; }
}

/* ─── Mini sticky bar (uklonjeno — rekapitulacija ostaje u kartici) ─── */
.mini-profit-bar {
  display: none !important;
}
/* ─── JSW MACHINE BLOCKS ─────────────────────────────────────── */
.jsw-machine-block {
  border: 0.5px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: visible;
}
.jsw-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg);
  border-bottom: 0.5px solid var(--border);
  border-radius: 8px 8px 0 0;
}
.jsw-block-title { font-size: 13px; font-weight: 600; }
.jsw-block-subtitle { font-size: 11px; color: var(--text3); margin-top: 2px; }
.jsw-block-body { padding: 12px 14px; }
.jsw-section-label {
  font-size: 11px; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: 0.4px; margin: 8px 0 5px;
}
.jsw-search-row {
  position: relative;
  margin-bottom: 8px;
}
.jsw-search-row input {
  width: 100%; font-size: 12px; height: 30px; padding: 0 8px;
}
.jsw-options-table {
  width: 100%; font-size: 12px; border-collapse: collapse; margin-bottom: 4px;
}
.jsw-options-table th {
  text-align: left; padding: 4px 6px; color: var(--text3);
  font-weight: 600; border-bottom: 0.5px solid var(--border); font-size: 11px;
}
.jsw-options-table td {
  padding: 4px 6px; border-bottom: 0.5px solid var(--border); vertical-align: middle;
}
.jsw-options-table tr:last-child td { border-bottom: none; }
.jsw-code { font-family: var(--font-mono); font-size: 11px; color: var(--text3); }
.jsw-del-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text3); font-size: 16px; padding: 0 4px; line-height: 1;
}
.jsw-del-btn:hover { color: var(--red); }
.jsw-remove-btn {
  background: none; border: 0.5px solid var(--border);
  border-radius: 4px; cursor: pointer; color: var(--text3);
  font-size: 12px; padding: 2px 6px;
}
.jsw-remove-btn:hover { color: var(--red); border-color: var(--red); }
.jsw-spare-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 0; border-bottom: 0.5px solid var(--border);
}
.jsw-spare-row:last-child { border-bottom: none; }
.jsw-spare-row input[type=checkbox] { width: 14px; height: 14px; flex-shrink: 0; }
.jsw-subtotal {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px; background: var(--bg); border-radius: 6px;
  margin-top: 10px; font-size: 13px; font-weight: 600;
}
.badge-list-price {
  font-size: 11px; font-weight: 600; padding: 2px 8px;
  background: var(--blue-light, #e6f1fb); color: var(--blue, #185fa5);
  border-radius: 4px;
}
/* Popravka za JSW dropdownove - sprečava rastezanje */
[id^="jsw-opt-dd-"] {
  min-width: 400px !important;
  max-width: 600px !important;
  width: auto !important;
  white-space: normal !important;
  word-wrap: break-word !important;
}

[id^="jsw-opt-dd-"] .search-item {
  white-space: normal !important;
  word-wrap: break-word !important;
}

[id^="jsw-opt-dd-"] .sri-name {
  white-space: normal !important;
  word-wrap: break-word !important;
  font-size: 12px !important;
  line-height: 1.3 !important;
}

[id^="jsw-opt-dd-"] .sri-sub {
  white-space: normal !important;
  word-wrap: break-word !important;
  font-size: 11px !important;
}
/* ═══════════════════════════════════════════════════════════════
   PWA & MOBILE POLISH
═══════════════════════════════════════════════════════════════ */

/* Touch targets — min 44px na svim interaktivnim elementima */
@media (max-width: 768px) {
  .btn { min-height: 44px; padding: 10px 16px; }
  .btn-sm { min-height: 36px; padding: 8px 12px; }
  .btn-icon { min-width: 44px; min-height: 44px; }
  .nav-item { min-height: 44px; }
  .f-tab { min-height: 36px; padding: 8px 14px; }

  /* Search trigger — samo ikona na mobile */
  #search-trigger { max-width: 44px; border-radius: 50%; }
  #search-trigger .search-label { display: none; }
  #search-trigger span:last-child { display: none; } /* Sakrij Ctrl+K hint */

  /* Search modal — puni width na mobile */
  #search-modal { padding-top: 0; align-items: flex-end; padding: 0; }
  #search-modal > div { width: 100%; max-width: 100%; border-radius: 16px 16px 0 0; }
  #search-results { max-height: 60vh; }

  /* Topbar — kompaktno */
  .topbar-title { font-size: 16px; }
  .topbar-actions .btn-ghost { display: none; } /* Sakrij Odjava na mobile — koristiti profil */

  /* Bottom nav aktivni tab — bolji kontrast */
  .nav-item.active { background: var(--accent-light); }

  /* Collapsible sidebar sekcije na mobile — prikaži sve jer je bottom nav */
  #sec-sistem { display: block !important; }

  /* Card padding manji na mobile */
  .page-content { padding: 12px 12px 72px; }

  /* Stat kartice — 2 kolone uvek */
  .stat-card { padding: 12px 14px; }
  .stat-value { font-size: 20px; }
}

/* PWA — Standalone mode (instaliran na home screen) */
@media (display-mode: standalone) {
  .topbar {
    padding-top: env(safe-area-inset-top);
  }
  .main {
    padding-bottom: env(safe-area-inset-bottom);
  }
  .sidebar {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* Tablet — sidebar ostaje ali smanjen */
@media (min-width: 769px) and (max-width: 1024px) {
  :root { --sidebar-w: 180px; }
  .nav-item { padding: 9px 14px; font-size: 13px; }
  .page-content { padding: 18px 20px; }
  .topbar { padding: 0 20px; }
}

/* Smooth scroll na mobile */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

/* Overscroll behavior — sprečava pull-to-refresh u PWA modu */
body { overscroll-behavior-y: contain; }

/* Focus outline za keyboard navigaciju */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

/* Sprečava dvostruki tap zoom na iOS */
button, a, input, select, textarea {
  touch-action: manipulation;
}

/* Kompaktan tag-picker (checkbox dropdown) */
.pg-tagpicker {
  position: relative;
  width: 100%;
}
.pg-tagpicker-btn {
  width: 100%;
  text-align: left;
  padding: 6px 10px;
  font-size: 11px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  color: var(--text2);
  font-family: inherit;
}
.pg-tagpicker.open .pg-tagpicker-btn {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-light);
}
.pg-tagpicker-panel {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  z-index: 60;
  margin-top: 4px;
  max-height: 240px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.pg-tagpicker.open .pg-tagpicker-panel {
  display: block;
}
.pg-tagpicker-filter {
  width: 100%;
  padding: 7px 10px;
  font-size: 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  font-family: inherit;
  box-sizing: border-box;
}
.pg-tagpicker-scroll {
  max-height: 200px;
  overflow-y: auto;
  padding: 4px 0 6px;
}
.pg-tagpicker-cat-h {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text3);
  padding: 6px 10px 2px;
}
.pg-tagpicker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text);
}
.pg-tagpicker-row:hover {
  background: var(--bg);
}
.pg-tagpicker-row input {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  cursor: pointer;
}

/* Kontakt modal — puna širina polja (LinkedIn, grid) */
.contact-modal-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  margin-bottom: 4px;
}
.contact-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.contact-modal-grid input,
.contact-modal-grid select,
.contact-modal-full input,
.contact-modal-full textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font-size: 13px;
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
}
.contact-modal-textarea {
  min-height: 64px;
  padding: 8px;
  resize: none;
}
.contact-modal-full {
  width: 100%;
}

/* ════════════════════════════════════════════════════════
   CLIENTS LIST — TAG FILTER CHIPS
════════════════════════════════════════════════════════ */
.cl-tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.cl-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.3px;
  transition: box-shadow 0.14s, opacity 0.14s, transform 0.1s;
  cursor: pointer;
  user-select: none;
  /* colored chips use CSS custom properties set via style attr */
  background: var(--tc, var(--surface));
  color: var(--tcc, var(--text2));
  border: 1.5px solid transparent;
}
.cl-tag-chip:not(.cl-tag-chip--all) {
  opacity: 0.72;
}
.cl-tag-chip:not(.cl-tag-chip--all):hover {
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.cl-tag-chip:not(.cl-tag-chip--all).is-active {
  opacity: 1;
  box-shadow: 0 0 0 2.5px var(--tcc, var(--accent));
}

/* "All" chip */
.cl-tag-chip--all {
  background: var(--surface);
  color: var(--text2);
  border-color: var(--border);
}
.cl-tag-chip--all:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}
.cl-tag-chip--all.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Action icons: fade in on row hover */
.hist-table .action-icons {
  opacity: 0;
  transition: opacity 0.15s;
}
.hist-table tr:hover .action-icons {
  opacity: 1;
}

/* ════════════════════════════════════════════════════════
   TOAST NOTIFICATION SYSTEM
   Auto-dismiss toasts — replaces static flash-messages div.
   JS in base.html reads #flash-data and injects here.
════════════════════════════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
  /* Shift up on mobile so toasts clear the bottom nav bar */
}
@media (max-width: 767px) {
  #toast-container {
    bottom: calc(56px + var(--space-4));
    right: var(--space-4);
    left: var(--space-4);
  }
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  font-size: var(--text-base);
  color: var(--text);
  max-width: 380px;
  width: 100%;
  pointer-events: auto;
  animation: toast-in 0.22s cubic-bezier(0.34, 1.4, 0.64, 1) both;
  position: relative;
  /* left accent stripe */
  border-left-width: 3px;
}
@media (max-width: 767px) {
  .toast { max-width: 100%; }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(28px) scale(0.97); }
  to   { opacity: 1; transform: translateX(0)   scale(1); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateX(0)   scale(1);    max-height: 80px; margin-bottom: 0; }
  to   { opacity: 0; transform: translateX(28px) scale(0.96); max-height: 0;   margin-bottom: -8px; }
}
.toast.is-dismissing {
  animation: toast-out 0.2s ease-in forwards;
  pointer-events: none;
}

/* accent stripe by category */
.toast--success { border-left-color: var(--green);  }
.toast--error,
.toast--danger  { border-left-color: var(--red);    }
.toast--warning { border-left-color: var(--amber);  }
.toast--info,
.toast--message { border-left-color: var(--accent); }

.toast__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  margin-top: 1px;
}
.toast--success  .toast__icon { background: var(--green-light);  color: var(--green);  }
.toast--error    .toast__icon,
.toast--danger   .toast__icon { background: var(--red-light);    color: var(--red);    }
.toast--warning  .toast__icon { background: var(--amber-light);  color: var(--amber);  }
.toast--info     .toast__icon,
.toast--message  .toast__icon { background: var(--accent-light); color: var(--accent); }

.toast__body {
  flex: 1;
  line-height: 1.45;
}

.toast__close {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text3);
  font-size: 16px;
  line-height: 1;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color 0.12s, background 0.12s;
  margin-top: -1px;
}
.toast__close:hover {
  color: var(--text);
  background: var(--surface2);
}

/* progress bar that drains over 4s */
.toast__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
}
.toast__progress-bar {
  height: 100%;
  width: 100%;
  transform-origin: left;
  animation: toast-progress 4s linear forwards;
}
.toast--success  .toast__progress-bar { background: var(--green);  }
.toast--error    .toast__progress-bar,
.toast--danger   .toast__progress-bar { background: var(--red);    }
.toast--warning  .toast__progress-bar { background: var(--amber);  }
.toast--info     .toast__progress-bar,
.toast--message  .toast__progress-bar { background: var(--accent); }
@keyframes toast-progress {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}
