/* FINMA Contact Database Styles */
:root {
    --primary: #1a365d;
    --primary-light: #2c5282;
    --accent: #ed8936;
    --bg: #f7fafc;
    --card-bg: #ffffff;
    --text: #2d3748;
    --text-light: #718096;
    --border: #e2e8f0;
    --success: #48bb78;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

header .subtitle {
    opacity: 0.9;
    font-size: 1.1rem;
}

main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Stats Section */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Filters */
.filters {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.filter-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-row input,
.filter-row select {
    padding: 0.6rem 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.95rem;
}

.filter-row input {
    flex: 1;
    min-width: 200px;
}

.filter-row select {
    min-width: 150px;
}

.btn-export {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-export:hover {
    background: #dd6b20;
}

.filter-info {
    margin-top: 0.75rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Table */
.table-container {
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow-x: auto;
}

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

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--primary);
    color: white;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}

th:hover {
    background: var(--primary-light);
}

th[data-sort]::after {
    content: " \2195";
    opacity: 0.5;
}

th.sort-asc::after {
    content: " \2191";
    opacity: 1;
}

th.sort-desc::after {
    content: " \2193";
    opacity: 1;
}

tbody tr:hover {
    background: #f8fafc;
}

td a {
    color: var(--primary-light);
    text-decoration: none;
}

td a:hover {
    text-decoration: underline;
}

.link-icon {
    display: inline-flex;
    gap: 0.5rem;
}

.link-icon a {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--bg);
    border-radius: 3px;
    font-size: 0.85rem;
}

.category-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.category-bank {
    background: #bee3f8;
    color: #2a4365;
}

.category-asset_manager {
    background: #c6f6d5;
    color: #22543d;
}

.category-fintech {
    background: #feebc8;
    color: #744210;
}

/* Quant highlight */
.stat-highlight {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.stat-highlight .stat-number {
    color: white;
}

.stat-highlight .stat-label {
    color: rgba(255,255,255,0.9);
}

.quant-badge {
    display: inline-block;
    background: #48bb78;
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
}

.quant-highlight {
    background: #f0fff4;
}

tr.has-quant {
    background: #f0fff4;
}

tr.has-quant:hover {
    background: #e6ffed;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem;
}

.btn-page {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-page:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

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

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

footer a {
    color: var(--primary-light);
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
    }

    .filter-row {
        flex-direction: column;
    }

    .filter-row input,
    .filter-row select {
        width: 100%;
    }

    th, td {
        padding: 0.5rem;
        font-size: 0.85rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }
}
