/* ============================================================
   MicroStock — novi dizajn sistem
   ============================================================ */

:root {
  --bg:        #f4f6fb;
  --surface:   #ffffff;
  --border:    #e5e7eb;
  --text:      #0f172a;
  --text-soft: #64748b;
  --text-mute: #94a3b8;

  --primary:      #6366f1;
  --primary-dark: #4f46e5;
  --primary-soft: #eef2ff;

  --success: #10b981;
  --warn:    #f59e0b;
  --danger:  #ef4444;
  --info:    #3b82f6;

  --radius:    12px;
  --radius-sm: 8px;
  --shadow:    0 1px 3px rgba(15,23,42,.06), 0 4px 12px rgba(15,23,42,.04);
  --shadow-lg: 0 10px 30px rgba(15,23,42,.08);

  --sidebar-w: 240px;
  --topbar-h:  60px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 { margin: 0 0 .75rem; line-height: 1.25; font-weight: 700; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; margin-top: 1.75rem; }
h3 { font-size: 1.05rem; margin-top: 1.25rem; }

.muted  { color: var(--text-soft); }
.small  { font-size: .85rem; }
.num    { text-align: right; font-variant-numeric: tabular-nums; }
.text-success { color: var(--success); }
.text-warn    { color: var(--warn);    }
.text-danger  { color: var(--danger);  }

/* ============================================================
   LAYOUT — sidebar + main
   ============================================================ */

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

.sidebar {
  width: var(--sidebar-w);
  background: #0f172a;
  color: #cbd5e1;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  padding: 1rem .75rem;
  z-index: 100;
  transition: transform .25s ease;
}

.sidebar__logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .75rem 1rem;
  font-weight: 800;
  font-size: 1.15rem;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: .75rem;
}
.sidebar__logo span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: 8px;
  font-size: 1rem;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
}

.sidebar__group {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #64748b;
  padding: .75rem .75rem .35rem;
  font-weight: 700;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem .75rem;
  border-radius: var(--radius-sm);
  color: #cbd5e1;
  font-size: .9rem;
  font-weight: 500;
  transition: background .15s, color .15s;
}
.sidebar__link:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
  text-decoration: none;
}
.sidebar__link.active {
  background: var(--primary);
  color: #fff;
}
.sidebar__icon {
  display: inline-flex;
  width: 20px; height: 20px;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.sidebar__badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
}

