/**
 * Style CSS - System Ewidencji Czasu Pracy
 * Firma Limańczyk Sp.J.
 * Design: Card Accent (v2.0)
 */

/* ============================================================================
   VARIABLES & RESET
   ============================================================================ */
:root {
    --color-primary: #FF6B35;
    --color-primary-light: #FF8F5A;
    --color-primary-dark: #E55A2B;
    --color-secondary: #4CAF50;
    --color-secondary-light: #81C784;
    --color-text: #212121;
    --color-text-light: #666666;
    --color-text-muted: #999999;
    --color-bg: #F0F2F5;
    --color-white: #FFFFFF;
    --color-error: #F44336;
    --color-warning: #FF9800;
    --color-info: #2196F3;
    
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    --nav-height: 56px;
    --bottom-nav-height: 64px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================================
   LOADING SCREEN
   ============================================================================ */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-primary);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: white;
}

.loading-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================================
   TOP BAR - MOBILE (Pracownik)
   ============================================================================ */
.top-bar {
    background: var(--color-white);
    height: var(--nav-height);
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-bar-logo {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.top-bar-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.top-bar-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    font-size: 14px;
    color: var(--color-text-light);
    display: block;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 480px) {
    .user-name {
        max-width: none;
    }
}

.btn-logout {
    padding: 8px 12px;
    background: var(--color-bg);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--color-text-light);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: #E0E0E0;
    color: var(--color-text);
}

/* ============================================================================
   TOP BAR - DESKTOP (Admin)
   ============================================================================ */
.top-bar-admin {
    background: var(--color-primary);
    color: white;
    height: var(--nav-height);
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.top-bar-admin .top-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-bar-admin .top-bar-logo {
    background: white;
    padding: 4px;
    border-radius: var(--radius-sm);
}

.top-bar-admin .top-bar-title {
    color: white;
}

.top-bar-admin .top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-bar-admin .user-name {
    color: rgba(255,255,255,0.9);
    display: block;
}

.top-bar-admin .btn-logout {
    background: rgba(255,255,255,0.2);
    color: white;
}

.top-bar-admin .btn-logout:hover {
    background: rgba(255,255,255,0.3);
}

/* ============================================================================
   BOTTOM NAVIGATION - MOBILE (Pracownik)
   ============================================================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: var(--color-white);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
    z-index: 100;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    background: none;
    min-width: 64px;
}

.bottom-nav-item:hover {
    color: var(--color-text-light);
}

.bottom-nav-item.active {
    color: var(--color-primary);
}

.bottom-nav-icon {
    font-size: 22px;
    margin-bottom: 4px;
}

.bottom-nav-label {
    font-size: 11px;
    font-weight: 500;
}

.bottom-nav-item.active .bottom-nav-label {
    font-weight: 600;
}

/* ============================================================================
   SIDE NAVIGATION - DESKTOP (Admin)
   ============================================================================ */
.admin-layout {
    display: flex;
    min-height: 100vh;
    padding-top: var(--nav-height);
}

.side-nav {
    width: 240px;
    background: var(--color-white);
    border-right: 1px solid #E0E0E0;
    position: fixed;
    left: 0;
    top: var(--nav-height);
    bottom: 0;
    overflow-y: auto;
    padding: 16px 0;
}

.side-nav-section {
    padding: 8px 16px;
    margin-bottom: 8px;
}

.side-nav-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.side-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--color-text-light);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 14px;
    border-left: 3px solid transparent;
}

.side-nav-item:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

.side-nav-item.active {
    background: #FFF5F0;
    color: var(--color-primary);
    border-left-color: var(--color-primary);
    font-weight: 600;
}

.side-nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.side-nav-divider {
    height: 1px;
    background: #E0E0E0;
    margin: 16px;
}

.admin-content {
    flex: 1;
    margin-left: 240px;
    padding: 24px;
    min-height: calc(100vh - var(--nav-height));
}

/* ============================================================================
   MAIN CONTENT AREA - MOBILE
   ============================================================================ */
.main-content {
    padding-top: calc(var(--nav-height) + 16px);
    padding-bottom: calc(var(--bottom-nav-height) + 16px);
    padding-left: 16px;
    padding-right: 16px;
    min-height: 100vh;
}

/* ============================================================================
   CARDS - Card Accent Style
   ============================================================================ */
.card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
    overflow: visible;
}

/* Zachowaj overflow: hidden tylko dla kart bez dropdownów (np. z obrazkami) */
.card-accent-blue,
.card-accent-green {
    overflow: hidden;
}

.card-accent-orange {
    border-left: 4px solid var(--color-primary);
}

.card-accent-green {
    border-left: 4px solid var(--color-secondary);
}

.card-accent-blue {
    border-left: 4px solid var(--color-info);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid #F0F0F0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 20px;
}

.card-body-compact {
    padding: 12px 20px;
}

/* ============================================================================
   FORMS
   ============================================================================ */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-light);
    margin-bottom: 8px;
}

.form-label-required::after {
    content: ' *';
    color: var(--color-error);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--color-bg);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: inherit;
    color: var(--color-text);
    transition: all 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    background: var(--color-white);
}

.form-input::placeholder {
    color: var(--color-text-muted);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-input-readonly {
    background: #E8E8E8;
    color: var(--color-text-light);
}

/* Form Row - dla daty i godzin */
.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 20px;
}

@media (max-width: 480px) {
    .form-row.form-row-mobile-stack {
        flex-direction: column;
        gap: 0;
    }
}

/* Time Select */
.time-select-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-dropdown {
    flex: 1;
}

.time-separator {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text-light);
}

/* Custom Dropdown */
.custom-dropdown {
    position: relative;
}

.dropdown-trigger {
    width: 100%;
    padding: 14px 16px;
    background: var(--color-bg);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    transition: all 0.2s;
}

.dropdown-trigger:hover {
    border-color: #E0E0E0;
}

.dropdown-trigger.active {
    border-color: var(--color-primary);
    background: var(--color-white);
}

.dropdown-trigger-text {
    color: var(--color-text);
}

.dropdown-trigger-text.placeholder {
    color: var(--color-text-muted);
}

.dropdown-arrow {
    color: var(--color-text-muted);
    font-size: 12px;
    transition: transform 0.2s;
}

.dropdown-arrow.open {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-white);
    border: 2px solid var(--color-primary);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    max-height: 280px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: var(--shadow-md);
}

