/* BDShield My Account Dashboard */

/* ─── Layout ─── */
.bd-dash-layout {
    display: flex;
    min-height: calc(100vh - 80px);
    margin-top: 80px;
}

.bd-dash-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--bd-cream, #FDFCFA);
    border-right: 1px solid var(--bd-soft-border, rgba(26,26,26,0.08));
    display: flex;
    flex-direction: column;
    padding: 32px 0;
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
    overflow-y: auto;
}

.bd-dash-main {
    flex: 1;
    min-width: 0;
    padding: 32px 40px 80px;
    max-width: 960px;
}

/* ─── Sidebar Profile ─── */
.bd-sidebar-profile {
    padding: 0 20px 24px;
    border-bottom: 1px solid var(--bd-soft-border, rgba(26,26,26,0.08));
    margin-bottom: 16px;
    text-align: center;
}

.bd-sidebar-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bd-gold, #C9A96E), var(--bd-gold-light, #DFC598));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    margin: 0 auto 10px;
}

.bd-sidebar-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--bd-charcoal, #1A1A1A);
}

.bd-sidebar-email {
    font-size: 12px;
    color: var(--bd-stone, #7A7268);
    margin-top: 2px;
}

.bd-sidebar-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 500;
    color: var(--bd-green, #2E8B57);
    margin-top: 8px;
    padding: 3px 10px;
    background: var(--bd-green-dim, rgba(46,139,87,0.08));
    border-radius: 20px;
}

.bd-sidebar-badge .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--bd-green, #2E8B57);
}

/* ─── Sidebar Nav ─── */
.bd-sidebar-nav {
    flex: 1;
    padding: 0 12px;
}

.bd-sidebar-section {
    margin-bottom: 12px;
}

.bd-sidebar-section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--bd-stone, #7A7268);
    padding: 0 8px;
    margin-bottom: 4px;
}

.bd-sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--bd-charcoal, #1A1A1A);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.bd-sidebar-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.bd-sidebar-link:hover {
    background: var(--bd-soft-border, rgba(26,26,26,0.08));
}

