/* ======================= GLOBAL BOX-SIZING FIX ======================= */

* {
    box-sizing: border-box;
}

@media (max-width: 782px) {
    html {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    body {
        overflow-x: hidden;
        max-width: 100vw;
        position: relative;
    }
}


/* ======================= RESPONSIVE DESIGN ======================= */

/* Mobile breakpoints */
:root {
    --mobile-breakpoint: 782px;
    --tablet-breakpoint: 1024px;
}

/* ======================= MOBILE OVERFLOW FIX ======================= */

@media (max-width: 782px) {
    /* Prevent horizontal scroll */
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }
    
    body.dark-mode {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }
    
    /* Fix all containers */
    .wrap,
    .cpt-dashboard-container,
    .cpt-dashboard-container > div {
        max-width: 100vw !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
    
    /* Remove negative margins */
    .cpt-dashboard-container > div[style*="margin: 0 -24px"] {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* Fix padding for overflow sections */
    .cpt-dashboard-container > div[style*="overflow-x: auto"] {
        margin-left: -16px !important;
        margin-right: -16px !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}

/* ======================= DASHBOARD RESPONSIVE ======================= */

/* Metrics grid - responsive */
.cpt-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 782px) {
    .cpt-metrics-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .cpt-metric-card {
        padding: 16px;
    }
    
    .cpt-metric-card__value {
        font-size: 24px;
    }
}

/* Quick actions - responsive */
@media (max-width: 782px) {
    .cpt-dashboard-container .button {
        font-size: 14px;
        padding: 12px;
    }
    
    .cpt-dashboard-container .dashicons {
        font-size: 20px !important;
    }
}

/* ======================= PORTFOLIO HOLDINGS TABLE - SIMPLIFIED MOBILE ======================= */

@media (max-width: 782px) {
    /* Container */
    #portfolio-holdings-container {
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    #portfolio-holdings-container > div[style*="overflow-x: auto"] {
        overflow-x: visible !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    #portfolio-holdings-container table.wp-list-table {
        border: none;
        background: transparent;
        width: 100% !important;
        display: block !important;
    }
    
    #portfolio-holdings-container table.wp-list-table thead {
        display: none;
    }
    
    #portfolio-holdings-container table.wp-list-table tbody {
        display: block;
        width: 100%;
    }
    
    /* === CARD LAYOUT WITH CSS GRID === */
    #portfolio-holdings-container table.wp-list-table tbody tr {
        display: grid !important;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
		grid-template-areas:
			"name value"
			"name2 pnl";
        gap: 12px 16px;
        align-items: start;
        width: 100%;
        margin-bottom: 12px;
        padding: 14px 16px;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        background: #fff;
        box-shadow: 0 1px 3px rgba(0,0,0,0.08);
        box-sizing: border-box;
    }
    
    /* Dark mode */
    body.dark-mode #portfolio-holdings-container table.wp-list-table tbody tr {
        background: var(--bg-card) !important;
        border-color: var(--border-color) !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.3) !important;
    }
    
    /* Hide all cells by default */
    #portfolio-holdings-container table.wp-list-table tbody td {
        display: none !important;
        border: none;
        padding: 0;
        margin: 0;
    }
    
    /* === SHOW ONLY 3 CELLS === */
    
    /* Coin name (td:2) - top left */
    #portfolio-holdings-container table.wp-list-table tbody td:nth-child(2) {
        display: flex !important;
        grid-area: name;
        align-items: center;
        gap: 10px;
    }
    
    /* Holdings value (td:11) - top right */
    #portfolio-holdings-container table.wp-list-table tbody td:nth-child(11) {
        display: block !important;
        grid-area: value;
        text-align: right;
    }
    
    /* P&L (td:12) - bottom right */
    #portfolio-holdings-container table.wp-list-table tbody td:nth-child(12) {
        display: flex !important;
        grid-area: pnl;
        justify-content: flex-end;
        align-items: center;
        gap: 4px;
    }
    