.dropdown-menu.open {
    display: block;
}

/* Dropdown z wyszukiwarką */
.dropdown-menu-searchable {
    max-height: 320px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.dropdown-menu-searchable .dropdown-search-wrapper {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #FAFAFA;
    padding: 10px;
    border-bottom: 1px solid #E0E0E0;
}

/* Lista wewnątrz dropdowna z wyszukiwarką */
.dropdown-menu-searchable .checkbox-group,
.dropdown-menu-searchable .radio-group {
    padding: 8px;
    max-height: none !important;
}

.dropdown-search-wrapper {
    padding: 10px;
    border-bottom: 1px solid #E0E0E0;
    background: #FAFAFA;
}

.dropdown-search-input {
    width: 100%;
    padding: 10px 12px 10px 36px;
    border: 2px solid #E0E0E0;
    border-radius: var(--radius-sm);
    font-size: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23999' viewBox='0 0 24 24' width='18' height='18'%3E%3Cpath d='M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 10px center;
    transition: border-color 0.2s;
}

.dropdown-search-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.dropdown-search-input::placeholder {
    color: #999;
}

/* Podświetlenie pasujących wyników */
.radio-item.highlighted,
.checkbox-item.highlighted {
    background: #FFF3E0;
}

/* Time Dropdown */
.time-dropdown-menu {
    max-height: 320px;
}

.time-options {
    display: flex;
    flex-direction: column;
}

.time-option {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    text-align: center;
    font-size: 15px;
}

.time-option:hover {
    background: var(--color-bg);
}

/* Checkbox & Radio Groups */
.checkbox-group,
.radio-group {
    padding: 8px;
}

.checkbox-item,
.radio-item {
    padding: 12px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.checkbox-item:hover,
.radio-item:hover {
    background: var(--color-bg);
}

.checkbox-item label,
.radio-item label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-item input,
.radio-item input {
    width: 20px;
    height: 20px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

/* Location Locked */
.location-locked {
    background: #E8F5E9 !important;
    border-color: var(--color-secondary) !important;
    color: #2E7D32 !important;
}

/* ============================================================================
   MAP
   ============================================================================ */
.map-wrapper {
    margin-top: 12px;
}

.map-container {
    width: 100%;
    height: 280px;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-top: 12px;
}

@media (min-width: 480px) {
    .map-container {
        height: 350px;
    }
}

.selected-address {
    margin-top: 8px;
    padding: 12px 16px;
    background: #E8F5E9;
    border-radius: var(--radius-sm);
    color: #2E7D32;
    font-size: 14px;
}

.gps-accuracy {
    padding: 10px 16px;
    background: #E3F2FD;
    border-radius: var(--radius-sm);
    color: #1976D2;
    font-size: 13px;
    margin-top: 8px;
}

/* GPS Blue Circle Marker */
.gps-marker {
    width: 18px;
    height: 18px;
    background: #4285F4;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.gps-marker-pulse {
    position: absolute;
    width: 40px;
    height: 40px;
    background: rgba(66, 133, 244, 0.2);
    border-radius: 50%;
    animation: gps-pulse 2s ease-out infinite;
}

@keyframes gps-pulse {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

/* Suma godzin w historii */
.entries-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--color-secondary);
    color: white;
    border-radius: var(--radius-md);
    margin-top: 12px;
    font-weight: 600;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(255,107,53,0.3);
}

.btn-primary:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--color-bg);
    color: var(--color-text);
}

.btn-secondary:hover {
    background: #E0E0E0;
}

.btn-success {
    background: var(--color-secondary);
    color: white;
    box-shadow: 0 4px 12px rgba(76,175,80,0.3);
}

.btn-success:hover {
    background: #43A047;
    transform: translateY(-1px);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
}

.btn-icon-edit {
    background: #E3F2FD;
    color: var(--color-info);
}

.btn-icon-delete {
    background: #FFEBEE;
    color: var(--color-error);
}

/* ============================================================================
   TODAY ENTRIES - Compact List
   ============================================================================ */
.entry-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--color-bg);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}

.entry-item:last-child {
    margin-bottom: 0;
}

.entry-info {
    flex: 1;
}

.entry-time {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-primary);
}

.entry-project {
    font-size: 13px;
    color: var(--color-text-light);
    margin-top: 2px;
}

.entry-actions {
    display: flex;
    gap: 8px;
}

/* ============================================================================
   ALERTS & BADGES
   ============================================================================ */
.alert {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success {
    background: #E8F5E9;
    color: #2E7D32;
    border-left: 4px solid var(--color-secondary);
}

.alert-error {
    background: #FFEBEE;
    color: #C62828;
    border-left: 4px solid var(--color-error);
}

.alert-warning {
    background: #FFF3E0;
    color: #E65100;
    border-left: 4px solid var(--color-warning);
}

.alert-info {
    background: #E3F2FD;
    color: #1565C0;
    border-left: 4px solid var(--color-info);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: var(--color-secondary);
    color: white;
}

.badge-warning {
    background: var(--color-warning);
    color: white;
}

.badge-pending {
    background: #FFF3E0;
    color: #E65100;
}

/* ============================================================================
   TABLE (Admin)
   ============================================================================ */
.table-container {
    overflow-x: auto;
    margin: -20px;
    padding: 20px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th,
.table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #E0E0E0;
}

.table th {
    background: var(--color-bg);
    font-weight: 600;
    color: var(--color-text-light);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tr:hover td {
    background: #FAFAFA;
}

.table td:last-child {
    white-space: nowrap;
}

/* ============================================================================
   LOGIN PAGE
   ============================================================================ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    padding: 20px;
}

.login-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
    display: block;
}

.login-title {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 8px;
}

.login-subtitle {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 14px;
    margin-bottom: 32px;
}

/* ============================================================================
   PLACEHOLDER PAGES (Grafik, Urlopy)
   ============================================================================ */
.placeholder-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: 40px 20px;
}

.placeholder-icon {
    font-size: 64px;
    margin-bottom: 24px;
    opacity: 0.5;
}

.placeholder-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 12px;
}

.placeholder-text {
    font-size: 14px;
    color: var(--color-text-muted);
    max-width: 280px;
    line-height: 1.6;
}

/* ============================================================================
   HELP PAGE
   ============================================================================ */
