/* Apoteka modul — akcenti + magacin tabela (BEZ vodoravnog scroll-a) */

#app-wrapper:has(.mf-apoteka) .infopult-sidebar {
    background:
        radial-gradient(circle at top left, rgba(16, 185, 129, .22), transparent 210px),
        linear-gradient(180deg, #134e4a 0%, #0f3e3a 55%, #0a2e2a 100%);
}

#app-wrapper:has(.mf-apoteka) .sidebar-glass-title h5 {
    color: #6ee7b7;
}

.mf-apoteka .infopult-card {
    border-left: 3px solid var(--mf-c1, #0f766e);
}

.mf-apoteka .infopult-card .card-header h5 {
    font-size: var(--mcl-font-sm, 0.875rem);
    font-weight: 700;
}

.mf-apoteka .infopult-card .card-body .form-label {
    font-size: var(--mcl-font-xs, 0.8125rem);
    font-weight: 600;
    margin-bottom: var(--mcl-filter-label-gap, 7px);
}

.mf-apoteka .page-banner-pill {
    background: rgba(255, 255, 255, .18);
}

.apoteka-legend-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.apoteka-legend-none {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

.apoteka-legend-low {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

.apoteka-legend-ok {
    background: #d1fae5;
    color: #065f46;
    border-color: #a7f3d0;
}

.mf-apoteka #magacinTable tbody tr.apoteka-row-none,
.mf-apoteka .apoteka-magacin-table tbody tr.apoteka-row-none {
    background-color: #fee2e2;
}

.mf-apoteka #magacinTable tbody tr.apoteka-row-none:hover,
.mf-apoteka .apoteka-magacin-table tbody tr.apoteka-row-none:hover {
    background-color: #fecaca;
}

.mf-apoteka #magacinTable tbody tr.apoteka-row-low,
.mf-apoteka .apoteka-magacin-table tbody tr.apoteka-row-low {
    background-color: #fef3c7;
}

.mf-apoteka #magacinTable tbody tr.apoteka-row-low:hover,
.mf-apoteka .apoteka-magacin-table tbody tr.apoteka-row-low:hover {
    background-color: #fde68a;
}

.mf-apoteka #magacinTable tbody tr.apoteka-row-ok,
.mf-apoteka .apoteka-magacin-table tbody tr.apoteka-row-ok {
    background-color: #ecfdf5;
}

.mf-apoteka #magacinTable tbody tr.apoteka-row-ok:hover,
.mf-apoteka .apoteka-magacin-table tbody tr.apoteka-row-ok:hover {
    background-color: #d1fae5;
}

/* Tabele — 100% širina, bez horizontalnog scroll-a */
.mf-apoteka .apoteka-table-wrap {
    overflow-x: hidden !important;
    overflow-y: auto;
    max-width: 100%;
}

.mf-apoteka .apoteka-magacin-table {
    table-layout: fixed !important;
    width: 100% !important;
    min-width: 0 !important;
    margin-bottom: 0;
    border-collapse: collapse;
}

.mf-apoteka .apoteka-magacin-table th,
.mf-apoteka .apoteka-magacin-table td {
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    vertical-align: middle;
    padding: 0.65rem 0.75rem !important;
    font-size: var(--mcl-font-sm, 0.875rem);
    line-height: 1.45;
    max-width: none !important;
}

.mf-apoteka .apoteka-magacin-table thead th {
    font-size: var(--mcl-font-xs, 0.8125rem);
    font-weight: 700;
    letter-spacing: 0.03em;
    background-color: #f1f5f9;
}

.mf-apoteka .apoteka-magacin-table td.apoteka-naziv,
.mf-apoteka .apoteka-magacin-table th:nth-child(2) {
    min-width: 8rem;
    max-width: 16rem;
}

.mf-apoteka .apoteka-magacin-table td.text-end,
.mf-apoteka .apoteka-magacin-table th.text-end,
.mf-apoteka .apoteka-magacin-table .mcl-col-actions {
    white-space: nowrap !important;
}

.mf-apoteka .apoteka-magacin-table .apoteka-serija-missing {
    color: #b91c1c;
    font-weight: 700;
}

.mf-apoteka .apoteka-magacin-table th.apoteka-col-required::after {
    content: ' *';
    color: #b91c1c;
    font-weight: 700;
}

.apoteka-cat-table .cat-name-input {
    max-width: 100%;
    font-size: .85rem;
}

.apoteka-cat-table .cat-save-btn,
.apoteka-cat-table .cat-delete-btn {
    white-space: nowrap;
    flex-shrink: 0;
}

.apoteka-cat-table .cat-sort-input {
    width: 70px;
    font-size: .85rem;
    text-align: center;
}

.mf-apoteka .apoteka-fak-row {
    cursor: pointer;
}

.mf-apoteka .apoteka-fak-row:hover {
    background-color: #ecfdf5;
}

.mf-apoteka .btn-fak-stavke {
    font-weight: 600;
    text-decoration: none;
    color: #0f766e;
}

.mf-apoteka .btn-fak-stavke:hover {
    text-decoration: underline;
    color: #134e4a;
}

.mf-apoteka .apoteka-form-card .apoteka-form-actions {
    display: flex;
    justify-content: flex-start;
    gap: 0.5rem;
}

.mf-apoteka .apoteka-search-hits {
    max-height: 220px;
    overflow-y: auto;
    border-radius: 0.375rem;
    box-shadow: 0 4px 12px rgba(19, 78, 74, 0.12);
}

.mf-apoteka .apoteka-search-hits .list-group-item {
    border-left: none;
    border-right: none;
    font-size: var(--mcl-font-sm, 0.875rem);
}

.mf-apoteka .apoteka-search-hits .list-group-item:first-child {
    border-top: none;
}

.mf-apoteka .apoteka-scan-input-group .btn {
    white-space: nowrap;
    font-size: var(--mcl-font-xs, 0.8125rem);
}

/* Skeniraj + Kamera u jednom redu (modal je u body — van .mf-apoteka) */
.apoteka-scan-input-group {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    width: 100%;
    gap: 0.5rem;
}

.apoteka-scan-input-group .form-control {
    flex: 1 1 auto;
    width: auto !important;
    min-width: 0;
}

.apoteka-scan-field .apoteka-scan-input-group .btn,
.apoteka-scan-input-group .apoteka-scan-btn,
.apoteka-scan-input-group .apoteka-camera-btn {
    width: auto !important;
    flex: 0 0 auto;
    border-radius: 8px !important;
}

/* Modal Dodaj stavku — kompaktno, 2 / 3 / 4 polja u redu (bez širenja) */
#modalDodajMagacin .modal-body {
    padding: 1rem 1.15rem;
}

#modalDodajMagacin .apoteka-modal-fields {
    display: block;
}

#modalDodajMagacin .form-label {
    font-size: 0.78rem;
    margin-bottom: 0.2rem;
}