/* === STYLING === */
    
    /* Coin image */
    #portfolio-holdings-container table.wp-list-table tbody td:nth-child(2) img,
    #portfolio-holdings-container table.wp-list-table tbody td:nth-child(2) > div > div:first-child {
        width: 32px !important;
        height: 32px !important;
        flex-shrink: 0 !important;
    }
    
    /* Coin name */
    #portfolio-holdings-container table.wp-list-table tbody td:nth-child(2) > div > div:last-child > div:first-child {
        font-size: 15px !important;
        font-weight: 600 !important;
        color: #1d2327;
        line-height: 1.3;
    }
    
    body.dark-mode #portfolio-holdings-container table.wp-list-table tbody td:nth-child(2) > div > div:last-child > div:first-child {
        color: var(--text-primary) !important;
    }
    
    /* Hide symbol */
    #portfolio-holdings-container table.wp-list-table tbody td:nth-child(2) > div > div:last-child > div:last-child {
        display: none !important;
    }
    
    /* Force right alignment on holdings cell */
    #portfolio-holdings-container table.wp-list-table tbody td:nth-child(11),
    #portfolio-holdings-container table.wp-list-table tbody td:nth-child(11) > div,
    #portfolio-holdings-container table.wp-list-table tbody td:nth-child(11) > div:first-child {
        text-align: right !important;
    }
    
    /* Holdings USD value - show */
    #portfolio-holdings-container table.wp-list-table tbody td:nth-child(11) > div:first-child {
        font-size: 15px !important;
        font-weight: 700 !important;
        color: #1d2327 !important;
        line-height: 1.3;
        display: block !important;
    }
    
    body.dark-mode #portfolio-holdings-container table.wp-list-table tbody td:nth-child(11) > div:first-child {
        color: var(--text-primary) !important;
    }
    
    /* HIDE original amount div (we'll use ::after instead) */
    #portfolio-holdings-container table.wp-list-table tbody td:nth-child(11) > div:nth-child(2) {
        display: none !important;
    }
    
    /* Show amount using ::after - bottom left */
    #portfolio-holdings-container table.wp-list-table tbody td:nth-child(11)::after {
        content: attr(data-amount);
        display: block;
        grid-area: name2;
        font-size: 13px;
        font-weight: 400;
        color: #6b7280;
        line-height: 1.3;
        text-align: right !important;
    }
    
    body.dark-mode #portfolio-holdings-container table.wp-list-table tbody td:nth-child(11)::after {
        color: var(--text-muted) !important;
    }
    
    /* P&L values inline */
    #portfolio-holdings-container table.wp-list-table tbody td:nth-child(12) > div {
        display: inline !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        line-height: 1.3;
    }
    
    /* Space between P&L value and percent */
    #portfolio-holdings-container table.wp-list-table tbody td:nth-child(12) > div:first-child::after {
        content: ' ';
    }
    
    /* P&L colors */
    #portfolio-holdings-container table.wp-list-table tbody td:nth-child(12).profit-positive > div {
        color: #16c784 !important;
    }
    
    #portfolio-holdings-container table.wp-list-table tbody td:nth-child(12).profit-negative > div {
        color: #ea3943 !important;
    }
    
    /* Hide all other columns */
    #portfolio-holdings-container table.wp-list-table tbody td:nth-child(1),   /* Rank */
    #portfolio-holdings-container table.wp-list-table tbody td:nth-child(3),   /* Price */
    #portfolio-holdings-container table.wp-list-table tbody td:nth-child(4),   /* Avg Buy */
    #portfolio-holdings-container table.wp-list-table tbody td:nth-child(5),   /* 1h */
    #portfolio-holdings-container table.wp-list-table tbody td:nth-child(6),   /* 24h */
    #portfolio-holdings-container table.wp-list-table tbody td:nth-child(7),   /* 7d */
    #portfolio-holdings-container table.wp-list-table tbody td:nth-child(8),   /* Sparkline */
    #portfolio-holdings-container table.wp-list-table tbody td:nth-child(9),   /* Volume */
    #portfolio-holdings-container table.wp-list-table tbody td:nth-child(10)   /* Market Cap */
    {
        display: none !important;
    }
}

/* ======================= RECENT TRANSACTIONS TABLE - COMPACT LIST ======================= */

