/**
 * EVE Member Dashboard - SEAT-like Interface
 * @since 1.0.0
 */

/* Ensure WordPress menu dropdowns appear above member dashboard */
.dropdown-menu,
.sub-menu,
nav .dropdown,
header .dropdown-menu {
    z-index: 99999 !important;
}

/* Container */
.eve-member-dashboard {
    background: #1a1d23;
    color: #e8e8e8;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    position: relative;
    z-index: 1;
}

/* Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0;
    border-bottom: none;
}

.dashboard-header h1 {
    margin: 0;
    color: #fff;
    font-size: 32px;
    font-weight: 700;
}

.header-left {
    flex: 0 0 auto;
}

.header-right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Character Switcher */
.character-switcher {
    display: flex;
    align-items: center;
    gap: 10px;
}

.character-switcher label {
    font-weight: 500;
    color: #b0b0b0;
}

.character-switcher select {
    background: #2a2f38;
    color: #fff;
    border: 1px solid #3a3f48;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

/* Main Content Layout */
.dashboard-content {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 20px;
}

/* Sidebar */
.dashboard-sidebar {
    background: #21252b;
    border-radius: 8px;
    padding: 15px;
}

.character-list-panel h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #fff;
    border-bottom: 2px solid #2a2f38;
    padding-bottom: 8px;
}

/* Character List */
.character-list {

}

.character-list-item {
    position: relative;
    background: #2a2f38;
    border-radius: 6px;
    margin-bottom: 1px;
    transition: all 0.2s;
    border: 2px solid transparent;
    padding-bottom: 14px;
}

.character-list-item:hover {
    background: #333a45;
    border-color: #9b59b6;
}

.character-list-item.active {
    background: #2e3441;
    border-color: #9b59b6;
    box-shadow: 0 0 0 1px rgba(155, 89, 182, 0.3);
}

/* Primary character active state - blue border */
.character-list-item.active:has(.primary-badge) {
    border-color: #5a9de8;
    box-shadow: 0 0 0 1px rgba(90, 157, 232, 0.3);
}

.character-list-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}
.character-list-item a,
.character-list-item a * {
    outline: 0 !important;
    border: 0 !important;
    text-decoration: none !important;
    box-shadow: none !important;
}
.eve-member-dashboard .character-portrait {
    position: relative;
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    overflow: visible;
    align-self: center;
    display: flex;
    align-items: center;
}

.eve-member-dashboard .character-portrait img {
    width: 100%;
    height: 100%;
    border-radius: 6px;
    border: 2px solid #3a3f48;
    display: block;
}

.eve-member-dashboard .character-list-item.active .character-portrait img {
    border-color: #9b59b6;
}

.eve-member-dashboard .character-list-item.active:has(.primary-badge) .character-portrait img {
    border-color: #5a9de8;
}

.character-info {
    flex: 1;
    min-width: 0;
}

.character-name {
    font-weight: 600;
    font-size: 13px;
    color: #fff;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.eve-member-dashboard .primary-badge {
    position: absolute;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    background: #5a9de8;
    color: #fff;
    font-size: 8px;
    padding: 3px 4px;
    border-radius: 0 0 4px 4px;
    text-transform: uppercase;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.eve-member-dashboard .alt-badge {
    position: absolute;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    background: #9b59b6;
    color: #fff;
    font-size: 8px;
    padding: 3px 4px;
    border-radius: 0 0 4px 4px;
    text-transform: uppercase;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.character-corp {
    font-size: 10px;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.remove-character-btn {
    position: absolute;
    bottom: 50%;
    right: 8px;
    transform: translateY(50%);
    background: #dc3545;
    color: #fff;
    border: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 11px;
    line-height: 1;
    z-index: 20;
}

.character-list-item:hover .remove-character-btn {
    opacity: 1;
}

.remove-character-btn:hover {
    background: #c82333;
}

/* Add Character Section */
.add-character-section {
    display: flex;
}

.add-character-section .button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 14px;
}

.add-character-section .button .dashicons {
    font-size: 18px;
}

.button-block {
    width: 100%;
    text-align: center;
    padding: 12px;
    font-weight: 600;
}

/* Main Panel */
.dashboard-main {
    background: #21252b;
    border-radius: 8px;
    padding: 30px;
}

/* Character Details */
.character-details-panel {
}

.character-header-section {
    display: flex;
    gap: 25px;
    margin-bottom: 25px;
    padding-bottom: 0;
    border-bottom: none;
}

.character-portrait-large img {
    width: 180px;
    height: 180px;
    border-radius: 8px;
    border: 3px solid #3a3f48;
}

.character-header-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.character-header-info h2 {
    margin: 0 0 15px 0;
    font-size: 36px;
    font-weight: 700;
    color: #fff;
}

.affiliation {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 16px;
    color: #d0d0d0;
}

.corp-logo,
.alliance-logo {
    width: 32px;
    height: 32px;
    border-radius: 4px;
}

.verification-badge-large {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: bold;
    margin-top: 15px;
    font-size: 14px;
    text-transform: uppercase;
}

.verification-badge-large.clean {
    background: #28a745;
    color: #fff;
}

.verification-badge-large.minor {
    background: #ffc107;
    color: #333;
}

.verification-badge-large.moderate {
    background: #ff9800;
    color: #fff;
}

.verification-badge-large.severe {
    background: #dc3545;
    color: #fff;
}

/* Alt Characters Section */
.alt-characters-section {
    margin-top: 30px;
    margin-bottom: 30px;
    padding: 20px;
    background: #1e2329;
    border-radius: 8px;
}

.alt-characters-section h3 {
    color: #fff;
    margin: 0 0 15px 0;
    font-size: 18px;
}

/* Add Character Button */
.eve-btn {
    background: #5a9de8;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none !important;
}

.eve-btn:hover {
    background: #4a8dd8;
    text-decoration: none !important;
}

.eve-btn-primary {
    background: #5a9de8;
}

.eve-btn-primary:hover {
    background: #4a8dd8;
}

.alt-characters-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.alt-character-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0px 5px;
    border-color: #9b59b6;
    border-radius: 6px;
    text-decoration: none !important;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    min-width: 200px;
    position: relative;
}

.alt-character-card:hover {
    background: #333a45;
    border-color: #9b59b6;
    text-decoration: none !important;
}

.alt-character-card.active {
    border-color: #9b59b6;
    background: #333a45;
}

/* Primary Character Card - Blue Styling */
.alt-character-card.primary-character-card {
    border: 3px solid transparent;
}

.alt-character-card.primary-character-card:hover {
    border-color: #3a7bc8;
}

.alt-character-card.primary-character-card.active {
    border-color: #3a7bc8;
}

.alt-character-card.primary-character-card .alt-character-portrait img {
    border: 2px solid #3a7bc8 !important;
}

/* Remove Character Button on Cards */
.remove-character-card-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    transform: none;
    background: #dc3545;
    color: #fff;
    border: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 16px;
    line-height: 1;
    padding: 0;
    z-index: 10;
}

.alt-character-card:hover .remove-character-card-btn {
    opacity: 1;
}

.remove-character-card-btn:hover {
    background: #c82333;
}

.alt-character-portrait {
    flex-shrink: 0;
}

.alt-character-portrait img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #9b59b6 !important;
}

.alt-character-info {
    flex: 1;
}

.alt-character-name {
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
}

.alt-character-corp {
    color: #b0b0b0;
    font-size: 11px;
}

/* Stats Tabs */
.eve-member-dashboard .stats-tabs {
    margin-top: 30px;
}

.eve-member-dashboard .tab-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: none;
    padding-bottom: 0;
}

.eve-member-dashboard .tab-btn {
    background: #2a2f38;
    border: 1px solid #3a3f48;
    border-radius: 999px;
    color: #9ca3af;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.eve-member-dashboard .tab-btn:hover {
    color: #fff;
    background: #333a45;
    border-color: #5a9de8;
}

.eve-member-dashboard .tab-btn.active {
    color: #fff;
    background: #5a9de8;
    border-color: #5a9de8;
}

.eve-member-dashboard .tab-content {
    display: none;
    padding: 20px 0;
}

.eve-member-dashboard .tab-content.active {
    display: block;
}

/* Overview Grid - 2x2 layout */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.overview-card {
    background: #1e2329;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid #5a9de8;
}

.overview-card.pvp-card {
    border-left-color: #dc3545;
}

.overview-card.pve-card {
    border-left-color: #28a745;
}

.overview-card.mining-card {
    border-left-color: #ff9800;
}

.overview-card.industry-card {
    border-left-color: #9333ea;
}

