@import url('mcl-tables-forms.css?v=202609021410');

:root {
    --sidebar-width: 280px;
    --sidebar-bg: #173f4f;
    --sidebar-text: #dee2e6;
    --sidebar-active: #0f766e;
    --topbar-height: 48px;
    --patient-text: #23415a;
    --patient-heading: #173f4f;
    --patient-muted: #5b7080;
    --patient-accent: #0f766e;
    /* MCL V3.0 — jedinstvena tipografija (15px baza) */
    --mcl-font-base: 0.9375rem;
    --mcl-font-sm: 0.875rem;
    --mcl-font-xs: 0.8125rem;
    --mcl-font-nav: 0.9375rem;
    --mcl-line-height: 1.45;
    --mcl-tables-forms-ver: 20260818a;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Century Gothic', CenturyGothic, AppleGothic, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: var(--mcl-font-base);
    line-height: var(--mcl-line-height);
    background:
        radial-gradient(circle at top right, rgba(15, 118, 110, .12), transparent 360px),
        #f4f7fb;
    color: var(--patient-text);
    min-height: 100vh;
    overflow-x: hidden;
}

#app-wrapper {
    min-height: 100vh;
}

/* Topbar */
.topbar {
    min-height: var(--topbar-height);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1020;
    border-bottom: 1px solid rgba(148, 163, 184, .18);
}

/* Sidebar — teal gradient, responds to dark mode */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1030;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: transform 0.3s ease, background 0.3s ease;
    background:
        radial-gradient(circle at top left, rgba(20, 184, 166, .22), transparent 210px),
        linear-gradient(180deg, #1a5a6a 0%, #154a5a 55%, #103e4e 100%);
    box-shadow: 14px 0 34px rgba(15, 23, 42, .18);
    border-right: 1px solid rgba(255, 255, 255, .08);
    padding: 18px 14px;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 16px;
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, .84);
    text-decoration: none;
    transition: all 0.25s;
    border: 1px solid transparent;
    margin: 3px 0;
}

.sidebar .nav-link i {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, .1);
    color: #b9f4e8;
    font-size: 0.9rem;
}

.sidebar .nav-link:hover {
    background: rgba(20, 184, 166, .16);
    color: #fff;
    border-color: rgba(20, 184, 166, .28);
    transform: translateX(2px);
}

.sidebar .nav-link:hover i {
    background: rgba(20, 184, 166, .22);
    color: #fff;
}

.sidebar .nav-link.active {
    background: rgba(20, 184, 166, .22);
    color: #fff;
    border-color: rgba(20, 184, 166, .35);
}

.sidebar .nav-link.active i {
    background: rgba(20, 184, 166, .3);
    color: #fff;
}

.sidebar-search input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 14px;
    color: #fff;
}

.sidebar-search input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.sidebar-search input:focus {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 0.2rem rgba(20, 184, 166, .15);
    color: #fff;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: auto;
    padding-top: 12px;
}

.sidebar h4,
.sidebar h5,
.sidebar h6 {
    color: #fff;
}

.sidebar .small,
.sidebar small {
    color: rgba(255, 255, 255, .78) !important;
}

/* Sidebar toggle button (mobile) */
.sidebar-toggle {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 1040;
    display: none;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1025;
}

.sidebar-overlay.show {
    display: block;
}

/* Content */
.content-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: 28px;
    display: flex;
    flex-direction: column;
}

/* Footer — stick to bottom */
.app-footer {
    margin-top: auto;
    width: 100%;
    flex-shrink: 0;
}

/* Cards — legacy style + glassmorphism + hover */
.card {
    border: 1px solid rgba(148, 163, 184, .18);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border-radius: 8px;
    color: var(--patient-text);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--patient-accent), #14b8a6, #0d9488);
    opacity: 0;
    transition: opacity 0.3s ease, height 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(15, 23, 42, .12);
    border-color: rgba(20, 184, 166, .3);
}

.card:hover::before {
    opacity: 1;
}

.card-header {
    font-weight: 700;
    color: var(--patient-heading);
    border-bottom: 1px solid rgba(148, 163, 184, .15);
    transition: border-color 0.3s ease;
}

