/* Wspólny styl dla wszystkich widoków aplikacji Kreator CRM */

/* Reset i podstawowe style */
* {
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    margin: 2rem;
    line-height: 1.5;
    color: #333;
    background-color: #fff;
    zoom: 0.8;
}

/* Typografia */
h1 {
    margin-bottom: 1rem;
    font-size: 1.8rem;
    font-weight: 600;
}

h2 {
    margin-bottom: 0.8rem;
    font-size: 1.4rem;
    font-weight: 600;
}

h3 {
    margin-bottom: 0.6rem;
    font-size: 1.2rem;
    font-weight: 600;
}

/* Toolbar i nawigacja */
.toolbar {
    margin-bottom: 1rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Nowe menu nawigacyjne */
.navbar {
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    padding: 0.75rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-container {
    width: 100%;
    margin: 0;
    padding: 0 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.navbar-brand {
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
    text-decoration: none;
    flex-shrink: 0;
}

.navbar-brand:hover {
    color: #007bff;
}

.navbar-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.navbar-nav li {
    margin: 0;
}

.navbar-nav a {
    display: block;
    padding: 0.5rem 0.65rem;
    color: #666;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 0.9rem;
    white-space: nowrap;
}

.navbar-nav a:hover {
    background: #f8f9fa;
    color: #333;
}

.navbar-nav a.active {
    background: #007bff;
    color: white;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.navbar-user-info {
    font-size: 0.85rem;
    color: #666;
}

.navbar-user-info strong {
    color: #333;
}

@media (max-width: 768px) {
    .navbar-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .navbar-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .navbar-user {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Tabele */
table {
    border-collapse: collapse;
    width: 100%;
    font-size: 14px;
    margin-bottom: 1rem;
}

th, td {
    border: 1px solid #ddd;
    padding: 0.5rem;
    text-align: left;
}

th {
    background-color: #f5f5f5;
    font-weight: 600;
}

th a {
    color: inherit;
    text-decoration: none;
    display: block;
    width: 100%;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

th a:hover {
    background-color: #e8e8e8;
}

tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.04);
}

/* Karty i boxy */
.card {
    max-width: 720px;
    margin: 0 auto;
    padding: 1.5rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
}

.card.full-width {
    max-width: none;
    width: 100%;
}

.box {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 1rem;
    background: #fff;
}

/* Grid i layout */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Przyciski i linki */
a.button, button.button {
    display: inline-block;
    padding: 0.4rem 0.6rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    text-decoration: none;
    background: #fff;
    color: #333;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

a.button:hover, button.button:hover {
    background: #f0f0f0;
}

button {
    padding: 0.4rem 0.6rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Formularze */
form.inline {
    display: inline;
}

input, select, textarea {
    padding: 0.3rem 0.4rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

/* Statusy i kolory */
.muted {
    color: #666;
}

.ok {
    color: #0b5;
}

.err {
    color: #b00020;
}

.status-nieprzypisane {
    color: #9E9E9E;
    font-style: italic;
}

.status-nowe {
    color: #2196F3;
}

.status-w-trakcie {
    color: #FF9800;
}

.status-do-spakowania {
    color: #8BC34A;
}

.status-wstrzymane {
    color: #F44336;
    font-weight: bold;
}

.status-do-wysylki {
    color: #4CAF50;
    font-weight: bold;
}

.status-gotowe-do-odbioru {
    color: #00BCD4;
    font-weight: bold;
}

.status-wyslane {
    color: #607D8B;
}

.status-anulowane {
    color: #9E9E9E;
    font-weight: 600;
    text-decoration: line-through;
}

/* Progress bar */
.progress-bar {
    width: 60px;
    background: #f0f0f0;
    border-radius: 3px;
    height: 20px;
    position: relative;
    margin: 0 auto;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-text {
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: #333;
}

/* Paginacja */
.pagination {
    margin-top: 1rem;
    text-align: center;
}

.pagination a {
    margin-right: 0.5rem;
    text-decoration: none;
    color: #007cba;
}

.pagination a:hover {
    text-decoration: underline;
}

.pagination strong {
    margin-right: 0.5rem;
    color: #333;
}

/* Obrazy i media */
img {
    max-width: 100%;
    height: auto;
}

.prints img {
    width: 80px;
    height: auto;
    border: 1px solid #eee;
    border-radius: 4px;
}

.print-image {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.print-thumb {
    display: block;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.print-thumb:hover {
    border-color: #007cba;
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.3);
    transform: scale(1.02);
}

.print-thumb img {
    display: block;
    border-radius: 4px;
}

.print-image a[style*="font-size: 0.75rem"] {
    transition: all 0.2s ease;
    cursor: pointer;
}

.print-image a[style*="font-size: 0.75rem"]:hover {
    color: #007cba !important;
    text-decoration: underline !important;
}

/* Specjalne layouty */
.prints-2x2 {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 15px;
    width: 100%;
}

.prints-2x2 .row {
    display: flex;
    gap: 1rem;
    align-items: stretch;
    justify-content: center;
    width: 100%;
}

/* Responsywność */
@media (max-width: 768px) {
    body {
        margin: 1rem;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
    
    .row {
        flex-direction: column;
    }
    
    table {
        font-size: 12px;
    }
    
    th, td {
        padding: 0.3rem;
    }
}

/* Utility classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

/* Style dla kategorii nadruków */
.print-category {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9em;
    text-align: center;
    min-width: 2rem;
}

.print-category-n {
    background-color: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.print-category-p {
    background-color: #f3e5f5;
    color: #7b1fa2;
    border: 1px solid #e1bee7;
}

.print-category-d {
    background-color: #e8f5e8;
    color: #388e3c;
    border: 1px solid #c8e6c9;
}

.print-category-d-przyg {
    background-color: #e8f5e8;
    color: #388e3c;
    border: 1px solid #c8e6c9;
}

.print-category-d-wg {
    background-color: #c8e6c9;
    color: #2e7d32;
    border: 1px solid #81c784;
}

.print-category-f {
    background-color: #fff3e0;
    color: #f57c00;
    border: 1px solid #ffcc02;
}

.print-category-f-przyg {
    background-color: #fff3e0;
    color: #f57c00;
    border: 1px solid #ffcc02;
}

.print-category-f-wg {
    background-color: #ffcc02;
    color: #e65100;
    border: 1px solid #ffb300;
}

.print-category-none {
    background-color: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
}

.print-category-nieprzypisane {
    background-color: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
}

/* Style dla statusu płatności */
.status-paid {
    color: #4CAF50;
    font-weight: 600;
}

.status-partially-paid {
    color: #ff9800;
    font-weight: 600;
}

.status-unpaid {
    color: #f44336;
    font-weight: 600;
}

/* Style dla alertów - DEPRECATED - użyj zamiast tego .notification */
.alert {
    padding: 0.75rem 1rem;
    margin: 0.5rem 0;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.alert-warning {
    color: #664d03;
    background-color: #fff3cd;
    border-color: #ffecb5;
}

.alert-danger, .alert-error {
    color: #842029;
    background-color: #f8d7da;
    border-color: #f5c2c7;
}

.alert-success {
    color: #0f5132;
    background-color: #d1e7dd;
    border-color: #badbcc;
}

.alert-info {
    color: #055160;
    background-color: #cff4fc;
    border-color: #b6effb;
}

/* Nowy system powiadomień - spójny z layoutem strony */
.notification {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    border-radius: 8px;
    border: 1px solid;
    font-size: 0.95rem;
    line-height: 1.5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: opacity 0.3s ease;
}

.notification-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
}

.notification-content {
    flex: 1;
}

.notification-content strong {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.notification-close {
    flex-shrink: 0;
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.notification-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
}

/* Typy powiadomień */
.notification-success {
    background-color: #d4edda;
    border: 2px solid #28a745;
    color: #155724;
    font-weight: 500;
}

.notification-success .notification-icon {
    color: #28a745;
    background: rgba(40, 167, 69, 0.15);
    font-size: 1.4rem;
}

.notification-error {
    background-color: #fee;
    border: 2px solid #dc3545;
    color: #721c24;
    font-weight: 500;
}

.notification-error .notification-icon {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.15);
    font-size: 1.4rem;
}

.notification-warning {
    background-color: #fff3cd;
    border: 2px solid #ffc107;
    color: #856404;
    font-weight: 500;
}

.notification-warning .notification-icon {
    color: #ffc107;
    background: rgba(255, 193, 7, 0.15);
    font-size: 1.4rem;
}

.notification-info {
    background-color: #ebf5fb;
    border-color: #85c1e9;
    color: #1b4f72;
}

.notification-info .notification-icon {
    color: #1b4f72;
    background: rgba(133, 193, 233, 0.3);
}

/* Responsywność */
@media (max-width: 768px) {
    .notification {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .notification-icon {
        width: 20px;
        height: 20px;
        font-size: 1rem;
    }
}

/* ============================================
   CONFIRMATION MODAL SYSTEM
   ============================================ */

/* Modal overlay */
.confirm-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    animation: fadeIn 0.2s ease-out;
}

.confirm-modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal container */
.confirm-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    animation: slideDown 0.3s ease-out;
    overflow: hidden;
}

/* Modal header */
.confirm-modal-header {
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.confirm-modal-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.confirm-modal-icon.warning {
    background-color: #fff3cd;
    color: #856404;
}

.confirm-modal-icon.danger {
    background-color: #f8d7da;
    color: #721c24;
}

.confirm-modal-icon.info {
    background-color: #d1ecf1;
    color: #0c5460;
}

.confirm-modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

/* Modal body */
.confirm-modal-body {
    padding: 1.75rem;
    color: #555;
    font-size: 1rem;
    line-height: 1.6;
}

.confirm-modal-body strong {
    color: #333;
    font-weight: 600;
}

/* Modal footer */
.confirm-modal-footer {
    padding: 1.25rem 1.75rem;
    background-color: #f8f9fa;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    border-top: 1px solid #e9ecef;
}

.confirm-modal-button {
    padding: 0.625rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.confirm-modal-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.confirm-modal-button:active {
    transform: translateY(0);
}

.confirm-modal-button.btn-cancel {
    background-color: #6c757d;
    color: white;
}

.confirm-modal-button.btn-cancel:hover {
    background-color: #5a6268;
}

.confirm-modal-button.btn-confirm {
    background-color: #007bff;
    color: white;
}

.confirm-modal-button.btn-confirm:hover {
    background-color: #0056b3;
}

.confirm-modal-button.btn-confirm.danger {
    background-color: #dc3545;
}

.confirm-modal-button.btn-confirm.danger:hover {
    background-color: #c82333;
}

.confirm-modal-button.btn-confirm.warning {
    background-color: #ffc107;
    color: #212529;
}

.confirm-modal-button.btn-confirm.warning:hover {
    background-color: #e0a800;
}

/* Secondary button (used across pipeline, docs, etc.) */
.btn-secondary {
    display: inline-block;
    padding: 0.4rem 0.85rem;
    background: #6c757d;
    color: #fff;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-secondary:hover {
    background: #5a6268;
    color: #fff;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive */
@media (max-width: 600px) {
    .confirm-modal {
        width: 95%;
        max-width: none;
    }

    .confirm-modal-header,
    .confirm-modal-body,
    .confirm-modal-footer {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .confirm-modal-footer {
        flex-direction: column;
    }

    .confirm-modal-button {
        width: 100%;
        justify-content: center;
    }
}