.help-section {
    margin-bottom: 24px;
}

.help-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-item {
    padding: 16px;
    background: var(--color-bg);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}

.help-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 6px;
}

.help-item-text {
    font-size: 13px;
    color: var(--color-text-light);
    line-height: 1.5;
}

.example-card {
    border: 2px solid #E0E0E0;
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
}

.example-card-header {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #E0E0E0;
}

.example-card-row {
    display: flex;
    font-size: 13px;
    margin-bottom: 6px;
}

.example-card-label {
    color: var(--color-text-muted);
    width: 120px;
    flex-shrink: 0;
}

.example-card-value {
    color: var(--color-text);
    flex: 1;
}

/* ============================================================================
   MODAL
   ============================================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    padding: 20px;
}

.modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
}

.modal .modal-header {
    background: var(--color-primary);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal .modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.modal .modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal .modal-body {
    padding: 20px;
    background: white;
}

.modal .modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #EEE;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: white;
}

.modal-content {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-content h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.modal-large {
    max-width: 800px;
}

/* ============================================================================
   UTILITIES
   ============================================================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--color-text-muted); }
.text-success { color: var(--color-secondary); }
.text-error { color: var(--color-error); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

.hidden { display: none !important; }

/* ============================================================================
   GOOGLE PLACES AUTOCOMPLETE
   ============================================================================ */
.pac-container {
    z-index: 100000 !important;
    background-color: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: none;
    margin-top: 4px;
}

.pac-item {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 14px;
    border-top: 1px solid #F0F0F0;
}

.pac-item:first-child {
    border-top: none;
}

.pac-item:hover {
    background-color: var(--color-bg);
}

.pac-item-selected {
    background-color: var(--color-bg);
}

/* ============================================================================
   TABS (Admin - fallback for mobile)
   ============================================================================ */
.tabs {
    display: flex;
    border-bottom: 2px solid #E0E0E0;
    margin-bottom: 24px;
    gap: 8px;
    overflow-x: auto;
}

.tab {
    padding: 12px 20px;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-light);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab:hover {
    color: var(--color-text);
}

.tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    font-weight: 600;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
    }
    
    .side-nav {
        display: none;
    }
    
    .admin-content {
        margin-left: 0;
        padding: 16px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .top-bar {
        padding: 0 12px;
    }
    
    .main-content {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    .card-body {
        padding: 16px;
    }
    
    .form-input,
    .form-select,
    .form-textarea,
    .dropdown-trigger {
        padding: 12px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .btn {
        padding: 12px 20px;
    }
}

/* ============================================================================
   ALERT MODAL - Na środku ekranu
   ============================================================================ */
.alert-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200000;
    padding: 20px;
}

.alert-modal {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 320px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: alertSlideIn 0.2s ease-out;
}

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

.alert-modal-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.alert-modal-message {
    font-size: 16px;
    color: var(--color-text);
    margin-bottom: 20px;
    line-height: 1.5;
}

.alert-modal-close {
    min-width: 100px;
}

.alert-modal-success {
    border-top: 4px solid var(--color-secondary);
}

.alert-modal-error {
    border-top: 4px solid #F44336;
}

.alert-modal-warning {
    border-top: 4px solid #FF9800;
}

.alert-modal-info {
    border-top: 4px solid #2196F3;
}

/* ============================================================================
   PERMISSIONS MODAL - Zgody przy logowaniu
   ============================================================================ */
.permissions-modal {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}

.permissions-modal h3 {
    margin: 0 0 16px 0;
    color: var(--color-text);
    font-size: 20px;
}

.permissions-modal p {
    color: var(--color-text-light);
    margin-bottom: 20px;
    line-height: 1.5;
}

.permission-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--color-bg);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}

.permission-icon {
    font-size: 32px;
    margin-right: 16px;
}

.permission-info {
    flex: 1;
}

.permission-title {
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 4px;
}

.permission-desc {
    font-size: 13px;
    color: var(--color-text-light);
}

.permission-status {
    font-size: 24px;
}

.permissions-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.permissions-buttons .btn {
    flex: 1;
}

/* ============================================================================
   ADMIN TABLE - Nowe kolumny
   ============================================================================ */
.admin-table th.col-approve,
.admin-table th.col-edit,
.admin-table th.col-delete {
    width: 70px;
    text-align: center;
}

.admin-table td.col-approve,
.admin-table td.col-edit,
.admin-table td.col-delete {
    text-align: center;
}

.edited-by-admin {
    color: #F44336;
    font-size: 11px;
    font-weight: 500;
    display: block;
    margin-top: 2px;
}

.permission-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 14px;
}

.permission-badge.granted {
    background: #E8F5E9;
}

.permission-badge.denied {
    background: #FFEBEE;
}

/* ============================================================================
   KALENDARZ
   ============================================================================ */
.calendar-container {
    background: white;
    border-radius: var(--radius-lg);
    padding: 12px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    max-width: 320px;
}

.calendar-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #E0E0E0;
}

.calendar-filter-btn {
    padding: 6px 12px;
    font-size: 12px;
    border: 1px solid #E0E0E0;
    background: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.calendar-filter-btn:hover {
    background: var(--color-bg);
}

.calendar-filter-btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.calendar-selected-range {
    font-size: 11px;
    color: var(--color-text-light);
    text-align: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #E0E0E0;
}

/* ============================================================================
   TOOLBAR - Kalendarz, Filtruj, Sortuj
   ============================================================================ */
.admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px;
    background: #F5F5F5;
    border-radius: var(--radius-lg);
    align-items: center;
}

.toolbar-dropdown {
    position: relative;
    display: inline-block;
}

.toolbar-btn {
    padding: 8px 14px;
    font-size: 13px;
    border: 1px solid #DDD;
    background: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.toolbar-btn:hover {
    background: #F0F0F0;
    border-color: #CCC;
}

.toolbar-btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.toolbar-dropdown-content {
    display: none;
    position: fixed;
    min-width: 280px;
    max-height: 500px;
    overflow-y: auto;
    background: white;
    border: 1px solid #DDD;
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    z-index: 99999;
    padding: 12px;
}

.toolbar-dropdown-content.calendar-dropdown {
    min-width: 300px;
    max-height: none;
    overflow: visible;
}

.toolbar-dropdown-content.show {
    display: block;
}

.toolbar-dropdown-content.right {
    left: auto;
    right: 0;
}

.dropdown-section {
    margin-bottom: 12px;
}

.dropdown-section:last-child {
    margin-bottom: 0;
}

.dropdown-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-light);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.dropdown-checkbox-list {
    max-height: 150px;
    overflow-y: auto;
}

