﻿/* mobile.css - Universal Responsive Styles for All Pages */

/* ====================================
   BREAKPOINT SYSTEM:
   - Extra Large: 1400px+
   - Large: 1200px - 1399px
   - Medium: 992px - 1199px
   - Tablets: 768px - 991px
   - Mobile: 576px - 767px
   - Small Mobile: 480px - 575px
   - Extra Small: < 480px
   ==================================== */

/* ---- EXTRA LARGE DESKTOPS (1400px+) ---- */
@media (min-width: 1400px) {
    .container,
    .container-fluid {
        max-width: 1320px;
        margin: 0 auto;
    }

    .dashboard-grid,
    .admin-dashboard-grid,
    .cards-grid,
    .grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }

    .content-section {
        padding: 0 3rem 3rem;
    }
}

/* ---- LARGE DESKTOPS (1200px - 1399px) ---- */
@media (max-width: 1399px) {
    .container,
    .container-fluid {
        max-width: 1140px;
    }

    .dashboard-grid,
    .admin-dashboard-grid,
    .cards-grid,
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ---- MEDIUM DEVICES (992px - 1199px) ---- */
@media (max-width: 1199px) {
    :root {
        --sidebar-width: 240px;
        --border-radius: 16px;
        --border-radius-small: 10px;
    }

    .container,
    .container-fluid {
        max-width: 960px;
    }

    .dashboard-grid,
    .admin-dashboard-grid,
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .content-section,
    .admin-content-section {
        grid-template-columns: 1fr;
    }

    .content-box,
    .card {
        padding: 2rem;
    }

    .content-wrapper {
        padding: 1.5rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    .form-container {
        padding: 2rem;
    }

    table {
        font-size: 0.95rem;
    }

    th, td {
        padding: 0.875rem;
    }
}

/* ---- TABLETS (768px - 991px) ---- */
@media (max-width: 991px) {
    :root {
        --sidebar-width: 280px;
        --sidebar-collapsed: 0;
    }

    .container,
    .container-fluid {
        max-width: 720px;
        padding: 0 1rem;
    }

    #container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        z-index: 200;
        transition: left var(--transition-medium);
        box-shadow: 5px 0 20px rgba(0, 0, 0, 0.3);
    }

        .sidebar.active {
            left: 0;
        }

    /* POPRAWIONY HAMBURGER */
    .hamburger {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background: var(--glass-bg);
        backdrop-filter: blur(var(--blur-amount));
        -webkit-backdrop-filter: blur(var(--blur-amount));
        border: 1px solid var(--glass-border);
        border-radius: var(--border-radius-small);
        cursor: pointer;
        transition: all var(--transition-fast);
        position: relative;
        z-index: 999;
        padding: 0;
        font-size: 1.4rem;
        color: var(--pink-medium);
    }

        .hamburger:hover {
            transform: scale(1.05);
            background: var(--bg-card-hover);
            box-shadow: var(--shadow-glow);
            border-color: var(--pink-medium);
        }

        .hamburger.active {
            background: var(--primary-gradient);
            color: var(--text-primary);
            border-color: transparent;
        }

    main header {
        padding: 1rem 1.5rem;
        gap: 1rem;
    }

        main header h2 {
            font-size: 1.4rem;
        }

    .user-profile .user-role,
    .hide-tablet {
        display: none;
    }

    .dashboard-grid,
    .admin-dashboard-grid,
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 1.5rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .filter-row {
        flex-wrap: wrap;
    }

    .table-container {
        margin: 0 -1rem;
        padding: 0 1rem;
        border-radius: 0;
    }

    .admin-settings-grid {
        grid-template-columns: 1fr;
    }

    .settings-sidebar {
        display: none;
    }
}

/* ---- MOBILE DEVICES (576px - 767px) ---- */
@media (max-width: 767px) {
    .container,
    .container-fluid {
        max-width: 100%;
        padding: 0 1rem;
    }

    html {
        font-size: 15px;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    h4 {
        font-size: 1rem;
    }

    /* POPRAWIONY HEADER MOBILE */
    main header {
        padding: 1rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        flex-wrap: nowrap;
    }

        main header h2 {
            font-size: 1.2rem;
            margin: 0;
            flex: 1;
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

    .hamburger {
        order: -1;
        flex-shrink: 0;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .user-menu {
        order: 1;
        gap: 0.75rem;
        flex-shrink: 0;
    }

    .content-wrapper {
        padding: 1rem;
    }

    /* SINGLE COLUMN GRIDS */
    .dashboard-grid,
    .admin-dashboard-grid,
    .cards-grid,
    .documents-grid,
    .help-categories,
    .module-selection {
        grid-template-columns: 1fr !important;
        gap: 1rem;
        padding: 1rem;
    }

    /* POPRAWIONE KARTY */
    .card,
    .content-box,
    .admin-stat-card {
        padding: 1.5rem;
        border-radius: var(--border-radius-small);
        margin-bottom: 1rem;
    }

        .card .icon {
            width: 50px;
            height: 50px;
            font-size: 1.5rem;
            margin-bottom: 1rem;
        }

        .card h3 {
            font-size: 1.1rem;
        }

        .card .value {
            font-size: 2rem;
        }

        .card .description {
            font-size: 0.85rem;
        }

    /* POPRAWIONE FORMULARZE */
    .form-container,
    .auth-card {
        padding: 1.5rem;
        margin: 0;
        border-radius: var(--border-radius-small);
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .form-control,
    .form-select,
    .form-textarea {
        padding: 0.875rem 1rem;
        font-size: 16px; /* Prevent iOS zoom */
        min-height: 44px;
    }

    .form-textarea {
        min-height: 100px;
    }

    .form-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

        .form-actions .btn {
            width: 100%;
        }

    /* PRZYCISKI */
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        min-height: 44px;
    }

    .btn-lg {
        padding: 0.875rem 1.75rem;
    }

    /* TABELE - SCROLLOWALNE */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -1rem;
        padding: 0;
    }

    .table-wrapper {
        min-width: 600px;
        padding: 0 1rem;
    }

    table {
        min-width: 100%;
        font-size: 0.875rem;
    }

    th, td {
        padding: 0.75rem 0.5rem;
        white-space: nowrap;
    }

    /* TIMELINE - GRID LAYOUT */
    .horizontal-timeline {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        padding: 1rem 0;
        align-items: start;
    }

        .horizontal-timeline::before,
        .horizontal-timeline::after {
            display: none;
        }

    .timeline-step {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .timeline-icon {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
        margin-bottom: 0.5rem;
    }

    .timeline-content {
        width: 100%;
    }

        .timeline-content h6 {
            font-size: 0.8rem;
            margin-bottom: 0.3rem;
            line-height: 1.2;
        }

        .timeline-content .small {
            font-size: 0.7rem;
            line-height: 1.3;
            display: block;
            margin-top: 0.2rem;
        }

    /* MODALE */
    .modal {
        margin: 1rem;
        max-width: calc(100% - 2rem);
        padding: 1.5rem;
    }

    /* CHAT/WIADOMOŚCI */
    .messages-container {
        height: 400px;
    }

    .message {
        max-width: 80%;
        font-size: 0.9rem;
    }

    /* PROFIL UŻYTKOWNIKA */
    .user-profile {
        padding: 0.4rem 0.75rem;
    }

        .user-profile .avatar {
            width: 36px;
            height: 36px;
        }

    /* DZWONEK POWIADOMIEŃ */
    .notification-bell {
        font-size: 1.2rem;
        padding: 0.4rem;
    }

    /* ADMIN ACTIONS */
    .admin-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .admin-action-btn {
        width: 100%;
        justify-content: center;
    }

    .user-status,
    .payment-status {
        font-size: 0.7rem;
        padding: 0.2rem 0.6rem;
    }

    .hide-mobile {
        display: none !important;
    }
}

/* ---- SMALL MOBILE (480px - 575px) ---- */
@media (max-width: 575px) {
    html {
        font-size: 14px;
    }

    .container,
    .container-fluid {
        padding: 0 0.75rem;
    }

    main header {
        padding: 0.75rem;
    }

        main header h2 {
            font-size: 1.1rem;
        }

    .hamburger {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }

    .content-wrapper {
        padding: 0.75rem;
    }

    .card,
    .content-box {
        padding: 1.25rem;
        margin-bottom: 0.75rem;
    }

    .form-container,
    .auth-card {
        padding: 1.25rem;
    }

    .dashboard-grid,
    .cards-grid {
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .horizontal-timeline {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .timeline-icon {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
        margin-bottom: 0.4rem;
    }

    .timeline-content h6 {
        font-size: 0.75rem;
    }

    .timeline-content .small {
        font-size: 0.65rem;
    }

    .sidebar {
        width: 100%;
        max-width: 100%;
    }
}

/* ---- EXTRA SMALL MOBILE (< 480px) ---- */
@media (max-width: 479px) {
    :root {
        --border-radius: 12px;
        --border-radius-small: 8px;
    }

    .container,
    .container-fluid {
        padding: 0 0.5rem;
    }

    main header {
        padding: 0.5rem;
    }

    .hamburger {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .content-wrapper {
        padding: 0.5rem;
    }

    .card,
    .content-box {
        padding: 1rem;
    }

    .dashboard-grid {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    /* VERTICAL TIMELINE DLA BARDZO MAŁYCH EKRANÓW */
    .horizontal-timeline {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        padding: 1rem 0;
        position: relative;
        align-items: stretch;
    }

        .horizontal-timeline::before {
            content: '';
            position: absolute;
            left: 25px;
            top: 25px;
            bottom: 25px;
            width: 2px;
            background: var(--glass-border);
            z-index: 0;
            display: block !important;
        }

    .timeline-step {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        text-align: left;
        gap: 1rem;
        width: 100%;
        position: relative;
        z-index: 1;
    }

    .timeline-icon {
        flex-shrink: 0;
        margin: 0;
        background: var(--bg-primary);
        z-index: 2;
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .timeline-content {
        flex-grow: 1;
        padding-top: 5px;
        max-width: calc(100vw - 100px);
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

        .timeline-content h6 {
            text-align: left;
            font-size: 0.85rem;
            margin-bottom: 0.3rem;
            white-space: normal;
            word-break: break-word;
        }

        .timeline-content .small {
            text-align: left;
            display: block;
            margin-bottom: 0.2rem;
            white-space: normal;
            word-break: break-word;
        }

    .form-container,
    .auth-card {
        padding: 1rem;
        margin: 0 0.5rem;
    }

    .two-factor-inputs input {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .social-buttons {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .mb-5 {
        margin-bottom: 2rem !important;
    }

    .mb-4 {
        margin-bottom: 1.5rem !important;
    }

    .mb-3 {
        margin-bottom: 0.75rem !important;
    }

    .mt-3 {
        margin-top: 0.75rem !important;
    }
}

/* ---- ADMIN PANEL RESPONSIVE ---- */
@media (max-width: 991px) {
    .admin-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -1rem;
        padding: 0 1rem;
        border-radius: 0;
    }

    .admin-table {
        min-width: 800px;
        width: 100%;
    }

    .admin-content-section {
        padding: 1rem;
    }

    .admin-filters {
        padding: 1rem;
    }

    .filter-row {
        flex-direction: column;
        gap: 1rem;
    }

    .filter-group {
        width: 100%;
        margin-right: 0 !important;
    }

    .admin-actions {
        flex-wrap: wrap;
        gap: 0.75rem;
        justify-content: center;
    }

    .admin-action-btn {
        min-width: 150px;
        text-align: center;
    }
}

@media (max-width: 767px) {
    .content-section {
        padding: 1rem 0.5rem !important;
    }

    .content-wrapper {
        padding: 0 0.5rem;
    }

    .content-box {
        padding: 1.5rem !important;
        border-radius: 0.75rem;
    }

    .admin-table-wrapper {
        margin: 0 -1.5rem;
        padding: 0;
    }

    .admin-table {
        font-size: 0.85rem;
        min-width: 900px;
    }

        .admin-table th,
        .admin-table td {
            padding: 0.75rem 0.5rem;
            white-space: nowrap;
        }

    .drag-handle {
        display: none;
    }

    #modules-table {
        min-width: 700px;
    }

        #modules-table th:nth-child(2),
        #modules-table td:nth-child(2) {
            min-width: 180px;
        }

    .admin-actions {
        flex-direction: column;
        padding: 1rem 0;
    }

    .admin-action-btn {
        width: 100%;
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }

    .filter-input {
        width: 100%;
        padding: 0.875rem 1rem;
        font-size: 16px;
    }

    .content-header h2 {
        font-size: 1.5rem !important;
    }

    .admin-table-header h3 {
        font-size: 1.1rem;
    }

    .success-message {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .settings-content {
        padding: 1rem !important;
    }

        .settings-content h2 {
            font-size: 1.5rem !important;
            margin-bottom: 2rem !important;
        }

    .list-group-item {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
}

/* ---- ORIENTATION & ACCESSIBILITY ---- */
@media (orientation: landscape) and (max-height: 600px) {
    .auth-container {
        padding: 0.5rem;
    }

    .auth-card {
        padding: 1rem;
    }

    .form-group {
        margin-bottom: 0.5rem;
    }

    .content-box {
        padding: 1rem;
    }

    main header {
        padding: 0.5rem 1rem;
    }

    .horizontal-timeline {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .timeline-step {
        flex-direction: column;
        text-align: center;
        width: auto;
        flex: 0 1 100px;
    }

    .timeline-icon {
        margin: 0 auto 0.5rem;
    }
}

@media (hover: none) and (pointer: coarse) {
    .card:hover,
    .btn:hover,
    .nav-link:hover,
    .hamburger:hover {
        transform: none;
        box-shadow: none;
    }

    .btn,
    .form-control,
    .nav-link,
    .hamburger {
        min-height: 44px;
    }

    .custom-checkbox {
        width: 1.25rem;
        height: 1.25rem;
    }

    select.filter-input {
        min-height: 44px;
    }

    tr[draggable="true"] {
        -webkit-user-drag: none;
        user-drag: none;
    }

    .drag-handle {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ---- PREVENT HORIZONTAL SCROLL ---- */
@media (max-width: 991px) {
    html, body {
        overflow-x: hidden;
        max-width: 100%;
    }

    main {
        overflow-x: hidden;
    }

    .content-wrapper {
        overflow-x: hidden;
    }

    .container,
    .container-fluid,
    .row {
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }
}


/* ---- IOS SAFARI FIXES ---- */
@supports (-webkit-touch-callout: none) {
    .auth-card,
    .card,
    .content-box {
        -webkit-backdrop-filter: blur(var(--blur-amount));
    }

    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    select,
    textarea {
        font-size: 16px;
    }
}

/* ---- UTILITY CLASSES ---- */
@media (max-width: 1199px) {
    .hide-lg {
        display: none !important;
    }
}

@media (max-width: 991px) {
    .hide-md {
        display: none !important;
    }
}

@media (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }

    .show-mobile {
        display: initial !important;
    }
}

@media (min-width: 768px) {
    .hide-desktop {
        display: none !important;
    }

    .show-desktop {
        display: initial !important;
    }
}

/* ---- PRINT STYLES ---- */
@media print {
    .sidebar,
    .hamburger,
    .user-menu,
    .btn,
    .form-actions,
    .admin-actions {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .card,
    .content-box {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }

    #container {
        grid-template-columns: 1fr;
    }

    main {
        margin: 0;
    }
}
/* Dodaj to do mobile.css - Mobile Menu Overlay Fixes */

/* ---- MOBILE MENU OVERLAY ---- */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-fast), visibility var(--transition-fast);
    z-index: 199;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    pointer-events: none;
}

    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

/* ---- MOBILE SIDEBAR FIXES ---- */
@media (max-width: 991px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        z-index: 200;
        transition: left var(--transition-medium);
        box-shadow: 5px 0 20px rgba(0, 0, 0, 0.3);
    }

        .sidebar.active {
            left: 0;
        }

    /* Container nie ma już grid columns na mobile */
    #container {
        grid-template-columns: 1fr;
    }

        /* Usuń stare klasy jeśli istnieją */
        #container.open {
            /* Nie używamy już tej klasy */
        }
}

/* ---- HAMBURGER IMPROVEMENTS ---- */
@media (max-width: 991px) {
    .hamburger {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background: var(--glass-bg);
        backdrop-filter: blur(var(--blur-amount));
        -webkit-backdrop-filter: blur(var(--blur-amount));
        border: 1px solid var(--glass-border);
        border-radius: var(--border-radius-small);
        cursor: pointer;
        transition: all var(--transition-fast);
        position: relative;
        z-index: 999;
        padding: 0;
        font-size: 1.4rem;
        color: var(--pink-medium);
    }

        .hamburger:hover {
            transform: scale(1.05);
            background: var(--bg-card-hover);
            box-shadow: var(--shadow-glow);
            border-color: var(--pink-medium);
        }

        .hamburger.active {
            background: var(--primary-gradient);
            color: var(--text-primary);
            border-color: transparent;
            transform: scale(1);
        }

        .hamburger:focus {
            outline: 2px solid var(--pink-medium);
            outline-offset: 2px;
        }
}

@media (max-width: 767px) {
    .hamburger {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

@media (max-width: 575px) {
    .hamburger {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
}

/* ---- PREVENT BODY SCROLL WHEN MENU OPEN ---- */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* ---- ACCESSIBILITY IMPROVEMENTS ---- */
@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .mobile-menu-overlay,
    .hamburger {
        transition: none !important;
    }
}

/* ---- TOUCH DEVICE IMPROVEMENTS ---- */
@media (hover: none) and (pointer: coarse) {
    .hamburger:hover {
        transform: none;
        box-shadow: none;
    }

    .hamburger:active {
        transform: scale(0.95);
        background: var(--bg-card-hover);
    }
}
/* ====================================
   EMERGENCY MOBILE FIX - CreateClient
   Dodaj na sam koniec mobile.css
   ==================================== */

/* ---- FORCE MOBILE LAYOUT ---- */
@media (max-width: 767px) {
    /* Force viewport */
    .content-section {
        padding: 0.5rem 0 !important;
        overflow-x: hidden;
    }

    .content-wrapper {
        padding: 0 0.5rem !important;
        max-width: 100%;
        overflow-x: hidden;
    }

    .content-box {
        padding: 1rem !important;
        margin: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden;
    }

    /* Fix header */
    .content-header {
        margin-bottom: 1.5rem !important;
    }

        .content-header h2 {
            font-size: 1.3rem !important;
            line-height: 1.3 !important;
            word-break: break-word;
        }

    /* Force single column for ALL filter rows */
    .admin-filters .filter-row {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
        margin-bottom: 1.5rem !important;
        width: 100% !important;
    }

    .filter-group {
        width: 100% !important;
        margin: 0 !important;
        flex: none !important;
    }

        .filter-group label {
            display: block !important;
            margin-bottom: 0.5rem !important;
            font-size: 0.9rem !important;
            font-weight: 600 !important;
        }

    .filter-input {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0.875rem 1rem !important;
        font-size: 16px !important;
        min-height: 44px !important;
        box-sizing: border-box !important;
        border-radius: 8px !important;
    }

    /* Remove all margin classes that break layout */
    .me-3,
    .ms-2,
    .me-2 {
        margin-right: 0 !important;
        margin-left: 0 !important;
    }

    .flex-fill {
        flex: none !important;
        width: 100% !important;
    }

    /* Fix table wrapper */
    .admin-table-wrapper {
        width: calc(100% + 2rem) !important;
        margin-left: -1rem !important;
        margin-right: -1rem !important;
        margin-bottom: 2rem !important;
        padding: 1rem !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border-radius: 0 !important;
    }

    .admin-table-header {
        margin-bottom: 1rem !important;
        padding: 0 !important;
    }

        .admin-table-header h3 {
            font-size: 1.1rem !important;
        }

    .admin-table {
        min-width: 700px !important;
        width: 700px !important;
        font-size: 0.85rem !important;
    }

        .admin-table th,
        .admin-table td {
            padding: 0.5rem 0.25rem !important;
            font-size: 0.8rem !important;
            white-space: nowrap !important;
        }

            /* Adjust column widths */
            .admin-table th:nth-child(2),
            .admin-table td:nth-child(2) {
                width: 200px !important;
                min-width: 200px !important;
            }

            .admin-table th:nth-child(3),
            .admin-table td:nth-child(3) {
                width: 80px !important;
                text-align: center !important;
            }

            .admin-table th:nth-child(4),
            .admin-table td:nth-child(4) {
                width: 180px !important;
                min-width: 180px !important;
            }

            .admin-table th:nth-child(5),
            .admin-table td:nth-child(5) {
                width: 60px !important;
                text-align: center !important;
            }

        /* Table inputs */
        .admin-table .filter-input {
            width: 100% !important;
            padding: 0.4rem !important;
            font-size: 13px !important;
            min-height: 32px !important;
        }

        .admin-table select.filter-input {
            min-height: 36px !important;
            font-size: 13px !important;
        }

    .custom-checkbox {
        width: 1rem !important;
        height: 1rem !important;
    }

    /* Commission section - FORCE single column */
    .admin-filters h4.stat-label {
        font-size: 1rem !important;
        margin-bottom: 1rem !important;
    }

    .filter-row.align-items-center {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem !important;
        padding: 1rem !important;
        background: rgba(255, 255, 255, 0.03) !important;
        border-radius: 8px !important;
        margin-bottom: 1rem !important;
    }

    .commission-input-group {
        width: 100% !important;
        max-width: none !important;
    }

        .commission-input-group .d-flex {
            width: auto !important;
            justify-content: flex-start !important;
        }

    .commission-percent {
        width: 80px !important;
        margin-right: 0.5rem !important;
    }

    /* Actions */
    .admin-actions {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
        margin-top: 2rem !important;
    }

    .admin-action-btn {
        width: 100% !important;
        padding: 0.875rem 1rem !important;
        font-size: 0.95rem !important;
        min-height: 48px !important;
        justify-content: center !important;
        text-align: center !important;
    }

    /* Text center override */
    .text-center {
        text-align: left !important;
    }

    .admin-actions.text-center {
        text-align: center !important;
    }

    /* Validation messages */
    .text-danger.small {
        font-size: 0.8rem !important;
        margin-top: 0.25rem !important;
        display: block !important;
    }

    /* Alert messages */
    .alert {
        margin: 0 0 1.5rem 0 !important;
        padding: 1rem !important;
        border-radius: 8px !important;
    }

    .success-message {
        margin: 0 0 1.5rem 0 !important;
        padding: 1rem !important;
        border-radius: 8px !important;
        font-size: 0.9rem !important;
    }
}

/* ---- SMALLER MOBILE ---- */
@media (max-width: 575px) {
    .content-box {
        padding: 0.75rem !important;
    }

    .content-header h2 {
        font-size: 1.2rem !important;
    }

    .admin-table {
        min-width: 600px !important;
        width: 600px !important;
    }

        .admin-table th:nth-child(2),
        .admin-table td:nth-child(2) {
            width: 160px !important;
            min-width: 160px !important;
        }

        .admin-table th:nth-child(4),
        .admin-table td:nth-child(4) {
            width: 150px !important;
            min-width: 150px !important;
        }
}

/* ---- ULTRA SMALL ---- */
@media (max-width: 479px) {
    .content-wrapper {
        padding: 0 0.25rem !important;
    }

    .content-box {
        padding: 0.5rem !important;
        border-radius: 0 !important;
    }

    .admin-table-wrapper {
        margin-left: -0.5rem !important;
        margin-right: -0.5rem !important;
        padding: 0.5rem !important;
    }

    .admin-table {
        min-width: 550px !important;
        width: 550px !important;
    }

        .admin-table th:nth-child(2),
        .admin-table td:nth-child(2) {
            width: 140px !important;
            min-width: 140px !important;
        }

        .admin-table th:nth-child(4),
        .admin-table td:nth-child(4) {
            width: 130px !important;
            min-width: 130px !important;
        }
}

/* ---- FORCE RESPONSIVE OVERRIDES ---- */
@media (max-width: 767px) {
    /* Override any Bootstrap or other CSS that might interfere */
    .row {
        margin: 0 !important;
    }

    .col,
    .col-12,
    .col-md-6,
    .col-lg-4 {
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Prevent horizontal scroll */
    body,
    html,
    .container,
    .container-fluid {
        overflow-x: hidden !important;
        max-width: 100% !important;
    }
}
/* ====================================
   CLIENTS LIST RESPONSIVE STYLES
   Dodaj na końcu mobile.css
   ==================================== */

/* ---- DESKTOP STYLES ---- */
.client-name,
.client-email,
.client-phone {
    display: flex;
    align-items: center;
}

.date-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(102, 126, 234, 0.1);
    color: var(--blue-accent);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ---- MOBILE CARDS (Hidden by default) ---- */
.mobile-cards {
    display: none;
}

.mobile-client-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-small);
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all var(--transition-fast);
}

    .mobile-client-card:hover {
        background: rgba(255, 255, 255, 0.08);
        border-color: var(--pink-medium);
        transform: translateY(-2px);
        box-shadow: var(--shadow-glow);
    }

.client-card-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    gap: 1rem;
}

.client-avatar {
    width: 50px;
    height: 50px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-primary);
    flex-shrink: 0;
}

.client-info {
    flex: 1;
    min-width: 0;
}

    .client-info .client-name {
        font-size: 1.1rem;
        font-weight: 600;
        color: var(--text-primary);
        margin: 0 0 0.25rem 0;
        display: block;
    }

.client-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

.client-actions {
    flex-shrink: 0;
}

.mobile-edit-btn {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

    .mobile-edit-btn:hover {
        transform: scale(1.1);
        box-shadow: var(--shadow-glow);
    }

.client-card-body {
    padding: 0 1rem 1rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.1);
}

.client-detail {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

    .client-detail i {
        width: 16px;
        color: var(--pink-medium);
        flex-shrink: 0;
    }

    .client-detail span {
        word-break: break-all;
    }

/* ---- MOBILE FAB BUTTON ---- */
.mobile-fab {
    display: none;
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 100;
}

.fab-btn {
    width: 56px;
    height: 56px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.5rem;
    box-shadow: var(--shadow-glow);
    transition: all var(--transition-fast);
}

    .fab-btn:hover {
        transform: scale(1.1);
        box-shadow: 0 0 40px rgba(240, 147, 251, 0.8);
    }

/* ---- RESPONSIVE BREAKPOINTS ---- */
@media (max-width: 991px) {
    /* Tablet - still show table but smaller */
    .admin-table {
        font-size: 0.9rem;
    }

        .admin-table th,
        .admin-table td {
            padding: 0.75rem 0.5rem;
        }

    .admin-action-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 767px) {
    /* Mobile - switch to cards */
    .hide-mobile {
        display: none !important;
    }

    .show-mobile {
        display: block !important;
    }

    .mobile-fab {
        display: block !important;
    }

    /* Content adjustments */
    .content-box {
        padding: 1.5rem !important;
    }

    .content-header h2 {
        font-size: 1.4rem !important;
    }

    .admin-table-wrapper {
        overflow: visible;
    }

    .admin-table-header {
        margin-bottom: 1.5rem;
    }

        .admin-table-header h3 {
            font-size: 1.1rem;
        }

    /* Mobile cards */
    .mobile-cards {
        display: block;
    }

    .mobile-client-card {
        margin-bottom: 1rem;
    }

    .client-card-header {
        padding: 1rem;
    }

    .client-card-body {
        padding: 0 1rem 1rem 1rem;
    }
}

@media (max-width: 575px) {
    /* Small mobile adjustments */
    .content-box {
        padding: 1rem !important;
        margin: 0 0.5rem;
    }

    .content-header h2 {
        font-size: 1.2rem !important;
    }

    .client-card-header {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .client-avatar {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    .client-info .client-name {
        font-size: 1rem;
    }

    .client-date {
        font-size: 0.75rem;
    }

    .mobile-edit-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .client-card-body {
        padding: 0 0.75rem 0.75rem 0.75rem;
    }

    .client-detail {
        padding: 0.4rem 0;
        font-size: 0.85rem;
    }

    .mobile-fab {
        bottom: 1.5rem;
        right: 1.5rem;
    }

    .fab-btn {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
}

@media (max-width: 479px) {
    /* Ultra small mobile */
    .content-box {
        padding: 0.75rem !important;
        margin: 0 0.25rem;
        border-radius: 0;
    }

    .mobile-fab {
        bottom: 1rem;
        right: 1rem;
    }

    .fab-btn {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }
}

/* ---- TOUCH DEVICES ---- */
@media (hover: none) and (pointer: coarse) {
    .mobile-client-card:hover {
        transform: none;
        box-shadow: none;
    }

    .mobile-client-card:active {
        background: rgba(255, 255, 255, 0.1);
        transform: scale(0.98);
    }

    .mobile-edit-btn:hover {
        transform: none;
        box-shadow: var(--shadow-glow);
    }

    .mobile-edit-btn:active {
        transform: scale(0.9);
    }

    .fab-btn:hover {
        transform: none;
        box-shadow: var(--shadow-glow);
    }

    .fab-btn:active {
        transform: scale(0.9);
    }
}

/* ---- LOADING STATES ---- */
.mobile-client-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

    .mobile-client-card.loading::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
        animation: loading-shimmer 1.5s infinite;
    }

/* ---- EMPTY STATE ---- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

    .empty-state i {
        font-size: 3rem;
        margin-bottom: 1rem;
        color: var(--pink-medium);
    }

    .empty-state h3 {
        margin-bottom: 0.5rem;
        color: var(--text-secondary);
    }

    .empty-state p {
        margin-bottom: 1.5rem;
    }
/* ====================================
   PROJECTS LIST RESPONSIVE STYLES
   Dodaj na końcu mobile.css
   ==================================== */

/* ---- DESKTOP STYLES ---- */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.header-actions {
    margin-top: 0.5rem;
}

.project-number {
    display: inline-block;
    width: 30px;
    height: 30px;
    background: var(--primary-gradient);
    color: var(--text-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.project-name,
.client-name {
    display: flex;
    align-items: center;
    font-weight: 500;
}

.date-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(102, 126, 234, 0.1);
    color: var(--blue-accent);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ---- MOBILE PROJECTS (Hidden by default) ---- */
.mobile-projects {
    display: none;
}

.mobile-project-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-small);
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all var(--transition-fast);
}

    .mobile-project-card:hover {
        background: rgba(255, 255, 255, 0.08);
        border-color: var(--pink-medium);
        transform: translateY(-2px);
        box-shadow: var(--shadow-glow);
    }

.project-card-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    gap: 1rem;
}

.project-number-badge {
    width: 45px;
    height: 45px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.project-info {
    flex: 1;
    min-width: 0;
}

.project-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
    word-break: break-word;
}

.project-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.client-info,
.date-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

    .client-info i,
    .date-info i {
        width: 14px;
        color: var(--pink-medium);
        flex-shrink: 0;
    }

.project-actions {
    flex-shrink: 0;
}

.mobile-stages-btn {
    width: 44px;
    height: 44px;
    background: var(--accent-gradient);
    border-radius: var(--border-radius-small);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--transition-fast);
    font-size: 1.1rem;
}

    .mobile-stages-btn:hover {
        transform: scale(1.05);
        box-shadow: var(--shadow-glow);
    }

/* ---- EMPTY STATE ---- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

    .empty-state i {
        font-size: 4rem;
        margin-bottom: 1.5rem;
        color: var(--pink-medium);
        opacity: 0.6;
    }

    .empty-state h3 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
        color: var(--text-secondary);
    }

    .empty-state p {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 2rem;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }

    .empty-state .admin-action-btn {
        display: inline-flex;
        padding: 1rem 2rem;
        font-size: 1rem;
    }

/* ---- RESPONSIVE BREAKPOINTS ---- */
@media (max-width: 991px) {
    /* Tablet adjustments */
    .content-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .header-actions {
        margin-top: 0;
        text-align: center;
    }

    .admin-table {
        font-size: 0.9rem;
    }

        .admin-table th,
        .admin-table td {
            padding: 0.75rem 0.5rem;
        }
}

@media (max-width: 767px) {
    /* Mobile - switch to cards */
    .hide-mobile {
        display: none !important;
    }

    .show-mobile {
        display: block !important;
    }

    /* Content adjustments */
    .content-box {
        padding: 1.5rem !important;
    }

    .content-header {
        margin-bottom: 1.5rem;
        flex-direction: column;
        gap: 0;
    }

        .content-header h2 {
            font-size: 1.4rem !important;
            margin-bottom: 0.5rem;
        }

        .content-header .underline {
            margin-bottom: 1rem;
        }

    /* Mobile projects */
    .mobile-projects {
        display: block;
    }

    .mobile-project-card {
        margin-bottom: 1rem;
    }

    .project-card-header {
        padding: 1rem;
        gap: 1rem;
    }

    .project-number-badge {
        width: 45px;
        height: 45px;
        font-size: 0.9rem;
    }

    .project-title {
        font-size: 1.1rem;
    }

    .project-meta {
        gap: 0.3rem;
    }

    .client-info,
    .date-info {
        font-size: 0.85rem;
    }

    .mobile-stages-btn {
        width: 44px;
        height: 44px;
    }

    /* Empty state mobile */
    .empty-state {
        padding: 2rem 1rem;
    }

        .empty-state i {
            font-size: 3rem;
            margin-bottom: 1rem;
        }

        .empty-state h3 {
            font-size: 1.3rem;
        }

        .empty-state p {
            font-size: 0.95rem;
            margin-bottom: 1.5rem;
        }
}

@media (max-width: 575px) {
    /* Small mobile adjustments */
    .content-box {
        padding: 1rem !important;
        margin: 0 0.5rem;
    }

    .content-header h2 {
        font-size: 1.2rem !important;
    }

    .project-card-header {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .project-number-badge {
        width: 40px;
        height: 40px;
        font-size: 0.85rem;
    }

    .project-title {
        font-size: 1rem;
    }

    .project-meta {
        gap: 0.25rem;
    }

    .client-info,
    .date-info {
        font-size: 0.8rem;
    }

    .mobile-stages-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    /* FAB adjustments */
    .mobile-fab {
        bottom: 1.5rem;
        right: 1.5rem;
    }

    .fab-btn {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
}

@media (max-width: 479px) {
    /* Ultra small mobile */
    .content-box {
        padding: 0.75rem !important;
        margin: 0 0.25rem;
        border-radius: 0;
    }

    .content-header h2 {
        font-size: 1.1rem !important;
    }

    .project-card-header {
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .project-number-badge {
        width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }

    .project-title {
        font-size: 0.95rem;
        line-height: 1.2;
    }

    .client-info,
    .date-info {
        font-size: 0.75rem;
    }

    .mobile-stages-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .mobile-fab {
        bottom: 1rem;
        right: 1rem;
    }

    .fab-btn {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }
}

/* ---- TOUCH DEVICES ---- */
@media (hover: none) and (pointer: coarse) {
    .mobile-project-card:hover {
        transform: none;
        box-shadow: none;
    }

    .mobile-project-card:active {
        background: rgba(255, 255, 255, 0.1);
        transform: scale(0.98);
    }

    .mobile-stages-btn:hover {
        transform: none;
        box-shadow: var(--shadow-glow);
    }

    .mobile-stages-btn:active {
        transform: scale(0.9);
    }

    .fab-btn:hover {
        transform: none;
        box-shadow: var(--shadow-glow);
    }

    .fab-btn:active {
        transform: scale(0.9);
    }
}

/* ---- LOADING STATES ---- */
.mobile-project-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

    .mobile-project-card.loading::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
        animation: loading-shimmer 1.5s infinite;
    }

/* ---- STATISTICS SECTION (if needed) ---- */
.projects-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-small);
    padding: 1.5rem;
    text-align: center;
    transition: all var(--transition-fast);
}

    .stat-card:hover {
        background: rgba(255, 255, 255, 0.08);
        border-color: var(--pink-medium);
    }

    .stat-card .stat-number {
        font-size: 2rem;
        font-weight: 700;
        background: var(--primary-gradient);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        margin-bottom: 0.5rem;
    }

    .stat-card .stat-label {
        font-size: 0.9rem;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 1px;
    }

@media (max-width: 767px) {
    .projects-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }

    .stat-card {
        padding: 1rem;
    }

        .stat-card .stat-number {
            font-size: 1.5rem;
        }

        .stat-card .stat-label {
            font-size: 0.8rem;
        }
}
/* ====================================
   COLLABORATORS RESPONSIVE STYLES
   Dodaj na końcu mobile.css
   ==================================== */

/* ---- DESKTOP STYLES ---- */
.collaborator-name {
    display: flex;
    align-items: center;
    font-weight: 500;
}

.type-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: rgba(102, 126, 234, 0.1);
    color: var(--blue-accent);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.commission-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: rgba(80, 227, 194, 0.1);
    color: #50E3C2;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ---- COLLABORATOR FORM STYLES ---- */
.collaborator-form-box {
    max-width: 700px;
    margin: 0 auto;
}

.form-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-small);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

    .section-title i {
        color: var(--pink-medium);
    }

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-control {
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-small);
    font-size: 0.95rem;
    color: var(--bg-primary);
    transition: all var(--transition-fast);
}

    .form-control:focus {
        outline: none;
        border-color: var(--pink-medium);
        background: rgba(255, 255, 255, 0.95);
        box-shadow: 0 0 15px rgba(240, 147, 251, 0.3);
    }

.input-group {
    display: flex;
    align-items: center;
}

.input-addon {
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--glass-border);
    border-left: none;
    border-radius: 0 var(--border-radius-small) var(--border-radius-small) 0;
    color: var(--bg-primary);
    font-weight: 600;
}

.input-group .form-control {
    border-radius: var(--border-radius-small) 0 0 var(--border-radius-small);
}

.validation-error {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    display: block;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn {
    padding: 0.875rem 2rem;
    border-radius: var(--border-radius-small);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-fast);
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    min-height: 44px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: var(--text-primary);
}

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-glow);
    }

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

    .btn-secondary:hover {
        background: rgba(255, 255, 255, 0.15);
        border-color: var(--pink-medium);
    }

/* ---- MOBILE COLLABORATORS (Hidden by default) ---- */
.mobile-collaborators {
    display: none;
}

.mobile-collaborator-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-small);
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all var(--transition-fast);
}

    .mobile-collaborator-card:hover {
        background: rgba(255, 255, 255, 0.08);
        border-color: var(--pink-medium);
        transform: translateY(-2px);
        box-shadow: var(--shadow-glow);
    }

