:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #ec4899;
    --bg-dark: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --success: #10b981;
    --danger: #ef4444;
}

.hidden {
    display: none !important;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* Background Blobs */
.background-blob {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    top: -200px;
    left: -200px;
    opacity: 0.3;
    z-index: -1;
    filter: blur(80px);
}

.blob-2 {
    top: auto;
    bottom: -200px;
    left: auto;
    right: -200px;
    background: radial-gradient(circle, var(--secondary) 0%, transparent 70%);
}

.app-container {
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
}

header {
    padding: 2rem;
    border-bottom: 1px solid var(--glass-border);
}

header h1 {
    margin: 0;
    font-size: 2rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-muted);
    margin-top: 0.5rem;
}

#main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.app-notification {
    margin: 1.25rem 2rem 0 2rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid transparent;
    font-weight: 600;
    line-height: 1.35;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.app-notification.visible {
    opacity: 1;
    transform: translateY(0);
}

.app-notification.success {
    background: rgba(16, 185, 129, 0.15);
    color: #a7f3d0;
    border-color: rgba(16, 185, 129, 0.55);
}

.app-notification.error {
    background: rgba(239, 68, 68, 0.15);
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.6);
}

/* Queue View */
.filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.execution-options {
    margin-bottom: 1.5rem;
    border: 1px solid var(--glass-border);
}

.execution-options-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.execution-options-header h3 {
    margin: 0;
    color: var(--primary);
}

.execution-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option-group label,
.option-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.option-date {
    width: 100%;
    box-sizing: border-box;
}

.option-group .option-check {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-main);
    font-size: 0.95rem;
}

.option-error {
    color: #fda4af;
    font-size: 0.8rem;
}

.execution-options-summary {
    margin: 1rem 0 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ghost:hover {
    color: white;
    border-color: white;
}

.glass-input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    color: white;
    width: 300px;
    outline: none;
    transition: all 0.3s;
}

.glass-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.card-list {
    display: grid;
    gap: 1rem;
}

.non-recurring-panel {
    margin-top: 1.5rem;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.03);
}

.non-recurring-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.non-recurring-header h3 {
    margin: 0;
    color: #fbbf24;
}

.non-recurring-header span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.non-recurring-list {
    display: grid;
    gap: 0.85rem;
}

.non-recurring-item {
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    display: grid;
    grid-template-columns: 1.7fr 1fr auto;
    gap: 0.9rem;
    align-items: end;
    background: rgba(15, 23, 42, 0.5);
}

.non-recurring-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.non-recurring-meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.non-recurring-category {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.non-recurring-category label {
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.unsaved-indicator {
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.5);
    background: rgba(245, 158, 11, 0.12);
    border-radius: 999px;
    padding: 0.1rem 0.45rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.non-recurring-category-input {
    width: 100%;
    min-width: 180px;
    padding: 0.6rem 0.8rem;
    border-radius: 10px;
}

.non-recurring-row-actions {
    display: flex;
    gap: 0.55rem;
}

.non-recurring-row-actions .btn-accept,
.non-recurring-row-actions .btn-reject {
    padding: 0.6rem 0.85rem;
    border-radius: 10px;
    font-size: 0.85rem;
    white-space: nowrap;
}

.non-recurring-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

.btn-accept:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.btn-ghost:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    border-color: var(--glass-border);
    color: var(--text-muted);
}

.conciliation-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
}

.conciliation-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
}

.item-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.item-meta {
    display: flex;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.candidates-count {
    color: var(--success);
    font-weight: 500;
}

/* Detail View */
.details-view {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.btn-back {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    margin-bottom: 1rem;
    font-size: 1rem;
    text-align: left;
}

.btn-back:hover {
    color: white;
}

.split-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    flex: 1;
    min-height: 0;
    /* Chrome fix for nested flex scroll */
}

.glass-panel {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.glass-panel h2 {
    margin-top: 0;
    color: var(--primary);
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
}

.candidates-list {
    flex: 1;
    overflow-y: auto;
    margin: 1rem 0;
}

.candidate-item {
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    gap: 1rem;
    align-items: center;
}

.candidate-item:last-child {
    border-bottom: none;
}

.candidate-details {
    flex: 1;
}

.actions {
    margin-top: auto;
    display: flex;
    justify-content: flex-end;
}

.btn-accept,
.btn-reject {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-accept {
    background: var(--success);
    color: white;
}

.btn-accept:hover {
    background: #059669;
}

.btn-reject {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.btn-reject:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Data Rows */
.data-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.label {
    color: var(--text-muted);
}

/* Header Actions */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Botão de Processamento */
.btn-process {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-process:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-process:active {
    transform: translateY(0);
}

.btn-process .icon {
    font-size: 1.1rem;
}

/* Status Indicator */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--primary);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.status-indicator:hover {
    background: rgba(99, 102, 241, 0.2);
}

.status-indicator.hidden {
    display: none;
}

.pulse {
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
}

.modal-content {
    width: 90%;
    max-width: 650px;
    max-height: 85vh;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    animation: modalIn 0.3s ease-out;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-close:hover {
    color: white;
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
}

/* Execution Layout */
.execution-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
}

.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
}

.status-badge.QUEUED {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-muted);
    border: 1px solid var(--text-muted);
}

.status-badge.RUNNING {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border: 1px solid var(--primary);
}

.status-badge.COMPLETED {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
}

.status-badge.FAILED {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 1rem;
    border: 1px solid var(--glass-border);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.current-step {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.metric-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 1.25rem;
    border-radius: 16px;
    text-align: center;
}

.metric-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
}

/* History */
.execution-history h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.history-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.hist-date {
    font-size: 0.9rem;
    font-weight: 600;
}

.hist-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.hist-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.hist-status.COMPLETED {
    background: var(--success);
}

.hist-status.FAILED {
    background: var(--danger);
}
/* Login View */
.login-view {
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-form {
    width: 100%;
    max-width: 400px;
    padding: 3rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    text-align: center;
}

.login-form h2 {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
}

.login-form p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.input-group {
    text-align: left;
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.input-group .glass-input {
    width: 100%;
    box-sizing: border-box;
}

.btn-login {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 1rem;
}

.btn-login:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Logout Button */
.btn-logout {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-logout:hover {
    color: white;
    border-color: white;
}

.btn-logout.hidden {
    display: none;
}

@media (max-width: 900px) {
    .app-notification {
        margin: 1rem 1rem 0 1rem;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .filters .glass-input {
        width: 100%;
        box-sizing: border-box;
    }

    .execution-options-grid {
        grid-template-columns: 1fr;
    }

    .non-recurring-item {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .non-recurring-row-actions {
        justify-content: flex-start;
    }
}
