/* 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;
}

.ctp-plans-scope {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: #1f1f1f;
    border: 1px solid #333;
    border-radius: 8px;
}

.ctp-plans-scope-btn {
    border: 0;
    background: transparent;
    color: #aaa;
    padding: 9px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
}

.ctp-plans-scope-btn.is-active {
    background: #ffc400;
    color: #111;
}

.btn-share-plan {
    margin-left: 6px;
}

.ctp-share-modal-content {
    max-width: 760px;
}

.ctp-share-body {
    display: grid;
    gap: 16px;
}

.ctp-share-field {
    position: relative;
    display: grid;
    gap: 8px;
}

.ctp-share-field label {
    color: #ffc400;
    font-weight: 700;
}

.ctp-share-field input {
    width: 100%;
    background: #1f1f1f;
    border: 1px solid #444;
    color: #fff;
    border-radius: 6px;
    padding: 10px 12px;
}

.ctp-share-results {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 20;
    background: #202020;
    border: 1px solid #444;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.ctp-share-result,
.ctp-share-result-empty {
    display: grid;
    width: 100%;
    gap: 3px;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid #333;
    background: transparent;
    color: #fff;
    text-align: left;
}

.ctp-share-result {
    cursor: pointer;
}

.ctp-share-result:hover {
    background: rgba(255, 196, 0, 0.12);
}

.ctp-share-result small,
.ctp-share-chip small,
.ctp-share-history-item small {
    color: #999;
}

.ctp-share-selected {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 34px;
}

.ctp-share-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #282828;
    border: 1px solid #444;
    color: #fff;
    border-radius: 8px;
    padding: 7px 10px;
    cursor: pointer;
}

.ctp-share-chip b {
    color: #ffc400;
    font-size: 16px;
}

.ctp-share-empty {
    color: #888;
    font-style: italic;
}

.ctp-share-status {
    min-height: 20px;
    color: #aaa;
}

.ctp-share-status.is-success {
    color: #66bb6a;
}

.ctp-share-status.is-error {
    color: #ef5350;
}

.ctp-share-status.is-loading {
    color: #ffc400;
}

.ctp-share-history-list {
    display: grid;
    gap: 8px;
}

.ctp-share-history-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid #333;
    border-radius: 8px;
    background: #1f1f1f;
}

.ctp-share-history-item > div {
    display: grid;
    gap: 3px;
}

.ctp-share-history-item span {
    color: #ffc400;
    font-weight: 700;
}

.ctp-share-status-expired,
.ctp-share-status-revoked {
    opacity: 0.68;
}

.ctp-revoke-share {
    border: 1px solid #6b2c2c;
    background: #331818;
    color: #ff9a9a;
    border-radius: 6px;
    padding: 7px 10px;
    cursor: pointer;
}

.ctp-readonly-notice {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 196, 0, 0.35);
    border-radius: 8px;
    background: rgba(255, 196, 0, 0.08);
    color: #f5df91;
}

.ctp-plan-readonly-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 196, 0, 0.12);
    border: 1px solid rgba(255, 196, 0, 0.35);
    color: #ffc400;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.ctp-plan-readonly .btn-add-jednostka,
.ctp-plan-readonly .jednostka-actions .btn-edit-jednostka,
.ctp-plan-readonly .jednostka-actions .btn-edit-jednostka-json,
.ctp-plan-readonly .jednostka-actions .btn-delete-jednostka,
.ctp-plan-readonly .cwiczenia-buttons,
.ctp-plan-readonly .checkbox-wrapper,
.ctp-plan-readonly .checkbox-wrapper-main,
.ctp-plan-readonly .drag-handle,
.ctp-plan-readonly .btn-edit-cwiczenie-params,
.ctp-plan-readonly .btn-duplicate-cwiczenie,
.ctp-plan-readonly .btn-delete-cwiczenie,
.ctp-plan-readonly .quick-meta-control,
.ctp-plan-readonly .ctp-quick-meta-controls,
.ctp-plan-readonly .ctp-inline-add-trigger-row,
.ctp-plan-readonly .ctp-inline-add-form-row {
    display: none !important;
}

.ctp-nav-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    min-height: 22px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255, 196, 0, 0.16);
    border: 1px solid rgba(255, 196, 0, 0.42);
    color: #ffc400;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
}

.plany-nav-link.active .ctp-nav-count {
    background: #ffc400;
    border-color: #ffc400;
    color: #111;
}

.plany-nav-link[href*="plany_tab=dashboard"].active {
    color: #ffc400;
    background: rgba(255, 196, 0, 0.1);
    border: 1px solid rgba(255, 196, 0, 0.34);
}

/* 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-duplicate-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-duplicate-small {
    color: #ffc400;
}

.btn-delete-small {
    color: #e57373;
    /* Light red */
}

.btn-edit-small:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.btn-duplicate-small:hover {
    color: #ffdf62;
    background: rgba(255, 196, 0, 0.11);
}

.btn-duplicate-small:disabled,
.btn-duplicate-small.is-loading {
    opacity: 0.6;
    cursor: wait;
}

.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;
    padding-bottom: 320px;
}

/* 1. Header Block */
.edytor-header {
    background:
        linear-gradient(135deg, rgba(255, 196, 0, 0.055), transparent 42%),
        linear-gradient(180deg, #202020 0%, #191919 100%);
    padding: 28px 30px;
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
    border: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    margin-bottom: 0;
    overflow: hidden;
}

.edytor-header::after {
    content: "";
    position: absolute;
    left: 30px;
    right: 30px;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 196, 0, 0.55), transparent 70%);
    pointer-events: none;
}

.edytor-header-main {
    position: relative;
    z-index: 1;
    display: flex !important;
    width: 100% !important;
    justify-content: space-between !important;
    gap: 28px;
    align-items: start;
}

.edytor-header-copy {
    min-width: 0;
    width: calc(50% - 14px) !important;
    flex: 0 0 calc(50% - 14px) !important;
}

.plan-heading {
    margin-top: 18px;
}

.plan-heading-kicker {
    display: inline-flex;
    align-items: center;
    height: 22px;
    color: #ffc400;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

.plan-heading-topline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.edytor-header h2,
.plan-heading h2 {
    color: #fff;
    margin: 5px 0 0 0;
    font-size: clamp(1.55rem, 2.15vw, 2.25rem);
    line-height: 1.18;
    font-weight: 850;
    letter-spacing: 0;
    max-width: 820px;
    display: flex;
    align-items: flex-start;
    gap: 11px;
}

.plan-heading h2 .dashicons {
    color: #ffc400;
    width: 28px;
    height: 28px;
    font-size: 28px;
    line-height: 1;
    flex: 0 0 28px;
    margin-top: 2px;
}

.edytor-header .btn-back {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: fit-content;
    color: #cfcfcf;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.18s ease;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.07);
    padding: 8px 12px;
    border-radius: 8px;
}

.edytor-header .btn-back .dashicons {
    width: 15px;
    height: 15px;
    font-size: 15px;
    line-height: 1;
}

.edytor-header .btn-back:hover {
    background: rgba(255, 196, 0, 0.1);
    border-color: rgba(255, 196, 0, 0.28);
    color: #fff;
    transform: translateX(-2px);
}

.plan-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 18px;
    color: #bdbdbd;
    font-size: 13px;
}

.plan-meta .meta-item {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.055);
}

.plan-meta .meta-label {
    color: #8f8f8f;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

.plan-meta .meta-value {
    color: #f4f4f4;
    font-weight: 700;
}

.plan-meta .meta-value-accent {
    color: #ffc400;
}

.ctp-plan-notes-chip {
    min-height: 22px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 7px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    color: #bdbdbd;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0;
    transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.ctp-plan-notes-chip:hover {
    color: #fff;
    background: rgba(255, 196, 0, 0.075);
    border-color: rgba(255, 196, 0, 0.2);
}

.ctp-plan-notes-chip .dashicons {
    width: 13px;
    height: 13px;
    color: #b7ae92;
    font-size: 13px;
    line-height: 1;
}

.ctp-plan-notes-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffc400;
    box-shadow: 0 0 0 3px rgba(255, 196, 0, 0.12);
}

.edytor-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-content: start;
    justify-self: auto !important;
    margin-left: auto !important;
    width: calc(50% - 14px) !important;
    max-width: none !important;
    flex: 0 0 calc(50% - 14px) !important;
}

.plan-action-btn {
    --action-accent: #ffc400;
    min-height: 46px;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035));
    color: #f5f5f5;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 24px rgba(0, 0, 0, 0.18);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
    white-space: normal;
    text-align: center;
}

.plan-action-btn .dashicons {
    width: 18px;
    height: 18px;
    font-size: 18px;
    line-height: 1;
    color: var(--action-accent);
    flex: 0 0 18px;
}

.plan-action-btn:hover {
    transform: translateY(-1px);
    border-color: var(--action-accent);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.05));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 14px 28px rgba(0, 0, 0, 0.23);
    color: #fff;
}

.plan-action-btn:focus-visible {
    outline: 2px solid var(--action-accent);
    outline-offset: 2px;
}

