/* Layout */
.pidp-flexwrap {
    display: flex;
    min-height: 80vh;
}
.pidp-flexwrap aside {
    width: 210px;
    background: #181f2c;
    color: #fff;
    padding: 2rem 0;
    min-height: 100vh;
}
.pidp-flexwrap nav {
    display: flex;
    flex-direction: column;
}
.pidp-flexwrap nav a {
    padding: 15px 24px;
    color: #a8b4d1;
    text-decoration: none;
    font-weight: 500;
    transition: .2s;
    border-left: 4px solid transparent;
}
.pidp-flexwrap nav a.active,
.pidp-flexwrap nav a:hover {
    background: #222e47;
    color: #fff;
    border-left: 4px solid #1380e9;
}
.pidp-main {
    flex: 1;
    background: #f6f8fa;
    padding: 36px 4vw;
    min-height: 80vh;
}

/* Header and search */
.pidp-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 1em;
    flex-wrap: wrap;
}
.pidp-list-header input {
    padding: 9px 14px;
    border-radius: 6px;
    border: 1px solid #d4e2f7;
    width: 200px;
    font-size: 1em;
}
.pidp-add-plan-btn {
    background: #1380e9;
    color: #fff;
    border: none;
    padding: 9px 24px;
    border-radius: 6px;
    font-size: 1em;
    margin-left: 1em;
    cursor: pointer;
    transition: background .18s;
    font-weight: bold;
}
.pidp-add-plan-btn:hover {
    background: #0a6dc2;
}

/* Pagination */
.pidp-pagination {
    font-size: .98em;
}
.pidp-page {
    padding: 7px 13px;
    margin: 0 1px;
    background: #e9eef5;
    color: #1b2846;
    border-radius: 5px;
    text-decoration: none;
    cursor: pointer;
    font-weight: 500;
    transition: background .18s;
}
.pidp-page.active,
.pidp-page:hover {
    background: #1b2846;
    color: #fff;
}

/* Card grid */
.pidp-card-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}
.pidp-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 16px #0001;
    padding: 1.2rem 1.4rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}
.pidp-card h4 {
    margin: .3em 0 .8em 0;
    font-size: 1.13em;
}
.pidp-card-meta {
    color: #8391b3;
    margin-bottom: 7px;
    font-size: .99em;
    word-break: break-word;
}
.pidp-user-card button,
.pidp-plan-card button {
    background: #1b2846;
    color: #fff;
    border: none;
    padding: 7px 22px;
    border-radius: 7px;
    margin-top: .4em;
    cursor: pointer;
    margin-right: .4em;
    font-size: .98em;
    transition: background .18s;
    min-height: 36px;
}
.pidp-user-card .pidp-withdrawal-btn {
    background: #f4b400 !important;
    color: #332600 !important;
    border: 1px solid #e2e2e2 !important;
    font-weight: bold !important;
    margin-left: 4px !important;
    padding: 7px 18px !important;
}
.pidp-user-card .pidp-withdrawal-btn:hover {
    background: #ffce2b !important;
    color: #111 !important;
}
.pidp-plan-card .pidp-delete-plan-btn {
    background: #e84141;
    color: #fff;
}
.pidp-plan-card .pidp-delete-plan-btn:hover {
    background: #c93030;
}

/* Real-time earnings fields */
.pidp-daily-earning,
#pidp-daily-counter {
    color: #fb8c00;
    font-weight: bold;
    font-size: 1.07em;
    letter-spacing: .5px;
}
.pidp-total-earning,
#pidp-total {
    color: #21b573;
    font-weight: bold;
    font-size: 1.13em;
    letter-spacing: .5px;
}

/* Modal */
.pidp-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.17);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pidp-modal-content {
    background: #fff;
    border-radius: 11px;
    box-shadow: 0 12px 48px #0002;
    padding: 2.2rem 2.7rem;
    min-width: 320px;
    max-width: 96vw;
    width: 100%;
    position: relative;
    max-height: 96vh;
    overflow-y: auto;
}
.pidp-modal-content h3 {
    margin-top: 0;
    font-weight: 600;
    font-size: 1.2em;
}
.pidp-modal-content label {
    display: block;
    margin-bottom: 12px;
    font-weight: 500;
    color: #1b2846;
}
.pidp-modal-content input,
.pidp-modal-content select {
    width: 100%;
    padding: 7px 10px;
    border-radius: 5px;
    border: 1px solid #dae6f3;
    margin-bottom: 7px;
    font-size: 1em;
    background: #f8fafd;
}
.pidp-modal-content button {
    margin-right: 1rem;
    margin-top: 1rem;
    padding: 8px 22px;
    border-radius: 6px;
    font-size: 1em;
    background: #21b573;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background .18s;
}
.pidp-modal-content button[type="button"] {
    background: #eee;
    color: #1b2846;
}
.pidp-modal-content button:disabled {
    opacity: .7;
}
.pidp-modal-content button:hover:not(:disabled) {
    background: #109056;
    color: #fff;
}
.pidp-modal-content .pidp-close-modal {
    background: #eee;
    color: #1b2846;
}
.pidp-modal-content .pidp-close-modal:hover {
    background: #e84141;
    color: #fff;
}
.pidp-modal-content button:focus,
.pidp-modal-content input:focus,
.pidp-modal-content select:focus {
    outline: 2px solid #1380e9;
    outline-offset: 1px;
}

/* Error */
.pidp-error {
    background: #fef2f2;
    color: #dc2626;
    padding: 1rem;
    border-radius: 7px;
    margin: 2em;
}

/* User dashboard */
.pidp-user-summary {
    max-width: 430px;
    margin: 3rem auto;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 16px #0001;
    padding: 2rem 1.5rem;
}
.pidp-user-summary .big {
    font-size: 1.28em;
    color: #21b573;
    font-weight: 600;
}
.pidp-highlight {
    color: #1380e9;
    font-weight: 600;
}

/* Days left / expired badges */
.pidp-days-left {
    color: #22835b;
    font-weight: bold;
    margin-left: 6px;
    font-size: 0.98em;
    background: #e2fcef;
    border-radius: 5px;
    padding: 2px 7px;
    display: inline-block;
}
.pidp-days-expired,
.pidp-card-meta span[style*="color:#e84141"] {
    color: #e84141 !important;
    font-weight: bold;
    background: #fdeeee;
    border-radius: 5px;
    padding: 2px 7px;
    font-size: 0.98em;
    margin-left: 6px;
    display: inline-block;
}

/* Responsive */
@media (max-width: 900px) {
    .pidp-flexwrap aside {
        width: 120px;
        font-size: 0.95em;
    }
    .pidp-main {
        padding: 18px 2vw;
    }
}
@media (max-width: 700px) {
    .pidp-flexwrap aside {
        width: 100px;
        padding: 1rem 0;
    }
    .pidp-main {
        padding: 8px 2vw;
    }
    .pidp-card-list {
        grid-template-columns: 1fr;
    }
    .pidp-user-summary {
        max-width: 98vw;
        padding: 1.2rem .7rem;
    }
    .pidp-modal-content {
        padding: 1rem .8rem;
    }
    .pidp-error {
        margin: 1em;
    }
}
@media (max-width: 480px) {
    .pidp-list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5em;
    }
    .pidp-card-list {
        overflow-x: auto;
        gap: 1em;
    }
}