:root {
  --bg: #0b1220;
  --bg-mid: #111a2e;
  --surface: #151f33;
  --surface-2: #1c2840;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #3b82f6;
  --accent-bright: #60a5fa;
  --accent-dim: #2563eb;
  --accent-glow: rgba(59, 130, 246, 0.35);
  --cyan: #22d3ee;
  --danger: #ef4444;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-soft: 0 2px 12px rgba(0, 0, 0, 0.2);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-weight: 500;
  background: var(--bg);
  color: var(--text);
  padding-top: var(--safe-top);
  padding-bottom: calc(16px + var(--safe-bottom));
  line-height: 1.45;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(59, 130, 246, 0.18), transparent 55%),
    radial-gradient(ellipse 80% 50% at 100% 50%, rgba(34, 211, 238, 0.06), transparent 45%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-mid) 45%, var(--bg) 100%);
  pointer-events: none;
}

::selection {
  background: rgba(59, 130, 246, 0.35);
  color: var(--text);
}

.app-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  background: linear-gradient(180deg, rgba(21, 31, 51, 0.65) 0%, transparent 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 480px;
  margin: 0 auto;
}

.brand-logo-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.35));
}

/* Ista klasa kao u glavnoj aplikaciji; u mobilnom headeru kompaktnije dimenzije */
.app-header .work-mode-welcome-logo {
  height: 56px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  display: block;
  margin: 0;
}

.brand-text h1 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.brand-text .sub {
  margin: 4px 0 0;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
}

main {
  padding: 20px 20px 28px;
  max-width: 480px;
  margin: 0 auto;
}

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: var(--shadow-soft);
}

.panel--elevated {
  background: linear-gradient(145deg, var(--surface-2) 0%, var(--surface) 100%);
  border-color: rgba(148, 163, 184, 0.14);
  box-shadow: var(--shadow);
}

.panel-login__title {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.panel-login__lead {
  margin: 0 0 18px;
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 500;
}

label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 600;
}

input[type='text'],
input[type='password'],
input[type='url'] {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(11, 18, 32, 0.55);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  font-weight: 500;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input::placeholder {
  color: rgba(148, 163, 184, 0.55);
}

input:hover {
  border-color: rgba(148, 163, 184, 0.35);
}

input:focus {
  outline: none;
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: rgba(11, 18, 32, 0.75);
}

.field {
  margin-bottom: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 15px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-bright) 0%, var(--accent-dim) 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
}

.btn-primary:hover {
  box-shadow: 0 6px 22px rgba(37, 99, 235, 0.45);
}

.btn-primary:active {
  background: linear-gradient(135deg, var(--accent) 0%, #1d4ed8 100%);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  margin-top: 10px;
  border: 1px solid transparent;
}

.btn-ghost:hover {
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(148, 163, 184, 0.06);
}

.message {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 14px;
  font-weight: 500;
}

.message-error {
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.message-info {
  background: rgba(59, 130, 246, 0.12);
  color: #bfdbfe;
  border: 1px solid rgba(59, 130, 246, 0.22);
}

.hidden {
  display: none !important;
}

.cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid rgba(148, 163, 184, 0.12);
  color: inherit;
  text-decoration: none;
  text-align: left;
  box-shadow: var(--shadow-soft);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.card__icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent-bright);
}

.card--op .card__icon {
  background: rgba(34, 211, 238, 0.1);
  color: var(--cyan);
}

.card__body {
  flex: 1;
  min-width: 0;
}

.card__body h2 {
  margin: 0 0 6px;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.card__body p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.4;
}

.card-action {
  width: 100%;
  cursor: pointer;
  font: inherit;
  position: relative;
  padding-right: 40px;
}

.card-action::after {
  content: '';
  position: absolute;
  right: 18px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  opacity: 0.45;
  pointer-events: none;
}