.plan-action-primary {
    --action-accent: #ffc400;
    grid-column: span 2;
    background: linear-gradient(135deg, #ffc400 0%, #e4a900 100%);
    color: #141414;
    border-color: rgba(255, 196, 0, 0.72);
    box-shadow: 0 14px 30px rgba(255, 196, 0, 0.17);
}

.plan-action-primary .dashicons {
    color: #141414;
}

.plan-action-primary:hover {
    color: #111;
    background: linear-gradient(135deg, #ffd338 0%, #f0b900 100%);
    box-shadow: 0 16px 34px rgba(255, 196, 0, 0.22);
}

.plan-action-secondary,
.plan-action-history {
    --action-accent: #9ca3af;
}

.plan-action-client {
    --action-accent: #4ade80;
}

.plan-action-ai {
    --action-accent: #00e5ff;
}

.plan-action-pdf {
    --action-accent: #f87171;
}

.plan-action-excel {
    --action-accent: #34d399;
}

@media (max-width: 980px) {
    .edytor-header-main {
        flex-direction: column !important;
        gap: 22px;
    }

    .edytor-header-copy {
        width: 100% !important;
        flex-basis: auto !important;
    }

    .edytor-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100% !important;
        max-width: none;
        margin-left: 0;
        flex-basis: auto !important;
        justify-self: stretch !important;
    }
}

@media (max-width: 600px) {
    .edytor-header {
        padding: 22px 18px;
    }

    .edytor-header::after {
        left: 18px;
        right: 18px;
    }

    .edytor-actions {
        grid-template-columns: 1fr;
    }

    .plan-action-primary {
        grid-column: auto;
    }

    .plan-meta .meta-item {
        width: 100%;
        justify-content: space-between;
    }
}

/* 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:
        linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.012)),
        #202020;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    margin: 0 0 36px;
    padding: 0;
    /* Removed padding for full-width children */
    overflow: hidden;
    /* Ensure children execute border-radius */
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.jednostka-card:hover {
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.18);
}

.jednostka-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: linear-gradient(180deg, #2b2b2b, #252525);
    /* Subtle contrast header */
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.jednostka-cwiczenia-section {
    padding-bottom: 22px;
}

.jednostka-summary-modern {
    margin-top: 34px !important;
    padding: 30px 22px 18px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), rgba(0, 0, 0, 0.08));
}

.jednostka-summary-modern .summary-grid {
    gap: 18px !important;
}

.jednostka-summary-modern .summary-card {
    border-color: rgba(255, 255, 255, 0.09) !important;
    background: rgba(255, 255, 255, 0.025) !important;
}

.volume-table-wrapper {
    margin: 28px 0 0 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-bottom: 0 !important;
}

.volume-header-toggle {
    min-height: 54px;
    border-radius: 0 0 8px 8px;
}

.volume-content {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0 0 8px 8px;
}

/* ==================== MODALS ==================== */
/* Class to block body scroll when modal is open */
html.modal-open,
body.modal-open,
html.ctp-scroll-locked,
body.ctp-scroll-locked {
    overflow: hidden !important;
    overscroll-behavior: none;
}

.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;
    overscroll-behavior: contain;
}

.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;
    overscroll-behavior: contain;
}

@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;
}

.ctp-client-progress-content {
    width: min(97vw, 1480px);
    max-width: 1480px;
    border-color: rgba(255, 196, 0, 0.24);
}

.ctp-client-progress-content .modal-header {
    background:
        linear-gradient(135deg, rgba(255, 196, 0, 0.12), transparent 48%),
        #252525;
}

.ctp-client-progress-content .modal-header h2 {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.ctp-client-progress-content .modal-close {
    background: transparent;
    border: 0;
    padding: 0 2px;
}

.ctp-client-progress-body {
    max-height: 62vh;
    overflow-y: auto;
    padding: 20px;
    overscroll-behavior: contain;
}

.ctp-client-progress-loading {
    padding: 42px 20px;
    text-align: center;
    color: #a9a9a9;
    font-weight: 700;
}

.ctp-client-progress-footer-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ctp-client-progress-footer-actions .plan-action-btn {
    width: auto;
    min-width: 190px;
    min-height: 42px;
}

.ctp-client-progress-footer-actions.is-trainer-only {
    justify-content: flex-end;
}

.ctp-modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.ctp-modal-btn:hover {
    transform: translateY(-1px);
}

.ctp-modal-btn-muted {
    background: rgba(255, 255, 255, 0.06);
    color: #f0f0f0;
}

.ctp-modal-btn-muted:hover {
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.1);
}

.ctp-modal-btn-ghost {
    gap: 8px;
    background: rgba(255, 196, 0, 0.08);
    color: #ffc400;
    border-color: rgba(255, 196, 0, 0.32);
}

.ctp-modal-btn-ghost:hover {
    background: rgba(255, 196, 0, 0.13);
    border-color: rgba(255, 196, 0, 0.52);
}

.ctp-modal-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.ctp-client-progress-ai-result {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.ctp-client-progress-ai-loading,
.ctp-client-progress-ai-error {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f0f0f0;
    font-weight: 800;
}

.ctp-client-progress-ai-loading span {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255, 196, 0, 0.24);
    border-top-color: #ffc400;
    animation: ctpReviewSpin 0.8s linear infinite;
}

.ctp-client-progress-ai-error {
    color: #ffb1b1;
    border-color: rgba(255, 70, 70, 0.34);
    background: rgba(255, 70, 70, 0.09);
}

.ctp-client-progress-ai-summary,
.ctp-client-progress-ai-card {
    border-radius: 8px;
    padding: 13px 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.045);
}

.ctp-client-progress-ai-summary {
    display: grid;
    gap: 6px;
    grid-column: 1 / -1;
    border-color: rgba(255, 196, 0, 0.24);
    background: rgba(255, 196, 0, 0.06);
}

.ctp-client-progress-ai-summary strong {
    color: #fff;
    line-height: 1.45;
}

.ctp-client-progress-ai-summary span,
.ctp-client-progress-ai-cost {
    color: #bdbdbd;
    font-size: 12px;
}

.ctp-client-progress-ai-card h3 {
    margin: 0 0 8px;
    color: #fff;
    font-size: 13px;
}

.ctp-client-progress-ai-card ul {
    margin: 0;
    padding-left: 18px;
    color: #dcdcdc;
    line-height: 1.55;
}

.ctp-client-progress-ai-card.is-positive {
    border-left: 4px solid #20d47b;
}

.ctp-client-progress-ai-card.is-neutral {
    border-left: 4px solid #7b8794;
}

.ctp-client-progress-ai-card.is-warning {
    border-left: 4px solid #ff4d4d;
}

.ctp-client-progress-ai-card.is-action {
    border-left: 4px solid #00e5ff;
}

.ctp-client-progress-ai-cost {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
    grid-column: 1 / -1;
}

@media (max-width: 900px) {
    .ctp-client-progress-content {
        width: 96vw;
    }

    .ctp-client-progress-ai-result {
        grid-template-columns: 1fr;
    }

    .ctp-client-progress-footer-actions {
        justify-content: stretch;
    }

    .ctp-client-progress-footer-actions .plan-action-btn,
    .ctp-client-progress-footer-actions .ctp-modal-btn {
        width: 100%;
    }
}

.ctp-plan-review-content {
    width: min(94vw, 1120px);
    max-width: 1120px;
    border-color: rgba(0, 229, 255, 0.24);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.58), 0 0 0 1px rgba(0, 229, 255, 0.06);
}

.ctp-plan-review-content .modal-header {
    background:
        linear-gradient(135deg, rgba(0, 229, 255, 0.12), transparent 48%),
        #252525;
}

