/* Custom WooCommerce Dashboard Styles */

:root {
    --cwd-v2-blue: #67b5df;
    --cwd-v2-blue-dark: #347da8;
    --cwd-v2-blue-soft: #edf8fd;
    --cwd-v2-ink: #354b59;
    --cwd-v2-muted: #5f707a;
    --cwd-v2-border: #d8eaf3;
    --cwd-v2-surface: #f7fcfe;
}

.cwd-v2-dashboard-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--cwd-v2-ink);
}

.cwd-v2-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.cwd-v2-card {
    background: #fff;
    border: 1px solid var(--cwd-v2-border);
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(52, 125, 168, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.cwd-v2-card:hover {
    box-shadow: 0 6px 16px rgba(52, 125, 168, 0.15);
    transform: translateY(-2px);
}

.cwd-v2-card-content {
    padding: 20px;
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.cwd-v2-profile-content {
    align-items: flex-start;
}

.cwd-v2-avatar {
    background-color: var(--cwd-v2-ink);
    color: #fff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    margin-right: 15px;
    flex-shrink: 0;
}

.cwd-v2-profile-info h2 {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 600;
}

.cwd-v2-profile-info p {
    margin: 0;
    font-size: 14px;
    color: var(--cwd-v2-muted);
}

.cwd-v2-badge {
    background-color: var(--cwd-v2-blue-soft);
    color: var(--cwd-v2-ink);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: bold;
}

.cwd-v2-email {
    color: var(--cwd-v2-muted);
    margin-top: 5px !important;
}

.cwd-v2-icon {
    margin-right: 20px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cwd-v2-blue-soft);
    border-radius: 6px;
    text-align: center;
    flex-shrink: 0;
}

.cwd-v2-icon svg,
.cwd-v2-action-icon {
    width: 30px;
    height: 30px;
    fill: none;
    stroke: var(--cwd-v2-blue-dark);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cwd-v2-icon svg {
    width: 32px;
    height: 32px;
}

.cwd-v2-card-text h3 {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 600;
}

.cwd-v2-card-text p {
    margin: 0;
    font-size: 14px;
    color: var(--cwd-v2-muted);
    line-height: 1.4;
}

.cwd-v2-card-footer {
    border-top: 1px solid var(--cwd-v2-border);
    padding: 15px 20px;
    background-color: var(--cwd-v2-surface);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
}

.cwd-v2-orders-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
}

.cwd-v2-card-footer a {
    color: var(--cwd-v2-blue-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.cwd-v2-card-footer a:hover {
    color: var(--cwd-v2-ink);
    text-decoration: underline;
}

.cwd-v2-action-icon {
    width: 17px;
    height: 17px;
    stroke-width: 2;
}

/* Endpoint Styles */

.cwd-v2-back-button {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--cwd-v2-blue-dark);
    text-decoration: none;
    font-weight: 600;
}

.cwd-v2-back-button:hover {
    color: var(--cwd-v2-ink);
    text-decoration: underline;
}

.cwd-v2-endpoint-content {
    background: #fff;
    padding: 20px;
    border: 1px solid var(--cwd-v2-border);
    border-radius: 6px;
}

.cwd-v2-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.cwd-v2-section-heading h3 {
    margin: 0 0 5px;
    font-size: 22px;
}

.cwd-v2-section-heading p {
    margin: 0;
    color: var(--cwd-v2-muted);
}

.cwd-v2-section-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.cwd-v2-section-links a {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--cwd-v2-surface);
    border: 1px solid var(--cwd-v2-border);
    color: var(--cwd-v2-blue-dark);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.cwd-v2-section-links a:hover {
    background: var(--cwd-v2-blue-soft);
    border-color: var(--cwd-v2-blue);
    color: var(--cwd-v2-blue-dark);
    text-decoration: none;
}

.cwd-v2-section-links a.cwd-v2-active-link {
    background: var(--cwd-v2-blue-dark);
    border-color: var(--cwd-v2-blue-dark);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}

.cwd-v2-track-dashboard {
    width: 100%;
    box-sizing: border-box;
}

.cwd-v2-order-tracking-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

@media (max-width: 640px) {
    .cwd-v2-timeline-stepper {
        flex-direction: column !important;
        gap: 16px !important;
    }

    .cwd-v2-timeline-line {
        display: none !important;
    }

    .cwd-v2-timeline-step {
        display: flex !important;
        align-items: center !important;
        text-align: left !important;
        gap: 12px !important;
    }

    .cwd-v2-timeline-step > div:first-child {
        margin: 0 !important;
        flex-shrink: 0 !important;
    }

    .cwd-v2-track-tabs {
        width: 100% !important;
        overflow-x: auto !important;
    }
}

/* Invoices */

.cwd-v2-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.cwd-v2-status-unpaid {
    background: var(--cwd-v2-blue-soft);
    color: var(--cwd-v2-blue-dark);
}

.cwd-v2-status-paid {
    background: #e6f4ea;
    color: #1e7e34;
}

.cwd-v2-status-overdue {
    background: #fdecea;
    color: #c62828;
}

.cwd-v2-status-void {
    background: #eceff1;
    color: #607d8b;
}

.cwd-v2-invoice-meta p {
    margin: 0 0 6px;
}

.cwd-v2-invoice-items tfoot th,
.cwd-v2-invoice-items tfoot td {
    font-weight: 700;
}

.cwd-v2-print-button {
    background: var(--cwd-v2-blue-dark);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.cwd-v2-print-button:hover {
    background: var(--cwd-v2-ink);
}

@media print {
    .cwd-v2-no-print,
    .cwd-v2-back-button,
    .cwd-v2-dashboard-container > a {
        display: none !important;
    }

    .cwd-v2-endpoint-content {
        border: none;
        padding: 0;
    }
}

/* ==========================================================================
   Credit Dashboard Layout & Alignment Styles
   ========================================================================== */

.cwd-v2-credit-dashboard {
    max-width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #0f172a;
    box-sizing: border-box;
}

.cwd-v2-credit-dashboard * {
    box-sizing: border-box;
}

.cwd-v2-credit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.cwd-v2-credit-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px 0;
    letter-spacing: -0.02em;
}

.cwd-v2-credit-header p {
    font-size: 13.5px;
    color: #64748b;
    margin: 0;
}

.cwd-v2-account-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12.5px;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
}

.cwd-v2-account-pill span {
    color: #64748b;
    font-weight: 500;
}

/* 4-Box Summary Grid */
.cwd-v2-credit-summary,
.cwd-v2-credit-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.cwd-v2-stat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 128px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cwd-v2-stat-card:hover {
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.cwd-v2-stat-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.cwd-v2-stat-label {
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.05em;
    margin: 0;
}

.cwd-v2-stat-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.cwd-v2-stat-value {
    font-size: 26px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.15;
    margin: 0;
    letter-spacing: -0.02em;
}

.cwd-v2-stat-value.cwd-val-danger {
    color: #dc2626;
}

.cwd-v2-stat-value.cwd-val-success {
    color: #16a34a;
}

.cwd-v2-stat-value.cwd-val-date {
    font-size: 22px;
}

.cwd-v2-stat-desc {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 6px;
    margin-bottom: 0;
    line-height: 1.3;
}

/* Action Cards Grid */
.cwd-v2-action-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
    align-items: stretch;
}

.cwd-v2-action-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.cwd-v2-action-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.cwd-v2-action-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
}

.cwd-v2-action-desc {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 16px 0;
    line-height: 1.45;
}

.cwd-v2-btn-primary {
    background: #0f172a !important;
    color: #ffffff !important;
    border: 1px solid #0f172a !important;
    border-radius: 6px !important;
    padding: 10px 20px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    line-height: 1.4 !important;
    transition: background 0.15s ease, border-color 0.15s ease !important;
}

.cwd-v2-btn-primary:hover {
    background: #1e293b !important;
    border-color: #1e293b !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

/* Tables Layout & Alignment */
.cwd-v2-section-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 28px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.cwd-v2-section-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.cwd-v2-section-top h3 {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 4px 0;
}

.cwd-v2-section-top p {
    font-size: 12.5px;
    color: #64748b;
    margin: 0;
}

.cwd-v2-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    margin-top: 8px;
}

.cwd-v2-data-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 13px !important;
    margin: 0 !important;
}

.cwd-v2-data-table thead tr th {
    padding: 12px 14px !important;
    font-weight: 600 !important;
    color: #64748b !important;
    font-size: 11.5px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    border-bottom: 1px solid #e2e8f0 !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    background: #f8fafc !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
    text-align: left;
}

.cwd-v2-data-table tbody tr td {
    padding: 12px 14px !important;
    vertical-align: middle !important;
    border-bottom: 1px solid #f1f5f9 !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    color: #334155 !important;
    background: transparent !important;
}

.cwd-v2-data-table tbody tr:hover td {
    background-color: #f8fafc !important;
}

.cwd-v2-data-table .th-num,
.cwd-v2-data-table .td-num {
    text-align: right !important;
}

.cwd-v2-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.3;
    white-space: nowrap;
}

.cwd-v2-btn-view {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 4px !important;
    padding: 6px 14px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #334155 !important;
    text-decoration: none !important;
    line-height: 1 !important;
    float: none !important;
    margin: 0 !important;
    cursor: pointer !important;
    transition: background 0.15s ease, border-color 0.15s ease !important;
}

.cwd-v2-btn-view:hover {
    background: #f1f5f9 !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
    text-decoration: none !important;
}