.dropdown-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 13px;
    cursor: pointer;
}

.dropdown-checkbox-item:hover {
    color: var(--color-primary);
}

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

.sort-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
}

.sort-item:hover {
    background: #F5F5F5;
}

.sort-item.active {
    background: rgba(245, 124, 0, 0.1);
    color: var(--color-primary);
}

.sort-direction {
    font-size: 12px;
    color: var(--color-text-light);
}

.active-filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(245, 124, 0, 0.1);
    color: var(--color-primary);
    border-radius: 12px;
    font-size: 11px;
}

.active-filter-tag button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--color-primary);
    padding: 0;
    line-height: 1;
}

/* Kategorie filtrów w dropdown */
.filter-category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    margin: 4px 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.filter-category-item:hover {
    background: #FFF3E0;
}

.filter-count {
    background: var(--color-primary);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    margin-left: 8px;
}

.filter-arrow {
    color: #999;
    font-size: 12px;
}

/* Modal filtrowania */
.filter-modal {
    max-width: 450px;
    width: 90%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    overflow: hidden;
}

.filter-modal .modal-header {
    background: var(--color-primary);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-modal .modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.filter-modal .modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.filter-modal-search {
    padding: 16px;
    border-bottom: 1px solid #EEE;
    background: white;
}

.filter-modal-search input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #E0E0E0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
}

.filter-modal-search input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.filter-modal-body {
    max-height: 300px;
    overflow-y: auto;
    padding: 8px 16px;
    background: white;
}

.filter-modal-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 10px;
    cursor: pointer;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    margin: 4px 0;
    border: 1px solid transparent;
}

.filter-modal-item:hover {
    background: #FFF3E0;
    border-color: #FFE0B2;
}

.filter-modal-item input {
    width: 20px;
    height: 20px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.filter-modal-item span {
    flex: 1;
}

.filter-modal-actions {
    display: flex;
    gap: 16px;
    padding: 12px 16px;
    border-top: 1px solid #EEE;
    background: #FAFAFA;
}

.filter-modal .modal-footer {
    padding: 16px;
    border-top: 1px solid #EEE;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: white;
}

.btn-link {
    background: none;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    font-size: 13px;
    padding: 0;
}

.btn-link:hover {
    text-decoration: underline;
}

/* Pole hasła z podglądem */
.password-display {
    display: flex;
    align-items: center;
    gap: 4px;
}

.password-hidden, .password-visible {
    font-family: monospace;
    font-size: 12px;
}

.btn-icon-small {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 14px;
    opacity: 0.7;
}

.btn-icon-small:hover {
    opacity: 1;
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    padding-right: 40px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
    opacity: 0.6;
}

.password-toggle:hover {
    opacity: 1;
}

/* ============================================================================
   EDYCJA INLINE
   ============================================================================ */
.editing-row {
    background: #FFF8E1 !important;
}

.editing-row td {
    padding: 4px 6px !important;
}

.inline-input {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid var(--color-primary);
    border-radius: 4px;
    font-size: 12px;
}

.inline-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(245, 124, 0, 0.2);
}

.inline-select {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid var(--color-primary);
    border-radius: 4px;
    font-size: 12px;
    background: white;
}

.inline-actions {
    display: flex;
    gap: 4px;
}

.inline-actions button {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 4px;
    cursor: pointer;
}

.inline-save {
    background: var(--color-secondary);
    color: white;
    border: none;
}

.inline-cancel {
    background: #EEE;
    border: 1px solid #DDD;
}

/* Pole "Inne - jakie?" */
.inline-other-input {
    margin-top: 4px;
    width: 100%;
}

/* ============================================================================
   ZMIANY ADMINA - poprawione przekreślenia
   ============================================================================ */
.change-indicator {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.original-text {
    color: #999;
    font-size: 11px;
}

.changed-text {
    color: #D32F2F;
    font-weight: 500;
    font-size: 11px;
}

.edited-badge {
    display: inline-block;
    background: #FFEBEE;
    color: #D32F2F;
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 4px;
}

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

.calendar-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--color-text);
}

.calendar-nav {
    display: flex;
    gap: 4px;
}

.calendar-nav button {
    width: 28px;
    height: 28px;
    border: 1px solid #E0E0E0;
    background: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
}

.calendar-nav button:hover {
    background: var(--color-bg);
}

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

.calendar-day-header {
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--color-text-light);
    padding: 4px 0;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: none;
    background: none;
    color: var(--color-text);
    width: 32px;
    height: 32px;
}

.calendar-day:hover:not(.disabled):not(.selected) {
    background: var(--color-bg);
}

.calendar-day.other-month {
    color: #CCC;
}

.calendar-day.today {
    font-weight: 700;
    color: var(--color-primary);
}

.calendar-day.selected {
    background: var(--color-primary);
    color: white;
    font-weight: 600;
}

.calendar-day.in-range {
    background: rgba(245, 124, 0, 0.2);
}

.calendar-day.has-entries {
    position: relative;
}

.calendar-day.has-entries::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 6px;
    height: 6px;
    background: var(--color-secondary);
    border-radius: 50%;
}

.calendar-day.disabled {
    color: #DDD;
    cursor: default;
}

/* Kalendarz w dropdown */
.toolbar-dropdown-content .calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.toolbar-dropdown-content .calendar-day-header {
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--color-text-light);
    padding: 4px 0;
}

.toolbar-dropdown-content .calendar-day {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    background: none;
    color: var(--color-text);
    position: relative;
}

.toolbar-dropdown-content .calendar-day:hover:not(.disabled) {
    background: #F5F5F5;
}

.toolbar-dropdown-content .calendar-day.today {
    font-weight: 700;
    color: var(--color-primary);
}

.toolbar-dropdown-content .calendar-day.selected {
    background: var(--color-primary);
    color: white;
}

.toolbar-dropdown-content .calendar-day.has-entries::after {
    content: '';
    position: absolute;
    bottom: 2px;
    width: 4px;
    height: 4px;
    background: var(--color-secondary);
    border-radius: 50%;
}

