/* =====================================================================
   Mix Company Admin
   ===================================================================== */
:root {
  --brand-red: #d71920;
  --brand-red-600: #b3141a;
  --brand-blue: #26419a;
  --brand-blue-600: #1d3480;
  --brand-blue-50: #eef2fb;
  --brand-sky: #2f8fd0;

  --navy-950: #09111e;
  --navy-900: #0e1829;
  --navy-800: #16243a;
  --navy-700: #22324b;

  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e3e8ef;
  --border-strong: #cfd7e2;

  --text: #131d30;
  --text-2: #475569;
  --muted: #7a8699;

  --success: #15803d;  --success-bg: #e8f6ee;
  --warn: #b45309;     --warn-bg: #fdf3e2;
  --danger: #c0262d;   --danger-bg: #fdecec;
  --info: #26419a;     --info-bg: #ebf0fb;
  --violet: #6d3fc0;   --violet-bg: #f1ebfc;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(14, 24, 41, .06);
  --shadow: 0 1px 2px rgba(14, 24, 41, .05), 0 4px 16px rgba(14, 24, 41, .06);
  --shadow-lg: 0 12px 40px rgba(14, 24, 41, .18);
  --sidebar-w: 256px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 var(--font); font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-blue); text-decoration: none; }
a:hover { color: var(--brand-blue-600); }
img { max-width: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
[hidden] { display: none !important; }

.ic { width: 18px; height: 18px; flex: none; vertical-align: middle; }

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

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-950) 100%);
  color: #b8c3d4; border-right: 1px solid rgba(255,255,255,.04);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 18px 20px 16px; color: #fff; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand:hover { color: #fff; }
