/* =========================================
   Conciliação Bancária — Design System
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Color palette */
    --bg-primary: #0a0a1a;
    --bg-secondary: #111128;
    --bg-card: #16162e;
    --bg-card-hover: #1c1c3a;
    --bg-input: #1a1a35;
    
    --border-color: #2a2a4a;
    --border-hover: #3a3a6a;
    --sidebar-bg: #16162e;
    
    --text-primary: #e8e8f0;
    --text-secondary: #9898b8;
    --text-muted: #6868a0;
    
    --accent-blue: #4d7cff;
    --accent-blue-glow: rgba(77, 124, 255, 0.3);
    --accent-purple: #8b5cf6;
    --accent-purple-glow: rgba(139, 92, 246, 0.3);
    --accent-green: #10b981;
    --accent-green-glow: rgba(16, 185, 129, 0.2);
    --accent-red: #ef4444;
    --accent-red-glow: rgba(239, 68, 68, 0.2);
    --accent-yellow: #f59e0b;
    --accent-yellow-glow: rgba(245, 158, 11, 0.2);
    --accent-cyan: #06b6d4;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #4d7cff, #8b5cf6);
    --gradient-success: linear-gradient(135deg, #10b981, #06b6d4);
    --gradient-danger: linear-gradient(135deg, #ef4444, #f59e0b);
    --gradient-card: linear-gradient(145deg, #16162e, #1a1a3a);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow-blue: 0 0 20px var(--accent-blue-glow);
    --shadow-glow-purple: 0 0 20px var(--accent-purple-glow);
    
    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================
   Reset & Base
   ========================================= */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background animated gradient */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(77, 124, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(6, 182, 212, 0.04) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* =========================================
   Layout
   ========================================= */

.layout-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    z-index: 10;
}

.sidebar .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px 32px 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.sidebar .logo-icon {
    width: 36px;
    height: 36px;
    background: var(--gradient-primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: var(--shadow-glow-blue);
}

.sidebar h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.sidebar-menu {
    list-style: none;
    padding: 0 12px;
    flex: 1;
}

.sidebar-menu li {
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    margin-bottom: 4px;
    /* No padding here — it lives on .sidebar-link */
}

/* Block-level link that fills the entire li tap target */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    width: 100%;
    color: inherit;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast), color var(--transition-fast);
}

.sidebar-menu li:hover > .sidebar-link {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.sidebar-menu li.active > .sidebar-link {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-glow-blue);
}

.sidebar-menu li.active {
    background: transparent; /* gradient lives on .sidebar-link now */
    box-shadow: none;
}

/* ── Sidebar back button (Estado 2: Financeiro) ── */
.sidebar-back {
    padding: 0 12px 16px 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
    background: transparent;
}

.sidebar-back-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

/* ── Estado 2: Financeiro tabs ── */
/* These li items use data-module JS (no anchor inside), so hover lives on the li itself */
.sidebar-financeiro li {
    padding: 12px 16px;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast), color var(--transition-fast);
}

.sidebar-financeiro li:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.sidebar-financeiro li.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-glow-blue);
}

.app-container {
    flex: 1;
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    overflow-x: hidden;
}

/* =========================================
   Header
   ========================================= */

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    margin-bottom: 28px;
    backdrop-filter: blur(10px);
}

.app-header .logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.app-header .logo-icon {
    width: 44px;
    height: 44px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: var(--shadow-glow-blue);
}

.app-header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.app-header .subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* =========================================
   Navigation Tabs
   ========================================= */

.nav-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-secondary);
    padding: 5px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 28px;
    overflow-x: auto;
}

.nav-tab {
    padding: 12px 24px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.nav-tab.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-glow-blue);
}

.nav-tab .badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.nav-tab.active .badge {
    background: rgba(255, 255, 255, 0.3);
}

/* =========================================
   Tab Content
   ========================================= */

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

/* =========================================
   Cards
   ========================================= */

.card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: var(--border-hover);
}

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

.card-title {
    font-size: 1.05rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title .icon {
    font-size: 1.2rem;
}

/* =========================================
   Upload Zone
   ========================================= */

.upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
}

.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    background: var(--bg-card);
    position: relative;
    overflow: hidden;
}

.upload-zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.upload-zone:hover {
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-glow-blue);
}

.upload-zone:hover::before {
    opacity: 0.05;
}

.upload-zone.dragover {
    border-color: var(--accent-purple);
    box-shadow: var(--shadow-glow-purple);
    transform: scale(1.01);
}

.upload-zone.loaded {
    border-color: var(--accent-green);
    border-style: solid;
}

.upload-zone .upload-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.upload-zone .upload-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}

.upload-zone .upload-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    position: relative;
    z-index: 1;
}

.upload-zone .upload-status {
    margin-top: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent-green);
    position: relative;
    z-index: 1;
}

.upload-zone input[type="file"] {
    display: none;
}

/* =========================================
   Stats Grid
   ========================================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card.blue::after { background: var(--gradient-primary); }
.stat-card.green::after { background: var(--gradient-success); }
.stat-card.red::after { background: var(--gradient-danger); }
.stat-card.purple::after { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }
.stat-card.cyan::after { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.stat-card.yellow::after { background: linear-gradient(135deg, #f59e0b, #fbbf24); }

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.stat-value.blue { color: var(--accent-blue); }
.stat-value.green { color: var(--accent-green); }
.stat-value.red { color: var(--accent-red); }
.stat-value.purple { color: var(--accent-purple); }
.stat-value.cyan { color: var(--accent-cyan); }
.stat-value.yellow { color: var(--accent-yellow); }

.stat-change {
    font-size: 0.75rem;
    margin-top: 4px;
    color: var(--text-secondary);
}

/* =========================================
   Tables
   ========================================= */