.toolbar-dropdown-content .calendar-day.other-month {
    color: #CCC;
}

.toolbar-dropdown-content .calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

/* ============================================================================
   TOOLTIP
   ============================================================================ */
.tooltip-cell {
    position: relative;
    cursor: help;
}

.tooltip-cell .tooltip-text {
    visibility: hidden;
    position: absolute;
    z-index: 1000;
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    white-space: pre-wrap;
    max-width: 300px;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    box-shadow: var(--shadow-md);
}

.tooltip-cell .tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.tooltip-cell:hover .tooltip-text {
    visibility: visible;
}

/* ============================================================================
   ZMIANY ADMINA - przekreślone oryginalne, czerwone nowe
   ============================================================================ */
.original-value {
    color: #999;
    text-decoration: line-through;
    font-size: 12px;
    display: block;
}

.admin-changed {
    color: #F44336;
    font-weight: 500;
}

.change-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* ============================================================================
   TABELA - mniejsze kolumny
   ============================================================================ */
.admin-table th.col-lp,
.admin-table td.col-lp {
    width: 50px;
    text-align: center;
}

.date-with-time {
    white-space: nowrap;
}

.date-time-added {
    font-size: 11px;
    color: var(--color-text-light);
}

.desc-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Komórka z wieloma wierszami */
.multiline-cell {
    vertical-align: top;
    max-width: 200px;
}

/* Komórka z przyciskiem edycji */
.cell-with-edit {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.cell-with-edit .cell-content {
    flex: 1;
    font-size: 11px;
    line-height: 1.5;
}

.cell-with-edit .cell-content.multiline {
    white-space: pre-line;
}

.btn-cell-edit {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 11px;
    opacity: 0.4;
    padding: 2px;
    flex-shrink: 0;
}

.btn-cell-edit:hover {
    opacity: 1;
}

/* Porównanie zmian per wiersz - w tabeli */
.line-unchanged {
    color: #333;
}

.line-changed {
    display: block;
    margin-bottom: 2px;
}

.line-old {
    color: #999;
}

.line-new {
    color: #D32F2F;
    font-weight: 500;
}

.line-removed {
    color: #999;
    text-decoration: line-through;
}

.line-added {
    color: #2E7D32;
    font-weight: 500;
}

/* Modal do edycji opisów */
.modal-medium {
    max-width: 600px;
    width: 90%;
}

.modal-entry-info {
    background: #f5f5f5;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
    color: #555;
}

.modal-textarea {
    min-height: 150px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
}

/* Porównanie zmian w modalu */
.modal-comparison-section {
    margin-bottom: 20px;
}

.comparison-label {
    font-size: 11px;
    color: #666;
    margin-bottom: 8px;
    text-transform: uppercase;
    font-weight: 600;
}

.modal-comparison {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
}

.comparison-row {
    display: flex;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
    align-items: flex-start;
    font-size: 13px;
}

.comparison-row:last-child {
    border-bottom: none;
}

.comparison-num {
    width: 24px;
    color: #999;
    font-size: 11px;
    text-align: right;
    flex-shrink: 0;
}

.comparison-old {
    flex: 1;
    color: #999;
}

.comparison-old.removed {
    text-decoration: line-through;
}

.comparison-old.empty {
    font-style: italic;
    color: #ccc;
}

.comparison-arrow {
    color: #ccc;
    flex-shrink: 0;
}

.comparison-new {
    flex: 1;
    color: #D32F2F;
    font-weight: 500;
}

.comparison-new.unchanged {
    color: #333;
    font-weight: normal;
}

.comparison-new.added {
    color: #2E7D32;
    font-weight: 500;
}

.comparison-new.empty {
    font-style: italic;
    color: #ccc;
    font-weight: normal;
}

/* ============================================================================
   Modal edycji zakresów robót
   ============================================================================ */
.identifier-section {
    margin-bottom: 16px;
}

.scope-section-label {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 8px;
}

.identifier-badge {
    display: inline-block;
    background: #E8F5E9;
    color: #2E7D32;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

.scopes-section {
    margin-bottom: 16px;
}

.scopes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.scope-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.scope-item:hover {
    background: #f0f0f0;
}

.scope-item.selected {
    background: #FFF3E0;
    border-color: #FF6B35;
}

.scope-item.was-original.not-selected::after {
    content: "odznaczono";
    position: absolute;
    right: 8px;
    font-size: 9px;
    color: #D32F2F;
    background: #FFEBEE;
    padding: 2px 6px;
    border-radius: 4px;
}

.scope-item.newly-added::after {
    content: "dodano";
    position: absolute;
    right: 8px;
    font-size: 9px;
    color: #2E7D32;
    background: #E8F5E9;
    padding: 2px 6px;
    border-radius: 4px;
}

.scope-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #FF6B35;
    flex-shrink: 0;
}

.scope-name {
    font-size: 13px;
    color: #333;
    flex: 1;
}

/* Pole "inne" */
.other-field {
    margin-top: 12px;
    padding: 12px;
    background: #FFF8E1;
    border: 1px solid #FFE082;
    border-radius: 8px;
}

.other-field.hidden {
    display: none;
}

.other-field label {
    display: block;
    font-size: 12px;
    color: #F57C00;
    font-weight: 600;
    margin-bottom: 6px;
}

.other-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #FFE082;
    border-radius: 6px;
    font-size: 14px;
}

.other-field input:focus {
    outline: none;
    border-color: #FF6B35;
}

/* Sekcja porównania zmian w modal scope */
.changes-section {
    margin-top: 16px;
    padding: 12px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.changes-row {
    display: flex;
    gap: 12px;
    font-size: 12px;
    padding: 4px 0;
}

.changes-label {
    width: 70px;
    color: #999;
    flex-shrink: 0;
}

.changes-value {
    flex: 1;
    word-break: break-word;
}

.changes-value.original {
    color: #999;
}

.changes-value.new {
    color: #D32F2F;
    font-weight: 500;
}

/* Wysokie pola tekstowe w panelu pracownika */
.textarea-tall {
    min-height: 120px;
}

/* Optymalizacja szerokości kolumn w tabeli ewidencji */
#entries-table th,
#entries-table td {
    padding: 8px 6px;
    font-size: 12px;
}

#entries-table .col-lp {
    width: 40px;
    text-align: center;
}

