/* ============================================================
   Claims Portal — Dark Cyberpunk Design System
   ============================================================ */

:root {
    /* Backgrounds */
    --bg-body: #06080f;
    --bg-surface: #0f1219;
    --bg-card: #151a27;
    --bg-card-hover: #1a2033;
    --bg-input: #0f1219;
    --bg-nav: #0b0e17;

    /* Borders */
    --border-subtle: #1e2538;
    --border-default: #2a3148;
    --border-accent: #7c3aed44;

    /* Primary */
    --primary: #8b5cf6;
    --primary-hover: #a78bfa;
    --primary-dim: #7c3aed;
    --primary-glow: rgba(139, 92, 246, 0.25);

    /* Accent */
    --accent: #06b6d4;
    --accent-hover: #22d3ee;
    --accent-glow: rgba(6, 182, 212, 0.2);

    /* Text */
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #0a0e1a;

    /* Status */
    --status-new: #3b82f6;
    --status-pending: #f59e0b;
    --status-progress: #8b5cf6;
    --status-submitted: #06b6d4;
    --status-closed: #6b7280;
    --status-paid: #10b981;
    --status-denied: #ef4444;

    /* Misc */
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --transition: 150ms ease;

    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-body);
    background: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

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

a:hover {
    color: var(--primary-hover);
}

/* ---- Navigation ---- */
.main-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 32px;
    height: 56px;
    background: var(--bg-nav);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 16px;
}

.brand-icon {
    font-size: 18px;
    color: var(--primary);
    text-shadow: 0 0 12px var(--primary-glow);
}