.card:hover .card-header {
    border-bottom-color: rgba(20, 184, 166, .25);
}

/* Card top border accent colors */
.card-primary {
    border-top: 3px solid #0f766e;
}

.card-success {
    border-top: 3px solid #198754;
}

.card-info {
    border-top: 3px solid #0dcaf0;
}

.card-warning {
    border-top: 3px solid #ffc107;
}

.card-danger {
    border-top: 3px solid #dc3545;
}

.card-secondary {
    border-top: 3px solid #6c757d;
}

.card-dark {
    border-top: 3px solid #212529;
}

/* Card icon hover — scale up */
.card-header i,
.card-title i {
    transition: transform 0.3s ease, color 0.3s ease;
}

.card:hover .card-header i,
.card:hover .card-title i {
    transform: scale(1.2);
    color: var(--patient-accent);
}

/* Tables */
.table th {
    font-weight: 600;
    color: var(--patient-heading);
}

.table {
    color: var(--patient-text);
}

.badge {
    font-weight: 500;
    border-radius: 999px;
}

/* Section title — legacy teal border-bottom */
.section-title {
    color: var(--patient-heading);
    border-bottom: 2px solid var(--patient-accent);
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Info labels & values — legacy style */
.info-label {
    font-weight: 600;
    color: var(--patient-muted);
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.info-value {
    margin-bottom: 15px;
    color: var(--patient-text);
    font-size: 1rem;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

/* History items — legacy left border */
.history-item {
    padding: 15px;
    border-left: 4px solid var(--patient-accent);
    background-color: #f8f9fa;
    margin-bottom: 15px;
    border-radius: 0 5px 5px 0;
}

/* Health info — legacy style */
.health-info {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
    border: 1px solid #e9ecef;
}

.health-info-value {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px 15px;
    min-height: 44px;
    cursor: text;
    transition: all 0.2s;
}

.health-info-value[contenteditable="true"]:hover {
    background-color: #f8f9fa;
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.1);
}

.health-info-value[contenteditable="true"]:focus {
    outline: none;
    background-color: #fff;
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Skeleton loading */
.skeleton-line {
    height: 0.9rem;
    background: linear-gradient(90deg, #e9ecef 25%, #f1f3f5 50%, #e9ecef 75%);
    background-size: 200% 100%;
    border-radius: 0.25rem;
    animation: skeleton-shimmer 1.5s infinite;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-wrapper {
    pointer-events: none;
}

/* Empty state */
.empty-state i {
    opacity: 0.4;
}

/* Toast container */
.toast-container {
    pointer-events: auto;
}

/* Responsive breakpoints — Bootstrap 5 aligned
   xs: <576px (mobile portrait)
   sm: >=576px (mobile landscape)
   md: >=768px (tablet)
   lg: >=992px (desktop)
   xl: >=1200px (large desktop)
   xxl: >=1400px (extra large)
*/

/* xs — Mobile portrait (< 576px) */
@media (max-width: 575.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .content-wrapper {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: inline-flex;
    }

    .card-body {
        padding: 0.75rem;
    }

    .table {
        font-size: 0.85rem;
    }

    .topbar {
        padding: 0.25rem 0.5rem !important;
    }

    .toast-container {
        inset: 0 auto auto 0;
        width: 100%;
        max-width: none;
    }

    .toast {
        min-width: 100%;
    }
}

/* sm — Mobile landscape (>= 576px) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .content-wrapper {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: inline-flex;
    }
}

/* md — Tablet (>= 768px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .content-wrapper {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: inline-flex;
    }

    .card-body {
        padding: 1rem;
    }
}

/* lg — Desktop (>= 992px) */
@media (min-width: 992px) {
    .sidebar-toggle {
        display: none !important;
    }

    .sidebar-overlay {
        display: none !important;
    }
}

/* xl — Large desktop (>= 1200px) */
@media (min-width: 1200px) {
    :root {
        --sidebar-width: 260px;
    }
}

/* xxl — Extra large (>= 1400px) */
@media (min-width: 1400px) {
    :root {
        --sidebar-width: 280px;
    }

    .content-wrapper {
        max-width: 1600px;
        margin-left: var(--sidebar-width);
        margin-right: auto;
    }
}

/* Reduced motion — respect user preference */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .skeleton-line {
        animation: none;
        background: #e9ecef;
    }
}

/* High contrast — respect user preference */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #dee2e6;
    }

    .sidebar .nav-link.active {
        outline: 2px solid #fff;
    }

    a:focus-visible,
    button:focus-visible {
        outline: 3px solid #000;
        outline-offset: 2px;
    }
}

/* Screen reader only utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Print styles */
@media print {

    .sidebar,
    .topbar,
    .sidebar-toggle,
    .sidebar-overlay,
    .toast-container,
    .btn,
    .no-print,
    .d-print-none {
        display: none !important;
    }

    .content-wrapper {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 0 !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
        break-inside: avoid;
    }

    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 12px;
    }

    .patient-header,
    .dossier-section,
    .lab-results-table,
    .exam-detail {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    h1,
    h2,
    h3,
    h4 {
        color: #000 !important;
    }

    a {
        text-decoration: none !important;
        color: #000 !important;
    }

    .table {
        font-size: 11px;
    }

    .table th {
        background: #e9ecef !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    @page {
        margin: 1.5cm;
    }
}

/* Focus visible for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--patient-accent);
    outline-offset: 2px;
}

/* Buttons — legacy teal accent */
.btn-primary {
    background-color: var(--patient-accent);
    border-color: var(--patient-accent);
}

.btn-primary:hover {
    background-color: #0d9488;
    border-color: #0d9488;
}

/* Modals — legacy rounded style */
.modal-content {
    border: 0;
    border-radius: 26px;
    overflow: hidden;
    box-shadow: 0 26px 70px rgba(15, 23, 42, .28);
}

.modal-header:not(.bg-danger) {
    background: linear-gradient(135deg, #0f766e, #16a34a 58%, #2563eb) !important;
    color: #fff;
    border-bottom: 0;
    padding: 18px 22px;
}

.modal-title {
    color: #fff;
    font-weight: 850;
    letter-spacing: -.01em;
}

.modal-body {
    background: #f8fafc;
    padding: 22px;
}

.modal-body>.row,
.modal-body>.mb-3 {
    background: #fff;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
}

.modal-body .form-label,
.modal-body .fw-bold {
    color: var(--patient-heading);
    font-weight: 800;
}

.modal-body .form-control,
.modal-body .form-select {
    border-radius: 14px;
    border-color: rgba(148, 163, 184, .38);
    color: var(--patient-text);
}

.modal-footer {
    background: #fff;
    border-top: 1px solid rgba(148, 163, 184, .2);
    padding: 16px 22px;
}

/* Text muted — legacy color */
.text-muted,
small,
.small,
.form-text {
    color: var(--patient-muted) !important;
}

/* Headings — legacy color */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--patient-heading);
}

/* Form controls — legacy style */
.form-control,
.form-select {
    border-radius: 8px;
    border-color: rgba(148, 163, 184, .3);
    color: var(--patient-text);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--patient-accent);
    box-shadow: 0 0 0 0.2rem rgba(15, 118, 110, .15);
}