@media (max-width: 782px) {
    #recent-transactions-container table.wp-list-table {
        border: none;
        background: #fff;
    }
    
    #recent-transactions-container table.wp-list-table thead {
        display: none;
    }
    
    #recent-transactions-container table.wp-list-table tbody {
        display: block;
    }
    
    /* Compact list item */
    #recent-transactions-container table.wp-list-table tbody tr {
        display: block;
        position: relative;
        padding: 12px 16px;
        border-bottom: 1px solid #f0f0f1;
        background: #fff;
        min-height: 50px;
    }
    
    #recent-transactions-container table.wp-list-table tbody tr:last-child {
        border-bottom: none;
    }
    
    #recent-transactions-container table.wp-list-table tbody td {
        display: block;
        border: none;
        padding: 0;
        margin: 0;
    }
    
    /* Asset name - top left */
    #recent-transactions-container table.wp-list-table tbody td:nth-child(2) {
        position: absolute;
        top: 12px;
        left: 16px;
        font-size: 15px;
        font-weight: 700;
        color: #1d2327;
        max-width: 55%;
    }
    
    #recent-transactions-container table.wp-list-table tbody td:nth-child(2) strong {
        display: block;
    }
    
    /* Date - bottom left */
    #recent-transactions-container table.wp-list-table tbody td:nth-child(1) {
        position: absolute;
        bottom: 12px;
        left: 16px;
        font-size: 11px;
        color: #6b7280;
    }
    
    /* Quantity - top right */
    #recent-transactions-container table.wp-list-table tbody td:nth-child(3) {
        position: absolute;
        top: 12px;
        right: 16px;
        font-size: 14px;
        font-weight: 600;
        color: #1d2327;
        text-align: right;
    }
    
    /* Type badge - bottom right */
    #recent-transactions-container table.wp-list-table tbody td:nth-child(5) {
        position: absolute;
        bottom: 10px;
        right: 16px;
        text-align: right;
    }
    
    #recent-transactions-container table.wp-list-table tbody td:nth-child(5) span {
        display: inline-block;
        padding: 2px 8px;
        border-radius: 4px;
        font-size: 10px;
        font-weight: 700;
    }
    
    /* Hide price */
    #recent-transactions-container table.wp-list-table tbody td:nth-child(4) {
        display: none;
    }
    
    /* Remove data-labels */
    #recent-transactions-container table.wp-list-table tbody td::before {
        display: none;
    }
}

/* ======================= TRANSACTION MANAGEMENT TABLES ======================= */

@media (max-width: 782px) {
    .wrap table.wp-list-table {
        border: none;
    }
    
    .wrap table.wp-list-table thead {
        display: none;
    }
    
    .wrap table.wp-list-table tbody {
        display: block;
    }
    
    .wrap table.wp-list-table tbody tr {
        display: block;
        margin-bottom: 12px;
        border: 1px solid #dcdcde;
        border-radius: 8px;
        padding: 12px;
        background: #fff;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    }
    
    .wrap table.wp-list-table tbody td {
        display: block;
        border: none;
        padding: 0;
        margin-bottom: 6px;
        text-align: left;
    }
    
    .wrap table.wp-list-table tbody td:last-child {
        margin-bottom: 0;
    }
    
    /* Name field - prominent */
    .wrap table.wp-list-table tbody td:nth-child(3) {
        font-size: 16px;
        font-weight: 700;
        color: #1d2327;
        margin-bottom: 8px;
        padding-bottom: 6px;
        border-bottom: 1px solid #e5e7eb;
    }
    
    /* Regular fields - flex layout */
    .wrap table.wp-list-table tbody td:not(:nth-child(3)):not(:last-child) {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        padding: 3px 0;
        font-size: 13px;
    }
    
    .wrap table.wp-list-table tbody td::before {
        content: attr(data-label);
        font-size: 10px;
        font-weight: 600;
        color: #6b7280;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        flex-shrink: 0;
        padding-right: 12px;
    }
    
    /* Hide label for name field */
    .wrap table.wp-list-table tbody td:nth-child(3)::before {
        content: none;
    }
    
    /* Actions - buttons */
    .wrap table.wp-list-table tbody td:last-child {
        display: flex;
        gap: 8px;
        margin-top: 10px;
        padding-top: 8px;
        border-top: 1px solid #e5e7eb;
    }
    
    .wrap table.wp-list-table tbody td:last-child::before {
        content: none;
    }
    
    .wrap table.wp-list-table tbody td:last-child a {
        flex: 1;
        padding: 8px 12px;
        text-align: center;
        background: #2271b1;
        color: #fff;
        border-radius: 6px;
        text-decoration: none;
        font-weight: 600;
        font-size: 13px;
    }
    
    .wrap table.wp-list-table tbody td:last-child a:hover {
        background: #135e96;
    }
    
    /* Delete link - red */
    .wrap table.wp-list-table tbody td:last-child a:last-child {
        background: #dc3545;
    }
    
    .wrap table.wp-list-table tbody td:last-child a:last-child:hover {
        background: #c82333;
    }
	
}
/* Hide Notes column on mobile - will show in expanded view later */
@media (max-width: 782px) {
    /* All Transactions table */
    .wp-list-table .column-notes {
        display: none !important;
    }
    
    /* Recent Transactions - hide notes icon column on mobile */
    #recent-transactions-container table.wp-list-table tbody td:nth-child(6) {
        display: none !important;
    }
}

