/* Updated: 2025-12-18 20:49 */
/* ==================== GLOBAL STYLES ==================== */
.plany-treningowe-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #e0e0e0;
    max-width: 1600px;
    margin: 0 auto;
}

.plany-treningowe-container a {
    color: #ffc400;
    text-decoration: none;
    transition: color 0.2s;
}

.plany-treningowe-container a:hover {
    color: #ffd54f;
}

/* ==================== NAVIGATION TABS ==================== */
/* ==================== HEADER & MENU REDESIGN ==================== */

.plany-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #333;
    flex-wrap: wrap;
    gap: 15px;
}

.plany-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0;
    background: linear-gradient(135deg, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Adjust new plan button */
.plany-header .btn-primary {
    font-size: 0.95rem;
    padding: 10px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(255, 196, 0, 0.15);
}

/* Navigation Tabs Redesign */
.plany-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 30px;
    background: #181818;
    padding: 6px;
    border-radius: 12px;
    display: inline-flex;
    /* Shrink to fit content */
    border: 1px solid #2a2a2a;
    flex-wrap: wrap;
}

.plany-nav-link {
    background-color: transparent;
    color: #888;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.plany-nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.05);
    transform: none;
}

.plany-nav-link.active {
    background-color: #2a2a2a;
    /* Fallback */
    color: #00e5ff;
    /* Fallback */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid #333;
    font-weight: 600;
}

/* Specific color variation for "Plany treningowe" active tab */
.plany-nav-link[href*="plany_tab=plany"].active {
    color: #4caf50;
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

/* Cwiczenia Tab - Orange */
.plany-nav-link[href*="plany_tab=cwiczenia"].active {
    color: #ff9800;
    background: rgba(255, 152, 0, 0.1);
    border: 1px solid rgba(255, 152, 0, 0.3);
}

/* Prompty AI Tab - Purple/Pink */
.plany-nav-link[href*="plany_tab=prompty_ai"].active {
    color: #e040fb;
    background: rgba(224, 64, 251, 0.1);
    border: 1px solid rgba(224, 64, 251, 0.3);
}

/* Ustawienia AI Tab - Blue */
.plany-nav-link[href*="plany_tab=ustawienia_ai"].active {
    color: #2979ff;
    background: rgba(41, 121, 255, 0.1);
    border: 1px solid rgba(41, 121, 255, 0.3);
}

/* Mobile responsive for header */
@media (max-width: 600px) {
    .plany-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .plany-nav {
        display: flex;
        overflow-x: auto;
        white-space: nowrap;
        width: 100%;
        padding-bottom: 15px;
        /* Scrollbar space */
    }
}


/* ==================== BUTTONS ==================== */
.btn-primary,
.btn-secondary,
.btn-warning,
.btn-danger,
.btn-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background-color: #ffc400;
    color: #111;
}

.btn-primary:hover {
    background-color: #ffcd33;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 196, 0, 0.2);
}

.btn-add {
    /* Zielony przycisk dodawania */
    background-color: #28a745;
    color: white;
}

