/* === USSL — main.css === */
/* Izvuceno iz index.html (linije 16-1232 i 1949-2033) */

    :root {
      --primary: #1976d2;
      --primary-soft: #e3f2fd;
      --bg: #f5f5f5;
      --text: #222;
      --card-bg: #ffffff;
      --danger: #d32f2f;
      --warning: #f9a825;
      --success: #388e3c;
      --absent: #9c27b0;
      --archived: #757575;
    }

    * {
      box-sizing: border-box;
      font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
      margin: 0;
      padding: 0;
    }

    body {
      margin: 0;
      background: var(--bg);
      color: var(--text);
      min-height: 100vh;
    }

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

    .sidebar {
      display: none;
      flex-direction: column;
      width: 240px;
      background: #0d47a1;
      color: #fff;
      padding: 16px;
      position: fixed;
      height: 100vh;
      overflow-y: auto;
      z-index: 100;
    }

    .sidebar h1 {
      font-size: 18px;
      margin-bottom: 24px;
      color: white;
    }

    .sidebar button {
      background: transparent;
      border: none;
      color: #fff;
      text-align: left;
      padding: 10px 12px;
      margin-bottom: 4px;
      border-radius: 12px;
      cursor: pointer;
      font-size: 15px;
      transition: all 0.2s ease;
    }

    .sidebar button:hover {
      background: rgba(255,255,255,0.1);
    }

    .sidebar button.active {
      background: rgba(255,255,255,0.15);
      font-weight: 600;
    }

    .main {
      flex: 1;
      display: flex;
      flex-direction: column;
      margin-left: 0;
      width: 100%;
    }

    @media (min-width: 768px) {
      .main {
        margin-left: 240px;
        width: calc(100% - 240px);
      }
    }

    .topbar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 12px 16px;
      background: #0d47a1;
      color: #fff;
      position: sticky;
      top: 0;
      z-index: 99;
      width: 100%;
    }

    .topbar-title {
      font-size: 18px;
      font-weight: 600;
    }

    .topbar-tabs {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }

    .topbar-tabs button {
      border: none;
      border-radius: 999px;
      padding: 6px 10px;
      font-size: 13px;
      background: rgba(255,255,255,0.1);
      color: #fff;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .topbar-tabs button:hover {
      background: rgba(255,255,255,0.2);
    }

    .topbar-tabs button.active {
      background: #fff;
      color: #0d47a1;
      font-weight: 600;
    }

    .content {
      padding: 12px;
      flex: 1;
    }

    @media (min-width: 768px) {
      .sidebar {
        display: flex;
      }
      .topbar {
        display: none;
      }
      .content {
        padding: 24px;
      }
    }

    .cards-grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 12px;
      margin-bottom: 20px;
    }

    @media (min-width: 768px) {
      .cards-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
      }
    }

    @media (min-width: 1024px) {
      .cards-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
      }
    }

    .card {
      background: var(--card-bg);
      border-radius: 16px;
      padding: 16px;
      box-shadow: 0 2px 6px rgba(0,0,0,0.08);
      transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    .card.clickable {
      cursor: pointer;
    }

    .card.clickable:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 10px rgba(0,0,0,0.12);
    }

    .card-title {
      font-size: 16px;
      font-weight: 600;
      margin-bottom: 4px;
      color: var(--text);
    }

    .card-subtitle {
      font-size: 13px;
      color: #555;
      margin-bottom: 8px;
      line-height: 1.4;
    }

    .pill {
      display: inline-block;
      font-size: 11px;
      padding: 2px 8px;
      border-radius: 999px;
      background: var(--primary-soft);
      color: var(--primary);
      margin-right: 4px;
      margin-top: 4px;
      font-weight: 500;
    }

    .pill-warning {
      background: #fff8e1;
      color: var(--warning);
    }

    .pill-danger {
      background: #ffebee;
      color: var(--danger);
    }

    .pill-absent {
      background: #f3e5f5;
      color: var(--absent);
    }

    .pill-archived {
      background: #f5f5f5;
      color: var(--archived);
    }

    .list {
      display: flex;
      flex-direction: column;
      gap: 8px;
      margin-top: 8px;
    }

    .list-item {
      background: #fff;
      border-radius: 12px;
      padding: 10px 12px;
      box-shadow: 0 1px 4px rgba(0,0,0,0.06);
      display: flex;
      flex-direction: column;
      gap: 4px;
      transition: all 0.2s ease;
    }

    .list-item:hover {
      box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

    .list-row-top {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 14px;
      gap: 8px;
    }

    .list-row-bottom {
      display: flex;
      flex-wrap: wrap;
      gap: 4px;
      align-items: center;
      font-size: 12px;
      color: #555;
    }

    .actions-row {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 6px;
    }

    .btn {
      border-radius: 999px;
      border: none;
      padding: 6px 10px;
      font-size: 12px;
      cursor: pointer;
      transition: all 0.2s ease;
      font-weight: 500;
    }

    .btn:hover {
      opacity: 0.9;
      transform: translateY(-1px);
    }

    .btn:active {
      transform: translateY(0);
    }

    .btn-outline {
      background: transparent;
      border: 1px solid #ccc;
      color: #333;
    }

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

    .btn-success {
      background: var(--success);
      color: #fff;
    }

    .btn-warning {
      background: var(--warning);
      color: #000;
    }

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

    .btn-absent {
      background: var(--absent);
      color: #fff;
    }
    
    .info-line {
  margin-top: 4px;
  margin-bottom: 6px;
  font-size: 12px;
    }

.info-warn {
  color: #b45309; /* topla narančasta */
}

.info-ok {
  color: #166534; /* tamno zelena */
}


    .section-title {
      font-size: 18px;
      font-weight: 600;
      margin: 4px 0 8px;
      color: var(--text);
    }

    .section-subtitle {
      font-size: 13px;
      color: #555;
      margin-bottom: 8px;
      line-height: 1.5;
    }

    .form-grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 8px;
      margin-top: 8px;
    }

    @media (min-width: 768px) {
      .form-grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
    }

    label {
      font-size: 12px;
      color: #555;
      display: block;
      margin-bottom: 4px;
      font-weight: 500;
    }

    input, select, textarea {
      width: 100%;
      padding: 8px 10px;
      border-radius: 8px;
      border: 1px solid #ccc;
      font-size: 13px;
      transition: all 0.2s ease;
    }

    input:focus, select:focus, textarea:focus {
      outline: none;
      border-color: var(--primary);
      box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
    }

    textarea {
      min-height: 60px;
      resize: vertical;
      font-family: inherit;
    }

    .mt-8 { margin-top: 8px; }
    .mt-16 { margin-top: 16px; }
    .mb-8 { margin-bottom: 8px; }
    .mb-16 { margin-bottom: 16px; }

    .flex {
      display: flex;
      gap: 8px;
      align-items: center;
    }

    .flex-between {
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 8px;
    }

    .small-text {
      font-size: 11px;
      color: #777;
      line-height: 1.4;
    }

    .chip {
      display: inline-block;
      font-size: 15px;
      padding: 8px 14px;
      border-radius: 8px;
      background: #f1f5f9;
      color: #555;
      font-weight: 600;
      border: 1px solid #e5e7eb;
      margin-right: 4px;
      margin-top: 2px;
      transition: all 0.2s ease;
    }
    

    .chip-red {
      background-color: #fee2e2;
      color: #b91c1c;
      border: 2px solid #ef4444;
     }

    .chip-red:hover {
      background-color: #fecaca;
     }

    .chip-green {
      background-color: #dcfce7;
      color: #166534;
      border: 2px solid #16a34a;
     }

    .chip-green:hover {
      background-color: #bbf7d0;
     }


    .chip.status-active {
      background: #d1fae5;
      color: #065f46;
      border: 1px solid #a7f3d0;
    }
    
    .chip.status-archived {
      background: #f1f5f9;
      color: #64748b;
      border: 1px solid #d1d5db;
    }

    .hidden { 
      display: none !important; 
    }

    .error {
      color: var(--danger);
      font-size: 12px;
      margin-top: 4px;
      padding: 6px 8px;
      background: #ffebee;
      border-radius: 6px;
      border-left: 3px solid var(--danger);
    }

    .success-msg {
      color: var(--success);
      font-size: 12px;
      margin-top: 4px;
      padding: 6px 8px;
      background: #e8f5e9;
      border-radius: 6px;
      border-left: 3px solid var(--success);
    }

    .warning-msg {
      color: var(--warning);
      font-size: 12px;
      margin-top: 4px;
      padding: 6px 8px;
      background: #fff8e1;
      border-radius: 6px;
      border-left: 3px solid var(--warning);
    }

    .loading {
      display: inline-block;
      width: 16px;
      height: 16px;
      border: 2px solid rgba(0,0,0,.1);
      border-radius: 50%;
      border-top-color: var(--primary);
      animation: spin 1s ease-in-out infinite;
    }

    @keyframes spin {
      to { transform: rotate(360deg); }
    }

    .loading-overlay {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(255,255,255,0.8);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 9999;
      backdrop-filter: blur(2px);
    }

    #login-overlay {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.95);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 10000;
      padding: 16px;
    }

    .login-card {
      background: #ffffff;
      border-radius: 18px;
      padding: 32px 28px;
      max-width: 420px;
      width: 100%;
      box-shadow: 0 18px 45px rgba(15, 23, 42, 0.28);
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
    }

    .login-title {
      font-size: 24px;
      font-weight: 700;
      margin-bottom: 4px;
      color: #111827;
      text-align: center;
    }

    .login-subtitle {
      font-size: 14px;
      color: #6b7280;
      margin-bottom: 24px;
      text-align: center;
      line-height: 1.5;
    }

    .login-label {
      display: block;
      font-size: 13px;
      font-weight: 500;
      color: #374151;
      margin-bottom: 4px;
    }

    .login-input {
      width: 100%;
      border-radius: 8px;
      border: 1px solid #d1d5db;
      padding: 10px 14px;
      font-size: 14px;
      outline: none;
      transition: border-color 0.15s ease, box-shadow 0.15s ease;
    }

    .login-input:focus {
      border-color: #2563eb;
      box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
    }

    .login-error {
      font-size: 13px;
      color: #b91c1c;
      margin-top: 8px;
      min-height: 18px;
      text-align: center;
    }

    .login-button {
      margin-top: 20px;
      width: 100%;
      border-radius: 8px;
      border: none;
      background: #2563eb;
      color: #ffffff;
      font-weight: 600;
      font-size: 15px;
      padding: 12px 16px;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      transition: background 0.15s ease, transform 0.05s ease;
    }

    .login-button:hover {
      background: #1d4ed8;
    }

    .login-button:active {
      transform: translateY(1px);
    }

    .login-footnote {
      margin-top: 20px;
      font-size: 11px;
      color: #9ca3af;
      text-align: center;
      line-height: 1.3;
      padding-top: 16px;
      border-top: 1px solid #e5e7eb;
    }

    .vitals-row {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      padding: 12px;
      background: #f8fafc;
      border-radius: 12px;
      margin: 12px 0;
      border: 1px solid #e2e8f0;
    }

    .vital-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      min-width: 60px;
    }

    .vital-label {
      font-size: 10px;
      color: #64748b;
      margin-bottom: 2px;
    }

    .vital-value {
      font-size: 14px;
      font-weight: 700;
      padding: 4px 8px;
      border-radius: 6px;
      min-width: 50px;
      text-align: center;
    }

    .vital-normal {
      background: #d1fae5;
      color: #065f46;
    }

    .vital-warning {
      background: #fef3c7;
      color: #92400e;
    }

    .vital-danger {
      background: #fee2e2;
      color: #991b1b;
    }

    .vital-na {
      background: #f1f5f9;
      color: #64748b;
    }

    .status-badge {
      padding: 4px 8px;
      border-radius: 999px;
      font-size: 11px;
      font-weight: 600;
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }

    .status-active {
      background: #d1fae5;
      color: #065f46;
    }

    .status-absent {
      background: #f3e8ff;
      color: #7c3aed;
    }

    .status-archived {
      background: #f1f5f9;
      color: #64748b;
    }

    .stats-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
      gap: 12px;
      margin-bottom: 20px;
    }

    .stat-card {
      background: white;
      border-radius: 12px;
      padding: 16px;
      text-align: center;
      box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    .stat-number {
      font-size: 24px;
      font-weight: 700;
      margin: 8px 0;
    }

    .stat-label {
      font-size: 12px;
      color: #64748b;
    }

    .alphabet-filter {
      display: flex;
      flex-wrap: wrap;
      gap: 4px;
      margin: 12px 0;
      justify-content: center;
    }

    .alphabet-letter {
      width: 28px;
      height: 28px;
      border-radius: 6px;
      border: 1px solid #e2e8f0;
      background: white;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 12px;
      font-weight: 600;
      transition: all 0.2s ease;
    }

    .alphabet-letter:hover {
      background: #f1f5f9;
    }

    .alphabet-letter.active {
      background: #3b82f6;
      color: white;
      border-color: #3b82f6;
    }

    .archive-actions {
      display: flex;
      gap: 8px;
      margin-top: 8px;
    }

    /* ── Karton pacijenta – modal overlay ── */
    #patient-detail-card {
      position: fixed !important;
      inset: 0;
      z-index: 2000;
      background: rgba(0, 0, 0, 0.55);
      display: none;
      align-items: flex-start;
      justify-content: center;
      padding: 16px;
      overflow-y: auto;
      backdrop-filter: blur(2px);
    }
    #patient-detail-card.open {
      display: flex !important;
    }
    #patient-detail-inner {
      background: #fff;
      border-radius: 16px;
      padding: 20px;
      width: 100%;
      max-width: 920px;
      margin: auto;
      box-shadow: 0 24px 64px rgba(0,0,0,0.2);
      position: relative;
    }
    @media (max-width: 768px) {
      #patient-detail-inner {
        padding: 14px;
        border-radius: 12px;
      }
    }

    .patient-nav-tabs {
      display: flex;
      border-bottom: 1px solid #e5e7eb;
      margin-bottom: 16px;
      overflow-x: auto;
    }
    
    .patient-nav-tab {
      padding: 10px 16px;
      border: none;
      background: none;
      cursor: pointer;
      font-size: 14px;
      color: #6b7280;
      white-space: nowrap;
      border-bottom: 2px solid transparent;
      transition: all 0.2s ease;
    }
    
    .patient-nav-tab:hover {
      color: #374151;
    }
    
    .patient-nav-tab.active {
      color: #1d4ed8;
      border-bottom-color: #1d4ed8;
      font-weight: 600;
    }
    
    .patient-section {
      display: none;
    }
    
    .patient-section.active {
      display: block;
    }

    .requisition-item {
      border-left: 4px solid;
      padding-left: 12px;
    }
    
    .requisition-status-pending {
      border-left-color: #f59e0b;
      background: #fffbeb;
    }
    
    .requisition-status-ordered {
      border-left-color: #3b82f6;
      background: #eff6ff;
    }
    
    .requisition-status-received {
      border-left-color: #10b981;
      background: #ecfdf5;
    }
    
    .requisition-status-cancelled {
      border-left-color: #9ca3af;
      background: #f9fafb;
    }
    
    .status-badge-requisition {
      padding: 2px 8px;
      border-radius: 999px;
      font-size: 11px;
      font-weight: 600;
    }
    
    .status-pending { background: #fef3c7; color: #92400e; }
    .status-ordered { background: #dbeafe; color: #1e40af; }
    .status-received { background: #d1fae5; color: #065f46; }
    .status-cancelled { background: #f3f4f6; color: #4b5563; }
    
    .section-highlight {
      background: linear-gradient(90deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
      border-left: 4px solid #3b82f6;
      padding: 12px;
      border-radius: 8px;
      margin-bottom: 16px;
    }
    
    .vital-value-row {
      font-weight: 600;
      font-size: 14px;
    }
    
    .vital-value-row.normal {
      color: #10b981;
    }
    
    .vital-value-row.warning {
      color: #f59e0b;
    }
    
    .vital-value-row.danger {
      color: #ef4444;
      font-weight: 700;
    }
    
    .vitals-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
      gap: 12px;
      margin-top: 16px;
    }
    
    .vital-card {
      padding: 12px;
      border-radius: 12px;
      background: white;
      border: 1px solid #e5e7eb;
      transition: all 0.2s ease;
    }
    
    .vital-card.alarm {
      border: 2px solid #ef4444;
      background: #fef2f2;
      animation: pulse 2s infinite;
    }
    
    .vital-card:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    }

    .empty-state {
      text-align: center;
      padding: 40px 20px;
      color: #666;
    }
    
    .empty-state-text {
      font-size: 14px;
    }
    
    .empty-state-icon {
      font-size: 48px;
      margin-bottom: 16px;
      opacity: 0.5;
    }

    .urine-low { background: #fef3c7; color: #92400e; }
    .urine-medium { background: #d1fae5; color: #065f46; }
    .urine-high { background: #fee2e2; color: #991b1b; }
    .urine-normal { background: #dbeafe; color: #1e40af; }

    .stool-normal { background: #d1fae5; color: #065f46; }
    .stool-abnormal { background: #fef3c7; color: #92400e; }
    .stool-danger { background: #fee2e2; color: #991b1b; }

    .hydration-good { background: #d1fae5; color: #065f46; }
    .hydration-warning { background: #fef3c7; color: #92400e; }
    .hydration-danger { background: #fee2e2; color: #991b1b; }


    }
    
        /* === LOGIN / ZAŠTITA PRIKAZA === */

    /* Normalno je app-shell vidljiv */
    .app-shell {
      display: flex;
    }

    /* Ako je login-overlay vidljiv (NEMA .hidden klase) – sakrij cijelu aplikaciju */
    #login-overlay:not(.hidden) + .app-shell {
      display: none;
    }


    /* === RESPONSIVE POPRAVCI === */
    @media (max-width: 480px) {
      .cards-grid {
        grid-template-columns: 1fr !important;
      }
      
      .form-grid-2 {
        grid-template-columns: 1fr !important;
      }
      
      .topbar-tabs {
        overflow-x: auto;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
      }
      
      .topbar-tabs button {
        font-size: 12px;
        padding: 4px 8px;
        white-space: nowrap;
      }
      
      .vitals-row {
        gap: 6px;
        padding: 8px;
      }
      
      .vital-item {
        min-width: 45px;
      }
      
      .vital-value {
        font-size: 12px;
        padding: 3px 6px;
        min-width: 40px;
      }
      
      .patient-nav-tabs {
        overflow-x: auto;
      }
      
      .patient-nav-tab {
        padding: 8px 12px;
        font-size: 12px;
      }
      
      .stat-card {
        padding: 12px !important;
      }
      
      .stat-number {
        font-size: 20px;
      }
    }
    
    @media (max-width: 360px) {
      .topbar-title {
        font-size: 16px;
      }
      
      .vitals-row {
        flex-wrap: wrap;
        justify-content: center;
      }
      
      .alphabet-letter {
        width: 24px;
        height: 24px;
        font-size: 11px;
      }
      
      /* 🔧 Prikaži naslov iznad popisa, sve ulijevo */
#view-dashboard .flex-between {
  display: flex;
  flex-direction: column; /* postavi elemente jedan ispod drugog */
  align-items: flex-start; /* poravnaj sve ulijevo */
  gap: 8px; /* mali razmak između naslova i teksta "Ažurirano" */
  margin-bottom: 10px;
}

/* 🔹 Osiguraj da popis ide ulijevo */
#view-dashboard #dashboard-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  margin: 0;
  padding: 10px 20px;
  width: 100%;
}

/* Bolničke klase za terapije */
.therapy-done {
  background-color: #dcfce7 !important;
  border-left-color: #16a34a !important;
}

.therapy-warning {
  background-color: #fee2e2 !important;
  border-left-color: #dc2626 !important;
}

.therapy-critical {
  background-color: #dc2626 !important;
  color: #fff !important;
  border-left-color: #7f1d1d !important;
}

.therapy-planned {
  background-color: #f3f4f6 !important;
  border-left-color: #9ca3af !important;
}

/* Treptanje za kritične (kasne) terapije */
@keyframes blink {
  0%, 100% { background-color: #dc2626; }
  50% { background-color: #ef4444; }
}
.blink-late {
  animation: blink 1.2s infinite;
}

.blink-late {
  animation: blink 1s infinite;
}
@keyframes blink {
  50% { opacity: 0.4; }
}

.hidden { display: none; }
.list-item:hover {
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: box-shadow 0.2s ease-in-out;
}
.small-text {
  color: #4b5563;
  font-size: 13px;
}

.therapy-row {
  font-size: 14px;
  color: #1f2937;
}
.therapy-row:hover {
  background-color: #f9fafb !important;
  transform: scale(1.01);
  transition: all 0.2s ease-in-out;
}
.btn-small {
  font-size: 13px;
  padding: 4px 8px;
}
.blink-late {
  animation: blink 1.2s infinite alternate;
}
@keyframes blink {
  from { opacity: 1; }
  to { opacity: 0.6; }
}

.therapy-row {
  font-size: 14px;
  color: #1f2937;
}
.therapy-row:hover {
  background-color: #f9fafb !important;
  transform: scale(1.01);
  transition: all 0.2s ease-in-out;
}
.btn-small {
  font-size: 13px;
  padding: 4px 8px;
}
.blink-late {
  animation: blink 1.2s infinite alternate;
}
@keyframes blink {
  from { opacity: 1; }
  to { opacity: 0.6; }
}

#tasks-list h4 {
  font-size: 1.05em;
  font-weight: 600;
  margin-bottom: 6px;
}
#tasks-list .error {
  color: #b91c1c;
  background: #fee2e2;
  padding: 8px;
  border-radius: 6px;
}
.small-text {
  font-size: 0.9em;
  color: #6b7280;
}

.bowel-card {
  transition: transform 0.1s ease-in-out, box-shadow 0.1s ease-in-out;
}
.bowel-card:hover {
  transform: scale(1.01);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
#tasks-panel-title {
  font-weight: 700;
  font-size: 1.2em;
  margin-bottom: 5px;
}
#tasks-panel-subtitle {
  font-size: 0.9em;
  color: #555;
}
.small-text {
  color: #666;
  font-size: 0.9em;
}
.error {
  color: #b91c1c;
  font-weight: 600;
}








    }

/* --- drugi style blok --- */
  .therapy-form-anim {
    transition: all 0.35s ease;
    opacity: 0;
    transform: translateY(-10px);
  }
  .therapy-form-anim.show {
    opacity: 1;
    transform: translateY(0);
  }
  
  .plans-subnav{
  position: sticky;
  top: 56px; /* ako ti je header drugačiji, reci pa prilagodimo */
  z-index: 30;
  display:flex;
  gap:8px;
  padding:10px 0;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #eee;
}

.subtab{
  border:1px solid #e6e6e6;
  background:#fff;
  padding:8px 12px;
  border-radius:10px;
  cursor:pointer;
  font-weight:600;
  font-size:13px;
}

.subtab.active{
  border-color:#2b6cff;
  box-shadow: 0 0 0 3px rgba(43,108,255,0.15);
}

.subtab-close{
  margin-left:auto;
  opacity:0.85;
}

.plans-section{
  margin-top:12px;
  padding:14px;
  border:1px solid #eee;
  border-radius:14px;
  background:#fff;
}

.plans-section.hidden{
  display:none;
}

.flex-between{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.flash-focus{
  animation: flashFocus 1.2s ease-out 1;
  outline: 3px solid rgba(43,108,255,0.25);
}

@keyframes flashFocus{
  0%   { box-shadow: 0 0 0 0 rgba(43,108,255,0.25); transform: translateY(0); }
  30%  { box-shadow: 0 0 0 10px rgba(43,108,255,0.12); transform: translateY(-1px); }
  100% { box-shadow: 0 0 0 0 rgba(43,108,255,0); transform: translateY(0); }
}

.birthday-banner{
  background:#fff8e1;
  border-left:4px solid #f59e0b;
  padding:10px 12px;
  border-radius:12px;
  margin: 10px 0 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  font-size: 14px;
}
.birthday-banner b{ font-weight: 700; }


/* =====================================================================
   USSL — terapija (dashboard kartice + status pillovi)
   =====================================================================
   Stilovi specifični za refaktorirani terapijski dashboard.
   Stari "injectTherapyStyles" iz legacy bundle-a i dalje radi; ovo su
   DODATNE klase koje koristi novi modul (lateness/dashboard.js).
   ===================================================================== */

/* --- jedan red terapije --- */
.therapy-row-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.therapy-row-main { flex: 1; min-width: 0; }
.therapy-row-side { flex-shrink: 0; text-align: right; }

.therapy-med-line {
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.med-dose  { font-weight: 400; color: #666; font-size: 13px; }
.med-route { font-size: 11px; color: #888; }

.therapy-time {
  font-size: 15px;
  font-weight: 700;
}
.therapy-status-pill {
  font-size: 11px;
  margin-top: 2px;
  padding: 2px 7px;
  border-radius: 12px;
  display: inline-block;
}

/* --- "tko je dao i kada" --- */
.therapy-given-info {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  padding: 5px 8px;
  background: #dcfce7;
  border-radius: 6px;
}
.therapy-given-info .given-name { font-size: 12px; font-weight: 700; color: #166534; }
.therapy-given-info .given-time { font-size: 11px; color: #16a34a; }

.therapy-note { font-size: 11px; color: #666; margin-top: 3px; }

/* --- akcijski tag pored imena lijeka --- */
.tag {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 20px;
  margin-left: 6px;
}
.tag-new  { color: #6b7280; background: #f3f4f6; }
.tag-late { color: #dc2626; font-weight: 700; }
.tag-warn { color: #ea580c; }

/* --- akcijski gumbi (Dano / Ostalo) --- */
.therapy-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* --- pacijentova grupa --- */
.therapy-patient-block .therapy-patient-head {
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.therapy-patient-block .patient-name {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}
.therapy-patient-block .patient-head-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.therapy-patient-block .counter { font-size: 12px; color: #6b7280; }
.therapy-patient-block .btn-karton {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
  color: #6b7280;
}
.therapy-patient-body { padding: 8px 10px; }
.therapy-patient-body .given-list { margin-top: 6px; }
.therapy-patient-body .empty-shift { color: #9ca3af; font-size: 12px; padding: 4px; }

/* --- "tihi" prikaz dane terapije --- */
.therapy-given-compact {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  background: #f0fdf4;
  border-radius: 6px;
  margin-bottom: 4px;
  font-size: 12px;
}
.therapy-given-compact .dot  { color: #16a34a; }
.therapy-given-compact .med  { flex: 1; color: #374151; font-weight: 500; }
.therapy-given-compact .time { color: #9ca3af; }
.therapy-given-compact .by   { color: #16a34a; font-size: 11px; }

/* --- PRN (po potrebi) terapija --- */
.prn-card {
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  background: #fff;
}
.prn-card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
.prn-med {
  display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap;
  font-size: 14px;
}
.prn-today-count {
  font-size: 11px; color: #6b7280; background: #f3f4f6;
  padding: 2px 8px; border-radius: 10px;
}
.prn-indication {
  font-size: 12px; background: #eff6ff; color: #1e40af;
  padding: 4px 8px; border-radius: 6px; margin-bottom: 8px;
}
.prn-info {
  font-size: 12px; color: #374151;
  border-left: 3px solid #d1d5db; padding-left: 8px; margin-bottom: 8px;
}
.prn-status-ok {
  font-size: 13px; color: #166534; background: #dcfce7;
  padding: 6px 10px; border-radius: 6px; margin-bottom: 8px;
}
.prn-status-block {
  font-size: 13px; color: #991b1b; background: #fee2e2;
  padding: 8px 10px; border-radius: 6px; margin-bottom: 8px;
  border-left: 3px solid #dc2626;
}
.prn-give-btn {
  width: 100%; padding: 10px; border: none; border-radius: 8px;
  background: #16a34a; color: #fff; font-size: 14px; font-weight: 700;
  cursor: pointer;
}
.prn-give-btn:hover { background: #15803d; }
.prn-give-btn-blocked { background: #f59e0b; color: #fff; }
.prn-give-btn-blocked:hover { background: #d97706; }

/* --- generic helperi --- */
.ussl-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  color: #6b7280;
  font-size: 14px;
}

/* =====================================================================
   USSL — Patient karton + modal stilovi
   ===================================================================== */

/* --- Edit modal --- */
.ussl-modal {
  position: fixed;
  inset: 0;
  z-index: 999999; /* iznad patient-detail-card i svega ostalog */
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px 12px;
  overflow-y: auto;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.ussl-modal.open { opacity: 1; }

.ussl-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(4px);
  z-index: 0;
}

.ussl-modal-content {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  width: 100%;
  max-width: 720px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
}

.ussl-modal-header {
  padding: 14px 20px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.ussl-modal-header h2 {
  margin: 0;
  font-size: 18px;
  color: #111827;
}
.ussl-modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #6b7280;
  width: 32px; height: 32px;
  border-radius: 8px;
}
.ussl-modal-close:hover { background: #f3f4f6; }

.ussl-modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

.ussl-modal-footer {
  padding: 12px 20px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  background: #f9fafb;
  border-radius: 0 0 14px 14px;
  flex-shrink: 0;
}

/* --- Edit form --- */
.pe-section {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.pe-section legend {
  font-size: 13px;
  font-weight: 700;
  color: #1976d2;
  padding: 0 8px;
}

.pe-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (max-width: 540px) {
  .pe-grid { grid-template-columns: 1fr; }
}

.pe-field { display: flex; flex-direction: column; gap: 4px; }
.pe-field-wide { grid-column: 1 / -1; }

.pe-field label {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}
.pe-field input,
.pe-field select {
  padding: 8px 10px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}
.pe-field input:focus,
.pe-field select:focus {
  outline: none;
  border-color: #1976d2;
}
.pe-field small {
  font-size: 11px;
  color: #9ca3af;
}

/* --- Clinical info banner (alergije, dijagnoze, kontakti) --- */
.patient-clinical-banner {
  margin-bottom: 12px;
}
.ci-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
@media (max-width: 720px) {
  .ci-grid { grid-template-columns: 1fr; }
}

.ci-card {
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.ci-card.ci-allergies         { border-color: #fbbf24; background: #fffbeb; }
.ci-card.ci-allergies.ci-critical { border-color: #dc2626; background: #fef2f2; box-shadow: 0 0 0 3px rgba(220,38,38,0.15); }
.ci-card.ci-diagnoses         { border-color: #93c5fd; background: #eff6ff; }
.ci-card.ci-contacts          { border-color: #86efac; background: #f0fdf4; }

.ci-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  font-weight: 700;
  font-size: 12px;
  color: #374151;
  background: rgba(255,255,255,0.5);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.ci-add-btn {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  width: 24px; height: 24px;
  cursor: pointer;
  font-size: 14px;
}
.ci-card-body { padding: 6px 10px; font-size: 12px; }
.ci-empty     { color: #9ca3af; font-style: italic; padding: 4px 0; }

.ci-item {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(0,0,0,0.06);
}
.ci-item:last-child { border-bottom: none; }

.ci-allergen   { font-weight: 700; color: #991b1b; }
.ci-mkb        { font-family: monospace; background: #1e40af; color:#fff; padding:1px 6px; border-radius:4px; font-weight:700; }
.ci-name       { font-weight: 600; color: #111827; }
.ci-primary    { font-size: 10px; color: #b45309; }
.ci-sev        { font-size: 10px; padding: 1px 6px; border-radius: 4px; font-weight: 700; }
.ci-note       { font-size: 11px; color: #6b7280; font-style: italic; }
.ci-sub        { font-size: 11px; color: #6b7280; }
.ci-phone      { color: #16a34a; font-weight: 600; text-decoration: none; }
.ci-delete     {
  background: none; border: none; color: #9ca3af; cursor: pointer;
  margin-left: auto; padding: 2px 6px; border-radius: 4px; font-size: 12px;
}
.ci-delete:hover { background: #fee2e2; color: #dc2626; }
.ci-loading    { padding: 10px; color: #6b7280; font-size: 12px; }
.ci-error      { padding: 8px; background: #fee2e2; color: #991b1b; border-radius: 6px; }

/* --- Modal za arhiviranje (razlozi) --- */
.arc-razlozi {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.arc-razlog-option {
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.15s;
  background: #fff;
}
.arc-razlog-option:hover { border-color: #93c5fd; background: #eff6ff; }
.arc-razlog-option.selected { border-color: #1976d2; background: #eff6ff; }
.arc-icon { font-size: 22px; }
.arc-label { font-weight: 600; color: #111827; }

/* --- Death certificate modal --- */
.dc-modal-content { max-width: 900px; }
.dc-section-generalije {
  background: #f9fafb;
  border-color: #d1d5db !important;
}
.dc-readonly-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 14px;
  font-size: 12px;
  color: #374151;
}
@media (max-width: 720px) {
  .dc-readonly-grid { grid-template-columns: 1fr; }
}

.dc-uzrok-row {
  display: grid;
  grid-template-columns: 200px 1fr 100px 110px;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}
@media (max-width: 720px) {
  .dc-uzrok-row { grid-template-columns: 1fr; }
}
.dc-uzrok-label { font-size: 11px; font-weight: 600; color: #374151; }
.dc-uzrok-row input {
  padding: 6px 8px;
  border: 1.5px solid #e5e7eb;
  border-radius: 6px;
  font-size: 13px;
}
.dc-mkb-input { font-family: monospace; text-transform: uppercase; }

.dc-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 700;
}
.dc-badge-draft  { background: #fef3c7; color: #92400e; }
.dc-badge-signed { background: #dcfce7; color: #166534; }

/* --- Gumbi za matičnu knjigu --- */
.btn-death-cert {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  color: #374151;
  margin-left: 4px;
}
.btn-death-cert:hover { background: #fee2e2; color: #991b1b; }

/* --- Gumb "Uredi" u zaglavlju kartona --- */
.btn-edit-patient {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  color: #374151;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  margin-right: 6px;
}
.btn-edit-patient:hover { background: #e5e7eb; }

/* =====================================================================
   USSL — Njega + Kupanje (v3.5)
   ===================================================================== */
.nursing-card {
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  margin-bottom: 12px;
  background: #fff;
  overflow: hidden;
}
.nursing-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
}
.nursing-patient-name { font-weight: 700; color: #111827; font-size: 15px; }
.btn-karton-mini {
  background: #fff; border: 1px solid #d1d5db; color: #374151;
  padding: 4px 10px; border-radius: 6px; font-size: 12px;
  font-weight: 600; cursor: pointer;
}
.btn-karton-mini:hover { background: #f3f4f6; }
.nursing-card-body { padding: 8px 14px 12px; }
.nursing-item { padding: 10px 0; border-bottom: 1px dashed #e5e7eb; }
.nursing-item:last-child { border-bottom: none; }
.nursing-item-head {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; margin-bottom: 4px;
}
.nursing-icon { font-size: 16px; }
.nursing-title { font-weight: 600; color: #111827; font-size: 14px; flex: 1; }
.nursing-info-text {
  font-size: 12px; color: #6b7280;
  padding-left: 24px; line-height: 1.4;
}
.nursing-action-btn {
  background: #16a34a; color: #fff; border: none;
  padding: 7px 14px; border-radius: 8px; font-weight: 700;
  font-size: 13px; cursor: pointer; white-space: nowrap;
}
.nursing-action-btn:hover { background: #15803d; }
.nursing-action-add { background: #2563eb; }
.nursing-action-add:hover { background: #1d4ed8; }
.nursing-done-line {
  font-size: 12px; color: #16a34a; font-weight: 600;
  padding: 4px 10px; background: #dcfce7;
  border-radius: 6px; white-space: nowrap;
}
.nursing-no-plan { font-size: 11px; color: #9ca3af; font-style: italic; }
.nursing-item-missing { opacity: 0.6; }
.nursing-history-list {
  margin-top: 6px; padding-left: 24px; font-size: 12px;
  display: flex; flex-direction: column; gap: 3px;
}
.nursing-history-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 3px 6px; background: #fef3c7;
  border-radius: 6px; color: #92400e;
}
.nh-time { font-weight: 700; }
.nh-text { flex: 1; color: #374151; }
.nh-by   { font-size: 11px; color: #6b7280; }
.dod-reason-btn {
  background: #fff; border: 1.5px solid #d1d5db; color: #374151;
  padding: 6px 12px; border-radius: 16px; font-size: 13px;
  cursor: pointer; font-weight: 500;
}
.dod-reason-btn:hover { border-color: #93c5fd; }
.dod-reason-btn.selected {
  background: #dbeafe; border-color: #2563eb;
  color: #1e40af; font-weight: 700;
}

/* Kupanje */
.bath-card {
  border: 1.5px solid #e5e7eb; border-radius: 12px;
  margin-bottom: 12px; background: #fff; overflow: hidden;
}
.bath-card-yellow { border-color: #fbbf24; background: #fffbeb; }
.bath-card-red    { border-color: #ef4444; background: #fef2f2;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.15); }
.bath-card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
}
.bath-card-yellow .bath-card-head { background: #fef3c7; }
.bath-card-red    .bath-card-head { background: #fee2e2; }
.bath-patient-name { font-weight: 700; color: #111827; font-size: 15px; }
.bath-card-body { padding: 10px 14px; }
.bath-title-line { font-size: 15px; color: #111827; margin-bottom: 2px; }
.bath-info-text {
  font-size: 12px; color: #6b7280;
  line-height: 1.4; margin-bottom: 8px;
}
.bath-last-info {
  font-size: 12px; color: #374151;
  padding: 6px 10px; background: #f9fafb;
  border-radius: 6px; margin-bottom: 6px;
}
.bath-alarm {
  font-size: 13px; font-weight: 700;
  padding: 6px 10px; border-radius: 6px; margin-bottom: 8px;
}
.bath-alarm-ok     { background: #dcfce7; color: #166534; }
.bath-alarm-yellow { background: #fef3c7; color: #92400e; }
.bath-alarm-red    { background: #fee2e2; color: #991b1b; }
.bath-action-row { margin-top: 6px; }
.bath-action-btn {
  background: #16a34a; color: #fff; border: none;
  padding: 8px 18px; border-radius: 8px;
  font-weight: 700; font-size: 14px; cursor: pointer;
}
.bath-action-btn:hover { background: #15803d; }
.bath-done-line {
  font-size: 13px; color: #16a34a; font-weight: 600;
  padding: 6px 10px; background: #dcfce7; border-radius: 6px;
}
.bath-note {
  font-size: 12px; color: #374151; font-weight: 400;
  margin-top: 4px; font-style: italic;
}