.collaborator-card-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    gap: 1rem;
}

.collaborator-avatar {
    width: 50px;
    height: 50px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-primary);
    flex-shrink: 0;
}

.collaborator-info {
    flex: 1;
    min-width: 0;
}

    .collaborator-info .collaborator-name {
        font-size: 1.1rem;
        font-weight: 600;
        color: var(--text-primary);
        margin: 0 0 0.5rem 0;
        display: block;
    }

.collaborator-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.type-info,
.commission-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

    .type-info i,
    .commission-info i {
        width: 14px;
        color: var(--pink-medium);
        flex-shrink: 0;
    }

.collaborator-actions {
    flex-shrink: 0;
}

.mobile-edit-btn {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

    .mobile-edit-btn:hover {
        transform: scale(1.1);
        box-shadow: var(--shadow-glow);
    }

/* ---- RESPONSIVE BREAKPOINTS ---- */
@media (max-width: 991px) {
    /* Tablet adjustments */
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .collaborator-form-box {
        max-width: 600px;
    }

    .admin-table {
        font-size: 0.9rem;
    }

        .admin-table th,
        .admin-table td {
            padding: 0.75rem 0.5rem;
        }
}

@media (max-width: 767px) {
    /* Mobile - switch to cards for index */
    .hide-mobile {
        display: none !important;
    }

    .show-mobile {
        display: block !important;
    }

    /* Content adjustments */
    .content-box {
        padding: 1.5rem !important;
    }

    .content-header h2 {
        font-size: 1.4rem !important;
    }

    /* Mobile collaborators */
    .mobile-collaborators {
        display: block;
    }

    /* Form adjustments */
    .collaborator-form-box {
        max-width: 100%;
        padding: 1.5rem !important;
    }

    .form-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .section-title {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .form-control {
        font-size: 16px; /* Prevent iOS zoom */
        min-height: 44px;
    }

    .form-actions {
        flex-direction: column;
        margin-top: 1.5rem;
        padding-top: 1rem;
    }

    .btn {
        width: 100%;
        justify-content: center;
        padding: 1rem 2rem;
    }

    /* Empty state mobile */
    .empty-state {
        padding: 2rem 1rem;
    }

        .empty-state i {
            font-size: 3rem;
            margin-bottom: 1rem;
        }

        .empty-state h3 {
            font-size: 1.3rem;
        }

        .empty-state p {
            font-size: 0.95rem;
            margin-bottom: 1.5rem;
        }
}

@media (max-width: 575px) {
    /* Small mobile adjustments */
    .content-box {
        padding: 1rem !important;
        margin: 0 0.5rem;
    }

    .content-header h2 {
        font-size: 1.2rem !important;
    }

    /* Collaborator cards */
    .collaborator-card-header {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .collaborator-avatar {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    .collaborator-info .collaborator-name {
        font-size: 1rem;
    }

    .type-info,
    .commission-info {
        font-size: 0.8rem;
    }

    .mobile-edit-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    /* Form adjustments */
    .collaborator-form-box {
        padding: 1rem !important;
    }

    .form-section {
        padding: 0.75rem;
    }

    .section-title {
        font-size: 0.95rem;
    }

    .form-control {
        padding: 0.75rem;
    }

    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 479px) {
    /* Ultra small mobile */
    .content-box {
        padding: 0.75rem !important;
        margin: 0 0.25rem;
        border-radius: 0;
    }

    .collaborator-form-box {
        padding: 0.75rem !important;
        border-radius: 0;
    }

    .form-section {
        padding: 0.75rem;
        border-radius: 8px;
    }

    .content-header h2 {
        font-size: 1.1rem !important;
    }
}

/* ---- TOUCH DEVICES ---- */
@media (hover: none) and (pointer: coarse) {
    .mobile-collaborator-card:hover {
        transform: none;
        box-shadow: none;
    }

    .mobile-collaborator-card:active {
        background: rgba(255, 255, 255, 0.1);
        transform: scale(0.98);
    }

    .mobile-edit-btn:hover {
        transform: none;
        box-shadow: var(--shadow-glow);
    }

    .mobile-edit-btn:active {
        transform: scale(0.9);
    }

    .btn:hover {
        transform: none;
        box-shadow: none;
    }

    .btn:active {
        transform: scale(0.98);
    }
}

/* ---- FORM VALIDATION STATES ---- */
.form-control.is-invalid {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.form-control.is-valid {
    border-color: #50E3C2;
    background: rgba(80, 227, 194, 0.1);
}

/* ---- LOADING STATES ---- */
.form-section.loading {
    opacity: 0.6;
    pointer-events: none;
}

.btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

    .btn.loading::after {
        content: '';
        width: 16px;
        height: 16px;
        border: 2px solid transparent;
        border-top: 2px solid currentColor;
        border-radius: 50%;
        animation: spin 1s linear infinite;
        margin-left: 0.5rem;
    }

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}
/* ====================================
   INVOICES RESPONSIVE STYLES
   Dodaj na końcu mobile.css
   ==================================== */

/* ---- DESKTOP STYLES ---- */
.invoice-number,
.collaborator-name {
    display: flex;
    align-items: center;
    font-weight: 500;
}

.client-info {
    display: flex;
    flex-direction: column;
}

.client-name {
    font-weight: 500;
    color: var(--text-primary);
}

.client-address {
    font-size: 0.85rem;
    line-height: 1.3;
    margin-top: 0.2rem;
}

.amount-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: rgba(80, 227, 194, 0.1);
    color: #50E3C2;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.date-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(102, 126, 234, 0.1);
    color: var(--blue-accent);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

    .status-badge.status-paid {
        background: rgba(80, 227, 194, 0.2);
        color: #50E3C2;
    }

    .status-badge.status-pending {
        background: rgba(241, 196, 15, 0.2);
        color: #f1c40f;
    }

/* ---- INVOICE FORM STYLES ---- */
.invoice-form-box {
    max-width: 800px;
    margin: 0 auto;
}

/* ---- MOBILE INVOICES (Hidden by default) ---- */
.mobile-invoices {
    display: none;
}

.mobile-invoice-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-small);
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all var(--transition-fast);
}

    .mobile-invoice-card:hover {
        background: rgba(255, 255, 255, 0.08);
        border-color: var(--pink-medium);
        transform: translateY(-2px);
        box-shadow: var(--shadow-glow);
    }

.invoice-card-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    gap: 1rem;
}

.invoice-status-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

    .invoice-status-icon .status-paid {
        color: #50E3C2;
        background: rgba(80, 227, 194, 0.1);
    }

    .invoice-status-icon .status-pending {
        color: #f1c40f;
        background: rgba(241, 196, 15, 0.1);
    }

.invoice-info {
    flex: 1;
    min-width: 0;
}

    .invoice-info .invoice-number {
        font-size: 1.1rem;
        font-weight: 600;
        color: var(--text-primary);
        margin: 0 0 0.5rem 0;
        display: block;
    }

.invoice-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.amount-info {
    font-size: 1rem;
    font-weight: 600;
    color: #50E3C2;
}

.date-info {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.invoice-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.mobile-edit-btn,
.mobile-pdf-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--transition-fast);
    font-size: 0.9rem;
}

