*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f2f8;
    color: #1a1a2e;
    font-size: 14px;
    min-height: 100vh;
}

/* NAVBAR */
.navbar {
    background: #fff;
    border-bottom: 1px solid #e5e7ef;
    display: flex;
    align-items: center;
    padding: 0 24px;
    height: 56px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 16px;
    color: #2563eb;
    white-space: nowrap;
}

.brand-icon {
    font-size: 20px;
}

.search-bar {
    flex: 1;
    max-width: 700px;
    height: 36px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0 14px;
    font-size: 14px;
    outline: none;
    background: #f8fafc;
    transition: border 0.2s;
}

.search-bar:focus {
    border-color: #2563eb;
    background: #fff;
}

.nav-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}

/* FILTERS CARD */
.filters-card {
    background: #fff;
    border-radius: 12px;
    margin: 20px 24px 12px;
    padding: 20px 24px;
    border: 1px solid #e5e7ef;
}

.filter-heading {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #111827;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 24px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-label {
    font-weight: 600;
    font-size: 13px;
    color: #374151;
    margin-bottom: 2px;
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: #4b5563;
    cursor: pointer;
}

.filter-group input[type="checkbox"],
.filter-group input[type="radio"] {
    accent-color: #2563eb;
    cursor: pointer;
}

.filter-group input[type="number"],
.filter-group select {
    width: 100%;
    height: 32px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0 8px;
    font-size: 12px;
    outline: none;
    background: #f9fafb;
}

.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.btn-apply {
    padding: 8px 24px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-apply:hover {
    background: #1d4ed8;
}

.btn-reset {
    padding: 8px 24px;
    background: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-reset:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.btn-email {
    padding: 8px 24px;
    background: #10b981;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-email:hover {
    background: #059669;
}

/* TABLE CARD */
.table-card {
    background: #fff;
    border-radius: 12px;
    margin: 0 24px 24px;
    border: 1px solid #e5e7ef;
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead tr {
    background: #f1f3f9;
    border-bottom: 1px solid #e2e8f0;
}

th {
    padding: 10px 16px;
    text-align: left;
    font-weight: 700;
    color: #8e99af;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

th.sortable {
    cursor: pointer;
}

.sort-icon {
    font-size: 10px;
    color: #cbd5e1;
    margin-left: 4px;
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
}

tbody tr:hover {
    background: #f8fafc;
}

/* SYMBOL & NAME */
.symbol-container {
    display: flex;
    flex-direction: column;
}

.symbol-text {
    color: #2563eb;
    font-weight: 700;
    font-size: 13px;
}

.company-name {
    font-size: 11px;
    color: #94a3b8;
}

#stockBody {
    min-height: 400px;
}

/* BADGES */
.change-pos {
    color: #16a34a;
    font-weight: 600;
}

.change-neg {
    color: #dc2626;
    font-weight: 600;
}

.badge {
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-bull {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #dcfce7;
}

.badge-bear {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fee2e2;
}

.ema-group {
    display: flex;
    gap: 4px;
}

.ema-item {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 2px;
}

.ema-bull {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #dcfce7;
}

.ema-bear {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fee2e2;
}

.tf-signal-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.tf-signal-row:last-child {
    margin-bottom: 0;
}

.tf-label {
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    min-width: 25px;
}

/* PAGINATION - IMPROVED UI */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 40px;
}

.page-numbers-list {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-num {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-num:hover {
    border-color: #2563eb;
    color: #2563eb;
    background: #f8fafc;
}

.btn-num.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.btn-page {
    padding: 6px 16px;
    height: 32px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: center;
}

.btn-page:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #2563eb;
    color: #2563eb;
}

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

.page-info {
    font-size: 13px;
    color: #6b7280;
}

/* LOADING SPINNER */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #e5e7ef;
    border-top: 2px solid #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}