.overview-card h3 {
    margin: 0 0 20px 0;
    font-size: 16px;
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.overview-card.pvp-card h3 {

}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.stat-row span {
    color: #9ca3af;
    font-size: 13px;
}

.stat-row strong {
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

/* Detailed Stats Grid */
.detailed-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.stat-box {
    background: #2a2f38;
    border-radius: 6px;
    padding: 20px;
    text-align: center;
}

.stat-box .label {
    display: block;
    color: #b0b0b0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    font-weight: 600;
}

.stat-box .value {
    display: block;
    color: #fff;
    font-size: 24px;
    font-weight: bold;
}

/* Period Selector */
.stats-period-selector {
    margin-bottom: 20px;
}

.stats-period-selector select {
    background: #2a2f38;
    color: #fff;
    border: 1px solid #3a3f48;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

/* Favorite Info */
.favorite-info {
    background: #2a2f38;
    border-radius: 6px;
    padding: 15px;
    margin-top: 20px;
}

.favorite-info h4 {
    margin: 0 0 10px 0;
    color: #fff;
    font-size: 16px;
}

.favorite-info p {
    margin: 0;
    color: #d0d0d0;
}

/* Character Stats Grid */
.eve-member-dashboard {
    background-color: #000000 !important;
}

.eve-member-dashboard .character-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.eve-member-dashboard .stat-card {
    background: #2a2f38;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.eve-member-dashboard .stat-label {
    display: block;
    color: #b0b0b0;
    font-size: 12px;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.eve-member-dashboard .stat-value {
    display: block;
    color: #fff;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
}

.eve-member-dashboard .stat-sub {
    display: block;
    color: #9ca3af;
    font-size: 12px;
}

/* Status Pills */
.eve-member-dashboard .character-status-pills {
    display: flex;
    gap: 8px;
    margin-top: 0;
    flex-wrap: wrap;
}

.eve-member-dashboard .status-pill {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-size: 13px;
    color: #b0b0b0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.eve-member-dashboard .status-pill.is-online {
    background: rgba(40, 167, 69, 0.15);
    color: #28a745;
    border-color: rgba(40, 167, 69, 0.3);
}

.eve-member-dashboard .status-pill.is-offline {
    background: rgba(108, 117, 125, 0.15);
    color: #9ca3af;
    border-color: rgba(108, 117, 125, 0.3);
}

/* Data Tables */
.eve-member-dashboard .data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    background: #2a2f38;
    border-radius: 8px;
    overflow: hidden;
}

.eve-member-dashboard .data-table thead {
    background: #21252b;
}

.eve-member-dashboard .data-table th {
    color: #fff;
    font-weight: 600;
    text-align: left;
    padding: 12px;
    border-bottom: 2px solid #3a3f48;
}

.eve-member-dashboard .data-table td {
    padding: 12px;
    border-bottom: 1px solid #3a3f48;
    color: #d0d0d0;
}

.eve-member-dashboard .data-table tbody tr:last-child td {
    border-bottom: none;
}

.eve-member-dashboard .data-table tbody tr:hover {
    background: #323842;
}

/* Tab Content Sections */
.eve-member-dashboard .no-data {
    color: #9ca3af;
    font-style: italic;
    padding: 20px;
    text-align: center;
}

.eve-member-dashboard .skills-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.eve-member-dashboard .skills-list li {
    padding: 10px;
    background: #2a2f38;
    border-radius: 4px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.eve-member-dashboard .skill-name {
    color: #fff;
    font-weight: 500;
}

.eve-member-dashboard .skill-level {
    color: #5a9de8;
    font-weight: 600;
}

.eve-member-dashboard .skill-sp {
    color: #9ca3af;
    font-size: 12px;
}

.eve-member-dashboard .implants-list {
    list-style: none;
    padding: 0;
}

.eve-member-dashboard .implants-list li {
    padding: 8px;
    background: #2a2f38;
    border-radius: 4px;
    margin-bottom: 5px;
    color: #d0d0d0;
}

.eve-member-dashboard .badge-buy {
    background: #28a745;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.eve-member-dashboard .badge-sell {
    background: #dc3545;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.eve-member-dashboard .verification-clean {
    color: #28a745;
}

.eve-member-dashboard .verification-minor {
    color: #ffc107;
}

.eve-member-dashboard .verification-moderate {
    color: #ff9800;
}

.eve-member-dashboard .verification-severe {
    color: #dc3545;
}

/* Verification Detail */
.verification-detail {
    background: #2a2f38;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid #5a9de8;
}

.verification-detail.clean {
    border-left-color: #28a745;
}

.verification-detail.minor {
    border-left-color: #ffc107;
}

.verification-detail.moderate {
    border-left-color: #ff9800;
}

.verification-detail.severe {
    border-left-color: #dc3545;
}

.verification-detail h3 {
    margin: 0 0 15px 0;
    color: #fff;
}

.verification-detail h4 {
    margin: 15px 0 10px 0;
    color: #fff;
}

.verification-detail ul {
    list-style: none;
    padding: 0;
}

.verification-detail li {
    padding: 8px 0;
    border-bottom: 1px solid #3a3f48;
    color: #d0d0d0;
}

/* No Character State */
.eve-member-dashboard.no-character {
    text-align: center;
    padding: 60px 20px;
}

.no-character-message {
    max-width: 500px;
    margin: 0 auto;
}

.eve-logo {
    width: 150px;
    height: auto;
    margin-bottom: 30px;
}

.no-character-message h2 {
    color: #fff;
    margin-bottom: 20px;
}

.no-character-message p {
    color: #b0b0b0;
    font-size: 16px;
    margin-bottom: 15px;
}

.no-character-message .error {
    color: #dc3545;
    font-weight: 600;
}

/* Buttons */
.button {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 14px;
}

.button-primary {
    background: #5a9de8;
    color: #fff;
}

.button-primary:hover {
    background: #4a8dd8;
}

.button-secondary {
    background: #6c757d;
    color: #fff;
}

.button-secondary:hover {
    background: #5a6268;
}

.button-large {
    padding: 15px 30px;
    font-size: 16px;
}

.dashicons {
    vertical-align: middle;
    width: 18px;
    height: 18px;
}

/* Login State */
.eve-member-dashboard-login {
    text-align: center;
    padding: 60px 20px;
    background: #21252b;
    border-radius: 8px;
}

.eve-member-dashboard-login h2 {
    color: #fff;
    margin-bottom: 15px;
}

.eve-member-dashboard-login p {
    color: #b0b0b0;
    margin-bottom: 20px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .dashboard-content {
        grid-template-columns: 220px 1fr;
    }
}

@media (max-width: 1024px) {
    .dashboard-content {
        grid-template-columns: 1fr;
    }

    .dashboard-sidebar {
        order: 2;
        margin-top: 20px;
    }

    .dashboard-main {
        order: 1;
    }

    .character-header-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    /* Keep overview cards in 2x2 grid on tablet landscape */
    .overview-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .dashboard-header h1 {
        font-size: 28px;
    }

    .character-switcher {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .character-switcher select {
        width: 100%;
    }

    .add-character-section {
        width: 100%;
        margin-top: 10px;
    }

    .dashboard-content {
        grid-template-columns: 1fr;
    }

    .dashboard-sidebar {
        order: 2;
    }

    .dashboard-main {
        order: 1;
        padding: 20px;
    }

    /* Stack overview cards on mobile */
    .overview-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .detailed-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .character-portrait-large img {
        width: 150px;
        height: 150px;
    }

    .character-header-info h2 {
        font-size: 28px;
    }

    .character-stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .eve-member-dashboard {
        padding: 10px;
    }

    .dashboard-main {
        padding: 15px;
    }

    .dashboard-header h1 {
        font-size: 22px;
    }

    .header-right {
        width: 100%;
    }

    .detailed-stats-grid {
        grid-template-columns: 1fr;
    }

    .character-stats-grid {
        grid-template-columns: 1fr;
    }

    .tab-nav {
        flex-wrap: wrap;
        gap: 6px;
    }

    .tab-btn {
        padding: 5px 10px;
        font-size: 11px;
    }

    .character-portrait-large img {
        width: 120px;
        height: 120px;
    }

    .overview-card {
        padding: 15px;
    }

    .overview-card h3 {
        font-size: 14px;
    }

    .stat-row {
        padding: 8px 0;
    }
}

/* --- Theme Template Layout Overrides --- */
.eve-member-dashboard.theme-layout {
    background: transparent;
    color: var(--text-secondary, #d7dbe7);
    padding: 0;
    margin: 40px 0;
    font-family: inherit;
}

.members-content .eve-member-dashboard.theme-layout .dashboard-header,
.members-content .eve-member-dashboard.theme-layout .dashboard-sidebar,
.members-content .eve-member-dashboard.theme-layout .dashboard-main {
    background: var(--bg-card, rgba(10, 12, 18, 0.85));
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.eve-member-dashboard.theme-layout .dashboard-header {
    border-radius: 16px;
    padding: 24px 32px;
    border-bottom: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.eve-member-dashboard.theme-layout .dashboard-header h1 {
    font-size: 36px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-primary, #fff);
    margin: 0;
}

.eve-member-dashboard.theme-layout .character-switcher label {
    color: var(--text-muted, #9ca3af);
}

.eve-member-dashboard.theme-layout .character-switcher select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary, #fff);
    border-radius: 999px;
    min-width: 220px;
}

.eve-member-dashboard.theme-layout .dashboard-content {
    margin-top: 24px;
    gap: 24px;
}

.eve-member-dashboard.theme-layout .dashboard-sidebar,
.eve-member-dashboard.theme-layout .dashboard-main {
    border-radius: 18px;
    padding: 24px;
}

.eve-member-dashboard.theme-layout .character-list-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
}

.eve-member-dashboard.theme-layout .character-list-item.active {
    background: linear-gradient(135deg, var(--accent-blue, #54acfa), var(--accent-cyan, #00d4ff));
    box-shadow: 0 10px 30px rgba(84, 172, 250, 0.3);
}

.eve-member-dashboard.theme-layout .character-name {
    font-size: 15px;
    letter-spacing: 0.03em;
}

.eve-member-dashboard.theme-layout .character-meta {
    color: var(--text-muted, rgba(255, 255, 255, 0.6));
}

.eve-member-dashboard.theme-layout .dashboard-main h2 {
    color: var(--text-primary, #fff);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.eve-member-dashboard.theme-layout .overview-grid .stat-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
}

.eve-member-dashboard.theme-layout .stat-card h4 {
    color: var(--text-muted, rgba(255, 255, 255, 0.7));
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.08em;
}

.eve-member-dashboard.theme-layout .stat-card .stat-value {
    font-size: 32px;
    color: var(--text-primary, #fff);
}

.eve-member-dashboard.theme-layout .tab-panel {
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.01);
}

.eve-member-dashboard.theme-layout .tab-btn {
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary, #fff);
    background: transparent;
}

.eve-member-dashboard.theme-layout .tab-btn.active {
    background: linear-gradient(135deg, var(--accent-blue, #54acfa), var(--accent-cyan, #00d4ff));
    border-color: transparent;
    color: #0b1220;
    font-weight: 600;
}

.eve-member-dashboard.theme-layout .skill-progress .progress-bar {
    background: rgba(255, 255, 255, 0.08);
}

.eve-member-dashboard.theme-layout .skill-progress .progress-fill {
    background: linear-gradient(90deg, var(--accent-blue, #54acfa), var(--accent-cyan, #00d4ff));
}

.eve-member-dashboard.theme-layout .detailed-stats-grid .stat-section,
.eve-member-dashboard.theme-layout .wallet-panel,
.eve-member-dashboard.theme-layout .mail-panel {
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.02);
}

.eve-member-dashboard.theme-layout .wallet-panel h3,
.eve-member-dashboard.theme-layout .mail-panel h3,
.eve-member-dashboard.theme-layout .contracts-panel h3 {
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-primary, #fff);
}

.eve-member-dashboard.theme-layout .button.button-primary {
    border-radius: 999px;
    padding: 10px 24px;
    background: linear-gradient(135deg, var(--accent-blue, #54acfa), var(--accent-cyan, #00d4ff));
    border: none;
    color: #080c14;
    font-weight: 600;
}

.eve-member-dashboard.theme-layout .button.button-secondary {
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: transparent;
    color: var(--text-primary, #fff);
}

.eve-member-dashboard.theme-layout .eve-mail-modal__dialog {
    background: var(--bg-card, rgba(4, 6, 12, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.eve-member-dashboard-login.theme-layout {
    background: var(--bg-card, rgba(14, 16, 24, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 40px;
}

/* ==============================================
   NEW TABS - Skills, Mining, Fittings, PI
   ============================================== */

/* Skills Tab */
.skills-content {
    padding: 10px 0;
}

.skills-summary {
    background: #21252b;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #2a2f38;
}

.skills-summary h3 {
    margin: 0 0 15px 0;
    color: #fff;
    font-size: 16px;
}

.summary-stats {
    display: flex;
    gap: 30px;
}

.summary-stat {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.summary-stat .stat-label {
    font-size: 12px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-stat strong {
    font-size: 20px;
    color: #5a9de8;
}

.skill-category {
    background: #21252b;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 10px;
    border: 1px solid #2a2f38;
}

.skill-category h4 {
    margin: 0 0 12px 0;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #2a2f38;
    padding-bottom: 10px;
}

.skill-category .category-meta {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 400;
}

.skill-category .skills-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 8px;
}

.skill-category .skills-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: #2a2f38;
    border-radius: 4px;
    font-size: 12px;
}

.skill-category .skills-list .skill-name {
    color: #e8e8e8;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.skill-category .skills-list .skill-level {
    color: #5a9de8;
    font-weight: 600;
    margin: 0 10px;
    white-space: nowrap;
}

.skill-category .skills-list .skill-sp {
    color: #9ca3af;
    font-size: 11px;
    white-space: nowrap;
}

/* Untrained skills styling (grayed out) */
.skill-category .skills-list li.skill-untrained {
    opacity: 0.4;
    background: rgba(255, 255, 255, 0.02);
}

.skill-category .skills-list li.skill-untrained .skill-name {
    color: #6b7280;
    font-weight: 400;
}

.skill-category .skills-list li.skill-untrained .skill-level {
    color: #6b7280;
    font-weight: 400;
}

.skill-category .skills-list li.skill-untrained .skill-sp {
    color: #6b7280;
}

/* Trained skills styling (normal) */
.skill-category .skills-list li.skill-trained {
    background: inherit;
}

/* Mining Tab */
.mining-content {
    padding: 10px 0;
}

.mining-content h3 {
    margin: 0 0 15px 0;
    color: #fff;
    font-size: 16px;
}

/* Fittings Tab */
.fittings-content {
    padding: 10px 0;
}

.fittings-content h3 {
    margin: 0 0 15px 0;
    color: #fff;
    font-size: 16px;
}

/* PI Tab */
.pi-content {
    padding: 10px 0;
}

.pi-content h3 {
    margin: 0 0 15px 0;
    color: #fff;
    font-size: 16px;
}

.pi-content h3:not(:first-child) {
    margin-top: 25px;
}

/* Responsive for new tabs */
@media (max-width: 768px) {
    .summary-stats {
        flex-direction: column;
        gap: 15px;
    }

    .skill-category .skills-list {
        grid-template-columns: 1fr;
    }

    .skill-category .skills-list li {
        flex-wrap: wrap;
    }

    .skill-category .skills-list .skill-name {
        flex: 1 1 100%;
        margin-bottom: 5px;
    }

    .mining-content .data-table,
    .fittings-content .data-table,
    .pi-content .data-table {
        font-size: 12px;
    }

    .mining-content .data-table th,
    .mining-content .data-table td,
    .fittings-content .data-table th,
    .fittings-content .data-table td,
    .pi-content .data-table th,
    .pi-content .data-table td {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .skill-category {
        padding: 12px 15px;
    }

    .skill-category h4 {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .summary-stat strong {
        font-size: 18px;
    }
}

/* ==============================================
   SHOW MORE / PAGINATION
   ============================================== */

.eve-member-dashboard .eve-section-header,
.eve-member-dashboard .mail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.eve-member-dashboard .eve-section-header h3,
.eve-member-dashboard .mail-header h3 {
    margin: 0;
    color: #fff;
    font-size: 16px;
}

.show-more-toggle {
    background: #2a2f38;
    border: 1px solid #3a3f48;
    color: #5a9de8;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.show-more-toggle:hover {
    background: #333a45;
    border-color: #5a9de8;
}

.show-more-toggle.expanded {
    background: #5a9de8;
    color: #fff;
    border-color: #5a9de8;
}

.hidden-row {
    display: none;
}

/* ==============================================
   MAIL ITEMS & MODAL
   ============================================== */

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

.mail-item {
    background: #21252b;
    border: 1px solid #2a2f38;
    border-radius: 8px;
    padding: 15px;
    transition: border-color 0.2s;
}

.mail-item:hover {
    border-color: #3a3f48;
}

.mail-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.mail-item-info {
    flex: 1;
    min-width: 0;
}

.mail-subject {
    font-weight: 600;
    font-size: 14px;
    color: #fff;
    display: block;
    margin-bottom: 4px;
}

.mail-meta {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 8px;
}

.mail-preview {
    font-size: 13px;
    color: #b0b0b0;
    margin: 0;
    line-height: 1.4;
}

.mail-actions {
    flex-shrink: 0;
}

.mail-read-btn {
    background: #5a9de8;
    border: none;
    color: #fff;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.mail-read-btn:hover {
    background: #4a8dd8;
}

.mail-template {
    display: none;
}

/* Mail Modal */
.eve-mail-modal {
    position: fixed;
    top: 120px; /* Account for fixed header */
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.eve-mail-modal-dialog {
    background: #1a1d23;
    border: 1px solid #3a3f48;
    border-radius: 12px;
    width: 100%;
    max-width: 700px;
    max-height: calc(100vh - 180px); /* Account for header + padding */
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.eve-mail-modal-header {
    display: flex;
    justify-content: flex-end;
    padding: 15px 20px;
    border-bottom: 1px solid #2a2f38;
}

.eve-mail-modal-close {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.eve-mail-modal-close:hover {
    color: #fff;
}

.eve-mail-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.eve-mail-modal-body header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #2a2f38;
}

.eve-mail-modal-body header h2 {
    margin: 0 0 8px 0;
    color: #fff;
    font-size: 20px;
}

.eve-mail-modal-body .mail-template-meta {
    margin: 0;
    color: #9ca3af;
    font-size: 13px;
}

.eve-mail-modal-body .mail-body-content {
    color: #e8e8e8;
    font-size: 14px;
    line-height: 1.6;
}

.eve-mail-modal-body .mail-body-content p {
    margin: 0 0 12px 0;
}

.eve-mail-modal-body .mail-body-content a {
    color: #5a9de8;
}

/* Mail Count */
.mail-count {
    font-size: 14px;
    color: #8b949e;
}

/* ==============================================
   MAIL FOLDER TABS
   ============================================== */

.mail-folder-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    border-bottom: 1px solid #3a3f48;
    padding-bottom: 15px;
}

.mail-folder-tab {
    background: #2a2f38;
    border: 1px solid #3a3f48;
    border-radius: 6px;
    color: #9ca3af;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mail-folder-tab:hover {
    background: #333a45;
    border-color: #5a9de8;
    color: #fff;
}

.mail-folder-tab.active {
    background: #5a9de8;
    border-color: #5a9de8;
    color: #fff;
}

.mail-folder-tab .folder-count {
    font-size: 11px;
    opacity: 0.8;
}

.mail-folder-content {
    display: none;
}

.mail-folder-content.active {
    display: block;
}

/* Mail Pagination */
.mail-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
}

.pagination-pages {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #c9d1d9;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    min-width: 40px;
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.pagination-btn.active {
    background: #238636;
    border-color: #238636;
    color: #fff;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-prev,
.pagination-next {
    min-width: 80px;
}

/* Hidden mail items for pagination */
.mail-page-item.hidden {
    display: none;
}

/* =====================================================
   WALLET TAB STYLES
   ===================================================== */

.wallet-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.wallet-section {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    padding: 20px;
}

.wallet-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.wallet-section-header h3 {
    margin: 0;
    color: #e6edf3;
    font-size: 16px;
    font-weight: 600;
}

.wallet-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.wallet-search {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 8px 12px;
    color: #c9d1d9;
    font-size: 13px;
    min-width: 180px;
    transition: border-color 0.2s, background 0.2s;
}

.wallet-search::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.wallet-search:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

.wallet-filter {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 8px 12px;
    color: #c9d1d9;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.wallet-filter:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
}

.wallet-filter option {
    background: #21262d;
    color: #c9d1d9;
}

/* Wallet Export Button */
.wallet-export-btn {
    background: rgba(35, 134, 54, 0.2);
    border: 1px solid rgba(35, 134, 54, 0.4);
    border-radius: 6px;
    padding: 8px 12px;
    color: #3fb950;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wallet-export-btn:hover {
    background: rgba(35, 134, 54, 0.3);
    border-color: rgba(35, 134, 54, 0.6);
    color: #56d364;
}

.wallet-export-btn:active {
    transform: scale(0.95);
}

.wallet-export-btn svg {
    width: 16px;
    height: 16px;
}

/* Wallet Table */
.wallet-paginated-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.wallet-paginated-table thead th {
    text-align: left;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: #8b949e;
}

.wallet-paginated-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #c9d1d9;
    font-size: 13px;
}

.wallet-paginated-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.wallet-paginated-table tbody tr.hidden {
    display: none;
}

/* Wallet Pagination */
.wallet-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
}

/* Wallet Page Info */
.wallet-page-info {
    text-align: center;
    color: #8b949e;
    font-size: 12px;
    padding: 5px 0;
}

/* Responsive Wallet */
@media (max-width: 768px) {
    .wallet-section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .wallet-controls {
        width: 100%;
    }

    .wallet-search {
        flex: 1;
        min-width: 120px;
    }

    .wallet-filter {
        min-width: 80px;
    }

    .wallet-paginated-table {
        font-size: 12px;
    }

    .wallet-paginated-table thead th,
    .wallet-paginated-table tbody td {
        padding: 8px 6px;
    }
}

@media (max-width: 480px) {
    .wallet-controls {
        flex-direction: column;
    }

    .wallet-search,
    .wallet-filter {
        width: 100%;
    }
}

/* =====================================================
   CONTRACTS TAB STYLES
   ===================================================== */

.contracts-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contracts-section {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    padding: 20px;
}

.contracts-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.contracts-section-header h3 {
    margin: 0;
    color: #e6edf3;
    font-size: 16px;
    font-weight: 600;
}

.contracts-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.contracts-search {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 8px 12px;
    color: #c9d1d9;
    font-size: 13px;
    min-width: 160px;
    transition: border-color 0.2s, background 0.2s;
}

.contracts-search::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.contracts-search:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

.contracts-filter {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 8px 12px;
    color: #c9d1d9;
    font-size: 13px;
    cursor: pointer;
}

.contracts-filter:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
}

.contracts-filter option {
    background: #21262d;
    color: #c9d1d9;
}

/* Contracts Table */
.contracts-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.contracts-table thead th {
    text-align: left;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: #8b949e;
}

.contracts-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #c9d1d9;
    font-size: 13px;
}

.contracts-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.contracts-table tbody tr.hidden {
    display: none;
}

.contract-location {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Contract Type Badges */
.contract-type-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.contract-type-item_exchange {
    background: rgba(88, 166, 255, 0.2);
    color: #58a6ff;
}

.contract-type-courier {
    background: rgba(136, 87, 229, 0.2);
    color: #a371f7;
}

.contract-type-auction {
    background: rgba(255, 166, 87, 0.2);
    color: #ffa657;
}

/* Contract View Button */
.contract-view-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #c9d1d9;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.contract-view-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Contracts Pagination */
.contracts-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
}

/* Contracts Page Info */
.contracts-page-info {
    text-align: center;
    color: #8b949e;
    font-size: 12px;
    padding: 5px 0;
}

/* Contract Modal */
.contract-modal-overlay {
    display: none;
    position: fixed;
    top: 120px; /* Account for fixed header */
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.contract-modal-overlay.is-open {
    display: flex;
}

.contract-modal-dialog {
    background: #21262d;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 180px); /* Account for header + padding */
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.contract-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
}

.contract-modal-header h3 {
    margin: 0;
    color: #e6edf3;
    font-size: 16px;
}

.contract-modal-close {
    background: none;
    border: none;
    color: #8b949e;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.contract-modal-close:hover {
    color: #e6edf3;
}

.contract-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* Contract Detail Content */
.contract-detail-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contract-detail-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.contract-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.contract-status-outstanding {
    background: rgba(88, 166, 255, 0.2);
    color: #58a6ff;
}

.contract-status-finished {
    background: rgba(63, 185, 80, 0.2);
    color: #3fb950;
}

.contract-status-in_progress {
    background: rgba(255, 166, 87, 0.2);
    color: #ffa657;
}

.contract-status-deleted {
    background: rgba(248, 81, 73, 0.2);
    color: #f85149;
}

.contract-detail-title {
    color: #e6edf3;
    font-size: 14px;
    font-weight: 500;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
}

.contract-detail-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.contract-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.contract-detail-label {
    color: #8b949e;
    font-size: 13px;
}

.contract-detail-value {
    color: #e6edf3;
    font-size: 13px;
    text-align: right;
    word-break: break-word;
    max-width: 60%;
}

/* Contract Items Section */
.contract-items-section {
    margin-top: 10px;
}

.contract-items-section h4 {
    margin: 0 0 10px 0;
    color: #e6edf3;
    font-size: 14px;
    font-weight: 600;
}

.contract-items-list {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    padding: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.contract-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.contract-item:last-child {
    border-bottom: none;
}

.contract-item-name {
    color: #c9d1d9;
    font-size: 13px;
}

.contract-item-qty {
    color: #8b949e;
    font-size: 13px;
    font-weight: 500;
}

/* Responsive Contracts */
@media (max-width: 768px) {
    .contracts-section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .contracts-controls {
        width: 100%;
    }

    .contracts-search {
        flex: 1;
        min-width: 100px;
    }

    .contracts-table {
        font-size: 12px;
    }

    .contracts-table thead th,
    .contracts-table tbody td {
        padding: 8px 6px;
    }

    .contract-modal-dialog {
        max-height: calc(100vh - 160px);
    }
}

@media (max-width: 480px) {
    .contracts-controls {
        flex-direction: column;
    }

    .contracts-search,
    .contracts-filter {
        width: 100%;
    }

    .contract-modal-overlay {
        top: 100px; /* Smaller header on mobile */
        padding: 10px;
    }

    .contract-modal-dialog {
        max-height: calc(100vh - 140px);
        max-width: 100%;
    }
}

/* Responsive for mail */
@media (max-width: 768px) {
    .mail-item-header {
        flex-direction: column;
        gap: 10px;
    }

    .mail-actions {
        width: 100%;
    }

    .mail-read-btn {
        width: 100%;
    }

    .eve-mail-modal-dialog {
        max-height: calc(100vh - 160px);
    }
}

@media (max-width: 480px) {
    .eve-mail-modal {
        top: 100px; /* Smaller header on mobile */
        padding: 10px;
    }

    .eve-mail-modal-dialog {
        max-height: calc(100vh - 140px);
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .section-header,
    .mail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .show-more-toggle {
        width: 100%;
        text-align: center;
    }
}

/* Scope Status Styling */
.scope-warning-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ff9800;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.scope-warning-badge .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.character-info .scope-status {
    margin-top: 4px;
}

.character-info .scope-warning {
    color: #ff9800;
    font-size: 11px;
    font-weight: 500;
}

/* Scope Status Alert */
.scope-status-alert {
    background: #2a2f38;
    border: 1px solid #ff9800;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.scope-status-alert .alert-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.scope-status-alert .alert-header .dashicons {
    color: #ff9800;
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.scope-status-alert .alert-header h3 {
    margin: 0;
    color: #ff9800;
    font-size: 18px;
}

.scope-status-alert p {
    color: #e8e8e8;
    margin: 0 0 15px 0;
}

.scope-status-alert .button {
    background: #ff9800;
    border-color: #ff9800;
    color: #fff;
    padding: 8px 20px;
    font-weight: 600;
}

.scope-status-alert .button:hover {
    background: #f57c00;
    border-color: #f57c00;
}

.scope-status-alert details {
    background: #1a1d23;
    border-radius: 4px;
    padding: 10px;
}

.scope-status-alert details summary {
    font-weight: 500;
    color: #b0b0b0;
}

.scope-status-alert details ul {
    margin: 10px 0;
}

.scope-status-alert details li {
    color: #9ca3af;
    margin: 4px 0;
}

/* Scope Update Message */
.scope-update-message {
    padding: 12px 20px;
    border-radius: 6px;
    margin: 15px 0;
    font-weight: 500;
}

.scope-update-message.success {
    background: #4caf50;
    color: #fff;
}

.scope-update-message.error {
    background: #f44336;
    color: #fff;
}

/* ========================================
   ASSETS - Location Groups & Compact Tables
   ======================================== */

/* Assets Summary Bar */
.assets-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 12px 16px;
    background: #2a2d35;
    border-radius: 6px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.assets-summary .summary-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.assets-summary .summary-item {
    color: #9ca3af;
    font-size: 13px;
}

.assets-summary .summary-item strong {
    color: #4fc3f7;
}

/* Asset Search */
.assets-search-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    position: relative;
}

.assets-search-inner {
    position: relative;
    display: flex;
    align-items: center;
}

.assets-search-input {
    padding: 8px 32px 8px 12px;
    border: 1px solid #3a3d45;
    border-radius: 4px;
    font-size: 13px;
    width: 220px;
    background: #1a1d23;
    color: #e8e8e8;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.assets-search-input:focus {
    outline: none;
    border-color: #4fc3f7;
    box-shadow: 0 0 0 2px rgba(79, 195, 247, 0.15);
}

.assets-search-input::placeholder {
    color: #6b7280;
}

.assets-search-icon {
    position: absolute;
    right: 10px;
    font-size: 14px;
    pointer-events: none;
    opacity: 0.5;
}

.assets-search-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #9ca3af;
    padding: 4px;
    line-height: 1;
    border-radius: 3px;
}

.assets-search-clear:hover {
    background: #3a3d45;
    color: #e8e8e8;
}

.assets-search-results {
    font-size: 11px;
    color: #4fc3f7;
    white-space: nowrap;
    text-align: right;
}

/* Search highlight */
.asset-item-row.search-highlight td:first-child {
    background: rgba(255, 235, 59, 0.15);
}

/* Search match markers */
.search-match > .location-header,
.search-match > .hangar-header,
.search-match > .container-header {
    border-left: 3px solid #4fc3f7;
}

/* Force visibility when search expands elements */
.asset-location-group.search-match.expanded > .location-items {
    display: block !important;
}

.hangar-section.search-match.expanded > .hangar-content {
    display: block !important;
}

.container-section.search-match.expanded > .container-content {
    display: block !important;
}

/* Location Group Container */
.asset-location-group {
    margin-bottom: 8px;
    border: 1px solid #3a3d45;
    border-radius: 6px;
    overflow: hidden;
    background: #22252d;
}

/* Location Header (Clickable) */
.location-header {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: #2a2d35;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.location-header:hover {
    background: #32363f;
}

.location-header .expand-icon {
    font-size: 10px;
    color: #6b7280;
    margin-right: 10px;
    transition: transform 0.2s ease;
    width: 12px;
}

.asset-location-group.expanded .location-header .expand-icon {
    transform: rotate(90deg);
}

.location-header .location-name {
    flex: 1;
    font-weight: 500;
    color: #e8e8e8;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 15px;
}

.location-header .location-stats {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-shrink: 0;
}

.location-header .item-count {
    color: #9ca3af;
    font-size: 12px;
}

.location-header .location-value {
    color: #4caf50;
    font-weight: 600;
    font-size: 12px;
    min-width: 80px;
    text-align: right;
}

/* Location Items Container (Hidden by default) */
.location-items {
    display: none;
    padding: 0;
    border-top: 1px solid #3a3d45;
}

.asset-location-group.expanded .location-items {
    display: block;
}

/* Inaccessible Structure Styling */
.asset-location-group.inaccessible .location-header {
    background: #3d3520;
}

.asset-location-group.inaccessible .location-header:hover {
    background: #4a4025;
}

.inaccessible-badge {
    color: #ffc107;
    margin-right: 6px;
}

/* Hangar Section (Second level) */
.hangar-section {
    border-bottom: 1px solid #2a2d35;
}

.hangar-section:last-child {
    border-bottom: none;
}

.hangar-header {
    display: flex;
    align-items: center;
    padding: 8px 14px 8px 28px;
    background: #262930;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.hangar-header:hover {
    background: #2e3138;
}

.hangar-header .expand-icon {
    font-size: 9px;
    color: #6b7280;
    margin-right: 8px;
    transition: transform 0.2s ease;
    width: 10px;
}

.hangar-section.expanded .hangar-header .expand-icon {
    transform: rotate(90deg);
}

.hangar-header .hangar-icon {
    margin-right: 6px;
    font-size: 12px;
}

.hangar-header .hangar-icon.ship-icon {
    color: #64b5f6;
}

.hangar-header .hangar-icon.item-icon {
    color: #a1887f;
}

.hangar-header .hangar-name {
    flex: 1;
    font-weight: 500;
    color: #c8c8c8;
    font-size: 12px;
}

/* Ship Hangar styling */
.hangar-section.ship-hangar .hangar-header {
    background: #1e2a38;
}

.hangar-section.ship-hangar .hangar-header:hover {
    background: #263545;
}

.hangar-header .hangar-stats {
    display: flex;
    gap: 12px;
    align-items: center;
}

.hangar-header .item-count {
    color: #8b949e;
    font-size: 11px;
}

.hangar-header .hangar-value {
    color: #4caf50;
    font-weight: 600;
    font-size: 11px;
    min-width: 70px;
    text-align: right;
}

.hangar-content {
    display: none;
    background: #1e2128;
}

.hangar-section.expanded .hangar-content {
    display: block;
}

/* Container Section (Ships/Containers - Third level) */
.container-section {
    border-bottom: 1px solid #262930;
    margin-left: 14px;
}

.container-section:last-child {
    border-bottom: none;
}

.container-header {
    display: flex;
    align-items: center;
    padding: 6px 14px 6px 28px;
    background: #1a1d23;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.container-header:hover {
    background: #22252d;
}

.container-header .expand-icon {
    font-size: 8px;
    color: #6b7280;
    margin-right: 8px;
    transition: transform 0.2s ease;
    width: 10px;
}

.container-section.expanded .container-header .expand-icon {
    transform: rotate(90deg);
}

.container-header .container-name {
    flex: 1;
    font-size: 12px;
    color: #e8e8e8;
}

.container-header .container-name strong {
    color: #5a9de8;
}

.container-header .container-type {
    font-size: 11px;
    color: #8b949e;
    margin-left: 6px;
}

.container-header .container-stats {
    display: flex;
    gap: 10px;
    align-items: center;
}

.container-header .item-count {
    color: #6b7280;
    font-size: 10px;
}

.container-header .container-value {
    color: #4caf50;
    font-weight: 500;
    font-size: 11px;
    min-width: 60px;
    text-align: right;
}

.container-content {
    display: none;
    padding-left: 14px;
}

.container-section.expanded .container-content {
    display: block;
}

/* Loose Items Section */
.loose-items-section {
    padding: 0;
}

.loose-items-section .compact-table {
    margin: 0;
}

/* Compact Table Styles */
.compact-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.compact-table thead {
    background: #1a1d23;
}

.compact-table thead th {
    padding: 6px 10px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.5px;
    color: #9ca3af;
    border-bottom: 1px solid #3a3d45;
}

.compact-table tbody tr {
    border-bottom: 1px solid #2a2d35;
}

.compact-table tbody tr:last-child {
    border-bottom: none;
}

.compact-table tbody tr:hover {
    background: #2a2d35;
}

.compact-table tbody td {
    padding: 5px 10px;
    color: #d1d5db;
    line-height: 1.3;
}

.compact-table .text-right {
    text-align: right;
}

.compact-table tfoot {
    background: #1a1d23;
}

.compact-table tfoot td {
    padding: 6px 10px;
    border-top: 1px solid #3a3d45;
    color: #e8e8e8;
}

.compact-table .total-row td {
    font-size: 11px;
}

/* Responsive adjustments for assets */
@media (max-width: 768px) {
    .assets-summary {
        flex-direction: column;
        gap: 8px;
    }

    .location-header {
        flex-wrap: wrap;
    }

    .location-header .location-name {
        flex-basis: calc(100% - 30px);
        margin-bottom: 5px;
    }

    .location-header .location-stats {
        margin-left: 22px;
    }
}

/* =========================================
   Linked Characters Totals (Primary Only)
   ========================================= */
.linked-characters-totals {
    margin-bottom: 20px;
}

.linked-characters-totals .totals-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.linked-characters-totals .total-card {
    background: linear-gradient(135deg, #2a2f38 0%, #21252b 100%);
    border-radius: 10px;
    padding: 20px 20px;
    text-align: center;
    border: 1px solid #3a3f48;
    transition: all 0.3s ease;
}

.linked-characters-totals .total-card:hover {
    border-color: #5a9de8;
    box-shadow: 0 4px 15px rgba(90, 157, 232, 0.15);
}

/* Rank Card - Gold/Yellow Theme */
.linked-characters-totals .total-card.total-rank {
    background: linear-gradient(135deg, #3a351a 0%, #21252b 100%);
    border-color: #5a4a2d;
    position: relative;
}

.linked-characters-totals .total-card.total-rank:hover {
    border-color: #f3c969;
    box-shadow: 0 4px 15px rgba(243, 201, 105, 0.15);
    
}

/* Rank Header Row - Badge, Title, Next Badge */
.linked-characters-totals .rank-header-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;


}

.linked-characters-totals .total-card.total-rank .rank-badge-display {
    flex-shrink: 0;
}

.linked-characters-totals .total-card.total-rank .rank-badge-img {
    height: 50px;
    width: auto;
    margin: 0px;

}

.linked-characters-totals .rank-title-section {
    text-align: center;
    
  
}

.linked-characters-totals .rank-title-section .total-label {
    margin-bottom: 0;
 
}

.linked-characters-totals .total-card.total-rank .total-value.rank-name {
    font-size: 16px;
    color: #f3c969;
    margin-bottom: 0;
    line-height: 1.5;
}

.linked-characters-totals .rank-xp-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: -20px;
}

.linked-characters-totals .rank-next-icon {
    height: 18px;
    width: auto;
    opacity: 0.6;
    
}

/* XP Section */
.linked-characters-totals .rank-xp-section {
    text-align: center;
}

.linked-characters-totals .rank-xp-bar {
    height: 5px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 2px;
    margin-top: 5px;
}

.linked-characters-totals .rank-xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #75c3fe 0%, #4aa7f8 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.linked-characters-totals .rank-xp-progress-text {
    font-size: 9px;
    color: #9ca3af;
}

.linked-characters-totals .rank-xp-progress-text.rank-max {
    color: #ffd700;
    font-weight: 600;
    
}

/* Next Rank Badge */
.linked-characters-totals .rank-next-badge {
    flex-shrink: 0;
    text-align: center;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    
}

.linked-characters-totals .rank-next-badge:hover {
    opacity: 1;
}

.linked-characters-totals .rank-next-badge .next-rank-label {
    display: block;
    font-size: 8px;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 2px;
}

.linked-characters-totals .rank-next-badge .rank-badge-img-next {
    height: 35px;
    width: auto;
    filter: grayscale(50%);
    transition: filter 0.2s ease;
}

.linked-characters-totals .rank-next-badge:hover .rank-badge-img-next {
    filter: grayscale(0%);
}

/* View All Ranks Modal */
.linked-characters-totals .rank-modal-trigger {
    font-size: 9px;
    color: #f3c969;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    background: none;
    border: none;
    padding: 0;
    margin-top: 0;
    font-family: inherit;
    display: block;
    margin-top: -20px;
    
}

.linked-characters-totals .rank-modal-trigger:hover {
    color: #ffd700;
    text-align: center;
}

.linked-characters-totals .rank-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.linked-characters-totals .rank-modal-overlay.is-open {
    display: flex;
}

.linked-characters-totals .rank-modal-content {
    background: #1a1d23;
    border: 1px solid #3a3f48;
    border-radius: 12px;
    padding: 20px;
    width: 100%;
    max-width: 410px;
    max-height: 60vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.linked-characters-totals .rank-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.linked-characters-totals .rank-modal-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.linked-characters-totals .rank-modal-header {
    font-size: 16px;
    font-weight: 700;
    color: #699cf3;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #3a3f48;
    text-align: center;
}

.linked-characters-totals .rank-modal-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.linked-characters-totals .rank-modal-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.02);
    transition: background 0.2s ease;
}

.linked-characters-totals .rank-modal-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.linked-characters-totals .rank-modal-item.current-rank {
    background: rgba(243, 201, 105, 0.15);
    border: 1px solid #f3c969;
}

.linked-characters-totals .rank-modal-item.achieved-rank {
    opacity: 0.5;
}

.linked-characters-totals .rank-modal-badge {
    height: 36px;
    width: auto;
    flex-shrink: 0;
}

.linked-characters-totals .rank-modal-name {
    flex: 1;
    font-size: 13px;
    color: #e8e8e8;
}

.linked-characters-totals .rank-modal-item.current-rank .rank-modal-name {
    color: #f3c969;
    font-weight: 600;
}

.linked-characters-totals .rank-modal-xp {
    font-size: 11px;
    color: #6b7280;
    flex-shrink: 0;
}

/* ISK Card - Green Theme */
.linked-characters-totals .total-card.total-isk {
    background: linear-gradient(135deg, #1a3a2a 0%, #21252b 100%);
    border-color: #2d5a3d;
}

.linked-characters-totals .total-card.total-isk:hover {
    border-color: #4ade80;
    box-shadow: 0 4px 15px rgba(74, 222, 128, 0.15);
}

/* Skillpoints Card - Purple Theme */
.linked-characters-totals .total-card.total-skillpoints {
    background: linear-gradient(135deg, #2a2a4a 0%, #21252b 100%);
    border-color: #3d3d6a;
}

.linked-characters-totals .total-card.total-skillpoints:hover {
    border-color: #a78bfa;
    box-shadow: 0 4px 15px rgba(167, 139, 250, 0.15);
}

/* Assets Card - Blue Theme */
.linked-characters-totals .total-card.total-assets {
    background: linear-gradient(135deg, #1a2a3a 0%, #21252b 100%);
    border-color: #2d4a5a;
}

.linked-characters-totals .total-card.total-assets:hover {
    border-color: #5a9de8;
    box-shadow: 0 4px 15px rgba(90, 157, 232, 0.15);
}

.linked-characters-totals .total-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
    margin-bottom: 8px;
}

.linked-characters-totals .total-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.linked-characters-totals .total-card.total-isk .total-value {
    color: #4ade80;
}

.linked-characters-totals .total-card.total-skillpoints .total-value {
    color: #a78bfa;
}

.linked-characters-totals .total-card.total-assets .total-value {
    color: #5a9de8;
}

.linked-characters-totals .total-sub {
    display: block;
    font-size: 11px;
    color: #6b7280;
}

/* Responsive adjustments for totals */
@media (max-width: 1200px) {
    .linked-characters-totals .totals-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .linked-characters-totals .totals-grid {
        grid-template-columns: 1fr;
    }

    .linked-characters-totals .total-value {
        font-size: 22px;
    }

    .linked-characters-totals .total-card.total-rank .total-value.rank-name {
        font-size: 16px;
    }
}

/* ===========================
   CONTACTS TAB STYLES - MEMBER DASHBOARD
   =========================== */

.contacts-content {
    padding: 0;
}

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

.contacts-summary-member {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.contacts-summary-member .contact-count-total {
    font-weight: 600;
    color: #e5e7eb;
    font-size: 14px;
}

.contacts-summary-member .contact-stat {
    font-size: 12px;
    color: #9ca3af;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.contacts-controls-member {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.contacts-search-member,
.contacts-filter-member {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.05);
    color: #e5e7eb;
}

.contacts-search-member::placeholder {
    color: #6b7280;
}

.contacts-search-member {
    min-width: 180px;
}

.contacts-filter-member {
    min-width: 130px;
}

.contacts-filter-member option {
    background: #1f2937;
    color: #e5e7eb;
}

.contacts-table-member {
    width: 100%;
    border-collapse: collapse;
}

.contacts-table-member th,
.contacts-table-member td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.contacts-table-member th {
    background: rgba(255, 255, 255, 0.03);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    color: #9ca3af;
    letter-spacing: 0.5px;
}

.contacts-table-member tr.hidden {
    display: none;
}

.contacts-table-member .contact-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.contacts-table-member .contact-portrait {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    object-fit: cover;
}

.contacts-table-member .contact-name {
    font-weight: 500;
    color: #e5e7eb;
}

/* Contact Type Badges - Member */
.contacts-table-member .contact-type-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
}

.contacts-table-member .contact-type-character {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

.contacts-table-member .contact-type-corporation {
    background: rgba(251, 146, 60, 0.2);
    color: #fdba74;
}

.contacts-table-member .contact-type-alliance {
    background: rgba(167, 139, 250, 0.2);
    color: #c4b5fd;
}

.contacts-table-member .contact-type-faction {
    background: rgba(74, 222, 128, 0.2);
    color: #86efac;
}

/* Standing Badges - Member */
.contacts-table-member .standing-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    min-width: 40px;
    text-align: center;
}

.contacts-table-member .standing-excellent {
    background: rgba(22, 163, 74, 0.3);
    color: #4ade80;
}

.contacts-table-member .standing-good {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

.contacts-table-member .standing-neutral {
    background: rgba(156, 163, 175, 0.2);
    color: #d1d5db;
}

.contacts-table-member .standing-bad {
    background: rgba(251, 146, 60, 0.2);
    color: #fdba74;
}

.contacts-table-member .standing-terrible {
    background: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* Contact Status Badges - Member */
.contacts-table-member .contact-status-cell {
    display: flex;
    gap: 4px;
}

.contacts-table-member .contact-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.contacts-table-member .contact-status-badge.watched {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

.contacts-table-member .contact-status-badge.blocked {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.contacts-table-member .muted {
    color: #6b7280;
}

/* Contacts Pagination - Member */
.contacts-pagination-member {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.contacts-pagination-member .pagination-pages {
    display: flex;
    gap: 4px;
}

.contacts-pagination-member .pagination-btn {
    padding: 5px 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: #9ca3af;
    transition: all 0.2s;
}

.contacts-pagination-member .pagination-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    color: #e5e7eb;
}

.contacts-pagination-member .pagination-btn.active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

.contacts-pagination-member .pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.contacts-page-info-member {
    text-align: center;
    font-size: 12px;
    color: #6b7280;
    margin-top: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .contacts-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .contacts-controls-member {
        flex-direction: column;
        width: 100%;
    }

    .contacts-search-member,
    .contacts-filter-member {
        width: 100%;
    }

    .contacts-table-member th,
    .contacts-table-member td {
        padding: 8px 10px;
        font-size: 12px;
    }

    .contacts-table-member .contact-portrait {
        width: 24px;
        height: 24px;
    }
}

/* ===========================
   CONTRACT ENTITY PORTRAITS - MEMBER DASHBOARD
   =========================== */

.contracts-table .contract-entity-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.contracts-table .contract-entity-portrait {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.contract-detail-value.contract-entity-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.contract-detail-value .contract-entity-portrait {
    width: 24px;
    height: 24px;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .contracts-table .contract-entity-portrait {
        width: 24px;
        height: 24px;
    }
}

/* =====================================================
   Re-authentication Warning Banner
   ===================================================== */
.eve-reauth-warning {
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
    border: 1px solid #ef4444;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(185, 28, 28, 0.3);
}

.reauth-warning-content {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 20px;
    position: relative;
}

.reauth-warning-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.reauth-warning-icon svg {
    width: 24px;
    height: 24px;
}

.reauth-warning-text {
    flex: 1;
    color: #fff;
}

.reauth-warning-text strong {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
    color: #fff;
}

.reauth-warning-text p {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
}

.reauth-character-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reauth-character-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 12px;
    border-radius: 6px;
}

.reauth-character-portrait {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.reauth-character-name {
    flex: 1;
    font-weight: 500;
    color: #fff;
}

.reauth-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #fff;
    color: #b91c1c;
    font-size: 13px;
    font-weight: 600;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.reauth-button:hover {
    background: #fef2f2;
    color: #991b1b;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.reauth-warning-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.7);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.reauth-warning-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

@media (max-width: 768px) {
    .reauth-warning-content {
        flex-direction: column;
        padding: 14px 16px;
    }

    .reauth-warning-icon {
        width: 32px;
        height: 32px;
    }

    .reauth-warning-icon svg {
        width: 20px;
        height: 20px;
    }

    .reauth-character-list li {
        flex-wrap: wrap;
    }

    .reauth-button {
        margin-left: auto;
        margin-top: 4px;
    }
}

/* ============================================
   Industry Tab Styles
   ============================================ */

.industry-content {
    overflow-x: auto;
    max-width: 840px;
}

/* Industry Filters */
.industry-filters {
    display: flex;
    gap: 16px;
    padding: 12px 0;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,0.7);
}

.filter-select {
    padding: 6px 28px 6px 10px;
    font-size: 13px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    background: rgba(255,255,255,0.05) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><path fill="%23ffffff" d="M2 4l4 4 4-4z"/></svg>') no-repeat right 8px center;
    appearance: none;
    cursor: pointer;
    min-width: 140px;
    color: #fff;
}

.filter-select option {
    background: #1f2937;
    color: #fff;
}

.filter-select:hover {
    border-color: rgba(255,255,255,0.3);
}

.filter-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.industry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.industry-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.industry-header .badge {
    background: #3b82f6;
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.industry-table {
    width: 100%;
    border-collapse: collapse;
}

.industry-table th {
    white-space: nowrap;
    padding: 12px 8px;
    font-weight: 600;
    text-align: left;
    background: rgba(255,255,255,0.05);
    border-bottom: 2px solid rgba(255,255,255,0.1);
}

.industry-table td {
    padding: 10px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    vertical-align: middle;
}

.industry-table tr:hover {
    background: rgba(255,255,255,0.02);
}

.industry-date {
    white-space: nowrap;
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    text-align: center;
}

.industry-date .date-line {
    display: block;
    font-weight: 500;
    color: rgba(255,255,255,0.8);
}

.industry-date .time-line {
    display: block;
    font-size: 11px;
    opacity: 0.7;
}

.industry-progress {
    min-width: 80px;
    width: 80px;
}

.progress-bar {
    position: relative;
    height: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.progress-active .progress-fill {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.progress-complete .progress-fill {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.progress-cancelled .progress-fill {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.progress-text {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.industry-location {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.industry-activity {
    white-space: nowrap;
}

.industry-activity i {
    margin-right: 6px;
    opacity: 0.7;
}

.industry-runs {
    text-align: center;
    font-weight: 600;
}

.industry-blueprint,
.industry-product {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Industry Pagination */
.industry-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    margin-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
    flex-wrap: wrap;
}

.industry-pagination .pagination-pages {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.industry-pagination .pagination-btn {
    min-width: 36px;
    text-align: center;
    padding: 8px 14px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    background: rgba(255,255,255,0.05);
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}

.industry-pagination .pagination-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
}

.industry-pagination .pagination-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}

.industry-pagination .pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Responsive Industry Table */
@media screen and (max-width: 1200px) {
    .industry-table {
        font-size: 12px;
    }

    .industry-table th,
    .industry-table td {
        padding: 8px 4px;
    }

    .industry-location {
        max-width: 120px;
    }

    .industry-product {
        max-width: 120px;
    }
}

@media screen and (max-width: 900px) {
    .industry-filters {
        flex-direction: column;
        gap: 8px;
    }

    .filter-group {
        width: 100%;
    }

    .filter-select {
        width: 100%;
    }

    .industry-content {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .industry-table {
        min-width: 650px;
    }
}

@media screen and (max-width: 600px) {
    .industry-pagination {
        flex-direction: column;
        gap: 8px;
    }

    .industry-pagination .pagination-pages {
        order: -1;
    }
}

/* ==========================================================================
   PI (Planetary Interaction) Tab Styles
   ========================================================================== */

/* PI Summary Cards */
.pi-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.pi-stat-card {
    background: linear-gradient(135deg, #2a2f38 0%, #1e2228 100%);
    border: 1px solid #3a3f4a;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pi-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.pi-stat-card.pi-stat-warning {
    border-color: #f39c12;
    background: linear-gradient(135deg, #3a3020 0%, #2a2518 100%);
}

.pi-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #4fc3f7;
    line-height: 1.2;
}

.pi-stat-card.pi-stat-warning .pi-stat-value {
    color: #f39c12;
}

.pi-stat-label {
    font-size: 12px;
    color: #9e9e9e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 5px;
}

/* Planet Type Badge */
.pi-planet-type {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

/* PI Status Badge */
.pi-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.pi-status-badge.pi-status-running {
    background: #2e7d32;
    color: #c8e6c9;
}

.pi-status-badge.pi-status-warning {
    background: #f57f17;
    color: #fff8e1;
}

.pi-status-badge.pi-status-expired {
    background: #c62828;
    color: #ffcdd2;
}

.pi-status-badge.pi-status-idle {
    background: #455a64;
    color: #cfd8dc;
}

/* PI Progress Bar */
.pi-progress-bar {
    position: relative;
    height: 22px;
    background: #2a2f38;
    border-radius: 4px;
    overflow: hidden;
    min-width: 120px;
}

.pi-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.pi-progress-fill.pi-status-running {
    background: linear-gradient(90deg, #388e3c 0%, #4caf50 100%);
}

.pi-progress-fill.pi-status-warning {
    background: linear-gradient(90deg, #f57f17 0%, #ffb300 100%);
}

.pi-progress-fill.pi-status-expired {
    background: linear-gradient(90deg, #c62828 0%, #e53935 100%);
}

.pi-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    z-index: 1;
}

/* Expired Text */
.pi-expired-text {
    color: #ef5350;
    font-weight: 600;
    font-size: 13px;
}

/* PI Tables */
.pi-content h3 {
    color: #4fc3f7;
    font-size: 16px;
    font-weight: 600;
    margin: 25px 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #3a3f4a;
}

.pi-content h3:first-of-type {
    margin-top: 0;
}

.pi-planets-table,
.pi-extractors-table,
.pi-factories-table,
.pi-storage-table {
    width: 100%;
}

.pi-extractors-table tr.pi-status-expired {
    background: rgba(198, 40, 40, 0.1);
}

.pi-extractors-table tr.pi-status-warning {
    background: rgba(245, 127, 23, 0.1);
}

/* Text utilities */
.text-center {
    text-align: center;
}

.text-muted {
    color: #9e9e9e;
    font-style: italic;
}

/* PI Responsive */
@media screen and (max-width: 768px) {
    .pi-summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .pi-stat-value {
        font-size: 22px;
    }

    .pi-progress-bar {
        min-width: 80px;
    }

    .pi-content {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .pi-planets-table,
    .pi-extractors-table,
    .pi-factories-table {
        min-width: 500px;
    }
}

@media screen and (max-width: 480px) {
    .pi-summary-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .pi-stat-card {
        padding: 10px;
    }

    .pi-stat-value {
        font-size: 18px;
    }

    .pi-stat-label {
        font-size: 10px;
    }
}

/* ================================
   PI Monthly Production Styles
   ================================ */
.pi-monthly-production {
    margin-top: 30px;
    padding: 20px;
    background: #2a2f38;
    border-radius: 8px;
    border: 1px solid #3a3f48;
}

.pi-monthly-production h3 {
    color: #fff;
    font-size: 1.3rem;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #3a3f48;
}

.pi-monthly-production h4 {
    color: #fff;
    font-size: 1rem;
    margin-top: 20px;
    margin-bottom: 12px;
}

.pi-monthly-desc {
    color: #9ca3af;
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.pi-monthly-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.pi-monthly-stat-card {
    flex: 1;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.2s ease;
    background: #21252b;
    border: 1px solid #3a3f48;
}

.pi-monthly-stat-card:hover {
    transform: translateY(-2px);
}

.pi-monthly-stat-card.pi-stat-extraction {
    border-left: 3px solid #28a745;
}

.pi-monthly-stat-card.pi-stat-production {
    border-left: 3px solid #ff9800;
}

.pi-monthly-stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #fff;
    line-height: 1.2;
}

.pi-monthly-stat-label {
    font-size: 0.75rem;
    color: #b0b0b0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 5px;
}

.pi-monthly-table {
    width: 100%;
    margin-top: 10px;
    background: #21252b;
    border-radius: 8px;
    overflow: hidden;
}

.pi-monthly-table th {
    background: #21252b;
    color: #b0b0b0;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    padding: 10px 12px;
    border-bottom: 2px solid #3a3f48;
}

.pi-monthly-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #3a3f48;
    color: #d0d0d0;
}

.pi-monthly-table tr:last-child td {
    border-bottom: none;
}

.pi-monthly-table tr:hover td {
    background: #323842;
}

.pi-tier-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
    margin-right: 8px;
    text-transform: uppercase;
}

.pi-tier-badge.pi-tier-r0 {
    background: #28a745;
}

.pi-tier-badge.pi-tier-p1 {
    background: #ff9800;
}

.pi-tier-badge.pi-tier-p2 {
    background: #5a9de8;
}

.pi-tier-badge.pi-tier-p3 {
    background: #9b59b6;
}

.pi-tier-badge.pi-tier-p4 {
    background: #ffc107;
    color: #21252b;
}

/* Standalone status classes for table cells */
.status-ok { color: #28a745; }
.status-warning { color: #ffc107; }
.status-expired { color: #dc3545; }

/* Standalone qty class for output quantities */
.qty {
    color: #9ca3af;
    font-size: 0.85em;
}

.font-bold {
    font-weight: 600;
}

.text-right {
    text-align: right;
}

/* Responsive for Monthly Production */
@media screen and (max-width: 768px) {
    .pi-monthly-stats {
        flex-direction: column;
    }

    .pi-monthly-stat-value {
        font-size: 1.5rem;
    }

    .pi-monthly-table {
        font-size: 0.85rem;
    }

    .pi-monthly-table th,
    .pi-monthly-table td {
        padding: 8px 10px;
    }
}

@media screen and (max-width: 480px) {
    .pi-monthly-production {
        padding: 15px;
    }

    .pi-monthly-stat-value {
        font-size: 1.3rem;
    }

    .pi-tier-badge {
        padding: 2px 5px;
        font-size: 0.6rem;
    }
}

/* ========================================
   PI Planet Cards - Collapsible Per-Planet View
   ======================================== */

.pi-planet-cards {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.pi-planet-card {
    background: #2a2f38;
    border: 1px solid #3a3f48;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.pi-planet-card:hover {
    border-color: #5a9de8;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.pi-planet-card.expanded {
    border-color: #5a9de8;
}

/* Planet Header - Clickable */
.pi-planet-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    user-select: none;
    background: #21252b;
    transition: background 0.2s ease;
}

.pi-planet-header:hover {
    background: #323842;
}

.pi-expand-icon {
    font-size: 0.8rem;
    color: #5a9de8;
    margin-right: 12px;
    transition: transform 0.3s ease;
    width: 12px;
    text-align: center;
}

.pi-planet-card.expanded .pi-expand-icon {
    transform: rotate(90deg);
}

.pi-planet-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.pi-planet-image {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #3a3f48;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.pi-planet-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pi-planet-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.pi-planet-type-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: fit-content;
}

/* Planet Type Badge Colors */
.pi-planet-type-badge.type-temperate { background: #28a745; color: #fff; }
.pi-planet-type-badge.type-barren { background: #6c757d; color: #fff; }
.pi-planet-type-badge.type-oceanic { background: #17a2b8; color: #fff; }
.pi-planet-type-badge.type-ice { background: #81d4fa; color: #21252b; }
.pi-planet-type-badge.type-gas { background: #ff9800; color: #fff; }
.pi-planet-type-badge.type-lava { background: #dc3545; color: #fff; }
.pi-planet-type-badge.type-storm { background: #9b59b6; color: #fff; }
.pi-planet-type-badge.type-plasma { background: #e91e63; color: #fff; }

/* Planet Summary (shown in header) */
.pi-planet-summary {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto;
    padding-left: 20px;
}

.pi-summary-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #b0b0b0;
    white-space: nowrap;
}

.pi-summary-item img {
    width: 20px;
    height: 20px;
    opacity: 0.8;
}

.pi-summary-item .status-ok { color: #28a745; }
.pi-summary-item .status-warning { color: #ffc107; }
.pi-summary-item .status-expired { color: #dc3545; }

/* Planet Body - Expandable Content */
.pi-planet-body {
    display: none;
    padding: 0 20px 20px;
    animation: slideDown 0.3s ease;
}

.pi-planet-card.expanded .pi-planet-body {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* PI Sections within Planet Body */
.pi-section {
    margin-top: 15px;
    background: #21252b;
    border-radius: 8px;
    overflow: hidden;
}

.pi-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: #21252b;
    border-bottom: 1px solid #3a3f48;
}

.pi-section-header img {
    width: 24px;
    height: 24px;
}

.pi-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pi-section-count {
    margin-left: auto;
    background: rgba(90, 157, 232, 0.2);
    color: #5a9de8;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Section Tables */
.pi-section-table {
    width: 100%;
    border-collapse: collapse;
}

.pi-section-table th {
    background: #21252b;
    color: #b0b0b0;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 12px;
    text-align: left;
}

.pi-section-table td {
    padding: 10px 12px;
    color: #d0d0d0;
    border-bottom: 1px solid #3a3f48;
    font-size: 0.85rem;
}

.pi-section-table tr:last-child td {
    border-bottom: none;
}

.pi-section-table tr:hover td {
    background: #323842;
}

/* Extractor Status Colors */
.pi-extractor-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.pi-extractor-status.running {
    background: rgba(40, 167, 69, 0.15);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.pi-extractor-status.warning {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.pi-extractor-status.expired {
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

/* Factory Input/Output */
.pi-factory-io {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pi-factory-inputs,
.pi-factory-outputs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.pi-factory-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #21252b;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.pi-factory-item .qty {
    color: #9ca3af;
}

.pi-factory-arrow {
    color: #5a9de8;
    font-weight: bold;
}

/* Storage Section */
.pi-storage-facility {
    margin-bottom: 10px;
}

.pi-storage-facility:last-child {
    margin-bottom: 0;
}

.pi-storage-facility-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #21252b;
    font-size: 0.85rem;
    color: #b0b0b0;
}

.pi-storage-facility-header img {
    width: 20px;
    height: 20px;
}

.pi-facility-total {
    margin-left: auto;
    color: #5a9de8;
    font-size: 0.8rem;
    font-weight: 600;
}

.pi-storage-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
}

.pi-storage-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #21252b;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.pi-storage-item .item-name {
    color: #d0d0d0;
}

.pi-storage-item .item-qty {
    color: #28a745;
    font-weight: 600;
}

/* Production Tally Section */
.pi-tally-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 15px;
}

.pi-tally-column {
    background: #21252b;
    border-radius: 6px;
    padding: 12px;
}

.pi-tally-column-title {
    font-size: 0.75rem;
    color: #b0b0b0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #3a3f48;
}

.pi-tally-column.extraction .pi-tally-column-title {
    color: #28a745;
}

.pi-tally-column.production .pi-tally-column-title {
    color: #ff9800;
}

.pi-tally-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 0.8rem;
}

.pi-tally-item .item-name {
    color: #9ca3af;
}

.pi-tally-item .item-qty {
    color: #d0d0d0;
    font-weight: 600;
}

/* No Data States */
.pi-no-data {
    padding: 20px;
    text-align: center;
    color: #9ca3af;
    font-style: italic;
}

.pi-section .pi-no-data {
    padding: 15px;
    font-size: 0.85rem;
}

/* Global PI Summary Header */
.pi-global-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    padding: 20px;
    background: #2a2f38;
    border: 1px solid #3a3f48;
    border-radius: 8px;
}

.pi-global-stat {
    text-align: center;
    padding: 15px;
    background: #21252b;
    border-radius: 8px;
}

.pi-global-stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.pi-global-stat-value.status-ok { color: #28a745; }
.pi-global-stat-value.status-warning { color: #ffc107; }
.pi-global-stat-value.status-expired { color: #dc3545; }

.pi-global-stat-label {
    font-size: 0.7rem;
    color: #b0b0b0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 5px;
}

/* Responsive - PI Planet Cards */
@media screen and (max-width: 992px) {
    .pi-planet-summary {
        display: none;
    }

    .pi-tally-grid {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 768px) {
    .pi-planet-header {
        padding: 12px 15px;
    }

    .pi-planet-image {
        width: 40px;
        height: 40px;
    }

    .pi-planet-name {
        font-size: 1rem;
    }

    .pi-section-table {
        display: block;
        overflow-x: auto;
    }

    .pi-section-table th,
    .pi-section-table td {
        padding: 8px 10px;
        white-space: nowrap;
    }

    .pi-global-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .pi-global-stat-value {
        font-size: 1.5rem;
    }
}

@media screen and (max-width: 480px) {
    .pi-planet-identity {
        gap: 8px;
    }

    .pi-planet-image {
        width: 36px;
        height: 36px;
    }

    .pi-planet-name {
        font-size: 0.9rem;
    }

    .pi-planet-type-badge {
        font-size: 0.6rem;
        padding: 2px 6px;
    }

    .pi-planet-body {
        padding: 0 12px 15px;
    }

    .pi-section-header {
        padding: 10px 12px;
    }

    .pi-section-title {
        font-size: 0.8rem;
    }

    .pi-storage-items {
        gap: 6px;
    }

    .pi-storage-item {
        padding: 4px 8px;
        font-size: 0.75rem;
    }

    .pi-global-summary {
        padding: 15px;
        gap: 10px;
    }

    .pi-global-stat {
        padding: 10px;
    }

    .pi-global-stat-value {
        font-size: 1.3rem;
    }
}