#entries-table .col-approve,
#entries-table .col-delete {
    width: 50px;
    text-align: center;
}

/* ============================================================================
   Identyfikatory - zakładki filtrów i badge
   ============================================================================ */
.identifier-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #E0E0E0;
}

.identifier-tab {
    padding: 6px 12px;
    border: 2px solid #E0E0E0;
    border-radius: 20px;
    background: white;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.identifier-tab:hover {
    border-color: var(--color-primary);
    background: #FFF3E0;
}

.identifier-tab.active {
    background: var(--tab-color, var(--color-primary));
    color: var(--tab-text, white);
    border-color: var(--tab-color, var(--color-primary));
}

.identifier-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

/* Status badge dla inwestycji */
.status-badge-project {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.status-badge-project.planowana {
    background: #E3F2FD;
    color: #1565C0;
}

.status-badge-project.w-trakcie {
    background: #FFF3E0;
    color: #E65100;
}

.status-badge-project.zakonczona {
    background: #E8F5E9;
    color: #2E7D32;
}

/* Animacja modala */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal {
    animation: modalSlideIn 0.2s ease-out;
}

/* Form select */
.form-select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #E0E0E0;
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    background: white;
    transition: border-color 0.2s;
}

.form-select:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* ============================================================================
   OPCJA C - Karty ze stałą wysokością i scroll tbody
   ============================================================================ */
.card-fixed-height {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 180px);
}

.card-fixed-height .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: 0;
}

.table-scroll-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid #E0E0E0;
    border-radius: var(--radius-sm);
    margin-top: 10px;
}

.table-sticky-header thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.table-sticky-header thead th {
    background: #FFF3E0;
    border-bottom: 2px solid var(--color-primary);
}

/* Scrollbar styling */
.table-scroll-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-scroll-container::-webkit-scrollbar-track {
    background: #F0F0F0;
    border-radius: 4px;
}

.table-scroll-container::-webkit-scrollbar-thumb {
    background: #BDBDBD;
    border-radius: 4px;
}

.table-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #9E9E9E;
}

/* Filtry identyfikatorów - nie scrollowane */
.identifier-filter-tabs {
    flex-shrink: 0;
}

/* Admin toolbar - nie scrollowany */
.card-fixed-height .admin-toolbar {
    flex-shrink: 0;
}

/* Aktywne filtry - nie scrollowane */
.card-fixed-height .active-filters {
    flex-shrink: 0;
}

/* ============================================================================
   SEKCJA URLOPY - Panel Pracownika
   ============================================================================ */

/* Selektor typu urlopu */
.leave-type-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.leave-type-btn {
    flex: 1;
    min-width: 140px;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.leave-type-btn:hover {
    border-color: var(--color-secondary);
    background: #f5f5f5;
}

.leave-type-btn.active {
    border-color: var(--color-secondary);
    background: #e8f5e9;
    color: var(--color-secondary);
}

.leave-type-btn[data-type="L4"].active {
    border-color: #f44336;
    background: #ffebee;
    color: #f44336;
}

/* Kalendarz urlopowy */
.leave-calendar-container {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
}

.leave-calendar {
    width: 100%;
}

.leave-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 0 4px;
}

.leave-calendar-nav {
    background: none;
    border: 1px solid #ddd;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.leave-calendar-nav:hover {
    background: #f5f5f5;
    border-color: var(--color-secondary);
}

.leave-calendar-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--color-text);
}

.leave-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.leave-calendar-day-header {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    padding: 8px 4px;
}

.leave-calendar-day {
    text-align: center;
    padding: 10px 4px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s ease;
    position: relative;
}

.leave-calendar-day:hover:not(.disabled):not(.empty):not(.blocked) {
    background: #e3f2fd;
}

.leave-calendar-day.empty {
    cursor: default;
}

.leave-calendar-day.today {
    border: 2px solid var(--color-primary);
}

.leave-calendar-day.weekend {
    background: #f5f5f5;
    color: #999;
}

.leave-calendar-day.holiday {
    background: #ffebee;
    color: #f44336;
}

.leave-calendar-day.disabled {
    color: #ccc;
    cursor: not-allowed;
    background: #fafafa;
}

.leave-calendar-day.blocked {
    color: #bbb;
    cursor: not-allowed;
    text-decoration: line-through;
}

.leave-calendar-day.selected,
.leave-calendar-day.start,
.leave-calendar-day.end {
    background: var(--color-secondary) !important;
    color: white !important;
}

.leave-calendar-day.start {
    border-radius: 6px 0 0 6px;
}

.leave-calendar-day.end {
    border-radius: 0 6px 6px 0;
}

.leave-calendar-day.start.end {
    border-radius: 6px;
}

.leave-calendar-day.in-range {
    background: var(--color-secondary);
    color: white;
    border-radius: 0;
}

.leave-calendar-day.in-range.weekend,
.leave-calendar-day.in-range.holiday {
    background: #ffcdd2;
    color: #333;
    text-decoration: line-through;
}

/* Legenda kalendarza */
.leave-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
    font-size: 11px;
    color: #666;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

.legend-dot.legend-selected {
    background: var(--color-secondary);
}

.legend-dot.legend-holiday {
    background: #ffebee;
    border: 1px solid #ffcdd2;
}

.legend-dot.legend-weekend {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
}

/* Informacja o wybranym zakresie */
.leave-range-info {
    font-weight: normal;
    color: #999;
    font-size: 12px;
}

/* Podgląd dni */
.leave-days-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #e8f5e9;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.leave-days-info {
    font-size: 13px;
    color: #333;
}

.leave-days-count {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.leave-days-count span {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-secondary);
}

/* Podsumowanie urlopu */
.leave-summary-grid {
    display: grid;
    gap: 12px;
}

.leave-summary-item {
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 4px solid var(--color-secondary);
}

.leave-summary-item.leave-summary-carryover {
    border-left-color: #ff9800;
    background: #fff8e1;
}

.leave-summary-item.leave-summary-remaining {
    border-left-color: var(--color-secondary);
    background: #e8f5e9;
}

.leave-summary-item.leave-summary-sick {
    border-left-color: #f44336;
    background: #ffebee;
}

.leave-summary-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.leave-summary-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text);
}

.leave-summary-value.leave-summary-big {
    font-size: 28px;
    color: var(--color-secondary);
}

.leave-summary-value.leave-summary-used {
    color: #666;
}