/* Desktop - ensure notes column visible and properly styled */
@media screen and (min-width: 783px) {
    .wp-list-table .column-notes {
        width: 50px;
        text-align: center;
    }
    
    .wp-list-table .cpt-notes-icon {
        cursor: pointer;
        font-size: 18px;
        transition: all 0.2s ease;
    }
    
    .wp-list-table .cpt-notes-icon.has-notes {
        color: #2271b1;
    }
    
    .wp-list-table .cpt-notes-icon.has-notes:hover {
        color: #135e96;
        transform: scale(1.1);
    }
    
    .wp-list-table .cpt-notes-icon.no-notes {
        color: #d1d5db;
    }
    
    .wp-list-table .cpt-notes-icon.no-notes:hover {
        color: #9ca3af;
        transform: scale(1.1);
    }
    
    /* Dark mode adjustments */
    body.dark-mode .wp-list-table .cpt-notes-icon.has-notes {
        color: #60a5fa;
    }
    
    body.dark-mode .wp-list-table .cpt-notes-icon.has-notes:hover {
        color: #93c5fd;
    }
    
    body.dark-mode .wp-list-table .cpt-notes-icon.no-notes {
        color: #4b5563;
    }
    
    body.dark-mode .wp-list-table .cpt-notes-icon.no-notes:hover {
        color: #6b7280;
    }
}

/* ======================= FORM IMPROVEMENTS MOBILE ======================= */

@media (max-width: 782px) {
    .form-table {
        width: 100%;
    }
    
    .form-table tr {
        display: block;
        margin-bottom: 16px;
        padding: 12px;
        background: #f9fafb;
        border-radius: 6px;
        border: 1px solid #e5e7eb;
    }
    
    .form-table tr:last-child {
        margin-bottom: 0;
    }
    
    .form-table th,
    .form-table td {
        display: block;
        width: 100%;
        padding: 0;
        text-align: left;
    }
    
    .form-table th {
        margin-bottom: 6px;
        font-size: 12px;
        font-weight: 600;
        color: #374151;
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }
    
    .form-table td {
        margin-top: 0;
    }
    
    .form-table input[type="text"],
    .form-table input[type="number"],
    .form-table input[type="date"],
    .form-table input[type="time"],
    .form-table select,
    .form-table textarea {
        width: 100%;
        max-width: 100%;
        font-size: 16px;
        padding: 10px 12px;
        border: 1px solid #d1d5db;
        border-radius: 6px;
        background: #fff;
    }
    
    .form-table input[type="text"]:focus,
    .form-table input[type="number"]:focus,
    .form-table select:focus {
        border-color: #2271b1;
        outline: none;
        box-shadow: 0 0 0 1px #2271b1;
    }
    
    .form-table .regular-text {
        width: 100%;
    }
    
    /* Radio buttons */
    .form-table input[type="radio"] {
        margin-right: 6px;
        width: 16px;
        height: 16px;
    }
    
    .form-table label {
        display: block;
        margin-bottom: 8px;
        font-size: 14px;
        font-weight: 500;
        color: #1d2327;
    }
    
    /* Description text */
    .form-table .description {
        font-size: 12px;
        margin-top: 4px;
        color: #6b7280;
        line-height: 1.4;
    }
}

/* ======================= TOUCH IMPROVEMENTS ======================= */

@media (max-width: 782px) {
    .button,
    a.button {
        min-height: 48px;
        padding: 12px 20px;
        font-size: 15px;
        border-radius: 8px;
    }
    
    /* Form inputs */
    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="password"],
    select,
    textarea {
        min-height: 48px;
        font-size: 16px;
    }
    
    /* Checkboxes and radios */
    input[type="checkbox"],
    input[type="radio"] {
        width: 20px;
        height: 20px;
    }
}

/* ======================= CAPITAL SUMMARY RESPONSIVE ======================= */