.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

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

thead {
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 2;
}

th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(42, 42, 74, 0.4);
    color: var(--text-primary);
    vertical-align: middle;
}

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

/* Scoped: exclude FullCalendar grid rows */
tbody tr:hover:not(.fc-timegrid-slot):not(.fc-scrollgrid-section) {
    background: var(--bg-card-hover);
}
/* Explicitly prevent FC slot rows from getting hover bg */
#calendar tbody tr:hover {
    background: transparent !important;
}

tbody tr:last-child td {
    border-bottom: none;
}

.cell-money {
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    text-align: right;
    white-space: nowrap;
}

.cell-money.positive { color: var(--accent-green); }
.cell-money.negative { color: var(--accent-red); }

.cell-date {
    color: var(--text-secondary);
    white-space: nowrap;
}

.cell-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.cell-badge.visa { background: rgba(77, 124, 255, 0.15); color: #6d9bff; }
.cell-badge.mastercard { background: rgba(239, 68, 68, 0.15); color: #ff7171; }
.cell-badge.elo { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.cell-badge.debito { background: rgba(6, 182, 212, 0.15); color: #22d3ee; }
.cell-badge.credito { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.cell-badge.conciliado { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.cell-badge.pendente { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.cell-badge.divergente { background: rgba(239, 68, 68, 0.15); color: #ff7171; }
.cell-badge.cancelamento { background: rgba(239, 68, 68, 0.15); color: #ff7171; }

/* =========================================
   Buttons
   ========================================= */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-glow-blue);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 30px var(--accent-blue-glow);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

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

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

.btn-success {
    background: var(--gradient-success);
}

/* =========================================
   Form Controls (Modals/Agenda)
   ========================================= */

.form-control {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}


.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 20px var(--accent-green-glow);
}

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

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-icon:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
}

/* =========================================
   Charts Area
   ========================================= */

.chart-container {
    position: relative;
    width: 100%;
    height: 350px;
    padding: 8px;
}

.chart-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

/* =========================================
   Conciliation Section
   ========================================= */

.conciliation-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.conciliation-actions label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.conciliation-actions input[type="number"] {
    width: 70px;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    text-align: center;
}

.conciliation-actions input[type="number"]:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

/* =========================================
   Toast / Notifications
   ========================================= */

.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    min-width: 300px;
}

.toast.success {
    background: linear-gradient(135deg, #064e3b, #065f46);
    border: 1px solid #10b981;
    color: #a7f3d0;
}

.toast.error {
    background: linear-gradient(135deg, #7f1d1d, #991b1b);
    border: 1px solid #ef4444;
    color: #fecaca;
}

.toast.info {
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    border: 1px solid #6366f1;
    color: #c7d2fe;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100px); }
}

/* =========================================
   Loading Spinner
   ========================================= */

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 26, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    backdrop-filter: blur(4px);
}

.loading-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.loading-content .spinner {
    width: 40px;
    height: 40px;
    border-width: 3px;
    border-top-color: var(--accent-blue);
}

/* =========================================
   Empty State
   ========================================= */

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

.empty-state .empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.85rem;
    max-width: 400px;
    margin: 0 auto;
}

/* =========================================
   Filter Bar
   ========================================= */

.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-bar select,
.filter-bar input[type="text"],
.filter-bar input[type="date"] {
    padding: 8px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
}

.filter-bar select:focus,
.filter-bar input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

.filter-bar select option {
    background: var(--bg-secondary);
}

/* =========================================
   Progress Bar
   ========================================= */

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar .fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-bar .fill.green { background: var(--gradient-success); }
.progress-bar .fill.blue { background: var(--gradient-primary); }

/* =========================================
   Scrollbar
   ========================================= */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* =========================================
   Responsive
   ========================================= */

@media (max-width: 1024px) {
    .upload-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-row {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 12px;
    }
    
    .app-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .nav-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .conciliation-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ============ Form Utilities ============ */
.form-label {
    display: block;
    margin-bottom: 4px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: #ffffff;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.form-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--bg-secondary);
}

/* ============ Tooltip Parcelas ============ */
.tooltip-container {
    position: relative;
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--accent-blue);
    font-size: 11px;
    font-weight: bold;
    cursor: help;
    transition: all 0.2s;
}

.info-icon:hover {
    border-color: var(--accent-blue);
    background: rgba(99, 102, 241, 0.1);
}

.tooltip-box {
    visibility: hidden;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    width: 240px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.tooltip-container:hover .tooltip-box,
.tooltip-container.active .tooltip-box {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.tooltip-box::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--border-color) transparent transparent transparent;
}

.tooltip-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 4px;
}

.tooltip-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-family: 'Inter', monospace;
}

.tooltip-footer {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-color);
    font-weight: 600;
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    color: var(--accent-green);
}

.tooltip-close {
    display: none;
    position: absolute;
    top: 5px;
    right: 8px;
    cursor: pointer;
    color: var(--text-muted);
}

/* Mobile Popover Adjustments */
@media (max-width: 768px) {
    .tooltip-box {
        position: fixed;
        bottom: 20px;
        left: 20px;
        right: 20px;
        width: auto;
        transform: none;
        bottom: 50%;
        transform: translateY(50%);
    }
    .tooltip-box::after { display: none; }
    .tooltip-close { display: block; }
}

