/* ==========================================
   GustSys Dashboard - Design System
   Theme: Dark Premium with Glassmorphism
   ========================================== */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ---------- CSS Variables ---------- */
:root {
    /* Background */
    --bg-primary: #0a0a1a;
    --bg-secondary: #0f0f2a;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --bg-sidebar: rgba(15, 15, 42, 0.95);

    /* Text */
    --text-primary: #e8e8f0;
    --text-secondary: #8888aa;
    --text-muted: #555577;
    --text-accent: #ffffff;

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.06);
    --border-glow: rgba(99, 102, 241, 0.3);

    /* Gradients */
    --gradient-blue: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-green: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --gradient-pink: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-orange: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    --gradient-cyan: linear-gradient(135deg, #00c6fb 0%, #005bea 100%);
    --gradient-purple: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow-blue: 0 0 30px rgba(102, 126, 234, 0.15);
    --shadow-glow-green: 0 0 30px rgba(56, 239, 125, 0.15);
    --shadow-glow-pink: 0 0 30px rgba(245, 87, 108, 0.15);
    --shadow-glow-orange: 0 0 30px rgba(253, 160, 133, 0.15);

    /* Sizes */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --header-height: 70px;
    --border-radius: 16px;
    --border-radius-sm: 10px;
    --border-radius-xs: 6px;

    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(102, 126, 234, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(118, 75, 162, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(17, 153, 142, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ---------- Layout ---------- */
.app-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 30px;
    transition: margin-left var(--transition-normal);
    min-width: 0;
}

.sidebar.collapsed~.main-content {
    margin-left: var(--sidebar-collapsed);
}

/* ---------- Sidebar ---------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform var(--transition-normal), width var(--transition-normal);
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    min-height: var(--header-height);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--gradient-blue);
    border-radius: var(--border-radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    flex-shrink: 0;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--gradient-blue);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .sidebar-nav span,
.sidebar.collapsed .user-info {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-toggle {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: var(--border-radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.mobile-toggle {
    display: none;
}

.sidebar.collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-item {
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.nav-item.active .nav-link {
    background: rgba(102, 126, 234, 0.12);
    color: #667eea;
}

.nav-item.active .nav-link i {
    color: #667eea;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.user-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 8px;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
}

.user-avatar {
    width: 48px;
    height: 48px;
    background: var(--gradient-purple);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    flex-shrink: 0;
}

.user-info {
    width: 100%;
    overflow: hidden;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    display: block;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.3;
    margin-bottom: 2px;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ---------- Page Header ---------- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 16px;
    width: 100%;
}

.page-header-premium {
    background: var(--bg-card);
    padding: 20px 24px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.page-header-top-border {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-blue);
}

.page-header-company {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-header-company-icon {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    background: rgba(102, 126, 234, 0.15);
    border: 1px solid rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667eea;
    font-size: 24px;
}

.page-title-gradient {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: var(--gradient-blue);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
}

.page-header-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

.company-cnpj-badge {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.company-cnpj-icon {
    margin-right: 4px;
    color: #8888aa;
}

.page-header-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.date-badge-icon {
    color: #667eea;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-accent);
}

.page-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 4px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--gradient-blue);
    color: white;
    box-shadow: var(--shadow-glow-blue);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 40px rgba(102, 126, 234, 0.3);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.12);
}

.btn-icon-mini {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: var(--border-radius-xs);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 10px;
    font-size: 12px;
    transition: all var(--transition-fast);
}

.btn-icon-mini:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    transform: scale(1.1);
}

/* Date picker badge */
.date-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ---------- Financial Alerts ---------- */
.alerts-card {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 18px 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.alerts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.alerts-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-accent);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.alerts-header-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.alerts-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: var(--border-radius-sm);
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
}

.alert-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.alert-content {
    min-width: 0;
    flex: 1;
}

.alert-content h4 {
    margin: 0;
    font-size: 0.84rem;
    color: var(--text-accent);
}

.alert-content p {
    margin: 2px 0 0;
    font-size: 0.77rem;
    color: var(--text-secondary);
}

.alert-value {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-accent);
    white-space: nowrap;
}

.alert-danger .alert-icon {
    color: #f5576c;
    background: rgba(245, 87, 108, 0.15);
}

.alert-warning .alert-icon {
    color: #f6d365;
    background: rgba(246, 211, 101, 0.15);
}

.alert-info .alert-icon {
    color: #00c6fb;
    background: rgba(0, 198, 251, 0.15);
}

/* ---------- KPI Cards ---------- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    overflow: hidden;
    transition: all var(--transition-normal);
    backdrop-filter: blur(10px);
}

.kpi-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.1);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.kpi-card.blue::before {
    background: var(--gradient-blue);
}

.kpi-card.blue:hover {
    box-shadow: var(--shadow-glow-blue);
}

.kpi-card.green::before {
    background: var(--gradient-green);
}

.kpi-card.green:hover {
    box-shadow: var(--shadow-glow-green);
}

.kpi-card.pink::before {
    background: var(--gradient-pink);
}

.kpi-card.pink:hover {
    box-shadow: var(--shadow-glow-pink);
}

.kpi-card.orange::before {
    background: var(--gradient-orange);
}

.kpi-card.orange:hover {
    box-shadow: var(--shadow-glow-orange);
}

.kpi-card-saida::before {
    background: linear-gradient(135deg, #f5576c, #c0392b);
}

.kpi-card-entrada::before {
    background: linear-gradient(135deg, #11998e, #38ef7d);
}

.kpi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: white;
}

.kpi-card.blue .kpi-icon {
    background: var(--gradient-blue);
}

.kpi-card.green .kpi-icon {
    background: var(--gradient-green);
}

.kpi-card.pink .kpi-icon {
    background: var(--gradient-pink);
}

.kpi-card.orange .kpi-icon {
    background: var(--gradient-orange);
}

.kpi-card.cyan::before {
    background: var(--gradient-cyan);
}

.kpi-card.cyan:hover {
    box-shadow: 0 0 30px rgba(0, 198, 251, 0.15);
}

.kpi-card.cyan .kpi-icon {
    background: var(--gradient-cyan);
}

.kpi-icon-saida {
    background: linear-gradient(135deg, #f5576c, #c0392b);
}

.kpi-icon-entrada {
    background: linear-gradient(135deg, #11998e, #38ef7d);
}

.kpi-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.kpi-trend.up {
    background: rgba(56, 239, 125, 0.1);
    color: #38ef7d;
}

.kpi-trend.down {
    background: rgba(245, 87, 108, 0.1);
    color: #f5576c;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-accent);
    line-height: 1;
    margin-bottom: 6px;
}

.kpi-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ---------- Charts Grid ---------- */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    backdrop-filter: blur(10px);
    transition: all var(--transition-normal);
}