#modalDodajMagacin .form-control,
#modalDodajMagacin .form-select,
#modalDodajMagacin .input-group-text {
    min-height: 2.125rem !important;
    padding: 0.3rem 0.55rem !important;
    font-size: 0.8125rem;
    border-radius: 8px;
    border-color: rgba(6, 182, 212, 0.12);
}

#modalDodajMagacin .apoteka-scan-input-group .form-control {
    border-radius: 8px;
}

#modalDodajMagacin .apoteka-scan-input-group .apoteka-scan-btn {
    border-radius: 8px;
}

#modalDodajMagacin .input-group:not(.apoteka-scan-input-group)>.form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

#modalDodajMagacin .input-group:not(.apoteka-scan-input-group)>.input-group-text {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

#modalDodajMagacin .border.rounded.p-3 {
    border-radius: 12px !important;
}

#modalDodajMagacin .border.rounded.p-3 .input-group .btn {
    width: auto !important;
    min-height: 2.125rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    border-radius: 8px;
}

.mf-apoteka .apoteka-form-card .form-control,
.mf-apoteka .apoteka-form-card .form-select {
    border-radius: 8px;
    border-color: rgba(6, 182, 212, 0.12);
}

.mf-apoteka .apoteka-scan-video {
    max-height: 280px;
    object-fit: cover;
    background: #000;
}

.mf-apoteka .apoteka-scan-status {
    min-height: 1.25rem;
}