.card-action:hover {
  border-color: rgba(96, 165, 250, 0.35);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.card-action:active {
  transform: scale(0.99);
  background: rgba(59, 130, 246, 0.08);
}

.view-head {
  margin-bottom: 14px;
}

.view-title {
  margin: 10px 0 4px;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.view-sub {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}

.btn-back {
  width: auto;
  padding: 10px 14px;
  margin-bottom: 2px;
  font-size: 0.88rem;
  font-weight: 600;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: var(--muted);
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.btn-back:hover {
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(148, 163, 184, 0.12);
}

.data-list {
  margin-bottom: 14px;
}

.list-item {
  background: var(--surface);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-soft);
}

.list-item-date {
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 0.95rem;
}

.list-item-row {
  font-size: 0.88rem;
  margin-bottom: 5px;
  line-height: 1.45;
  font-weight: 500;
}

.list-item-row .label {
  color: var(--muted);
  margin-right: 6px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.list-note {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
}

.list-item-meta {
  margin-top: 8px;
  font-size: 0.74rem;
  color: var(--muted);
  text-transform: lowercase;
}

.list-loading,
.list-empty {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 16px 0;
  font-weight: 500;
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.toolbar .btn {
  width: auto;
  flex: 1;
  min-width: 120px;
}

.home-welcome__user {
  padding-bottom: 4px;
}

.home-welcome__name {
  margin: 0 0 4px;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.home-welcome__dept {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
}

.pwa-install-card {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.12) 0%, rgba(34, 211, 238, 0.08) 100%);
  border: 1px solid rgba(96, 165, 250, 0.22);
  box-shadow: var(--shadow-soft);
}

.pwa-install-card__head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.pwa-install-card__glyph {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  color: #7dd3fc;
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(125, 211, 252, 0.25);
}

.pwa-install-card__glyph svg {
  display: block;
}

.pwa-install-card__title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.pwa-install-card__lead {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
  font-weight: 500;
}

.pwa-install-card__cta {
  width: 100%;
  margin: 0;
  padding: 16px 18px;
  font-size: 1rem;
  font-weight: 700;
}

.pwa-install-card__manual {
  margin: 12px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
  font-weight: 500;
}

.pwa-install-card__ios-line {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text);
  font-weight: 500;
}

.hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.5;
  font-weight: 500;
}

.hint--boxed {
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(11, 18, 32, 0.45);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.1);
}

.modules-status {
  color: var(--muted);
  font-size: 0.86rem;
  margin: 0 0 14px;
  font-weight: 600;
}

.modules-empty {
  margin-top: 10px;
}

#file-protocol-warning {
  display: none;
}

html.mobilna-file-protocol #file-protocol-warning {
  display: block;
}

html.mobilna-file-protocol .app-header,
html.mobilna-file-protocol main {
  display: none !important;
}

.file-protocol-warning {
  margin: 28px 18px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  padding: 24px;
  background: linear-gradient(145deg, var(--surface-2) 0%, var(--surface) 100%);
  color: var(--text);
  border-radius: var(--radius);
  border: 1px solid rgba(239, 68, 68, 0.45);
  font-size: 0.95rem;
  line-height: 1.55;
  box-shadow: var(--shadow);
  font-weight: 500;
}

.file-protocol-warning h1 {
  margin: 0 0 14px;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fecaca;
  letter-spacing: -0.02em;
}

.file-protocol-warning code {
  font-size: 0.85em;
  background: rgba(0, 0, 0, 0.35);
  padding: 2px 7px;
  border-radius: 6px;
  word-break: break-all;
}

.file-protocol-warning ol {
  margin: 14px 0;
  padding-left: 1.25rem;
}

.file-protocol-note {
  margin: 18px 0 0;
  font-size: 0.86rem;
  color: var(--muted);
}

/* OP termini – prikaz */
.op-view__head .view-title {
  margin-top: 6px;
}

.op-view__brand {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: 8px;
}

.op-view__icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(34, 211, 238, 0.2) 0%, rgba(59, 130, 246, 0.25) 100%);
  color: var(--accent-bright);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.2);
}

.op-view__icon svg {
  display: block;
}

.op-view__title {
  margin: 0;
}

.op-view__sub {
  margin: 4px 0 0;
}

