/* ==========================================================================
   Spájz Master Dashboard — spajz-dashboard.css
   ========================================================================== */

.kk-spajz-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 20px 60px;
    font-family: 'Titillium Web', 'Roboto', Arial, sans-serif;
    box-sizing: border-box;
}

/* ── Header ─────────────────────────────────────────────────────────────── */

.kk-spajz-header {
    background: linear-gradient(135deg, #6b4c2e 0%, #8b6342 100%);
    border-radius: 12px;
    padding: 28px 32px;
    margin-bottom: 28px;
    color: #fff;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.kk-spajz-header .kk-spajz-title {
    font-size: clamp(22px, 4vw, 34px);
    font-weight: 700;
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fff !important;
    line-height: 1.2;
}

.kk-spajz-group-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.kk-spajz-header .kk-spajz-group-name {
    font-size: 18px;
    font-weight: 600;
    color: #ffd9a0 !important;
}

.kk-spajz-header .kk-spajz-group-region {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85) !important;
    background: rgba(0, 0, 0, 0.25);
    padding: 3px 12px;
    border-radius: 20px;
}

/* Group switcher (admin only) */
.kk-spajz-group-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
}

.kk-spajz-group-switcher select {
    padding: 5px 10px;
    border-radius: 6px;
    border: none;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    cursor: pointer;
}

.kk-spajz-group-switcher select option {
    background: #5a3d22;
    color: #fff;
}

/* ── Tabs ────────────────────────────────────────────────────────────────── */

.kk-spajz-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #e0d5c8;
    margin-bottom: 24px;
}

.kk-spajz-tab {
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 600;
    color: #7a6048;
    text-decoration: none;
    border-radius: 8px 8px 0 0;
    border: 2px solid transparent;
    border-bottom: none;
    transition: background 0.15s, color 0.15s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kk-spajz-tab:hover {
    background: #f5ede2;
    color: #4a2e10;
    text-decoration: none;
}

.kk-spajz-tab.active {
    background: #fff;
    color: #4a2e10;
    border-color: #e0d5c8;
    border-bottom-color: #fff;
    margin-bottom: -2px;
}

/* ── Badge ───────────────────────────────────────────────────────────────── */

.kk-spajz-badge {
    background: #c0392b;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 12px;
    line-height: 1.4;
}

.kk-spajz-badge--neutral {
    background: #7a6048;
}

/* ── Panel headings ──────────────────────────────────────────────────────── */

.kk-spajz-panel h2 {
    font-size: 20px;
    font-weight: 700;
    color: #4a2e10;
    margin: 0 0 18px;
    padding-bottom: 8px;
    border-bottom: 2px solid #eebb00;
}

.kk-spajz-empty {
    color: #888;
    font-style: italic;
    padding: 24px;
    text-align: center;
    background: #fafafa;
    border-radius: 8px;
    border: 1px dashed #ddd;
}

/* ── Member list ─────────────────────────────────────────────────────────── */

.kk-spajz-member-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kk-spajz-member-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid #e8ddd0;
    border-radius: 10px;
    padding: 14px 18px;
    gap: 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.15s, opacity 0.4s, max-height 0.4s;
}

.kk-spajz-member-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.09);
}

.kk-spajz-member-card.is-approved {
    background: #f1f8f1;
    border-color: #a5d6a7;
    pointer-events: none;
}

.kk-spajz-member-card.is-rejected {
    background: #fff5f5;
    border-color: #ef9a9a;
    pointer-events: none;
}

