/* ==================== SHARED COMPONENT STYLES ==================== */
/* Styles used across multiple components */

/* Modern Modals */
.modal-modern .modal-content {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

.modal-modern .modal-header {
    background-image: var(--gradient-header);
    color: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
  padding: 1.5rem;
    border-bottom: none;
}

.modal-modern .modal-title {
    font-weight: 700;
    font-size: 1.25rem;
}

.modal-modern .btn-close {
    filter: brightness(0) invert(1);
}

.modal-modern .modal-body {
    padding: 2rem;
    max-height: calc(100vh - 250px);
    overflow-y: auto;
}

    .modal-modern .modal-body::-webkit-scrollbar {
        width: 8px;
    }

    .modal-modern .modal-body::-webkit-scrollbar-track {
      background: #f1f1f1;
        border-radius: 10px;
    }

    .modal-modern .modal-body::-webkit-scrollbar-thumb {
 background-image: var(--gradient-primary);
        border-radius: 10px;
    }

        .modal-modern .modal-body::-webkit-scrollbar-thumb:hover {
        background: var(--global-palette1);
        }

.modal-modern .modal-footer {
    padding: 1.5rem 2rem;
 border-top: 1px solid #f0f0f0;
}

.modal-modern.modal-scrollable .modal-dialog {
    max-height: calc(100vh - 3.5rem);
}

.modal-modern.modal-scrollable .modal-content {
    max-height: calc(100vh - 3.5rem);
    display: flex;
 flex-direction: column;
}

.modal-modern.modal-scrollable .modal-body {
    overflow-y: auto;
    flex: 1 1 auto;
}

.modal-backdrop-modern {
    background-color: rgba(0, 146, 68, 0.2);
    backdrop-filter: blur(4px);
}

/* Modern Form Controls */
.form-label-modern {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-control-modern {
 border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

    .form-control-modern:focus {
      border-color: var(--global-palette1);
        box-shadow: 0 0 0 0.2rem rgba(0, 146, 68, 0.15);
    }

.form-select-modern {
  border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

    .form-select-modern:focus {
        border-color: var(--global-palette1);
        box-shadow: 0 0 0 0.2rem rgba(0, 146, 68, 0.15);
    }

.form-check-modern .form-check-input {
    width: 1.25rem;
height: 1.25rem;
    border: 2px solid #e0e0e0;
    transition: all 0.2s ease;
}

    .form-check-modern .form-check-input:checked {
        background-color: var(--global-palette1);
        border-color: var(--global-palette1);
  }

.form-check-modern .form-check-label {
    font-weight: 500;
    margin-left: 0.5rem;
}

/* Modern Badges */
.badge-modern {
    padding: 0.3rem 0.65rem;
    border-radius: 16px;
    font-weight: 500;
    font-size: 0.75rem;
    white-space: nowrap;
}

.badge-sku {
    background-color: white;
    color: var(--global-palette1);
    border: 2px solid white;
}

.badge-supplier {
    background-color: rgba(255,255,255,0.3);
    color: white;
    border: 1px solid rgba(255,255,255,0.5);
}

.badge-ean {
    background-color: rgba(255,255,255,0.4);
    color: white;
    border: 1px solid rgba(255,255,255,0.6);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.badge-ean-primary {
    background-color: var(--global-palette1);
    color: white;
    font-size: 0.95rem;
    padding: 0.4rem 0.85rem;
    display: inline-flex;
    align-items: center;
 gap: 0.3rem;
}

.badge-ean-additional {
    background-color: #17a2b8;
    color: white;
}

.badge-barcode {
    background-color: #17a2b8;
    color: white;
}

.badge-location {
    background-color: var(--global-palette1);
    color: white;
  font-size: 0.95rem;
 padding: 0.4rem 0.85rem;
}

.badge-additional-location {
    background-color: #17a2b8;
    color: white;
}

.badge-size {
    background-color: #6c757d;
    color: white;
}

.badge-role {
    background-color: #007bff;
    color: white;
}

.badge-warehouse {
    background-color: #28a745;
    color: white;
}

.badge-settings-yes {
    background-color: #17a2b8;
    color: white;
}

.badge-settings-no {
    background-color: #6c757d;
    color: white;
}

/* Modern Alerts */
.alert-modern {
    border: none;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-sm);
}

    .alert-modern.alert-success {
        background-color: #d4edda;
        color: #155724;
    }

    .alert-modern.alert-danger {
  background-color: #f8d7da;
        color: #721c24;
    }

    .alert-modern.alert-warning {
      background-color: #fff3cd;
        color: #856404;
    }

    .alert-modern.alert-info {
        background-color: #d1ecf1;
  color: #0c5460;
    }

/* Modern Buttons */
.btn-modern {
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

    .btn-modern:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }

/* Action Buttons */
.btn-action-group {
    display: flex;
    gap: 0.5rem;
}

.btn-action {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-action-settings {
  background-color: #009244;
    color: white;
    border: none;
}

    .btn-action-settings:hover {
        background-color: #007a38;
      transform: translateY(-1px);
   box-shadow: var(--shadow-sm);
    }

.btn-action-password {
    background-color: #f39c12;
    color: white;
    border: none;
}

    .btn-action-password:hover {
        background-color: #e67e22;
        transform: translateY(-1px);
        box-shadow: var(--shadow-sm);
    }

.btn-action-delete {
    background-color: #e74c3c;
    color: white;
    border: none;
}

  .btn-action-delete:hover {
        background-color: #c0392b;
        transform: translateY(-1px);
        box-shadow: var(--shadow-sm);
    }

.btn-action-edit {
    background-color: var(--global-palette1);
    color: white;
  border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
 transition: all 0.2s ease;
}

    .btn-action-edit:hover {
        background-color: #007a38;
        transform: translateY(-1px);
        box-shadow: var(--shadow-sm);
        color: white;
    }

/* Section Styles */
.section-divider {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--global-palette1), transparent);
    margin: 1.5rem 0;
}

.section-title {
    font-weight: 700;
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.settings-grid {
    display: grid;
    gap: 1rem;
}

/* ============================================
   BADGE STYLES - Badge components
   ============================================ */
.badge-modern {
    font-weight: 600;
    padding: 0.35em 0.65em;
    border-radius: 0.25rem;
}

.badge-location {
    background-color: #0d6efd;
    color: white;
}

.badge-additional-location {
    background-color: #6c757d;
    color: white;
}

.badge-ean-primary {
    background-color: #198754;
    color: white;
}

.badge-ean-additional {
    background-color: #0dcaf0;
    color: #000;
}

.badge-size {
    background-color: #fd7e14;
    color: white;
}

.badge-warning {
    background-color: #ffc107;
    color: #000;
}

.badge-success {
    background-color: #198754;
    color: white;
}

.badge-info {
    background-color: #0dcaf0;
    color: #000;
}

/* ============================================
   TOAST NOTIFICATION STYLES
   ============================================ */
.toast-container {
    z-index: 9999 !important;
}

.toast {
    min-width: 300px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-header {
    font-weight: 600;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.toast-body {
    white-space: pre-line;
    word-wrap: break-word;
}

.toast-success .toast-header {
    background-color: #198754;
    color: white;
}

.toast-error .toast-header {
    background-color: #dc3545;
    color: white;
}

.toast-warning .toast-header {
    background-color: #ffc107;
    color: #000;
}

.toast-info .toast-header {
    background-color: #0dcaf0;
    color: #000;
}

.btn-close-white {
    filter: brightness(0) invert(1);
}


/* ==================== OPEN/DETAIL BUTTON (lists) ==================== */
/* Piękny przycisk wejścia w szczegóły — używany w listach (PZ, dostawy, ...) */
.btn-open-detail {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.4rem 0.95rem;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    background: linear-gradient(135deg, var(--global-palette4) 0%, var(--global-palette5) 100%);
    border: none;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(2, 44, 50, 0.25), 0 1px 2px rgba(0,0,0,0.05);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
    cursor: pointer;
    white-space: nowrap;
}

.btn-open-detail:hover,
.btn-open-detail:focus {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35), 0 2px 4px rgba(0,0,0,0.08);
    filter: brightness(1.05);
    outline: none;
}

.btn-open-detail:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}

.btn-open-detail i {
    font-size: 0.95rem;
    transition: transform 0.2s ease;
}

.btn-open-detail:hover i {
    transform: translateX(2px);
}

/* Mobile: tylko ikona, bez tekstu */
@media (max-width: 575.98px) {
    .btn-open-detail {
        padding: 0.45rem 0.65rem;
        gap: 0;
    }
    .btn-open-detail > span {
        display: none;
    }
    .btn-open-detail i {
        font-size: 1.05rem;
    }
}

/* Szerokość kolumny "Akcja" w listach z btn-open-detail */
.th-action-open {
    width: 110px;
}
@media (max-width: 575.98px) {
    .th-action-open {
        width: 56px;
    }
}

/* ===== Sticky TOC fix for /admin/settings =====
   <main> has overflow-x:auto which creates a scroll container and breaks
   position:sticky on descendants. Override only when the page contains
   .settings-page so other pages keep horizontal overflow handling.
   !important needed because Blazor CSS isolation scopes main in
   MainLayout.razor.css with equal specificity but loads after this file. */
main:has(.settings-page) {
    overflow-x: visible !important;
    overflow-y: visible !important;
}
.page:has(.settings-page) {
    overflow: visible !important;
}