/* ==================== STAT CARDS ==================== */
.ph-stat-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 22px 20px;
    transition: all 0.35s ease;
    position: relative;
    overflow: hidden;
}

.ph-stat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.ph-stat-card:hover::before { opacity: 1; }
.ph-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}

.ph-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.buy-icon    { background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.2); }
.sell-icon   { background: rgba(239, 68, 68, 0.1);  border: 1px solid rgba(239, 68, 68, 0.2);  }
.gold-icon   { background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.2); }
.profit-icon { background: rgba(168, 85, 247, 0.1); border: 1px solid rgba(168, 85, 247, 0.2); }

.ph-stat-value {
    font-size: 1.6rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 4px;
}

.ph-stat-label {
    font-size: 0.75rem;
    color: #525252;
    margin-bottom: 3px;
}

.ph-stat-sub {
    font-size: 0.72rem;
    font-weight: 600;
}

/* ==================== CHART CARD ==================== */
.ph-chart-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 22px;
    padding: 26px;
}

.ph-period-btn {
    padding: 6px 14px;
    border-radius: 9px;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: 'AzarMehr', sans-serif;
    color: #525252;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
}

.ph-period-btn:hover { color: #ffffff; }

.ph-period-btn.active {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.ph-chart-area {
    position: relative;
    margin-top: 8px;
}

.ph-chart-x-axis {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
}

.ph-chart-x-label {
    font-size: 0.65rem;
    color: #404040;
}

/* ==================== DONUT ==================== */
.ph-donut-wrap {
    display: flex;
    justify-content: center;
}

.ph-donut-svg {
    width: 140px;
    height: 140px;
}

.ph-dist-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.ph-dist-row:last-child { border-bottom: none; }

/* ==================== TABLE CARD ==================== */
.ph-table-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 22px;
    padding: 26px;
}

/* ==================== FILTER BAR ==================== */
.ph-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ph-search-wrap {
    position: relative;
    flex: 1;
    min-width: 180px;
}

.ph-search-icon {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #404040;
    pointer-events: none;
}

.ph-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px 40px 10px 14px;
    color: #ffffff;
    font-size: 0.85rem;
    font-family: 'AzarMehr', sans-serif;
    outline: none;
    transition: all 0.3s ease;
}

.ph-search-input:focus {
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.03);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.07);
}

.ph-search-input::placeholder { color: #3a3a3a; }

.ph-filter-group {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 11px;
    padding: 4px;
    gap: 3px;
}

.ph-filter-btn {
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    font-family: 'AzarMehr', sans-serif;
    color: #737373;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
}

.ph-filter-btn:hover { color: #ffffff; background: rgba(255, 255, 255, 0.04); }

.ph-filter-btn.active {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.22);
}

.ph-select {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 11px;
    padding: 9px 14px;
    color: #a3a3a3;
    font-size: 0.8rem;
    font-family: 'AzarMehr', sans-serif;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 32px;
    transition: border-color 0.3s ease;
}

.ph-select:focus { border-color: rgba(245, 158, 11, 0.35); }
.ph-select option { background: #1a1a1a; color: #ffffff; }

.ph-sort-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 11px;
    color: #a3a3a3;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'AzarMehr', sans-serif;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.ph-sort-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

.ph-export-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 11px;
    color: #10b981;
    font-size: 0.8rem;
    font-weight: 700;
    font-family: 'AzarMehr', sans-serif;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.ph-export-btn:hover {
    background: rgba(16, 185, 129, 0.14);
    transform: translateY(-1px);
}

/* ==================== TABLE ==================== */
.ph-table {
    border-collapse: separate;
    border-spacing: 0;
    min-width: 900px;
}

.ph-th {
    text-align: right;
    font-size: 0.75rem;
    color: #525252;
    font-weight: 700;
    padding: 0 14px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    white-space: nowrap;
    user-select: none;
}

.ph-th:first-child { padding-right: 0; }

.ph-th.sortable {
    cursor: pointer;
    transition: color 0.25s ease;
}

.ph-th.sortable:hover { color: #f59e0b; }

.ph-th.sorted {
    color: #f59e0b;
}

.ph-th.sorted svg {
    transform: rotate(180deg);
}

.ph-th svg { display: inline-block; margin-right: 4px; vertical-align: middle; }

.ph-td {
    padding: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.855rem;
    vertical-align: middle;
    white-space: nowrap;
    transition: background 0.2s ease;
}

.ph-td:first-child { padding-right: 0; }

.ph-tr:last-child .ph-td { border-bottom: none; }

.ph-tr {
    transition: background 0.2s ease;
    cursor: pointer;
}

.ph-tr:hover .ph-td {
    background: rgba(255, 255, 255, 0.015);
}

/* TX Type Badge */
.ph-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 100px;
}

.ph-type-badge.buy {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.ph-type-badge.sell {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Gold Type Badge */
.ph-gold-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 8px;
    background: rgba(245, 158, 11, 0.08);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.15);
}

/* Status Badge */
.ph-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 100px;
}

.ph-status.success {
    background: rgba(16, 185, 129, 0.08);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.18);
}