.btn-add:hover {
    background-color: #218838;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

/* Small buttons */
.btn-small {
    padding: 4px 10px;
    font-size: 12px;
}

/* Action buttons in table */
.btn-edit-small,
.btn-delete-small {
    background: transparent;
    color: #aaa;
    border: none;
    width: auto;
    height: auto;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-right: 15px;
    font-size: 14px;
    padding: 6px 10px;
    transition: color 0.2s, background 0.2s;
}

.btn-delete-small {
    color: #e57373;
    /* Light red */
}

.btn-edit-small:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.btn-delete-small:hover {
    color: #ff5252;
    background: rgba(220, 53, 69, 0.1);
}


/* ==================== EDITOR STYLES ==================== */
/* ==================== EDITOR STYLES (CARD DESIGN) ==================== */
.edytor-planu {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 1. Header Block */
.edytor-header {
    background: #1c1c1c;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
    /* Reset margins/padding from previous styles if any */
    margin-bottom: 0;
}

.edytor-header h2 {
    color: #fff;
    /* Title white for better contrast or Gold if preferred, sticking to white is cleaner with Gold accents */
    margin: 15px 0 10px 0;
    font-size: 2rem;
    font-weight: 700;
}

.edytor-header .btn-back {
    display: inline-flex;
    align-items: center;
    color: #aaa;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 14px;
    border-radius: 20px;
}

.edytor-header .btn-back:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateX(-3px);
}

.plan-meta {
    color: #888;
    font-size: 14px;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.plan-meta strong {
    color: #ccc;
    font-weight: 600;
}

/* 2. Units Section Block */
.edytor-section {
    background: #1c1c1c;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid #333;
    padding-bottom: 15px;
}

.section-header h3 {
    color: #ffc400;
    font-size: 1.5rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-add-jednostka {
    /* Using global btn-primary styles (Gold) */
    padding: 10px 20px;
    font-size: 15px;
    border-radius: 8px;
    /* Slightly more rounded */
}

/* Info Box below section header */
.jednostki-info {
    background: #252525;
    padding: 15px 20px;
    border-radius: 8px;
    border: 1px solid #333;
    margin-bottom: 25px;
    color: #ccc;
    font-size: 14px;
    line-height: 1.5;
}

.jednostki-info p {
    margin: 0 0 5px 0;
    font-size: 15px;
}

.jednostki-info strong {
    color: #fff;
}

.jednostki-info small {
    color: #888;
    display: block;
    margin-top: 5px;
}

/* Jednostka Card (Individual Unit) */
.jednostka-card {
    background-color: #222;
    border: 1px solid #333;
    border-radius: 12px;
    margin-bottom: 25px;
    padding: 0;
    /* Removed padding for full-width children */
    overflow: hidden;
    /* Ensure children execute border-radius */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.jednostka-card:hover {
    border-color: #444;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.jednostka-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: #2a2a2a;
    /* Subtle contrast header */
    border-bottom: 1px solid #333;
}

/* ==================== MODALS ==================== */
/* Class to block body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

.plany-modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    /* Changed from auto to hidden - modal wrapper shouldn't scroll */
    background-color: rgba(0, 0, 0, 0.7);
    /* Black w/ opacity */
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

.plany-modal.active {
    display: flex;
    /* Flex to center content */
}

.modal-content {
    background-color: #1c1c1c;
    margin: 40px auto;
    padding: 0;
    border: 1px solid #333;
    width: 90%;
    max-width: 600px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: slideDown 0.3s ease-out;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

@keyframes slideDown {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #252525;
    border-radius: 12px 12px 0 0;
}

.modal-header h2 {
    margin: 0;
    color: #fff;
    font-size: 1.25rem;
}

.modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover,
.modal-close:focus {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

.modal-content form {
    padding: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #ccc;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
    /* Fix width issues */
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ffc400;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #333;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #252525;
    border-radius: 0 0 12px 12px;
}

/* Form Grid */
.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

/* Radio Group */
.serie-type-selector {
    display: flex;
    gap: 30px;
    margin-top: 5px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #ddd;
    font-size: 0.95em;
    position: relative;
    padding-left: 28px;
    /* Space for custom radio */
}

/* Hide default radio */
.radio-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* Custom Radio Circle */
.radio-label span::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 18px;
    width: 18px;
    background-color: #2a2a2a;
    border: 2px solid #555;
    border-radius: 50%;
    transition: all 0.2s ease;
}

/* Inner Dot (hidden by default) */
.radio-label span::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    height: 10px;
    width: 10px;
    background-color: #ffc400;
    border-radius: 50%;
    transition: all 0.2s ease;
}

/* Hover State */
.radio-label:hover span::before {
    border-color: #888;
}

/* Checked State */
.radio-label input[type="radio"]:checked~span::before {
    border-color: #ffc400;
    background-color: #2a2a2a;
}

.radio-label input[type="radio"]:checked~span::after {
    transform: translateY(-50%) scale(1);
}

.radio-label input[type="radio"]:checked~span {
    color: #fff;
    font-weight: 500;
}

/* Weekly Grid for Series */
.tygodnie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.tydzien-input-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tydzien-input-wrapper label {
    font-size: 11px;
    margin-bottom: 2px;
    color: #aaa;
}

.tydzien-serie-input {
    width: 100% !important;
    text-align: center;
    padding: 5px !important;
}

/* Unit Highlight */
.unit-name-highlight {
    background: #2a2a2a;
    padding: 10px;
    border-left: 3px solid #ffc400;
    border-radius: 4px;
    color: #fff;
    font-weight: 500;
}

.jednostka-info h4 {
    margin: 0;
    font-size: 1.4rem;
    /* Larger font */
    color: #fff;
    display: inline-block;
    font-weight: 700;
    letter-spacing: 0.5px;
    vertical-align: middle;
}

.jednostka-num {
    display: inline-block;
    background: rgba(255, 196, 0, 0.15);
    /* Gold badge background */
    color: #ffc400;
    padding: 5px 12px;
    border-radius: 8px;
    margin-right: 15px;
    /* More spacing */
    font-weight: 700;
    font-size: 1.1rem;
    vertical-align: middle;
    border: 1px solid rgba(255, 196, 0, 0.2);
}

.jednostka-notatki {
    display: block;
    color: #888;
    font-size: 13px;
    margin-top: 6px;
    margin-left: 2px;
    font-style: italic;
}

/* Unit Header Actions (Edit, Delete, Show/Hide) */
/* Unit Header Actions (Edit, Delete, Show/Hide) */
.jednostka-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.jednostka-actions button {
    background: transparent;
    border: none;
    color: #888;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 6px;
    height: 32px;
}

/* Edit Button (Clean Text + Icon) */
.jednostka-actions .btn-edit-jednostka {
    color: #aaa;
}

.jednostka-actions .btn-edit-jednostka:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* Delete Button (Clean Text + Icon) */
.jednostka-actions .btn-delete-jednostka {
    color: #aaa;
}

.jednostka-actions .btn-delete-jednostka:hover {
    color: #ff4d4d;
    background: rgba(255, 77, 77, 0.1);
}

/* Hide/Show Toggle (Stroked Gold Button) */
.jednostka-actions .btn-toggle-cwiczenia {
    background: transparent;
    border: 1px solid #ffc400;
    color: #ffc400;
    padding: 6px 16px;
    font-weight: 600;
}

.jednostka-actions .btn-toggle-cwiczenia:hover {
    background: rgba(255, 196, 0, 0.1);
    color: #ffcd33;
    border-color: #ffcd33;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 196, 0, 0.15);
}

/* Cwiczenia Filters (Green pills) */
.cwiczenia-filters {
    margin: 15px 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-filter {
    background: #2a2a2a;
    border: 1px solid #333;
    color: #888;
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.2s;
}

.btn-filter:hover,
.btn-filter.active {
    background: #2ecc71;
    /* Fresh green */
    color: #fff;
    border-color: #2ecc71;
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.2);
}

/* Exercise Action Buttons (Add Custom, From DB, Superset) */
.cwiczenia-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 20px;
    padding-top: 10px;
    border-top: 1px solid #333;
    /* Separator from filters if needed, or remove */
    margin-top: 10px;
}

.cwiczenia-buttons button {
    padding: 8px 18px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
}

/* + Dodaj ćwiczenie (Primary Gold) */
.btn-add-cwiczenie-custom {
    background: #ffc400;
    color: #111;
    box-shadow: 0 2px 10px rgba(255, 196, 0, 0.1);
}

.btn-add-cwiczenie-custom:hover {
    background: #ffcd33;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 196, 0, 0.2);
}

/* Z bazy (Secondary Dark Outline) */
.btn-add-cwiczenie-from-db {
    background: transparent;
    border: 1px solid #666;
    color: #ccc;
}

.btn-add-cwiczenie-from-db:hover {
    border-color: #fff;
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

/* Superseria (Warning/Orange) */
.btn-superset {
    background: rgba(255, 152, 0, 0.1);
    color: #ff9800;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.btn-superset:hover {
    background: #ff9800;
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

/* Empty State - Brak ćwiczeń */
.jednostka-cwiczenia-section .empty-cwiczenia,
p.empty-cwiczenia {
    margin: 40px 20px !important;
    padding: 30px !important;
    background: rgba(255, 196, 0, 0.05) !important;
    border: 1px dashed rgba(255, 196, 0, 0.3) !important;
    border-radius: 12px !important;
    text-align: center !important;
    color: #aaa !important;
    font-size: 15px !important;
    line-height: 1.6 !important;
    transition: all 0.3s ease;
}

.jednostka-cwiczenia-section .empty-cwiczenia:hover,
p.empty-cwiczenia:hover {
    background: rgba(255, 196, 0, 0.08) !important;
    border-color: rgba(255, 196, 0, 0.5) !important;
}

/* ==================== TABLE STYLES ==================== */
/* ==================== TABLE STYLES (MATCHING PANEL TRENERA) ==================== */
.plany-table,
.cwiczenia-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: #222;
    border-radius: 8px;
    overflow: hidden;
    margin: 0 10px;
}

.plany-table th,
.cwiczenia-table th {
    text-align: left;
    color: #ffc400;
    font-size: 13px;
    text-transform: uppercase;
    padding: 15px;
    border-bottom: 2px solid #ffc400;
    background-color: #333;
    font-weight: 600;
}

.plany-table td,
.cwiczenia-table td {
    padding: 15px;
    border-bottom: 1px solid #444;
    vertical-align: middle;
    color: #eee;
    font-size: 14px;
}

.plany-table tr:hover,
.cwiczenia-table tr:hover {
    background-color: #2a2a2a;
}

.plany-table tr:last-child td,
.cwiczenia-table tr:last-child td {
    border-bottom: none;
}

/* Specific Plan List Styles */
.plany-tab-content {
    background: #1c1c1c;
    padding: 25px;
    margin-bottom: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.plany-tab-content h2 {
    color: #ffc400;
    margin-top: 0;
    border-bottom: 1px solid #333;
    padding-bottom: 15px;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.plany-table td strong {
    color: #fff;
    font-size: 1.1em;
}

/* Action Buttons in Table */
.btn-edit,
.btn-delete {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    margin-right: 5px;
}

.plany-table .btn-edit,
.btn-edit {
    background-color: #333;
    color: #ffc400 !important;
    border: 1px solid #ffc400;
}

.btn-edit:hover {
    background-color: #ffc400;
    color: #111;
}

.btn-delete {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid #dc3545;
}

.btn-delete:hover {
    background-color: #dc3545;
    color: white;
}

/* Badges */
.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
}

.status-active .status-badge,
.status-badge.status-active {
    background-color: rgba(40, 167, 69, 0.2);
    color: #4caf50;
    border: 1px solid #4caf50;
}

.status-draft .status-badge,
.status-badge.status-draft {
    background-color: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    border: 1px solid #ffc107;
}

.status-archived .status-badge,
.status-badge.status-archived {
    background-color: rgba(108, 117, 125, 0.2);
    color: #adb5bd;
    border: 1px solid #6c757d;
}

/* Status Realizacji Badges */
.status-badge.status-realizacji-not_started {
    background-color: rgba(108, 117, 125, 0.2);
    color: #adb5bd;
    border: 1px solid #6c757d;
}

.status-badge.status-realizacji-in_progress {
    background-color: rgba(33, 150, 243, 0.15);
    color: #2196f3;
    border: 1px solid #2196f3;
}

.status-badge.status-realizacji-completed {
    background-color: rgba(76, 175, 80, 0.15);
    color: #4caf50;
    border: 1px solid #4caf50;
}

.status-badge.status-realizacji-paused {
    background-color: rgba(255, 152, 0, 0.15);
    color: #ff9800;
    border: 1px solid #ff9800;
}

.status-realizacji-paused {
    color: #ff9800;
}

.badge-typ-cwiczenia {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    margin-left: 8px;
    text-transform: uppercase;
    font-weight: 600;
    background: #333;
    border: 1px solid #555;
    color: #ccc;
}

/* Custom Checkbox */
.checkbox-wrapper input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #333;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    border: 1px solid #444;
}

.checkbox-wrapper input[type="checkbox"]:checked {
    background: #007bff;
    border-color: #007bff;
}

.checkbox-wrapper input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 12px;
    left: 4px;
    top: 0px;
}

/* Superseries */
.superset-row {
    background-color: rgba(255, 152, 0, 0.05);
    border-left: 2px solid #ff9800;
}

/* ==================== SERIE DISPLAY ==================== */
.serie-display-box {
    display: inline-block;
    background: #2a2a2a;
    border: 1px solid #444;
    padding: 2px 8px;
    border-radius: 4px;
    min-width: 30px;
    text-align: center;
}

.serie-progression-inline .prog-step {
    display: inline-block;
    background: #333;
    padding: 2px 6px;
    margin-right: 2px;
    border-radius: 3px;
    font-size: 12px;
    color: #ccc;
    border: 1px solid #444;
}


.empty-cwiczenia {
    margin: 0 20px;
}

/* ==================== AI SETTINGS (PRESERVED) ==================== */
.ai-settings-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 30px;
    border: 1px solid #2a2a3e;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.ai-settings-header .header-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.ai-settings-header .header-icon {
    font-size: 3.5em;
    filter: drop-shadow(0 4px 12px rgba(0, 229, 255, 0.4));
    animation: pulse 3s ease-in-out infinite;
}

.ai-settings-header .header-text h2 {
    margin: 0 0 8px 0;
    font-size: 2em;
    background: linear-gradient(135deg, #00e5ff 0%, #00b4d8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.ai-settings-header .header-text p {
    margin: 0;
    color: #a8a8b3;
    font-size: 1em;
    line-height: 1.5;
}

/* AI Settings Card */
.ai-settings-card {
    background: linear-gradient(135deg, #1e1e2e 0%, #1a1a2a 100%);
    border: 1px solid #2a2a3e;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    border-bottom: 1px solid #2a2a3e;
}

.card-icon {
    font-size: 2.5em;
    filter: drop-shadow(0 2px 8px rgba(0, 229, 255, 0.3));
}

.card-title {
    flex: 1;
}

.card-title h3 {
    margin: 0 0 6px 0;
    font-size: 1.4em;
    color: #fff;
    font-weight: 600;
}

.card-title p {
    margin: 0;
    color: #a8a8b3;
    font-size: 0.9em;
}

/* Form */
.ai-settings-form {
    padding: 24px;
}

.form-section {
    margin-bottom: 28px;
}

.form-section:last-of-type {
    margin-bottom: 0;
}

.modern-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.label-icon {
    font-size: 1.4em;
    margin-top: 2px;
}

.label-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.label-title {
    color: #fff;
    font-weight: 600;
    font-size: 1em;
}

.label-desc {
    color: #a8a8b3;
    font-size: 0.85em;
}

/* Input Wrapper with Action Button */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper .modern-input {
    flex: 1;
    padding-right: 50px;
    background: #2a2a2a;
    border: 1px solid #444;
    padding: 10px;
    color: white;
    border-radius: 6px;
}

.input-action-btn {
    position: absolute;
    right: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #2a2a3e;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #00e5ff;
}

.eye-icon {
    font-size: 1.1em;
}

.input-hint {
    margin: 8px 0 0 0;
    color: #a8a8b3;
    font-size: 0.85em;
}

.input-hint a {
    color: #00e5ff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.input-hint a:hover {
    color: #00b4d8;
    text-decoration: underline;
}

/* Form Actions */
.form-actions {
    padding-top: 24px;
    border-top: 1px solid #2a2a3e;
    display: flex;
    justify-content: flex-end;
}

.btn-save-settings {
    background: linear-gradient(135deg, #00e5ff 0%, #0091ea 100%);
    color: #000;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(0, 229, 255, 0.3);
}

.btn-save-settings:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 229, 255, 0.5);
}

.btn-save-settings:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ==================== CLIENT VIEW REDESIGN (MOBILE CARDS) ==================== */

/* Main Card Container */
/* Main Card Container - Now Full Width Integration */
.exercise-card-mobile {
    background: #181818;
    /* Darker background for contrast */
    border-top: 1px solid #333;
    /* Separator from tabs/header */
    border-radius: 0;
    padding: 24px;
    margin-bottom: 0;
    position: relative;
    /* Ensure no side borders/radius to match list view width */
}

/* 1. Header */
.mobile-card-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 20px;
}

.mobile-card-index {
    color: #444;
    font-size: 1.2rem;
    font-weight: 800;
    font-family: 'Inter', sans-serif;
}

.mobile-card-title {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.video-icon {
    text-decoration: none;
    font-size: 0.8em;
    opacity: 0.7;
    transition: opacity 0.2s;
    margin-left: 8px;
}

.video-icon:hover {
    opacity: 1;
}

/* 2. Stats Board (Middle Section) */
.stats-board {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
}

/* Top Row: Series & Reps */
.stats-main-row {
    background: #111;
    /* Darkest block */
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #222;
    text-align: center;
}

.stats-label-sc {
    display: block;
    color: #666;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.stats-main-values {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.series-boxes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.serie-box {
    background: #222;
    border: 1px solid #333;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    color: #888;
    transition: all 0.2s;
    display: flex;
    gap: 4px;
    align-items: center;
}

.serie-box.single {
    /* For uniform series */
    color: #ffc400;
    border-color: #ffc400;
    font-weight: bold;
    font-size: 14px;
}

.serie-box .sb-label {
    opacity: 0.7;
    font-size: 10px;
}

.serie-box .sb-val {
    font-weight: 700;
}

.reps-big {
    font-size: 1.5rem;
    font-weight: 800;
    color: #ffc400;
    /* Gold */
    display: flex;
    align-items: center;
    gap: 8px;
}

.x-divider {
    color: #444;
    font-weight: 500;
    font-size: 1.2rem;
}

/* Bottom Row: Details (Tempo/Rest) */
.stats-details-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.client-results-section {
    border-top: 1px dashed #333;
    padding-top: 20px;
}

.results-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 250px;
    margin: 0 auto;
}

.detail-box {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.detail-box:hover {
    transform: translateY(-2px);
}

.tempo-box {
    border: 1px dashed #00e5ff;
}

.rest-box {
    border: 1px dashed #ffc400;
}

.d-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.tempo-box .d-label {
    color: #00e5ff;
}

.rest-box .d-label {
    color: #ffc400;
}

.d-value {
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.d-icon {
    font-size: 0.8em;
    opacity: 0.8;
}

/* 3. Results Section */
.results-header {
    color: #888;
    font-size: 12px;
    margin-bottom: 12px;
    text-align: center;
}

.result-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.set-idx {
    color: #555;
    font-size: 12px;
    width: 20px;
    text-align: right;
}

.input-group {
    position: relative;
    flex: 1;
}

.res-input {
    width: 100%;
    background: #252525;
    border: 1px solid #333;
    color: #fff;
    padding: 10px;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    transition: border-color 0.2s, background 0.2s;
    /* Remove number arrows */
    -moz-appearance: textfield;
    appearance: textfield;
}

/* ==================== RESPONSIVE VISIBILITY ==================== */
/* Default (Desktop): Show Table, Hide Mobile Cards */
.desktop-only-table {
    display: block;
}

.client-mobile-cards {
    display: none;
}

/* Mobile (max-width: 768px): Hide Table, Show Mobile Cards */
@media (max-width: 768px) {
    .desktop-only-table {
        display: none !important;
    }

    .client-mobile-cards {
        display: block !important;
    }
}


.res-input:focus {
    outline: none;
    border-color: #ffc400;
    background: #2a2a2a;
}

.dash {
    color: #333;
}

.superset-container {
    padding: 0 20px;
    /* Align with list content */
}

/* ==================== CLIENT VIEW REPAIRS ==================== */
.client-unit-header {
    background: #2a2a2a;
    /* Slightly lighter header */
    padding: 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    transition: background 0.2s;
}

.client-unit-header:hover {
    background: #333;
}

.unit-summary-stats {
    background: #1f1f1f;
    padding: 15px 20px;
    color: #bbb;
    font-size: 0.9em;
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #333;
}

.unit-step-indicator {
    background: #1f1f1f;
    color: #fff;
    text-align: center;
    padding: 10px;
    font-size: 0.95em;
    border-bottom: 1px solid #333;
}

.unit-tabs-nav {
    display: flex;
    justify-content: center;
    background: #1f1f1f;
    border-bottom: 1px solid #333;
    margin-bottom: 20px;
}

.unit-list-container {
    padding: 0;
}

.unit-list-item {
    padding: 15px 20px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.unit-list-item:last-child {
    border-bottom: none;
}

.unit-list-item:hover {
    background: rgba(255, 255, 255, 0.02);
}


/* ==================== AI SETTINGS - BALANCE TILES ==================== */
.balance-tiles-container {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.balance-tile {
    background: #252525;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 20px;
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, border-color 0.2s;
}

.balance-tile:hover {
    transform: translateY(-2px);
    border-color: #444;
}

.balance-tile .tile-label {
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.balance-tile .tile-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.balance-tile .tile-value.value-remaining {
    color: #2ecc71;
    /* Green */
}

.balance-tile .tile-value.value-usage {
    color: #e74c3c;
    /* Red */
}

.balance-tile .tile-value.value-total {
    color: #3498db;
    /* Blue */
}

/* ==================== EXERCISES TAB STYLES (Tree View) ==================== */

/* Container */
.cwiczenia-tab-content {
    max-width: 100%;
    margin: 0;
}

.cwiczenia-tab-content h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cwiczenia-tab-content .instrukcja {
    color: #888;
    margin-bottom: 30px;
    font-size: 0.95rem;
}

.kategorie-tree {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Category Header Card */
.kategoria-header {
    background: #1c1c1c;
    border: 1px solid #333;
    padding: 15px 20px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    user-select: none;
}

.kategoria-header:hover {
    background: #252525;
    border-color: #444;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.kategoria-header.expanded {
    background: #2a2a2a;
    border-color: #ffc400;
    box-shadow: 0 0 0 1px #ffc400, 0 4px 12px rgba(255, 196, 0, 0.1);
}

/* Icon (Arrow) */
.toggle-icon {
    font-size: 10px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    margin-right: 15px;
    color: #888;
    transition: all 0.3s ease;
    position: relative;
}

.toggle-icon::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: rotate(45deg);
    margin-left: -2px;
    /* Optical centering */
    transition: all 0.2s;
}

.kategoria-header:hover .toggle-icon {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.kategoria-header.expanded .toggle-icon {
    transform: rotate(90deg);
    background: #ffc400;
    color: #111;
    /* Black arrow on gold bg */
}

/* Empty node - dot */
.toggle-icon.empty::before {
    content: '';
    width: 4px;
    height: 4px;
    background-color: currentColor;
    border: none;
    border-radius: 50%;
    transform: none;
    margin-left: 0;
}

.toggle-icon.empty {
    opacity: 0.3;
}

/* Text & Badges */
.kategoria-nazwa {
    flex: 1;
    font-size: 1.1rem;
    font-weight: 600;
    color: #ddd;
    letter-spacing: 0.5px;
}

.kategoria-header.expanded .kategoria-nazwa {
    color: #fff;
}

.kategoria-badge {
    background: #111;
    border: 1px solid #333;
    color: #888;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    min-width: 24px;
    text-align: center;
}

.kategoria-header.expanded .kategoria-badge {
    color: #ffc400;
    border-color: #ffc400;
    background: rgba(255, 196, 0, 0.1);
}

/* Nested Content */
.kategoria-content {
    margin-top: 5px;
    margin-bottom: 15px;
    margin-left: 27px;
    /* Align with arrow center */
    padding-left: 20px;
    border-left: 2px solid #333;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Subcategories (Recursive) Styling */
.kategoria-level-1 .kategoria-header {
    padding: 12px 15px;
    background: #222;
}

.kategoria-level-1 .kategoria-nazwa {
    font-size: 1rem;
}

/* Exercise List Inline */
.cwiczenia-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.cwiczenie-item {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 4px;
    transition: background 0.2s;
    border: 1px solid transparent;
}

.cwiczenie-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: #444;
}

.cwiczenie-icon {
    margin-right: 12px;
    font-size: 1rem;
    filter: grayscale(1);
    transition: filter 0.2s;
}

.cwiczenie-item:hover .cwiczenie-icon {
    filter: grayscale(0);
}

.cwiczenie-item strong {
    color: #ccc;
    font-weight: 500;
}

.cwiczenie-item:hover strong {
    color: #fff;
}

.cwiczenie-type {
    font-size: 10px;
    text-transform: uppercase;
    color: #666;
    background: #111;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid #333;
    margin-left: auto;
    font-weight: 600;
}

.link-icon {
    margin-left: 10px;
    text-decoration: none;
    font-size: 12px;
    padding: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
}

.link-icon:hover {
    background: rgba(0, 123, 255, 0.2);
    transform: scale(1.1);
}

/* ==================== MOBILE RESPONSIVE ==================== */
@media (max-width: 768px) {

    /* Responsive Table Card View */
    .plany-table,
    .plany-table tbody,
    .plany-table tr,
    .plany-table td {
        display: block;
        width: 100%;
    }

    .plany-table thead {
        display: none;
    }

    .plany-table tr {
        margin-bottom: 20px;
        background: #252525;
        border: 1px solid #333;
        border-radius: 12px;
        padding: 15px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    }

    .plany-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
        border-bottom: 1px solid #3a3a3a;
        text-align: right;
        min-height: 40px;
    }

    .plany-table td:last-child {
        border-bottom: none;
        justify-content: center;
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid #444;
        gap: 10px;
    }

    .plany-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #888;
        text-transform: uppercase;
        font-size: 11px;
        margin-right: 15px;
        text-align: left;
        flex-shrink: 0;
    }

    /* Ensure action buttons are well sized on mobile */
    .btn-edit,
    .btn-delete {
        padding: 10px 20px;
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}

/* Ensure basic styles for edit/delete buttons if not present */
.btn-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    background-color: #007bff;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    margin-right: 5px;
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.btn-edit:hover {
    background-color: #0056b3;
    color: white;
}

.btn-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    background-color: #dc3545;
    color: white;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.btn-delete:hover {
    background-color: #c82333;
}

/* ==================== EDITOR MOBILE RESPONSIVE ==================== */
@media (max-width: 768px) {

    /* Responsive Exercise Table Card View */
    .cwiczenia-table,
    .cwiczenia-table tbody,
    .cwiczenia-table tr,
    .cwiczenia-table td {
        display: block;
        width: 100%;
    }

    .cwiczenia-table thead {
        display: none;
    }

    .cwiczenia-table tr {
        margin-bottom: 20px;
        background: #252525;
        border: 1px solid #333;
        border-radius: 12px;
        padding: 15px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    }

    .cwiczenia-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid #3a3a3a;
        text-align: right;
        min-height: 30px;
    }

    .cwiczenia-table td:last-child {
        border-bottom: none;
        justify-content: center;
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid #444;
        gap: 10px;
    }

    /* Checkbox Cell Special Handling */
    .cwiczenia-table td[data-label="Wybierz"],
    .cwiczenia-table td:first-child:not([data-label]) {
        justify-content: flex-start;
        border-bottom: 1px solid #444;
        margin-bottom: 5px;
        padding-bottom: 10px;
    }

    .cwiczenia-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #888;
        text-transform: uppercase;
        font-size: 11px;
        margin-right: 15px;
        text-align: left;
        flex-shrink: 0;
    }

    /* Fix serie progression display in mobile */
    .serie-progression-inline {
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    /* Unit Header Improvements for Mobile */
    .jednostka-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .jednostka-actions {
        width: 100%;
        justify-content: space-between;
        border-top: 1px solid #333;
        padding-top: 15px;
    }

    .cwiczenia-buttons {
        flex-direction: column;
        padding-right: 0 !important;
        align-items: stretch;
    }

    .cwiczenia-buttons button {
        width: 100%;
        justify-content: center;
    }

    /* Filters */
    .cwiczenia-filters {
        margin-left: 0 !important;
        justify-content: center;
    }

    /* Summary Grid */
    .summary-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Modals */
    .modal-content {
        width: 95%;
        margin: 10px;
        max-height: 95vh;
        overflow-y: auto;
    }

    .tygodnie-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ==================== EXERCISE FILTERS REDESIGN (PREMIUM DARK) ==================== */

/* Container styling - Glassmorphism/Dark Theme */
.cwiczenia-filters-container {
    background: #1c1c1c !important;
    border: 1px solid #333 !important;
    border-radius: 12px !important;
    padding: 25px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px !important;
    position: relative;
    overflow: hidden;
}

/* Subtle accent line at top */
.cwiczenia-filters-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #ffc400, transparent);
    opacity: 0.5;
}

.cwiczenia-filters-container h3 {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 0 !important;
    margin-bottom: 20px !important;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.5px;
}

/* Filter inputs common styles */
.cwiczenia-filters-container input[type="text"],
.cwiczenia-filters-container select {
    background-color: #252525 !important;
    border: 1px solid #444 !important;
    border-radius: 8px !important;
    color: #e0e0e0 !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    box-shadow: none;
    height: 48px;
    /* Taller touch targets */
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}

.cwiczenia-filters-container input[type="text"]::placeholder {
    color: #777;
}

/* Focus states */
.cwiczenia-filters-container input[type="text"]:focus,
.cwiczenia-filters-container select:focus {
    border-color: #ffc400 !important;
    background-color: #2a2a2a !important;
    box-shadow: 0 0 0 2px rgba(255, 196, 0, 0.15);
}

/* Grid layout for filters */
.filters-row {
    display: grid !important;
    grid-template-columns: 2fr 1.5fr 1fr auto;
    /* Search takes more space */
    gap: 15px !important;
    align-items: end;
    /* Align to bottom so inputs align even if labels vary (though no labels here) */
}

.filter-group {
    position: relative;
    width: 100%;
}

@media (max-width: 900px) {
    .filters-row {
        grid-template-columns: 1fr 1fr;
    }

    .filter-group:first-child {
        grid-column: 1 / -1;
        /* Search full width */
    }
}

@media (max-width: 600px) {
    .filters-row {
        grid-template-columns: 1fr;
        gap: 10px !important;
    }

    /* Reset button full width on mobile or positioned differently */
    #btn-reset-filters {
        width: 100% !important;
    }
}

/* Reset Button Style */
#btn-reset-filters {
    background-color: #2a2a2a;
    border: 1px solid #444;
    color: #888;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    padding: 0;
}

#btn-reset-filters:hover {
    background-color: #333;
    border-color: #d32f2f;
    /* Darker red */
    color: #ff5252;
}

/* Fix for Select dropdown arrow in dark mode */
div.cwiczenia-filters-container select#filter-kategoria,
div.cwiczenia-filters-container select#filter-typ {
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23888888%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 10px auto !important;
    padding-right: 32px !important;
}

div.cwiczenia-filters-container select#filter-kategoria:focus,
div.cwiczenia-filters-container select#filter-typ:focus {
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23ffc400%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E") !important;
}

/* SEARCH RESULTS STYLING */
#cwiczenia-search-results {
    margin-top: 20px;
    animation: fadeIn 0.3s ease;
}

