/* WoodPlan — Main Stylesheet
   Auto-extracted from index.html
*/

body { font-family: 'Manrope', sans-serif; }
.hidden { display: none !important; }

/* Login */
.login-screen { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    min-height: 100vh; 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.login-box { 
    background: white; 
    padding: 40px; 
    border-radius: 15px; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    width: 400px;
}
.login-box h1 { margin-bottom: 20px; color: #2c3e50; }

/* App */
.app-container { display: flex; height: 100vh; }
.sidebar { 
    width: 250px; 
    background: #2c3e50; 
    color: white; 
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.sidebar h2 { margin-bottom: 30px; font-size: 20px; }
.user-badge {
    background: rgba(255,255,255,0.1);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 30px;
}
.user-badge .name { font-weight: bold; font-size: 16px; }

.nav-link { 
    display: block; 
    padding: 12px; 
    color: white; 
    text-decoration: none; 
    border-radius: 5px;
    margin-bottom: 5px;
    cursor: pointer;
    transition: all 0.2s;
}
.nav-link:hover, .nav-link.active { background: #34495e; }

.main-content { flex: 1; overflow-y: auto; background: #ecf0f1; }
.top-bar { 
    background: white; 
    padding: 20px; 
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Mobile indicator - visible only on mobile */
.mobile-mode-indicator {
    display: none;
    position: fixed;
    top: 10px;
    right: 10px;
    background: #51cf66;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    z-index: 9999;
    animation: pulse 2s infinite;
}

.mobile-mode-indicator::after {
    content: '';
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.content-area { padding: 30px; }
.page { display: none; }
.page.active { display: block; }

.tasks-content {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Components */
.stats-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); 
    gap: 10px;
    margin-bottom: 24px;
}
.stat-card { 
    background: white; 
    padding: 12px 14px; 
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.stat-card h3 { color: #7f8c8d; font-size: 11px; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.3px; }
.stat-value { font-size: 22px; font-weight: bold; color: #2c3e50; }

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.search-box {
    position: relative;
    flex: 0 0 auto;
}

.search-box input {
    padding: 8px 12px 8px 36px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    width: 250px;
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-box::before {
    content: '🔍';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    pointer-events: none;
}

.filter-tabs {
    display: inline-flex;
    gap: 5px;
}
.filter-tab {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #7f8c8d;
    transition: all 0.2s;
}
.filter-tab.active {
    background: #3498db;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.filter-tab:hover:not(.active) {
    background: #ecf0f1;
    color: #2c3e50;
}

/* Role selector styles */
.role-selector {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 2px solid #3498db;
    background: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    color: #2c3e50;
}
.role-selector:hover {
    border-color: #2980b9;
    background: #f8f9fa;
}
.role-selector:focus {
    outline: none;
    border-color: #2980b9;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Role tabs on dashboard */
.role-tab {
    padding: 12px 24px;
    border: none;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #7f8c8d;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 8px;
}
.role-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}
.role-tab:hover:not(.active) {
    background: #ecf0f1;
    color: #2c3e50;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

table { 
    width: 100%; 
    background: white; 
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-collapse: collapse;
}
table th { 
    background: #34495e; 
    color: white; 
    padding: 15px;
    text-align: left;
}
table td { padding: 12px 15px; border-bottom: 1px solid #ecf0f1; }
table tr:last-child td { border-bottom: none; }
table tr:hover { background: #f8f9fa; }

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    font-weight: 500;
}
.btn-primary { background: #3498db; color: white; }
.btn-success { background: #27ae60; color: white; }
.btn-danger { background: #e74c3c; color: white; }
.btn-warning { background: #f39c12; color: white; }
.btn-secondary { background: #95a5a6; color: white; }
.btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn:disabled { background: #bdc3c7; cursor: not-allowed; transform: none; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

.badge { 
    display: inline-block;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}
.badge-success { background: #d4edda; color: #155724; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-info { background: #d1ecf1; color: #0c5460; }
.badge-primary { background: #cce5ff; color: #004085; }

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal.active { display: flex; }
.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.modal-header {
    padding: 20px;
    border-bottom: 1px solid #ecf0f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h2 { color: #2c3e50; }
.modal-body { padding: 20px; }
.modal-footer {
    padding: 20px;
    border-top: 1px solid #ecf0f1;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #2c3e50;
    font-weight: bold;
}
.form-group small {
    display: block;
    color: #7f8c8d;
    margin-top: 3px;
    font-size: 12px;
}
input, select, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}
textarea { min-height: 100px; resize: vertical; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
}
.empty-state h3 { margin-bottom: 10px; }

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #7f8c8d;
    line-height: 1;
}
.close-btn:hover { color: #2c3e50; }

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 2000;
    animation: slideIn 0.3s ease;
    min-width: 300px;
}
@keyframes slideIn {
    from { transform: translateX(400px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
.toast.success { border-left: 4px solid #27ae60; }
.toast.error { border-left: 4px solid #e74c3c; }

.stage-assignment {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #3498db;
}
.stage-assignment h4 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.info-box {
    background: #e8f5e9;
    border-left: 4px solid #27ae60;
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
}
.info-box strong { display: block; margin-bottom: 5px; }

.user-status {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
}
.user-status.active { background: #27ae60; }
.user-status.inactive { background: #e74c3c; }

.files-section { background: #f8f9fa; padding: 20px; border-radius: 10px; margin: 20px 0; border-left: 4px solid #3498db; }
.files-section h3 { margin-bottom: 15px; color: #2c3e50; }
.files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 15px; margin-bottom: 15px; }
.file-item { background: white; padding: 15px; border-radius: 8px; border: 1px solid #ddd; text-align: center; transition: all 0.3s; }
.file-item:hover { box-shadow: 0 5px 15px rgba(0,0,0,0.1); transform: translateY(-2px); }
.file-icon { font-size: 48px; margin-bottom: 10px; }
.file-name { font-size: 12px; color: #2c3e50; word-break: break-word; margin-bottom: 5px; }
.file-meta { font-size: 10px; color: #7f8c8d; }
.file-preview { width: 100%; height: 100px; object-fit: cover; border-radius: 5px; margin-bottom: 10px; cursor: pointer; }
.upload-area { border: 2px dashed #ddd; border-radius: 8px; padding: 30px; text-align: center; cursor: pointer; transition: all 0.3s; }
.upload-area:hover { border-color: #3498db; background: #f8f9fa; }
.issues-in-order { background: #fff3cd; padding: 15px; border-radius: 8px; margin: 20px 0; border-left: 4px solid #f39c12; }
.issue-item-inline { background: white; padding: 12px; border-radius: 5px; margin-bottom: 10px; border-left: 3px solid #f39c12; }
.approval-status { background: #fff3cd; padding: 15px; border-radius: 8px; margin: 10px 0; border-left: 4px solid #f39c12; text-align: center; }
.badge-notification { background: #e74c3c; color: white; padding: 2px 6px; border-radius: 10px; font-size: 11px; margin-left: 5px; }

/* Chat tabs layout */
.chat-tabs-container {
    background: white;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 20px;
}
.chat-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 4px;
}
.chat-tab {
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    border: none;
    font-size: 13px;
    font-weight: 500;
    color: #7f8c8d;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}
.chat-tab:hover {
    background: #f8f9fa;
    color: #2c3e50;
}
.chat-tab.active {
    background: #3498db;
    color: white;
}
.chat-tab-badge {
    background: rgba(231, 76, 60, 0.9);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
}

.chat-window-fullwidth {
    background: white;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 350px);
    min-height: 400px;
}
.chat-header { padding: 20px; border-bottom: 2px solid #ecf0f1; }
.chat-messages { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 15px; }
.chat-message { max-width: 70%; padding: 12px 16px; border-radius: 12px; }
.chat-message.own { align-self: flex-end; background: #2196f3; color: white; }
.chat-message.other { align-self: flex-start; background: #ecf0f1; color: #2c3e50; }
.chat-message-author { font-size: 11px; font-weight: bold; margin-bottom: 5px; opacity: 0.8; }
.chat-message-time { font-size: 10px; opacity: 0.7; margin-top: 5px; }
.chat-input-area { padding: 20px; border-top: 2px solid #ecf0f1; display: flex; gap: 10px; }
.chat-input-area textarea { flex: 1; resize: none; padding: 12px; border: 1px solid #ddd; border-radius: 8px; }
.chat-empty { text-align: center; padding: 100px 20px; color: #95a5a6; }

/* Calendar legend - compact style for all devices */
.calendar-legend {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
    padding: 10px !important;
    margin-top: 15px !important;
    font-size: 10px !important;
    background: #ecf0f1;
    border-radius: 5px;
}

.calendar-legend span {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin: 0 !important;
}

.calendar-legend span::before {
    content: '';
    width: 14px !important;
    height: 14px !important;
    border-radius: 3px;
    flex-shrink: 0;
    background: attr(data-color);
}

/* Individual legend colors using attribute selectors */
.calendar-legend span[data-color="#3498db"]::before { background: #3498db; }
.calendar-legend span[data-color="#9b59b6"]::before { background: #9b59b6; }
.calendar-legend span[data-color="#e67e22"]::before { background: #e67e22; }
.calendar-legend span[data-color="#16a085"]::before { background: #16a085; }
.calendar-legend span[data-color="#27ae60"]::before { background: #27ae60; }
.calendar-legend span[data-color="#f39c12"]::before { background: #f39c12; }
.calendar-legend span[data-color="#8e44ad"]::before { background: #8e44ad; }
.calendar-legend span[data-color="#e74c3c"]::before { background: #e74c3c; }

/* ==================== RESPONSIVE DESIGN ==================== */

/* Mobile header (hidden on desktop) */
.mobile-header {
    display: none;
    background: #2c3e50;
    color: white;
    padding: 12px 16px;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.hamburger {
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.hamburger:hover {
    background: rgba(255,255,255,0.1);
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

/* Bottom navigation */
.bottom-nav {
    display: none;
    background: white;
    border-top: 1px solid #ddd;
    padding: 8px 0;
    position: sticky;
    bottom: 0;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.bottom-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
    font-size: 11px;
    color: #7f8c8d;
    text-decoration: none;
}

.bottom-nav-item:hover {
    background: #f8f9fa;
}

.bottom-nav-item.active {
    color: #3498db;
    background: #ecf0f1;
}

.bottom-nav-icon {
    font-size: 20px;
}

/* Tablet and smaller (< 1024px) */
@media screen and (max-width: 1024px) {
    .mobile-header {
        display: flex;
    }
    
    .top-bar {
        display: none;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        height: 100vh;
        width: 280px;
        z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .app-container {
        flex-direction: column;
    }
    
    .content {
        width: 100% !important;
        margin-left: 0 !important;
        padding: 16px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .btn, button {
        min-height: 44px;
        padding: 10px 16px;
    }
    
    .modal-content {
        width: 90%;
        max-width: 600px;
        margin: 20px auto;
    }
    
    #workerWidgetsContainer {
        grid-template-columns: 1fr !important;
    }
    
    .filter-tabs {
        flex-wrap: wrap;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .page-header > div {
        width: 100%;
    }
    
    .search-box {
        width: 100%;
    }
    
    .search-box input {
        width: 100%;
    }
    
    
    /* Mobile Calendar Improvements */
    #calendarGrid {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .calendar-legend {
        flex-wrap: wrap;
        font-size: 11px !important;
        padding: 10px !important;
    }
    
    .calendar-legend span {
        font-size: 10px !important;
        padding: 4px 8px !important;
    }
    
    #calendarPeriodTitle {
        font-size: 16px !important;
    }
    
    #calPrevBtn, #calNextBtn {
        font-size: 11px !important;
        padding: 8px 12px !important;
    }
    
    /* Mobile calendar - hide grid, show list */
    .calendar-desktop {
        display: none !important;
    }
    
    .calendar-mobile {
        display: block !important;
    }
    
    .calendar-mobile-day {
        background: white;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .calendar-mobile-day-header {
        font-weight: 600;
        font-size: 14px;
        color: #2c3e50;
        margin-bottom: 8px;
        padding-bottom: 8px;
        border-bottom: 2px solid #ecf0f1;
    }
    
    .calendar-mobile-event {
        padding: 8px;
        margin-bottom: 6px;
        border-radius: 6px;
        font-size: 12px;
        color: white;
    }
    
    .bottom-nav {
        display: block;
    }
}

/* Mobile (< 768px) */
@media screen and (max-width: 768px) {
    /* Show mobile mode indicator */
    .mobile-mode-indicator {
        display: block !important;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    /* Mobile Fixed Bottom Tabs */
    .mobile-fixed-tabs {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid #e0e0e0;
        padding: 8px 12px 20px;
        display: flex;
        gap: 6px;
        overflow-x: auto;
        z-index: 999;
        -webkit-overflow-scrolling: touch;
    }
    
    .mobile-fixed-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .mobile-tab {
        padding: 8px 14px;
        background: #f0f0f0;
        border: none;
        border-radius: 20px;
        font-size: 12px;
        white-space: nowrap;
        cursor: pointer;
        transition: all 0.2s;
        font-weight: 500;
        flex-shrink: 0;
    }
    
    .mobile-tab.active {
        background: #667eea;
        color: white;
        font-weight: 600;
    }
    
    /* Mobile Fixed Action Buttons */
    .mobile-fixed-actions {
        position: fixed;
        bottom: 60px;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid #e0e0e0;
        padding: 10px 12px;
        display: flex;
        gap: 8px;
        z-index: 998;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    }
    
    .mobile-action-btn {
        flex: 1;
        padding: 12px 10px;
        border: none;
        border-radius: 10px;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        transition: transform 0.1s;
    }
    
    .mobile-action-btn:active {
        transform: scale(0.95);
    }
    
    .mobile-action-btn.primary {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
    }
    
    .mobile-action-btn.success {
        background: #51cf66;
        color: white;
    }
    
    .mobile-action-btn.warning {
        background: #ffa726;
        color: white;
    }
    
    /* Add bottom padding to content when fixed bars are present */
    .page {
        padding-bottom: 140px !important;
    }
    
    /* Hide desktop filter tabs and buttons on mobile */
    .filter-tabs {
        display: none !important;
    }
    
    #orderManagementButtons .btn {
        display: none !important;
    }
    
    .login-box {
        width: 90%;
        padding: 30px 20px;
    }
    
    #workerWidgetsContainer {
        grid-template-columns: 1fr !important;
    }
    
    .modal-content {
        width: 100%;
        height: 100%;
        max-width: none;
        margin: 0;
        border-radius: 0;
    }
    
    /* ENHANCED: Hide desktop tables, show mobile cards */
    .data-table {
        display: none !important;
    }
    
    .mobile-cards {
        display: block !important;
    }
    
    /* Keep small tables for some contexts */
    table.keep-on-mobile {
        display: table;
        font-size: 12px;
    }
    
    table.keep-on-mobile th, 
    table.keep-on-mobile td {
        padding: 8px 6px;
    }
    
    table {
        font-size: 12px;
    }
    
    th, td {
        padding: 8px 6px;
    }
    
    .filter-tab {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .stat-card {
        padding: 10px 12px;
    }
    
    .stat-card h3 {
        font-size: 10px;
    }
    
    .stat-value {
        font-size: 18px;
    }
    
    #calendar {
        font-size: 11px;
    }
    
    .chat-message {
        max-width: 85%;
        font-size: 13px;
    }
    
    /* Chat tabs scroll on mobile */
    .chat-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
    }
    .chat-tabs::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }
    .chat-tab {
        font-size: 12px;
        padding: 8px 14px;
    }
    .chat-window-fullwidth {
        height: calc(100vh - 280px);
    }
    
    input, textarea, select {
        min-height: 44px;
        font-size: 16px;
    }
}

/* Mobile Card Styles - Hidden on desktop, shown on mobile */
.mobile-cards {
    display: none; /* Hidden by default, shown in mobile media query */
}

.mobile-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.2s;
}

.mobile-card:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

.mobile-card-header {
    font-weight: 700;
    margin-bottom: 12px;
    color: #2c3e50;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-card-id {
    background: #667eea;
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

.mobile-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9rem;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}

.mobile-card-row:last-child {
    border-bottom: none;
    margin-bottom: 12px;
}

.mobile-card-label {
    color: #7f8c8d;
    font-weight: 500;
    font-size: 0.85rem;
}

.mobile-card-value {
    color: #2c3e50;
    font-weight: 600;
    text-align: right;
}

.mobile-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #ecf0f1;
}

.mobile-card-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
}

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

.mobile-card-btn-primary:active {
    background: #5568d3;
}

.mobile-card-btn-secondary {
    background: #ecf0f1;
    color: #2c3e50;
}

.mobile-card-btn-secondary:active {
    background: #d5dbdb;
}

.mobile-card-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.mobile-card-status.active {
    background: #d1f2eb;
    color: #0e6655;
}

.mobile-card-status.completed {
    background: #d5f4e6;
    color: #1e7e34;
}

.mobile-card-status.pending {
    background: #fff3cd;
    color: #856404;
}

.mobile-card-status.delayed {
    background: #f8d7da;
    color: #721c24;
}

.mobile-card-badge {
    background: #e8eaf6;
    color: #3f51b5;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Collapsible rows */
.collapsible-row {
    cursor: pointer;
    transition: background 0.2s;
}

.collapsible-row:hover {
    background: #f8f9fa !important;
}

.collapsible-row.collapsed .collapsible-content {
    display: none;
}

.collapse-toggle {
    cursor: pointer;
    user-select: none;
    display: inline-block;
    width: 20px;
    text-align: center;
    transition: transform 0.2s;
}

.collapsible-row.collapsed .collapse-toggle {
    transform: rotate(-90deg);
}

.collapsible-content {
    transition: all 0.2s;
}

/* Very small phones (< 375px) */
@media screen and (max-width: 375px) {
    .mobile-header {
        padding: 10px 12px;
    }
    
    .content {
        padding: 12px;
    }
    
    .stat-card h3 {
        font-size: 9px;
    }
    
    .stat-value {
        font-size: 16px;
    }
    
    .bottom-nav-item {
        font-size: 10px;
        padding: 6px 8px;
    }
    
    .bottom-nav-icon {
        font-size: 18px;
    }
    
    /* Compact bottom nav for 5 items on very small screens */
    .bottom-nav-item {
        padding: 6px 4px;
        font-size: 9px;
    }
    
    .bottom-nav-icon {
        font-size: 16px;
    }
}

/* ========== MOBILE WIDGET CARDS ========== */
@media (max-width: 768px) {
    /* Quick Actions Mobile */
    .quick-actions-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)) !important;
        gap: 8px !important;
    }
    
    .quick-action-btn {
        padding: 10px 6px !important;
    }
    
    .quick-action-btn > div:first-child {
        font-size: 20px !important;
        margin-bottom: 4px !important;
    }
    
    .quick-action-btn > div:nth-child(2) {
        font-size: 11px !important;
    }
    
    .quick-action-btn > div:nth-child(3) {
        font-size: 9px !important;
    }
    
    /* Widget Card for Mobile */
    .mobile-widget-card {
        background: white;
        border-radius: 12px;
        padding: 14px;
        margin-bottom: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        border-left: 4px solid #667eea;
    }
    
    .mobile-widget-card.priority-high {
        border-left-color: #ff6b6b;
    }
    
    .mobile-widget-card.priority-medium {
        border-left-color: #ffa726;
    }
    
    .mobile-widget-card.priority-low {
        border-left-color: #51cf66;
    }
    
    .mobile-widget-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 10px;
    }
    
    .mobile-widget-number {
        font-size: 12px;
        font-weight: 700;
        color: #667eea;
        background: rgba(102, 126, 234, 0.1);
        padding: 4px 10px;
        border-radius: 12px;
    }
    
    .mobile-widget-status {
        font-size: 11px;
        padding: 4px 10px;
        border-radius: 12px;
        font-weight: 600;
        background: #f0f0f0;
        color: #666;
    }
    
    .mobile-widget-status.pending {
        background: #fff4e6;
        color: #ffa726;
    }
    
    .mobile-widget-status.approved {
        background: #e8f5e9;
        color: #51cf66;
    }
    
    .mobile-widget-status.rejected {
        background: #ffebee;
        color: #ff6b6b;
    }
    
    .mobile-widget-content {
        font-size: 14px;
        color: #2c3e50;
        line-height: 1.5;
        margin-bottom: 10px;
        font-weight: 500;
    }
    
    .mobile-widget-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        font-size: 11px;
        color: #999;
        margin-bottom: 10px;
    }
    
    .mobile-widget-meta span {
        display: flex;
        align-items: center;
        gap: 4px;
    }
    
    .mobile-widget-actions {
        display: flex;
        gap: 8px;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid #f0f0f0;
    }
    
    .mobile-widget-btn {
        flex: 1;
        padding: 8px;
        border: none;
        border-radius: 8px;
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
        transition: transform 0.1s;
    }
    
    .mobile-widget-btn:active {
        transform: scale(0.95);
    }
    
    .mobile-widget-btn.primary {
        background: #667eea;
        color: white;
    }
    
    .mobile-widget-btn.success {
        background: #51cf66;
        color: white;
    }
    
    .mobile-widget-btn.danger {
        background: #ff6b6b;
        color: white;
    }
    
    .mobile-widget-btn.secondary {
        background: #f0f0f0;
        color: #666;
    }
    
    /* Hide desktop tables on mobile, show widget view */
    .desktop-table-view {
        display: none !important;
    }
    
    .mobile-widget-view {
        display: block !important;
    }
    
    /* Horizontal scrollable tabs for mobile */
    .mobile-tabs-container {
        display: flex;
        gap: 8px;
        padding: 8px 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 16px;
    }
    
    .mobile-tabs-container::-webkit-scrollbar {
        display: none;
    }
    
    .mobile-tab-btn {
        padding: 8px 16px;
        background: #f0f0f0;
        border: none;
        border-radius: 20px;
        font-size: 13px;
        white-space: nowrap;
        cursor: pointer;
        transition: all 0.2s;
        font-weight: 500;
    }
    
    .mobile-tab-btn.active {
        background: #667eea;
        color: white;
        font-weight: 600;
    }
    
    /* Search box responsive */
    .search-box input {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    /* Make data tables scrollable on mobile instead of breaking */
    .data-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Desktop - hide mobile widgets */
@media (min-width: 769px) {
    .mobile-widget-view {
        display: none !important;
    }
    
    .desktop-table-view {
        display: block !important;
    }
}

/* ==================== PERMISSIONS MODAL ==================== */
.permission-category {
    margin-bottom: 24px;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #ecf0f1;
}

.category-title {
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
}

.permission-item {
    display: flex;
    align-items: flex-start;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.permission-item:hover {
    background: #e9ecef;
}

.permission-item.from-role {
    opacity: 0.7;
    cursor: default;
}

.permission-item.from-role:hover {
    background: #f8f9fa;
}

.permission-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
}

.permission-item input[type="checkbox"]:disabled {
    cursor: not-allowed;
}

.permission-label {
    flex: 1;
}

.permission-name {
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 3px;
}

.permission-desc {
    font-size: 12px;
    color: #7f8c8d;
    line-height: 1.4;
}

.badge-role {
    display: inline-block;
    background: #95a5a6;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 6px;
}

.badge-custom {
    display: inline-block;
    background: #51cf66;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 6px;
}

.user-info-section {
    background: #f8f9fa;
    padding: 14px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 13px;
}

.user-info-section div {
    margin-bottom: 6px;
}

.user-info-section div:last-child {
    margin-bottom: 0;
}

/* ══════════════════════════════════════════
   AI CHAT — style
══════════════════════════════════════════ */
#page-ai-chat {
    display: none;
    height: calc(100vh - 61px);
    padding: 0;
    flex-direction: column;
}
#page-ai-chat.active { display: flex; }

.ai-chat-wrapper {
    display: flex;
    height: 100%;
    background: #f8f9fa;
}
.ai-sidebar-chat {
    width: 230px;
    flex-shrink: 0;
    background: white;
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
    gap: 7px;
    overflow-y: auto;
}
.ai-sidebar-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: #adb5bd;
    margin: 6px 0 2px 4px;
}
.ai-suggestion {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 9px 11px;
    font-size: 12px;
    color: #495057;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1.4;
}
.ai-suggestion:hover {
    background: #eef2ff;
    border-color: #667eea;
    color: #667eea;
}
.ai-suggestion .ai-sug-icon {
    font-size: 13px;
    display: block;
    margin-bottom: 2px;
}
.ai-chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.ai-chat-topbar {
    background: white;
    border-bottom: 1px solid #e9ecef;
    padding: 13px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.ai-status-dot {
    width: 8px;
    height: 8px;
    background: #51cf66;
    border-radius: 50%;
    flex-shrink: 0;
    animation: ai-pulse 2s infinite;
}
@keyframes ai-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}
.ai-chat-title { font-size: 15px; font-weight: 700; color: #2c3e50; }
.ai-chat-subtitle { font-size: 12px; color: #adb5bd; margin-left: auto; }

.ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 22px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.ai-msg {
    display: flex;
    gap: 9px;
    max-width: 82%;
    animation: ai-msg-in 0.18s ease-out;
}
@keyframes ai-msg-in {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: translateY(0); }
}
.ai-msg.user  { flex-direction: row-reverse; align-self: flex-end; }
.ai-msg.agent { align-self: flex-start; }
.ai-msg-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}
.ai-msg.agent .ai-msg-avatar { background: linear-gradient(135deg,#667eea,#764ba2); }
.ai-msg.user  .ai-msg-avatar { background: #e9ecef; }
.ai-msg-bubble {
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}
.ai-msg.agent .ai-msg-bubble {
    background: white;
    color: #2c3e50;
    border: 1px solid #e9ecef;
    border-bottom-left-radius: 4px;
}
.ai-msg.user .ai-msg-bubble {
    background: linear-gradient(135deg,#667eea,#764ba2);
    color: white;
    border-bottom-right-radius: 4px;
}
.ai-msg-time {
    font-size: 10px;
    color: #adb5bd;
    align-self: flex-end;
    margin-bottom: 2px;
    white-space: nowrap;
}
.ai-actions-log {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 7px 11px;
    font-size: 12px;
    color: #166534;
    margin-top: 4px;
}
.ai-actions-log summary { cursor: pointer; font-weight: 600; user-select: none; }
.ai-actions-log pre { margin-top: 6px; font-size: 11px; white-space: pre-wrap; }
.ai-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 9px 13px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}
.ai-typing span {
    width: 6px; height: 6px;
    background: #adb5bd;
    border-radius: 50%;
    animation: ai-bounce 1.2s infinite;
}
.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ai-bounce {
    0%,60%,100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}
.ai-input-area {
    background: white;
    border-top: 1px solid #e9ecef;
    padding: 14px 18px;
}
.ai-input-row { display: flex; gap: 9px; align-items: flex-end; }
.ai-input-wrap {
    flex: 1;
    background: #f8f9fa;
    border: 1.5px solid #e9ecef;
    border-radius: 12px;
    padding: 9px 13px;
    transition: border-color 0.2s;
    display: flex;
    align-items: flex-end;
}
.ai-input-wrap:focus-within { border-color: #667eea; background: white; }
#aiChatInput {
    flex: 1;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 13.5px;
    color: #2c3e50;
    resize: none;
    outline: none;
    max-height: 110px;
    min-height: 20px;
    line-height: 1.5;
}
#aiChatInput::placeholder { color: #adb5bd; }
.ai-send-btn {
    background: linear-gradient(135deg,#667eea,#764ba2);
    border: none;
    border-radius: 10px;
    width: 40px; height: 40px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s;
}
.ai-send-btn:hover:not(:disabled) { transform: scale(1.06); }
.ai-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.ai-send-btn svg { width: 17px; height: 17px; fill: white; }
.ai-hint { font-size: 10.5px; color: #adb5bd; margin-top: 5px; text-align: center; }
.ai-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    gap: 11px;
    padding: 40px;
}
.ai-welcome-icon {
    width: 60px; height: 60px;
    background: linear-gradient(135deg,#667eea,#764ba2);
    border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    font-size: 30px;
    margin-bottom: 6px;
}
.ai-welcome h2 { font-size: 21px; font-weight: 700; color: #2c3e50; }
.ai-welcome p { font-size: 14px; color: #7f8c8d; max-width: 370px; line-height: 1.6; }
.ai-welcome-chips {
    display: flex; flex-wrap: wrap; gap: 7px;
    justify-content: center; margin-top: 6px;
}
.ai-welcome-chip {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    padding: 7px 13px;
    font-size: 12.5px;
    color: #495057;
    cursor: pointer;
    transition: all 0.15s;
}
.ai-welcome-chip:hover { background: #eef2ff; border-color: #667eea; color: #667eea; }

/* ══════════════════════════════════════════════════
   CALENDAR v2 — spójny z layoutem aplikacji
══════════════════════════════════════════════════ */

/* ── View toggle buttons ── */
.cal-view-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    background: transparent;
    color: #7f8c8d;
    font-weight: 500;
    transition: all 0.15s;
    font-family: inherit;
}
.cal-view-btn:hover  { background: #d5dbdb; color: #2c3e50; }
.cal-view-btn.active { background: #3498db; color: #fff; font-weight: 600; }

/* ── Sidebar ── */
.cal-sidebar {
    width: 200px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.cal-sidebar-section {
    background: white;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}
.cal-sidebar-title {
    font-size: 10px;
    font-weight: 700;
    color: #95a5a6;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
    text-transform: uppercase;
}
.cal-filter-link {
    padding: 6px 4px;
    color: #2c3e50;
    font-size: 13px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s;
}
.cal-filter-link:hover { background: #ecf0f1; }
.cal-legend-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: #2c3e50;
    margin-bottom: 5px;
}
.cal-legend-item span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}

/* ── Month grid ── */
.cal-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #dfe6e9;
    border: 1px solid #dfe6e9;
    border-radius: 8px;
    overflow: hidden;
}
.cal-month-header {
    background: #34495e;
    color: white;
    text-align: center;
    padding: 8px 0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.cal-month-cell {
    background: white;
    min-height: 90px;
    padding: 6px;
    cursor: pointer;
    transition: background 0.1s;
}
.cal-month-cell:hover    { background: #f8f9fa; }
.cal-other-month         { background: #f8f9fa; }
.cal-other-month .cal-cell-date { color: #bdc3c7; }
.cal-weekend             { background: #fdfefe; }
.cal-today               { background: #eaf4fd !important; }
.cal-cell-date {
    font-size: 13px;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 4px;
}
.cal-today-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #3498db;
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 12px;
}
.cal-holiday-label { color: #e74c3c; font-size: 10px; cursor: help; }

/* ── Events ── */
.cal-ev {
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
    margin-bottom: 2px;
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    transition: opacity 0.15s;
}
.cal-ev:hover      { opacity: 0.8; }
.cal-ev[draggable="true"] { cursor: grab; }
.cal-ev[draggable="true"]:active { cursor: grabbing; }
.cal-ev-more {
    font-size: 10px;
    color: #95a5a6;
    padding: 1px 4px;
    cursor: pointer;
}
.cal-ev-week { font-size: 10px; }
.cal-ev-day  {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 5px;
    font-size: 13px;
    margin-bottom: 4px;
    color: #2c3e50;
}
.cal-worker-badge {
    margin-left: auto;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

/* ── Gantt container (week & day & month) ── */
.gantt-container {
    background: white; border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden; border: 1px solid #e8ecf0;
}
.gantt-grid {
    display: grid;
    grid-template-columns: 160px repeat(7, 1fr);
}
.gantt-corner {
    background: #1a252f; color: white;
    padding: 12px; font-size: 12px; font-weight: 700;
    display: flex; align-items: center;
    border-bottom: 2px solid #2c3e50;
}
.gantt-day-header {
    background: #2c3e50; color: white;
    text-align: center; padding: 8px 4px;
    font-size: 11px; font-weight: 600;
    border-bottom: 2px solid #34495e;
    border-left: 1px solid #34495e;
}
.gantt-day-header .g-date { font-size: 20px; font-weight: 800; margin-top: 2px; }
.gantt-day-header.today { background: #3498db; }
.gantt-day-header.weekend { background: #3d4f5f; opacity: 0.8; }

.gantt-worker {
    padding: 8px 10px;
    background: #f8f9fa;
    border-bottom: 1px solid #ecf0f1;
    border-right: 2px solid #e0e4e8;
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; font-weight: 600;
    min-height: 48px;
    overflow: hidden;
}
.gantt-worker-dot {
    width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.gantt-worker-role {
    font-size: 10px; color: #95a5a6; font-weight: 400; margin-top: 1px;
}

.gantt-cell {
    border-bottom: 1px solid #ecf0f1;
    border-left: 1px solid #f0f2f4;
    padding: 3px;
    min-height: 48px;
    position: relative;
    overflow: hidden;
}
.gantt-cell.today-col { background: #f0f7ff; }
.gantt-cell.weekend-col { background: #fafafa; }
.gantt-cell.other-month { opacity: 0.5; }

/* Cell date overlay (month view) */
.gantt-cell-date {
    position: absolute; top: 2px; right: 4px;
    font-size: 10px; color: #95a5a6; font-weight: 600;
    pointer-events: none;
}
.gantt-cell-today {
    background: #3498db; color: white; border-radius: 50%;
    width: 18px; height: 18px; display: inline-flex;
    align-items: center; justify-content: center; font-size: 9px;
}

/* ── Compact mini bars (week & month) ── */
.gantt-bar-mini {
    padding: 2px 5px; border-radius: 4px;
    font-size: 10px; font-weight: 600; color: white;
    cursor: pointer; margin-bottom: 2px;
    display: flex; align-items: center; gap: 3px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    transition: transform 0.1s, box-shadow 0.15s;
    line-height: 1.3;
}
.gantt-bar-mini:hover {
    transform: scale(1.03);
    box-shadow: 0 2px 6px rgba(0,0,0,0.18);
    z-index: 2;
}
.gantt-bar-mini[draggable="true"] { cursor: grab; }
.gantt-bar-mini[draggable="true"]:active { cursor: grabbing; }
.gbm-id { max-width: 60px; overflow: hidden; text-overflow: ellipsis; }
.gbm-time { font-size: 9px; opacity: 0.7; margin-left: auto; flex-shrink: 0; }
.gantt-bar-more {
    font-size: 9px; color: #95a5a6; text-align: center; cursor: pointer;
}
.gantt-vacation-mini {
    background: repeating-linear-gradient(45deg, #f39c1230, #f39c1230 4px, transparent 4px, transparent 8px) !important;
    color: #e67e22 !important; border: 1px dashed #f39c12;
}
.gantt-absence-mini {
    background: repeating-linear-gradient(45deg, #e74c3c20, #e74c3c20 4px, transparent 4px, transparent 8px) !important;
    color: #e74c3c !important; border: 1px dashed #e74c3c;
}

/* ── Full-size Gantt bars (kept for legacy/large bars) ── */
.gantt-bar {
    padding: 4px 8px; border-radius: 6px;
    font-size: 11px; font-weight: 600;
    cursor: pointer; margin-bottom: 3px;
    display: flex; align-items: center; gap: 5px;
    transition: transform 0.1s, box-shadow 0.15s;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    color: white;
}
.gantt-bar:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 2;
}
.gantt-bar-icon { font-size: 13px; }
.gantt-bar-time { font-size: 9px; opacity: 0.7; margin-left: auto; }

/* Vacation/absence full */
.gantt-vacation {
    background: repeating-linear-gradient(45deg, #f39c1215, #f39c1215 5px, transparent 5px, transparent 10px);
    border: 1px dashed #f39c12;
    border-radius: 6px; padding: 4px 8px;
    font-size: 10px; color: #e67e22; font-weight: 600;
    text-align: center;
    height: calc(100% - 8px);
    display: flex; align-items: center; justify-content: center;
}
.gantt-absence {
    background: repeating-linear-gradient(45deg, #e74c3c15, #e74c3c15 5px, transparent 5px, transparent 10px);
    border: 1px dashed #e74c3c;
    border-radius: 6px; padding: 4px 8px;
    font-size: 10px; color: #e74c3c; font-weight: 600;
    text-align: center;
    height: calc(100% - 8px);
    display: flex; align-items: center; justify-content: center;
}

/* ── Gantt day (hours) ── */
.gantt-day-container {
    background: white; border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden; border: 1px solid #e8ecf0;
}
.gantt-day-grid {
    display: grid;
    grid-template-columns: 160px repeat(10, 1fr);
}
.gantt-hour-header {
    background: #34495e; color: white;
    text-align: center; padding: 10px 2px;
    font-size: 12px; font-weight: 600;
    border-left: 1px solid #2c3e50;
}
.gantt-hour-header.now { background: #3498db; }

.gantt-hour-cell {
    border-bottom: 1px solid #ecf0f1;
    border-left: 1px solid #f0f2f4;
    min-height: 56px;
    position: relative;
    overflow: visible;
}
.gantt-hour-cell.work-hour { background: #fafcff; }

/* Multi-column span bar */
.gantt-span-bar {
    position: absolute; top: 8px; bottom: 8px;
    border-radius: 8px; padding: 0 10px;
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 600; color: white;
    cursor: pointer; z-index: 1;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: transform 0.1s;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gantt-span-bar:hover { transform: scaleY(1.1); }

/* ── Month week label ── */
.gantt-month-week-label {
    font-size: 11px; font-weight: 700; color: #7f8c8d;
    padding: 8px 0 4px; margin-top: 4px;
}

/* ── Legacy aliases (still used by year) ── */
.cal-week-today     { background: #eaf4fd !important; }
.cal-week-weekend   { background: #f9f9f9 !important; }

/* ── Day grid (legacy - still used by month click) ── */
.cal-day-grid {
    display: grid;
    grid-template-columns: 56px 1fr;
    border: 1px solid #ecf0f1;
    border-radius: 8px;
    overflow: hidden;
    max-height: 70vh;
    overflow-y: auto;
}
.cal-day-time {
    padding: 5px 6px;
    text-align: right;
    font-size: 10px;
    color: #95a5a6;
    background: #f8f9fa;
    border-bottom: 1px solid #ecf0f1;
    border-right: 1px solid #ecf0f1;
}
.cal-day-now { background: #eaf4fd; color: #3498db; font-weight: 700; }
.cal-day-slot {
    padding: 3px 6px;
    min-height: 32px;
    background: white;
    border-bottom: 1px solid #ecf0f1;
}

/* ── Year grid ── */
.cal-year-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.cal-year-month {
    background: white;
    border-radius: 10px;
    padding: 16px 18px;
    cursor: pointer;
    box-shadow: 0 1px 6px rgba(0,0,0,0.07);
    transition: box-shadow 0.2s, transform 0.15s;
}
.cal-year-month:hover { box-shadow: 0 6px 18px rgba(0,0,0,0.12); transform: translateY(-1px); }
.cal-year-current { border: 2px solid #3498db; background: #f8fbff; }
.cal-year-month-name {
    font-size: 15px; font-weight: 700; color: #2c3e50;
    text-align: left; margin-bottom: 10px;
    padding-bottom: 6px; border-bottom: 1px solid #ecf0f1;
}
.cal-year-mini-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
}
.cal-year-mini-hdr {
    font-size: 10px; color: #95a5a6; padding: 4px 0;
    font-weight: 600; text-transform: uppercase;
}
.cal-year-mini-day {
    display: flex; flex-direction: column; align-items: center;
    justify-content: flex-start;
    font-size: 12px; color: #555; padding: 4px 2px 2px;
    border-radius: 6px; min-height: 36px;
    position: relative; transition: background 0.15s;
}
.cal-year-mini-day:hover { background: #f0f2f5; }
.cal-year-day-num { line-height: 1.2; }
.cal-year-today {
    background: #3498db; color: white; border-radius: 6px; font-weight: 700;
}
.cal-year-today:hover { background: #2980b9; }
.cal-year-weekend { color: #bdc3c7; }
.cal-year-other-month { visibility: hidden; }
.cal-year-dots {
    display: flex; gap: 2px; margin-top: 2px;
    justify-content: center; flex-wrap: wrap;
}
.cal-year-dot {
    width: 5px; height: 5px; border-radius: 50%;
    display: inline-block; flex-shrink: 0;
}

/* ── Mobile styles ── */
.cal-mobile-view-bar { display: none; }
.cal-mobile-day {
    background: white;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    cursor: pointer;
}
.cal-mobile-today   { border-left: 4px solid #3498db; }
.cal-mobile-weekend { background: #fdfefe; }
.cal-mobile-day-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.cal-mobile-date-num {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    min-width: 28px;
}
.cal-mobile-today-dot {
    background: #3498db;
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}
.cal-mobile-day-name {
    font-size: 13px;
    color: #7f8c8d;
    flex: 1;
}
.cal-mobile-ev-count {
    background: #3498db;
    color: white;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
}
.cal-mobile-ev {
    padding: 7px 10px;
    border-radius: 5px;
    font-size: 13px;
    color: #2c3e50;
    margin-bottom: 5px;
    cursor: pointer;
}

/* ── Responsive breakpoints ── */
@media (max-width: 1024px) {
    .cal-sidebar  { display: none; }
    .cal-year-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .cal-mobile-view-bar {
        display: flex;
        gap: 4px;
        background: #ecf0f1;
        border-radius: 8px;
        padding: 3px;
        margin-top: 12px;
        justify-content: center;
    }
    .cal-mobile-view-bar .cal-view-btn { flex: 1; text-align: center; font-size: 12px; padding: 6px 4px; }
    /* na mobile chowamy górny pasek widoków */
    #page-calendar .page-header .cal-view-btn-group { display: none; }
    .cal-year-grid { grid-template-columns: 1fr; gap: 10px; }
    .cal-year-month { padding: 12px; }
    .cal-year-month-name { font-size: 13px; }
    .cal-year-mini-day { font-size: 11px; min-height: 32px; }
    #calendarGrid { font-size: 12px; }
}
@media (max-width: 480px) {
    .cal-year-grid { grid-template-columns: 1fr; }
    .cal-month-cell { min-height: 64px; padding: 3px; }
    .cal-cell-date  { font-size: 11px; }
    .cal-ev         { font-size: 9px; padding: 1px 3px; }
}

/* ══════════════════════════════════════════════════
   MENU KATEGORII
══════════════════════════════════════════════════ */
.nav-category { margin-bottom: 4px; }
.nav-category-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.35);
    padding: 12px 12px 3px;
}
.nav-category:first-child .nav-category-label { padding-top: 4px; }
.nav-link { margin-bottom: 1px; font-size: 13px; }

/* ══════════════════════════════════════════════════
   FORMULARZ PRACOWNIKA — siatka uprawnień
══════════════════════════════════════════════════ */
.qe-permissions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid #ecf0f1;
}
.qe-permissions-grid label {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 6px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    color: #2c3e50;
    font-weight: normal;
    transition: background 0.1s;
}
.qe-permissions-grid label:hover { background: #ecf0f1; }

/* ══════════════════════════════════════════════════
   MENU KATEGORII + SIDEBAR COLLAPSE v2
══════════════════════════════════════════════════ */

/* Kategorie */
.nav-category { margin-bottom: 2px; }
.nav-category-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.75);
    padding: 14px 12px 5px;
    user-select: none;
    transition: color 0.15s;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: 4px;
    background: rgba(255,255,255,0.04);
    border-radius: 4px 4px 0 0;
}
.nav-category-label:hover { color: rgba(255,255,255,0.95); }
.nav-cat-items { overflow: hidden; transition: max-height 0.25s ease; max-height: 500px; }
.nav-cat-collapsed { max-height: 0 !important; }
.nav-link { margin-bottom: 1px; font-size: 13px; }

/* Sidebar toggle button */
.nav-sidebar-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    color: rgba(255,255,255,0.45);
    font-size: 12px;
    cursor: pointer;
    border-radius: 5px;
    margin-bottom: 8px;
    transition: all 0.2s;
    user-select: none;
}
.nav-sidebar-toggle:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.8); }
.nav-toggle-label { font-size: 11px; }

/* Collapsed sidebar: icon-only mode */
.sidebar-collapsed {
    width: 56px !important;
    padding: 12px 8px !important;
    overflow: hidden;
}
.sidebar-collapsed .user-badge,
.sidebar-collapsed .user-badge .name,
.sidebar-collapsed #subscriptionExpiry,
.sidebar-collapsed #manageSubscriptionBtn,
.sidebar-collapsed #roleSelector,
.sidebar-collapsed #sidebarTimerContainer {
    display: none !important;
}
.sidebar-collapsed h2 { display: none; }
.sidebar-collapsed::before {
    content: '🪵';
    display: block;
    text-align: center;
    font-size: 22px;
    margin-bottom: 12px;
}
.nav-cat-icon-sep {
    text-align: center;
    font-size: 14px;
    padding: 6px 0 2px;
    opacity: 0.4;
    cursor: default;
    user-select: none;
}
.nav-link-icon {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 10px 4px !important;
    font-size: 18px;
    position: relative;
}

/* ══════════════════════════════════════════════════
   GROUP TAB BAR — zakładki wewnątrz stron
══════════════════════════════════════════════════ */
.group-tab-bar {
    display: flex;
    gap: 0;
    background: white;
    border-bottom: 2px solid #ecf0f1;
    padding: 0 20px;
    flex-wrap: wrap;
}
.group-tab {
    padding: 12px 20px;
    border: none;
    background: none;
    color: #7f8c8d;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    white-space: nowrap;
}
.group-tab:hover {
    color: #2c3e50;
    background: rgba(0,0,0,0.02);
}
.group-tab.active {
    color: #3498db;
    border-bottom-color: #3498db;
}

/* Work timer in sidebar */
.work-timer-display {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    margin-top: 6px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
}
.work-timer-display .timer-value {
    font-weight: 700;
    color: rgba(255,255,255,0.85);
    font-size: 13px;
}

/* ══════════════════════════════════════════════════
   QUICK ACTIONS — mniejsze kafelki
══════════════════════════════════════════════════ */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
}
.qa-tile {
    border-radius: 10px;
    padding: 10px 6px;
    cursor: pointer;
    text-align: center;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    user-select: none;
}
.qa-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 14px rgba(0,0,0,0.18);
}
.qa-tile:active { transform: translateY(0); }
.qa-icon {
    font-size: 20px;
    margin-bottom: 4px;
}
.qa-label {
    font-size: 11px;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

/* ══════════════════════════════════════════════════
   PERMISSIONS GRID (pracownik)
══════════════════════════════════════════════════ */
.qe-permissions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: #f8f9fa;
    padding: 8px;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ecf0f1;
}
.qe-permissions-grid label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 7px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    color: #2c3e50;
    font-weight: normal;
    transition: background 0.1s;
}
.qe-permissions-grid label:hover { background: #ecf0f1; }

@media (max-width: 768px) {
    .quick-actions-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
    .qa-tile { padding: 8px 4px; }
    .qa-icon { font-size: 18px; }
    .qa-label { font-size: 10px; }
    .sidebar-collapsed { display: none !important; }
}

/* ========================================
   SCHEDULER v2 — Style kalendarza godzinowego
   ======================================== */

/* Slot opóźniony */
.cal-ev.cal-delayed {
    border-left-color: #e74c3c !important;
    background: #fee !important;
    color: #c0392b !important;
}

/* Slot z wymuszonym terminem */
.cal-ev.cal-forced {
    border-left-style: dashed !important;
}

/* Godziny pracy — wyróżnienie wiersza 6-14 w widoku tygodnia */
.cal-work-hour {
    background: #f0fdf4 !important;
}
.cal-week-slot.cal-work-hour {
    background: transparent;
}

/* Pasek czasu pracy w widoku dnia */
.cal-gantt-work-band {
    position: absolute;
    background: rgba(39,174,96,0.06);
    border-left: 2px dashed #27ae60;
    border-right: 2px dashed #27ae60;
    top: 0; bottom: 0;
    pointer-events: none;
}

/* Baner opóźnień */
#calDelayBanner {
    animation: slideInDown 0.3s ease;
}
@keyframes slideInDown {
    from { transform: translateY(-10px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

/* Modal opóźnień — tabela */
#delayModal table th {
    padding: 8px 10px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #7f8c8d;
    border-bottom: 2px solid #eee;
}
#delayModal table td {
    padding: 8px 10px;
    font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
}
#delayModal table tr:hover td {
    background: #fafafa;
}

/* Podgląd harmonogramu w modalu dodawania zlecenia */
#schedulePreviewContainer .stage-bar {
    transition: all 0.2s ease;
}
#schedulePreviewContainer .stage-bar:hover {
    transform: translateX(3px);
}

/* Podgląd Gantt — dodatkowe */
.gantt-container::-webkit-scrollbar,
.gantt-day-container::-webkit-scrollbar {
    height: 8px;
}
.gantt-container::-webkit-scrollbar-thumb,
.gantt-day-container::-webkit-scrollbar-thumb {
    background: #bdc3c7; border-radius: 4px;
}
.gantt-container::-webkit-scrollbar-track,
.gantt-day-container::-webkit-scrollbar-track {
    background: #f0f2f5;
}

/* Legenda pozioma nad kalendarzem */
.cal-legend-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.cal-legend-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: var(--lc, #7f8c8d);
    white-space: nowrap;
    line-height: 1.4;
}

/* Filtr pracowników — dropdown */
.cal-worker-panel {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 200;
    background: #fff;
    border: 1px solid #dfe6e9;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    padding: 10px;
    min-width: 200px;
    max-height: 320px;
    overflow-y: auto;
}
.cal-worker-panel.active {
    display: block;
}
.cal-worker-panel label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 6px;
}
.cal-worker-panel label:hover {
    background: #f0f2f5;
}

/* ── Google Drive panel ── */
.drive-folder-panel {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 12px;
    margin: 10px 0;
}
.drive-folder-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}
.drive-subfolder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 6px;
}
.drive-subfolder-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-size: 12px;
    color: #2c3e50;
    text-decoration: none;
    transition: all 0.15s;
    cursor: pointer;
}
.drive-subfolder-link:hover {
    background: #ebf5fb;
    border-color: #3498db;
    color: #3498db;
}
.drive-files-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.drive-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none;
    color: #2c3e50;
    font-size: 12px;
    transition: background 0.15s;
}
.drive-file-item:hover { background: #f0f2f5; }
.drive-file-icon { font-size: 16px; flex-shrink: 0; }
.drive-file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drive-file-meta { font-size: 10px; color: #95a5a6; white-space: nowrap; }

/* Drive client grid on Disk page */
.drive-client-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
}
.drive-client-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 10px 12px;
    transition: border-color 0.15s;
}
.drive-client-card:hover { border-color: #3498db; }
.drive-client-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.drive-client-items {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-left: 8px;
    border-left: 2px solid #e9ecef;
}
.drive-item-link {
    font-size: 12px;
    color: #555;
    text-decoration: none;
    padding: 3px 6px;
    border-radius: 4px;
    transition: background 0.15s;
}
.drive-item-link:hover { background: #e8f4fd; color: #3498db; }

/* Drive file browser */
.drive-browse-list {
    display: flex;
    flex-direction: column;
}
.drive-browse-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    cursor: pointer;
    transition: background 0.1s;
    border-bottom: 1px solid #f8f9fa;
}
.drive-browse-item:hover { background: #f0f7ff; }
.drive-browse-folder { font-weight: 600; }
.drive-browse-icon { font-size: 18px; flex-shrink: 0; width: 24px; text-align: center; }
.drive-browse-name {
    flex: 1;
    font-size: 13px;
    color: #2c3e50;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.drive-browse-meta {
    font-size: 11px;
    color: #95a5a6;
    white-space: nowrap;
    min-width: 50px;
    text-align: right;
}

/* Spinner ładowania */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #ddd;
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================================
   MODUŁ MAGAZYNU — WoodPlan v7
   ======================================================== */

.mag-wrapper {
  padding: 0;
}

/* Zakładki główne modułu */
.mag-tabs {
  display: flex;
  gap: 2px;
  background: #ecf0f1;
  border-radius: 10px;
  padding: 4px;
  margin: 16px 0;
  flex-wrap: wrap;
}

.mag-tab-btn {
  flex: 1;
  min-width: 130px;
  padding: 10px 16px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #7f8c8d;
  transition: all 0.2s;
  white-space: nowrap;
}

.mag-tab-btn.active {
  background: #fff;
  color: #2c3e50;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.mag-tab-btn:hover:not(.active) {
  background: rgba(255,255,255,0.5);
  color: #2c3e50;
}

/* Stat cards */
.mag-stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.mag-stat-card {
  background: #fff;
  border: 1px solid #e8ecef;
  border-radius: 10px;
  padding: 16px 20px;
  border-left: 4px solid #3498db;
}

.mag-stat-card.mag-stat-amber { border-left-color: #f39c12; }
.mag-stat-card.mag-stat-red   { border-left-color: #e74c3c; }
.mag-stat-card.mag-stat-green { border-left-color: #27ae60; }

.mag-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #2c3e50;
  line-height: 1.1;
}

.mag-stat-label {
  font-size: 12px;
  color: #7f8c8d;
  margin-top: 4px;
  font-weight: 500;
}

/* Actions row */
.mag-actions-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* Pill tabs (category filter) */
.mag-pill-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mag-pill {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid #ddd;
  background: #fff;
  color: #555;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}

.mag-pill.active {
  background: #2c3e50;
  color: #fff;
  border-color: #2c3e50;
}

.mag-pill:hover:not(.active) {
  background: #f0f0f0;
}

/* Table wrapper */
.mag-table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid #e8ecef;
  background: #fff;
}

.mag-table {
  width: 100%;
  font-size: 13px;
}

/* Row status colors */
tr.mag-row-low {
  background: #fffbea !important;
}
tr.mag-row-critical {
  background: #fff5f5 !important;
}

/* Badges */
.mag-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.mag-badge-green  { background: #e8f5e9; color: #2e7d32; }
.mag-badge-amber  { background: #fff8e1; color: #f57c00; }
.mag-badge-red    { background: #ffebee; color: #c62828; }
.mag-badge-blue   { background: #e3f2fd; color: #1565c0; }

/* Category badge chips */
.mag-cat-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.cat-plyty     { background: #e3f2fd; color: #1976d2; }
.cat-obrzeza   { background: #fff3e0; color: #f57c00; }
.cat-akcesoria { background: #e8f5e9; color: #388e3c; }
.cat-chemia    { background: #f3e5f5; color: #7b1fa2; }
.cat-bhp       { background: #fce4ec; color: #c62828; }
.cat-biurowe   { background: #e0f2f1; color: #00796b; }
.cat-inne      { background: #f5f5f5; color: #616161; }

/* Magazyn zleceń — karty */
.mag-orders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 16px;
}

.mag-order-card {
  background: #fff;
  border: 1px solid #e8ecef;
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.mag-order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.mag-order-total {
  font-size: 15px;
  font-weight: 700;
  color: #2c3e50;
  background: #f0f4f8;
  padding: 4px 12px;
  border-radius: 20px;
}

.mag-order-materials-table {
  width: 100%;
  font-size: 12px;
  border-collapse: collapse;
  margin-bottom: 12px;
}

.mag-order-materials-table th {
  background: #f8f9fa;
  padding: 6px 8px;
  text-align: left;
  font-weight: 600;
  color: #555;
  border-bottom: 1px solid #eee;
}

.mag-order-materials-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #f5f5f5;
}

.mag-order-card-footer {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
}

/* Dostawcy */
.mag-suppliers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.mag-supplier-card {
  background: #fff;
  border: 1px solid #e8ecef;
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.mag-supplier-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.mag-supplier-info {
  font-size: 13px;
  color: #555;
  line-height: 1.7;
  margin-bottom: 8px;
}

.mag-supplier-info a {
  color: #3498db;
  text-decoration: none;
}

.mag-supplier-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}

/* Historia ruchów — filtry */
.mag-history-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
  padding: 14px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e8ecef;
}

.mag-filter-input {
  padding: 7px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  color: #2c3e50;
}

.mag-filter-input:focus {
  outline: none;
  border-color: #3498db;
}

/* Modal close button alias */
.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #999;
  padding: 0;
  line-height: 1;
}

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

/* Responsive */
@media (max-width: 768px) {
  .mag-tabs {
    flex-direction: column;
  }
  .mag-tab-btn {
    min-width: auto;
    text-align: left;
  }
  .mag-stat-cards {
    grid-template-columns: 1fr 1fr;
  }
  .mag-orders-grid,
  .mag-suppliers-grid {
    grid-template-columns: 1fr;
  }
  .mag-actions-row {
    flex-direction: column;
  }
  .mag-history-filters {
    flex-direction: column;
  }
}

/* form-row alias for magazine module */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
}

/* ========================================================
   MODUŁ BOM (Bill of Materials) — WoodPlan v7
   ======================================================== */

/* Modal shell */
.bom-modal-content {
  max-width: 920px;
  width: 96vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

.bom-header {
  background: linear-gradient(135deg, #2c3e50 0%, #3d5a7a 100%);
  color: #fff;
  border-radius: 10px 10px 0 0;
}

.bom-header h3 { color: #fff; }
.bom-header .modal-close { color: rgba(255,255,255,0.7); }
.bom-header .modal-close:hover { color: #fff; }

/* Progress bar */
.bom-progress {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  background: #f8f9fa;
  border-bottom: 1px solid #e8ecef;
  overflow-x: auto;
}

.bom-step-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 64px;
}

.bom-step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ddd;
  color: #888;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s;
}

.bom-step-indicator.active .bom-step-circle {
  background: #3498db;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.2);
}

.bom-step-indicator.done .bom-step-circle {
  background: #27ae60;
  color: #fff;
}

.bom-step-line {
  flex: 1;
  height: 2px;
  background: #ddd;
  min-width: 24px;
  margin-bottom: 20px;
}

.bom-step-label {
  font-size: 11px;
  color: #999;
  font-weight: 500;
  text-align: center;
}

.bom-step-indicator.active .bom-step-label,
.bom-step-indicator.done .bom-step-label {
  color: #2c3e50;
}

/* Body & footer */
.bom-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.bom-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-top: 1px solid #e8ecef;
  background: #fafafa;
  border-radius: 0 0 10px 10px;
}

/* Step 1: Source cards */
.bom-source-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.bom-source-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 12px;
  border: 2px solid #e8ecef;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  background: #fff;
}

.bom-source-card:hover {
  border-color: #3498db;
  background: #f0f7ff;
}

.bom-source-card.selected {
  border-color: #3498db;
  background: #ebf5fb;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.bom-source-card input[type="radio"] { display: none; }
.bom-source-icon { font-size: 28px; }
.bom-source-name { font-weight: 700; font-size: 13px; color: #2c3e50; }
.bom-source-desc { font-size: 11px; color: #7f8c8d; line-height: 1.4; }

/* Upload zone */
.bom-upload-zone {
  border: 2px dashed #c0cfe0;
  border-radius: 10px;
  padding: 32px;
  text-align: center;
  background: #f8fbff;
  transition: all 0.2s;
  cursor: pointer;
}

.bom-upload-zone.drag-over {
  border-color: #3498db;
  background: #ebf5fb;
}

/* Step 2: Plates table */
.bom-table-scroll {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid #e8ecef;
}

.bom-plates-table th,
.bom-plates-table td {
  padding: 4px 6px;
}

.bom-cell-input {
  padding: 4px 6px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 12px;
  background: #fff;
  color: #2c3e50;
  box-sizing: border-box;
}

.bom-cell-input:focus {
  outline: none;
  border-color: #3498db;
  background: #f0f7ff;
}

select.bom-cell-input { cursor: pointer; }

/* Step 5: Cost summary box */
.bom-cost-summary {
  margin-top: 20px;
  padding: 18px 20px;
  background: #f8f9fa;
  border-radius: 10px;
  border: 1px solid #e8ecef;
}

.bom-cost-summary table { border-collapse: collapse; }
.bom-cost-summary td { padding: 4px 8px; }

/* Responsive */
@media (max-width: 768px) {
  .bom-modal-content { max-width: 100vw; border-radius: 0; }
  .bom-source-cards { grid-template-columns: 1fr 1fr; }
  .bom-progress { padding: 10px 12px; }
  .bom-step-label { display: none; }
}

/* ========================================================
   MODUŁ ZADANIA HUB — WoodPlan v7
   ======================================================== */

.th-wrapper { padding: 0; }

/* Header */
.th-header { flex-wrap: wrap; gap: 12px; }

/* View switcher */
.th-view-switcher {
  display: flex;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
}
.th-view-btn {
  padding: 7px 14px;
  border: none;
  background: #fff;
  cursor: pointer;
  font-size: 15px;
  border-right: 1px solid #ddd;
  transition: background 0.15s;
}
.th-view-btn:last-child { border-right: none; }
.th-view-btn.active { background: #2c3e50; color: #fff; }
.th-view-btn:hover:not(.active) { background: #f5f5f5; }

/* Search */
.th-search {
  padding: 8px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 13px;
  width: 220px;
  background: #fff;
}
.th-search:focus { outline: none; border-color: #3498db; }

/* Add dropdown */
.th-add-dropdown { position: relative; }
.th-add-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 1000;
  min-width: 220px;
  overflow: hidden;
}
.th-add-menu button {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  color: #2c3e50;
  transition: background 0.1s;
}
.th-add-menu button:hover { background: #f5f5f5; }
.th-priority-item { color: #e74c3c !important; font-weight: 700; }

/* Type tabs */
.th-type-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 12px 0 16px;
}
.th-type-tab {
  padding: 7px 16px;
  border-radius: 20px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #555;
  transition: all 0.15s;
}
.th-type-tab.active { background: #2c3e50; color: #fff; border-color: #2c3e50; }
.th-type-tab:hover:not(.active) { background: #f0f0f0; }
.th-priority-tab.active { background: #e74c3c; border-color: #e74c3c; }

/* List view */
.th-list-wrap { overflow-x: auto; border-radius: 8px; border: 1px solid #e8ecef; background: #fff; }
.th-list-table { width: 100%; }
.th-row-priority { background: #fff8f8 !important; }
.th-row-overdue { background: #fff3f3 !important; }
.th-empty { text-align: center; padding: 48px; color: #999; font-size: 14px; }

/* Progress bar */
.th-progress-bar {
  height: 6px;
  background: #eee;
  border-radius: 3px;
  overflow: hidden;
}
.th-progress-lg { height: 10px; border-radius: 5px; }
.th-progress-fill { height: 100%; border-radius: inherit; transition: width 0.3s; }

/* Stage pill */
.th-stage-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* Priority badges */
.th-badge { display: inline-block; padding: 3px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.th-badge-max    { background: #ffebee; color: #c62828; }
.th-badge-high   { background: #fff3e0; color: #e65100; }
.th-badge-normal { background: #f5f5f5; color: #616161; }
.th-badge-low    { background: #e3f2fd; color: #1565c0; }

/* Mobile task card */
.th-mobile-list { display: flex; flex-direction: column; gap: 10px; }
.th-task-card {
  background: #fff;
  border: 1px solid #e8ecef;
  border-left: 4px solid #ddd;
  border-radius: 8px;
  padding: 14px;
  cursor: pointer;
  transition: box-shadow 0.15s;
}
.th-task-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.th-card-priority { border-left-color: #e74c3c !important; background: #fff8f8; }
.th-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 4px; }
.th-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 12px; }

/* Kanban */
.th-kanban {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 16px;
  align-items: flex-start;
}
.th-kanban-col {
  min-width: 220px;
  max-width: 280px;
  flex: 0 0 auto;
  background: #f8f9fa;
  border-radius: 10px;
  overflow: hidden;
}
.th-kanban-col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  font-weight: 700;
  font-size: 13px;
}
.th-count-badge {
  background: rgba(0,0,0,0.12);
  color: inherit;
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 12px;
}
.th-kanban-cards { padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.th-kanban-card {
  background: #fff;
  border: 1px solid #e8ecef;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  transition: box-shadow 0.15s;
  font-size: 13px;
}
.th-kanban-card:hover { box-shadow: 0 2px 6px rgba(0,0,0,0.1); }
.th-kanban-priority { border-color: #e74c3c; box-shadow: 0 0 0 2px #e74c3c30; }

/* Calendar */
.th-calendar { }
.th-cal-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}
.th-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.th-cal-header-cell {
  padding: 8px 4px;
  text-align: center;
  font-weight: 700;
  font-size: 12px;
  color: #666;
  background: #f8f9fa;
}
.th-cal-cell {
  min-height: 80px;
  background: #fff;
  border: 1px solid #e8ecef;
  border-radius: 4px;
  padding: 4px;
  cursor: pointer;
  transition: background 0.1s;
}
.th-cal-cell:hover { background: #f0f7ff; }
.th-cal-empty { background: #fafafa; cursor: default; }
.th-cal-today { background: #ebf5fb; border-color: #3498db; }
.th-cal-priority-day { border-color: #e74c3c; }
.th-cal-day-num { font-weight: 700; font-size: 12px; color: #2c3e50; margin-bottom: 2px; }
.th-cal-event {
  display: block;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 10px;
  color: #fff;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.th-cal-more { font-size: 10px; color: #999; }

/* Detail modal */
.th-detail-modal {
  max-width: 780px;
  width: 96vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.th-detail-modal .modal-header {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: #fff;
  border-radius: 10px 10px 0 0;
}
.th-detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

/* Detail sections */
.th-detail-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #f0f0f0;
}
.th-detail-section:last-child { border-bottom: none; }
.th-detail-section h4 { margin: 0 0 12px; font-size: 14px; color: #2c3e50; }

/* Prerequisites */
.th-prereq-list { display: flex; flex-direction: column; gap: 8px; }
.th-prereq-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #eee;
}
.th-prereq-item.ok    { background: #f0fff4; border-color: #c8e6c9; }
.th-prereq-item.missing { background: #fff5f5; border-color: #ffcdd2; }
.th-prereq-item > div:nth-child(2) { flex: 1; }

/* Stage track */
.th-stages-track {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  padding: 4px 0;
}
.th-stage-node { display: flex; flex-direction: column; align-items: center; min-width: 80px; }
.th-stage-circle {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #ddd;
  color: #999;
  font-size: 12px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.25s;
}
.th-stage-node.done .th-stage-circle    { background: #27ae60; color: #fff; }
.th-stage-node.active .th-stage-circle  { background: #3498db; color: #fff; box-shadow: 0 0 0 4px rgba(52,152,219,0.2); }
.th-stage-node.future .th-stage-circle  { background: #ecf0f1; color: #bdc3c7; }
.th-stage-node-label { font-size: 9px; color: #999; text-align: center; margin-top: 3px; max-width: 80px; }
.th-stage-node.active .th-stage-node-label { color: #3498db; font-weight: 700; }
.th-stage-node.done .th-stage-node-label   { color: #27ae60; }
.th-stage-connector { flex: 1; height: 2px; background: #ecf0f1; min-width: 12px; }
.th-stage-connector.done { background: #27ae60; }

/* Checklist */
.th-checklist { display: flex; flex-direction: column; gap: 6px; }
.th-checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #eee;
  cursor: pointer;
  transition: background 0.1s;
  font-size: 13px;
}
.th-checklist-item:hover { background: #f8f9fa; }
.th-checklist-item.checked { background: #f0fff4; border-color: #c8e6c9; color: #555; text-decoration: line-through; }
.th-checklist-item input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; }
.th-checklist-progress { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; flex-wrap: wrap; gap: 8px; }

/* Circulation list cards */
.th-circ-card {
  background: #f8f9fa;
  border: 1px solid #e8ecef;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

/* Quote amount */
.th-quote-amount {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 14px 20px;
  border: 1px solid #e8ecef;
}

/* History */
.th-history { display: flex; flex-direction: column; gap: 0; }
.th-history-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 8px 0;
  border-left: 2px solid #e8ecef;
  padding-left: 16px;
  position: relative;
}
.th-history-dot {
  position: absolute;
  left: -5px;
  top: 12px;
  width: 8px; height: 8px;
  background: #3498db;
  border-radius: 50%;
}

/* Detail actions */
.th-detail-actions { background: #fafafa; border-radius: 8px; padding: 14px; }

/* Responsive */
@media (max-width: 768px) {
  .th-search { width: 140px; }
  .th-kanban { flex-direction: column; }
  .th-kanban-col { min-width: auto; max-width: 100%; }
  .th-stages-track { flex-wrap: wrap; gap: 8px; }
  .th-stage-connector { display: none; }
  .th-cal-grid { font-size: 10px; }
  .th-cal-cell { min-height: 50px; }
}

/* ========================================================
   PWA — Mobile UI dla Montera / Stolarza — WoodPlan v7
   ======================================================== */

/* ── Shell ── */
.pwa-shell {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #f5f6fa;
  font-family: inherit;
  z-index: 9000;
  -webkit-tap-highlight-color: transparent;
}

/* ── Network Banner ── */
.pwa-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.3s, opacity 0.5s;
}
.pwa-banner-online  { background: #e8f5e9; color: #2e7d32; }
.pwa-banner-offline { background: #fff8e1; color: #e65100; }
.pwa-banner-syncing { background: #e3f2fd; color: #1565c0; }
.pwa-banner-icon { font-size: 14px; }
.pwa-banner-text { flex: 1; }
.pwa-banner-btn {
  padding: 4px 12px;
  border-radius: 12px;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* ── Header ── */
.pwa-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #1A2B3C;
  color: #fff;
  flex-shrink: 0;
}
.pwa-header-left { display: flex; flex-direction: column; }
.pwa-logo { font-size: 17px; font-weight: 800; letter-spacing: -0.3px; }
.pwa-date { font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 1px; }
.pwa-header-right { display: flex; align-items: center; gap: 10px; }
.pwa-user-badge {
  font-size: 12px;
  color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.1);
  padding: 4px 10px;
  border-radius: 12px;
}
.pwa-icon-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  min-width: 48px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pwa-icon-btn:active { color: #fff; }

/* ── Content ── */
.pwa-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* ── Bottom Nav ── */
.pwa-bottom-nav {
  display: flex;
  background: #fff;
  border-top: 1px solid #e8ecef;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  flex-shrink: 0;
}
.pwa-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 4px 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: #7f8c8d;
  transition: color 0.15s;
  min-height: 56px;
}
.pwa-nav-btn.active { color: #1A2B3C; }
.pwa-nav-btn:active { opacity: 0.7; }
.pwa-nav-icon { font-size: 22px; }
.pwa-nav-label { font-size: 11px; font-weight: 600; margin-top: 2px; }

/* ── Screen ── */
.pwa-screen { padding: 16px; padding-bottom: 24px; }
.pwa-screen-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.pwa-screen-title h2 { margin: 0; font-size: 20px; }
.pwa-role-badge {
  font-size: 12px;
  background: #1A2B3C;
  color: #fff;
  padding: 4px 12px;
  border-radius: 12px;
  font-weight: 700;
}
.pwa-loading { text-align: center; padding: 48px; color: #999; font-size: 18px; }
.pwa-empty   { text-align: center; padding: 48px; color: #999; }

/* ── Task Cards (Today screen) ── */
.pwa-task-list { display: flex; flex-direction: column; gap: 12px; }
.pwa-task-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid #e8ecef;
  border-left: 4px solid #3498db;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: box-shadow 0.15s;
  -webkit-tap-highlight-color: rgba(0,0,0,0.04);
}
.pwa-task-card:active { box-shadow: 0 0 0 2px #3498db40; }
.pwa-task-priority { border-left-color: #e74c3c; background: #fff8f8; }
.pwa-task-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.pwa-task-num { font-weight: 800; font-size: 15px; color: #2c3e50; }
.pwa-status-badge { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 10px; }
.pwa-task-client { font-size: 16px; font-weight: 600; color: #2c3e50; margin-bottom: 4px; }
.pwa-task-address { font-size: 13px; color: #7f8c8d; margin-bottom: 10px; }
.pwa-task-footer { display: flex; justify-content: space-between; align-items: center; }

/* ── Task Detail ── */
.pwa-task-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
}
.pwa-back-btn {
  background: none;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  color: #2c3e50;
  cursor: pointer;
  min-height: 48px;
  white-space: nowrap;
}
.pwa-detail-num { font-size: 17px; font-weight: 800; color: #2c3e50; }
.pwa-detail-client { font-size: 14px; color: #7f8c8d; }
.pwa-quick-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

/* ── Sections ── */
.pwa-section {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
  border: 1px solid #e8ecef;
}
.pwa-section-title {
  font-size: 14px;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pwa-progress-text { font-size: 12px; color: #7f8c8d; font-weight: 500; }
.pwa-progress-bar-wrap {
  height: 6px;
  background: #eee;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}
.pwa-progress-bar-fill {
  height: 100%;
  background: #27ae60;
  border-radius: 3px;
  transition: width 0.3s;
}

/* ── Checklist ── */
.pwa-checklist { display: flex; flex-direction: column; gap: 8px; }
.pwa-check-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  border: 1.5px solid #e8ecef;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 56px;
}
.pwa-check-item:active { background: #f5f5f5; }
.pwa-check-item.checked { background: #f0fff4; border-color: #c8e6c9; }
.pwa-check-item input[type="checkbox"] {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  margin-top: 1px;
  cursor: pointer;
  accent-color: #27ae60;
}
.pwa-check-text {
  font-size: 15px;
  line-height: 1.4;
  color: #2c3e50;
}
.pwa-check-item.checked .pwa-check-text { text-decoration: line-through; color: #7f8c8d; }

/* ── Photos ── */
.pwa-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.pwa-photo-thumb {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1;
  background: #f0f0f0;
}
.pwa-photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pwa-synced-badge, .pwa-unsynced-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 8px;
}
.pwa-synced-badge   { background: #27ae60; color: #fff; }
.pwa-unsynced-badge { background: #f39c12; color: #fff; }
.pwa-photo-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed #c0d0e0;
  border-radius: 8px;
  aspect-ratio: 1;
  cursor: pointer;
  color: #7f8c8d;
  transition: background 0.15s;
}
.pwa-photo-add:active { background: #f0f0f0; }

/* ── Signature ── */
.pwa-sig-hint { font-size: 13px; color: #999; margin-bottom: 8px; }
.pwa-sig-canvas {
  width: 100%;
  height: 140px;
  border: 2px solid #e8ecef;
  border-radius: 10px;
  background: #fafafa;
  display: block;
  touch-action: none;
}
.pwa-sig-actions { display: flex; gap: 10px; margin-top: 10px; }
.pwa-sig-done {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: #f0fff4;
  border-radius: 8px;
  border: 1px solid #c8e6c9;
  font-size: 13px;
  color: #2e7d32;
  margin-bottom: 10px;
}

/* ── Submit area ── */
.pwa-submit-area {
  padding: 4px 0 8px;
}
.pwa-submit-hint {
  font-size: 13px;
  color: #f39c12;
  margin-bottom: 8px;
  padding: 8px 12px;
  background: #fff8e1;
  border-radius: 6px;
}

/* ── PWA Buttons ── */
.pwa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 20px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  text-decoration: none;
  min-height: 48px;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.pwa-btn:active { opacity: 0.75; }
.pwa-btn-primary  { background: #1A2B3C; color: #fff; }
.pwa-btn-outline  { background: transparent; border: 2px solid #1A2B3C; color: #1A2B3C; }
.pwa-btn-action   { background: #f0f4f8; color: #2c3e50; border: 1px solid #ddd; flex: 1; text-align: center; }
.pwa-btn-sm       { padding: 8px 14px; font-size: 13px; min-height: 40px; }
.pwa-btn-full     { width: 100%; }
.pwa-btn.disabled, .pwa-btn:disabled {
  background: #ccc;
  color: #888;
  cursor: not-allowed;
  opacity: 0.7;
}

/* ── Report ── */
.pwa-report-date { font-size: 15px; font-weight: 600; color: #2c3e50; margin-bottom: 16px; }
.pwa-report-tasks { display: flex; flex-direction: column; gap: 4px; }
.pwa-report-task-item { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; border-bottom: 1px solid #f0f0f0; }
.pwa-time-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Forms ── */
.pwa-form-group { display: flex; flex-direction: column; gap: 4px; }
.pwa-label { font-size: 13px; font-weight: 600; color: #555; }
.pwa-input {
  padding: 12px 14px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
  color: #2c3e50;
  min-height: 48px;
}
.pwa-input:focus { outline: none; border-color: #1A2B3C; }
.pwa-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  color: #2c3e50;
  background: #fff;
  resize: vertical;
  min-height: 100px;
  box-sizing: border-box;
}
.pwa-textarea:focus { outline: none; border-color: #1A2B3C; }

/* ── Install guide ── */
.pwa-install-section { margin-bottom: 20px; }
.pwa-install-section h4 { margin: 0 0 10px; font-size: 15px; }
.pwa-install-steps { margin: 0; padding-left: 20px; }
.pwa-install-steps li { margin-bottom: 8px; font-size: 14px; line-height: 1.5; }

/* ── Stolarz BOM checklist ── */
.pwa-bom-list { display: flex; flex-direction: column; gap: 8px; }
.pwa-bom-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #e8ecef;
  border-radius: 10px;
  min-height: 56px;
}
.pwa-bom-item input[type="checkbox"] { width: 24px; height: 24px; accent-color: #9b59b6; flex-shrink: 0; }
.pwa-bom-item-name { flex: 1; font-size: 14px; font-weight: 600; }
.pwa-bom-item-qty  { font-size: 13px; color: #7f8c8d; white-space: nowrap; }

/* ── Stolarz extras ── */
.pwa-bom-received { opacity: 0.5; }
.pwa-bom-received .pwa-bom-item-name { text-decoration: line-through; }
.pwa-mag-ready   { font-size: 11px; font-weight: 700; color: #27ae60; margin-left: 6px; }
.pwa-mag-pending { font-size: 11px; font-weight: 700; color: #f39c12; margin-left: 6px; }

/* ── Install prompt banner (desktop + iOS hint) ── */
.pwa-install-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1A2B3C;
  color: #fff;
  border-radius: 14px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  z-index: 9999;
  max-width: 380px;
  width: calc(100vw - 32px);
  animation: slideUp 0.4s ease;
}
@keyframes slideUp {
  from { transform: translateX(-50%) translateY(100px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0);    opacity: 1; }
}
.pwa-install-banner-text { flex: 1; font-size: 14px; line-height: 1.4; }
.pwa-install-banner-text strong { display: block; font-size: 15px; margin-bottom: 2px; }
.pwa-install-banner-btn {
  background: #3498db;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  min-height: 44px;
}
.pwa-install-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

/* ══════════════════════════════════════════════════════════════════
   CALCULATOR — Redesigned UI
   ══════════════════════════════════════════════════════════════════ */

/* ── Header ── */
.calc-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; }
.calc-header h2 { font-size:22px; font-weight:800; color:#0f172a; margin:0; }
.calc-header .calc-subtitle { font-size:13px; color:#6b7280; margin-top:2px; }
.calc-header-actions { display:flex; gap:8px; }
.calc-header-actions button {
  padding:8px 14px; border-radius:8px; border:1px solid #e2e8f0;
  background:#fff; font-size:13px; cursor:pointer; color:#475569; transition:all .15s;
}
.calc-header-actions button:hover { background:#f8fafc; border-color:#cbd5e1; }

/* ── Step Bar ── */
.calc-step-bar {
  display:flex; gap:4px; margin-bottom:24px;
  background:#fff; border-radius:12px; padding:6px;
  box-shadow:0 1px 3px rgba(0,0,0,.06);
}
.calc-step-item {
  flex:1; display:flex; align-items:center; justify-content:center; gap:8px;
  padding:12px 16px; border-radius:8px; font-size:13px; font-weight:600;
  color:#94a3b8; cursor:pointer; transition:all .2s;
}
.calc-step-item.active { background:#1e40af; color:#fff; box-shadow:0 2px 8px rgba(30,64,175,.3); }
.calc-step-num {
  width:24px; height:24px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  font-size:11px; font-weight:700; background:#e2e8f0; color:#64748b;
}
.calc-step-item.active .calc-step-num { background:rgba(255,255,255,.25); color:#fff; }
.calc-step-badge { background:#ef4444; color:#fff; font-size:10px; padding:2px 6px; border-radius:10px; font-weight:700; }
.calc-step-item.active .calc-step-badge { background:rgba(255,255,255,.3); }

/* ── Main Layout ── */
.calc-main { display:flex; gap:20px; align-items:flex-start; margin-bottom:24px; }
.calc-form-col { flex:5; min-width:0; }
.calc-preview-col { flex:3; min-width:320px; position:sticky; top:20px; }

/* ── Mode Switch ── */
.calc-mode-switch { display:flex; background:#f1f5f9; border-radius:10px; padding:4px; gap:4px; margin-bottom:16px; }
.calc-mode-btn {
  flex:1; padding:10px 12px; border:none; border-radius:8px; cursor:pointer;
  font-size:13px; font-weight:600; background:transparent; color:#64748b; transition:all .2s;
}
.calc-mode-btn.active { background:#1e40af; color:#fff; box-shadow:0 2px 6px rgba(30,64,175,.25); }
.calc-mode-btn.active-wolna { background:#6d28d9; color:#fff; box-shadow:0 2px 6px rgba(109,40,217,.25); }
.calc-mode-btn.active-cad { background:#065f46; color:#fff; box-shadow:0 2px 6px rgba(6,95,70,.25); }
.calc-mode-btn:not(.active):not(.active-wolna):not(.active-cad):hover { background:#e2e8f0; }

/* ── Form Card ── */
.calc-form-card {
  background:#fff; border-radius:14px; overflow:hidden;
  box-shadow:0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.04);
}

/* ── Accordion Sections ── */
.calc-acc { border-bottom:1px solid #f1f5f9; }
.calc-acc:last-child { border-bottom:none; }
.calc-acc-header {
  display:flex; align-items:center; gap:10px; padding:14px 18px;
  cursor:pointer; user-select:none; transition:background .15s;
}
.calc-acc-header:hover { background:#fafbfc; }
.calc-acc-icon {
  font-size:15px; width:32px; height:32px; display:flex; align-items:center; justify-content:center;
  background:#f1f5f9; border-radius:8px; flex-shrink:0;
}
.calc-acc-title { font-size:14px; font-weight:700; flex:1; color:#0f172a; }
.calc-acc-sub { font-size:11px; color:#94a3b8; margin-left:auto; }
.calc-acc-chev { color:#94a3b8; font-size:11px; transition:transform .2s; margin-left:8px; }
.calc-acc.closed .calc-acc-chev { transform:rotate(-90deg); }
.calc-acc.closed .calc-acc-body { display:none; }
.calc-acc-body { padding:0 18px 16px 18px; }

/* ── Form Fields ── */
.calc-field { margin-bottom:14px; }
.calc-field label {
  display:block; font-size:11px; font-weight:700; color:#64748b;
  margin-bottom:5px; text-transform:uppercase; letter-spacing:.3px;
}
.calc-field input, .calc-field select, .calc-field textarea {
  width:100%; padding:10px 12px; border:1.5px solid #e2e8f0; border-radius:8px;
  font-size:14px; color:#1e293b; background:#fff; transition:all .15s;
  outline:none; font-family:inherit; box-sizing:border-box;
}
.calc-field input:focus, .calc-field select:focus, .calc-field textarea:focus {
  border-color:#3b82f6; box-shadow:0 0 0 3px rgba(59,130,246,.12);
}
.calc-field textarea { resize:none; }
.calc-field .calc-hint { font-size:11px; color:#94a3b8; margin-top:4px; }

/* Dims Row */
.calc-dims-row { display:flex; gap:8px; }
.calc-dim-input { flex:1; position:relative; }
.calc-dim-input input { padding-right:34px; }
.calc-dim-input .calc-dim-label {
  position:absolute; right:10px; top:50%; transform:translateY(-50%);
  font-size:11px; color:#94a3b8; font-weight:500; pointer-events:none;
}
.calc-dims-info {
  display:flex; gap:12px; margin-top:6px; padding:8px 10px;
  background:#f8fafc; border-radius:6px; font-size:11px; color:#64748b;
}
.calc-dims-info span { font-weight:600; color:#475569; }

/* ── Toggle Buttons ── */
.calc-toggle-group { display:flex; gap:4px; background:#f1f5f9; border-radius:8px; padding:3px; }
.calc-toggle-btn {
  flex:1; padding:8px; border:none; border-radius:6px; cursor:pointer;
  font-size:12px; font-weight:600; background:transparent; color:#64748b; transition:all .15s;
}
.calc-toggle-btn.active { background:#fff; color:#1e293b; box-shadow:0 1px 3px rgba(0,0,0,.1); }

/* ── Lighting Toggle ── */
.calc-lighting-on {
  display:flex; align-items:center; gap:10px; padding:10px 14px;
  background:#fffbeb; border:1.5px solid #fde68a; border-radius:8px; cursor:pointer;
}
.calc-lighting-off {
  display:flex; align-items:center; gap:10px; padding:10px 14px;
  background:#fff; border:1.5px solid #e2e8f0; border-radius:8px; cursor:pointer;
}
.calc-lt-dot { width:8px; height:8px; border-radius:50%; background:#f59e0b; flex-shrink:0; }
.calc-lt-text { flex:1; font-size:13px; font-weight:500; }
.calc-lighting-on .calc-lt-text { color:#92400e; }
.calc-lighting-off .calc-lt-text { color:#64748b; }
.calc-lt-switch {
  width:40px; height:22px; border-radius:11px; position:relative; flex-shrink:0; transition:background .2s;
}
.calc-lighting-on .calc-lt-switch { background:#f59e0b; }
.calc-lighting-off .calc-lt-switch { background:#cbd5e1; }
.calc-lt-switch::after {
  content:''; position:absolute; top:2px; width:18px; height:18px;
  border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.2); transition:left .2s;
}
.calc-lighting-on .calc-lt-switch::after { left:20px; }
.calc-lighting-off .calc-lt-switch::after { left:2px; }

/* ── Extra row ── */
.calc-extra-row {
  display:flex; gap:6px; margin-bottom:6px; align-items:center;
}
.calc-extra-row input {
  padding:8px 10px; border:1.5px solid #e2e8f0; border-radius:8px; font-size:13px;
  outline:none; font-family:inherit; box-sizing:border-box;
}
.calc-extra-row input:focus { border-color:#3b82f6; box-shadow:0 0 0 3px rgba(59,130,246,.12); }
.calc-extra-del { border:none; background:none; color:#ef4444; cursor:pointer; font-size:16px; padding:4px; }
.calc-add-extra-btn {
  width:100%; margin-top:6px; padding:8px; border:1.5px dashed #e2e8f0; border-radius:8px;
  background:transparent; cursor:pointer; font-size:12px; color:#94a3b8; transition:all .15s;
}
.calc-add-extra-btn:hover { border-color:#cbd5e1; color:#64748b; }

/* ── Live Preview Card ── */
.calc-preview-card {
  background:#fff; border-radius:14px; overflow:hidden;
  box-shadow:0 1px 3px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.06);
}
.calc-preview-viz {
  background:linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
  padding:24px; text-align:center; border-bottom:1px solid #e2e8f0;
}
.calc-preview-viz svg { margin:0 auto; display:block; }
.calc-preview-viz-label { font-size:11px; color:#94a3b8; margin-top:6px; }

.calc-preview-breakdown { padding:16px 18px; }
.calc-preview-bd-title {
  font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.5px;
  color:#94a3b8; margin-bottom:12px;
}

/* Cost Bars */
.calc-cost-bar-stack { display:flex; height:8px; border-radius:4px; overflow:hidden; margin-bottom:14px; gap:1px; }
.calc-cost-bar-stack .bar { transition:width .3s; }

.calc-cost-row {
  display:flex; justify-content:space-between; align-items:center;
  padding:5px 0; font-size:13px;
}
.calc-cost-label { display:flex; align-items:center; gap:8px; color:#475569; }
.calc-cost-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.calc-cost-val { font-weight:600; color:#1e293b; }
.calc-cost-divider { border-top:1px dashed #e2e8f0; margin:8px 0; }
.calc-cost-divider.bold { border-top:2px solid #e2e8f0; margin:12px 0; }

.calc-cost-row.netto .calc-cost-label { font-weight:700; color:#2563eb; font-size:14px; }
.calc-cost-row.netto .calc-cost-val { color:#2563eb; font-size:16px; font-weight:800; }
.calc-cost-row.brutto .calc-cost-label { font-weight:700; color:#16a34a; font-size:15px; }
.calc-cost-row.brutto .calc-cost-val { color:#16a34a; font-size:18px; font-weight:800; }

.calc-preview-action { padding:14px 18px; border-top:1px solid #f1f5f9; }
.calc-btn-add {
  width:100%; padding:13px; border:none; border-radius:10px;
  background:linear-gradient(135deg, #1e40af, #3b82f6); color:#fff;
  font-size:14px; font-weight:700; cursor:pointer;
  box-shadow:0 4px 12px rgba(30,64,175,.3); transition:all .2s; letter-spacing:.3px;
}
.calc-btn-add:hover { opacity:.9; transform:translateY(-1px); box-shadow:0 6px 16px rgba(30,64,175,.35); }

/* ── Edit banner ── */
.calc-edit-banner {
  padding:10px 16px; background:#dbeafe; border:1px solid #93c5fd; border-radius:8px;
  margin-bottom:14px; display:flex; justify-content:space-between; align-items:center;
  font-size:13px; color:#1e40af;
}
.calc-edit-banner button { border:none; background:none; cursor:pointer; color:#1e40af; font-size:13px; }

/* ── Items Section ── */
.calc-items-title {
  font-size:14px; font-weight:700; color:#0f172a; margin-bottom:12px;
  display:flex; align-items:center; gap:8px;
}
.calc-items-badge { background:#1e40af; color:#fff; font-size:11px; padding:2px 8px; border-radius:10px; font-weight:700; }

.calc-items-table {
  background:#fff; border-radius:14px; overflow:hidden;
  box-shadow:0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.04);
}
.calc-item-row {
  display:flex; align-items:center; padding:14px 18px; gap:14px;
  border-bottom:1px solid #f1f5f9; transition:background .1s;
}
.calc-item-row:hover { background:#fafbfc; }

.calc-item-drag { color:#cbd5e1; cursor:grab; font-size:16px; user-select:none; flex-shrink:0; }
.calc-item-num {
  width:28px; height:28px; border-radius:8px; display:flex; align-items:center; justify-content:center;
  font-size:11px; font-weight:700; flex-shrink:0;
}
.calc-item-num.mebel { background:#dbeafe; color:#1e40af; }
.calc-item-num.wolna { background:#f3e8ff; color:#7c3aed; }

.calc-item-info { flex:1; min-width:0; }
.calc-item-name { font-size:14px; font-weight:700; color:#0f172a; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.calc-item-meta { font-size:12px; color:#94a3b8; margin-top:2px; }

.calc-item-chips { display:flex; gap:4px; flex-wrap:wrap; flex-shrink:0; }
.calc-chip { padding:3px 8px; border-radius:6px; font-size:10px; font-weight:600; white-space:nowrap; display:inline-block; }
.calc-chip.blue { background:#dbeafe; color:#1e40af; }
.calc-chip.amber { background:#fef3c7; color:#92400e; }
.calc-chip.purple { background:#f3e8ff; color:#7c3aed; }
.calc-chip.gray { background:#f1f5f9; color:#475569; }
.calc-chip.teal { background:#ccfbf1; color:#0f766e; }

.calc-item-price { text-align:right; flex-shrink:0; min-width:100px; }
.calc-item-price .netto { font-size:15px; font-weight:800; color:#2563eb; }
.calc-item-price .brutto { font-size:12px; color:#16a34a; font-weight:600; }

.calc-item-actions { display:flex; gap:4px; flex-shrink:0; }
.calc-item-actions button {
  width:32px; height:32px; border:1px solid #e2e8f0; border-radius:8px;
  background:#fff; cursor:pointer; font-size:13px; display:flex; align-items:center; justify-content:center;
  transition:all .15s;
}
.calc-item-actions button:hover { background:#f1f5f9; }
.calc-item-actions button.del { border-color:#fecaca; }
.calc-item-actions button.del:hover { background:#fef2f2; }

/* ── Items Footer ── */
.calc-items-footer {
  display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap;
  padding:16px 18px; background:#f8fafc; border-top:2px solid #e2e8f0; gap:12px;
}
.calc-footer-summary { display:flex; align-items:baseline; gap:20px; }
.calc-footer-count { font-size:13px; color:#64748b; }
.calc-footer-netto { font-size:17px; font-weight:800; color:#2563eb; }
.calc-footer-netto small { font-weight:500; font-size:12px; color:#94a3b8; }
.calc-footer-brutto { font-size:20px; font-weight:800; color:#16a34a; }
.calc-footer-brutto small { font-weight:500; font-size:13px; color:#94a3b8; }
.calc-footer-actions { display:flex; gap:8px; }
.calc-btn-pdf {
  padding:10px 18px; border:1.5px solid #e2e8f0; border-radius:10px;
  background:#fff; font-size:13px; font-weight:600; cursor:pointer; color:#475569; transition:all .15s;
}
.calc-btn-pdf:hover { background:#f8fafc; border-color:#cbd5e1; }
.calc-btn-save {
  padding:10px 22px; border:none; border-radius:10px;
  background:linear-gradient(135deg, #1e40af, #3b82f6); color:#fff;
  font-size:14px; font-weight:700; cursor:pointer;
  box-shadow:0 4px 12px rgba(30,64,175,.25); transition:all .2s;
}
.calc-btn-save:hover { opacity:.9; transform:translateY(-1px); box-shadow:0 6px 16px rgba(30,64,175,.3); }

/* ── Empty State ── */
.calc-empty {
  background:#fff; border-radius:14px; padding:60px; text-align:center; color:#94a3b8;
  box-shadow:0 1px 3px rgba(0,0,0,.06);
}
.calc-empty-icon { font-size:40px; margin-bottom:12px; }
.calc-empty-title { font-size:16px; font-weight:600; margin-bottom:6px; color:#64748b; }
.calc-empty-text { font-size:13px; }

/* ── Quick Insert (wolna) ── */
.calc-quick-insert {
  padding:10px 12px; background:#f3f0ff; border-radius:8px; margin-bottom:14px;
  font-size:12px; color:#6d28d9; display:flex; align-items:center; gap:8px; flex-wrap:wrap;
}
.calc-quick-insert select {
  font-size:12px; border:1px solid #ddd; border-radius:6px; padding:4px 8px;
}

/* ── Responsive ── */
@media (max-width:900px) {
  .calc-main { flex-direction:column; }
  .calc-preview-col { position:static; min-width:0; width:100%; }
  .calc-item-chips { display:none; }
  .calc-step-item span:not(.calc-step-num):not(.calc-step-badge) { display:none; }
}
/* deploy-bust 1776407504 */