.bd-sidebar-link.active {
    background: var(--bd-gold-dim, rgba(201,169,110,0.12));
    color: var(--bd-gold, #C9A96E);
}

.badge-count {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    background: var(--bd-gold-dim, rgba(201,169,110,0.12));
    color: var(--bd-gold, #C9A96E);
    padding: 0 6px;
}

.badge-count.grey {
    background: var(--bd-soft-border, rgba(26,26,26,0.08));
    color: var(--bd-stone, #7A7268);
}

/* ─── Sidebar Footer ─── */
.bd-sidebar-footer {
    padding: 16px 12px 0;
    border-top: 1px solid var(--bd-soft-border, rgba(26,26,26,0.08));
    margin-top: auto;
}

.bd-sidebar-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--bd-stone, #7A7268);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.bd-sidebar-logout svg {
    width: 18px;
    height: 18px;
}

.bd-sidebar-logout:hover {
    background: var(--bd-red-dim, rgba(220,38,38,0.08));
    color: var(--bd-red, #DC2626);
}

/* ─── Dashboard Header ─── */
.bd-dash-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}

.bd-dash-greeting {
    font-family: var(--bd-font-heading, 'Playfair Display', serif);
    font-size: 26px;
    font-weight: 700;
    color: var(--bd-charcoal, #1A1A1A);
    margin-bottom: 4px;
}

.bd-dash-greeting-sub {
    font-size: 14px;
    color: var(--bd-stone, #7A7268);
}

.bd-dash-header-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* ─── Buttons ─── */
.bd-dash-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--bd-soft-border, rgba(26,26,26,0.08));
    background: #fff;
    color: var(--bd-charcoal, #1A1A1A);
    transition: all 0.2s;
}

.bd-dash-btn:hover {
    border-color: var(--bd-gold-light, #DFC598);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.bd-dash-btn.primary {
    background: var(--bd-charcoal, #1A1A1A);
    color: #fff;
    border-color: var(--bd-charcoal, #1A1A1A);
}

.bd-dash-btn.primary:hover {
    background: var(--bd-warm-black, #0D0D0D);
}

/* ─── Stats Grid ─── */
.bd-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.bd-stat-card {
    background: #fff;
    border: 1px solid var(--bd-soft-border, rgba(26,26,26,0.08));
    border-radius: 12px;
    padding: 20px;
}

.bd-stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.bd-stat-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.bd-stat-icon.gold   { background: var(--bd-gold-dim, rgba(201,169,110,0.12)); color: var(--bd-gold, #C9A96E); }
.bd-stat-icon.green  { background: var(--bd-green-dim, rgba(46,139,87,0.08)); color: var(--bd-green, #2E8B57); }
.bd-stat-icon.blue   { background: var(--bd-blue-dim, rgba(59,130,246,0.08)); color: var(--bd-blue, #3B82F6); }
.bd-stat-icon.orange { background: var(--bd-orange-dim, rgba(234,88,12,0.08)); color: var(--bd-orange, #EA580C); }

.bd-stat-trend {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.bd-stat-trend.up      { background: var(--bd-green-dim, rgba(46,139,87,0.08)); color: var(--bd-green, #2E8B57); }
.bd-stat-trend.neutral { background: var(--bd-blue-dim, rgba(59,130,246,0.08)); color: var(--bd-blue, #3B82F6); }

.bd-stat-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--bd-charcoal, #1A1A1A);
    line-height: 1;
    margin-bottom: 4px;
}

.bd-stat-label {
    font-size: 13px;
    color: var(--bd-stone, #7A7268);
}

/* ─── Content Grid ─── */
.bd-content-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

/* ─── Panel ─── */
.bd-panel {
    background: #fff;
    border: 1px solid var(--bd-soft-border, rgba(26,26,26,0.08));
    border-radius: 12px;
    overflow: hidden;
}

.bd-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--bd-soft-border, rgba(26,26,26,0.08));
}

.bd-panel-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--bd-charcoal, #1A1A1A);
}

.bd-panel-title .count {
    font-size: 12px;
    font-weight: 600;
    color: var(--bd-stone, #7A7268);
    background: var(--bd-ivory, #F7F5F0);
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 6px;
}

.bd-panel-action {
    font-size: 13px;
    font-weight: 500;
    color: var(--bd-gold, #C9A96E);
    text-decoration: none;
}

.bd-panel-action:hover {
    color: var(--bd-gold-light, #DFC598);
}

/* ─── Product Row ─── */
.bd-product-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--bd-soft-border, rgba(26,26,26,0.08));
}

.bd-product-row:last-child {
    border-bottom: none;
}

.bd-product-row-thumb {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, #2a2520, #1a1714);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bd-product-row-info {
    flex: 1;
    min-width: 0;
}

.bd-product-row-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--bd-charcoal, #1A1A1A);
}

.bd-product-row-meta {
    font-size: 12px;
    color: var(--bd-stone, #7A7268);
}

.bd-product-row-actions {
    flex-shrink: 0;
}

.bd-row-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--bd-soft-border, rgba(26,26,26,0.08));
    color: var(--bd-charcoal, #1A1A1A);
    background: #fff;
    transition: all 0.2s;
}

.bd-row-btn:hover {
    border-color: var(--bd-gold-light, #DFC598);
    color: var(--bd-gold, #C9A96E);
}

.bd-row-btn.download {
    background: var(--bd-charcoal, #1A1A1A);
    color: #fff;
    border-color: var(--bd-charcoal, #1A1A1A);
}

.bd-row-btn.download:hover {
    background: var(--bd-warm-black, #0D0D0D);
}

/* ─── Empty State ─── */
.bd-empty-state {
    text-align: center;
    padding: 40px 20px;
}

.bd-empty-state-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--bd-charcoal, #1A1A1A);
    margin: 12px 0 4px;
}

.bd-empty-state-desc {
    font-size: 13px;
    color: var(--bd-stone, #7A7268);
    margin-bottom: 16px;
}

/* ─── Activity ─── */
.bd-activity-list {
    padding: 8px 0;
}

.bd-activity-item {
    display: flex;
    gap: 12px;
    padding: 10px 20px;
}

.bd-activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
}

.bd-activity-dot.gold   { background: var(--bd-gold, #C9A96E); }
.bd-activity-dot.green  { background: var(--bd-green, #2E8B57); }
.bd-activity-dot.blue   { background: var(--bd-blue, #3B82F6); }
.bd-activity-dot.orange { background: var(--bd-orange, #EA580C); }

.bd-activity-text {
    font-size: 13px;
    color: var(--bd-charcoal, #1A1A1A);
    line-height: 1.4;
}

.bd-activity-time {
    font-size: 11px;
    color: var(--bd-stone, #7A7268);
    margin-top: 2px;
}

/* ─── Section Label ─── */
.bd-dash-section-label {
    font-size: 16px;
    font-weight: 700;
    color: var(--bd-charcoal, #1A1A1A);
    margin: 28px 0 12px;
}

/* ─── License Table ─── */
.bd-license-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.bd-license-table thead th {
    padding: 12px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--bd-stone, #7A7268);
    border-bottom: 1px solid var(--bd-soft-border, rgba(26,26,26,0.08));
    background: var(--bd-ivory, #F7F5F0);
}

.bd-license-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--bd-soft-border, rgba(26,26,26,0.08));
    color: var(--bd-charcoal, #1A1A1A);
}

.bd-license-table tr:last-child td {
    border-bottom: none;
}

/* ─── Status Badge ─── */
.bd-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.bd-status-badge .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.bd-status-badge.active         { background: var(--bd-green-dim, rgba(46,139,87,0.08)); color: var(--bd-green, #2E8B57); }
.bd-status-badge.active .dot    { background: var(--bd-green, #2E8B57); }
.bd-status-badge.expiring       { background: var(--bd-orange-dim, rgba(234,88,12,0.08)); color: var(--bd-orange, #EA580C); }
.bd-status-badge.expiring .dot  { background: var(--bd-orange, #EA580C); }

/* ─── Settings ─── */
.bd-settings-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.bd-settings-card {
    background: #fff;
    border: 1px solid var(--bd-soft-border, rgba(26,26,26,0.08));
    border-radius: 12px;
    padding: 24px;
}

.bd-settings-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--bd-charcoal, #1A1A1A);
    margin-bottom: 4px;
}

.bd-settings-card-desc {
    font-size: 13px;
    color: var(--bd-stone, #7A7268);
    margin-bottom: 16px;
}

.bd-setting-field {
    margin-bottom: 14px;
}

.bd-setting-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--bd-stone, #7A7268);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}

.bd-setting-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--bd-soft-border, rgba(26,26,26,0.08));
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--bd-font-body, 'DM Sans', sans-serif);
    color: var(--bd-charcoal, #1A1A1A);
    background: var(--bd-ivory, #F7F5F0);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.bd-setting-input:focus {
    border-color: var(--bd-gold, #C9A96E);
    box-shadow: 0 0 0 3px var(--bd-gold-dim, rgba(201,169,110,0.12));
    background: #fff;
}

.bd-setting-input[readonly] {
    cursor: default;
}

.bd-setting-row-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--bd-soft-border, rgba(26,26,26,0.08));
}

.bd-setting-row-inline:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.bd-setting-row-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--bd-charcoal, #1A1A1A);
}

.bd-setting-row-desc {
    font-size: 12px;
    color: var(--bd-stone, #7A7268);
    margin-top: 1px;
}

/* ─── Animations ─── */
.bd-anim-fade-up {
    animation: bdDashFadeUp 0.5s ease both;
}

@keyframes bdDashFadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Edit Account Form ─── */
.bd-edit-account-form .woocommerce-error,
.bd-edit-account-form .woocommerce-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

/* ─── Licenses (BDLS) ─── */
.bdls-licenses-wrap {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bdls-license-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    transition: box-shadow 0.2s;
}
.bdls-license-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.bdls-license-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f3f4f6;
}

.bdls-license-key-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bdls-license-key {
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 1.5px;
    color: #1f2937;
    background: #f8f9fa;
    padding: 8px 14px;
    border-radius: 6px;
}

.bdls-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.15s;
}
.bdls-copy-btn:hover { background: #f3f4f6; color: #374151; }
.bdls-copy-btn.copied { background: #dcfce7; border-color: #86efac; color: #16a34a; }

.bdls-badges {
    display: flex;
    gap: 8px;
    align-items: center;
}

.bdls-tier-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.bdls-tier-starter { background: #f3f4f6; color: #6b7280; }
.bdls-tier-professional { background: #dbeafe; color: #1d4ed8; }
.bdls-tier-agency { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92400e; }

.bdls-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}
.bdls-status-active .bdls-status-badge { background: #dcfce7; color: #16a34a; }
.bdls-status-expired .bdls-status-badge { background: #fef9c3; color: #a16207; }
.bdls-status-revoked .bdls-status-badge { background: #fee2e2; color: #dc2626; }

.bdls-license-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.bdls-detail {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bdls-detail-label {
    font-size: 12px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 500;
}

.bdls-detail-value {
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}

.bdls-activated-sites {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
}

.bdls-activated-sites ul {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bdls-activated-sites li code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    background: #f8f9fa;
    padding: 4px 10px;
    border-radius: 4px;
    color: #6b7280;
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
    .bd-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .bd-content-grid {
        grid-template-columns: 1fr;
    }
    .bd-dash-main {
        padding: 24px 28px 60px;
    }
}

@media (max-width: 768px) {
    .bd-dash-layout {
        flex-direction: column;
        margin-top: 70px;
    }
    .bd-dash-sidebar {
        width: 100%;
        position: relative;
        top: 0;
        height: auto;
        overflow: visible;
        border-right: none;
        border-bottom: 1px solid var(--bd-soft-border, rgba(26,26,26,0.08));
        flex-direction: row;
        padding: 16px 0;
        align-items: center;
    }
    .bd-sidebar-profile {
        display: none;
    }
    .bd-sidebar-nav {
        display: flex;
        gap: 4px;
        overflow-x: auto;
        padding: 0 12px;
        flex: 1;
    }
    .bd-sidebar-section {
        display: flex;
        gap: 4px;
        margin-bottom: 0;
    }
    .bd-sidebar-section-label {
        display: none;
    }
    .bd-sidebar-link {
        white-space: nowrap;
        padding: 8px 14px;
    }
    .bd-sidebar-link svg {
        display: none;
    }
    .bd-sidebar-footer {
        display: none;
    }
    .bd-dash-main {
        padding: 20px 16px 60px;
    }
    .bd-dash-header {
        flex-direction: column;
    }
    .bd-stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .bd-settings-row {
        grid-template-columns: 1fr;
    }
    .bd-license-table {
        font-size: 13px;
    }
    .bd-license-table thead th,
    .bd-license-table td {
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .bd-stats-grid {
        grid-template-columns: 1fr;
    }
    .bdls-license-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .bdls-license-key {
        font-size: 13px;
        letter-spacing: 1px;
    }
    .bdls-license-details {
        grid-template-columns: 1fr 1fr;
    }
}