#cwiczenia-search-results .search-results-header {
    background: #1c1c1c;
    /* Use header bar style */
    padding: 15px 20px;
    border: 1px solid #333;
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    color: #aaa;
    font-size: 0.85em;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
}

#cwiczenia-search-results .cwiczenia-list.results-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border: 1px solid #333;
    border-top: none;
    background: #1c1c1c;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.cwiczenie-item {
    padding: 16px 24px !important;
    border-bottom: 1px solid #2a2a2a !important;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
}

.cwiczenie-item:last-child {
    border-bottom: none !important;
}

.cwiczenie-item:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Result Item Content Layout */
.cwiczenie-header-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.cwiczenie-header-row strong {
    color: #e0e0e0;
    font-size: 1.05rem;
    font-weight: 600;
}

.cwiczenie-meta-row {
    font-size: 0.85rem;
    color: #777;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 36px;
    /* Indent to align with text start (icon size + gap) */
}

/* Icons */
.cwiczenie-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Badges */
.badge-kategoria {
    display: inline-block;
    background: rgba(255, 196, 0, 0.1) !important;
    /* Semi-transparent gold */
    color: #ffc400 !important;
    border: 1px solid rgba(255, 196, 0, 0.2) !important;
    padding: 2px 8px !important;
    border-radius: 4px !important;
    font-size: 0.75rem !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cwiczenie-type {
    background: #252525;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #333;
}

/* Links */
.link-icon {
    color: #2979ff !important;
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 500;
}

.link-icon:hover {
    color: #63a4ff !important;
    text-decoration: underline;
}

/* Delete Button */
.btn-delete-cwiczenie {
    opacity: 0.4;
    transition: all 0.2s;
    font-size: 1.1rem;
    padding: 8px;
    border-radius: 6px;
}

.btn-delete-cwiczenie:hover {
    opacity: 1;
    background: rgba(255, 68, 68, 0.1);
    transform: scale(1.1);
}

/* Loading Spinner */
#cwiczenia-loading {
    padding: 50px;
    color: #ffc400;
    font-weight: 500;
    background: #1c1c1c;
    border-radius: 12px;
    border: 1px solid #333;
    margin-bottom: 20px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header Action Buttons Adjustment to match */
.cwiczenia-header-actions h2 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #ddd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.cwiczenia-header-actions .btn-primary {
    /* Ensure these match the new rounded standard */
    border-radius: 8px;
    padding: 10px 20px;
    box-shadow: 0 4px 15px rgba(255, 196, 0, 0.15);
}