.sidebar__footer {
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: .75rem;
  margin-top: .75rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ============================================================
   MAIN AREA
   ============================================================ */

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar__title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}
.topbar__right {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.topbar__user {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .65rem;
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: .85rem;
  color: var(--text);
  font-weight: 500;
}
.topbar__user:hover { background: #e2e8f0; text-decoration: none; }

.burger {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  padding: .25rem .5rem;
  color: var(--text);
}

.content {
  flex: 1;
  padding: 1.5rem 1.75rem 3rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.page-header h1,
.page-header h2 { margin: 0; }
.page-header__actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ============================================================
   CARD
   ============================================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
.card h3:first-child,
.card h2:first-child { margin-top: 0; }
.card--info    { background: var(--primary-soft); border-color: #c7d2fe; }
.card--danger  { background: #fef2f2; border-color: #fecaca; }
.card--success { background: #f0fdf4; border-color: #bbf7d0; }
.card--warn    { background: #fffbeb; border-color: #fde68a; }

/* ============================================================
   KPI
   ============================================================ */

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .75rem;
  margin-bottom: 1.5rem;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: .25rem;
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--primary);
}
.kpi__label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-soft);
  font-weight: 600;
}
.kpi__value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.kpi__meta {
  font-size: .75rem;
  color: var(--text-mute);
}
.kpi--good  ::before { background: var(--success); }
.kpi--bad   ::before { background: var(--danger);  }
.kpi--warn  ::before { background: var(--warn);    }
.kpi--alert { background: #fef2f2; }
.kpi--alert ::before { background: var(--danger); }

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .55rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, transform .05s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:hover   { text-decoration: none; }

.btn--primary {
  background: var(--primary);
  color: #fff;
}
.btn--primary:hover { background: var(--primary-dark); }

.btn--secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn--secondary:hover { background: #f8fafc; border-color: #cbd5e1; }

.btn--danger {
  background: var(--danger);
  color: #fff;
}
.btn--danger:hover { background: #dc2626; }

.btn--ghost {
  background: transparent;
  color: var(--text-soft);
}
.btn--ghost:hover { background: var(--bg); color: var(--text); }

.btn--sm { padding: .35rem .7rem; font-size: .8rem; }

.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Legacy alias */
.btn-primary   { background: var(--primary); color: #fff; padding:.55rem 1rem; border-radius: var(--radius-sm); font-weight:600; display:inline-flex; align-items:center; gap:.45rem; text-decoration:none; border:1px solid transparent; cursor:pointer; font-size:.9rem; }
.btn-primary:hover { background: var(--primary-dark); text-decoration:none; }
.btn-secondary { background: var(--surface); color: var(--text); border:1px solid var(--border); padding:.55rem 1rem; border-radius:var(--radius-sm); font-weight:600; display:inline-flex; align-items:center; gap:.45rem; text-decoration:none; cursor:pointer; font-size:.9rem; }
.btn-secondary:hover { background:#f8fafc; text-decoration:none; }

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .5rem .85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
}
.btn-link:hover { background: #f8fafc; text-decoration: none; }

.link-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: .35rem .5rem;
  font-size: 1rem;
  border-radius: var(--radius-sm);
  transition: background .15s;
}
.link-btn:hover { background: var(--bg); }

/* ============================================================
   TABLES
   ============================================================ */

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
table,
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: .9rem;
}
th, td {
  padding: .7rem .9rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
th {
  background: #f8fafc;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-soft);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbfc; }

tr.low,
tr.danger { background: #fef2f2; }
tr.archived { opacity: .55; }
tr.archived:hover { background: transparent; }

.table-scroll {
  overflow-x: auto;
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.table-scroll table { margin: 0; }
.table-compact th,
.table-compact td {
  padding: .35rem .55rem;
  font-size: .8rem;
  white-space: nowrap;
}

/* ============================================================
   FORMS
   ============================================================ */

.form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
.form-row {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin-bottom: .85rem;
}
.form-row label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-soft);
}
.form-row input,
.form-row select,
.form-row textarea { width: 100%; }

input, select, textarea {
  padding: .55rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

button:not(.link-btn):not(.burger) {
  cursor: pointer;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 600;
  padding: .55rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--primary);
  color: #fff;
  transition: background .15s;
}
button:not(.link-btn):not(.burger):hover { background: var(--primary-dark); }

.grid-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .65rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}

.inline-form {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: .75rem;
}
.inline-form input,
.inline-form select { flex: 1; min-width: 100px; }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
  font-weight: 500;
}

.file-input {
  width: 100%;
  padding: .75rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  background: #fafbff;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.file-input:hover { border-color: var(--primary); background: var(--primary-soft); }

/* ============================================================
   FILTER BAR
   ============================================================ */

.filter-form {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .65rem .85rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.filter-form input[type="text"],
.filter-form input:not([type]) { flex: 1; min-width: 160px; }
.filter-form label {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .85rem;
  color: var(--text-soft);
}

/* ============================================================
   BADGES
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .18rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  line-height: 1.4;
}
.badge--new       { background: #dbeafe; color: #1e40af; }
.badge--paid      { background: #dcfce7; color: #166534; }
.badge--shipped   { background: #fef3c7; color: #92400e; }
.badge--done      { background: #dcfce7; color: #166534; }
.badge--cancelled { background: #fee2e2; color: #991b1b; }
.badge--active    { background: #dbeafe; color: #1e40af; }

.badge-admin   { background: #fee2e2; color: #991b1b; }
.badge-manager { background: #dbeafe; color: #1e40af; }
.badge-viewer  { background: #e2e8f0; color: #334155; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-source  { background: #ede9fe; color: #5b21b6; }

.badge-alert {
  background: var(--danger);
  color: #fff;
  padding: .12rem .5rem;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
  margin-left: .35rem;
}

/* ============================================================
   FLASH
   ============================================================ */

.flash { margin-bottom: 1rem; }
.flash-ok,
.flash-success {
  background: #dcfce7; color: #166534;
  padding: .7rem 1rem; border-radius: var(--radius-sm);
  margin-bottom: .4rem; border: 1px solid #bbf7d0;
}
.flash-err,
.flash-error,
.flash-danger {
  background: #fee2e2; color: #991b1b;
  padding: .7rem 1rem; border-radius: var(--radius-sm);
  margin-bottom: .4rem; border: 1px solid #fecaca;
}

/* ============================================================
   ALERTS
   ============================================================ */

.alert {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid var(--warn);
  border-radius: var(--radius-sm);
  padding: .85rem 1rem;
  margin: 1rem 0;
}
.alert.danger,
.alert-err {
  background: #fef2f2;
  border-color: #fecaca;
  border-left-color: var(--danger);
  color: #7f1d1d;
}
.alert-ok {
  background: #f0fdf4;
  border-color: #bbf7d0;
  border-left-color: var(--success);
  color: #14532d;
}

/* ============================================================
   PROGRESS
   ============================================================ */

.progress {
  background: #eef2f7;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  margin-top: .35rem;
}
.progress .bar {
  height: 100%;
  background: var(--success);
  transition: width .35s;
  border-radius: 999px;
}
.progress .bar.warn   { background: var(--warn); }
.progress .bar.danger { background: var(--danger); }

/* ============================================================
   ADMIN TOOLS
   ============================================================ */

.admin-tools {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.admin-tools h2 { margin-top: 0; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .75rem;
  margin-top: 1rem;
}
.tile {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: transform .1s, box-shadow .15s, border-color .15s;
  box-shadow: var(--shadow);
}
.tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
  text-decoration: none;
}
.tile__icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}
.tile__title {
  font-weight: 700;
  font-size: .95rem;
  margin-bottom: .15rem;
}
.tile__desc {
  font-size: .78rem;
  color: var(--text-soft);
  line-height: 1.35;
}

/* ============================================================
   PROFILE
   ============================================================ */

.profile-head {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 800;
  flex-shrink: 0;
}
.profile-head__info { flex: 1; min-width: 200px; }
.profile-head__name {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0 0 .25rem;
}
.profile-head__email {
  color: var(--text-soft);
  font-size: .9rem;
  margin-bottom: .5rem;
}

/* ============================================================
   CHART BOX
   ============================================================ */

.chart-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
  height: 320px;
  position: relative;
}
.chart-box--sm { height: 240px; }

/* ============================================================
   QUICK ACTIONS (dashboard)
   ============================================================ */

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .75rem;
  margin-bottom: 1.5rem;
}
.qa-card {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform .1s, box-shadow .15s;
}
.qa-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}
.qa-card__icon {
  width: 40px; height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  background: var(--primary-soft);
  border-radius: 10px;
  flex-shrink: 0;
}
.qa-card__title { font-weight: 700; font-size: .92rem; }
.qa-card__meta  { font-size: .78rem; color: var(--text-soft); }

/* ============================================================
   ALERT CARDS (dashboard)
   ============================================================ */

.alerts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: .75rem;
  margin-bottom: 1.5rem;
}
.alert-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--warn);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  box-shadow: var(--shadow);
}
.alert-card.danger { border-left-color: var(--danger); }
.alert-card.warn   { border-left-color: var(--warn); }
.alert-card h3 { margin: 0 0 .5rem; font-size: .95rem; }
.alert-card ul { margin: 0; padding-left: 1.1rem; }
.alert-card li { margin-bottom: .2rem; font-size: .85rem; }
.alert-card p  { margin: 0 0 .35rem; color: var(--text-soft); font-size: .85rem; }

/* ============================================================
   SPLIT
   ============================================================ */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

/* ============================================================
   EMPTY / CHIP / MISC
   ============================================================ */

.empty {
  background: var(--surface);
  border: 1px dashed var(--border);
  padding: 2rem 1rem;
  border-radius: var(--radius);
  color: var(--text-soft);
  text-align: center;
}

.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  background: var(--bg);
  border-radius: 999px;
  padding: .2rem .7rem;
  font-size: .82rem;
}