.kk-spajz-member-info {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.kk-spajz-avatar {
    width: 48px !important;
    height: 48px !important;
    border-radius: 50%;
    flex-shrink: 0;
}

.kk-spajz-member-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.kk-spajz-member-name {
    font-size: 15px;
    color: #3a2010;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.kk-spajz-member-email {
    font-size: 13px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}

.kk-spajz-member-rate {
    font-size: 13px;
    color: #6b4c2e;
    font-weight: 600;
}

.kk-spajz-role-badge {
    font-size: 11px;
    background: #6b4c2e;
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Action buttons ──────────────────────────────────────────────────────── */

.kk-spajz-member-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.kk-spajz-btn {
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    font-family: inherit;
    line-height: 1;
}

.kk-spajz-btn:active {
    transform: scale(0.97);
}

.kk-spajz-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.kk-spajz-btn--approve {
    background: #2e7d32;
    color: #fff;
}

.kk-spajz-btn--approve:hover:not(:disabled) {
    background: #1b5e20;
}

.kk-spajz-btn--reject {
    background: #fff;
    color: #c62828;
    border-color: #c62828;
}

.kk-spajz-btn--reject:hover:not(:disabled) {
    background: #ffebee;
}

/* ── Standalone message ──────────────────────────────────────────────────── */

.kk-spajz-message {
    max-width: 600px;
    margin: 60px auto;
    text-align: center;
    font-size: 18px;
    color: #6b4c2e;
    padding: 32px;
    background: #fdf6ee;
    border-radius: 12px;
    border: 1px solid #e8ddd0;
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */

@media (max-width: 620px) {
    .kk-spajz-header {
        padding: 20px;
    }

    .kk-spajz-member-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .kk-spajz-member-actions {
        width: 100%;
    }

    .kk-spajz-btn {
        flex: 1;
        text-align: center;
    }

    .kk-spajz-tabs {
        flex-wrap: wrap;
    }

    .kk-spajz-tab {
        padding: 8px 14px;
        font-size: 14px;
    }
}

/* ── Recipe Pool ─────────────────────────────────────────────────────────── */

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

.kk-pool-header h2 {
    margin: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.kk-spajz-btn--clone-open {
    background: #6b4c2e;
    color: #fff;
    font-size: 14px;
    padding: 9px 18px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    transition: background 0.15s;
}

.kk-spajz-btn--clone-open:hover {
    background: #4a2e10;
}

.kk-spajz-btn--edit {
    background: #fff;
    color: #6b4c2e;
    border: 2px solid #6b4c2e;
    font-size: 13px;
    padding: 6px 14px;
}

.kk-spajz-btn--edit:hover {
    background: #fdf6ee;
}

.kk-pool-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kk-pool-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid #e8ddd0;
    border-radius: 10px;
    padding: 14px 18px;
    gap: 16px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.04);
    transition: opacity 0.3s, max-height 0.35s;
}

.kk-pool-card:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.kk-pool-card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.kk-pool-card-title {
    font-size: 15px;
    color: #3a2010;
}

.kk-pool-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}

.kk-pool-version {
    background: #f0e6d8;
    color: #6b4c2e;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.kk-pool-source-link {
    color: #888;
    text-decoration: underline;
    font-size: 12px;
}

.kk-pool-source-link:hover {
    color: #6b4c2e;
}

.kk-pool-card-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* ── Clone picker modal ──────────────────────────────────────────────────── */

.kk-clone-picker {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.kk-clone-picker-box {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 560px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
    overflow: hidden;
}

.kk-clone-picker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px 14px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.kk-clone-picker-head h3 {
    margin: 0;
    font-size: 18px;
    color: #4a2e10;
}

.kk-clone-picker-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    font-family: inherit;
}

.kk-clone-picker-close:hover {
    color: #333;
}

.kk-clone-search-input {
    width: 100%;
    padding: 12px 18px;
    border: none;
    border-bottom: 1px solid #eee;
    font-size: 15px;
    font-family: inherit;
    box-sizing: border-box;
    outline: none;
    flex-shrink: 0;
}

.kk-clone-search-input:focus {
    background: #fdfaf6;
}

.kk-clone-results {
    overflow-y: auto;
    flex: 1 1 auto;
    padding: 8px 0;
}

.kk-clone-result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    gap: 12px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.1s;
}

.kk-clone-result-row:hover {
    background: #fdf8f3;
}

.kk-clone-result-row.is-cloned {
    opacity: 0.55;
}

.kk-clone-result-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.kk-clone-result-info strong {
    font-size: 14px;
    color: #3a2010;
}

.kk-clone-result-info span {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 340px;
}

.kk-spajz-btn--clone-do {
    background: #6b4c2e;
    color: #fff;
    border: none;
    font-size: 13px;
    padding: 6px 14px;
    white-space: nowrap;
    flex-shrink: 0;
}

.kk-spajz-btn--clone-do:hover:not(:disabled) {
    background: #4a2e10;
}

/* ── Events tab ─────────────────────────────────────────────────────────── */

.kk-event-form {
    background: #fdf6ee;
    border: 1px solid #e8ddd0;
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 24px;
}

.kk-event-form h3 {
    margin: 0 0 16px;
    font-size: 17px;
    color: #4a2e10;
}

.kk-form-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 14px;
}

.kk-form-row label {
    font-size: 13px;
    font-weight: 600;
    color: #6b4c2e;
}

.kk-form-row input[type=text],
.kk-form-row input[type=date],
.kk-form-row select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    max-width: 400px;
    box-sizing: border-box;
}

.kk-form-row input:focus,
.kk-form-row select:focus {
    outline: none;
    border-color: #6b4c2e;
    background: #fdfaf6;
}

.kk-ev-recipe-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 160px;
    overflow-y: auto;
    border: 1px solid #e0d5c8;
    border-radius: 6px;
    padding: 10px 14px;
    background: #fff;
    max-width: 400px;
}