/* ==================== EXERCISES TAB FILTER DESIGN ==================== */

.cwiczenia-filters-container {
    background: #1c1c1c !important;
    border: 1px solid #333 !important;
    border-radius: 12px !important;
    padding: 24px !important;
    margin-bottom: 32px !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2) !important;
}

.cwiczenia-filters-container h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #fff;
    font-size: 1.1rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.filters-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 200px;
    position: relative;
}

/* Base style for inputs and selects in filters */
.filter-group input,
.filter-group select {
    width: 100%;
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 12px 16px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    appearance: none;
    /* Remove default browser arrow for selects */
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* Specific select styling to add custom arrow */
.filter-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 48px;
    cursor: pointer;
}

.filter-group input::placeholder {
    color: #777;
    font-weight: 400;
}

/* Hover and Focus states */
.filter-group input:hover,
.filter-group select:hover {
    border-color: #555;
    background-color: #333;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #ffc400;
    box-shadow: 0 0 0 3px rgba(255, 196, 0, 0.15);
    background-color: #333;
}

/* Search input specific icon */
#filter-search {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23777' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 16px center;
    background-size: 18px;
    padding-left: 48px;
}

/* Filter Actions (Reset button) */
.filter-actions {
    display: flex;
    align-items: center;
}

#btn-reset-filters {
    background-color: #2a2a2a;
    border: 1px solid #444;
    color: #888;
    width: 46px;
    height: 46px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    font-size: 1.2rem;
}