.errors {
  max-height: 200px;
  overflow-y: auto;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: .78rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: .5rem 1rem;
}

/* ============================================================
   LOGIN (posebna stranica bez layout-a)
   ============================================================ */

.login-body {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  padding: 1rem;
}

.login-box {
  background: var(--surface);
  padding: 2.5rem 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 380px;
}
.login-box h1 { margin: 0 0 .25rem; text-align: center; font-size: 1.5rem; }
.login-box .subtitle { text-align: center; color: var(--text-soft); margin-bottom: 1.5rem; font-size: .9rem; }

.login-box form { display: flex; flex-direction: column; gap: .85rem; }
.login-box label {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  font-size: .85rem;
  color: var(--text-soft);
  font-weight: 600;
}
.login-box input {
  padding: .7rem .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
}
.login-box button {
  padding: .8rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: .5rem;
}
.login-box button:hover { background: var(--primary-dark); }

.login-box .hint {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: .8rem;
  color: var(--text-soft);
  text-align: center;
  line-height: 1.6;
}
.login-box .hint code {
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  color: var(--text);
}

/* ============================================================
   IMPORT MAP GRID
   ============================================================ */

.map-heading {
  font-size: .8rem;
  color: var(--text-soft);
  margin: 1rem 0 .5rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 700;
}
.map-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .5rem;
}
.map-row { display: flex; flex-direction: column; gap: .25rem; }
.map-label { font-size: .85rem; font-weight: 600; color: var(--text); }
.map-select { width: 100%; }

