@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;600;700&family=DM+Sans:wght@300;400;500;600&family=JetBrains+Mono:wght@300;400&display=swap');

:root {
    --bg-primary: #08090d;
    --bg-secondary: #0f1117;
    --bg-tertiary: #161921;
    --bg-elevated: #1c1f2a;
    --gold-primary: #c9a84c;
    --gold-light: #e4c76b;
    --gold-dim: #8a7034;
    --gold-glow: rgba(201, 168, 76, 0.08);
    --text-primary: #e8e6e1;
    --text-secondary: #9a978f;
    --text-muted: #5c5a54;
    --border-subtle: rgba(201, 168, 76, 0.1);
    --border-strong: rgba(201, 168, 76, 0.25);
    --positive: #4ecb71;
    --negative: #e85454;
    --neutral: #5b9bd5;
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-weight: 300;
    min-height: 100vh;
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(201, 168, 76, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(201, 168, 76, 0.02) 0%, transparent 50%);
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 48px 40px;
}

/* Header */
.header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.header h1 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: 2.4rem;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.header h1 span {
    color: var(--gold-primary);
}

.header-meta {
    display: flex;
    align-items: center;
    gap: 24px;
}

.stat-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

.stat-badge .value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    color: var(--gold-light);
    font-weight: 400;
}

/* Controls */
.controls {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

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

.filter-group label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.filter-select {
    appearance: none;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 400;
    padding: 10px 36px 10px 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23c9a84c' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.filter-select:hover {
    border-color: var(--border-strong);
}

.filter-select:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px var(--gold-glow);
}

/* Table wrapper */
.table-wrapper {
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-secondary);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(201, 168, 76, 0.05);
}

.table-scroll {
    overflow-x: auto;
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

th {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-strong);
    padding: 14px 18px;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    white-space: nowrap;
    user-select: none;
}

th.sortable {
    cursor: pointer;
    transition: color 0.2s;
}

th.sortable:hover {
    color: var(--gold-light);
}

th.sortable::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 6px;
    vertical-align: middle;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid var(--text-muted);
    opacity: 0.4;
    transition: opacity 0.2s, transform 0.2s;
}

th.sortable:hover::after {
    opacity: 1;
    border-top-color: var(--gold-primary);
}

th.sort-asc::after {
    opacity: 1;
    border-top-color: var(--gold-primary);
    transform: rotate(180deg);
}

th.sort-desc::after {
    opacity: 1;
    border-top-color: var(--gold-primary);
}

td {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    font-weight: 300;
    vertical-align: top;
}

tr {
    transition: background-color 0.15s;
}

tbody tr:hover {
    background-color: var(--gold-glow);
}

tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.01);
}

tbody tr:nth-child(even):hover {
    background-color: var(--gold-glow);
}

/* Column-specific styles */
.col-id {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    width: 60px;
}

.col-desc {
    max-width: 320px;
    line-height: 1.5;
}

.col-desc .desc-text {
    line-height: 1.5;
}

.col-desc .desc-link {
    display: inline-block;
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--gold-dim);
    text-decoration: none;
    transition: color 0.2s;
}

.col-desc .desc-link:hover {
    color: var(--gold-light);
}

.col-currency {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    text-align: right;
    white-space: nowrap;
}

.col-currency.highlight {
    color: var(--gold-light);
    font-weight: 400;
}

.col-date {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.col-number {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    text-align: center;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.status-badge.active {
    background: rgba(78, 203, 113, 0.1);
    color: var(--positive);
    border: 1px solid rgba(78, 203, 113, 0.2);
}

.status-badge.completed {
    background: rgba(91, 155, 213, 0.1);
    color: var(--neutral);
    border: 1px solid rgba(91, 155, 213, 0.2);
}

.status-badge.expiring {
    background: rgba(230, 180, 50, 0.1);
    color: #e6b432;
    border: 1px solid rgba(230, 180, 50, 0.2);
}

.status-badge.failed {
    background: rgba(232, 84, 84, 0.1);
    color: var(--negative);
    border: 1px solid rgba(232, 84, 84, 0.2);
}

.status-badge.unknown {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Row animations */
@keyframes fadeInRow {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

tbody tr {
    animation: fadeInRow 0.4s ease both;
}

tbody tr:nth-child(1) { animation-delay: 0.02s; }
tbody tr:nth-child(2) { animation-delay: 0.04s; }
tbody tr:nth-child(3) { animation-delay: 0.06s; }
tbody tr:nth-child(4) { animation-delay: 0.08s; }
tbody tr:nth-child(5) { animation-delay: 0.10s; }
tbody tr:nth-child(6) { animation-delay: 0.12s; }
tbody tr:nth-child(7) { animation-delay: 0.14s; }
tbody tr:nth-child(8) { animation-delay: 0.16s; }
tbody tr:nth-child(9) { animation-delay: 0.18s; }
tbody tr:nth-child(10) { animation-delay: 0.20s; }
tbody tr:nth-child(n+11) { animation-delay: 0.22s; }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 80px 40px;
    color: var(--text-muted);
}

.empty-state h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    font-weight: 400;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 24px 16px;
    }

    .header {
        flex-direction: column;
        gap: 16px;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .controls {
        flex-wrap: wrap;
    }

    th, td {
        padding: 10px 12px;
    }
}
