/* =====================================================
   GERENCIADOR DE PAGAMENTOS - DESIGN SYSTEM
   Modern Light Theme with Premium Aesthetics
   ===================================================== */

/* CSS Custom Properties */
:root {
    /* Colors - Harmonious Blue/Slate Palette */
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-300: #93c5fd;
    --primary-400: #60a5fa;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-800: #1e40af;
    --primary-900: #1e3a8a;
    
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    
    /* Status Colors */
    --success-50: #ecfdf5;
    --success-100: #d1fae5;
    --success-500: #10b981;
    --success-600: #059669;
    --success-700: #047857;
    
    --warning-50: #fffbeb;
    --warning-100: #fef3c7;
    --warning-500: #f59e0b;
    --warning-600: #d97706;
    
    --danger-50: #fef2f2;
    --danger-100: #fee2e2;
    --danger-500: #ef4444;
    --danger-600: #dc2626;
    
    /* Semantic Colors */
    --bg-primary: #ffffff;
    --bg-secondary: var(--slate-50);
    --bg-tertiary: var(--slate-100);
    
    --text-primary: var(--slate-900);
    --text-secondary: var(--slate-600);
    --text-tertiary: var(--slate-400);
    
    --border-color: var(--slate-200);
    --border-color-hover: var(--slate-300);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Spacing */
    --navbar-height: 64px;
    --content-max-width: 1400px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
}

/* Reset and Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

/* =====================================================
   NAVBAR
   ===================================================== */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    z-index: 100;
}

.navbar-container {
    max-width: var(--content-max-width);
    height: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--primary-700);
}

.navbar-brand i {
    font-size: 1.5rem;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
}

.navbar-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.navbar-link:hover {
    color: var(--primary-600);
    background: var(--primary-50);
}

.navbar-link.active {
    color: var(--primary-700);
    background: var(--primary-100);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.user-name {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-logout:hover {
    background: var(--danger-50);
    border-color: var(--danger-500);
    color: var(--danger-600);
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

.logout-form {
    display: flex;
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    padding: 1rem;
    z-index: 99;
    transform: translateY(-100%);
    opacity: 0;
    transition: all var(--transition-normal);
}

.mobile-menu.open {
    transform: translateY(0);
    opacity: 1;
}

.mobile-menu-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.mobile-menu-link:hover {
    background: var(--slate-100);
}

.mobile-menu hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 0.5rem 0;
}

.text-danger {
    color: var(--danger-600) !important;
}

/* =====================================================
   MAIN CONTENT
   ===================================================== */

.main-content {
    margin-top: var(--navbar-height);
    min-height: calc(100vh - var(--navbar-height));
    padding: 2rem 1.5rem;
    max-width: var(--content-max-width);
    margin-left: auto;
    margin-right: auto;
}

/* =====================================================
   ALERTS
   ===================================================== */

.alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: var(--success-50);
    color: var(--success-700);
    border: 1px solid var(--success-100);
}

.alert-error {
    background: var(--danger-50);
    color: var(--danger-600);
    border: 1px solid var(--danger-100);
}

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.alert-close:hover {
    opacity: 1;
}

/* =====================================================
   STATS GRID
   ===================================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    font-size: 1.5rem;
}

.stat-pending .stat-icon {
    background: var(--warning-100);
    color: var(--warning-600);
}

.stat-overdue .stat-icon {
    background: var(--danger-100);
    color: var(--danger-600);
}

.stat-paid .stat-icon {
    background: var(--success-100);
    color: var(--success-600);
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* =====================================================
   TOOLBAR
   ===================================================== */

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* =====================================================
   BUTTONS
   ===================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--slate-50);
    border-color: var(--border-color-hover);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-500), var(--success-600));
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--success-600), var(--success-700));
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-500), var(--warning-600));
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-500), var(--danger-600));
    color: white;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: var(--slate-100);
    color: var(--text-primary);
}