.leave-summary-detail {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

/* Historia wniosków */
.leave-history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.leave-history-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    border-left: 4px solid #e0e0e0;
}

.leave-history-item.pending {
    border-left-color: #ff9800;
    background: #fffde7;
}

.leave-history-item.approved {
    border-left-color: var(--color-secondary);
    background: #f1f8e9;
}

.leave-history-item.rejected {
    border-left-color: #f44336;
    background: #ffebee;
}

.leave-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.leave-type-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.leave-type-badge.uw {
    background: #e8f5e9;
    color: var(--color-secondary);
}

.leave-type-badge.l4 {
    background: #ffebee;
    color: #f44336;
}

.leave-status-badge {
    font-size: 12px;
    font-weight: 500;
}

.leave-status-badge.pending {
    color: #ff9800;
}

.leave-status-badge.approved {
    color: var(--color-secondary);
}

.leave-status-badge.rejected {
    color: #f44336;
}

.leave-history-dates {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.leave-days-badge {
    background: #e0e0e0;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.leave-history-note {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    padding: 6px 10px;
    background: rgba(0,0,0,0.03);
    border-radius: 4px;
}

.leave-history-rejection {
    font-size: 12px;
    color: #c62828;
    margin-bottom: 8px;
    padding: 8px 10px;
    background: #ffebee;
    border-radius: 4px;
    border-left: 3px solid #f44336;
}

.leave-history-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid #eee;
}

.leave-submitted {
    font-size: 11px;
    color: #999;
}

/* Przycisk anuluj */
.btn-danger {
    background: #f44336;
    color: white;
    border: none;
}

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

.btn-sm {
    padding: 4px 10px;
    font-size: 11px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 30px 20px;
    color: #999;
    font-size: 14px;
}

/* Card body compact - dla list */
.card-body-compact {
    padding: 12px;
}

/* ============================================================================
   SEKCJA URLOPY - Panel Administratora
   ============================================================================ */

/* Badge w nawigacji */
.side-nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #f44336;
    color: white;
    font-size: 10px;
    font-weight: 700;
    border-radius: 9px;
    margin-left: auto;
}

/* Zakładki widoków urlopów */
.leaves-view-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.leaves-tab {
    padding: 8px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.leaves-tab:hover {
    background: #f5f5f5;
    border-color: var(--color-secondary);
}

.leaves-tab.active {
    background: var(--color-secondary);
    color: white;
    border-color: var(--color-secondary);
}

.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #ff9800;
    color: white;
    font-size: 10px;
    font-weight: 700;
    border-radius: 9px;
}

.leaves-tab.active .tab-badge {
    background: white;
    color: var(--color-secondary);
}

/* Tabela wniosków urlopowych */
.leave-row-pending {
    background: #fffde7;
}

.leave-row-approved {
    background: #f1f8e9;
}

.leave-row-rejected {
    background: #ffebee;
}

.status-buttons {
    display: flex;
    gap: 4px;
}

.btn-success {
    background: var(--color-secondary);
    color: white;
    border: none;
}

.btn-success:hover {
    background: #388E3C;
}

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.status-badge.approved {
    background: #e8f5e9;
    color: var(--color-secondary);
}

.status-badge.rejected {
    background: #ffebee;
    color: #f44336;
}

.status-badge.pending {
    background: #fff8e1;
    color: #ff9800;
}

.time-small {
    font-size: 11px;
    color: #999;
}

.note-cell {
    cursor: help;
    border-bottom: 1px dotted #999;
}

.text-success {
    color: var(--color-secondary);
}

.text-danger {
    color: #f44336;
}

.text-warning {
    color: #ff9800;
}

/* Modal duży */
.modal-large {
    max-width: 600px;
    width: 95%;
}

/* Modal dodawania urlopu - kompaktowy */
#leave-modal .modal-large {
    max-height: 90vh;
}

#leave-modal .modal-body {
    padding: 16px;
    max-height: calc(90vh - 130px);
    overflow-y: auto;
}

#leave-modal .form-group {
    margin-bottom: 12px;
}

#leave-modal .form-label {
    margin-bottom: 4px;
    font-size: 13px;
}

#leave-modal .leave-calendar-container {
    padding: 8px;
}

#leave-modal .leave-calendar-header {
    margin-bottom: 8px;
}

#leave-modal .leave-calendar-nav {
    padding: 4px 10px;
    font-size: 12px;
}

#leave-modal .leave-calendar-title {
    font-size: 14px;
}

#leave-modal .leave-calendar-grid {
    gap: 2px;
}

#leave-modal .leave-calendar-day-header {
    padding: 4px 2px;
    font-size: 10px;
}

#leave-modal .leave-calendar-day {
    padding: 6px 2px;
    font-size: 12px;
}

#leave-modal .leave-days-preview {
    padding: 8px 12px;
    margin-bottom: 12px;
}

#leave-modal .leave-days-info {
    font-size: 12px;
}

#leave-modal .leave-days-count span {
    font-size: 22px;
}

#leave-modal .leave-type-selector {
    gap: 8px;
}

#leave-modal .leave-type-btn {
    padding: 8px 12px;
    font-size: 12px;
}

.modal-xlarge {
    max-width: 1200px;
    width: 95%;
    max-height: 90vh;
}

.modal-xlarge .modal-body {
    max-height: calc(90vh - 120px);
    overflow-y: auto;
}

/* Kalendarz nieobecności */
.absence-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 8px;
}

.absence-calendar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 992px) {
    .absence-calendar-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .absence-calendar-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .absence-calendar-grid {
        grid-template-columns: 1fr;
    }
}

.absence-month {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
}

.absence-month-title {
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 8px;
    color: var(--color-text);
}

.absence-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.absence-day-header {
    text-align: center;
    font-size: 9px;
    font-weight: 600;
    color: #999;
    padding: 2px;
}

.absence-day {
    text-align: center;
    font-size: 10px;
    padding: 4px 2px;
    border-radius: 3px;
}

.absence-day.empty {
    visibility: hidden;
}

.absence-day.weekend {
    background: #f5f5f5;
    color: #999;
}

.absence-day.holiday {
    background: #ffebee;
    color: #f44336;
}

.absence-day.vacation {
    background: var(--color-secondary);
    color: white;
    font-weight: 600;
}