.ph-status.pending {
    background: rgba(245, 158, 11, 0.08);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.18);
}

.ph-status.failed {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.18);
}

/* PnL */
.ph-pnl.positive { color: #10b981; font-weight: 700; }
.ph-pnl.negative { color: #ef4444; font-weight: 700; }
.ph-pnl.neutral  { color: #737373; }

/* Detail Button */
.ph-detail-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.18);
    color: #f59e0b;
    cursor: pointer;
    transition: all 0.25s ease;
}

.ph-detail-btn:hover {
    background: rgba(245, 158, 11, 0.15);
    transform: scale(1.08);
}

/* ==================== EMPTY STATE ==================== */
.ph-empty {
    text-align: center;
    padding: 60px 20px;
}

.ph-empty-icon {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* ==================== PAGINATION ==================== */
.ph-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.ph-page-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #737373;
    cursor: pointer;
    transition: all 0.25s ease;
}

.ph-page-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
}

.ph-page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.ph-page-numbers {
    display: flex;
    gap: 4px;
}

.ph-page-num {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 600;
    color: #737373;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid transparent;
}

.ph-page-num:hover { color: #ffffff; background: rgba(255, 255, 255, 0.05); }

.ph-page-num.active {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.25);
    color: #f59e0b;
}

/* ==================== DETAIL MODAL ==================== */
.ph-modal-box {
    background: #111111;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    width: 100%;
    max-width: 520px;
    overflow: hidden;
    animation: modalBoxIn 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
}

@keyframes modalBoxIn {
    from { opacity: 0; transform: scale(0.92) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(6px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ph-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ph-modal-type-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ph-modal-type-icon.buy {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.ph-modal-type-icon.sell {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.modal-close {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #737373;
    cursor: pointer;
    transition: all 0.25s ease;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.ph-modal-body {
    padding: 26px 28px;
}

/* Modal Status Banner */
.ph-modal-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 22px;
}

.ph-modal-status.success {
    background: rgba(16, 185, 129, 0.07);
    border: 1px solid rgba(16, 185, 129, 0.18);
}

.ph-modal-status.pending {
    background: rgba(245, 158, 11, 0.07);
    border: 1px solid rgba(245, 158, 11, 0.18);
}

.ph-modal-status.failed {
    background: rgba(239, 68, 68, 0.07);
    border: 1px solid rgba(239, 68, 68, 0.18);
}

.ph-modal-status-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Detail Grid */
.ph-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 20px;
}

.ph-detail-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 14px;
}

.ph-detail-item.full {
    grid-column: 1 / -1;
}

.ph-detail-label {
    font-size: 0.72rem;
    color: #525252;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 5px;
}

.ph-detail-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: #e5e5e5;
}

/* Price Comparison */
.ph-price-comparison {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 4px;
}

.ph-price-arrow {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #525252;
}

/* Modal Buttons */
.ph-modal-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #0a0a0a;
    font-weight: 800;
    font-size: 0.875rem;
    font-family: 'AzarMehr', sans-serif;
    border: none;
    border-radius: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.25);
}

.ph-modal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(245, 158, 11, 0.35);
}

.ph-modal-btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 13px;
    color: #a3a3a3;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: 'AzarMehr', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ph-modal-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
}

/* ==================== ROW FLASH ==================== */
@keyframes rowHighlight {
    0%   { background: rgba(245, 158, 11, 0.08); }
    100% { background: transparent; }
}

.ph-tr.highlight .ph-td {
    animation: rowHighlight 1.2s ease forwards;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .ph-filter-bar { gap: 8px; }
    .ph-table-card { padding: 18px; }
    .ph-chart-card { padding: 18px; }
    .ph-modal-body { padding: 18px 20px; }
    .ph-detail-grid { grid-template-columns: 1fr; }
    .ph-detail-item.full { grid-column: 1; }
}