.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .5rem;
  margin-top: .5rem;
}
.preset-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .5rem .75rem;
  font-size: .85rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (min-width: 700px) {
  .map-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    transform: translateX(-100%);
    width: 260px;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }

  .main { margin-left: 0; }

  .burger { display: block; }

  .content { padding: 1rem 1rem 2rem; }

  .topbar { padding: 0 .85rem; }
  .topbar__user span { display: none; }

  .page-header h1 { font-size: 1.35rem; }

  .kpi-strip { grid-template-columns: repeat(2, 1fr); }

  .quick-actions { grid-template-columns: 1fr; }

  .card { padding: 1rem 1.1rem; }
  .form { padding: 1rem 1.1rem; }

  .filter-form {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-form input,
  .filter-form select,
  .filter-form button,
  .filter-form .btn-link { width: 100%; }

  table { font-size: .82rem; }
  th, td { padding: .5rem .6rem; }

  .profile-head { flex-direction: column; text-align: center; }
  .profile-head__info { text-align: center; }

  .chart-box { height: 260px; }
}

@media (max-width: 480px) {
  .kpi-strip { grid-template-columns: 1fr 1fr; gap: .5rem; }
  .kpi { padding: .75rem .85rem; }
  .kpi__value { font-size: 1.25rem; }

  h1 { font-size: 1.25rem; }
  h2 { font-size: 1.1rem; }

  .tiles { grid-template-columns: 1fr; }
}

/* Overlay za mobilni sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.5);
  z-index: 99;
}
.sidebar-overlay.show { display: block; }

/* Badge za source (import log) */
.badge--source { background: #ede9fe; color: #5b21b6; }

/* Responsive tabela sa checkbox filterima u filter-form */
@media (max-width: 768px) {
  .filter-form label { width: 100%; }
  .filter-form label input[type="checkbox"] { margin-right: .35rem; }
}

/* Login responsivno */
@media (max-width: 480px) {
  .login-box { padding: 1.75rem 1.25rem; }
  .login-box h1 { font-size: 1.3rem; }
}

/* Print optimizacija za fakturu */
@media print {
  .sidebar, .topbar, .page-header__actions, .flash { display: none !important; }
  .main { margin: 0 !important; }
  .content { padding: 0 !important; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ====== Kalkulator cena ====== */

.result-box {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  margin-top: .5rem;
}
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .3rem 0;
  font-size: .9rem;
}
.result-row.result-headline {
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: .5rem;
  font-size: 1rem;
}
.result-row.result-headline strong {
  font-size: 1.35rem;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}
.result-row.small {
  font-size: .8rem;
  color: var(--text-soft);
}
.result-row.small span:last-child {
  font-variant-numeric: tabular-nums;
}
.result-box hr {
  border: none;
  border-top: 1px dashed var(--border);
  margin: .5rem 0;
}

/* Chip dugmad (preseti kanala) */
.chip-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .35rem .85rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.chip-btn:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-dark);
}

/* ====== Bulk kalkulacija ====== */
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
}

