/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    height: 100vh;
    overflow: hidden;
}

.hidden {
    display: none !important;
}

/* Login Screen */
.login-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-container h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: #333;
}

.form-group {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group-checkbox-single label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0;
    font-weight: normal;
    cursor: pointer;
}

.form-group-checkbox-single input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
}

.login-btn {
    width: 100%;
    padding: 0.75rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.login-btn:hover {
    background: #5a6fd8;
}

.error-message {
    color: #e74c3c;
    text-align: center;
    margin-top: 1rem;
}

/* App Layout */
.app {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.header h1 {
    color: #333;
}

.header-controls {
    display: flex;
    gap: 1rem;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn.active {
    background: #28a745;
    color: white;
}

.btn.active:hover {
    background: #218838;
}

.potencjaly-column.hidden {
    display: none;
}

/* Filters */
.filters {
    background: white;
    padding: 1rem 2rem;
    border-bottom: 1px solid #ddd;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: end;
    max-height: 120px;
    overflow-y: auto;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 120px;
}

.filter-group label {
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.filter-group input,
.filter-group select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Sums */
.sums {
    background: white;
    padding: 0.5rem 2rem;
    border-bottom: 1px solid #ddd;
    display: flex;
    gap: 2rem;
}

.sum-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sum-label {
    font-weight: 500;
    color: #666;
}

.sum-value {
    font-weight: bold;
    color: #333;
}

/* Kanban Board */
.kanban-board {
    flex: 1;
    display: flex;
    overflow-x: auto;
    padding: 1rem 2rem;
    gap: 1rem;
}

.kanban-column {
    background: #f8f9fa;
    border-radius: 8px;
    min-width: 320px;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    height: fit-content;
    max-height: 100%;
}

.column-header {
    padding: 1rem;
    background: white;
    border-bottom: 1px solid #ddd;
    border-radius: 8px 8px 0 0;
}

.column-header h3 {
    margin-bottom: 0.5rem;
    color: #333;
}

.column-sum {
    font-size: 0.8rem;
    color: #666;
}

.column-value {
    font-size: 0.8rem;
}

.column-value.max-value {
    font-weight: bold;
    color: #dc3545;
    font-size: 1.6rem; /* 2x większe niż standardowe 0.8rem */
    display: inline-block;
    line-height: 1.2;
}

.column-cards {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 200px;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
}

/* Cards */
.kanban-card {
    background: white;
    border-radius: 6px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: move;
    transition: all 0.3s;
    border-left: 4px solid #667eea;
    height: 250px;
    overflow-y: auto;
    flex-shrink: 0;
}

.kanban-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.kanban-card.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.card-priority-high {
    border-left-color: #e74c3c;
}

.card-priority-urgent {
    border-left-color: #f39c12;
}

.card-excluded {
    opacity: 0.6;
    border-left-color: #95a5a6;
}

.card-completed {
    background-color: #e8f5e9;
    border-left-color: #4caf50;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.5rem;
}

.card-title {
    font-weight: bold;
    font-size: 1rem;
    color: #333;
}

.card-client {
    color: #666;
    font-size: 0.8rem;
}

.product-group-badge {
    display: inline-block;
    background: #667eea;
    color: white;
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    margin-left: 0.5rem;
    font-weight: 600;
    vertical-align: middle;
}

.card-compact-code .product-group-badge {
    font-size: 0.65rem;
    padding: 0.1rem 0.3rem;
    margin-left: 0.3rem;
}

.card-content {
    margin-bottom: 0.5rem;
}

.card-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
}

.card-label {
    color: #666;
}

.card-value {
    font-weight: 500;
}

.card-comment {
    font-style: italic;
    color: #666;
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

.card-notes {
    background: #f8f9fa;
    border-left: 3px solid #667eea;
    padding: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #444;
    border-radius: 0 4px 4px 0;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 100px;
    overflow-y: auto;
}

.card-checkboxes {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.checkbox-item {
    font-size: 0.7rem;
    background: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    color: #666;
}

.card-actions {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.kanban-card:hover .card-actions {
    opacity: 1;
}

/* ===== COMPACT VIEW STYLES ===== */
.kanban-board.compact-view {
    gap: 0.5rem;
}

.kanban-board.compact-view .kanban-column {
    min-width: 280px;
    max-width: 280px;
}

.kanban-column.collapsed .column-cards {
    display: none;
}

.kanban-column.collapsed .column-header {
    border-radius: 8px;
}

/* Compact card styles */
.kanban-card.card-compact {
    height: auto;
    min-height: 50px;
    padding: 0.5rem;
    cursor: pointer;
}

.kanban-card.card-compact:hover {
    transform: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.card-compact-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.25rem 0;
    cursor: pointer;
    user-select: none;
}

.card-compact-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.card-compact-code {
    font-weight: 600;
    font-size: 0.85rem;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-compact-client {
    font-size: 0.75rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-compact-quantity {
    font-weight: 600;
    font-size: 0.9rem;
    color: #667eea;
    padding: 0.2rem 0.5rem;
    background: #f0f4ff;
    border-radius: 4px;
    white-space: nowrap;
    min-width: 50px;
    text-align: center;
}

.card-expand-icon {
    font-size: 0.7rem;
    color: #999;
    transition: transform 0.2s;
    margin-left: 0.25rem;
    flex-shrink: 0;
}

.card-compact-details {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 1000px;
    }
}

.card-compact-details.hidden {
    display: none;
}

.card-compact .card-content {
    margin-bottom: 0.75rem;
}

.card-compact .card-actions {
    opacity: 1;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e5e7eb;
}

.card-compact .card-action-btn {
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
}

/* Responsive compact view */
@media (max-width: 768px) {
    .kanban-board.compact-view .kanban-column {
        min-width: 240px;
        max-width: 240px;
    }
    
    .card-compact-code {
        font-size: 0.8rem;
    }
    
    .card-compact-client {
        font-size: 0.7rem;
    }
    
    .card-compact-quantity {
        font-size: 0.8rem;
        padding: 0.15rem 0.4rem;
        min-width: 45px;
    }
}

.card-action-btn {
    padding: 0.25rem 0.5rem;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.3s;
}

.card-edit-btn {
    background: #28a745;
    color: white;
}

.card-edit-btn:hover {
    background: #218838;
}

.card-duplicate-btn {
    background: #ffc107;
    color: #333;
}

.card-duplicate-btn:hover {
    background: #e0a800;
}

.card-delete-btn {
    background: #dc3545;
    color: white;
}

.card-delete-btn:hover {
    background: #c82333;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.confirm-modal {
    max-width: 400px;
    text-align: center;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #ddd;
}

.modal-header h2 {
    color: #333;
}

.confirm-message {
    padding: 2rem 1rem;
    font-size: 1.1rem;
    color: #333;
}

.modal-close {
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.modal-close:hover {
    color: #333;
}

#card-form {
    padding: 1rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: flex-start;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}

.form-group-checkboxes {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.form-group-checkboxes > label:first-child {
    height: 1.5rem;
    margin-bottom: 0.5rem;
    display: block;
    visibility: hidden;
}

.checkbox-group {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 0;
    min-height: 2.75rem;
    justify-content: flex-start;
    padding-top: 0;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
    margin-bottom: 0;
    white-space: nowrap;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
}

/* Statistics Modal */
.statistics-modal {
    max-width: 90%;
    width: 1200px;
    max-height: 90vh;
}

.statistics-content {
    padding: 1rem;
    max-height: calc(90vh - 100px);
    overflow-y: auto;
}

.statistics-loading,
.statistics-error {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.statistics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.statistics-section {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.statistics-section h3 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.1rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

.statistics-table {
    overflow-x: auto;
}

.statistics-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.statistics-table th {
    background: #667eea;
    color: white;
    padding: 0.5rem;
    text-align: left;
    font-weight: 500;
}

.statistics-table td {
    padding: 0.5rem;
    border-bottom: 1px solid #ddd;
}

.statistics-table tbody tr:hover {
    background: #f0f0f0;
}

.statistics-alerts {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.statistics-alert {
    padding: 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.statistics-alert-danger {
    background: #fee;
    border-left: 4px solid #e74c3c;
    color: #c0392b;
}

.statistics-alert-warning {
    background: #fff3cd;
    border-left: 4px solid #f39c12;
    color: #856404;
}

.statistics-alert-success {
    background: #d4edda;
    border-left: 4px solid #28a745;
    color: #155724;
}

.statistics-metric {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: 6px;
    border: 2px solid #667eea;
}

.metric-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .filters {
        padding: 1rem;
        flex-direction: column;
    }

    .filter-group {
        min-width: auto;
    }

    .kanban-board {
        padding: 1rem;
        flex-direction: column;
    }

    .kanban-column {
        min-width: auto;
        max-width: none;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .statistics-modal {
        max-width: 95%;
        width: 100%;
    }

    .statistics-grid {
        grid-template-columns: 1fr;
    }
}

/* Settings Modal */
.settings-modal {
    max-width: 600px;
    width: 90%;
}

.settings-content {
    padding: 1.5rem;
}

.settings-section {
    margin-bottom: 1.5rem;
}

.settings-section h3 {
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #667eea;
    font-size: 1.1rem;
}

.db-settings {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.db-settings.hidden {
    display: none;
}

.settings-actions {
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.connection-status {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    flex: 1;
    min-width: 200px;
}

.connection-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.connection-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.connection-status.testing {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.settings-info {
    background: #e7f3ff;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid #667eea;
    margin-top: 1.5rem;
}

.settings-info h4 {
    margin: 0 0 0.75rem 0;
    color: #333;
    font-size: 1rem;
}

.settings-info p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
}

.settings-info .warning {
    color: #856404;
    background: #fff3cd;
    padding: 0.5rem;
    border-radius: 4px;
    margin-top: 1rem;
}

#settings-modal .form-group {
    margin-bottom: 1rem;
}

#settings-modal .form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
}

#settings-modal .form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#settings-modal .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
    outline: none;
}

#settings-modal .form-row {
    display: flex;
    gap: 1rem;
}

#settings-modal .form-row .form-group {
    flex: 1;
}

@media (max-width: 768px) {
    .settings-modal {
        max-width: 95%;
    }

    #settings-modal .form-row {
        flex-direction: column;
        gap: 0;
    }

    .settings-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .connection-status {
        text-align: center;
    }
}

/* Clients Management */
.clients-management {
    margin-top: 1rem;
}

.clients-list-container {
    margin-top: 1.5rem;
}

.clients-list-container h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
}

.clients-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
}

.clients-loading {
    padding: 1rem;
    text-align: center;
    color: #6b7280;
}

.client-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s;
}

.client-item:last-child {
    border-bottom: none;
}

.client-item:hover {
    background-color: #f9fafb;
}

.client-item-name {
    flex: 1;
    font-weight: 500;
    color: #1f2937;
}

.client-item-actions {
    display: flex;
    gap: 0.5rem;
}

.client-item-actions .btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.client-item-actions .btn-danger {
    background: #ef4444;
    color: white;
    border: none;
}

.client-item-actions .btn-danger:hover {
    background: #dc2626;
}

/* Settings modal buttons */
#settings-modal .modal-actions {
    justify-content: center;
    padding: 1.25rem 1.5rem;
    margin-top: 1.5rem;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
    margin: 1.5rem -1.5rem -1.5rem -1.5rem;
}

#settings-modal .modal-actions .btn {
    min-width: 140px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
}

/* ===== CUSTOM DIALOG MODAL ===== */
.dialog-modal {
    max-width: 420px;
    text-align: center;
    padding: 2rem;
    border-radius: 16px;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: dialogAppear 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes dialogAppear {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.dialog-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: iconPulse 0.5s ease-out;
}

@keyframes iconPulse {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.dialog-icon svg {
    width: 40px;
    height: 40px;
    stroke-width: 2.5;
}

.dialog-icon .icon-info {
    color: #3b82f6;
}

.dialog-icon .icon-success {
    color: #10b981;
}

.dialog-icon .icon-warning {
    color: #f59e0b;
}

.dialog-icon .icon-error {
    color: #ef4444;
}

.dialog-icon .icon-question {
    color: #8b5cf6;
}

/* Icon backgrounds */
.dialog-icon.info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.dialog-icon.success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

.dialog-icon.warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.dialog-icon.error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
}

.dialog-icon.question {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
}

.dialog-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.dialog-message {
    font-size: 1rem;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 1.75rem;
    padding: 0 0.5rem;
}

.dialog-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.dialog-actions .btn {
    min-width: 120px;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.dialog-actions .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.dialog-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.dialog-actions .btn-secondary {
    background: #f3f4f6;
    color: #4b5563;
    border: 2px solid #e5e7eb;
}

.dialog-actions .btn-secondary:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.dialog-actions .btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.dialog-actions .btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

/* ===== STATISTICS WITH CHARTS ===== */
.statistics-modal {
    max-width: 1100px;
    max-height: 90vh;
}

.statistics-content {
    padding: 1rem;
    overflow-y: auto;
    max-height: calc(90vh - 80px);
}

.statistics-loading {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
    font-size: 1.1rem;
}

/* Summary Cards */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 2rem;
    height: 2rem;
    stroke: #667eea;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.85rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.chart-container {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.chart-container h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #667eea;
}

.chart-container canvas {
    max-height: 250px;
}

/* Stats Tables */
.stats-details {
    margin-top: 1rem;
}

.stats-table-container {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.stats-table-container h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #667eea;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
}

.stats-table th,
.stats-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.stats-table th {
    background: #f3f4f6;
    font-weight: 600;
    color: #374151;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.stats-table tr:hover {
    background: #f9fafb;
}

.stats-table .deadline-soon {
    color: #dc2626;
    font-weight: 600;
}

.stats-table .deadline-ok {
    color: #10b981;
}

/* Responsive */
@media (max-width: 900px) {
    .stats-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .stats-summary {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
}

/* ===== CLIENT GOALS MODAL ===== */
.goals-modal {
    max-width: 1000px;
    width: 90%;
    max-height: 90vh;
}

.goals-content {
    padding: 1.5rem;
    max-height: calc(90vh - 100px);
    overflow-y: auto;
}

.goals-controls {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.goals-controls .form-group {
    margin-bottom: 0;
    min-width: 150px;
}

.goals-controls .form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.goals-loading {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

.goals-table-container {
    margin-top: 1rem;
}

.goals-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.goals-table thead {
    background: #667eea;
    color: white;
}

.goals-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.goals-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.goals-table tbody tr:hover {
    background: #f9fafb;
}

/* Goal row colors */
.goal-completed {
    background: #d1fae5;
}

.goal-good {
    background: #dbeafe;
}

.goal-medium {
    background: #fef3c7;
}

.goal-low {
    background: #fee2e2;
}

.goal-over {
    background: #fce7f3;
}

.goal-negative {
    color: #dc2626;
    font-weight: 600;
}

.goal-100 {
    color: #059669;
    font-weight: 600;
}

.goal-80 {
    color: #2563eb;
    font-weight: 600;
}

.goal-50 {
    color: #d97706;
    font-weight: 600;
}

.goal-low {
    color: #dc2626;
    font-weight: 600;
}

/* ===== POTENTIAL MANAGEMENT MODAL ===== */
.potential-modal {
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
}

.potential-content {
    padding: 1.5rem;
    max-height: calc(90vh - 100px);
    overflow-y: auto;
}

.potential-controls {
    margin-bottom: 1.5rem;
}

.potential-loading {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

.potential-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.potential-table thead {
    background: #667eea;
    color: white;
}

.potential-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.potential-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.potential-table tbody tr:hover {
    background: #f9fafb;
}

@media (max-width: 768px) {
    .goals-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .goals-controls .form-group {
        min-width: auto;
    }
    
    .goals-table {
        font-size: 0.8rem;
    }
    
    .goals-table th,
    .goals-table td {
        padding: 0.5rem;
    }
}