.mobile-edit-btn {
    background: var(--primary-gradient);
}

.mobile-pdf-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

    .mobile-edit-btn:hover,
    .mobile-pdf-btn:hover {
        transform: scale(1.1);
        box-shadow: var(--shadow-glow);
    }

.invoice-card-body {
    padding: 0 1rem 1rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.1);
}

.invoice-detail {
    display: flex;
    align-items: flex-start;
    padding: 0.5rem 0;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

    .invoice-detail i {
        width: 16px;
        color: var(--pink-medium);
        flex-shrink: 0;
        margin-top: 0.1rem;
    }

    .invoice-detail strong {
        color: var(--text-primary);
    }

    .invoice-detail small {
        color: var(--text-muted);
        line-height: 1.3;
    }

/* ---- ALERTS ---- */
.alert {
    padding: 1rem;
    border-radius: var(--border-radius-small);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.alert-success {
    background: rgba(80, 227, 194, 0.1);
    border: 1px solid rgba(80, 227, 194, 0.3);
    color: #50E3C2;
}

.alert-info {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: var(--blue-accent);
}

/* ---- RESPONSIVE BREAKPOINTS ---- */
@media (max-width: 991px) {
    /* Tablet adjustments */
    .admin-table {
        font-size: 0.9rem;
    }

        .admin-table th,
        .admin-table td {
            padding: 0.75rem 0.5rem;
        }

    .client-address {
        display: none; /* Hide address on tablet */
    }

    .invoice-form-box {
        max-width: 100%;
    }
}

@media (max-width: 767px) {
    /* Mobile - switch to cards */
    .hide-mobile {
        display: none !important;
    }

    .show-mobile {
        display: block !important;
    }

    /* Content adjustments */
    .content-box {
        padding: 1.5rem !important;
    }

    .content-header h2 {
        font-size: 1.1rem !important;
    }

    .invoice-card-header {
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .invoice-status-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .invoice-info .invoice-number {
        font-size: 0.95rem;
        line-height: 1.2;
    }

    .amount-info {
        font-size: 0.85rem;
    }

    .date-info {
        font-size: 0.7rem;
    }

    .mobile-edit-btn,
    .mobile-pdf-btn {
        width: 30px;
        height: 30px;
        font-size: 0.75rem;
    }

    .invoice-actions {
        gap: 0.25rem;
    }
}

/* ---- TOUCH DEVICES ---- */
@media (hover: none) and (pointer: coarse) {
    .mobile-invoice-card:hover {
        transform: none;
        box-shadow: none;
    }

    .mobile-invoice-card:active {
        background: rgba(255, 255, 255, 0.1);
        transform: scale(0.98);
    }

    .mobile-edit-btn:hover,
    .mobile-pdf-btn:hover {
        transform: none;
        box-shadow: var(--shadow-glow);
    }

    .mobile-edit-btn:active,
    .mobile-pdf-btn:active {
        transform: scale(0.9);
    }

    .btn:hover {
        transform: none;
        box-shadow: none;
    }

    .btn:active {
        transform: scale(0.98);
    }

    /* Larger form elements for touch */
    .form-control {
        min-height: 48px !important;
    }

    select.form-control {
        min-height: 50px !important;
    }

    textarea.form-control {
        min-height: 120px !important;
    }
}

/* ---- LOADING STATES ---- */
.mobile-invoice-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

    .mobile-invoice-card.loading::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
        animation: loading-shimmer 1.5s infinite;
    }

.btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

    .btn.loading::after {
        content: '';
        width: 16px;
        height: 16px;
        border: 2px solid transparent;
        border-top: 2px solid currentColor;
        border-radius: 50%;
        animation: spin 1s linear infinite;
        margin-left: 0.5rem;
    }

/* ---- FORM VALIDATION STATES ---- */
.form-control.is-invalid {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.05);
}

.form-control.is-valid {
    border-color: #50E3C2;
    background: rgba(80, 227, 194, 0.05);
}

/* ---- PRINT STYLES FOR INVOICES ---- */
@media print {
    .mobile-fab,
    .invoice-actions,
    .mobile-edit-btn,
    .mobile-pdf-btn,
    .admin-actions,
    .btn {
        display: none !important;
    }

    .mobile-invoice-card {
        background: white;
        border: 1px solid #ddd;
        color: black;
        page-break-inside: avoid;
        margin-bottom: 1rem;
    }

    .invoice-info .invoice-number,
    .amount-info,
    .client-name {
        color: black !important;
    }

    .invoice-detail {
        color: black !important;
    }

    .status-badge {
        background: #f0f0f0 !important;
        color: black !important;
    }
}

/* ---- ACCESSIBILITY IMPROVEMENTS ---- */
@media (prefers-reduced-motion: reduce) {
    .mobile-invoice-card,
    .mobile-edit-btn,
    .mobile-pdf-btn,
    .btn {
        transition: none !important;
    }

        .mobile-invoice-card:hover {
            transform: none !important;
        }
}

/* ---- HIGH CONTRAST MODE ---- */
@media (prefers-contrast: high) {
    .status-badge.status-paid {
        background: #004d00;
        color: #00ff00;
        border: 1px solid #00ff00;
    }

    .status-badge.status-pending {
        background: #4d4d00;
        color: #ffff00;
        border: 1px solid #ffff00;
    }

    .amount-badge {
        background: #004d00;
        color: #00ff00;
        border: 1px solid #00ff00;
    }

    .mobile-invoice-card {
        border: 2px solid var(--text-primary);
    }
}

/*
    ODTWORZONY POCZATEK BLOKU @media (max-width: 767px).

    Co tu bylo: ogryzek deklaracji `-size: 1.4rem !important;` z osieroconym
    nawiasem klamrowym - resztka po dawnej edycji, bez selektora i bez `{`.
    Razem z nim przepadla linia otwierajaca zapytanie medialne, a nawias
    zamykajacy kilkadziesiat linijek nizej (przed `@media (max-width: 575px)`)
    zostal bez pary.

    SKUTEK, KTORY TO NAPRAWIA: caly ponizszy blok - pisany dla telefonu -
    obowiazywal na KAZDEJ szerokosci ekranu. Na monitorze oznaczalo to m.in.
    `.btn { width: 100% }`, czyli przycisk "Szukaj" nad lista zamowien
    rozciagniety na 1000 px, `.form-actions { flex-direction: column }`
    i `.form-grid { grid-template-columns: 1fr }`. Dokladnie te rzeczy,
    ktore sprawialy wrazenie, ze interfejs jest "za duzy".

    Ponizej 768 px nic sie nie zmienia - reguly dzialaja tak jak dzialaly.
*/
@media (max-width: 767px) {

/* Mobile invoices */
.mobile-invoices {
    display: block;
}

.mobile-invoice-card {
    margin-bottom: 1rem;
}

.invoice-card-header {
    padding: 1rem;
    gap: 1rem;
}

.invoice-status-icon {
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
}

.invoice-info .invoice-number {
    font-size: 1.05rem;
}

.amount-info {
    font-size: 0.95rem;
}

.date-info {
    font-size: 0.8rem;
}

.mobile-edit-btn,
.mobile-pdf-btn {
    width: 36px;
    height: 36px;
    font-size: 0.85rem;
}

.invoice-card-body {
    padding: 0 1rem 1rem 1rem;
}

.invoice-detail {
    padding: 0.4rem 0;
    font-size: 0.85rem;
}

/* Form adjustments */
.invoice-form-box {
    padding: 1.5rem !important;
}

.form-section {
    padding: 1rem;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.form-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
}

.form-control {
    font-size: 16px; /* Prevent iOS zoom */
    min-height: 44px;
}

textarea.form-control {
    min-height: 100px;
}

.form-actions {
    flex-direction: column;
    margin-top: 1.5rem;
    padding-top: 1rem;
}

.btn {
    width: 100%;
    justify-content: center;
    padding: 1rem 2rem;
}

/* Alerts mobile */
.alert {
    padding: 0.875rem;
    font-size: 0.9rem;
}

/* Empty state mobile */
.empty-state {
    padding: 2rem 1rem;
}

    .empty-state i {
        font-size: 3rem;
        margin-bottom: 1rem;
    }

    .empty-state h3 {
        font-size: 1.3rem;
    }

    .empty-state p {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

} /* koniec @media (max-width: 767px) odtworzonego wyzej */

@media (max-width: 575px) {
    /* Small mobile adjustments */
    .content-box {
        padding: 1rem !important;
        margin: 0 0.5rem;
    }

    .content-header h2 {
        font-size: 1.2rem !important;
    }

    /* Invoice cards */
    .invoice-card-header {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .invoice-status-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .invoice-info .invoice-number {
        font-size: 1rem;
    }

    .amount-info {
        font-size: 0.9rem;
    }

    .date-info {
        font-size: 0.75rem;
    }

    .mobile-edit-btn,
    .mobile-pdf-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .invoice-card-body {
        padding: 0 0.75rem 0.75rem 0.75rem;
    }

    .invoice-detail {
        padding: 0.3rem 0;
        font-size: 0.8rem;
    }

    /* Form adjustments */
    .invoice-form-box {
        padding: 1rem !important;
    }

    .form-section {
        padding: 0.75rem;
    }

    .section-title {
        font-size: 0.95rem;
    }

    .form-control {
        padding: 0.75rem;
    }

    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 479px) {
    /* Ultra small mobile */
    .content-box {
        padding: 0.75rem !important;
        margin: 0 0.25rem;
        border-radius: 0;
    }

    .invoice-form-box {
        padding: 0.75rem !important;
        border-radius: 0;
    }

    .form-section {
        padding: 0.75rem;
        border-radius: 8px;
    }

    /* Stała tu reguła `.content-header h2`, urwana w połowie słowa „font” przy
       doklejaniu poniższej sekcji na koniec pliku. Nie odtwarzamy jej, bo rozmiar
       nagłówka na najwęższych ekranach ustawiają już dwa wcześniejsze bloki
       479 px — oba na 1.1rem. Brakujący średnik i brakująca klamra zostawiały
       cały ten blok otwarty do końca pliku, przez co 719 następnych linii —
       w tym sześć bloków 767 px i reguły dla ekranów dotykowych — zawężało się
       do telefonów do 479 px i nigdy nie działało na tabletach. */
}

/* ====================================
   CUSTOMER PANEL STAGE DETAILS FIX
   ==================================== */

/* Poprawka białego tła w widoku szczegółowym etapu */
@media (max-width: 767px) {
    /* Główne kontenery customer panel */
    .customer-layout,
    .customer-container,
    .customer-panel,
    .customer-view,
    .stage-details,
    .stage-details-container {
        background-color: var(--bg-primary) !important;
        color: var(--text-primary) !important;
    }
    
    /* Content boxy w customer panel */
    .customer-panel .content-box,
    .customer-view .content-box,
    .stage-details .content-box {
        background: var(--glass-bg) !important;
        backdrop-filter: blur(var(--blur-amount));
        -webkit-backdrop-filter: blur(var(--blur-amount));
        border: 1px solid var(--glass-border);
        color: var(--text-primary) !important;
    }
    
    /* Nagłówki */
    .customer-panel h1, .customer-panel h2, .customer-panel h3,
    .customer-panel h4, .customer-panel h5, .customer-panel h6,
    .stage-details h1, .stage-details h2, .stage-details h3,
    .stage-details h4, .stage-details h5, .stage-details h6 {
        color: var(--text-primary) !important;
    }
    
    /* Teksty */
    .customer-panel p, .customer-panel span, .customer-panel div:not(.content-box),
    .stage-details p, .stage-details span, .stage-details div:not(.content-box) {
        color: var(--text-secondary) !important;
    }
    
    /* Specjalne klasy kolorów */
    .customer-panel .text-muted,
    .stage-details .text-muted {
        color: var(--text-muted) !important;
    }
    
    .customer-panel .text-success,
    .stage-details .text-success {
        color: #50E3C2 !important;
    }
    
    .customer-panel .text-primary,
    .stage-details .text-primary {
        color: var(--pink-medium) !important;
    }
    
    .customer-panel .text-warning,
    .stage-details .text-warning {
        color: #f1c40f !important;
    }
    
    /* Linki i przyciski */
    .customer-panel a:not(.btn),
    .stage-details a:not(.btn) {
        color: var(--pink-medium);
    }
    
    .customer-panel .btn,
    .stage-details .btn {
        background: var(--primary-gradient);
        color: var(--text-primary);
        border: none;
    }
    
    /* Timeline w stage details */
    .stage-details .timeline-step {
        background: transparent;
    }
    
    .stage-details .timeline-icon {
        background: var(--glass-bg);
        border: 1px solid var(--glass-border);
        color: var(--text-primary);
    }
    
    .stage-details .timeline-content {
        color: var(--text-primary);
    }
    
    /* Tabele w customer panel */
    .customer-panel table,
    .stage-details table {
        background: var(--glass-bg);
        color: var(--text-primary);
    }
    
    .customer-panel th,
    .stage-details th {
        background: rgba(255, 255, 255, 0.05);
        color: var(--text-primary);
    }
    
    .customer-panel td,
    .stage-details td {
        color: var(--text-secondary);
        border-color: var(--glass-border);
    }
}
/* ====================================
   CUSTOMER PANEL STAGE DETAILS FIX
   Dodaj to na samym końcu mobile.css
   ==================================== */

/* Poprawka białego tła w widoku szczegółowym etapu */
@media (max-width: 767px) {
    /* Główne kontenery customer panel */
    .customer-layout,
    .customer-container,
    .customer-panel,
    .customer-view,
    .stage-details,
    .stage-details-container {
        background-color: var(--bg-primary) !important;
        color: var(--text-primary) !important;
    }

        /* Content boxy w customer panel */
        .customer-panel .content-box,
        .customer-view .content-box,
        .stage-details .content-box {
            background: var(--glass-bg) !important;
            backdrop-filter: blur(var(--blur-amount));
            -webkit-backdrop-filter: blur(var(--blur-amount));
            border: 1px solid var(--glass-border);
            color: var(--text-primary) !important;
        }

        /* Nagłówki */
        .customer-panel h1, .customer-panel h2, .customer-panel h3,
        .customer-panel h4, .customer-panel h5, .customer-panel h6,
        .stage-details h1, .stage-details h2, .stage-details h3,
        .stage-details h4, .stage-details h5, .stage-details h6 {
            color: var(--text-primary) !important;
        }

        /* Teksty */
        .customer-panel p, .customer-panel span, .customer-panel div:not(.content-box),
        .stage-details p, .stage-details span, .stage-details div:not(.content-box) {
            color: var(--text-secondary) !important;
        }

        /* Specjalne klasy kolorów */
        .customer-panel .text-muted,
        .stage-details .text-muted {
            color: var(--text-muted) !important;
        }

        .customer-panel .text-success,
        .stage-details .text-success {
            color: #50E3C2 !important;
        }

        .customer-panel .text-primary,
        .stage-details .text-primary {
            color: var(--pink-medium) !important;
        }

        .customer-panel .text-warning,
        .stage-details .text-warning {
            color: #f1c40f !important;
        }

        /* Linki i przyciski */
        .customer-panel a:not(.btn),
        .stage-details a:not(.btn) {
            color: var(--pink-medium);
        }

        .customer-panel .btn,
        .stage-details .btn {
            background: var(--primary-gradient);
            color: var(--text-primary);
            border: none;
        }

        /* Timeline w stage details */
        .stage-details .timeline-step {
            background: transparent;
        }

        .stage-details .timeline-icon {
            background: var(--glass-bg);
            border: 1px solid var(--glass-border);
            color: var(--text-primary);
        }

        .stage-details .timeline-content {
            color: var(--text-primary);
        }

        /* Tabele w customer panel */
        .customer-panel table,
        .stage-details table {
            background: var(--glass-bg);
            color: var(--text-primary);
        }

        .customer-panel th,
        .stage-details th {
            background: rgba(255, 255, 255, 0.05);
            color: var(--text-primary);
        }

        .customer-panel td,
        .stage-details td {
            color: var(--text-secondary);
            border-color: var(--glass-border);
        }
}
/* Safari iOS specific fixes */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari */
    .content-box {
        -webkit-backdrop-filter: blur(var(--blur-amount));
    }
    
    /* Prevent zoom on input focus */
    input, select, textarea {
        font-size: 16px !important;
    }
    
    /* Fix for 100vh on iOS */
    .sidebar {
        height: 100vh;
        height: -webkit-fill-available;
    }
}

/* Safe area insets for iPhone X+ */
@supports (padding: max(0px)) {
    .container {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
    
    .mobile-fab {
        bottom: max(2rem, env(safe-area-inset-bottom) + 1rem);
    }
}
/* ====================================
   ADMIN STAGES & MODULES MOBILE FIX
   Dodaj do mobile.css lub utwórz admin-mobile.css
   ==================================== */

/*
    TABELE NA TELEFONIE.

    CO TU STAŁO I DLACZEGO BYŁO GROŹNE: reguła bezwarunkowo chowała
    `.admin-table-wrapper` poniżej 768 px, licząc na listę kart `.mobile-stages-view`
    „która będzie w HTML" — tak głosił komentarz autora. Kart nigdy nie dopisano
    do żadnego widoku poza dwoma. Skutek był taki, że na telefonie lista zamówień
    administratora, lista klientów, cennik i **lista zamówień klienta** były PUSTE:
    nie węższe, nie przewijane — puste. Zmierzone: 127 znaków tekstu i zero wierszy
    na `/Klient/Zamowienia` przy 390 px.

    TERAZ: tabela znika WYŁĄCZNIE tam, gdzie obok niej naprawdę leży lista kart.
    Wszędzie indziej zostaje i przewija się w swoim kontenerze — ten sam wzorzec,
    którego używa reszta projektu, i jedyny, który nie wymaga pisania drugiego
    widoku dla każdej tabeli z osobna.

    Gdyby przeglądarka nie znała `:has()`, na telefonie pokażą się i karty, i tabela.
    Nadmiar jest tu właściwym kierunkiem awarii — brak treści nie jest.
*/
@media (max-width: 767px) {
    /* Element z klasą jest SAM sekcją, a karty leżą jako jego dalsze rodzeństwo —
       stąd `~` na nim wprost, a nie `:has()` na rodzicu. */
    .admin-table-wrapper:has(~ .mobile-stages-view),
    .responsive-table-container:has(~ .mobile-stages-view) {
        display: none !important;
    }

    .mobile-stages-view {
        display: block !important;
    }

    /* Tabela szersza od ekranu przewija się w SOBIE, a nie rozpycha strony. */
    .admin-table-wrapper,
    .responsive-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }
}

/* Mobile Stage Cards */
.mobile-stages-view {
    display: none; /* Hidden on desktop */
}

.mobile-stage-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-small);
    margin-bottom: 1rem;
    padding: 1rem;
    position: relative;
}