#btn-reset-filters:hover {
    background-color: #ff4444;
    border-color: #ff4444;
    color: #fff;
    transform: rotate(90deg);
}

/* Responsive */
@media (max-width: 768px) {
    .filters-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-actions {
        justify-content: flex-end;
    }

    #btn-reset-filters {
        width: 100%;
        margin-top: 8px;
        flex-direction: row;
        gap: 8px;
    }

    #btn-reset-filters::after {
        content: "Wyczyść filtry";
        font-size: 0.9rem;
    }
}

/* FORCE FIX FOR EXERCISE TAB FILTERS */
.plany-treningowe-container .cwiczenia-filters-container {
    background-color: #1a1a1a !important;
    border: 1px solid #333 !important;
    padding: 20px !important;
    border-radius: 12px !important;
}

.plany-treningowe-container .cwiczenia-filters-container h3 {
    color: #fff !important;
    margin-bottom: 20px !important;
}

.plany-treningowe-container .filters-row {
    display: flex !important;
    gap: 15px !important;
    flex-wrap: wrap !important;
    align-items: center !important;
}

.plany-treningowe-container .filter-group {
    flex: 1 !important;
    min-width: 200px !important;
}

.plany-treningowe-container .filter-group input,
.plany-treningowe-container .filter-group select {
    background-color: #2a2a2a !important;
    /* Dark background */
    color: #ffffff !important;
    /* White text */
    border: 1px solid #444 !important;
    border-radius: 8px !important;
    padding: 10px 15px !important;
    height: 42px !important;
    /* Fixed height for consistency */
    width: 100% !important;
    box-shadow: none !important;
}