.ctp-plan-review-content .modal-header h2 {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.ctp-plan-review-content .modal-header .dashicons {
    color: #00e5ff;
}

.ctp-plan-review-content .modal-close {
    background: transparent;
    border: 0;
    padding: 0 2px;
}

.ctp-plan-review-body {
    padding: 24px;
}

.ctp-plan-review-intro {
    display: grid;
    gap: 5px;
    padding: 14px 16px;
    margin-bottom: 18px;
    border-radius: 8px;
    border: 1px solid rgba(0, 229, 255, 0.18);
    background: rgba(0, 229, 255, 0.055);
    color: #d7faff;
}

.ctp-plan-review-intro strong {
    color: #fff;
    font-size: 14px;
}

.ctp-plan-review-intro span {
    color: #a9c9cf;
    font-size: 13px;
}

.ctp-review-mode-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.ctp-review-mode-option {
    position: relative;
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 7px 12px;
    align-items: start;
    padding: 15px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    background: rgba(255, 255, 255, 0.045);
    color: #ededed;
    cursor: pointer;
    transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.ctp-review-mode-option:hover,
.ctp-review-mode-option.is-active {
    border-color: rgba(0, 229, 255, 0.58);
    background: rgba(0, 229, 255, 0.07);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.ctp-review-mode-option.is-active {
    transform: translateY(-1px);
}

.ctp-review-mode-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ctp-review-mode-option .dashicons {
    grid-row: span 2;
    width: 22px;
    height: 22px;
    font-size: 22px;
    color: #00e5ff;
}

.ctp-review-mode-option strong {
    color: #fff;
    font-size: 14px;
    line-height: 1.25;
}

.ctp-review-mode-option small {
    color: #aeb8bb;
    font-size: 12px;
    line-height: 1.45;
}

.ctp-plan-review-body label {
    display: block;
    margin-bottom: 8px;
    color: #d6d6d6;
    font-weight: 800;
    font-size: 13px;
}

.ctp-plan-review-body textarea {
    width: 100%;
    min-height: 112px;
    resize: vertical;
    box-sizing: border-box;
    padding: 13px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #151515;
    color: #f5f5f5;
    font-size: 14px;
    line-height: 1.5;
}

.ctp-plan-review-body textarea:focus {
    outline: 2px solid rgba(0, 229, 255, 0.72);
    outline-offset: 2px;
    border-color: rgba(0, 229, 255, 0.72);
}

.ctp-plan-review-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.ctp-review-checkbox {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    width: auto;
    margin: 0 !important;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.052);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #d8d8d8 !important;
    font-size: 12px !important;
}

.ctp-review-checkbox input {
    margin: 0;
    accent-color: #00e5ff;
}

.ctp-plan-review-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}

.ctp-plan-review-actions .plan-action-btn {
    width: auto;
    min-width: 210px;
}

.ctp-plan-review-actions .plan-action-btn.is-loading {
    opacity: 0.74;
    cursor: wait;
    transform: none;
}

.ctp-plan-review-result {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.ctp-review-loading,
.ctp-review-error {
    padding: 14px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.045);
    color: #ededed;
    font-weight: 700;
}

.ctp-review-loading {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #d7faff;
}

.ctp-review-loading span {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(0, 229, 255, 0.22);
    border-top-color: #00e5ff;
    animation: ctpReviewSpin 0.8s linear infinite;
}

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

.ctp-review-error {
    border-color: rgba(248, 113, 113, 0.55);
    background: rgba(127, 29, 29, 0.34);
    color: #ffd6d6;
}

.ctp-review-summary {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 14px;
    padding: 17px;
    border-radius: 8px;
    border: 1px solid rgba(0, 229, 255, 0.2);
    background:
        linear-gradient(135deg, rgba(0, 229, 255, 0.09), transparent 44%),
        rgba(255, 255, 255, 0.04);
}

.ctp-review-summary div {
    display: grid;
    gap: 5px;
}

.ctp-review-summary span {
    color: #8ea9ad;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.ctp-review-summary strong {
    color: #fff;
    font-size: 16px;
    line-height: 1.45;
}

.ctp-review-score {
    min-width: 82px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(0, 229, 255, 0.13);
    border: 1px solid rgba(0, 229, 255, 0.22);
    color: #bdf9ff !important;
    font-size: 18px !important;
}

.ctp-review-card {
    padding: 15px 16px;
    border-radius: 8px;
    border-left: 4px solid var(--review-accent, #00e5ff);
    background: rgba(255, 255, 255, 0.042);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ctp-review-card.is-positive {
    --review-accent: #34d399;
}

.ctp-review-card.is-warning {
    --review-accent: #fbbf24;
}

.ctp-review-card.is-action {
    --review-accent: #00e5ff;
}

.ctp-review-card.is-neutral {
    --review-accent: #9ca3af;
}

.ctp-review-card h3 {
    margin: 0 0 10px;
    color: #fff;
    font-size: 14px;
}

.ctp-review-card ul {
    margin: 0;
    padding-left: 18px;
    color: #dedede;
    line-height: 1.55;
}

.ctp-review-card li + li {
    margin-top: 7px;
}

.ctp-review-cost {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: #a7a7a7;
    font-size: 12px;
}

.ctp-review-cost span {
    padding: 6px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.ctp-ai-tools-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 14px;
}

.ctp-ai-tool-btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 9px 13px;
    border-radius: 8px;
    border: 1px solid rgba(0, 229, 255, 0.22);
    background: linear-gradient(180deg, rgba(0, 229, 255, 0.11), rgba(255, 255, 255, 0.04));
    color: #dffbff;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.ctp-ai-tool-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 229, 255, 0.62);
    background: linear-gradient(180deg, rgba(0, 229, 255, 0.17), rgba(255, 255, 255, 0.055));
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.ctp-ai-tool-btn .dashicons {
    color: #00e5ff;
}

.ctp-ai-working {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 10px 0 14px;
    padding: 14px 16px;
    border: 1px solid rgba(0, 229, 255, 0.22);
    border-radius: 10px;
    background:
        linear-gradient(135deg, rgba(0, 229, 255, 0.08), transparent 45%),
        rgba(255, 255, 255, 0.035);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.ctp-ai-working-orb {
    display: grid;
    grid-template-columns: repeat(3, 7px);
    gap: 4px;
    flex: 0 0 auto;
    min-width: 38px;
    min-height: 38px;
    align-content: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(0, 229, 255, 0.09);
    border: 1px solid rgba(0, 229, 255, 0.28);
}

.ctp-ai-working-orb span {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #00e5ff;
    animation: ctpAiWorkingDots 1.05s infinite ease-in-out;
}

.ctp-ai-working-orb span:nth-child(2) {
    animation-delay: 0.14s;
}

.ctp-ai-working-orb span:nth-child(3) {
    animation-delay: 0.28s;
}

.ctp-ai-working-copy {
    min-width: 0;
    flex: 1;
}

.ctp-ai-working-copy strong,
.ctp-ai-working-copy span {
    display: block;
}

.ctp-ai-working-copy strong {
    color: #f4f4f4;
    font-size: 14px;
    margin-bottom: 3px;
}

.ctp-ai-working-phase {
    color: #a9dfe6;
    font-size: 13px;
}

.ctp-ai-working-bar {
    position: relative;
    height: 4px;
    margin-top: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.ctp-ai-working-bar i {
    position: absolute;
    inset: 0 auto 0 0;
    width: 42%;
    border-radius: inherit;
    background: linear-gradient(90deg, #00e5ff, #ffc400);
    animation: ctpAiWorkingBar 1.65s infinite ease-in-out;
}

@keyframes ctpAiWorkingDots {
    0%,
    80%,
    100% {
        opacity: 0.35;
        transform: translateY(0);
    }

    40% {
        opacity: 1;
        transform: translateY(-4px);
    }
}

@keyframes ctpAiWorkingBar {
    0% {
        transform: translateX(-110%);
    }

    100% {
        transform: translateX(250%);
    }
}

.ctp-plan-ai-notes-content {
    width: min(94vw, 760px);
    border-color: rgba(255, 196, 0, 0.24);
}

.ctp-plan-ai-notes-content .modal-header h2 {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.ctp-plan-ai-notes-content .modal-header .dashicons {
    color: #ffc400;
}

.ctp-plan-ai-notes-body {
    display: grid;
    gap: 14px;
    padding: 22px 24px;
}

.ctp-plan-ai-notes-intro {
    margin: 0;
    color: #cfcfcf;
    font-size: 14px;
    line-height: 1.55;
}

#ctp-plan-ai-context {
    width: 100%;
    min-height: 230px;
    resize: vertical;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 10px;
    background: rgba(12, 12, 12, 0.74);
    color: #fff;
    padding: 14px 15px;
    font-size: 14px;
    line-height: 1.55;
}

#ctp-plan-ai-context:focus {
    outline: none;
    border-color: rgba(255, 196, 0, 0.58);
    box-shadow: 0 0 0 3px rgba(255, 196, 0, 0.1);
}

.ctp-plan-ai-notes-status {
    min-height: 20px;
    color: #a7a7a7;
    font-size: 13px;
    font-weight: 700;
}

.ctp-plan-ai-notes-status.is-success {
    color: #39d98a;
}

.ctp-plan-ai-notes-status.is-error {
    color: #ff5c93;
}

.ctp-continuation-content {
    width: min(94vw, 1120px);
    max-width: 1120px;
    border-color: rgba(255, 196, 0, 0.25);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.58), 0 0 0 1px rgba(255, 196, 0, 0.06);
}

.ctp-continuation-content .modal-header {
    background:
        linear-gradient(135deg, rgba(255, 196, 0, 0.12), transparent 48%),
        #252525;
}

.ctp-continuation-content .modal-header h2 {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.ctp-continuation-content .modal-header .dashicons {
    color: #ffc400;
}

.ctp-continuation-content .modal-close {
    background: transparent;
    border: 0;
    padding: 0 2px;
}

.ctp-continuation-body {
    display: grid;
    gap: 18px;
    padding: 24px;
}

.ctp-continuation-grid {
    display: grid;
    grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.15fr);
    gap: 18px;
}

.ctp-continuation-panel {
    display: grid;
    gap: 9px;
}

.ctp-continuation-panel label {
    color: #d6d6d6;
    font-weight: 800;
    font-size: 13px;
}

.ctp-continuation-panel input[type="search"],
.ctp-continuation-panel textarea {
    width: 100%;
    box-sizing: border-box;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #151515;
    color: #f5f5f5;
    font-size: 14px;
}

.ctp-continuation-panel input[type="search"] {
    min-height: 42px;
    padding: 9px 11px;
}

.ctp-continuation-panel textarea {
    min-height: 112px;
    resize: vertical;
    padding: 13px 14px;
    line-height: 1.5;
}

.ctp-continuation-panel input[type="search"]:focus,
.ctp-continuation-panel textarea:focus {
    outline: 2px solid rgba(255, 196, 0, 0.72);
    outline-offset: 2px;
    border-color: rgba(255, 196, 0, 0.72);
}

.ctp-continuation-user-search {
    display: grid;
    gap: 8px;
}

.ctp-continuation-client-results {
    display: grid;
    gap: 7px;
    max-height: 290px;
    overflow: auto;
}

.ctp-continuation-plans {
    display: grid;
    gap: 8px;
    max-height: 310px;
    overflow: auto;
    padding-right: 4px;
}

.ctp-continuation-empty,
.ctp-continuation-status {
    padding: 13px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.045);
    color: #cfcfcf;
    font-weight: 700;
    font-size: 13px;
}

.ctp-continuation-empty.is-error,
.ctp-continuation-status.is-error {
    border-color: rgba(248, 113, 113, 0.55);
    background: rgba(127, 29, 29, 0.34);
    color: #ffd6d6;
}

.ctp-continuation-empty.is-success,
.ctp-continuation-status.is-success {
    border-color: rgba(52, 211, 153, 0.36);
    background: rgba(6, 95, 70, 0.28);
    color: #c8ffe8;
}

.ctp-client-result {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 11px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.042);
    color: #f5f5f5;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.ctp-client-result:hover,
.ctp-client-result:focus-visible {
    border-color: rgba(255, 196, 0, 0.58);
    background: rgba(255, 196, 0, 0.07);
    transform: translateY(-1px);
    outline: none;
}

.ctp-client-result span {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.ctp-client-result strong {
    color: #fff;
    font-size: 14px;
}

.ctp-client-result small {
    color: #aaa;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ctp-client-result em {
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(255, 196, 0, 0.11);
    border: 1px solid rgba(255, 196, 0, 0.18);
    color: #ffe27a;
    font-style: normal;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.ctp-continuation-status.is-loading {
    border-color: rgba(0, 229, 255, 0.28);
    background: rgba(0, 229, 255, 0.055);
    color: #d7faff;
}

.ctp-continuation-plan-card {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 11px;
    align-items: start;
    padding: 12px 13px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.042);
    cursor: pointer;
    transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.ctp-continuation-plan-card:hover,
.ctp-continuation-plan-card.is-selected {
    border-color: rgba(255, 196, 0, 0.58);
    background: rgba(255, 196, 0, 0.07);
}

.ctp-continuation-plan-card.is-selected {
    transform: translateY(-1px);
}

.ctp-continuation-plan-card input {
    margin-top: 2px;
    accent-color: #ffc400;
}

.ctp-plan-card-main {
    display: grid;
    gap: 4px;
}

.ctp-plan-card-main strong {
    color: #fff;
    font-size: 14px;
}

.ctp-plan-card-main small {
    color: #aaa;
    font-size: 12px;
    line-height: 1.35;
}

.ctp-continuation-preview-wrap {
    border-radius: 8px;
    border: 1px solid rgba(255, 196, 0, 0.2);
    background: rgba(255, 196, 0, 0.045);
    overflow: hidden;
}

.ctp-continuation-preview-wrap summary {
    padding: 12px 14px;
    color: #ffe27a;
    font-weight: 800;
    cursor: pointer;
}

.ctp-continuation-preview-wrap pre {
    max-height: 360px;
    overflow: auto;
    margin: 0;
    padding: 14px;
    border-top: 1px solid rgba(255, 196, 0, 0.16);
    background: #151515;
    color: #e8e8e8;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.ctp-continuation-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.ctp-continuation-actions .plan-action-btn {
    width: auto;
    min-width: 205px;
}

.ctp-continuation-actions .plan-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 600px) {
    .ctp-plan-review-body {
        padding: 18px;
    }

    .ctp-review-mode-grid {
        grid-template-columns: 1fr;
    }

    .ctp-plan-review-actions .plan-action-btn {
        width: 100%;
        min-width: 0;
    }

    .ctp-review-summary {
        flex-direction: column;
    }

    .ctp-review-score {
        width: 100%;
    }

    .ctp-continuation-body {
        padding: 18px;
    }

    .ctp-continuation-grid {
        grid-template-columns: 1fr;
    }

    .ctp-continuation-actions {
        flex-direction: column;
    }

    .ctp-continuation-actions .plan-action-btn {
        width: 100%;
        min-width: 0;
    }
}

.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;
}

.modal-footer.ctp-client-progress-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 16px 20px;
    align-items: stretch;
    justify-content: stretch;
    background: rgba(37, 37, 37, 0.98);
}

.ctp-plan-preview-modal {
    max-width: 860px;
    width: min(92vw, 860px);
}

.ctp-plan-preview-content {
    max-height: 70vh;
    overflow-y: auto;
    padding: 20px;
}

.ctp-plan-preview-info {
    margin-bottom: 20px;
    padding: 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(135deg, rgba(255, 196, 0, 0.055), transparent 46%),
        #303030;
}

.ctp-plan-preview-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.ctp-plan-preview-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.2;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.075);
    color: #e8e8e8;
}