.absence-day.sick {
    background: #f44336;
    color: white;
    font-weight: 600;
}

/* Filter modal */
.filter-modal-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.filter-modal-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-modal-item:hover {
    background: #f5f5f5;
}

.filter-modal-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Table footer */
.table-footer {
    padding: 12px 16px;
    background: #f5f5f5;
    border-top: 1px solid #e0e0e0;
    font-size: 13px;
    color: #666;
    text-align: right;
}

/* ============================================================================
   Edycja przeniesienia urlopu (carryover)
   ============================================================================ */

.carryover-cell {
    white-space: nowrap;
}

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

.carryover-edit-btn {
    margin-left: 4px;
    opacity: 0.6;
}

.carryover-edit-btn:hover {
    opacity: 1;
}

.carryover-input-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.carryover-input {
    width: 50px;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 12px;
}

/* Edycja dni urlopu w sekcji Pracownicy */
.vacation-cell {
    white-space: nowrap;
}

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

.vacation-edit-btn {
    margin-left: 4px;
    opacity: 0.6;
}

.vacation-edit-btn:hover {
    opacity: 1;
}

.vacation-input-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.vacation-input {
    width: 50px;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 12px;
}

.btn-xs {
    padding: 2px 6px;
    font-size: 10px;
    border-radius: 3px;
}

/* ============================================================================
   Kalendarz zespołowy (Team Calendar - Gantt)
   ============================================================================ */

.team-calendar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    min-height: 0;
}

.team-calendar .table-scroll-container {
    flex: 1;
    min-height: 0;
    max-height: calc(100vh - 350px);
}

.team-calendar-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.team-calendar-period {
    font-weight: 600;
    font-size: 14px;
    min-width: 180px;
    text-align: center;
}

.team-calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 10px 12px;
    background: #f5f5f5;
    border-radius: 6px;
    font-size: 12px;
}

.team-calendar-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.team-calendar-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.team-calendar-table th,
.team-calendar-table td {
    border: 1px solid #e0e0e0;
    padding: 0;
    text-align: center;
    vertical-align: middle;
}

.team-calendar-table th {
    padding: 8px 4px;
    background: #f5f5f5;
}

.team-calendar-table th.col-lp,
.team-calendar-table td.col-lp {
    width: 35px;
    min-width: 35px;
    max-width: 35px;
    text-align: center;
    padding: 4px 2px;
    font-size: 11px;
    background: #fafafa;
}

.team-calendar-table th.col-worker {
    width: 110px;
    min-width: 110px;
    max-width: 110px;
    text-align: left;
    padding-left: 8px;
    font-size: 11px;
}

.team-calendar-table td.col-worker {
    text-align: left;
    padding: 4px 8px;
    font-weight: 500;
    font-size: 11px;
    background: #fafafa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
}

.team-calendar-table th.col-workplace {
    width: 70px;
    min-width: 70px;
    max-width: 70px;
    text-align: left;
    padding-left: 8px;
    font-size: 10px;
}

.team-calendar-table td.col-workplace {
    text-align: left;
    padding: 4px 8px;
    font-size: 10px;
    background: #fafafa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70px;
}

.team-day-header {
    min-width: 70px;
    width: auto;
}

/* Dni robocze (Pn-Pt) - większe */
.team-day-header:nth-child(4),
.team-day-header:nth-child(5),
.team-day-header:nth-child(6),
.team-day-header:nth-child(7),
.team-day-header:nth-child(8) {
    min-width: 80px;
}

/* Weekend (So-Nd) - mniejsze */
.team-day-header.weekend {
    min-width: 45px;
    background: #f5f5f5;
}

.team-day-header .day-name {
    font-size: 11px;
    font-weight: 600;
    color: #666;
}

.team-day-header .day-num {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.team-day-header.today {
    background: #fff3e0;
}

.team-day-header.today .day-num {
    color: var(--color-primary);
}

.team-day-header.weekend .day-name,
.team-day-header.weekend .day-num {
    color: #999;
}

.team-day-header.holiday {
    background: #ffebee;
}

.team-day {
    width: 50px;
    height: 36px;
    position: relative;
}

.team-day.today {
    box-shadow: inset 0 0 0 2px var(--color-primary);
}

.team-day.weekend {
    background: #f5f5f5;
}

.team-day.holiday {
    background: #ffebee;
}

.team-day.uw {
    background: var(--color-secondary);
    color: white;
    font-weight: 600;
    font-size: 11px;
}

.team-day.l4 {
    background: #f44336;
    color: white;
    font-weight: 600;
    font-size: 11px;
}

.team-day.pending {
    background: #ff9800;
    color: white;
}

.team-calendar-summary {
    padding: 12px 16px;
    background: #e8f5e9;
    border-radius: 6px;
    font-size: 13px;
}

/* ============================================================================
   Wersja 4.1 - Nowe style
   ============================================================================ */

/* Toolbar - szerszy dropdown dla kalendarza */
.toolbar-dropdown-wide {
    min-width: 320px;
}

/* Siatka miesięcy w kalendarzu */
.calendar-months-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 8px 0;
}

.calendar-month-item {
    padding: 6px 4px;
    text-align: center;
    font-size: 11px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

.calendar-month-item:hover {
    background: #f5f5f5;
}

.calendar-month-item.active {
    background: #4CAF50;
    color: white;
}

/* Nawigacja lat w kalendarzu nieobecności */
.absence-year-nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.absence-year-nav .btn {
    min-width: 80px;
}

/* Zakładki urlopów - poprawiony styl */
.leaves-view-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0e0e0;
    flex-wrap: wrap;
}

.leaves-tab {
    padding: 8px 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    border-radius: 6px 6px 0 0;
    transition: all 0.2s;
    position: relative;
}

.leaves-tab:hover {
    color: #333;
    background: #f5f5f5;
}

.leaves-tab.active {
    color: #4CAF50;
    background: #e8f5e9;
}

.leaves-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #4CAF50;
}

/* Team Calendar - tabelka responsywna */
.team-calendar-table {
    min-width: 100%;
}

.team-calendar-table .col-worker {
    min-width: 150px;
    max-width: 200px;
    position: sticky;
    left: 0;
    background: white;
    z-index: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .calendar-months-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .toolbar-dropdown-wide {
        min-width: 280px;
    }
    
    .absence-year-nav {
        flex-wrap: wrap;
    }
}