.btn-danger-icon:hover {
    background: var(--danger-50);
    color: var(--danger-600);
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-toggle::after {
    content: '';
    display: inline-block;
    width: 0.4em;
    height: 0.4em;
    border-bottom: 2px solid;
    border-right: 2px solid;
    transform: rotate(45deg);
    margin-left: 0.25em;
    margin-bottom: 0.1em;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    min-width: 200px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    z-index: 50;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: background var(--transition-fast);
}

.dropdown-item:first-child {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.dropdown-item:hover {
    background: var(--slate-50);
}

/* =====================================================
   FILTERS BAR
   ===================================================== */

.filters-bar {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
}

/* =====================================================
   FORM ELEMENTS
   ===================================================== */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    font-family: inherit;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-100);
}

input::placeholder {
    color: var(--text-tertiary);
}

.input-icon {
    position: relative;
}

.input-icon i {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 1rem;
    pointer-events: none;
}

.input-icon input {
    padding-left: 2.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row > * {
    flex: 1;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

.error-text {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: var(--danger-600);
}

/* Checkbox */
.checkbox-group {
    margin-bottom: 1.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
}

.checkbox-label input {
    width: auto;
    margin: 0;
}

/* =====================================================
   CARDS GRID
   ===================================================== */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.payment-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.payment-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: var(--primary-200);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, var(--slate-50), var(--bg-primary));
    border-bottom: 1px solid var(--border-color);
}

.card-supplier {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.card-body {
    padding: 1.25rem;
}

.card-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.info-row i {
    font-size: 1rem;
    color: var(--text-tertiary);
}

.info-row.text-danger {
    color: var(--danger-600);
}

.info-row.text-danger i {
    color: var(--danger-500);
}

.card-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-700);
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    background: var(--slate-50);
    border-top: 1px solid var(--border-color);
}

.footer-left, .footer-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.status-pago {
    background: var(--success-100);
    color: var(--success-700);
}

.status-pendente {
    background: var(--warning-100);
    color: var(--warning-600);
}

.status-atrasado {
    background: var(--danger-100);
    color: var(--danger-600);
}

.status-cancelado {
    background: var(--slate-200);
    color: var(--slate-600);
}

/* Invoice Badges */
.invoice-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
}

.invoice-sim {
    background: var(--success-50);
    color: var(--success-600);
}

.invoice-nao {
    background: var(--slate-100);
    color: var(--slate-500);
}

.invoice-parcial {
    background: var(--warning-50);
    color: var(--warning-600);
}

.receipt-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: var(--primary-50);
    color: var(--primary-600);
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
}