@media (max-width: 782px) {
    .capital-summary-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
    
    .capital-item {
        padding: 16px;
        border-radius: 8px;
    }
    
    .capital-value {
        font-size: 22px;
    }
    
    .profit-summary {
        padding: 20px;
        border-radius: 12px;
    }
    
    .profit-value {
        font-size: 28px;
    }
}

/* ======================= SPACING & TYPOGRAPHY ======================= */

@media (max-width: 782px) {
    .wrap h1 {
        font-size: 26px;
        margin-bottom: 20px;
        font-weight: 700;
    }
    
    .wrap h2 {
        font-size: 20px;
        font-weight: 700;
        margin-top: 30px;
        margin-bottom: 16px;
    }
    
    .cpt-section-header h2 {
        font-size: 20px;
        font-weight: 700;
    }
    
    .cpt-dashboard-container {
        padding: 0 16px;
    }
    
    .cpt-section-header {
        margin-top: 32px;
        margin-bottom: 16px;
    }
}

/* ======================= OVERFLOW HANDLING ======================= */

@media (max-width: 782px) {
    .wrap {
        overflow-x: hidden;
    }
}

/* ======================= TOAST NOTIFICATIONS MOBILE ======================= */

@media (max-width: 782px) {
    .cpt-toast-container {
        left: 12px;
        right: 12px;
        top: 12px;
    }
    
    .cpt-toast {
        min-width: auto;
        max-width: none;
        margin-bottom: 12px;
        border-radius: 8px;
    }
}

/* ======================= ADMIN BAR ADJUSTMENTS ======================= */

@media screen and (max-width: 600px) {
    .cpt-toast-container {
        top: 46px;
    }
}

/* ======================= LANDSCAPE MODE ======================= */

@media (max-width: 782px) and (orientation: landscape) {
    .cpt-metric-card {
        padding: 12px;
    }
    
    .cpt-section-header {
        margin-top: 20px;
        margin-bottom: 12px;
    }
}

/* ======================= TABLET SPECIFIC ======================= */