/* Badge u istoriji za režim A/B */
.badge--active  { background: #dbeafe; color: #1e40af; }
.badge--shipped { background: #fef3c7; color: #92400e; }

/* ==================== TOPBAR SWITCHERS ==================== */

.topbar__right {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.topbar__switcher {
    display: inline-block;
}

.topbar__select {
    appearance: none;
    -webkit-appearance: none;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: .35rem .6rem;
    font-size: .85rem;
    font-family: inherit;
    color: #374151;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.topbar__select:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.topbar__select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .15);
}

/* Na mobilnom — manje */
@media (max-width: 640px) {
    .topbar__select {
        padding: .25rem .4rem;
        font-size: .75rem;
    }
}

/* ============================================================
   BRAND (logo + naziv firme iznad MicroStock)
   ============================================================ */

.sidebar__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  padding: .25rem .75rem .85rem;
  margin-bottom: .5rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar__brand-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
}
.sidebar__brand-wordmark {
  width: 100%;
  max-width: 180px;
  height: auto;
  object-fit: contain;
}

/* ============================================================
   SITE FOOTER (3 kolone, bez horizontalnog scroll-a)
   ============================================================ */

.site-footer {
  margin-top: 3rem;
  /* VAŽNO: bez negativnih margina — one izazivaju horizontalni scroll */
  padding: 5px;
  background: #0f172a;
  color: #cbd5e1;
  width: 100%;
  box-sizing: border-box;
}

.site-footer__box {
  padding: .75rem 1.25rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;   /* levo | sredina | desno */
  align-items: center;
  gap: 1rem;
  color: #fff;
}

/* ---- LEVO: logo + Studio ---- */
.site-footer__brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  line-height: 1;
  justify-self: start;
  min-width: 0;
}
.site-footer__wordmark {
  height: 26px;
  width: auto;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}
.site-footer__studio {
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .05em;
  color: rgba(255,255,255,.9);
  line-height: 1;
  white-space: nowrap;
}

/* ---- SREDINA: copyright ---- */
.site-footer__copy {
  justify-self: center;
  font-size: .78rem;
  color: rgba(255,255,255,.8);
  white-space: nowrap;
  text-align: center;
}

/* ---- DESNO: email ---- */
.site-footer__info {
  justify-self: end;
  min-width: 0;
}
.site-footer__info a {
  color: #fff;
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.site-footer__info a:hover {
  text-decoration: underline;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .site-footer__box {
    grid-template-columns: 1fr;
    gap: .5rem;
    text-align: center;
    padding: .85rem 1rem;
  }
  .site-footer__brand,
  .site-footer__info {
    justify-self: center;
  }
  .site-footer__copy {
    white-space: normal;
    order: 3;   /* copyright ide ispod na mobilnom */
  }
  .site-footer__info a {
    white-space: normal;
    word-break: break-all;
  }
}

/* ============================================================
   LOGIN BRAND + FOOTER
   ============================================================ */

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  margin-bottom: 1rem;
}
.login-brand__icon {
  width: 56px;
  height: 56px;
  object-fit: contain;
}
.login-brand__wordmark {
  width: 100%;
  max-width: 220px;
  height: auto;
  object-fit: contain;
}

.login-footer {
  position: fixed;
  bottom: 1rem;
  left: 0; right: 0;
  text-align: center;
  font-size: .78rem;
  color: rgba(255,255,255,.55);
  line-height: 1.6;
}
.login-footer a {
  color: rgba(255,255,255,.75);
  text-decoration: none;
}
.login-footer a:hover {
  color: #fff;
  text-decoration: underline;
}

/* Responsive — footer na mobilnom */
@media (max-width: 600px) {
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
  .site-footer__info {
    align-items: flex-start;
    text-align: left;
  }
}

/* ============================================================
   CAPITAL
   ============================================================ */

.capital-current {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: .85rem 1.1rem;
  background: var(--primary-soft);
  border: 1px solid #c7d2fe;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
}
.capital-current__label {
  font-size: .85rem;
  color: var(--text-soft);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.capital-current__value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary-dark);
  font-variant-numeric: tabular-nums;
}
.capital-form { margin-bottom: .5rem; }

/* Kapital KPI — zlatna akcentna linija */
.kpi--capital::before { background: #d4af37; }   /* zlatna, u skladu sa logom */
.kpi--capital .kpi__value { color: #b8860b; }

/* ============================================================
   GLOBALNA PRETRAGA (Ctrl+K)
   ============================================================ */

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
}
.search-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,.6);
  backdrop-filter: blur(2px);
}
.search-modal__box {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 70vh;
}
#search-input {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem;
  font-size: 1.05rem;
  outline: none;
  border-radius: 0;
  background: transparent;
}
.search-results {
  overflow-y: auto;
  padding: .5rem 0;
}
.search-group {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-mute);
  font-weight: 700;
  padding: .65rem 1.25rem .25rem;
}
.search-item {
  display: block;
  padding: .5rem 1.25rem;
  color: var(--text);
  text-decoration: none;
  font-size: .9rem;
  border-left: 3px solid transparent;
  transition: background .1s, border-color .1s;
}
.search-item:hover {
  background: var(--primary-soft);
  border-left-color: var(--primary);
  text-decoration: none;
}
.search-empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--text-soft);
  font-size: .9rem;
}

/* ============================================================
   STATUS BADGES za račune nabavke
   ============================================================ */

/* Neplaćen — plava */
.badge--status-pending {
  background: #dbeafe;
  color: #1e40af;
}