.form-label {
    color: var(--patient-heading);
    font-weight: 600;
}

/* Patient header — legacy style */
.patient-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.patient-name {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--patient-heading);
    margin: 0;
}

.patient-type {
    font-size: 1rem;
    background-color: #e9ecef;
    padding: 5px 10px;
    border-radius: 15px;
    font-weight: 500;
}

/* Info grid — legacy CSS grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #0d6efd;
    color: #fff;
    padding: 8px 16px;
    z-index: 1100;
    text-decoration: none;
    border-radius: 0 0 4px 0;
}

.skip-link:focus {
    top: 0;
}

/* ===== Enhanced hover effects & glassmorphism ===== */

/* Buttons — hover lift + glow */
.btn {
    transition: all 0.25s ease;
    border-radius: 8px;
    font-weight: 600;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, .12);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(15, 23, 42, .1);
}

.btn-primary {
    background-color: var(--patient-accent);
    border-color: var(--patient-accent);
}

.btn-primary:hover {
    background-color: #0d9488;
    border-color: #0d9488;
    box-shadow: 0 6px 18px rgba(15, 118, 110, .3);
}

.btn-outline-primary {
    color: var(--patient-accent);
    border-color: var(--patient-accent);
}

.btn-outline-primary:hover {
    background-color: var(--patient-accent);
    border-color: var(--patient-accent);
    box-shadow: 0 4px 14px rgba(15, 118, 110, .2);
}