.op-view__toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.op-view__toolbar-actions {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.op-view__hint {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 12px 14px;
  background: linear-gradient(145deg, rgba(34, 211, 238, 0.14) 0%, rgba(59, 130, 246, 0.12) 50%, rgba(15, 23, 42, 0.35) 100%);
  border: 1px solid rgba(125, 211, 252, 0.32);
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.op-view__hint.hidden {
  display: none !important;
}

.op-view__hint-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: #7dd3fc;
  background: rgba(34, 211, 238, 0.18);
  border: 1px solid rgba(125, 211, 252, 0.28);
}

.op-view__hint-icon svg {
  display: block;
}

.op-view__hint-text {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.4;
  color: #e0f2fe;
}

.btn-op-new {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 16px;
  margin: 0;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #0c1929;
  cursor: pointer;
  touch-action: manipulation;
  appearance: none;
  border: none;
  border-radius: 14px;
  background: linear-gradient(165deg, #38bdf8 0%, #2563eb 52%, #1d4ed8 100%);
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.12s ease, box-shadow 0.2s ease, filter 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-op-new:focus {
  outline: none;
}

.btn-op-new:focus-visible {
  outline: 2px solid rgba(125, 211, 252, 0.9);
  outline-offset: 2px;
}

.btn-op-new:active {
  transform: scale(0.98);
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.3);
}

.btn-op-new.hidden {
  display: none !important;
}

.btn-op-new__icon {
  display: flex;
  color: rgba(12, 25, 41, 0.95);
}

.btn-op-new__icon svg {
  display: block;
}

.btn-op-new__label {
  position: relative;
  top: 0.5px;
}

.btn-op-refresh {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  min-width: 112px;
  padding: 0 16px;
  margin: 0;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #e0f2fe;
  cursor: pointer;
  touch-action: manipulation;
  appearance: none;
  border: 1px solid rgba(125, 211, 252, 0.38);
  border-radius: 14px;
  background: linear-gradient(165deg, rgba(34, 211, 238, 0.28) 0%, rgba(59, 130, 246, 0.2) 100%);
  box-shadow: 0 4px 12px rgba(8, 47, 73, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: transform 0.12s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-op-refresh:focus {
  outline: none;
}

.btn-op-refresh:focus-visible {
  outline: 2px solid rgba(125, 211, 252, 0.85);
  outline-offset: 2px;
}

.btn-op-refresh:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(8, 47, 73, 0.2);
}

.btn-op-refresh__icon {
  display: flex;
  color: #7dd3fc;
}

.btn-op-refresh__icon svg {
  display: block;
}

.btn-op-refresh__label {
  position: relative;
  top: 0.5px;
}

.op-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.op-card {
  position: relative;
  text-align: left;
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--surface-2) 0%, var(--surface) 100%);
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.op-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
  background: var(--op-accent, var(--accent));
}

.op-card--r1 {
  --op-accent: #3b82f6;
}

.op-card--r2 {
  --op-accent: #8b5cf6;
}

.op-card--r3 {
  --op-accent: #14b8a6;
}

.op-card--tap {
  cursor: pointer;
}

.op-card--tap:active {
  transform: scale(0.992);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.28);
}

.op-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px 8px;
  padding-left: 16px;
}

.op-card__room {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.op-card__status {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 999px;
}

.op-card__status--ok {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.op-card__status--draft {
  background: rgba(234, 179, 8, 0.12);
  color: #fde047;
  border: 1px solid rgba(234, 179, 8, 0.35);
}

.op-card__status--cancelled {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.op-card__schedule {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  padding: 0 14px 10px;
  padding-left: 16px;
}

.op-card__date {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.op-card__time {
  font-size: 0.95rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent-bright);
}

.op-card__dur {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.12);
}

.op-card__patient {
  padding: 0 14px 8px;
  padding-left: 16px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

.op-card__dg {
  padding: 0 14px 6px;
  padding-left: 16px;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

.op-card__dg-l {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-bright);
  margin-right: 6px;
}

.op-card__zah {
  padding: 0 14px 12px;
  padding-left: 16px;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.45;
}

.op-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px 12px;
  padding-left: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  background: rgba(11, 18, 32, 0.35);
}

.op-card__dept {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cyan);
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.op-card__dept--empty {
  min-width: 4px;
  opacity: 0;
  pointer-events: none;
}

.op-card__chev {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  opacity: 0.5;
  flex-shrink: 0;
}

.op-card__readonly {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* OP modal – sekcije */
.mobil-modal-overlay--op {
  background: rgba(8, 12, 22, 0.62);
}

.mobil-modal--op {
  border: 1px solid rgba(96, 165, 250, 0.18);
  box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.5);
}

.mobil-modal__head--op {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.14) 0%, rgba(34, 211, 238, 0.08) 100%);
  border-bottom-color: rgba(96, 165, 250, 0.2);
}

.mobil-modal__kicker {
  margin: 0 0 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-bright);
}

.mobil-modal__body--op {
  padding-top: 8px;
}