.plany-treningowe-container .filter-group input::placeholder {
    color: #888 !important;
}

/* Fix for Select dropdown specific */
.plany-treningowe-container .filter-group select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 15px center !important;
    background-size: 12px !important;
    padding-right: 40px !important;
}

.plany-treningowe-container .filter-actions #btn-reset-filters {
    background-color: #333 !important;
    border: 1px solid #444 !important;
    color: #ff4444 !important;
    width: 42px !important;
    height: 42px !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
}

.plany-treningowe-container .filter-actions #btn-reset-filters:hover {
    background-color: #ff4444 !important;
    color: #fff !important;
}

/* ==================== MODAL FORM IMPROVEMENTS ==================== */
.modal-content .form-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.modal-content .form-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffc400;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
}

.modal-content .form-section-title i {
    font-size: 16px;
}

.modal-content .form-row {
    display: block !important;
    margin: 0 !important;
    width: 100% !important;
}

.modal-content .form-group {
    display: flex !important;
    flex-direction: column !important;
    margin-bottom: 15px !important;
}

.modal-content .form-group:last-child {
    margin-bottom: 0 !important;
}

.modal-content input[type="text"],
.modal-content input[type="number"],
.modal-content textarea,
.modal-content select {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    box-sizing: border-box !important;
    background: #1a1a1a !important;
    border: 1px solid #444 !important;
    border-radius: 8px !important;
    padding: 12px 16px !important;
    color: #fff !important;
    font-size: 14px !important;
    margin-top: 8px !important;
    transition: all 0.2s ease;
}