.chart-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.1);
}

.chart-card.full-width {
    grid-column: 1 / -1;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.chart-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-accent);
}

.chart-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.chart-actions {
    display: flex;
    gap: 4px;
}

.chart-actions button {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--border-radius-xs);
    font-size: 0.75rem;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chart-actions button:hover,
.chart-actions button.active {
    background: rgba(102, 126, 234, 0.12);
    color: #667eea;
    border-color: rgba(102, 126, 234, 0.3);
}

.chart-body {
    position: relative;
    height: 280px;
}

.chart-body canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ---------- Data Table ---------- */
.table-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    backdrop-filter: blur(10px);
    margin-bottom: 30px;
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.table-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-accent);
}

.table-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 8px 14px;
}

.table-search i {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.table-search input {
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    width: 180px;
}

.table-search input::placeholder {
    color: var(--text-muted);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.data-table tbody td {
    padding: 14px 16px;
    font-size: 0.875rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
}

.table-overflow {
    overflow-x: auto;
}

.receber-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.receber-filters {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-chip {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-chip:hover {
    color: var(--text-primary);
    border-color: #6366f1;
}

.filter-chip.active {
    background: #6366f1;
    border-color: #6366f1;
    color: #ffffff;
}

.col-expand {
    width: 40px;
}

.recent-table-wrapper {
    max-height: 400px;
    overflow-y: auto;
    transition: max-height 0.3s ease;
}

.recent-table-head {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-card);
}

.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 2100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    min-width: 260px;
    max-width: 380px;
    padding: 10px 14px;
    border-radius: var(--border-radius-xs);
    border: 1px solid var(--border-color);
    background: rgba(20, 20, 45, 0.98);
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
    font-size: 0.85rem;
    animation: toast-in 0.22s ease-out;
}

.toast-error {
    border-left: 3px solid #f5576c;
}

.toast-success {
    border-left: 3px solid #38ef7d;
}

.toast-hide {
    animation: toast-out 0.22s ease-in forwards;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-badge.success {
    background: rgba(56, 239, 125, 0.1);
    color: #38ef7d;
}

.status-badge.success::before {
    background: #38ef7d;
}

.status-badge.warning {
    background: rgba(246, 211, 101, 0.1);
    color: #f6d365;
}

.status-badge.warning::before {
    background: #f6d365;
}

.status-badge.danger {
    background: rgba(245, 87, 108, 0.1);
    color: #f5576c;
}

.status-badge.danger::before {
    background: #f5576c;
}

.status-badge.info {
    background: rgba(0, 198, 251, 0.1);
    color: #00c6fb;
}

.status-badge.info::before {
    background: #00c6fb;
}

/* ---------- Loading Skeleton ---------- */
.skeleton {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.03) 25%,
            rgba(255, 255, 255, 0.06) 50%,
            rgba(255, 255, 255, 0.03) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--border-radius-xs);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.animate-in {
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
}

.animate-in:nth-child(1) {
    animation-delay: 0.05s;
}

.animate-in:nth-child(2) {
    animation-delay: 0.1s;
}

.animate-in:nth-child(3) {
    animation-delay: 0.15s;
}

.animate-in:nth-child(4) {
    animation-delay: 0.2s;
}

.animate-in:nth-child(5) {
    animation-delay: 0.25s;
}

.animate-in:nth-child(6) {
    animation-delay: 0.3s;
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: var(--sidebar-width);
        transform: translateX(-100%);
    }

    .sidebar.collapsed {
        width: var(--sidebar-width);
    }

    .sidebar.mobile-active {
        transform: translateX(0);
    }

    .sidebar .logo-text,
    .sidebar .sidebar-nav span,
    .sidebar .user-info {
        opacity: 1;
        width: auto;
        overflow: visible;
    }

    .sidebar.collapsed .logo-text,
    .sidebar.collapsed .sidebar-nav span,
    .sidebar.collapsed .user-info {
        opacity: 1;
        width: auto;
        overflow: visible;
    }

    .main-content {
        margin-left: 0;
        padding: 15px 12px;
        padding-top: 80px;
        width: 100%;
        overflow-x: hidden;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .alerts-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header-company {
        width: 100%;
    }

    .page-header-meta {
        flex-wrap: wrap;
        gap: 8px;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
        gap: 8px;
        flex-wrap: wrap;
    }

    .filter-group,
    .date-badge {
        flex: 1;
        min-width: 140px;
        justify-content: center;
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    .btn-primary .btn-text {
        display: none;
    }

    .btn-primary {
        padding: 10px;
        width: 44px;
        height: 44px;
        justify-content: center;
    }

    /* Mobile Overlay */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 999;
        display: none;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .mobile-toggle {
        display: flex;
        position: fixed;
        top: 20px;
        left: 20px;
        width: 44px;
        height: 44px;
        background: var(--bg-sidebar);
        backdrop-filter: blur(10px);
        border: 1px solid var(--border-color);
        border-radius: var(--border-radius-sm);
        color: var(--text-primary);
        font-size: 20px;
        align-items: center;
        justify-content: center;
        z-index: 1001;
        cursor: pointer;
        box-shadow: var(--shadow-md);
    }

    body.sidebar-mobile-open .mobile-toggle {
        opacity: 0;
        pointer-events: none;
    }
}

@media (max-width: 480px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }
}

/* Phase 2 - Interactive Filters */
.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #8888aa;
}

.period-select {
    background: transparent;
    border: none;
    color: #fff;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    font-family: inherit;
}

.period-select option {
    background: #1a1a3a;
    color: #fff;
}

.period-select:focus-visible,
.btn:focus-visible,
.btn-icon-mini:focus-visible,
.nav-link:focus-visible,
.form-control:focus-visible,
input[type="date"]:focus-visible,
input[type="number"]:focus-visible,
input[type="text"]:focus-visible,
button:focus-visible {
    outline: 2px solid rgba(0, 198, 251, 0.8);
    outline-offset: 2px;
}

.kpi-change {
    font-size: 13px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
}

.kpi-change.up {
    color: #38ef7d;
    background: rgba(56, 239, 125, 0.1);
}

.kpi-change.down {
    color: #f5576c;
    background: rgba(245, 87, 108, 0.1);
}

/* ---------- Master-Detail Expansion ---------- */
.row-master {
    cursor: pointer;
}

.row-master:hover {
    background: rgba(102, 126, 234, 0.05) !important;
}

.btn-expand {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    cursor: pointer;
}

.row-master.expanded .btn-expand {
    transform: rotate(180deg);
    background: var(--gradient-blue);
    color: white;
    border-color: transparent;
}

.row-detail {
    background: rgba(15, 15, 42, 0.4);
    display: none;
}

.row-detail.active {
    display: table-row;
}

.detail-container {
    padding: 15px 40px 25px 60px;
    animation: slideDown 0.3s ease-out;
}

.detail-table {
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.detail-table th {
    background: rgba(255, 255, 255, 0.03);
    padding: 10px 15px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.detail-table td {
    padding: 10px 15px;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.01);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.row-master.expanded {
    background: rgba(102, 126, 234, 0.03) !important;
}

/* ---------- Buttons & Actions ---------- */
.btn-mini {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
    color: white;
}

.btn-report {
    height: 38px;
    padding: 0 24px;
    border-radius: 12px;
    border: none;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-report i {
    font-size: 1.2rem;
}

.btn-report:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.45);
    filter: brightness(1.2);
}

.btn-report:active {
    transform: translateY(-1px);
}

.btn-export {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%) !important;
}

.btn-print {
    background: linear-gradient(135deg, #10b981 0%, #3b82f6 100%) !important;
}

/* ---------- Filtros de Lançamentos de Caixa ---------- */
.btn-filter {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.btn-filter:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.btn-filter.active {
    background: rgba(102, 126, 234, 0.12);
    color: #667eea;
    border-color: rgba(102, 126, 234, 0.3);
}

.btn-filter.entrada.active {
    background: rgba(56, 239, 125, 0.12);
    color: #38ef7d;
    border-color: rgba(56, 239, 125, 0.3);
}

.btn-filter.saida.active {
    background: rgba(245, 87, 108, 0.12);
    color: #f5576c;
    border-color: rgba(245, 87, 108, 0.3);
}

.btn-filter i {
    font-size: 0.7rem;
}
@media (max-width: 640px) {
    .hide-mobile { display: none !important; }
}