.ctp-plan-preview-status-active {
    background: rgba(34, 197, 94, 0.14);
    border-color: rgba(34, 197, 94, 0.48);
    color: #78e29e;
}

.ctp-plan-preview-status-draft {
    background: rgba(255, 196, 0, 0.14);
    border-color: rgba(255, 196, 0, 0.48);
    color: #ffd75a;
}

.ctp-plan-preview-status-archived {
    background: rgba(148, 163, 184, 0.14);
    border-color: rgba(148, 163, 184, 0.36);
    color: #cbd5e1;
}

.ctp-plan-preview-client {
    background: rgba(33, 150, 243, 0.13);
    border-color: rgba(33, 150, 243, 0.42);
    color: #9fd5ff;
}

.ctp-plan-preview-length {
    color: #f5f5f5;
}

.ctp-plan-preview-description {
    color: #d1d1d1;
    font-style: italic;
    margin: 14px 0 0;
    line-height: 1.5;
}

.ctp-plan-preview-footer {
    position: sticky;
    bottom: 0;
    padding: 12px 18px;
    gap: 8px;
}

.ctp-plan-preview-footer .ctp-preview-btn {
    min-width: 0;
    min-height: 38px;
    padding: 8px 14px !important;
    border-radius: 7px !important;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    box-shadow: none;
    transform: none;
}

.ctp-plan-preview-footer .ctp-preview-btn:hover {
    transform: none;
}

.ctp-plan-preview-footer .ctp-preview-btn-muted {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #ddd;
}

.ctp-plan-preview-footer .ctp-preview-btn-primary {
    background: #ffc400;
    color: #111 !important;
    border: 1px solid rgba(255, 196, 0, 0.72);
}

.ctp-plan-preview-footer .ctp-preview-btn-ghost {
    background: rgba(255, 196, 0, 0.08);
    color: #ffd95a;
    border: 1px solid rgba(255, 196, 0, 0.28);
}

.ctp-plan-preview-footer .ctp-preview-btn:disabled {
    opacity: 0.55;
    cursor: wait;
}

/* 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);
}

/* Inline quick add under exercise rows */
.cwiczenia-table .ctp-inline-add-trigger-row td,
.jednostki-table .ctp-inline-add-trigger-row td {
    padding: 18px 16px 18px !important;
    border-top: 0 !important;
    border-bottom: 0 !important;
    background: rgba(255, 196, 0, 0.015);
}

.cwiczenia-table .ctp-inline-add-trigger-row,
.cwiczenia-table .ctp-inline-add-form-row,
.jednostki-table .ctp-inline-add-trigger-row,
.jednostki-table .ctp-inline-add-form-row {
    border-bottom: 0 !important;
}

.cwiczenia-table .ctp-inline-add-trigger-row + tr td,
.jednostki-table .ctp-inline-add-trigger-row + tr td {
    border-top: 0 !important;
}

.ctp-inline-add-toggle {
    width: 100%;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px dashed rgba(255, 196, 0, 0.28);
    border-radius: 8px;
    background: rgba(255, 196, 0, 0.035);
    color: rgba(255, 196, 0, 0.78);
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    margin: 4px 0;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.ctp-inline-add-toggle:hover {
    border-color: rgba(255, 196, 0, 0.75);
    background: rgba(255, 196, 0, 0.09);
    color: #ffc400;
}

.ctp-inline-add-toggle .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
}

.cwiczenia-table.ctp-empty-cwiczenia-table {
    width: calc(100% - 40px) !important;
    margin: 18px 20px 28px !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
    overflow: visible !important;
}

.cwiczenia-table.ctp-empty-cwiczenia-table thead {
    display: none;
}

.cwiczenia-table.ctp-empty-cwiczenia-table tbody,
.cwiczenia-table.ctp-empty-cwiczenia-table tr,
.cwiczenia-table.ctp-empty-cwiczenia-table td {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.cwiczenia-table.ctp-empty-cwiczenia-table .ctp-inline-add-trigger-row td {
    padding: 0 !important;
}

.cwiczenia-table.ctp-empty-cwiczenia-table .ctp-inline-add-toggle {
    min-height: 58px;
    margin: 0;
    background: rgba(255, 196, 0, 0.03);
}

.cwiczenia-table.ctp-empty-cwiczenia-table .ctp-inline-add-form-row td {
    padding: 14px 0 0 !important;
}

.cwiczenia-table.ctp-empty-cwiczenia-table .ctp-inline-add-form {
    padding: 14px;
    border: 1px solid rgba(255, 196, 0, 0.18);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.025);
}