.stage-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.stage-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: var(--primary-gradient);
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.9rem;
}

.stage-name {
    flex: 1;
    margin: 0 0.75rem;
    font-weight: 600;
    font-size: 1.05rem;
}

.stage-status {
    font-size: 0.8rem;
}

    .stage-status.completed {
        color: #50E3C2;
    }

    .stage-status.pending {
        color: #f1c40f;
    }

.stage-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stage-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stage-field-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stage-field-value {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.stage-field-input {
    width: 100%;
    padding: 0.5rem;
    background: rgba(255,255,255,0.9);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    font-size: 16px; /* Prevent iOS zoom */
    color: var(--bg-primary);
}

.stage-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.mobile-action-btn {
    flex: 1;
    padding: 0.625rem;
    font-size: 0.85rem;
    border-radius: 6px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    text-decoration: none;
    transition: all 0.2s;
}

    .mobile-action-btn.primary {
        background: var(--primary-gradient);
        color: white;
    }

    .mobile-action-btn.success {
        background: linear-gradient(135deg, #50E3C2, #3eb89f);
        color: white;
    }

    .mobile-action-btn.secondary {
        background: rgba(255,255,255,0.1);
        color: var(--text-primary);
        border: 1px solid var(--glass-border);
    }

/* Module Management Mobile */
.mobile-modules-view {
    display: none;
}

@media (max-width: 767px) {
    .mobile-modules-view {
        display: block !important;
    }

    /* Disable drag on mobile */
    .drag-handle {
        display: none !important;
    }

    tr[draggable="true"] {
        -webkit-user-drag: none;
        user-drag: none;
    }
}

.mobile-module-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-small);
    margin-bottom: 0.75rem;
    padding: 1rem;
    position: relative;
}