.modal-content input:focus,
.modal-content textarea:focus {
    border-color: #ffc400 !important;
    background: #222 !important;
    outline: none;
}

.modal-content label {
    display: block !important;
    font-weight: 600 !important;
    color: #eee !important;
    font-size: 13px !important;
    margin-bottom: 0 !important;
}

.modal-content small {
    color: #666 !important;
    font-size: 11px !important;
    margin-top: 6px !important;
    line-height: 1.4;
}

/* ==================== FORMULARZ PROGRESJI (RADIO) ==================== */
.progression-toggle {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 5px;
}

.radio-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 30px;
    cursor: pointer;
    font-size: 14px;
    color: #ddd;
    user-select: none;
    line-height: 20px;
    /* Wyrównanie linii */
}

/* Ukryj domyślny input */
.radio-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* Customowy checkmark */
.radio-checkmark {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    /* Idealne centrowanie w pionie */
    left: 0;
    height: 18px;
    width: 18px;
    background-color: #252525;
    border: 2px solid #555;
    border-radius: 50%;
    transition: all 0.2s ease;
}

/* On mouse-over */
.radio-container:hover input~.radio-checkmark {
    border-color: #888;
}

/* When checked */
.radio-container input:checked~.radio-checkmark {
    border-color: #ffc400;
    background-color: #252525;
}