/* Plaćen — zelena */
.badge--status-paid {
  background: #dcfce7;
  color: #166534;
}

/* Delimično plaćen — žuta */
.badge--status-partial {
  background: #fef3c7;
  color: #92400e;
}

/* U kašnjenju — crvena */
.badge--status-overdue {
  background: #fee2e2;
  color: #991b1b;
  animation: pulse-overdue 2s ease-in-out infinite;
}

@keyframes pulse-overdue {
  0%, 100% { opacity: 1; }
  50%      { opacity: .75; }
}

/* Otkazan — siva */
.badge--status-cancelled {
  background: #e5e7eb;
  color: #4b5563;
  text-decoration: line-through;
}

/* ============================================================
   KPI kartice za statuse (leve linije u boji)
   ============================================================ */

.kpi--info::before  { background: #3b82f6; }   /* plavo */
.kpi--paid::before  { background: #10b981; }   /* zeleno */
.kpi--warn::before  { background: #f59e0b; }   /* žuto */
.kpi--overdue::before { background: #ef4444; } /* crveno */

.kpi--overdue {
  background: #fef2f2;
}
.kpi--overdue .kpi__value {
  color: #dc2626;
}

/* Statusi narudžbina */
.badge--status-new       { background: #dbeafe; color: #1e40af; }
.badge--status-paid      { background: #dcfce7; color: #166534; }
.badge--status-shipped   { background: #fef3c7; color: #92400e; }
.badge--status-done      { background: #dcfce7; color: #166534; }
.badge--status-cancelled { background: #e5e7eb; color: #4b5563; text-decoration: line-through; }

/* ============================================================
   PREVIEW (screenshots)
   ============================================================ */

.preview {
  padding: 6rem 0;
  background: var(--bg);
}

.preview__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.preview-card {
  text-align: center;
  display: flex;
  flex-direction: column;
}

.preview-card__browser {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px 12px 0 0;
  padding: .6rem .8rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  box-shadow: var(--shadow-sm);
}

.browser-dots {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}
.browser-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.browser-dots span:nth-child(1) { background: #ff5f57; }
.browser-dots span:nth-child(2) { background: #febc2e; }
.browser-dots span:nth-child(3) { background: #28c840; }

.browser-url {
  flex: 1;
  margin-left: .5rem;
  background: #f1f5f9;
  padding: .25rem .65rem;
  border-radius: 6px;
  font-size: .72rem;
  color: var(--text-soft);
  font-family: ui-monospace, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-card__content {
  background: #fff;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 12px 12px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  padding: 0;
  width: 100%;
  height: 180px;                    /* ← FIKSNA VISINA */
  position: relative;
}

.preview-card__content img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
}

.preview-card__caption {
  margin-top: .85rem;
  font-size: .85rem;
  color: var(--text-soft);
  font-weight: 500;
}

/* Responsive */
@media (max-width: 900px) {
  .preview__grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
  .preview-card__content {
    height: 160px;
  }
}

@media (max-width: 600px) {
  .preview {
    padding: 4rem 0;
  }
  .preview__grid {
    grid-template-columns: 1fr;
  }
  .preview-card__content {
    height: 200px;
  }
}

/* ============================================================
   VIDEO DEMO
   ============================================================ */

.video-demo {
  padding: 5rem 0;
  background: var(--bg-soft);
  text-align: center;                /* centriraj sadržaj */
}

.video-wrapper {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: #000;
  aspect-ratio: 16 / 9;
  margin: 2rem auto;                 /* centriraj + vertikalna margina */
  max-width: 1100px;                 /* ← povećano sa 900px */
  width: 100%;
}

.video-wrapper iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: none;
}

.video-note {
  text-align: center;
  margin-top: 1.5rem;
  font-size: .95rem;
  color: var(--text-soft);
}

.video-note a {
  color: var(--indigo);
  font-weight: 600;
  text-decoration: none;
}

.video-note a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .video-wrapper {
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  .video-demo { padding: 3rem 0; }
}

/* ==================== DEMO DUGME (KONTRASTNO & PREMIUM) ==================== */
.btn--demo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: #ffffff !important;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 22px;
  border-radius: 8px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
  border: 1px solid rgba(251, 191, 36, 0.4);
  transition: all 0.25s ease-in-out;
}

.btn--demo:hover {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 6px 20px rgba(217, 119, 6, 0.5);
  transform: translateY(-2px);
  color: #ffffff !important;
}

.btn--demo:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.3);
}