.cwiczenia-table .ctp-inline-add-form-row td,
.jednostki-table .ctp-inline-add-form-row td {
    padding: 14px 16px 22px !important;
    border-top: 0 !important;
    border-bottom: 0 !important;
    background:
        linear-gradient(90deg, rgba(255, 196, 0, 0.08), transparent 38%),
        rgba(255, 255, 255, 0.025);
}

.ctp-inline-add-form {
    display: grid;
    grid-template-columns: minmax(220px, 1.8fr) minmax(70px, 0.55fr) minmax(105px, 0.8fr) minmax(80px, 0.65fr) minmax(82px, 0.65fr) auto auto;
    gap: 8px;
    align-items: center;
}

.ctp-inline-add-form input {
    width: 100%;
    min-height: 38px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: #181818;
    color: #fff;
    padding: 8px 10px;
    font-size: 13px;
    outline: none;
}

.ctp-inline-add-form input:focus {
    border-color: #ffc400;
    box-shadow: 0 0 0 2px rgba(255, 196, 0, 0.11);
}

.ctp-inline-save,
.ctp-inline-cancel {
    min-height: 38px;
    border-radius: 7px;
    padding: 8px 12px;
    border: 1px solid transparent;
    font-weight: 800;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}

.ctp-inline-save {
    background: #ffc400;
    color: #111;
    box-shadow: 0 8px 20px rgba(255, 196, 0, 0.18);
}

.ctp-inline-save:hover {
    background: #ffd43b;
}

.ctp-inline-cancel {
    background: rgba(255, 255, 255, 0.06);
    color: #d7d7d7;
    border-color: rgba(255, 255, 255, 0.12);
}

.ctp-inline-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
}

.ctp-quick-meta-controls {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 6px;
    vertical-align: middle;
}

.ctp-quick-meta-select {
    width: auto !important;
    min-width: 74px !important;
    max-width: 150px !important;
    height: 24px !important;
    min-height: 24px !important;
    padding: 2px 22px 2px 7px !important;
    border-radius: 5px !important;
    border: 1px dashed rgba(255, 196, 0, 0.55) !important;
    background-color: rgba(255, 196, 0, 0.09) !important;
    color: #ffc400 !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    cursor: pointer;
    vertical-align: middle;
}

.ctp-quick-meta-select:hover,
.ctp-quick-meta-select:focus {
    border-color: #ffc400 !important;
    background-color: rgba(255, 196, 0, 0.16) !important;
    outline: none !important;
}

.ctp-quick-meta-select:disabled {
    opacity: 0.55;
    cursor: wait;
}

.ctp-quick-meta-select-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-width: 1px !important;
    min-height: 1px !important;
    padding: 0 !important;
    margin: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.ctp-quick-combobox {
    position: relative;
    display: inline-flex;
    vertical-align: middle;
}

.ctp-quick-combobox__trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 112px;
    max-width: 190px;
    height: 26px;
    padding: 0 9px;
    color: #ffc400;
    background:
        linear-gradient(135deg, rgba(255, 196, 0, 0.13), rgba(255, 255, 255, 0.035));
    border: 1px dashed rgba(255, 196, 0, 0.62);
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 850;
    line-height: 1;
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.ctp-quick-combobox__trigger:hover,
.ctp-quick-combobox.is-open .ctp-quick-combobox__trigger {
    border-color: #ffc400;
    background: rgba(255, 196, 0, 0.17);
    box-shadow: 0 0 0 3px rgba(255, 196, 0, 0.09);
}

.ctp-quick-combobox__label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ctp-quick-combobox__chevron {
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    opacity: 0.82;
}

.ctp-quick-combobox__panel {
    position: fixed;
    left: 12px;
    top: 12px;
    z-index: 999999;
    display: none;
    width: min(310px, calc(100vw - 24px));
    padding: 8px;
    background: #151515;
    border: 1px solid rgba(255, 196, 0, 0.32);
    border-radius: 8px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(255, 255, 255, 0.035) inset;
}

.ctp-quick-combobox.is-open .ctp-quick-combobox__panel {
    display: block;
}

.ctp-quick-combobox__search-wrap {
    display: block;
    margin-bottom: 7px;
}

.ctp-quick-combobox__search {
    width: 100% !important;
    min-height: 34px !important;
    padding: 0 10px !important;
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.07) !important;
    border: 1px solid rgba(255, 255, 255, 0.13) !important;
    border-radius: 7px !important;
    outline: none !important;
    font-size: 12px !important;
    font-weight: 650 !important;
}

.ctp-quick-combobox__search:focus {
    border-color: rgba(255, 196, 0, 0.74) !important;
    box-shadow: 0 0 0 3px rgba(255, 196, 0, 0.1) !important;
}

.ctp-quick-combobox__options {
    display: grid;
    max-height: var(--ctp-combobox-options-height, 230px);
    overflow: auto;
    padding-right: 2px;
    gap: 3px;
}

.ctp-quick-combobox__options::-webkit-scrollbar {
    width: 7px;
}

.ctp-quick-combobox__options::-webkit-scrollbar-thumb {
    background: rgba(255, 196, 0, 0.45);
    border-radius: 999px;
}