/* Inner dot */
.radio-container .radio-checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

/* Show inner dot when checked */
.radio-container input:checked~.radio-checkmark:after {
    display: block;
}

/* Style the inner dot */
.radio-container .radio-checkmark:after {
    top: 3px;
    left: 3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffc400;
}

/* ==================== USER SEARCH (PLAN ASSIGNMENT) ==================== */
.user-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #2a2a2a;
    border: 1px solid #444;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.user-search-result-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #333;
    transition: background-color 0.2s;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-search-result-item:last-child {
    border-bottom: none;
}

.user-search-result-item:hover {
    background-color: #333;
}

.user-search-result-item .user-name {
    color: #fff;
    font-weight: 500;
    font-size: 14px;
}

.user-search-result-item .user-details {
    color: #888;
    font-size: 12px;
    display: flex;
    gap: 12px;
}

.user-search-result-item .user-id,
.user-search-result-item .user-email {
    color: #888;
}

.selected-user-badge {
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 10px 12px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
}

.selected-user-badge .selected-user-remove {
    background: transparent;
    border: none;
    color: #e57373;
    font-size: 20px;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
    transition: color 0.2s;
}

.selected-user-badge .selected-user-remove:hover {
    color: #ff5252;
}

#selected-user-name {
    color: #fff;
    font-weight: 500;
}

#user-search-wrapper {
    position: relative;
}

/* ==================== DRAG & DROP STYLES ==================== */
.cwiczenia-table tbody tr {
    cursor: move;
}

.drag-handle {
    cursor: grab;
    transition: color 0.2s;
    user-select: none;
}

.drag-handle:hover {
    color: #fff !important;
}

.drag-handle:active {
    cursor: grabbing;
    color: #ffc400 !important;
}

/* Sortable Placeholder (Added by jQuery UI) */
.ui-sortable-helper {
    background: #2a2a2a;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    display: table;
    /* Preserve table layout */
}

.ui-state-highlight {
    background: rgba(255, 196, 0, 0.05) !important;
    border: 1px dashed #ffc400 !important;
    height: 60px;
    visibility: visible !important;
}

/* === MODERN ACTION BUTTONS (Header) === */
.btn-edit-plan-details,
.btn-open-plan-history,
.btn-export-plan-pdf,
.btn-export-plan-excel {
    border: none !important;
    border-radius: 8px !important;
    padding: 10px 20px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    color: #fff !important;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    text-transform: none !important;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn-edit-plan-details i,
.btn-open-plan-history i,
.btn-export-plan-pdf i,
.btn-export-plan-excel i {
    font-size: 16px;
}

.btn-edit-plan-details:hover,
.btn-open-plan-history:hover,
.btn-export-plan-pdf:hover,
.btn-export-plan-excel:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.15), 0 4px 6px rgba(0, 0, 0, 0.1);
    filter: brightness(1.1);
}

.btn-edit-plan-details:active,
.btn-open-plan-history:active,
.btn-export-plan-pdf:active,
.btn-export-plan-excel:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ⚙️ Settings Button */
.btn-edit-plan-details {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%) !important;
}

/* 📄 PDF Button */
.btn-export-plan-pdf {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%) !important;
}

/* 📊 Excel Button */
.btn-export-plan-excel {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%) !important;
}

/* 📜 History Button */
.btn-open-plan-history {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
}