:root {
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --text: #0F172A;
    --subtext: #64748B;
    --border: #E2E8F0;
    --background: #F8FAFF;
    --card-bg: #FFFFFF;
    --shadow: 0 24px 50px rgba(15, 23, 42, 0.12);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.user-profile--compact {
    padding: 12px 18px;
    gap: 12px;
}

.user-profile--compact .user-avatar {
    width: 42px;
    height: 42px;
    font-size: 18px;
}

.user-profile--compact .signout-btn {
    padding: 10px 18px;
}

* {
    box-sizing: border-box;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% -10%, rgba(37, 99, 235, 0.16), transparent 45%),
        radial-gradient(circle at 90% 120%, rgba(56, 189, 248, 0.18), transparent 55%),
        var(--background);
    color: var(--text);
}
.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.app-header {
    background: var(--card-bg);
    padding: 48px 80px 36px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-profile {
    display: inline-flex;
    align-items: center;
    gap: 18px;
    padding: 14px 24px;
    border-radius: 999px;
    border: 1px solid rgba(226, 232, 240, 0.65);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(14px);
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: grid;
    place-items: center;
    color: white;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 0.05em;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    line-height: 1.1;
}

.brand-text h1 {
    font-size: 32px;
    margin: 0 0 6px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.brand-text p {
    margin: 0;
    color: var(--subtext);
    font-weight: 500;
    font-size: 15px;
}

.tab-bar {
    display: flex;
    gap: 12px;
    padding: 0 8px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.85);
}

.tab {
    border: none;
    background: transparent;
    padding: 24px 16px 18px;
    font-size: 15px;
    font-weight: 600;
    color: var(--subtext);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    position: relative;
    transition: color 0.2s ease;
}

.tab-icon svg {
    width: 20px;
    height: 20px;
}

.tab.active {
    color: var(--primary);
}

.user-label {
    font-size: 12px;
    font-weight: 600;
    color: rgba(100, 116, 139, 0.9);
    letter-spacing: 0.02em;
}

.user-email {
    font-size: 15px;
    font-weight: 600;
}

.tab {
    position: relative;
}

.tab::after {
    content: '';
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: -1px;
    height: 3px;
    border-radius: 999px;
    background: transparent;
    transition: background 0.2s ease;
}

.signout-btn {
    border: none;
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary);
    font-weight: 600;
    border-radius: 999px;
    padding: 10px 22px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.signout-btn:hover {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    transform: translateY(-1px);
}

.signout-btn:active {
    transform: translateY(0);
    background: linear-gradient(135deg, rgba(29, 78, 216, 0.75), rgba(30, 64, 175, 0.9));
}

.card {
    flex: 1;
    background: var(--card-bg);
    padding: 0 80px 72px;
}

.panel {
    padding: 36px 0 0;
}

.panel h2 {
    font-size: 26px;
    margin: 0 0 24px;
    font-weight: 700;
}

.transaction-form {
    background: rgba(248, 250, 255, 0.92);
    border-radius: 28px;
    padding: 48px;
    border: 1px solid rgba(226, 232, 240, 0.7);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 28px 36px;
}

.form-field label {
    display: block;
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 12px;
    color: var(--text);
}

.form-field input,
.form-field select {
    width: 100%;
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-field input::placeholder {
    color: rgba(148, 163, 184, 0.9);
}

.form-field input:focus,
.form-field select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: '';
    position: absolute;
    pointer-events: none;
    right: 16px;
    top: 50%;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--subtext);
    border-bottom: 2px solid var(--subtext);
    transform: translateY(-60%) rotate(45deg);
}

.form-field select {
    appearance: none;
    background-color: transparent;
    padding-right: 42px;
}

.form-field.checkbox {
    display: flex;
    align-items: flex-end;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    color: var(--text);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 1.5px solid var(--border);
    accent-color: var(--primary);
}