.op-form-section {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.op-form-section:last-of-type {
  border-bottom: none;
  margin-bottom: 8px;
  padding-bottom: 0;
}

.op-form-section__title {
  margin: 0 0 12px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.op-form-meta {
  margin-top: 4px !important;
  padding: 10px 12px;
  background: rgba(59, 130, 246, 0.06);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(59, 130, 246, 0.12);
}

.mobil-modal__foot--op {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.mobil-modal__foot--op .btn-danger {
  order: -1;
  width: 100%;
  margin: 0 !important;
}

.btn-op-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-op-delete__icon {
  display: flex;
  flex-shrink: 0;
  opacity: 0.95;
}

.btn-op-delete__icon svg {
  display: block;
}

.btn-op-delete:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.mobil-modal__foot-row {
  display: flex;
  gap: 10px;
}

.mobil-modal__foot-row .btn {
  flex: 1;
}

.op-input-accent:focus {
  border-color: var(--cyan) !important;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15) !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Raspored dežurstava – prikaz */
.dz-view__head .view-title {
  margin-top: 6px;
}

.dz-view__brand {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: 8px;
}

.dz-view__icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.22) 0%, rgba(59, 130, 246, 0.2) 100%);
  color: #c4b5fd;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.18);
}

.dz-view__icon svg {
  display: block;
}

.dz-view__title {
  margin: 0;
}

.dz-view__sub {
  margin: 4px 0 0;
}

.dz-view__toolbar {
  display: flex;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 16px;
}

.dz-view__hint {
  flex: 1;
  min-width: 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.14) 0%, rgba(59, 130, 246, 0.1) 50%, rgba(15, 23, 42, 0.35) 100%);
  border: 1px solid rgba(196, 181, 253, 0.32);
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.dz-view__hint-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid rgba(196, 181, 253, 0.25);
}

.dz-view__hint-icon svg {
  display: block;
}

.dz-view__hint-text {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.4;
  color: #ede9fe;
}

.dz-view__hint.hidden {
  display: none !important;
}

.btn-dz-refresh {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  margin: 0;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #ede9fe;
  cursor: pointer;
  touch-action: manipulation;
  appearance: none;
  border: 1px solid rgba(196, 181, 253, 0.35);
  border-radius: 14px;
  background: linear-gradient(165deg, rgba(139, 92, 246, 0.35) 0%, rgba(99, 102, 241, 0.22) 100%);
  box-shadow: 0 4px 12px rgba(88, 28, 135, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: transform 0.12s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-dz-refresh:focus {
  outline: none;
}

.btn-dz-refresh:focus-visible {
  outline: 2px solid rgba(196, 181, 253, 0.85);
  outline-offset: 2px;
}

.btn-dz-refresh:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(88, 28, 135, 0.15);
}

.btn-dz-refresh__icon {
  display: flex;
  color: #c4b5fd;
}

.btn-dz-refresh__icon svg {
  display: block;
}

.btn-dz-refresh__label {
  position: relative;
  top: 0.5px;
}

.dz-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dz-card {
  position: relative;
  text-align: left;
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--surface-2) 0%, var(--surface) 100%);
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.dz-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
  background: var(--dz-accent, #8b5cf6);
}

.dz-card--w0 {
  --dz-accent: #a78bfa;
}

.dz-card--w1 {
  --dz-accent: #818cf8;
}

.dz-card--w2 {
  --dz-accent: #60a5fa;
}

.dz-card--w3 {
  --dz-accent: #22d3ee;
}

.dz-card--w4 {
  --dz-accent: #34d399;
}

.dz-card--w5 {
  --dz-accent: #fbbf24;
}

.dz-card--w6 {
  --dz-accent: #f472b6;
}

.dz-card--tap {
  cursor: pointer;
}

.dz-card--tap:active {
  transform: scale(0.992);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.28);
}

.dz-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px 6px;
  padding-left: 16px;
}

.dz-card__weekday {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.dz-card__badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 999px;
}