.brand-text {
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.nav-link {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.nav-link.active {
    color: var(--primary);
    background: rgba(139, 92, 246, 0.1);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.nav-user-name {
    font-size: 13px;
    color: var(--text-secondary);
}

.nav-logout {
    color: var(--text-muted) !important;
    font-size: 12px;
}

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 99px;
    background: linear-gradient(135deg, var(--status-pending), #fbbf24);
    color: var(--bg-body);
    font-size: 10px;
    font-weight: 700;
    font-family: var(--font-mono);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.nav-role-badge {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 99px;
}

.badge-admin {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-staff {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-customer {
    background: rgba(6, 182, 212, 0.15);
    color: #22d3ee;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

/* ---- Layout ---- */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px 32px;
}

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

.page-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

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

/* ---- Cards ---- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
    border-color: var(--border-accent);
    box-shadow: 0 0 20px var(--primary-glow);
}

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

.card-title {
    font-size: 15px;
    font-weight: 600;
}

/* ---- Stat Cards ---- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity var(--transition);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    font-family: var(--font-mono);
    background: linear-gradient(135deg, var(--text-primary), var(--primary-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ---- Tables ---- */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
}

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

thead th {
    background: var(--bg-surface);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-default);
    white-space: nowrap;
    position: sticky;
    top: 0;
}

tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

tbody tr {
    transition: background var(--transition);
}

tbody tr:hover {
    background: var(--bg-card-hover);
}

tbody tr:nth-child(even) {
    background: rgba(15, 18, 25, 0.5);
}

tbody tr:nth-child(even):hover {
    background: var(--bg-card-hover);
}

.cell-mono {
    font-family: var(--font-mono);
    font-size: 12px;
}

.cell-amount {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-primary);
}

.cell-link {
    color: var(--primary);
    font-weight: 500;
}

.cell-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* ---- Status Badges ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.badge-new { background: rgba(59,130,246,0.12); color: #60a5fa; border: 1px solid rgba(59,130,246,0.25); }
.badge-new::before { background: #3b82f6; box-shadow: 0 0 6px rgba(59,130,246,0.5); }

.badge-pending, .badge-pending_customer { background: rgba(245,158,11,0.12); color: #fbbf24; border: 1px solid rgba(245,158,11,0.25); }
.badge-pending::before, .badge-pending_customer::before { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,0.5); }

.badge-in_progress { background: rgba(139,92,246,0.12); color: #a78bfa; border: 1px solid rgba(139,92,246,0.25); }
.badge-in_progress::before { background: #8b5cf6; box-shadow: 0 0 6px rgba(139,92,246,0.5); }

.badge-submitted { background: rgba(6,182,212,0.12); color: #22d3ee; border: 1px solid rgba(6,182,212,0.25); }
.badge-submitted::before { background: #06b6d4; box-shadow: 0 0 6px rgba(6,182,212,0.5); }

.badge-closed { background: rgba(107,114,128,0.12); color: #9ca3af; border: 1px solid rgba(107,114,128,0.25); }
.badge-closed::before { background: #6b7280; }

.badge-paid, .badge-completed { background: rgba(16,185,129,0.12); color: #34d399; border: 1px solid rgba(16,185,129,0.25); }
.badge-paid::before, .badge-completed::before { background: #10b981; box-shadow: 0 0 6px rgba(16,185,129,0.5); }

.badge-denied, .badge-expired { background: rgba(239,68,68,0.12); color: #f87171; border: 1px solid rgba(239,68,68,0.25); }
.badge-denied::before, .badge-expired::before { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,0.5); }

/* Action required indicator - draws attention to claims blocked on customer response */
.badge-action-required {
    background: rgba(249,115,22,0.15);
    color: #fb923c;
    border: 1px solid rgba(249,115,22,0.4);
    margin-left: 6px;
    animation: pulse-action 2s ease-in-out infinite;
}
.badge-action-required::before {
    background: #f97316;
    box-shadow: 0 0 8px rgba(249,115,22,0.7);
}

@keyframes pulse-action {
    0%, 100% { box-shadow: 0 0 0 0 rgba(249,115,22,0.4); }
    50% { box-shadow: 0 0 0 4px rgba(249,115,22,0); }
}

tr.row-action-required {
    background: rgba(249,115,22,0.04);
    border-left: 3px solid #f97316;
}
tr.row-action-required:hover {
    background: rgba(249,115,22,0.08);
}
tr.row-action-required td:first-child {
    box-shadow: inset 3px 0 0 #f97316;
}

/* ---- Forms ---- */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-label .required {
    color: var(--status-denied);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.form-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-subtle);
}

.form-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-section-title::before {
    content: '';
    width: 3px;
    height: 16px;
    background: var(--accent);
    border-radius: 2px;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-dim), var(--primary));
    color: #fff;
    box-shadow: 0 2px 12px var(--primary-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    box-shadow: 0 4px 20px var(--primary-glow);
    transform: translateY(-1px);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-accent);
}

.btn-accent {
    background: linear-gradient(135deg, #0891b2, var(--accent));
    color: #fff;
    box-shadow: 0 2px 12px var(--accent-glow);
}

.btn-accent:hover {
    box-shadow: 0 4px 20px var(--accent-glow);
    transform: translateY(-1px);
    color: #fff;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

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

.btn-lg {
    padding: 14px 28px;
    font-size: 15px;
}

/* ---- Alerts ---- */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.25);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.25);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.25);
}

.alert-info {
    background: rgba(6, 182, 212, 0.1);
    color: #22d3ee;
    border-color: rgba(6, 182, 212, 0.25);
}

/* ---- Login Page ---- */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(6, 182, 212, 0.06) 0%, transparent 50%),
        var(--bg-body);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo .brand-icon {
    font-size: 28px;
    display: block;
    margin-bottom: 12px;
}

.login-logo .brand-text {
    font-size: 20px;
}

/* ---- Detail Page ---- */
.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.detail-grid-full {
    grid-template-columns: 1fr;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 13px;
}

.detail-label {
    color: var(--text-muted);
    font-weight: 500;
}

.detail-value {
    color: var(--text-primary);
    text-align: right;
    font-weight: 500;
}

/* ---- Filters ---- */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
    align-items: flex-end;
}

.filters .form-group {
    margin-bottom: 0;
    min-width: 160px;
}

.filters .form-input,
.filters .form-select {
    padding: 8px 12px;
    font-size: 13px;
}

/* ---- Pagination ---- */
.pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 24px;
}

.pagination a,
.pagination span {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    transition: all var(--transition);
}

.pagination a:hover {
    background: var(--bg-card);
    border-color: var(--border-accent);
    color: var(--primary);
}

.pagination .active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ---- Timeline ---- */
.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-default);
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -21px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--bg-card);
    box-shadow: 0 0 8px var(--primary-glow);
}

.timeline-date {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.timeline-content {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ---- Upload ---- */
.upload-zone {
    border: 2px dashed var(--border-default);
    border-radius: var(--radius-lg);
    padding: 48px;
    text-align: center;
    transition: all var(--transition);
    cursor: pointer;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.05);
}

.upload-zone-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.upload-zone-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.upload-zone-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ---- Footer ---- */
.main-footer {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 12px;
    border-top: 1px solid var(--border-subtle);
    margin-top: 48px;
}

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

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state-text {
    font-size: 15px;
    margin-bottom: 20px;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .main-nav {
        flex-wrap: wrap;
        height: auto;
        padding: 12px 16px;
        gap: 8px;
    }
    .nav-links {
        order: 3;
        width: 100%;
        overflow-x: auto;
    }
    .container {
        padding: 16px;
    }
    .detail-grid {
        grid-template-columns: 1fr;
    }
    .stat-grid {
        grid-template-columns: 1fr 1fr;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
}