.btn-outline-secondary:hover,
.btn-outline-info:hover,
.btn-outline-success:hover,
.btn-outline-warning:hover,
.btn-outline-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(15, 23, 42, .1);
}

/* Icon inside buttons — scale on hover */
.btn i {
    transition: transform 0.25s ease;
}

.btn:hover i {
    transform: scale(1.15);
}

/* Table rows — hover highlight */
.table tbody tr {
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.table tbody tr:hover {
    background-color: rgba(20, 184, 166, .06);
    transform: translateX(2px);
}

.table tbody tr:hover td {
    border-color: rgba(20, 184, 166, .15);
}

/* Badges — subtle glow on hover */
.badge {
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.badge:hover {
    box-shadow: 0 0 12px rgba(20, 184, 166, .25);
    transform: scale(1.05);
}

/* Links — smooth color transition */
a {
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

/* Topbar — enhanced glassmorphism */
.topbar {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin: 10px 12px;
    padding: 8px 16px !important;
}

/* Topbar buttons — hover glow */
.topbar .btn:hover {
    box-shadow: 0 4px 12px rgba(15, 118, 110, .15);
}

/* Topbar — version badge + user name (kontrast) */
.topbar-version {
    background: linear-gradient(135deg, #06b6d4, #10b981);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 10px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(6, 182, 212, .25);
}

.topbar-user {
    color: #134e4a;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 8px;
    background: rgba(6, 182, 212, 0.08);
}

/* Sidebar nav-link icon — hover spin/wobble */
.sidebar .nav-link i,
.infopult-sidebar-menu a i {
    transition: transform 0.3s ease, background 0.25s ease, color 0.25s ease;
}

.sidebar .nav-link:hover i,
.infopult-sidebar-menu a:hover i {
    transform: scale(1.15) rotate(-5deg);
}

/* Sidebar active link — subtle pulsing glow */
.sidebar .nav-link.active,
.infopult-sidebar-menu a.active {
    box-shadow: 0 0 12px rgba(20, 184, 166, .15);
}

/* Alerts — slide-in animation */
.alert {
    border-radius: 12px;
    animation: alertSlideIn 0.35s ease-out;
}

@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dropdown menus — glassmorphism + animation */
.dropdown-menu {
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 14px;
    box-shadow: 0 12px 34px rgba(15, 23, 42, .12);
    backdrop-filter: blur(10px);
    animation: dropdownFade 0.2s ease-out;
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    transition: background 0.18s ease, color 0.18s ease, padding-left 0.18s ease;
}

.dropdown-item:hover {
    background-color: rgba(20, 184, 166, .1);
    color: var(--patient-accent);
    padding-left: 1.5rem;
}

/* Form controls — focus glow */
.form-control,
.form-select {
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.15s ease;
}

.form-control:focus,
.form-select:focus {
    transform: translateY(-1px);
}

/* Input group — hover border */
.input-group:hover .form-control,
.input-group:hover .form-select {
    border-color: rgba(20, 184, 166, .4);
}

/* Toast — slide-in + glassmorphism */
.toast {
    border-radius: 14px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 28px rgba(15, 23, 42, .15);
    animation: toastSlideIn 0.3s ease-out;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Nav tabs — hover underline animation */
.nav-tabs .nav-link {
    transition: color 0.2s ease, border-color 0.2s ease;
    border-radius: 8px 8px 0 0;
}

.nav-tabs .nav-link:hover {
    color: var(--patient-accent);
    border-color: rgba(20, 184, 166, .2);
}

/* Accordion — smooth expand */
.accordion-button {
    transition: background 0.2s ease, color 0.2s ease;
    border-radius: 8px !important;
}

.accordion-button:not(.collapsed) {
    background: rgba(20, 184, 166, .08);
    color: var(--patient-accent);
}

.accordion-button:hover {
    background: rgba(20, 184, 166, .05);
}

.accordion-item {
    border-radius: 8px !important;
    overflow: hidden;
    margin-bottom: 8px;
}

/* Progress bars — animated stripe */
.progress-bar {
    background-color: var(--patient-accent);
    transition: width 0.4s ease;
}

/* List group items — hover slide */
.list-group-item {
    transition: background 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
    border-radius: 8px !important;
    margin-bottom: 4px;
}

.list-group-item:hover {
    background-color: rgba(20, 184, 166, .06);
    transform: translateX(3px);
    border-color: rgba(20, 184, 166, .15);
}

/* Page transition — disabled to prevent sidebar trembling */
.content-wrapper {
    animation: none;
}

/* Modal — enhanced entrance */
.modal-dialog {
    animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Close button — hover rotate */
.btn-close {
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn-close:hover {
    transform: rotate(90deg);
    opacity: 0.8;
}

/* Pagination — hover lift */
.page-link {
    transition: all 0.2s ease;
    border-radius: 8px !important;
    margin: 0 2px;
    color: var(--patient-accent);
}

.page-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(15, 118, 110, .15);
    color: var(--patient-accent);
}

.page-item.active .page-link {
    background-color: var(--patient-accent);
    border-color: var(--patient-accent);
}

/* === Unified page banner — gradient box design (centralized) === */
.page-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 21px;
    border-radius: 21px;
    margin-bottom: 18px;
    color: #fff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .09);
}

.page-banner-teal {
    background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
}

/* Page banner — tall variant (bez topbar, sad sadrži verziju/korisnik/odjava) */
.page-banner-tall {
    padding: 24px 28px;
    min-height: 96px;
    align-items: center;
}

/* Page banner — XL variant (20% veća visina + veći tekst) */
.page-banner-xl {
    padding: 32px 36px;
    min-height: 115px;
}

.page-banner-xl .page-banner-title-xl {
    font-size: 1.85rem;
    letter-spacing: 0.5px;
}

.page-banner-xl .page-banner-desc-lg {
    font-size: var(--mcl-font-sm);
    opacity: 0.85;
    line-height: 1.45;
    max-width: 52rem;
}

.page-banner-xl .page-banner-pill {
    font-size: 0.9rem;
    padding: 5px 14px;
}

.page-banner-version {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 10px;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.page-banner-user {
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.banner-logout-btn {
    background-color: rgba(255, 255, 255, 0.95) !important;
    color: #dc2626 !important;
    border: 1px solid rgba(220, 38, 38, 0.3) !important;
}

.banner-logout-btn:hover {
    background-color: #dc2626 !important;
    color: #fff !important;
    border-color: #dc2626 !important;
}

.page-banner-blue {
    background: linear-gradient(135deg, #2563eb 0%, #0d6efd 100%);
}

.page-banner-green {
    background: linear-gradient(135deg, #198754 0%, #20c997 100%);
}

.page-banner-purple {
    background: linear-gradient(135deg, #6f42c1 0%, #8b5cf6 100%);
}

.page-banner-dark {
    background: linear-gradient(135deg, #1a1a1a 0%, #3a3a3a 100%);
}

.page-banner-amber {
    background: linear-gradient(135deg, #fd7e14 0%, #ffc107 100%);
}

.page-banner-red {
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
}

.page-banner-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.page-banner h1,
.page-banner h2 {
    color: #fff;
    font-weight: 700;
    margin: 0;
    font-size: 1.6rem;
    line-height: 1.2;
}

.page-banner p {
    margin: 0;
    opacity: .75;
    color: #fff;
    font-size: .85rem;
    line-height: 1.2;
}

.page-banner .banner-back-btn,
.page-banner .banner-action-btn {
    background-color: rgba(255, 255, 255, .95);
    color: #1e293b;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 999px;
    padding: 8px 18px;
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: all 0.25s ease;
}

.page-banner .banner-back-btn {
    font-size: .9rem;
    padding: 6px 12px;
}

.page-banner .banner-back-btn:hover,
.page-banner .banner-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, .12);
    text-decoration: none;
    color: #0d9488;
}

.page-banner .banner-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .page-banner {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}

/* === MCL tabele — bez horizontalnog skrola, tekst se prelama === */
table {
    width: 100%;
}

.table-responsive {
    overflow-x: hidden !important;
    overflow-y: visible;
    max-height: none;
}

/* Protokol tabele — isti globalni standard kao mcl-tables-forms.css */

.table td,
.table th {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: normal;
    overflow-wrap: normal;
    min-width: 0;
}

.table td.mcl-cell-wrap,
.table th.mcl-cell-wrap {
    white-space: normal;
    overflow: hidden;
    text-overflow: clip;
    word-break: break-word;
    overflow-wrap: break-word;
}

@media (max-width: 575.98px) {
    .table-responsive {
        overflow-x: hidden;
    }

    .table-responsive-sm {
        overflow-x: hidden;
    }
}

@media (max-width: 767.98px) {
    .table {
        font-size: var(--mcl-font-sm);
    }

    .table th,
    .table td {
        padding: 0.35rem 0.5rem;
    }

    .table .btn-sm {
        padding: 0.15rem 0.35rem;
        font-size: var(--mcl-font-xs);
    }
}

/* Ensure main content containers don't overflow */
.infopult-wrapper,
.infopult-main,
.content-wrapper,
.container-fluid {
    overflow-x: hidden;
}

/* === Dark mode contrast fixes === */

/* Infopult card header colors — light mode */
.card-header-podsetnik {
    background: #fff3cd;
    color: #997a00;
}

.card-header-hronicni {
    background: #fde8e8;
    color: #991b1b;
}

.card-header-uputstvo {
    background: #e0ecff;
    color: #1e40af;
}

.badge-hronicni-count {
    background: #fff;
    color: #991b1b;
}

.legend-bar {
    background: #fff;
}

.broj-kartona-highlight {
    font-size: 1.8rem;
    font-weight: bold;
    color: #198754;
    margin: 10px 0 20px;
    padding: 15px;
    border: 2px dashed #198754;
    border-radius: 5px;
    background-color: #f8fff8;
    display: inline-block;
}

.patient-success-info {
    margin: 20px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 5px;
    border-left: 4px solid #198754;
}

.patient-success-title {
    color: #198754;
    border-bottom: 1px solid #198754;
    padding-bottom: 5px;
    margin-bottom: 15px;
}

/* New patient choice cards */
.choice-card {
    border: 2px solid #198754;
    cursor: pointer;
    transition: all 0.3s;
}

.choice-icon-success {
    color: #198754;
}

/* === Module info collapse — toggle button in banner === */
.banner-info-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.92);
    color: #0d6efd;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.banner-info-toggle:hover {
    background: #fff;
    color: #0b5ed7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
}

.banner-info-toggle i {
    font-size: 0.9rem;
}

.module-info-collapse {
    position: fixed;
    top: 72px;
    right: 16px;
    max-width: 380px;
    z-index: 9999;
}

.module-info-collapse .module-info-card {
    background: #fff;
    border: 1px solid #bde0fe;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
    color: #084298;
    padding: 16px 18px;
    font-size: 0.82rem;
}

.module-info-collapse strong {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.modul-usage-list {
    margin: 0;
    padding: 0 0 0 8px;
    list-style: none;
}

.modul-usage-list li {
    font-size: 0.82rem;
    color: #475569;
    line-height: 1.5;
    padding: 3px 0 3px 16px;
    position: relative;
}

.modul-usage-list li::before {
    content: '\2022';
    position: absolute;
    left: 0;
    color: #94a3b8;
}

/* === Dashboard module info button (popover trigger) === */
.modul-info-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #94a3b8;
    font-size: 0.85rem;
    z-index: 5;
    transition: color 0.2s ease, background 0.2s ease;
}

.modul-info-btn:hover {
    color: #0d6efd;
    background: rgba(255, 255, 255, 1);
}

/* Loading spinner for submit buttons */
.btn-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 0.375rem;
}

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

.btn-loading {
    pointer-events: none;
    opacity: 0.75;
}