.primary-btn {
    margin-top: 40px;
    width: 100%;
    padding: 20px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    cursor: pointer;
    box-shadow: 0 18px 30px rgba(37, 99, 235, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 34px rgba(37, 99, 235, 0.4);
}

.secondary-btn:hover {
    background: rgba(37, 99, 235, 0.12);
    transform: translateY(-1px);
}

.transactions-card {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 28px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.08);
    padding: 36px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.transactions-card--alerts {
    border-color: rgba(239, 68, 68, 0.35);
    box-shadow: 0 32px 60px rgba(239, 68, 68, 0.15);
}

.transactions-row--flagged {
    background: rgba(254, 226, 226, 0.7);
}

.transactions-amount {
    font-weight: 700;
}

.transactions-status__icon {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: currentColor;
}

.detail-drawer {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(8px);
    transition: opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
    z-index: 1200;
}

.detail-drawer[aria-hidden="false"] {
    opacity: 1;
    pointer-events: auto;
}

.detail-drawer__backdrop {
    position: absolute;
    inset: 0;
}

.detail-drawer__panel {
    position: relative;
    width: min(960px, calc(100% - 64px));
    background: #fff;
    border-radius: 26px;
    box-shadow: 0 26px 70px rgba(15, 23, 42, 0.18);
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.detail-drawer__header {
    display: flex;
    align-items: center;
    gap: 18px;
}

.detail-drawer__back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(248, 250, 255, 0.92);
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
}

.detail-drawer__back:hover {
    border-color: rgba(37, 99, 235, 0.6);
}

.detail-drawer__header h2 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.detail-section {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.detail-section h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

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

.summary-grid article {
    background: rgba(248, 250, 255, 0.92);
    border-radius: 18px;
    padding: 18px 20px;
    border: 1px solid rgba(226, 232, 240, 0.7);
}

.summary-label {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(100, 116, 139, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.summary-value {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.summary-subvalue {
    margin: 6px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: rgba(100, 116, 139, 0.9);
}

.reasons-list {
    display: grid;
    gap: 16px;
}

.reason-card {
    display: flex;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 18px;
    border: 1px solid rgba(250, 204, 21, 0.5);
    background: rgba(253, 230, 138, 0.24);
}

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

.reason-title {
    margin: 0 0 6px;
    font-weight: 700;
    color: #B45309;
}

.reason-body {
    margin: 0;
    font-size: 14px;
    color: rgba(100, 116, 139, 0.95);
}

.detail-actions {
    background: rgba(248, 250, 255, 0.92);
    border-radius: 18px;
    border: 1px solid rgba(226, 232, 240, 0.7);
    padding: 22px 24px 26px;
}

.detail-actions p {
    margin: 0;
    color: var(--subtext);
    font-weight: 500;
}

.detail-actions__buttons {
    margin-top: 18px;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.detail-btn {
    padding: 14px 22px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.detail-btn--primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 18px 32px rgba(37, 99, 235, 0.35);
}

.detail-btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 38px rgba(37, 99, 235, 0.4);
}

.detail-btn--secondary {
    background: #fff;
    color: var(--primary);
    border-color: rgba(37, 99, 235, 0.45);
}

.detail-btn--secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 26px rgba(15, 23, 42, 0.12);
}

@media (max-width: 720px) {
    .detail-drawer__panel {
        width: calc(100% - 32px);
        padding: 28px 22px;
    }

    .detail-drawer__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .detail-actions__buttons {
        flex-direction: column;
    }
}

.transactions-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.transactions-card__title h3 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.transactions-card__title p {
    margin: 0;
    color: var(--subtext);
    font-weight: 500;
    font-size: 14px;
}

.transactions-table {
    border-radius: 22px;
    background: rgba(248, 250, 255, 0.92);
    border: 1px solid rgba(226, 232, 240, 0.8);
    overflow: hidden;
    position: relative;
}

.transactions-table__head,
.transactions-row {
    display: grid;
    grid-template-columns: minmax(120px, 1.1fr) minmax(110px, 0.8fr) minmax(160px, 1.2fr) minmax(160px, 1.2fr) minmax(150px, 1fr) minmax(120px, 0.8fr);
    align-items: center;
    padding: 18px 28px;
    gap: 18px;
}

.transactions-table__head {
    background: rgba(15, 23, 42, 0.04);
    color: rgba(15, 23, 42, 0.65);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.transactions-table__body {
    display: flex;
    flex-direction: column;
}

.transactions-row {
    background: #fff;
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.transactions-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 24px rgba(15, 23, 42, 0.08);
}

.transactions-row:last-child {
    border-bottom: none;
}

.transactions-row__merchant {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.transactions-row__merchant span:last-child {
    font-size: 12px;
    font-weight: 500;
    color: rgba(100, 116, 139, 0.9);
    text-transform: capitalize;
}

.transactions-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid transparent;
}

.transactions-status--clean {
    background: rgba(34, 197, 94, 0.12);
    color: #166534;
    border-color: rgba(34, 197, 94, 0.3);
}

.transactions-status--flagged {
    background: rgba(239, 68, 68, 0.12);
    color: #991B1B;
    border-color: rgba(239, 68, 68, 0.35);
}

.transactions-empty {
    margin: 0;
    padding: 32px;
    text-align: center;
    font-weight: 600;
    color: var(--subtext);
}

.transactions-empty[hidden] {
    display: none;
}

.transactions-table__body:empty + .transactions-empty {
    display: block;
}

.transactions-table__body:not(:empty) + .transactions-empty {
    display: none;
}

.card-mask {
    letter-spacing: 0.08em;
}

.transactions-date {
    color: rgba(100, 116, 139, 0.95);
    font-weight: 500;
}

@media (max-width: 1024px) {
    .transactions-table__head,
    .transactions-row {
        grid-template-columns: minmax(110px, 1fr) minmax(100px, 0.8fr) minmax(160px, 1.2fr) minmax(140px, 1.1fr) minmax(140px, 1fr) minmax(120px, 0.9fr);
        padding: 16px 20px;
    }
}

@media (max-width: 720px) {
    .transactions-card {
        padding: 28px 20px;
        border-radius: 22px;
    }

    .transactions-card__header {
        flex-direction: column;
        align-items: stretch;
    }

    .transactions-table__head {
        display: none;
    }

    .transactions-table__body {
        display: grid;
        gap: 16px;
    }

    .transactions-row {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
        padding: 18px 20px;
        border: 1px solid rgba(226, 232, 240, 0.7);
        border-radius: 18px;
        box-shadow: none;
        gap: 12px;
    }

    .transactions-row:hover {
        transform: none;
        box-shadow: none;
    }

    .transactions-row__merchant {
        grid-column: span 2;
    }

    .transactions-status {
        justify-self: flex-start;
    }
}

main.card {
    margin: 0;
}

@media (max-width: 720px) {
    .app-header {
        padding: 32px 24px 24px;
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
    }

    .card {
        padding: 0 24px 48px;
    }

    .user-profile {
        align-self: stretch;
        justify-content: space-between;
        padding: 12px 18px;
    }

    .tab-bar {
        padding: 0;
    }

    .tab {
        flex: 1;
        justify-content: center;
        font-size: 14px;
        padding: 18px 12px 16px;
    }

    .transaction-form {
        padding: 32px 24px;
        border-radius: 22px;
    }

    .form-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 22px;
    }
}
