/* ===== Podstawowe style ===== */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e7eb 100%);
    min-height: 100vh;
}

/* ===== Modern NavBar ===== */
.navbar-dark {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
}

.navbar-brand {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-link {
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem !important;
    margin: 0 0.25rem;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.25) !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border-bottom: 3px solid white;
}

.btn-outline-light {
    border: 2px solid white !important;
    font-weight: 600 !important;
    border-radius: 0.5rem !important;
    transition: all 0.3s ease !important;
}

.btn-outline-light:hover {
    background: white !important;
    color: #667eea !important;
    transform: translateY(-2px);
}

h1 {
    color: #212529;
    margin-bottom: 1.5rem;
}

h1:focus {
    outline: none;
}

/* ===== Formularze i walidacja ===== */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

/* ===== Błędy Blazor ===== */
.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

/* ===== Checkboxy ===== */
.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

input[type="checkbox"] {
    cursor: pointer;
    width: 1.2rem;
    height: 1.2rem;
}

/* ===== Modern Cards ===== */
.card {
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
    border-radius: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom: none;
    font-weight: 700;
    padding: 1.25rem 1.5rem;
    border-radius: 1rem 1rem 0 0;
}

.card-header h5 {
    color: white;
    margin: 0;
    font-size: 1.1rem;
}

.card-body {
    padding: 1.5rem;
}

/* ===== Modern Tables ===== */
.table {
    background-color: white;
    border-radius: 0.5rem;
    overflow: hidden;
}

.table thead th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid #667eea;
    font-weight: 700;
    white-space: nowrap;
    color: #495057;
    padding: 1rem;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: #f8f9fa;
}

.table-hover tbody tr {
    transition: all 0.2s ease;
}

.table-hover tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.08);
    transform: scale(1.01);
}

.table tbody td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
}