.brand-mark { width: 44px; height: 44px; filter: drop-shadow(0 3px 8px rgba(0,0,0,.35)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.brand-text small { font-size: 12px; color: #8494ab; margin-top: 2px; }

.nav { flex: 1; overflow-y: auto; padding: 8px 12px 20px; }
.nav-group { margin: 16px 10px 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: #66768e; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 11px;
  padding: 8px 12px; margin: 1px 0; border-radius: 8px;
  color: #b8c3d4; font-weight: 500; transition: background .15s, color .15s;
}
.nav-link .ic { color: #7f8ea6; transition: color .15s; }
.nav-link:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-link:hover .ic { color: #cfd8e5; }
.nav-link.active { background: rgba(255,255,255,.08); color: #fff; }
.nav-link.active .ic { color: #fff; }
.nav-link.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand-red); }
.nav-link .nav-ext { width: 14px; height: 14px; margin-left: auto; opacity: .5; }

.sidebar-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.06); }
.user-card { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; background: rgba(255,255,255,.04); }
.user-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.user-meta strong { color: #fff; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta small { color: #7f8ea6; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card form { margin: 0; }
.user-card .icon-btn { color: #9aa8bd; }
.user-card .icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: 60px;
  display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: rgba(255,255,255,.88); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-title { display: flex; align-items: center; gap: 6px; font-weight: 600; min-width: 0; }
.topbar-title > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-app { color: var(--muted); font-weight: 500; white-space: nowrap; }
.crumb-sep { width: 14px; height: 14px; color: var(--border-strong); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar-date { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.topbar-date .ic { width: 16px; height: 16px; }
.menu-btn { display: none; }

.content { flex: 1; width: 100%; max-width: 1560px; margin: 0 auto; padding: 28px; }
.footer { padding: 18px 28px 24px; color: var(--muted); font-size: 12.5px; text-align: center; }
.sidebar-backdrop { display: none; }

/* --------------------------------------------------------------- page head */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { display: flex; align-items: center; gap: 12px; font-size: 24px; font-weight: 700; flex-wrap: wrap; }
.h1-clip { max-width: 900px; overflow-wrap: anywhere; }
.page-ic { width: 38px; height: 38px; border-radius: 10px; display: inline-grid; place-items: center; background: var(--surface); border: 1px solid var(--border); color: var(--brand-blue); box-shadow: var(--shadow-sm); }
.page-ic .ic { width: 20px; height: 20px; }
.page-sub { margin: 6px 0 0; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.page-sub .ic { width: 15px; height: 15px; }
.page-sub strong { color: var(--text-2); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 8px; color: var(--muted); font-weight: 500; font-size: 13px; }
.back-link .ic { width: 16px; height: 16px; }
.back-link:hover { color: var(--brand-blue); }

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 15px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font: 500 14px/1 var(--font); white-space: nowrap; cursor: pointer; user-select: none;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn .ic { width: 17px; height: 17px; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(38, 65, 154, .25); }
.btn-primary { background: var(--brand-blue); color: #fff; box-shadow: 0 1px 2px rgba(29, 52, 128, .3), inset 0 1px 0 rgba(255,255,255,.1); }
.btn-primary:hover { background: var(--brand-blue-600); color: #fff; }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--surface-2); border-color: #b8c3d1; color: var(--text); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-link { background: none; border: 0; color: var(--brand-blue); padding: 0 8px; }
.btn-link:hover { text-decoration: underline; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a11e24; color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: #f1c6c8; }
.btn-danger-ghost:hover { background: var(--danger-bg); }
.btn-light { background: #fff; color: var(--text); }
.btn-light:hover { background: #f1f5f9; color: var(--text); }
.btn-light-ghost { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.3); }
.btn-light-ghost:hover { background: rgba(255,255,255,.18); color: #fff; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; }
.btn-lg { height: 46px; font-size: 15px; font-weight: 600; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; padding: 0; }

.icon-btn {
  width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 8px;
  border: 0; background: transparent; color: var(--muted); cursor: pointer; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--brand-blue-50); color: var(--brand-blue); }
.icon-btn.danger:hover { background: var(--danger-bg); color: var(--danger); }
.icon-btn .ic { width: 17px; height: 17px; }

/* --------------------------------------------------------------- cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head h3 { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 600; }
.card-head h3 .ic { color: var(--muted); }
.card-head .ic { width: 16px; height: 16px; }
.card-body { padding: 20px; }

/* --------------------------------------------------------------- toolbar / filters */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.search { position: relative; display: flex; align-items: center; flex: 1 1 240px; max-width: 360px; }
.search-wide { max-width: 420px; }
.search .ic { position: absolute; left: 11px; width: 17px; height: 17px; color: var(--muted); pointer-events: none; }

input[type=text], input[type=search], input[type=email], input[type=number], input[type=password],
input[type=date], input[type=datetime-local], select, textarea {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--text); font: 14px var(--font); transition: border-color .15s, box-shadow .15s;
}
.search input[type=search] { width: 100%; padding-left: 36px; }
textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237a8699' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-blue); box-shadow: 0 0 0 3px rgba(38, 65, 154, .15); }
input::placeholder, textarea::placeholder { color: #a0aabb; }

.filter-select { width: auto; min-width: 150px; max-width: 230px; }
.filter-select.is-active, .filter-date.is-active input { border-color: var(--brand-blue); background-color: var(--brand-blue-50); color: var(--brand-blue-600); font-weight: 500; }
.filter-date { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.filter-date input { width: 150px; }

.more-filters { position: relative; }
.more-filters > summary { list-style: none; }
.more-filters > summary::-webkit-details-marker { display: none; }
.more-filters[open] > summary { background: var(--surface-2); border-color: var(--border-strong); }
.more-filters-body {
  position: absolute; z-index: 20; top: calc(100% + 6px); right: 0; width: 520px; max-width: 86vw;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.more-filters-body .filter-select, .more-filters-body .ss { max-width: none; width: 100%; }
.pill { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--brand-blue); color: #fff; font-size: 11.5px; font-weight: 600; }
.pill-muted { background: #eef1f5; color: var(--text-2); }

/* quick chips */
.qchips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.qchip {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow-sm);
  color: var(--text-2); font-weight: 500; transition: all .15s;
}
.qchip .ic { width: 16px; height: 16px; color: var(--muted); }
.qchip b { font-weight: 600; font-size: 12.5px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.qchip:hover { border-color: var(--border-strong); color: var(--text); }
.qchip-warn b { background: var(--warn-bg); color: var(--warn); border-color: #f3dbb3; }
.qchip.active { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.qchip.active .ic { color: #fff; }
.qchip.active b { background: rgba(255,255,255,.15); border-color: transparent; color: #fff; }

/* bulk bar */
.bulkbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 16px; background: var(--brand-blue-50); border-bottom: 1px solid #cfdaf3; }
.bulkbar select, .bulkbar input { height: 32px; width: auto; min-width: 220px; font-size: 13px; }
.bulk-count { font-weight: 500; color: var(--brand-blue-600); margin-right: 4px; }

/* --------------------------------------------------------------- table */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th, .table td { padding: 11px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid #edf1f5; }
.table th {
  position: sticky; top: 0; z-index: 1; background: var(--surface-2);
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); white-space: nowrap;
}
.th-sort { display: inline-flex; align-items: center; gap: 4px; color: inherit; }
.th-sort:hover { color: var(--text); }
.sort-ic { width: 14px; height: 14px; }
.sort-ic.muted { opacity: .35; }
th.sorted { color: var(--brand-blue); }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: #f7f9fc; }
.table tbody tr[data-href] { cursor: pointer; }
.table tbody tr.is-selected { background: var(--brand-blue-50); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 0; }
.table-compact td { padding: 10px 16px; }

.col-id { width: 70px; color: var(--muted); font-variant-numeric: tabular-nums; }
.col-actions { width: 1%; white-space: nowrap; text-align: right; }
.col-check { width: 40px; padding-right: 0 !important; }
.col-thumb { width: 64px; }
.col-name { min-width: 230px; max-width: 520px; overflow-wrap: anywhere; }
.col-flag { width: 1%; }
.table-articles th, .table-articles td { padding-left: 10px; padding-right: 10px; }
.table-articles td.num .badge { margin-top: 4px; }
.row-actions { display: inline-flex; gap: 2px; align-items: center; }
.row-actions form { margin: 0; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.center { text-align: center !important; }
.nowrap { white-space: nowrap; }
.clip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clip-sm { max-width: 170px; }
.note-cell { max-width: 420px; overflow-wrap: anywhere; }
.fw { font-weight: 600; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.small { font-size: 12.5px; }
.text-muted { color: var(--muted); }
.text-danger { color: var(--danger) !important; font-weight: 600; }
.link-plain { color: var(--text); }
.link-plain:hover { color: var(--brand-blue); }
.link-muted { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); margin-top: 10px; }
.link-muted .ic { width: 14px; height: 14px; }
.count-link { display: inline-block; min-width: 34px; padding: 2px 8px; border-radius: 6px; background: var(--brand-blue-50); font-weight: 600; text-align: center; }
.map-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; white-space: nowrap; }
.map-link .ic { width: 15px; height: 15px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; color: var(--muted); font-size: 12px; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; }
.user-cell { display: flex; align-items: center; gap: 10px; }

.thumb { position: relative; display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 8px; background: #fff; border: 1px solid var(--border); overflow: visible; }
.thumb img { width: 100%; height: 100%; object-fit: contain; border-radius: 7px; background: #fff; transition: transform .18s ease, box-shadow .18s ease; transform-origin: left center; }
.table-articles .thumb:hover img { position: relative; z-index: 5; transform: scale(4.2); box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.thumb-empty, .thumb-broken { background: var(--surface-2); border-style: dashed; color: #b0bac8; }
.thumb-empty .ic { width: 20px; height: 20px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1; vertical-align: middle;
}
.badge .ic { width: 13px; height: 13px; }
.badge-lg { height: 26px; padding: 0 10px; font-size: 13px; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-violet { background: var(--violet-bg); color: var(--violet); }
.badge-muted { background: #eef1f5; color: #5d6b80; }
.badge-red { background: #fde8e7; color: var(--brand-red-600); }
.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; background: #eef1f5; color: var(--text-2); font-size: 12.5px; font-weight: 500; white-space: nowrap; }

.avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; display: inline-grid; place-items: center; background: linear-gradient(135deg, #dfe6f7, #c6d2ef); color: var(--brand-blue-600); font-size: 12.5px; font-weight: 700; }
.avatar-dark { background: linear-gradient(135deg, var(--brand-red), #8f1216); color: #fff; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 48px 16px; color: var(--muted); text-align: center; }
.empty .ic { width: 32px; height: 32px; margin-bottom: 6px; color: #b8c2d0; }
.empty strong { color: var(--text-2); font-size: 15px; }

.list-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.list-info strong { color: var(--text-2); }
.list-foot-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.pp { display: inline-flex; align-items: center; gap: 8px; }
.pp select { height: 32px; width: 78px; font-size: 13px; }
.pager { display: inline-flex; align-items: center; gap: 4px; }
.pager a, .pager span { min-width: 32px; height: 32px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 8px; font-weight: 500; color: var(--text-2); }
.pager a:hover { background: var(--surface-2); color: var(--text); }
.pager .current { background: var(--navy-900); color: #fff; }
.pager .disabled { opacity: .35; }
.pager .gap { min-width: 16px; }
.pager .ic { width: 16px; height: 16px; }

/* --------------------------------------------------------------- switch */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: none; }
.switch input[type=checkbox] { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch .slider { position: absolute; inset: 0; border-radius: 22px; background: #cdd5e0; transition: background .18s; }
.switch .slider::before { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s; }
.switch input:checked + .slider { background: var(--brand-blue); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 3px rgba(38, 65, 154, .25); }
.switch input:disabled + .slider { opacity: .55; }
.switch.sm { width: 34px; height: 19px; }
.switch.sm .slider::before { width: 13px; height: 13px; }
.switch.sm input:checked + .slider::before { transform: translateX(15px); }
.switch.busy .slider { opacity: .6; }

.cb { width: 16px; height: 16px; accent-color: var(--brand-blue); cursor: pointer; vertical-align: middle; }
.check-inline { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--text-2); cursor: pointer; font-size: 13.5px; }

/* --------------------------------------------------------------- forms */
.form-card .card-body { padding: 8px 24px 24px; }
.form-section { padding-top: 18px; }
.form-section + .form-section { margin-top: 10px; border-top: 1px solid var(--border); }
.form-section-title { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-weight: 500; color: var(--text-2); font-size: 13.5px; }
.w-full { grid-column: span 6; }
.w-half { grid-column: span 3; }
.w-third { grid-column: span 2; }
.req { color: var(--brand-red); }
.help { color: var(--muted); font-size: 12.5px; margin: 0; }
.field-error { display: flex; align-items: center; gap: 5px; color: var(--danger); font-size: 12.5px; font-weight: 500; margin-top: 6px; }
.field-error .ic { width: 14px; height: 14px; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); background: #fffafa; }
.readonly-value { min-height: 38px; display: flex; align-items: center; padding: 0 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px dashed var(--border-strong); color: var(--text-2); font-family: var(--mono); font-size: 13px; }
.input-group { display: flex; gap: 6px; }
.input-group input { flex: 1; }

.field-switch { justify-content: center; }
.switch-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; transition: border-color .15s, background .15s; }
.switch-row:hover { border-color: var(--border-strong); background: var(--surface-2); }
.switch-row:has(input:checked) { border-color: #c3cfee; background: var(--brand-blue-50); }
.switch-text { display: flex; flex-direction: column; line-height: 1.3; }
.switch-label { font-weight: 600; color: var(--text); }
.switch-help { font-size: 12.5px; color: var(--muted); }

.form-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 24px; background: var(--surface-2); border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }
.form-actions-left { display: flex; flex-wrap: wrap; gap: 8px; }
.form-actions.sticky { position: sticky; bottom: 0; z-index: 10; margin-top: 20px; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 -4px 20px rgba(14,24,41,.06); background: rgba(255,255,255,.95); backdrop-filter: blur(8px); }

.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.split-side { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 80px; }
.split-side .card + .card { margin-top: 0; }

.dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
.dl dt { color: var(--muted); font-size: 13px; }
.dl dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.dl-sep { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }

/* dropzone */
.dropzone { display: flex; flex-direction: column; gap: 12px; }
.dz-preview { position: relative; aspect-ratio: 1 / 1; border-radius: 10px; border: 1px solid var(--border); background: #fff; display: grid; place-items: center; overflow: hidden; }
.dz-preview img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.dz-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); }
.dz-empty .ic { width: 40px; height: 40px; color: #b8c2d0; }
.dz-preview.is-empty { background: var(--surface-2); }
.dz-zoom-hint { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 7px; background: rgba(9,17,30,.72); color: #fff; font-size: 12px; font-weight: 500; opacity: 0; transition: opacity .15s; pointer-events: none; }
.dz-zoom-hint .ic { width: 14px; height: 14px; }
.dz-preview:hover .dz-zoom-hint { opacity: 1; }
.dz-preview.is-empty .dz-zoom-hint { display: none; }
.dz-target { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 14px; border: 1.5px dashed var(--border-strong); border-radius: 10px; text-align: center; color: var(--text-2); cursor: pointer; transition: border-color .15s, background .15s; }
.dz-target input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-target .ic { width: 24px; height: 24px; color: var(--brand-blue); margin-bottom: 4px; }
.dz-target small { color: var(--muted); font-size: 12px; }
.dz-target strong { color: var(--brand-blue); }
.dropzone.drag .dz-target, .dz-target:hover { border-color: var(--brand-blue); background: var(--brand-blue-50); }
.dropzone.has-error .dz-target { border-color: var(--danger); }
.dz-file { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; background: var(--success-bg); color: var(--success); font-size: 13px; font-weight: 500; }
.dz-file .ic { width: 16px; height: 16px; }
.dz-file button { margin-left: auto; }

/* searchable select */
.ss { position: relative; width: 100%; }
.toolbar .ss { width: auto; min-width: 200px; max-width: 260px; }
.ss-btn { width: 100%; height: 38px; padding: 0 34px 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; text-align: left; font: 14px var(--font); color: var(--text); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237a8699' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
.ss-btn:focus { outline: none; border-color: var(--brand-blue); box-shadow: 0 0 0 3px rgba(38, 65, 154, .15); }
.ss-btn.placeholder { color: var(--muted); }
.ss.is-active .ss-btn { border-color: var(--brand-blue); background-color: var(--brand-blue-50); color: var(--brand-blue-600); font-weight: 500; }
.bulkbar .ss { width: 280px; }
.bulkbar .ss-btn { height: 32px; font-size: 13px; }
.has-error .ss-btn { border-color: var(--danger); }
.ss-pop { position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; min-width: 100%; width: max-content; max-width: min(460px, 90vw); background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); overflow: hidden; }
.ss-pop input { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; height: 42px; }
.ss-pop input:focus { box-shadow: none; }
.ss-list { max-height: 300px; overflow-y: auto; padding: 4px; }
.ss-group { padding: 8px 10px 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ss-opt { padding: 7px 10px; border-radius: 6px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-opt.in-group { padding-left: 18px; }
.ss-opt:hover, .ss-opt.hl { background: var(--brand-blue-50); color: var(--brand-blue-600); }
.ss-opt.sel { font-weight: 600; color: var(--brand-blue); }
.ss-none { padding: 14px; color: var(--muted); text-align: center; }

/* plan obilazaka na formi komercijaliste */
.assign-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.assign-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.plan-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.plan-day { border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); overflow: hidden; }
.plan-day-head { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; background: #fff; border-bottom: 1px solid var(--border); }
.plan-day ul { list-style: none; margin: 0; padding: 6px 0; }
.plan-day li { display: flex; flex-direction: column; padding: 5px 12px; line-height: 1.3; }
.plan-day li span { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-day li small { color: var(--muted); font-size: 12px; }
.plan-day li.more { font-size: 13px; font-weight: 500; }

/* --------------------------------------------------------------- alerts / toasts / modal */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: 10px; font-size: 13.5px; margin-bottom: 16px; }
.alert .ic { margin-top: 1px; }
.alert-error { background: var(--danger-bg); color: #9b1c22; }
.alert-success { background: var(--success-bg); color: var(--success); }
.note-inline { display: flex; align-items: center; gap: 8px; margin: -6px 0 20px; color: var(--muted); font-size: 13px; }
.note-inline .ic { width: 16px; height: 16px; }

.toasts { position: fixed; z-index: 100; right: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 13px 14px; border-radius: 11px; background: var(--navy-900); color: #fff; box-shadow: var(--shadow-lg); font-weight: 500; animation: toast-in .25s ease; }
.toast > .ic { margin-top: 1px; }
.toast-success > .ic { color: #4ade80; }
.toast-error > .ic { color: #fb7185; }
.toast span { flex: 1; }
.toast-x { border: 0; background: none; color: #8a9ab2; cursor: pointer; padding: 0; }
.toast-x .ic { width: 16px; height: 16px; }
.toast.out { opacity: 0; transform: translateY(8px); transition: all .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

.modal { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 16px; background: rgba(9, 17, 30, .55); backdrop-filter: blur(3px); animation: fade .15s; }
.modal-box { width: 420px; max-width: 100%; background: #fff; border-radius: 16px; padding: 26px; box-shadow: var(--shadow-lg); text-align: center; }
.modal-icon { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--danger-bg); color: var(--danger); }
.modal-icon .ic { width: 24px; height: 24px; }
.modal-box h3 { font-size: 18px; margin-bottom: 8px; }
.modal-box p { margin: 0 0 22px; color: var(--text-2); }
.modal-actions { display: flex; gap: 10px; justify-content: center; }
.modal-actions .btn { min-width: 120px; }
@keyframes fade { from { opacity: 0; } }

/* --------------------------------------------------------------- dashboard */
.hero {
  position: relative; overflow: hidden; border-radius: 16px; margin-bottom: 20px; min-height: 220px;
  background:
    radial-gradient(600px 300px at 85% 30%, rgba(47, 143, 208, .35), transparent 60%),
    radial-gradient(500px 260px at 100% 100%, rgba(215, 25, 32, .35), transparent 60%),
    linear-gradient(115deg, var(--navy-950) 0%, var(--navy-900) 45%, #16294a 100%);
  box-shadow: var(--shadow);
}
.hero-mark { position: absolute; right: 4%; top: 50%; width: 300px; transform: translateY(-50%) rotate(-8deg); opacity: .9; filter: drop-shadow(0 20px 40px rgba(0,0,0,.45)); pointer-events: none; }
.hero-inner { position: relative; padding: 34px 36px; max-width: 640px; color: #fff; }
.hero-kicker { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #fca5a5; margin-bottom: 10px; }
.hero h1 { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.hero p { margin: 10px 0 22px; color: #c6d0de; font-size: 15px; }
.hero p strong { color: #fff; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: 14px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); transition: transform .15s, box-shadow .15s, border-color .15s; min-width: 0; }
a.kpi:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(14,24,41,.09); border-color: var(--border-strong); color: var(--text); }
.kpi-ic { grid-row: 1 / 4; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; }
.kpi-ic .ic { width: 22px; height: 22px; }
.ic-blue { background: var(--info-bg); color: var(--brand-blue); }
.ic-amber { background: var(--warn-bg); color: var(--warn); }
.ic-green { background: var(--success-bg); color: var(--success); }
.ic-red { background: #fde8e7; color: var(--brand-red); }
.kpi-label { color: var(--muted); font-size: 13px; font-weight: 500; }
.kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-value small { font-size: 14px; font-weight: 600; color: var(--muted); }
.kpi-sub { color: var(--muted); font-size: 12.5px; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
.dash-grid .card + .card { margin-top: 0; }
.side-stack { display: flex; flex-direction: column; gap: 16px; }
.side-stack .card + .card { margin-top: 0; }

.chart-body { position: relative; }
.chart-empty { position: absolute; inset: 20px 20px 56px; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-weight: 500; pointer-events: none; }
.bars { display: flex; align-items: stretch; gap: 2px; height: 230px; }
.bar-col { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); min-width: 0; }
.bar-track { flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; border-bottom: 1px solid var(--border); }
.bar-num { font-size: 11px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.bar { display: block; width: min(70%, 34px); background: #8fa3d9; border-radius: 4px 4px 0 0; transition: background .15s; }
.bar-col:hover .bar { background: var(--brand-blue); }
.bar-col.today .bar { background: var(--brand-blue); }
.bar-x { display: flex; flex-direction: column; align-items: center; font-size: 12px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.bar-x small { font-size: 10.5px; color: #a0aabb; }
.bar-col.today .bar-x { color: var(--text); font-weight: 600; }
.bar-col[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% - 4px); left: 50%; transform: translateX(-50%);
  padding: 6px 10px; border-radius: 7px; background: var(--navy-900); color: #fff; font-size: 12px; font-weight: 500; white-space: nowrap; z-index: 5; pointer-events: none;
}

.rank { display: flex; align-items: center; gap: 12px; padding: 8px 6px; border-radius: 8px; color: var(--text); }
.rank:hover { background: var(--surface-2); color: var(--text); }
.rank-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.rank-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-bar { height: 6px; border-radius: 3px; background: #eef1f5; overflow: hidden; }
.rank-bar span { display: block; height: 100%; border-radius: 3px; background: var(--brand-blue); }
.rank-val { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 32px; text-align: right; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; }
.tile { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: #fff; color: var(--text-2); font-weight: 500; }
.tile .ic { color: var(--muted); }
.tile b { margin-left: auto; color: var(--text); font-variant-numeric: tabular-nums; }
.tile:hover { background: var(--surface-2); color: var(--brand-blue); }
.tile:hover .ic { color: var(--brand-blue); }

.app-card { display: flex; align-items: center; gap: 14px; padding: 14px 18px; color: var(--text); transition: border-color .15s, transform .15s; }
.app-card:hover { border-color: var(--border-strong); transform: translateY(-1px); color: var(--text); }
.app-card .kpi-ic { width: 40px; height: 40px; }
.app-text { flex: 1; display: flex; flex-direction: column; line-height: 1.35; }
.app-text small { color: var(--muted); }
.app-ext { color: var(--muted); }

/* RUC izvještaj */
.period-card { margin-bottom: 20px; }
.period-card .toolbar { border-bottom: 0; }
.range-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rchip { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-2); font-size: 13px; font-weight: 500; background: #fff; }
.rchip:hover { border-color: var(--border-strong); color: var(--text); }
.rchip.active { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.tabs { display: flex; align-items: center; gap: 4px; padding: 10px 12px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--text-2); font-weight: 500; }
.tab .ic { width: 16px; height: 16px; color: var(--muted); }
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand-blue); border-bottom-color: var(--brand-blue); }
.tab.active .ic { color: var(--brand-blue); }
.tab-search { margin-left: auto; padding-bottom: 8px; flex: 0 1 280px; }
.tab-search .search { max-width: none; }
.tab-search input[type=search] { height: 34px; }

.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar-label { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 4px; min-width: 0; }
.hbar-rank { flex: none; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; background: #eef1f5; color: var(--text-2); font-size: 11px; font-weight: 700; }
.hbar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.hbar-row { display: flex; align-items: center; gap: 10px; }
.hbar-track { flex: 1; height: 10px; border-radius: 0 4px 4px 0; background: #f0f3f8; overflow: hidden; }
.hbar-fill { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--brand-blue); }
.hbar:first-child .hbar-fill { background: var(--brand-red); }
.hbar-val { flex: none; min-width: 64px; text-align: right; font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }

/* detalji narudžbe / fakture */
.info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.info-grid .card + .card { margin-top: 0; }
.info-card { padding: 16px 18px; }
.info-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
.info-value { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.info-sub { margin-top: 4px; color: var(--muted); font-size: 13px; }
.info-sub .ic { width: 15px; height: 15px; }
.info-total { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.info-total .info-label, .info-total .info-sub { color: #94a3b8; }
.info-total .info-value { font-size: 24px; letter-spacing: -.02em; }
.info-total small { font-size: 14px; color: #94a3b8; }
.note-card { padding: 14px 18px; margin-bottom: 20px; background: #fffbeb; border-color: #f7e2a8; color: #6b4e0a; }

.error-card { max-width: 480px; margin: 60px auto; padding: 40px; text-align: center; }
.error-card h1 { margin: 10px 0 8px; font-size: 22px; }
.error-card p { color: var(--muted); margin: 0 0 22px; }
.error-ic { width: 56px; height: 56px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: var(--warn-bg); color: var(--warn); }
.error-ic .ic { width: 28px; height: 28px; }

/* lightbox */
img[data-zoom] { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; background: rgba(8, 14, 25, .92); backdrop-filter: blur(4px); animation: fade .15s; }
.lb-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; color: #fff; }
.lb-title { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; background: rgba(255,255,255,.08); color: #fff; font: 500 13px var(--font); cursor: pointer; }
.lb-btn:hover { background: rgba(255,255,255,.18); color: #fff; }
.lb-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 24px 8px; overflow: hidden; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; background: #fff; border-radius: 6px; box-shadow: 0 20px 60px rgba(0,0,0,.5); cursor: zoom-in; }
.lb-stage.zoomed { display: block; overflow: auto; padding: 0; }
.lb-stage.zoomed img { max-width: none; max-height: none; border-radius: 0; cursor: zoom-out; }
.lb-help { padding: 6px 16px 14px; text-align: center; color: #8a9ab2; font-size: 12px; }

/* --------------------------------------------------------------- login */
.login-body { background: #fff; }
.login { display: grid; grid-template-columns: 1.2fr 1fr; min-height: 100vh; }
.login-hero {
  position: relative; overflow: hidden; display: flex; align-items: flex-end;
  background:
    radial-gradient(700px 420px at 75% 30%, rgba(47, 143, 208, .35), transparent 60%),
    radial-gradient(600px 380px at 10% 110%, rgba(215, 25, 32, .38), transparent 60%),
    linear-gradient(150deg, #16294a 0%, var(--navy-900) 45%, var(--navy-950) 100%);
}
.login-hero-mark { position: absolute; right: -6%; top: 8%; width: min(62%, 520px); transform: rotate(-10deg); filter: drop-shadow(0 30px 60px rgba(0,0,0,.5)); pointer-events: none; }
.login-hero-inner { position: relative; padding: 48px 56px; color: #fff; max-width: 680px; }
.login-badge { display: inline-block; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22); font-size: 12.5px; font-weight: 500; margin-bottom: 18px; }
.login-hero h1 { font-size: 34px; font-weight: 700; letter-spacing: -.02em; line-height: 1.18; }
.login-hero p { margin: 14px 0 0; color: #c3cddc; font-size: 15.5px; max-width: 520px; }
.login-panel { display: grid; place-items: center; padding: 40px 24px; background: linear-gradient(180deg, #fff 0%, #f6f8fb 100%); }
.login-card { width: 100%; max-width: 380px; }
.login-logo { display: block; width: 230px; margin: 0 0 26px; }
.login-card h2 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.login-sub { margin: 6px 0 26px; color: var(--muted); }
.login-card .field { margin-bottom: 16px; }
.login-card .btn-block { margin-top: 8px; }
.input-icon { position: relative; display: flex; align-items: center; }
.input-icon > .ic { position: absolute; left: 13px; color: var(--muted); pointer-events: none; }
.input-icon input { height: 46px; padding-left: 42px; font-size: 15px; }
.input-icon .reveal { position: absolute; right: 6px; width: 36px; height: 36px; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 8px; display: grid; place-items: center; }
.input-icon .reveal:hover { color: var(--text); background: var(--surface-2); }
.login-foot { margin-top: 28px; color: var(--muted); font-size: 12.5px; text-align: center; }

/* --------------------------------------------------------------- responsive */
@media (max-width: 1280px) {
  .kpis, .info-grid { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: minmax(0, 1fr) 320px; }
  .hero-mark { width: 220px; opacity: .5; }
}
@media (max-width: 1080px) {
  .dash-grid { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .split-side { position: static; order: -1; }
  .dz-preview { aspect-ratio: auto; height: 260px; }
  .dz-preview img { height: 258px; }
}
@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease, visibility .25s; visibility: hidden; }
  .sidebar.open { transform: none; visibility: visible; box-shadow: var(--shadow-lg); }
  .sidebar-backdrop.open { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(9,17,30,.45); }
  .main { margin-left: 0; }
  .menu-btn { display: inline-grid; }
  .login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login-hero { min-height: 220px; }
  .login-hero-mark { width: 180px; right: 16px; top: 16px; }
  .login-hero-inner { padding: 28px 24px; }
  .login-hero h1 { font-size: 22px; max-width: 70%; }
  .login-hero p { display: none; }
}
@media (max-width: 700px) {
  .content { padding: 18px 16px; }
  .topbar { padding: 0 12px; }
  .topbar-app, .crumb-sep, .topbar-date { display: none; }
  .kpis, .info-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .w-full, .w-half, .w-third { grid-column: span 1; }
  .form-card .card-body { padding: 4px 16px 18px; }
  .form-actions { padding: 12px 16px; }
  .page-head h1 { font-size: 20px; }
  .search, .search-wide { max-width: none; flex-basis: 100%; }
  .filter-select, .toolbar .ss { flex: 1 1 140px; max-width: none; }
  .more-filters { flex: 1 1 100%; }
  .more-filters-body { position: static; width: 100%; max-width: none; margin-top: 8px; grid-template-columns: 1fr; box-shadow: none; }
  .hero-inner { padding: 24px 20px; }
  .hero h1 { font-size: 22px; }
  .hero-mark { display: none; }
  .tiles { grid-template-columns: 1fr; }
  .toasts { right: 16px; bottom: 16px; }
  .tab-search { flex-basis: 100%; margin-left: 0; }
}

/* --------------------------------------------------------------- print */
@media print {
  .sidebar, .topbar, .footer, .no-print, .toasts { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; max-width: none; }
  body { background: #fff; }
  .card { box-shadow: none; }
  .info-total { background: #fff; color: var(--text); border-color: var(--border); }
  .info-total .info-label, .info-total .info-sub, .info-total small { color: var(--muted); }
}

/* dugi nazivi kategorija u listi artikala */
.chip-wrap { white-space: normal; max-width: 170px; line-height: 1.35; padding-top: 3px; padding-bottom: 3px; border-radius: 8px; }

/* RUC: grafikon iznad tabele, tabela preko cijele širine */
.ruc-layout { display: flex; flex-direction: column-reverse; gap: 20px; }
.ruc-layout .card + .card { margin-top: 0; }
.ruc-layout .hbars { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 32px; grid-auto-flow: column; grid-template-rows: repeat(5, auto); }
@media (max-width: 900px) { .ruc-layout .hbars { grid-template-columns: 1fr; grid-auto-flow: row; grid-template-rows: none; } }

/* --------------------------------------------------------------- AI slike */
.nav-badge { margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px; background: var(--brand-red); color: #fff; font-size: 11.5px; font-weight: 600; display: inline-grid; place-items: center; }
.btn-ai { background: linear-gradient(135deg, #6d3fc0, var(--brand-blue)); color: #fff; border-color: transparent; }
.btn-ai:hover { filter: brightness(1.08); color: #fff; }
.notice { display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin-bottom: 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); }
.notice-warn { background: var(--warn-bg); border-color: #f3dbb3; color: var(--warn); }
.notice .btn { margin-left: auto; }
.ai-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; background: rgba(255,255,255,.96); backdrop-filter: blur(6px); border-radius: var(--radius) var(--radius) 0 0; }
.ai-all { display: inline-flex; align-items: center; gap: 8px; margin-right: 6px; color: var(--text-2); cursor: pointer; }
.ai-bar-sp { flex: 1; }
.ai-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; padding: 16px; }
.ai-card { position: relative; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.ai-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.ai-card.is-selected { border-color: var(--brand-blue); box-shadow: 0 0 0 3px rgba(38, 65, 154, .15); }
.ai-check { position: absolute; top: 10px; left: 10px; z-index: 2; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: rgba(255,255,255,.92); border: 1px solid var(--border); cursor: pointer; }
.ai-img { aspect-ratio: 1000 / 1333; background: #fff; border-bottom: 1px solid var(--border); }
.ai-img img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; display: block; }
.ai-body { padding: 10px 12px 4px; min-width: 0; }
.ai-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13.5px; line-height: 1.35; }
.ai-body .meta a { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-actions { display: flex; gap: 8px; padding: 10px 12px 12px; margin-top: auto; }
.ai-actions .btn { flex: 1; justify-content: center; }
.ai-progress { padding: 16px; border-bottom: 1px solid var(--border); }
.ai-progress-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.ai-meter { height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.ai-meter span { display: block; height: 100%; background: linear-gradient(90deg, #6d3fc0, var(--brand-blue)); transition: width .4s ease; }
.ai-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ai-stats > div { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); display: flex; flex-direction: column; gap: 2px; }
.ai-stats span { color: var(--muted); font-size: 12.5px; }
.ai-stats strong { font-size: 20px; }
.check-inline { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; margin-top: 6px; cursor: pointer; }
@media (max-width: 640px) {
  .ai-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 10px; }
  .ai-actions { flex-direction: column; }
  .ai-stats { grid-template-columns: 1fr; }
}
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; filter: none; }

/* --------------------------------------------------------------- tekst na slici */
.tx-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.tx-stage-card { padding: 16px; }
.tx-stage { position: relative; max-width: 560px; margin: 0 auto; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.tx-stage canvas { display: block; width: 100%; height: auto; cursor: move; touch-action: none; }
.tx-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); background: var(--surface-2); min-height: 300px; }
.tx-loading .ic { width: 32px; height: 32px; }
.tx-controls { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 16px; }
.tx-controls input[type=range] { width: 100%; accent-color: var(--brand-blue); }
.tx-colors { display: flex; gap: 10px; }
.tx-color input { position: absolute; opacity: 0; pointer-events: none; }
.tx-color span { display: block; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--border-strong); cursor: pointer; box-shadow: inset 0 0 0 3px #fff; }
.tx-color input:checked + span { border-color: var(--brand-blue); box-shadow: inset 0 0 0 3px #fff, 0 0 0 3px rgba(38, 65, 154, .25); }
.tx-color input:focus-visible + span { outline: 2px solid var(--brand-blue); outline-offset: 2px; }
.tx-pos { display: flex; flex-wrap: wrap; gap: 6px; }
.tx-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 6px; border-top: 1px solid var(--border); padding-top: 16px; }
.img-text-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
@media (max-width: 900px) { .tx-layout { grid-template-columns: 1fr; } .tx-controls { position: static; } }
.qchips-sub { margin-top: -6px; }
.qchip-sm { height: 32px; padding: 0 11px; font-size: 13px; }
.qchip-sm .ic { width: 14px; height: 14px; }