.ctp-quick-combobox__option {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 32px;
    padding: 7px 9px;
    color: rgba(255, 255, 255, 0.86);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 7px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 750;
    text-align: left;
    transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.ctp-quick-combobox__option:hover,
.ctp-quick-combobox__option:focus {
    color: #ffc400;
    background: rgba(255, 196, 0, 0.1);
    border-color: rgba(255, 196, 0, 0.18);
    outline: none;
}

.ctp-quick-combobox__empty {
    display: block;
    padding: 12px 8px 7px;
    color: rgba(255, 255, 255, 0.48);
    font-size: 12px;
    font-weight: 750;
    text-align: center;
}

.ctp-quick-combobox.is-saving {
    opacity: 0.62;
    pointer-events: none;
}

@media (max-width: 1100px) {
    .ctp-inline-add-form {
        grid-template-columns: 1fr 90px 120px;
    }

    .ctp-inline-save,
    .ctp-inline-cancel {
        width: 100%;
    }
}

@media (max-width: 720px) {
    .ctp-inline-add-form {
        grid-template-columns: 1fr;
    }
}

/* 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);
}

.btn-copy-cwiczenia,
.btn-paste-cwiczenia {
    white-space: nowrap;
}

.btn-paste-cwiczenia:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
}

.btn-paste-cwiczenia.is-ready {
    border-color: rgba(255, 196, 0, 0.45);
    color: #ffc400;
}

/* 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;
}

.ctp-dashboard-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding: 18px;
    margin-bottom: 18px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(135deg, rgba(255, 196, 0, 0.08), transparent 44%),
        rgba(255, 255, 255, 0.035);
}

.ctp-dashboard-head h2 {
    border-bottom: 0;
    margin: 4px 0 8px;
    padding: 0;
    font-size: 1.8rem;
}

.ctp-dashboard-head p {
    margin: 0;
    color: #a7a7a7;
    font-size: 14px;
}

.ctp-dashboard-kicker {
    color: #ffc400;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.ctp-dashboard-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 24px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ffd84a 0%, #ffc400 58%, #f5a900 100%) !important;
    border: 1px solid rgba(255, 236, 150, 0.5) !important;
    color: #171717 !important;
    text-shadow: none !important;
    font-weight: 900;
    white-space: nowrap;
    box-shadow: 0 10px 28px rgba(255, 196, 0, 0.24);
}

.ctp-dashboard-action:hover {
    color: #000 !important;
    filter: brightness(1.04);
    transform: translateY(-1px);
}

.ctp-dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.ctp-dashboard-metric {
    min-height: 132px;
    padding: 17px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #222;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.ctp-dashboard-metric::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: #ffc400;
}

.ctp-dashboard-metric span {
    color: #bdbdbd;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.ctp-dashboard-metric strong {
    color: #fff;
    font-size: 2.4rem;
    line-height: 1;
}

.ctp-dashboard-metric small {
    color: #909090;
    line-height: 1.35;
}

.ctp-dashboard-metric-active::before,
.ctp-dashboard-metric-pulse::before {
    background: #22c55e;
}

.ctp-dashboard-metric-done::before {
    background: #2196f3;
}

.ctp-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(280px, 0.78fr);
    gap: 14px;
}

.ctp-dashboard-panel {
    padding: 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.035);
}

.ctp-dashboard-panel-wide {
    grid-column: span 2;
}

.ctp-dashboard-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.ctp-dashboard-panel-head h3 {
    margin: 0;
    color: #f5f5f5;
    font-size: 1rem;
}

.ctp-dashboard-panel-head strong {
    color: #ffc400;
    font-size: 1.2rem;
}

.ctp-dashboard-panel-head a {
    font-size: 12px;
    font-weight: 800;
}

.ctp-dashboard-bars {
    display: grid;
    gap: 13px;
}

.ctp-dashboard-bar-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    color: #cfcfcf;
    font-size: 13px;
    margin-bottom: 7px;
}

.ctp-dashboard-bar-line strong {
    color: #fff;
}

.ctp-dashboard-track {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.ctp-dashboard-track i {
    display: block;
    height: 100%;
    min-width: 4px;
    border-radius: inherit;
    background: #ffc400;
}

.ctp-dashboard-bar-status-active .ctp-dashboard-track i,
.ctp-dashboard-bar-realization-completed .ctp-dashboard-track i {
    background: #22c55e;
}

.ctp-dashboard-bar-status-draft .ctp-dashboard-track i,
.ctp-dashboard-bar-realization-paused .ctp-dashboard-track i {
    background: #ffb020;
}

.ctp-dashboard-bar-status-archived .ctp-dashboard-track i,
.ctp-dashboard-bar-realization-not_started .ctp-dashboard-track i {
    background: #8b949e;
}

.ctp-dashboard-bar-realization-in_progress .ctp-dashboard-track i {
    background: #2196f3;
}

.ctp-dashboard-balance {
    display: grid;
    gap: 10px;
}

.ctp-dashboard-balance div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    min-height: 42px;
    padding: 11px 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.18);
}

.ctp-dashboard-balance span {
    color: #bdbdbd;
    font-size: 13px;
}

.ctp-dashboard-balance strong {
    color: #fff;
    font-size: 1.2rem;
}

.ctp-dashboard-list {
    display: grid;
    gap: 8px;
}

.ctp-dashboard-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(0, 0, 0, 0.16);
    color: #e8e8e8;
}

.ctp-dashboard-row:hover {
    border-color: rgba(255, 196, 0, 0.4);
    background: rgba(255, 196, 0, 0.06);
}

.ctp-dashboard-row div:first-child {
    min-width: 0;
}

.ctp-dashboard-row strong,
.ctp-dashboard-row span {
    display: block;
}

.ctp-dashboard-row strong {
    color: #fff;
    margin-bottom: 3px;
}

.ctp-dashboard-row div:first-child > span {
    color: #a9a9a9;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ctp-dashboard-row-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 240px;
}

.ctp-dashboard-row-meta small {
    color: #969696;
}

.ctp-dashboard-empty {
    margin: 0;
    padding: 14px;
    border-radius: 8px;
    color: #a7a7a7;
    background: rgba(0, 0, 0, 0.18);
}

.ctp-dashboard-compact .ctp-dashboard-head {
    margin-bottom: 14px;
    padding: 16px 18px;
}

.ctp-dashboard-compact .ctp-dashboard-head h2 {
    font-size: 1.45rem;
    margin-bottom: 5px;
}

.ctp-dashboard-modules {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.ctp-dashboard-module {
    min-height: 230px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(135deg, rgba(255, 196, 0, 0.08), transparent 46%),
        rgba(255, 255, 255, 0.035);
}

.ctp-dashboard-module-top {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.ctp-dashboard-module-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 196, 0, 0.12);
    border: 1px solid rgba(255, 196, 0, 0.24);
    font-size: 1.15rem;
}

.ctp-dashboard-module h3 {
    margin: 1px 0 4px;
    color: #fff;
    font-size: 1.05rem;
}

.ctp-dashboard-module p {
    margin: 0;
    color: #8f8f8f;
    font-size: 0.84rem;
    line-height: 1.35;
}

.ctp-dashboard-module-main {
    display: flex;
    align-items: baseline;
    gap: 9px;
    margin-top: auto;
}

.ctp-dashboard-module-main strong {
    color: #ffc400;
    font-size: 2.35rem;
    line-height: 1;
}

.ctp-dashboard-module-main span {
    color: #bdbdbd;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
}

.ctp-dashboard-module-items {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.ctp-dashboard-module-items div {
    min-width: 0;
    padding: 9px 10px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.18);
}

.ctp-dashboard-module-items span,
.ctp-dashboard-module-items strong {
    display: block;
}

.ctp-dashboard-module-items span {
    color: #858585;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.ctp-dashboard-module-items strong {
    color: #f5f5f5;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ctp-dashboard-module-link {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255, 196, 0, 0.1);
    border: 1px solid rgba(255, 196, 0, 0.22);
    color: #ffc400 !important;
    font-size: 0.84rem;
    font-weight: 900;
}

.ctp-dashboard-module-link:hover {
    background: rgba(255, 196, 0, 0.16);
    color: #ffdc55 !important;
}

.ctp-dashboard-activity {
    margin-top: 14px;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.ctp-dashboard-activity-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.ctp-dashboard-activity-head h3 {
    margin: 2px 0 0;
    color: #fff;
    font-size: 1.05rem;
}

.ctp-dashboard-activity-head small {
    color: #ffc400;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.ctp-dashboard-event-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.ctp-dashboard-event {
    min-width: 0;
    display: flex;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(0, 0, 0, 0.18);
    color: inherit !important;
}

a.ctp-dashboard-event:hover {
    border-color: rgba(255, 196, 0, 0.24);
    background: rgba(255, 196, 0, 0.055);
}

.ctp-dashboard-event-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    margin-top: 6px;
    border-radius: 999px;
    background: #8f8f8f;
    box-shadow: 0 0 0 4px rgba(143, 143, 143, 0.12);
}

.ctp-dashboard-event-success .ctp-dashboard-event-dot {
    background: #20d77a;
    box-shadow: 0 0 0 4px rgba(32, 215, 122, 0.12);
}

.ctp-dashboard-event-warning .ctp-dashboard-event-dot {
    background: #ffc400;
    box-shadow: 0 0 0 4px rgba(255, 196, 0, 0.14);
}

.ctp-dashboard-event-body {
    min-width: 0;
    flex: 1;
}

.ctp-dashboard-event-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 5px;
}

.ctp-dashboard-event-line span,
.ctp-dashboard-event-line time {
    color: #8f8f8f;
    font-size: 0.7rem;
    font-weight: 900;
    line-height: 1.2;
    text-transform: uppercase;
}

.ctp-dashboard-event-line time {
    flex: 0 0 auto;
}

.ctp-dashboard-event strong,
.ctp-dashboard-event small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ctp-dashboard-event strong {
    color: #f5f5f5;
    font-size: 0.9rem;
    line-height: 1.25;
}

.ctp-dashboard-event small {
    margin-top: 4px;
    color: #a1a1a1;
    font-size: 0.78rem;
}

@media (max-width: 1180px) {
    .ctp-dashboard-metrics,
    .ctp-dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ctp-dashboard-panel-wide {
        grid-column: span 2;
    }
}

@media (max-width: 760px) {
    .ctp-dashboard-head,
    .ctp-dashboard-row {
        flex-direction: column;
        align-items: stretch;
    }

    .ctp-dashboard-metrics,
    .ctp-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .ctp-dashboard-panel-wide {
        grid-column: auto;
    }

    .ctp-dashboard-event-list {
        grid-template-columns: 1fr;
    }

    .ctp-dashboard-module-items {
        grid-template-columns: 1fr;
    }

    .ctp-dashboard-row-meta {
        min-width: 0;
        justify-content: flex-start;
    }
}

.ctp-orders-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding: 18px;
    margin: 22px 0 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(135deg, rgba(255, 196, 0, 0.08), transparent 42%),
        rgba(255, 255, 255, 0.035);
}

.ctp-orders-head h2 {
    border-bottom: 0;
    margin: 4px 0 8px;
    padding: 0;
    font-size: 1.8rem;
}

.ctp-orders-head p {
    margin: 0;
    color: #a7a7a7;
    font-size: 14px;
}

.ctp-orders-head-stat {
    min-width: 128px;
    padding: 12px 16px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.22);
    text-align: center;
}

.ctp-orders-head-stat span {
    display: block;
    color: #aaa;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.ctp-orders-head-stat strong {
    color: #ffc400;
    font-size: 2rem;
    line-height: 1.1;
}

.ctp-orders-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.ctp-orders-card {
    min-height: 116px;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #222;
    color: #eee;
    text-align: left;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: border-color 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.ctp-orders-card::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: #ffc400;
}

.ctp-orders-card[data-order-status="stale"]::before {
    background: #ff4d4d;
}

.ctp-orders-card[data-order-status="in_progress"]::before,
.ctp-orders-card[data-order-status="newest"]::before {
    background: #2196f3;
}

.ctp-orders-card[data-order-status="completed"]::before {
    background: #22c55e;
}

.ctp-orders-card:hover {
    border-color: rgba(255, 196, 0, 0.45);
    background: rgba(255, 196, 0, 0.06);
    transform: translateY(-1px);
}

.ctp-orders-card span {
    color: #cfcfcf;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.ctp-orders-card strong {
    color: #fff;
    font-size: 2.1rem;
    line-height: 1;
}

.ctp-orders-card small {
    color: #949494;
}

.ctp-orders-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1.4fr) minmax(170px, .8fr) repeat(2, minmax(150px, .75fr)) auto;
    gap: 10px;
    align-items: end;
    margin: 0 0 14px;
    padding: 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background:
        linear-gradient(135deg, rgba(255, 196, 0, 0.055), transparent 42%),
        rgba(255, 255, 255, 0.035);
}

.ctp-orders-toolbar input,
.ctp-orders-toolbar select {
    width: 100%;
    min-height: 38px;
    box-sizing: border-box;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    background: #151515;
    color: #f5f5f5;
    font-size: 13px;
}

.ctp-orders-toolbar label {
    color: #9f9f9f;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.ctp-orders-table-wrap {
    overflow-x: auto;
}

.ctp-orders-table .btn-view-zamowienie {
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 900;
}

.ctp-order-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ctp-orders-table .btn-delete-zamowienie {
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 900;
    border: 1px solid rgba(255, 77, 77, 0.36);
    background: rgba(255, 77, 77, 0.12);
    color: #ffb3b3;
    cursor: pointer;
    box-shadow: none;
}

.ctp-orders-table .btn-delete-zamowienie:hover {
    border-color: rgba(255, 77, 77, 0.7);
    background: rgba(255, 77, 77, 0.2);
    color: #fff;
}

.ctp-order-id {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.ctp-order-row td small {
    display: block;
    margin-top: 4px;
    color: #8e8e8e;
    font-size: 12px;
}

.ctp-order-email {
    color: #c7c7c7 !important;
    word-break: break-word;
}

.ctp-order-account {
    color: #8e8e8e !important;
}

.ctp-order-account.is-linked {
    color: #70e09a !important;
}

.ctp-order-status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.ctp-order-status-to_create {
    background: rgba(255, 196, 0, 0.13);
    border-color: rgba(255, 196, 0, 0.45);
    color: #ffd95a;
}

.ctp-order-status-stale {
    background: rgba(255, 77, 77, 0.13);
    border-color: rgba(255, 77, 77, 0.5);
    color: #ff9a9a;
}

.ctp-order-status-in_progress {
    background: rgba(33, 150, 243, 0.13);
    border-color: rgba(33, 150, 243, 0.45);
    color: #83c7ff;
}

.ctp-order-status-completed {
    background: rgba(34, 197, 94, 0.13);
    border-color: rgba(34, 197, 94, 0.45);
    color: #7ee2a2;
}

.ctp-order-age {
    font-weight: 900;
    color: #ddd;
}

.ctp-order-age.is-warning {
    color: #ffd95a;
}

.ctp-order-age.is-critical {
    color: #ff9a9a;
}

.ctp-order-modal {
    max-width: 920px;
    width: 95%;
}

.ctp-order-modal .modal-body {
    padding: 20px;
    max-height: 74vh;
    overflow-y: auto;
}

.ctp-order-ai-brief {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 196, 0, 0.24);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(255, 196, 0, 0.08), transparent 48%),
        #222;
}

.ctp-order-ai-brief strong {
    display: block;
    color: #fff;
    font-size: 15px;
    margin-bottom: 4px;
}

.ctp-order-ai-brief small {
    display: block;
    color: #9f9f9f;
    line-height: 1.45;
}

.ctp-order-ai-brief-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.ctp-order-ai-brief-actions .btn-primary,
.ctp-order-ai-brief-actions .btn-secondary {
    min-height: 38px;
    padding: 9px 14px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.ctp-order-plan-link {
    display: grid;
    gap: 12px;
    padding: 14px;
    margin-bottom: 22px;
    border-radius: 8px;
    border: 1px solid rgba(0, 229, 255, 0.2);
    background:
        linear-gradient(135deg, rgba(0, 229, 255, 0.065), transparent 48%),
        rgba(255, 255, 255, 0.035);
}

.ctp-order-plan-link-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
}

.ctp-order-plan-link-head strong,
.ctp-order-plan-link-head small {
    display: block;
}

.ctp-order-plan-link-head strong {
    color: #fff;
    font-size: 15px;
    margin-bottom: 4px;
}

.ctp-order-plan-link-head small {
    color: #9f9f9f;
    line-height: 1.45;
}

.ctp-order-plan-current {
    flex: 0 0 auto;
    max-width: 300px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    color: #dffbff;
    font-size: 12px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ctp-order-plan-link-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.ctp-order-linked-plan-select {
    width: 100%;
    min-height: 42px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: #202020;
    color: #fff;
    padding: 9px 11px;
}

.ctp-order-plan-link-status {
    min-height: 18px;
    color: #aaa;
    font-size: 13px;
}

.ctp-order-plan-link-status.is-success {
    color: #70e09a;
}

.ctp-order-plan-link-status.is-error {
    color: #ff9a9a;
}

@media (max-width: 1180px) {
    .ctp-orders-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ctp-orders-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .ctp-orders-head {
        flex-direction: column;
        align-items: stretch;
    }

    .ctp-orders-summary,
    .ctp-orders-toolbar {
        grid-template-columns: 1fr;
    }

    .ctp-order-ai-brief {
        align-items: stretch;
        flex-direction: column;
    }

    .ctp-order-ai-brief-actions {
        justify-content: stretch;
    }

    .ctp-order-ai-brief-actions .btn-primary,
    .ctp-order-ai-brief-actions .btn-secondary {
        flex: 1 1 180px;
    }

    .ctp-order-plan-link-head {
        flex-direction: column;
    }

    .ctp-order-plan-current {
        max-width: 100%;
    }

    .ctp-order-plan-link-controls {
        grid-template-columns: 1fr;
    }
}

.ctp-plans-toolbar {
    display: grid;
    grid-template-columns: minmax(320px, 1.7fr) repeat(3, minmax(150px, .85fr)) auto;
    gap: 10px;
    align-items: end;
    margin: 0 0 14px;
    padding: 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background:
        linear-gradient(135deg, rgba(255, 196, 0, 0.055), transparent 42%),
        rgba(255, 255, 255, 0.035);
}

.ctp-plans-search,
.ctp-plans-filter {
    display: grid;
    gap: 6px;
}

.ctp-plans-toolbar label {
    color: #9f9f9f;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.ctp-plans-toolbar input,
.ctp-plans-toolbar select {
    width: 100%;
    min-height: 38px;
    box-sizing: border-box;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    background: #151515;
    color: #f5f5f5;
    font-size: 13px;
}

.ctp-plans-toolbar input:focus,
.ctp-plans-toolbar select:focus {
    outline: 2px solid rgba(255, 196, 0, 0.62);
    outline-offset: 2px;
    border-color: rgba(255, 196, 0, 0.62);
}

.ctp-plans-reset {
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    background: rgba(255, 255, 255, 0.045);
    color: #d6d6d6;
    font-weight: 800;
    cursor: pointer;
    transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.ctp-plans-reset:hover {
    border-color: rgba(255, 196, 0, 0.55);
    background: rgba(255, 196, 0, 0.08);
    color: #fff;
}

.ctp-plans-list-status {
    min-height: 20px;
    margin: 0 0 10px;
    color: #9f9f9f;
    font-size: 12px;
    font-weight: 700;
}

.ctp-plans-list-status.is-loading {
    color: #ffe27a;
}

.ctp-plans-list-status.is-error {
    color: #ff9a9a;
}

.ctp-plans-table-wrap {
    overflow-x: auto;
}

.plany-table .plan-title-trigger {
    cursor: pointer;
    color: #ffc400;
    border-bottom: 1px dashed rgba(255, 196, 0, 0.75);
    font-size: 1.05em;
}

.ctp-plan-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 260px;
}

.ctp-plan-name-stack {
    display: grid;
    gap: 6px;
    min-width: 280px;
}

.ctp-plan-row-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 50px;
    color: #9f9f9f;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
}

.ctp-plan-row-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ctp-plan-row-meta span + span::before {
    content: "";
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 196, 0, 0.65);
}

.ctp-plan-id-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    padding: 4px 8px;
    border: 1px solid rgba(255, 196, 0, 0.34);
    border-radius: 7px;
    background: rgba(255, 196, 0, 0.09);
    color: #ffc400;
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1;
    flex: 0 0 auto;
}

.plany-table .plan-title-trigger:hover {
    color: #ffdf62;
    border-bottom-color: #ffdf62;
}

.ctp-plans-pagination {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.ctp-plans-page {
    min-height: 34px;
    min-width: 34px;
    padding: 7px 11px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    background: rgba(255, 255, 255, 0.045);
    color: #d6d6d6;
    font-weight: 800;
    cursor: pointer;
}

.ctp-plans-page:hover,
.ctp-plans-page.is-active {
    border-color: rgba(255, 196, 0, 0.65);
    background: rgba(255, 196, 0, 0.12);
    color: #ffc400;
}

.ctp-plans-page:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.ctp-plans-empty {
    margin-top: 10px;
}

@media (max-width: 1280px) {
    .ctp-plans-toolbar {
        grid-template-columns: minmax(280px, 1.3fr) repeat(2, minmax(150px, 1fr));
    }
}

.ctp-plans-scope-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: 0 0 18px;
}

.ctp-plans-scope-row .ctp-plans-scope {
    width: auto;
    max-width: 100%;
}

#modal-share-training-plan .ctp-share-modal-content {
    width: min(92vw, 720px);
    max-width: 720px;
    overflow: hidden;
}

#modal-share-training-plan .modal-header {
    align-items: center;
    padding: 24px 26px 18px;
}

#modal-share-training-plan .modal-header h2 {
    margin: 0;
    line-height: 1.2;
}

#modal-share-training-plan .modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.16);
    color: #ddd;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

#modal-share-training-plan .ctp-share-body {
    padding: 22px 26px 24px;
    gap: 18px;
}

#modal-share-training-plan .ctp-share-field {
    gap: 8px;
}

#modal-share-training-plan .ctp-share-field label {
    display: block !important;
    margin: 0 !important;
    color: #f0f0f0 !important;
    font-size: 12px !important;
    font-weight: 800 !important;
}

#modal-share-training-plan .ctp-share-field input {
    margin: 0 !important;
    min-width: 0 !important;
    min-height: 52px;
    padding: 12px 14px !important;
    border-radius: 8px !important;
}

#modal-share-training-plan .ctp-share-selected {
    min-height: 32px;
}

#modal-share-training-plan .ctp-share-body h3 {
    margin: 22px 0 0;
    color: #fff;
    font-size: 22px;
    line-height: 1.2;
}

#modal-share-training-plan .modal-footer {
    padding: 18px 26px 22px;
    gap: 12px;
}

@media (max-width: 760px) {
    .ctp-plans-toolbar {
        grid-template-columns: 1fr;
    }

    .ctp-plans-pagination {
        justify-content: stretch;
    }

    .ctp-plans-page {
        flex: 1 1 auto;
    }
}

.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, 179, 0, 0.07);
    background-color: color-mix(in srgb, var(--ctp-superset-color, #ffb300) 7%, transparent);
    border-left: 2px solid var(--ctp-superset-color, #ffb300);
}

.ctp-superset-row--1 {
    --ctp-superset-color: #ffb300;
}

.ctp-superset-row--2 {
    --ctp-superset-color: #00d4ff;
    background-color: rgba(0, 212, 255, 0.07);
}

.ctp-superset-row--3 {
    --ctp-superset-color: #9b5cff;
    background-color: rgba(155, 92, 255, 0.07);
}

.ctp-superset-row--4 {
    --ctp-superset-color: #39d98a;
    background-color: rgba(57, 217, 138, 0.07);
}

.ctp-superset-row--5 {
    --ctp-superset-color: #ff5c93;
    background-color: rgba(255, 92, 147, 0.07);
}

.ctp-superset-row--6 {
    --ctp-superset-color: #ff7a3d;
    background-color: rgba(255, 122, 61, 0.07);
}

.ctp-superset-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
    padding: 2px 7px;
    border: 1px solid currentColor;
    border-radius: 5px;
    font-size: 0.78em;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: 0;
    color: var(--ctp-superset-badge-color, #ffb300);
    background: rgba(255, 179, 0, 0.12);
    background: color-mix(in srgb, var(--ctp-superset-badge-color, #ffb300) 12%, transparent);
}

.ctp-superset-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.ctp-superset-badge--1 {
    --ctp-superset-badge-color: #ffb300;
}

.ctp-superset-badge--2 {
    --ctp-superset-badge-color: #00d4ff;
    background: rgba(0, 212, 255, 0.12);
}

.ctp-superset-badge--3 {
    --ctp-superset-badge-color: #9b5cff;
    background: rgba(155, 92, 255, 0.12);
}

.ctp-superset-badge--4 {
    --ctp-superset-badge-color: #39d98a;
    background: rgba(57, 217, 138, 0.12);
}

.ctp-superset-badge--5 {
    --ctp-superset-badge-color: #ff5c93;
    background: rgba(255, 92, 147, 0.12);
}

.ctp-superset-badge--6 {
    --ctp-superset-badge-color: #ff7a3d;
    background: rgba(255, 122, 61, 0.12);
}

/* ==================== 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;
}

.ctp-json-import-modal {
    width: min(920px, calc(100vw - 32px));
    max-width: 920px !important;
}

.ctp-json-empty-units {
    padding: 14px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 196, 0, 0.35);
    background: rgba(255, 196, 0, 0.07);
    color: #f4f4f4;
    font-weight: 700;
    line-height: 1.5;
}

.ctp-json-docs p {
    margin: 0 0 12px;
    color: #cfcfcf;
    line-height: 1.55;
}

.ctp-json-docs-accordion {
    padding: 0 !important;
    overflow: hidden;
}

.ctp-json-docs-accordion summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    color: #ffc400;
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
    cursor: pointer;
    list-style: none;
    border-bottom: 1px solid transparent;
}

.ctp-json-docs-accordion summary::-webkit-details-marker {
    display: none;
}

.ctp-json-docs-accordion[open] summary {
    border-bottom-color: #333;
}

.ctp-json-docs-accordion summary .dashicons {
    width: 18px;
    height: 18px;
    font-size: 18px;
    line-height: 1;
    transition: transform 0.18s ease;
}

.ctp-json-docs-accordion[open] summary .dashicons {
    transform: rotate(180deg);
}

.ctp-json-docs-body {
    padding: 18px 20px 20px;
}

.ctp-json-docs code {
    color: #ffc400;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 1px 5px;
}

.ctp-json-docs pre {
    margin: 12px 0;
    padding: 14px;
    max-height: 360px;
    overflow: auto;
    border-radius: 8px;
    background: #101010;
    border: 1px solid rgba(255, 255, 255, 0.09);
    color: #e9e9e9;
    font-size: 12px;
    line-height: 1.45;
    white-space: pre-wrap;
}

#import-json-payload {
    min-height: 260px;
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
    line-height: 1.45;
}

#unit-json-payload {
    min-height: 430px;
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
    line-height: 1.45;
}

.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;
}

.cwiczenia-table tbody tr.ctp-sort-locked {
    cursor: default;
}

.cwiczenia-table tbody tr.ctp-sort-locked .drag-handle,
.cwiczenia-table tbody tr.ctp-sort-locked .drag-handle:hover,
.cwiczenia-table tbody tr.ctp-sort-locked .drag-handle:active {
    color: rgba(255, 255, 255, 0.28) !important;
    cursor: not-allowed !important;
}

.cwiczenia-table tbody tr.ctp-sort-locked-pulse {
    box-shadow: inset 3px 0 0 #ffc400;
    background: rgba(255, 196, 0, 0.08);
}

/* 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;
}

.ctp-inline-editable-cell {
    cursor: text !important;
    position: relative;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.ctp-inline-editable-cell:hover {
    background: rgba(255, 255, 255, 0.035);
    box-shadow: inset 0 0 0 1px rgba(255, 196, 0, 0.18);
}

.ctp-inline-cell-editing {
    padding: 6px !important;
    background: rgba(255, 196, 0, 0.06);
}

.ctp-inline-cell-input {
    width: 100%;
    min-width: 64px;
    height: 34px;
    padding: 6px 9px;
    border: 1px solid #ffc400;
    border-radius: 6px;
    background: #111;
    color: #fff;
    font: inherit;
    text-align: center;
    outline: none;
    box-sizing: border-box;
}

.ctp-inline-cell-input:focus {
    box-shadow: 0 0 0 3px rgba(255, 196, 0, 0.16);
}

.ctp-inline-cell-editing.is-saving .ctp-inline-cell-input {
    opacity: 0.65;
}

/* Header action buttons are handled by .plan-action-btn near the editor header styles. */

/* Plans list controls aligned with status badges. */
.ctp-plans-scope {
    gap: 6px;
    padding: 4px;
    border-color: rgba(255, 255, 255, 0.11);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
}

.ctp-plans-scope-btn {
    min-height: 36px;
    padding: 7px 14px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: #cfcfcf;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.ctp-plans-scope-btn:hover {
    border-color: rgba(255, 196, 0, 0.4);
    background: rgba(255, 196, 0, 0.07);
    color: #fff;
}

.ctp-plans-scope-btn.is-active {
    border-color: #ffc400;
    background: rgba(255, 196, 0, 0.12);
    color: #ffc400;
}

.ctp-plan-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.ctp-plans-ajax-table .ctp-plan-actions .btn-edit,
.ctp-plans-ajax-table .ctp-plan-actions .btn-share-plan,
.ctp-plans-ajax-table .ctp-plan-actions .btn-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    min-width: 64px;
    margin: 0 !important;
    padding: 7px 12px;
    border-radius: 7px;
    box-sizing: border-box;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    text-shadow: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.ctp-plans-ajax-table .ctp-plan-actions .btn-edit {
    border: 1px solid #ffc400 !important;
    background: rgba(255, 196, 0, 0.08) !important;
    color: #ffc400 !important;
}

.ctp-plans-ajax-table .ctp-plan-actions .btn-edit:hover {
    background: rgba(255, 196, 0, 0.18) !important;
    color: #ffdf62 !important;
}

.ctp-plans-ajax-table .ctp-plan-actions .btn-share-plan {
    border: 1px solid #6c757d !important;
    background: rgba(108, 117, 125, 0.16) !important;
    color: #d6dce2 !important;
}

.ctp-plans-ajax-table .ctp-plan-actions .btn-share-plan:hover {
    border-color: #adb5bd !important;
    background: rgba(108, 117, 125, 0.28) !important;
    color: #fff !important;
}

.ctp-plans-ajax-table .ctp-plan-actions .btn-delete {
    border: 1px solid #dc3545 !important;
    background: rgba(220, 53, 69, 0.12) !important;
    color: #ff6673 !important;
}

.ctp-plans-ajax-table .ctp-plan-actions .btn-delete:hover {
    background: rgba(220, 53, 69, 0.24) !important;
    color: #fff !important;
}

@media (max-width: 768px) {
    .ctp-plan-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .ctp-plans-ajax-table .ctp-plan-actions .btn-edit,
    .ctp-plans-ajax-table .ctp-plan-actions .btn-share-plan,
    .ctp-plans-ajax-table .ctp-plan-actions .btn-delete {
        flex: 1 1 96px;
    }
}