@media (min-width: 783px) and (max-width: 1024px) {
    .cpt-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .capital-summary-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ======================= ACCESSIBILITY ======================= */

@media (prefers-contrast: high) {
    .cpt-metric-card {
        border: 2px solid currentColor;
    }
    
    .button {
        border: 2px solid currentColor;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cpt-toast,
    .cpt-metric-card,
    .button {
        transition: none;
        animation: none;
    }
}

/* ======================= PRINT STYLES ======================= */

@media print {
    .cpt-toast-container,
    .button,
    .cpt-overlay {
        display: none !important;
    }
    
    .cpt-metric-card,
    .capital-item {
        border: 1px solid #000;
        page-break-inside: avoid;
    }
}

/* =============================================
   COINGECKO-STYLE DASHBOARD RESPONSIVE
   ============================================= */

/* Desktop - wszystkie kolumny widoczne */
@media (min-width: 1400px) {
    .cpt-dashboard-container table {
        font-size: 13px;
    }
}

/* Large tablets - ukryj 1h i Volume */
@media (max-width: 1200px) {
    .cpt-dashboard-container table th:nth-child(4),
    .cpt-dashboard-container table td:nth-child(4),
    .cpt-dashboard-container table th:nth-child(7),
    .cpt-dashboard-container table td:nth-child(7) {
        display: none;
    }
}

/* Tablets - ukryj dodatkowo Market Cap i 7d */
@media (max-width: 992px) {
    .cpt-dashboard-container table th:nth-child(4),
    .cpt-dashboard-container table td:nth-child(4),
    .cpt-dashboard-container table th:nth-child(6),
    .cpt-dashboard-container table td:nth-child(6),
    .cpt-dashboard-container table th:nth-child(7),
    .cpt-dashboard-container table td:nth-child(7),
    .cpt-dashboard-container table th:nth-child(8),
    .cpt-dashboard-container table td:nth-child(8) {
        display: none;
    }
}

/* Mobile - tylko najważniejsze kolumny */
@media (max-width: 768px) {
    /* Ukryj: 1h%, 7d%, Sparkline, Volume, Market Cap */
    .cpt-dashboard-container table th:nth-child(5),
    .cpt-dashboard-container table td:nth-child(5),
    .cpt-dashboard-container table th:nth-child(7),
    .cpt-dashboard-container table td:nth-child(7),
    .cpt-dashboard-container table th:nth-child(8),
    .cpt-dashboard-container table td:nth-child(8),
    .cpt-dashboard-container table th:nth-child(9),
    .cpt-dashboard-container table td:nth-child(9),
    .cpt-dashboard-container table th:nth-child(10),
    .cpt-dashboard-container table td:nth-child(10) {
        display: none;
    }
    
    /* Pokaż: Rank, Coin, Price, Avg Buy, 24h%, Holdings, PNL */
    
    /* Mniejsze czcionki */
    .cpt-dashboard-container table {
        font-size: 11px;
    }
    
    .cpt-dashboard-container table th,
    .cpt-dashboard-container table td {
        padding: 10px 6px !important;
    }
    
    /* Obrazki coinów mniejsze */
    .cpt-dashboard-container table tbody tr img,
    .cpt-dashboard-container table tbody tr > td > div > div:first-child {
        width: 24px !important;
        height: 24px !important;
        font-size: 10px !important;
    }
    
    /* Quick Actions - pionowy układ */
    .cpt-dashboard-container div[style*="grid-template-columns: repeat(auto-fit, minmax(160px, 1fr))"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Holdings & Performance - pełna szerokość */
    .cpt-holdings-chart,
    .cpt-performance-chart {
        grid-column: 1 / -1 !important;
    }
    
    /* Sekcje na mobile - mniejszy padding */
    .cpt-dashboard-container > div[style*="background: #fff"] {
        padding: 16px !important;
        margin-bottom: 16px !important;
    }
}

/* Very small mobile */
@media (max-width: 480px) {
    /* Ukryj również Avg Buy price na bardzo małych ekranach */
    .cpt-dashboard-container table th:nth-child(4),
    .cpt-dashboard-container table td:nth-child(4) {
        display: none;
    }
    
    /* Rank też możemy ukryć */
    .cpt-dashboard-container table th:nth-child(1),
    .cpt-dashboard-container table td:nth-child(1) {
        display: none;
    }
}

/* Desktop - pokazuj sparkline tylko gdy jest miejsce */
@media (min-width: 1400px) {
    .cpt-dashboard-container table th:nth-child(8),
    .cpt-dashboard-container table td:nth-child(8) {
        display: table-cell !important;
    }
}

/* Large tablets - ukryj sparkline */
@media (max-width: 1200px) {
    .cpt-dashboard-container table th:nth-child(8),
    .cpt-dashboard-container table td:nth-child(8) {
        display: none;
    }
}

/* ======================= RECENT TRANSACTIONS FIX ======================= */

@media (max-width: 782px) {
    #recent-transactions-container {
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
        padding: 0 !important;
    }
    
    #recent-transactions-container > div[style*="overflow-x: auto"] {
        overflow-x: visible !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    #recent-transactions-container table.wp-list-table {
        width: 100% !important;
        display: block !important;
        background: transparent;
    }
    
    #recent-transactions-container table.wp-list-table tbody tr {
        margin-bottom: 10px;
        padding: 14px 16px;
        border: 1px solid #e5e7eb;
        border-radius: 10px;
        background: #fff;
        box-shadow: 0 1px 3px rgba(0,0,0,0.08);
        position: relative;
        min-height: 70px;
    }
    
    /* Dark mode styling */
    body.dark-mode #recent-transactions-container table.wp-list-table tbody tr {
        background: var(--bg-card) !important;
        border-color: var(--border-color) !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.3) !important;
    }
    
    /* Asset name - clearly visible */
    body.dark-mode #recent-transactions-container table.wp-list-table tbody td:nth-child(2) {
        color: var(--text-primary) !important;
    }
    
    body.dark-mode #recent-transactions-container table.wp-list-table tbody td:nth-child(2) strong {
        color: var(--text-primary) !important;
        font-weight: 700 !important;
    }
    
    /* Date */
    body.dark-mode #recent-transactions-container table.wp-list-table tbody td:nth-child(1) {
        color: var(--text-muted) !important;
    }
    
    /* Quantity */
    body.dark-mode #recent-transactions-container table.wp-list-table tbody td:nth-child(3) {
        color: var(--text-secondary) !important;
    }
    
    /* Type badge */
    body.dark-mode #recent-transactions-container table.wp-list-table tbody td:nth-child(5) span {
        background: var(--bg-secondary) !important;
        border: 1px solid var(--border-color) !important;
    }
}