/* Shared visual language, inspired by the UdrugaPlus public website. */
:root {
  --bg: #f3f5f8;
  --card: #ffffff;
  --accent: #3b4f87;
  --accent-2: #6173af;
  --text: #273b54;
  --muted: #59687b;
  --border: #dfe5ed;
  --sidebar: #273b54;
  --positive: #287e34;
  --soft: #eef0f5;
  --shell-shadow: 0 6px 24px rgba(39, 59, 84, 0.06);
}
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
button, input, select, textarea { font-family: inherit; }
h1, h2, h3, h4 { font-family: 'Inter Tight', 'Inter', sans-serif; letter-spacing: -0.025em; }
.title-block { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.25rem 1.25rem; width: 100%; min-width: 0; }
.title-block h1 { font-size: 1.5rem; font-weight: 600; line-height: 1.3; }
.title-block p { flex: 1 1 18rem; margin: 0; font-size: 0.85rem; }
.content { gap: 1rem; padding: 1.5rem; }
.topbar { flex-shrink: 0; }
.toolbar, .table-card, .card, .contact-card, .stat, .brand-box, .frame {
  box-shadow: var(--shell-shadow);
}
.toolbar { padding: 0.8rem 1rem; flex-shrink: 0; }
.table-card { min-height: 0; }
.table-scroll { min-height: 0; }
.search input, .toolbar select, .modal input, .modal select,
.date-input button, .top-nav a, .topbar-links a {
  background: var(--card);
  border-radius: 10px;
}
.search input { padding-top: 0.65rem; padding-bottom: 0.65rem; }
.search::before {
  content: '';
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
}
.search::after {
  content: '';
  position: absolute;
  left: 1.48rem;
  top: calc(50% + 5px);
  width: 5px;
  border-top: 1.5px solid var(--muted);
  transform: rotate(45deg);
  pointer-events: none;
}
.btn, .auth-btn {
  background: var(--positive);
  color: #fff;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.6rem 0.95rem;
  font-weight: 600;
}
.btn:hover, .auth-btn:hover { background: #21692b; box-shadow: 0 4px 12px rgba(39, 59, 84, 0.12); border-color: transparent; }
.btn-ghost { background: var(--card); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--soft); border-color: var(--accent); }
.btn-danger { background: #fff0f1; color: #a5273d; border-color: #edc5cd; }
.btn-danger:hover { background: #ffe3e7; border-color: #a5273d; }
button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
:is(button, a, input, select, textarea):focus-visible { outline: 3px solid var(--accent-2); outline-offset: 3px; }
thead th { background: var(--soft); font-size: 0.75rem; letter-spacing: 0.045em; padding: 0.85rem 0.95rem; }
thead th[data-key]::after { color: var(--muted); }
tbody td { padding: 0.4rem 0.95rem; font-size: 0.875rem; }
tbody .btn { padding: 0.4rem 0.75rem; }
tbody tr:hover { background: #f7f9fc; }
.status-pill { text-transform: none; letter-spacing: 0; font-weight: 600; }
.status-pill.active { background: #eaf6ec; color: #287e34; border-color: #cbe5cf; }
.status-pill.inactive { background: var(--soft); color: var(--muted); }
.modal { max-height: 90dvh; overflow: auto; box-shadow: 0 24px 70px rgba(39, 59, 84, 0.2); }
.modal-backdrop { background: rgba(24, 38, 58, 0.45); padding: 1rem; }
.sidebar {
  --text: #fff;
  --muted: #e0e6f1;
  --border: #52637f;
  --card: #344962;
  background: radial-gradient(at bottom right, #6173af, var(--sidebar));
  color: var(--text);
}
.sidebar .nav a { font-weight: 500; }
.sidebar .nav a.active { background: rgba(255,255,255,0.16); border-color: rgba(255,255,255,0.24); }
.sidebar .nav a:hover { background: rgba(255,255,255,0.1); }
.sidebar .brand-box, .sidebar .logout-row { background: rgba(255,255,255,0.05); box-shadow: none; }
.sidebar .company-select { background: #344962; }
.sidebar :focus-visible { outline-color: #fff; }
.hero {
  background: radial-gradient(at bottom right, #6173af, #273b54);
  color: #fff;
  border: none;
  box-shadow: var(--shell-shadow);
}
.hero p, .hero .badge { color: #fff; }
.hero .stat { color: var(--text); }
.hero-visual { box-shadow: none; }
.hero-caption, .lightbox button { color: #fff; }
section { box-shadow: var(--shell-shadow); }
body > .topbar { background: var(--card); }
#submit-btn { background: var(--positive); }
#submit-btn:hover { background: #21692b; }
.top-nav { box-shadow: var(--shell-shadow); }
@media (max-width: 1080px) {
  body:has(#content-frame) { height: 100dvh; grid-template-rows: minmax(0, auto) minmax(0, 1fr); }
  body:has(#content-frame) .sidebar { max-height: 45dvh; overflow-y: auto; }
  body:has(#content-frame) .main { min-height: 0; }
  body:has(#content-frame) .frame { height: 100%; }
}
@media (max-width: 700px) {
  .content { padding: 1rem; height: auto; min-height: 100dvh; overflow: visible; }
  body:has(> .content) { overflow: auto; }
  .top-actions, .search, .search input { width: 100%; min-width: 0; }
  .table-card { flex: none; }
  .table-scroll { max-height: 65dvh; }
  .title-block h1 { font-size: 1.5rem; }
  .title-block { flex-direction: column; align-items: flex-start; }
  .title-block p { flex: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* Application workspace */
.login-language { display: flex; justify-content: flex-end; align-items: center; gap: 0.5rem; margin-bottom: 1rem; font-size: 0.8rem; color: var(--muted); }
.login-language label { margin: 0; }
.login-language select { border: 1px solid var(--border); border-radius: 8px; padding: 0.4rem; background: var(--card); color: var(--text); }
.password-field { position: relative; }
.password-field input { padding-right: 5.5rem; }
.login-page #password-toggle { position: absolute; right: 0.4rem; top: 0.45rem; width: auto; padding: 0.45rem 0.6rem; font-size: 0.8rem; color: var(--accent); background: transparent; box-shadow: none; transform: none; }
.login-page .logo { max-width: 100%; height: auto; }
.app-shell .sidebar { gap: 1.15rem; }
.app-shell .brand-box { border: 0; padding: 0.35rem; background: transparent; }
.app-shell .brand-logo { height: 56px; }
.app-shell .company-row { flex-wrap: wrap; }
.app-shell .company-select { min-width: 0; width: 100%; flex-basis: 100%; }
.app-shell .sidebar-account .lang-group { margin-left: auto; flex-shrink: 0; }
.app-shell .sidebar-account .lang-btn { text-transform: uppercase; }
.app-shell .sidebar-account .icon-btn { flex-shrink: 0; }
.sidebar-account { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--border); }
.sidebar-account .logout-email { display: block; margin-top: 0.6rem; }
.app-shell .main { padding: 0; }
.app-shell .frame { height: 100%; border: 0; border-radius: 0; box-shadow: none; }
.mobile-header { display: none; }
.list-toolbar { justify-content: flex-start; gap: 0.75rem 1.25rem; box-shadow: none; }
.list-toolbar .top-actions { display: contents; }
.list-toolbar .top-actions > .btn { order: 4; margin-left: auto; white-space: nowrap; }
.list-toolbar .count { margin-left: auto; }
.pagination { background: transparent; border: 0; box-shadow: none; padding: 0.25rem 0; }
.table-scroll thead th, .items-table-wrap thead th { position: sticky; top: 0; z-index: 1; }
td, .items-foot { font-variant-numeric: tabular-nums; }
.numeric-cell { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.order-item-table :is(th, td):nth-child(n+4):nth-child(-n+6) { text-align: right; white-space: nowrap; }
.modal.order-modal { overflow: hidden; padding-bottom: 0; }
.order-modal > h2 { flex: none; padding-right: 2rem; }
.order-modal-body { overflow: auto; min-height: 0; padding: 0.25rem 0.25rem 1rem; }
.form-section-title { margin: 0 0 0.85rem; font-size: 1rem; }
.order-modal .modal-actions { flex: none; border-top: 1px solid var(--border); padding: 1rem 0; background: var(--card); }
.modal textarea { width: 100%; min-height: 80px; resize: vertical; padding: 0.65rem; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--text); }
.order-grid > .field, .item-form > .field { min-width: 0; }
.order-grid :is(input, select), .item-form :is(input, select) { width: 100%; min-width: 0; }
@media (max-width: 1080px) {
  body.app-shell:has(#content-frame) { grid-template-rows: auto minmax(0, 1fr); }
  .app-shell .mobile-header { display: flex; align-items: center; justify-content: space-between; padding: 0.65rem 1rem; background: var(--card); border-bottom: 1px solid var(--border); font-weight: 600; }
  #nav-toggle { border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--text); padding: 0.6rem 0.9rem; cursor: pointer; }
  body.app-shell:has(#content-frame) .sidebar { display: none; max-height: 60dvh; }
  body.app-shell.navigation-open:has(#content-frame) { grid-template-rows: auto auto minmax(0, 1fr); }
  body.app-shell.navigation-open:has(#content-frame) .sidebar { display: flex; }
  .app-shell .main { padding: 0; }
}
@media (max-width: 700px) {
  .list-toolbar .search { flex-basis: 100%; }
  .list-toolbar .top-actions > .btn { margin-left: 0; width: 100%; }
  .modal.order-modal { max-height: 94dvh; padding: 1rem 1rem 0; }
}
