/* ==========================================================================
   HERMES FINANCE - EXECUTIVE DARK GLASSMORPHISM DESIGN SYSTEM
   ========================================================================== */

:root {
    --bg-base: #080c14;
    --bg-sidebar: #0d1322;
    --bg-card: rgba(19, 27, 46, 0.7);
    --bg-card-hover: rgba(28, 38, 64, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(6, 182, 212, 0.3);
    
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    --primary: #06b6d4;
    --primary-glow: rgba(6, 182, 212, 0.25);
    --accent: #6366f1;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-purple: #8b5cf6;
    --accent-pink: #ec4899;
    --danger: #ef4444;

    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

    --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px rgba(6, 182, 212, 0.15);
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(6, 182, 212, 0.1) 0px, transparent 50%),
        radial-gradient(at 50% 100%, rgba(16, 185, 129, 0.08) 0px, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* App Layout Grid */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 270px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 28px 20px;
    flex-shrink: 0;
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 36px;
    padding: 0 6px;
}

.brand-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #06b6d4, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 0 20px var(--primary-glow);
}

.brand-text h2 {
    font-family: var(--font-heading);
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.brand-text .accent-text {
    color: var(--primary);
}

.version-badge {
    font-size: 11px;
    color: var(--text-dim);
    font-weight: 500;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-align: left;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    transform: translateX(3px);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.15), rgba(99, 102, 241, 0.05));
    border-color: rgba(6, 182, 212, 0.3);
    color: var(--primary);
}

.nav-icon {
    font-size: 18px;
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.pulse-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-emerald);
    box-shadow: 0 0 10px var(--accent-emerald);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.status-info {
    display: flex;
    flex-direction: column;
}

.status-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
}

.status-subtitle {
    font-size: 11px;
    color: var(--text-dim);
}

.btn-quick-sync {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-quick-sync:hover {
    background: rgba(6, 182, 212, 0.15);
    border-color: var(--primary);
    color: var(--primary);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 32px 40px;
    max-width: 1440px;
}

/* Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.header-left h1 {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.wallet-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    padding: 8px 16px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    font-size: 13px;
    font-weight: 600;
}

.wallet-acc {
    color: var(--primary);
    background: rgba(6, 182, 212, 0.12);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.45);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 11px;
}

.btn-text-link {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-text-link:hover {
    text-decoration: underline;
    color: #38bdf8;
}

/* Glass Card */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: var(--transition-smooth);
}

/* Tabs */
.tab-view {
    display: none;
    flex-direction: column;
    gap: 24px;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-view.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.stat-card {
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.stat-title {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.bg-cyan { background: rgba(6, 182, 212, 0.15); color: #06b6d4; }
.bg-amber { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.bg-purple { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.bg-emerald { background: rgba(16, 185, 129, 0.15); color: #10b981; }

.stat-value {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 8px;
}

.trend-pill {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 700;
}

.trend-positive { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.trend-negative { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.trend-neutral { background: rgba(6, 182, 212, 0.15); color: #06b6d4; }

.trend-subtext, .stat-subtext-detail {
    font-size: 12px;
    color: var(--text-dim);
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1.2fr;
    gap: 20px;
}

.chart-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.card-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.card-header-actions h3 {
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 700;
}

.card-desc {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 2px;
}

.chart-badge {
    background: rgba(6, 182, 212, 0.12);
    color: var(--primary);
    border: 1px solid rgba(6, 182, 212, 0.25);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.chart-container {
    position: relative;
    height: 260px;
    width: 100%;
}

.doughnut-box {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Tables */
.recent-feed-card, .tx-table-card {
    padding: 24px;
}

.tx-table-container {
    overflow-x: auto;
}

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

.tx-table th {
    text-align: left;
    padding: 12px 14px;
    color: var(--text-dim);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.tx-table td {
    padding: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

.tx-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.text-right { text-align: right; }
.text-center { text-align: center; }

/* Badges & Tags */
.merchant-cell {
    display: flex;
    flex-direction: column;
}

.merchant-name {
    font-weight: 600;
    color: var(--text-main);
}

.merchant-sub {
    font-size: 11px;
    color: var(--text-dim);
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.tag-qris { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.tag-va { background: rgba(236, 72, 153, 0.15); color: #f472b6; }
.tag-tf { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }

.entity-personal { color: var(--text-muted); }
.entity-miriva { color: #facc15; font-weight: 700; }
.entity-surejase { color: #818cf8; font-weight: 700; }

.amount-display {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 14px;
    color: #fff;
}

.btn-icon-receipt {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.btn-icon-receipt:hover {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
}

/* Filter Bar */
.filter-bar {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    flex: 1;
    max-width: 420px;
}

.search-box input {
    background: none;
    border: none;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 13px;
    width: 100%;
    outline: none;
}

.filter-group {
    display: flex;
    gap: 12px;
}

.select-dropdown {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    outline: none;
    cursor: pointer;
}

.select-dropdown option {
    background: #0d1322;
    color: #fff;
}

/* Email Tester */
.email-tester-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.tester-input-card, .tester-result-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.preset-buttons {
    display: flex;
    gap: 8px;
}

.textarea-wrapper {
    flex: 1;
    margin-top: 14px;
}

.textarea-wrapper textarea {
    width: 100%;
    height: 320px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    color: #a5f3fc;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    line-height: 1.5;
    outline: none;
    resize: none;
}

.textarea-wrapper textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

.tester-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.extraction-container {
    min-height: 320px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-top: 14px;
}

.extraction-container.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.placeholder-msg {
    color: var(--text-dim);
    max-width: 280px;
}

.placeholder-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 10px;
}

.parsed-result-box {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.parsed-header-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.parsed-field-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.parsed-label { color: var(--text-dim); }
.parsed-val { color: var(--text-main); font-weight: 600; }
.parsed-val.highlight { color: #38bdf8; font-size: 15px; }

/* Copilot Tab */
.copilot-layout {
    display: flex;
    flex-direction: column;
    height: 650px;
    padding: 24px;
}

.copilot-chat-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-color);
}

.copilot-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #06b6d4, #8b5cf6);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.copilot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.copilot-msg {
    display: flex;
    gap: 12px;
    max-width: 80%;
}

.copilot-msg.user-msg {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.msg-avatar {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.msg-bubble {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 14px;
    line-height: 1.5;
}

.user-msg .msg-bubble {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(99, 102, 241, 0.2));
    border-color: rgba(6, 182, 212, 0.4);
}

.suggested-queries {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.query-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.query-chip:hover {
    background: rgba(6, 182, 212, 0.15);
    border-color: var(--primary);
}

.copilot-input-bar {
    display: flex;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.copilot-input-bar input {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 12px 18px;
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 14px;
    outline: none;
}

.copilot-input-bar input:focus {
    border-color: var(--primary);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.open {
    display: flex;
}

.modal-card {
    width: 480px;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.bca-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bca-logo-pill {
    background: #0060af;
    color: #fff;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.btn-close-modal {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 24px;
    cursor: pointer;
}

.btn-close-modal:hover {
    color: #fff;
}

.receipt-body {
    padding: 20px 0 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Responsive */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .charts-grid { grid-template-columns: 1fr; }
    .email-tester-grid { grid-template-columns: 1fr; }
    .sidebar { width: 80px; padding: 20px 10px; }
    .brand-text, .nav-item span:not(.nav-icon), .status-info { display: none; }
    .nav-item { justify-content: center; padding: 12px; }
}