/* ===== Modern Alerts ===== */
.alert {
    border: none;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

/* ===== Modern Buttons ===== */
.btn {
    font-weight: 600;
    border-radius: 0.5rem;
    padding: 0.625rem 1.25rem;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 6px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8b 100%);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    box-shadow: 0 4px 6px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268 0%, #4e555b 100%);
    box-shadow: 0 6px 12px rgba(108, 117, 125, 0.4);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    box-shadow: 0 4px 6px rgba(220, 53, 69, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    box-shadow: 0 6px 12px rgba(220, 53, 69, 0.4);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.875rem;
}

/* ===== Modern Forms ===== */
.form-control, .form-select {
    border: 2px solid #e0e6ed;
    border-radius: 0.5rem;
    padding: 0.625rem 0.875rem;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

/* ===== Spinner ===== */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* ===== Modal ===== */
.modal.show {
    display: block;
}

/* ===== Kafelki zadań ===== */
.company-card {
    margin-bottom: 2rem;
}

.company-card .card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 1.5rem;
}

.company-card .card-header h5 {
    color: white;
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
}

.company-card .card-header .badge {
    font-size: 1rem;
    padding: 0.5rem 0.75rem;
}

.task-tile {
    display: flex;
    align-items: center;
    padding: 1.25rem;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 100px;
}

.task-tile:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.task-tile.completed {
    background: #f0fdf4;
    border-color: #22c55e;
}

.task-tile.completed:hover {
    border-color: #16a34a;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

.task-tile-icon {
    font-size: 2.5rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

.task-tile-icon .bi-check-circle-fill {
    color: #22c55e;
}

.task-tile-icon .bi-circle {
    color: #d1d5db;
}

.task-tile-content {
    flex: 1;
}

.task-tile-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.task-tile-step {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.task-tile-date {
    font-size: 0.75rem;
    color: #9ca3af;
    font-style: italic;
}

/* ===== Grid układowy dla tasków ===== */
.accounting-table-container {
    max-height: calc(100vh - 250px);
    overflow-x: auto;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    position: relative;
}

.accounting-grid {
    margin-bottom: 0;
    table-layout: auto;
    width: 100%;
    min-width: max-content;
    overflow: visible !important;
}

.accounting-grid thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #f8f9fa;
}

.accounting-grid thead tr {
    background-color: #f8f9fa;
}

.accounting-grid thead th {
    background-color: #f8f9fa !important;
    vertical-align: middle;
    font-size: 1.1rem;
    font-weight: 700;
    border-bottom: 2px solid #dee2e6 !important;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.accounting-grid .order-col {
    width: 70px;
}

/* Kolumna Segregator - pierwsza kolumna */
.accounting-grid th:first-child,
.accounting-grid td:first-child {
    width: 50px;
    min-width: 50px;
    max-width: 50px;
}

/* Kolumna Firma - druga kolumna */
.accounting-grid th:nth-child(2),
.accounting-grid td:nth-child(2) {
    width: 150px;
    min-width: 150px;
    max-width: 150px;
}

.accounting-grid .task-col {
    font-weight: 600;
    color: #667eea;
    transition: background-color 0.3s ease;
    white-space: nowrap;
    padding: 0.5rem 0.25rem;
    width: 110px;
    min-width: 110px;
    max-width: 110px;
}

.accounting-grid .task-col.task-completed {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
}

.accounting-grid .actions-col {
    width: 80px;
}

.accounting-grid .task-cell {
    padding: 0.25rem;
    vertical-align: top;
    width: 110px;
    min-width: 110px;
    max-width: 110px;
}

.task-tile-mini {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.25rem;
    background: #fef2f2;
    border: 2px solid #ef4444;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    margin-bottom: 0.25rem;
    height: 70px;
    min-height: 70px;
    max-height: 70px;
    box-sizing: border-box;
}

.task-tile-mini:last-child {
    margin-bottom: 0;
}

.task-tile-mini:hover {
    border-color: #dc2626;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.task-tile-mini > div:first-child {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    overflow: hidden;
    min-width: 0;
}

.task-tile-mini.completed {
    background: #f0fdf4;
    border-color: #22c55e;
}

.task-tile-mini.completed:hover {
    border-color: #16a34a;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.2);
}

.task-tile-mini.disabled {
    background: #f3f4f6;
    border-color: #9ca3af;
    opacity: 0.6;
}

.task-tile-mini.disabled:hover {
    border-color: #6b7280;
    box-shadow: 0 2px 8px rgba(156, 163, 175, 0.2);
}

.task-tile-mini-icon {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.task-tile-mini-icon .bi-check-circle-fill {
    color: #22c55e;
}

.task-tile-mini-icon .bi-circle {
    color: #ef4444;
}

.task-tile-mini-icon .bi-slash-circle {
    color: #9ca3af;
}

.task-tile-mini-step {
    font-size: 0.7rem;
    color: #6b7280;
    text-align: center;
    line-height: 1.1;
    margin-top: 0.15rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.task-tile-mini-date {
    font-size: 0.6rem;
    color: #9ca3af;
    text-align: center;
    line-height: 1;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.task-tile-mini-user {
    font-size: 0.55rem;
    color: #6b7280;
    line-height: 1;
    text-align: center;
    font-weight: 500;
    margin-top: 0.1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* ===== Info Button with Unread Notes ===== */
.info-btn {
    font-size: 1.2rem;
    color: #6c757d;
    padding: 0.25rem 0.4rem;
    position: relative;
    transition: all 0.2s ease;
}

.info-btn:hover {
    color: #495057;
}

.info-btn.has-unread {
    color: #ffc107 !important;
    animation: pulse-unread 1.5s infinite;
    background: rgba(255, 193, 7, 0.15);
    border-radius: 50%;
}

.info-btn.has-unread:hover {
    color: #e0a800 !important;
    background: rgba(255, 193, 7, 0.25);
}

.info-btn.has-unread i {
    filter: drop-shadow(0 0 4px rgba(255, 193, 7, 0.8));
}

.unread-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #dc3545;
    color: white;
    font-size: 0.65rem;
    font-weight: bold;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 2px solid white;
}

@keyframes pulse-unread {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.4);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 0 8px 2px rgba(255, 193, 7, 0.6);
    }
}

/* ===== Dashboard Styles ===== */

/* Task Progress Tiles - Horizontal Layout */
.task-tiles-horizontal {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    align-items: stretch;
}

.task-tile-dashboard {
    flex: 1 1 0;
    padding: 0.75rem 0.5rem;
    border-radius: 0.5rem;
    color: white;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    min-height: 80px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.task-tile-dashboard:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.task-tile-overall {
    flex: 2 1 0;
}

.task-tile-overall .task-tile-dashboard-name {
    font-weight: 800 !important;
    font-size: 0.8rem !important;
}

.task-tile-overall .task-tile-dashboard-percent {
    font-weight: 800 !important;
    font-size: 0.75rem !important;
}

.task-tile-dashboard-icon {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
    opacity: 0.95;
}

.task-tile-dashboard-name {
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
    line-height: 1.2;
    opacity: 0.95;
}

.task-tile-dashboard-percent {
    font-size: 0.7rem;
    font-weight: 600;
    opacity: 0.9;
}

/* Old inline styles */
.task-tile-inline {
    flex: 0 0 auto;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    color: white;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-block;
    min-width: auto;
    max-width: fit-content;
}

.task-tile-inline:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Old Grid Styles - Kept for backward compatibility */
.task-tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.task-tile-compact {
    padding: 1.25rem;
    border-radius: 0.75rem;
    color: white;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.task-tile-compact:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.task-tile-name {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    opacity: 0.95;
}

.task-tile-percentage {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.task-tile-count {
    font-size: 0.85rem;
    opacity: 0.9;
}

.overall-progress-tile {
    padding: 1.5rem;
    border-radius: 0.75rem;
    color: white;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.overall-label {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.overall-percentage {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.overall-details {
    font-size: 1rem;
    opacity: 0.95;
}

/* Activity Log */
.activity-log-container {
    max-height: calc(100vh - 350px);
    min-height: 300px;
    overflow-y: auto;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    padding: 1rem;
    background: white;
    border-left: 4px solid #6c757d;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.activity-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateX(4px);
}

.activity-item.activity-completed {
    border-left-color: #22c55e;
    background: #f0fdf4;
}

.activity-item.activity-uncompleted {
    border-left-color: #f97316;
    background: #fff7ed;
}

.activity-item.activity-note {
    border-left-color: #3b82f6;
    background: #eff6ff;
}

.activity-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 1rem;
}

.activity-content {
    flex: 1;
}

.activity-header {
    margin-bottom: 0.25rem;
}

.activity-description {
    font-size: 0.9rem;
    color: #4b5563;
    margin-bottom: 0.25rem;
}

.activity-timestamp {
    font-size: 0.8rem;
}

/* Chat Styles */
.chat-card {
    height: calc(100vh - 200px);
    max-height: 800px;
    display: flex;
    flex-direction: column;
}

.chat-card .card-body {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.chat-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

/* Chat Full Height - for Dashboard */
.chat-card-full {
    height: calc(100vh - 200px);
    max-height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
}

.chat-card-full .card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    padding: 0;
}

.chat-messages-container-full {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    min-height: 0;
}

.chat-message {
    margin-bottom: 1rem;
    max-width: 80%;
}

.chat-message-own {
    margin-left: auto;
}

.chat-message-other {
    margin-right: auto;
}

.chat-message-header {
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
}

.chat-message-own .chat-message-header {
    text-align: right;
}

.chat-message-body {
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    word-wrap: break-word;
}

.chat-message-own .chat-message-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 0.25rem;
}

.chat-message-other .chat-message-body {
    background: white;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 0.25rem;
}

.chat-input-container {
    padding: 1rem;
    background: white;
    border-top: 1px solid #dee2e6;
}

.chat-input-container .input-group {
    display: flex;
}

.chat-input-container .form-control {
    border-radius: 1.5rem 0 0 1.5rem;
    border-right: none;
}

.chat-input-container .btn {
    border-radius: 0 1.5rem 1.5rem 0;
    padding: 0.5rem 1.5rem;
}

/* ===== Responsywność ===== */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
    }

    input[type="checkbox"] {
        width: 1rem;
        height: 1rem;
    }

    .task-tile {
        padding: 1rem;
        min-height: 80px;
    }

    .task-tile-icon {
        font-size: 2rem;
        margin-right: 0.75rem;
    }

    .task-tile-name {
        font-size: 1rem;
    }

    .accounting-grid th:first-child,
    .accounting-grid td:first-child {
        width: 50px;
        min-width: 50px;
        max-width: 50px;
    }

    .accounting-grid th:nth-child(2),
    .accounting-grid td:nth-child(2) {
        width: 150px;
        min-width: 150px;
        max-width: 150px;
    }

    .accounting-grid .task-col {
        font-size: 0.75rem;
    }

    .task-tile-mini {
        padding: 0.5rem 0.25rem;
        min-height: 50px;
    }

    .task-tile-mini-icon {
        font-size: 1.25rem;
    }

    .task-tile-mini-step {
        font-size: 0.65rem;
    }

    .task-tile-mini-date {
        font-size: 0.6rem;
    }
}

/* Tytuł widoczny tylko podczas druku */
.print-only-title {
    display: none;
}

/* ===== Modern Home Page Styles ===== */
.home-page {
    padding-top: 0;
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 1.25rem;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
}

.page-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.page-title-section {
    color: white;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-title i {
    font-size: 1.5rem;
    opacity: 0.9;
}

.page-subtitle {
    margin: 0.25rem 0 0 0;
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 500;
}

.page-actions {
    display: flex;
    gap: 1.5rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.action-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.action-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.action-label i {
    font-size: 0.8rem;
}

.modern-select {
    min-width: 180px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid transparent;
    border-radius: 0.75rem;
    padding: 0.6rem 1rem;
    font-weight: 600;
    color: #4a5568;
    transition: all 0.3s ease;
}

.modern-select:focus {
    border-color: white;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.25);
    background: white;
}

.btn-group-modern {
    display: flex;
    gap: 0.5rem;
}

.btn-modern {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-config {
    background: rgba(255, 255, 255, 0.95);
    color: #667eea;
}

.btn-config:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-config-alt {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-color: rgba(255, 255, 255, 0.4);
}

.btn-config-alt:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: white;
    transform: translateY(-2px);
}

.export-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.scale-select {
    width: 80px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid transparent;
    border-radius: 0.75rem;
    padding: 0.6rem 0.75rem;
    font-weight: 600;
    color: #4a5568;
}

.scale-select:focus {
    border-color: white;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.25);
}

.btn-export {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.btn-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
    color: white;
}

/* Data Card */
.data-card {
    border-radius: 1rem;
    overflow: visible;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.data-card:hover {
    transform: none;
}

.data-card .card-body {
    overflow: visible;
    padding: 0;
}

/* Empty State */
.empty-state-card {
    background: white;
    border-radius: 1.25rem;
    padding: 4rem 2rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.empty-state-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8eeff 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state-icon i {
    font-size: 3rem;
    color: #667eea;
    opacity: 0.8;
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.empty-state-description {
    color: #6b7280;
    font-size: 1rem;
    margin-bottom: 2rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.empty-state-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.35);
}

.btn-primary-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.45);
    color: white;
}

.btn-outline-primary {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline-primary:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

/* Modern Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-modern {
    background: white;
    border-radius: 1.25rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-modern.modal-lg {
    width: 100%;
    max-width: 800px;
}

.modal-header-modern {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.modal-header-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-header-icon i {
    font-size: 1.5rem;
    color: white;
}

.modal-header-text {
    flex: 1;
}

.modal-title-modern {
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.modal-subtitle-modern {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.875rem;
    margin: 0.25rem 0 0 0;
}

.modal-close-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 0.5rem;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.modal-body-modern {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer-modern {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.btn-secondary-modern {
    background: #6c757d;
    color: white;
}

.btn-secondary-modern:hover {
    background: #5a6268;
    color: white;
    transform: translateY(-1px);
}

.section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title i {
    color: #667eea;
}

/* Responsive adjustments for page header */
@media (max-width: 992px) {
    .page-header-content {
        flex-direction: column;
        align-items: stretch;
    }

    .page-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 576px) {
    .page-header {
        padding: 1.25rem;
    }

    .page-title {
        font-size: 1.35rem;
    }

    .page-actions {
        flex-direction: column;
        gap: 1rem;
    }

    .action-group {
        width: 100%;
    }

    .modern-select {
        width: 100%;
    }

    .btn-group-modern {
        width: 100%;
    }

    .btn-group-modern .btn-modern {
        flex: 1;
    }

    .export-controls {
        width: 100%;
    }

    .export-controls .btn-export {
        flex: 1;
    }
}

/* ===== Print Styles ===== */
@media print {
    /* Ukryj elementy niepotrzebne podczas drukowania */
    .navbar,
    .btn,
    button,
    .card-header,
    .no-print,
    #blazor-error-ui {
        display: none !important;
    }

    /* Pokaż tytuł tylko podczas druku */
    .print-only-title {
        display: block !important;
        text-align: center;
        margin-bottom: 0.2rem;
        padding: 0.1rem 0;
        border-bottom: 0.5pt solid #000;
    }

    .print-only-title h2 {
        font-size: 9pt;
        font-weight: bold;
        margin: 0;
    }

    /* Ustawienia strony */
    @page {
        size: landscape;
        margin: 0.3cm;
    }

    body {
        background: white !important;
        margin: 0;
        padding: 0;
        transform: scale(0.65);
        transform-origin: top left;
        width: 154%;
    }

    .container-fluid {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0;
    }

    /* Tabela księgowa */
    .card {
        box-shadow: none !important;
        border: none !important;
        margin: 0 !important;
        page-break-inside: avoid;
    }

    .card-body {
        padding: 0 !important;
    }

    .accounting-header-table-container,
    .accounting-body-table-container {
        border: none !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .accounting-grid {
        width: 100% !important;
        border-collapse: collapse !important;
        font-size: 4pt !important;
    }

    .accounting-grid th,
    .accounting-grid td {
        border: 0.5pt solid #666 !important;
        padding: 0.5pt !important;
        font-size: 4pt !important;
        line-height: 1 !important;
        white-space: nowrap !important;
    }

    .accounting-grid thead th {
        background-color: #e8e8e8 !important;
        font-weight: bold !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    .task-tile-mini {
        border-width: 0.5pt !important;
        page-break-inside: avoid;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
        font-size: 0pt !important;
        padding: 0 !important;
        margin: 0.5pt !important;
        min-width: 8pt !important;
        width: 8pt !important;
        height: 8pt !important;
        display: inline-block !important;
    }

    /* Ukryj teksty w task tiles */
    .task-tile-mini * {
        display: none !important;
    }

    /* Zapobiegaj łamaniu stron wewnątrz wierszy */
    .accounting-grid tr {
        page-break-inside: avoid;
    }

    /* Kolumny firm - trochę szersze */
    .company-col {
        max-width: none !important;
    }
}