.items-count {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.empty-state i {
    font-size: 4rem;
    color: var(--text-tertiary);
    margin-bottom: 1.5rem;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Pagination */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.pagination-wrapper nav {
    display: flex;
    gap: 0.25rem;
}

.pagination-wrapper a,
.pagination-wrapper span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.pagination-wrapper a:hover {
    background: var(--primary-50);
    border-color: var(--primary-200);
}

.pagination-wrapper span.current {
    background: var(--primary-500);
    border-color: var(--primary-500);
    color: white;
}

/* =====================================================
   DRAWER
   ===================================================== */

.drawer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.drawer.open {
    opacity: 1;
    visibility: visible;
}

.drawer-content {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 600px;
    background: var(--bg-primary);
    box-shadow: var(--shadow-xl);
    transform: translateX(100%);
    transition: transform var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.drawer.open .drawer-content {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--slate-50), var(--bg-primary));
}

.drawer-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.drawer-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.drawer-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.drawer-section h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.section-header h4 {
    margin-bottom: 0;
}

/* Detail Grid */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-item label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.detail-item span {
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.text-bold {
    font-weight: 600;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* Items Table */
.items-table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.items-table {
    width: 100%;
    border-collapse: collapse;
}

.items-table th,
.items-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.875rem;
}

.items-table th {
    background: var(--slate-50);
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.items-table td {
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.items-table tr:last-child td {
    border-bottom: none;
}

.items-table tr:hover td {
    background: var(--slate-50);
}

/* Add Item Form */
.add-item-form {
    background: var(--slate-50);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.add-item-form .form-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.add-item-form input {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    transition: all var(--transition-fast);
    margin-bottom: 1rem;
}

.upload-area:hover,
.upload-area.dragging {
    border-color: var(--primary-400);
    background: var(--primary-50);
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.upload-label i {
    font-size: 2.5rem;
    color: var(--primary-400);
}

.upload-label small {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* Receipts List */
.receipts-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.receipt-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--slate-50);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.receipt-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--primary-100);
    color: var(--primary-600);
    border-radius: var(--radius-md);
    font-size: 1.25rem;
}

.receipt-info {
    flex: 1;
    min-width: 0;
}

.receipt-name {
    display: block;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.receipt-meta {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.receipt-actions {
    display: flex;
    gap: 0.25rem;
}

.empty-receipts {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    color: var(--text-tertiary);
    font-size: 0.875rem;
    justify-content: center;
}

/* Audit List */
.audit-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.audit-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    background: var(--slate-50);
}

.audit-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--slate-200);
    color: var(--slate-600);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    flex-shrink: 0;
}

.audit-content {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.audit-action {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.audit-meta {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    gap: 1rem;
    color: var(--text-secondary);
}

.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* =====================================================
   MODAL
   ===================================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal.open {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(20px);
    transition: all var(--transition-normal);
}

.modal.open .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* =====================================================
   AUTH PAGE
   ===================================================== */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--slate-100) 50%, var(--primary-100) 100%);
    padding: 2rem;
}

.auth-container {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.auth-header {
    text-align: center;
    padding: 2.5rem 2rem 2rem;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
    color: white;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
}

.auth-logo i {
    font-size: 2rem;
}

.auth-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.auth-header p {
    font-size: 0.9375rem;
    opacity: 0.9;
}

.auth-form {
    padding: 2rem;
}

.auth-footer {
    padding: 1.5rem 2rem;
    text-align: center;
    background: var(--slate-50);
    border-top: 1px solid var(--border-color);
}

.auth-footer p {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}


/* Invoice Badges */
.invoice-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s;
}

.invoice-badge i {
    width: 14px;
    height: 14px;
}

/* Not Issued - Prominent Red */
.invoice-nao {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
    box-shadow: 0 1px 2px rgba(220, 38, 38, 0.1);
}

/* Issued - Calm Blue */
.invoice-sim {
    background: #eff6ff;
    color: #3b82f6;
    border: 1px solid #dbeafe;
}

/* Partial - Warning Orange */
.invoice-parcial {
    background: #fff7ed;
    color: #f97316;
    border: 1px solid #ffedd5;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 1024px) {
    .navbar-menu {
        display: none;
    }
    
    .navbar-toggle {
        display: flex;
    }
    
    .mobile-menu {
        display: block;
    }
    
    .user-info {
        display: none;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1.5rem 1rem;
    }
    
    .stats-grid {
        display: none;
    }
    
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .toolbar-left, .toolbar-right {
        justify-content: space-between;
    }
    
    .filters-bar {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-actions {
        width: 100%;
    }
    
    .filter-actions .btn {
        flex: 1;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .drawer-content {
        max-width: 100%;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-row > * {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .navbar-brand span {
        display: none;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .card-value {
        font-size: 1.5rem;
    }
    
    .auth-container {
        padding: 0;
    }
    
    .auth-card {
        border-radius: 0;
    }
}

/* Print styles */
@media print {
    .navbar, .toolbar, .filters-bar, .drawer, .modal {
        display: none !important;
    }
    
    .main-content {
        margin-top: 0;
        padding: 0;
    }
    
    .payment-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Card Notes Style */
.card-notes {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background-color: var(--warning-50);
    border: 1px solid var(--warning-200);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    color: var(--warning-800);
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    line-height: 1.4;
}

.card-notes i {
    width: 14px;
    height: 14px;
    margin-top: 2px;
    flex-shrink: 0;
    opacity: 0.7;
}

/* Autocomplete Styles */
.autocomplete-wrapper {
    position: relative;
    width: 100%;
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 50;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 4px;
    list-style: none;
    padding: 0;
}

.autocomplete-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--slate-100);
    transition: background-color 0.15s;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background-color: var(--slate-50);
}

.autocomplete-item-name {
    font-weight: 500;
    color: var(--text-primary);
}

.autocomplete-item-meta {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}