.dz-card__badge--marked {
  background: rgba(251, 191, 36, 0.14);
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.dz-card__badge--plain {
  background: rgba(148, 163, 184, 0.1);
  color: var(--muted);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.dz-card__date {
  padding: 0 14px 10px;
  padding-left: 16px;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.dz-card__rows {
  padding: 0 14px 4px;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dz-card__row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dz-card__lab {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #c4b5fd;
}

.dz-card__val {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

.dz-card__nap {
  margin: 8px 14px 0;
  margin-left: 16px;
  padding: 10px 12px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
  font-style: italic;
  background: rgba(11, 18, 32, 0.45);
  border-radius: var(--radius-sm);
  border-left: 2px solid rgba(167, 139, 250, 0.35);
}

.dz-card__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 10px 14px 12px;
  padding-left: 16px;
  margin-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  background: rgba(11, 18, 32, 0.35);
}

.dz-card__chev {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  opacity: 0.5;
}

.dz-card__readonly {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Modal raspored */
.mobil-modal-overlay--dz {
  background: rgba(10, 8, 22, 0.62);
}

.mobil-modal--dz {
  border: 1px solid rgba(167, 139, 250, 0.22);
  box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.5);
}

.mobil-modal__head--dz {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.16) 0%, rgba(59, 130, 246, 0.1) 100%);
  border-bottom-color: rgba(167, 139, 250, 0.22);
}

.mobil-modal__kicker--dz {
  color: #c4b5fd;
}

.mobil-modal__body--dz {
  padding-top: 8px;
}

.mobil-modal__foot--dz {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.mobil-modal__foot--dz .mobil-modal__foot-row {
  display: flex;
  gap: 10px;
}

.mobil-modal__foot--dz .mobil-modal__foot-row .btn {
  flex: 1;
}

.mobil-modal__foot--dz .btn-danger {
  order: -1;
  width: 100%;
  margin: 0 !important;
}

.dz-interni-note {
  margin-top: 12px !important;
  padding: 10px 12px;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: var(--radius-sm);
}

.list-item--tap {
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.list-item--tap:active {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(96, 165, 250, 0.35);
}

.mobil-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.mobil-modal-overlay.hidden {
  display: none !important;
}

.mobil-modal {
  width: 100%;
  max-width: 480px;
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
  background: var(--surface-2);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.45);
  margin: 0 auto;
}

.mobil-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  flex-shrink: 0;
}

.mobil-modal__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.mobil-modal__close {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.mobil-modal__body {
  padding: 14px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
}

.mobil-modal__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0));
  border-top: 1px solid rgba(148, 163, 184, 0.15);
  flex-shrink: 0;
}

.mobil-modal__foot .btn {
  flex: 1;
  min-width: 100px;
}

.mobil-modal__foot .btn-danger {
  flex: 1 1 100%;
  order: -1;
  background: rgba(239, 68, 68, 0.2);
  color: #fecaca;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.mobil-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mobil-field-row > div {
  min-width: 0;
}

.mobil-field-row > div input,
.mobil-field-row > div select {
  width: 100%;
  box-sizing: border-box;
}

/* OP modal: sala uža, datum širi */
.mobil-field-row--op-sala-datum {
  grid-template-columns: minmax(0, 0.42fr) minmax(0, 0.58fr);
}

/* OP modal: početak i trajanje ravnomjerno */
.mobil-field-row--op-start-traj {
  grid-template-columns: 1fr 1fr;
}

/* Anesteziolog: už padajući izbornik (ne preko cijelog modala) */
.field--op-an select.op-select-an,
select#mobil-op-an.op-select-an {
  display: block;
  width: 100%;
  max-width: min(100%, 220px);
}

.mobil-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text);
}

.mobil-check input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

#mobil-dz-nap,
.mobil-modal__body textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(11, 18, 32, 0.55);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  font-weight: 500;
  resize: vertical;
  min-height: 80px;
}

.mobil-pac-picked {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--accent-bright);
}

.mobil-autocomplete {
  margin-top: 8px;
  max-height: 200px;
  overflow-y: auto;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: var(--surface);
}

.mobil-autocomplete.hidden {
  display: none !important;
}

.mobil-autocomplete__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.mobil-autocomplete__item:last-child {
  border-bottom: none;
}

.mobil-autocomplete__jmbg {
  font-size: 0.72rem;
  color: var(--muted);
}

.mobil-autocomplete__name {
  font-weight: 600;
}

.mobil-autocomplete__empty {
  padding: 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

@media (min-width: 520px) {
  .mobil-modal-overlay {
    align-items: center;
    padding: 20px;
  }

  .mobil-modal {
    border-radius: var(--radius);
    max-height: min(88vh, 900px);
  }

  .mobil-modal__foot .btn-danger {
    flex: 0 1 auto;
    order: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }

  .btn:active,
  .card-action:active,
  .op-card--tap:active,
  .dz-card--tap:active {
    transform: none;
  }
}