.kk-ev-recipe-list label {
    font-size: 13px;
    font-weight: 400;
    color: #3a2010;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.kk-form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
}

.kk-inline-msg {
    font-size: 13px;
    font-weight: 600;
}

#kk-event-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kk-event-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid #e8ddd0;
    border-radius: 10px;
    padding: 14px 18px;
    gap: 16px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.04);
    transition: opacity 0.3s, max-height 0.35s;
}

.kk-event-card:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.kk-event-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.kk-event-title {
    font-size: 15px;
    color: #3a2010;
}

.kk-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: #888;
}

.kk-event-date {
    background: #f0e6d8;
    color: #6b4c2e;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.kk-event-loc::before { content: '\1F4CD\00A0'; }
.kk-event-host::before { content: '\1F464\00A0'; }

/* ── Price table ─────────────────────────────────────────────────────────── */

.kk-settings-hint {
    font-size: 13px;
    color: #888;
    margin: -8px 0 18px;
    font-style: italic;
}

.kk-price-search {
    width: 100%;
    max-width: 320px;
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    margin-bottom: 14px;
}

.kk-price-search:focus {
    outline: none;
    border-color: #6b4c2e;
    background: #fdfaf6;
}

.kk-price-table {
    border: 1px solid #e8ddd0;
    border-radius: 10px;
    overflow: hidden;
}

.kk-price-row {
    display: grid;
    grid-template-columns: 2fr 0.7fr 1fr 1.2fr;
    align-items: center;
    padding: 10px 16px;
    gap: 12px;
    border-bottom: 1px solid #f0ebe4;
    font-size: 14px;
}

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

.kk-price-row--head {
    background: #f5ede2;
    font-weight: 700;
    font-size: 12px;
    color: #6b4c2e;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 10px 16px;
}

.kk-price-row:not(.kk-price-row--head):hover {
    background: #fdfaf6;
}

.kk-price-name {
    font-weight: 600;
    color: #3a2010;
}

.kk-price-unit {
    color: #888;
    font-size: 12px;
}

.kk-price-global {
    color: #6b4c2e;
}

.kk-price-override-input {
    width: 100%;
    max-width: 110px;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    box-sizing: border-box;
    text-align: right;
    -moz-appearance: textfield;
}

.kk-price-override-input::-webkit-outer-spin-button,
.kk-price-override-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.kk-price-override-input:focus {
    outline: none;
    border-color: #6b4c2e;
    background: #fdfaf6;
}

.kk-price-header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.kk-price-currency-select {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #3a2010;
}

.kk-price-currency-select select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    cursor: pointer;
}

/* ── Group Settings tab ──────────────────────────────────────────────────── */

.kk-settings-form {
    max-width: 480px;
}

.kk-settings-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
}

.kk-settings-field label {
    font-size: 14px;
    font-weight: 600;
    color: #4a2e10;
}

.kk-settings-field input[type=text],
.kk-settings-field textarea {
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
    width: 100%;
}

.kk-settings-field input:focus,
.kk-settings-field textarea:focus {
    outline: none;
    border-color: #6b4c2e;
    background: #fdfaf6;
}

@media (max-width: 620px) {
    .kk-price-row {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
    }

    .kk-price-row--head span:nth-child(n+3) {
        display: none;
    }

    .kk-event-card {
        flex-direction: column;
        align-items: flex-start;
    }
}

.kk-clone-results {
    overflow-y: auto;
    flex: 1;
    padding: 8px 0;
}

.kk-clone-result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    gap: 14px;
    border-bottom: 1px solid #f5f0ea;
    transition: background 0.1s;
}

.kk-clone-result-row:last-child {
    border-bottom: none;
}

.kk-clone-result-row:hover {
    background: #fdf8f2;
}

.kk-clone-result-row.is-cloned {
    opacity: 0.55;
}

.kk-clone-result-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.kk-clone-result-info strong {
    font-size: 14px;
    color: #3a2010;
}

.kk-clone-result-info span {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 360px;
}

.kk-spajz-btn--clone-do {
    background: #6b4c2e;
    color: #fff;
    font-size: 13px;
    padding: 7px 14px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    flex-shrink: 0;
    white-space: nowrap;
    transition: background 0.15s;
}

.kk-spajz-btn--clone-do:hover:not(:disabled) {
    background: #4a2e10;
}

.kk-spajz-btn--clone-do:disabled {
    background: #ccc;
    cursor: default;
}

.kk-clone-loading {
    padding: 30px;
    text-align: center;
}

@media (max-width: 620px) {
    .kk-pool-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .kk-pool-card-actions {
        width: 100%;
    }

    .kk-clone-picker-box {
        max-height: 90vh;
    }
}