.module-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.module-toggle {
    width: 44px;
    height: 24px;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s;
}

    .module-toggle.active {
        background: var(--primary-gradient);
    }

.module-toggle-handle {
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.module-toggle.active .module-toggle-handle {
    left: 22px;
}

.module-info {
    flex: 1;
}

.module-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.module-status {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.module-order-buttons {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.order-btn {
    width: 28px;
    height: 20px;
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.7rem;
    color: var(--text-primary);
}

    .order-btn:hover {
        background: var(--primary-gradient);
        color: white;
    }

/* ====================================
   CREATE/EDIT CLIENT MOBILE IMPROVEMENTS
   ==================================== */
@media (max-width: 767px) {
    /*
        USUNIĘTY WYMUSZONY JASNY MOTYW NA TELEFONIE.

        Stał tu blok, który poniżej 767 px przestawiał `.content-wrapper` i `.content-box`
        na białe tło z ciemnym tekstem, a `.content-section` na jasnoszare. Aplikacja jest
        ciemna na każdej innej szerokości, więc telefon robił się jedynym ekranem w innym
        motywie — i to niekompletnym.

        Niekompletnym, bo blok wyliczał z nazwy tylko część elementów: `label`, `h2`, `h3`,
        `h4`, `input`, `select`, `textarea`. Wszystko poza tą listą zostawało przy jasnym
        kolorze z motywu ciemnego i lądowało jako BIAŁY TEKST NA BIAŁYM TLE. Dopisywanie
        kolejnych selektorów to gonienie własnego ogona — każdy nowy ekran dokłada elementy,
        o których ta lista nie wie.

        `.content-section` przy okazji nie występuje w żadnym widoku — była to reguła martwa
        od początku.

        Motyw ciemny ma komplet kolorów w site.css i działa na telefonie tak samo jak
        na komputerze, więc usunięcie tego bloku nie zostawia po sobie dziury.
    */

    /* Przycisk akcji full-width */
    .admin-action-btn {
        display: block !important;
        width: 100% !important;
        margin-bottom: 0.75rem !important;
    }

    /* Twoje istniejące poprawki */
    .admin-filters {
        padding: 0 !important;
        margin-bottom: 1.5rem !important;
    }

    .filter-row {
        flex-direction: column !important;
        gap: 1rem !important;
        margin-bottom: 0 !important;
    }

    .filter-group {
        width: 100% !important;
        margin: 0 !important;
    }

    .filter-input {
        width: 100% !important;
        padding: 0.75rem !important;
        font-size: 16px !important; /* Prevent iOS zoom */
    }

    /* Stała tu zbłąkana klamra, która zamykała blok 767 px o trzydzieści linii
       za wcześnie. Reguły poniżej — mimo wcięcia sugerującego coś innego —
       wypadały przez to poza zapytanie medialne. Blok zamyka się teraz tam,
       gdzie kończy się jego treść. */

    /* Commission section */
    .commission-input-group {
        width: 100% !important;
        margin-top: 0.5rem;
    }

    .commission-percent {
        width: 80px !important;
    }

    /* Replace table with cards for modules */
    #modules-table {
        display: none !important;
    }

    .mobile-modules-list {
        display: block !important;
    }

    /* Actions */
    .admin-actions {
        flex-direction: column !important;
        gap: 1rem !important;
    }

    .admin-action-btn {
        width: 100% !important;
        padding: 0.875rem !important;
        justify-content: center !important;
    }
}

/* Mobile modules list for client form */
.mobile-modules-list {
    display: none;
}

.mobile-module-item {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.mobile-module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.mobile-module-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.mobile-module-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-module-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Touch-friendly adjustments */
@media (hover: none) and (pointer: coarse) {
    .mobile-action-btn,
    .order-btn,
    .module-toggle {
        min-height: 44px;
    }

    .stage-field-input,
    .filter-input {
        min-height: 44px;
    }

    /* Remove hover effects on touch devices */
    .mobile-stage-card:hover,
    .mobile-module-card:hover {
        transform: none;
    }

    /* Add active states instead */
    .mobile-stage-card:active,
    .mobile-module-card:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
}

/* Ensure proper dark theme */
@media (max-width: 767px) {
    .content-section,
    .content-box,
    .settings-content {
        background: var(--bg-primary) !important;
        color: var(--text-primary) !important;
    }

    /* Fix white backgrounds */
    input[type="date"],
    input[type="number"],
    input[type="text"],
    input[type="email"],
    select {
        background: rgba(255,255,255,0.9) !important;
        color: #1a1a2e !important;
    }

    /* Fix content box padding */
    .content-box {
        padding: 1rem !important;
        margin: 0 0.5rem;
    }

    .settings-content {
        padding: 1rem !important;
        max-width: 100% !important;
    }
}
