/* ============================================
   CHECKFY - Design System Profissional
   Tema Dark com Roxo Neon
   ============================================ */

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

:root {
    /* Cores Principais - Roxo Neon */
    --primary: #9333ea;
    --primary-hover: #a855f7;
    --primary-light: #c084fc;
    --primary-dark: #7e22ce;
    --primary-dark: #7e22ce;
    --primary-glow: transparent;
    /* Neutralized */

    /* Background Dark - Mais Clean */
    --bg-dark: #0d0d0d;
    --bg-darker: #0d0d0d;
    --bg-card: #14101A;
    --bg-card-hover: #1a1520;
    --bg-sidebar: #0d0d0d;
    --bg-header: #0d0d0d;
    --bg-primary: #0d0d0d;
    --bg-secondary: #0d0d0d;

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;

    /* Borders - Mais Sutil */
    --border-color: #1f1f1f;
    --border-hover: #2a2a2a;

    /* Status Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;

    /* Shadows & Effects */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    --shadow-glow: none;
    /* Neutralized */

    /* Spacing */
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    /* Spacing Scale - Mais Clean */
    --spacing-1: 4px;
    --spacing-2: 8px;
    --spacing-3: 12px;
    --spacing-4: 16px;
    --spacing-5: 20px;
    --spacing-6: 24px;
    --spacing-8: 32px;
    --spacing-10: 40px;
    --spacing-12: 48px;

    /* Font - Urbanist */
    --font-family: 'Urbanist', 'Urbanist Fallback', system-ui, sans-serif;

    /* Typography Scale */
    --font-size-xs: 11px;
    --font-size-sm: 13px;
    --font-size-base: 15px;
    --font-size-md: 17px;
    --font-size-lg: 20px;
    --font-size-xl: 24px;
    --font-size-2xl: 32px;
    --font-size-3xl: 40px;

    /* Font Weights */
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Letter Spacing */
    --letter-spacing-tight: -0.02em;
    --letter-spacing-normal: 0;
    --letter-spacing-wide: 0.02em;

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   RESET & BASE
   ============================================ */

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

/* Prevenir overflow horizontal global */
img,
video,
iframe,
svg {
    max-width: 100%;
    height: auto;
}

/* Garantir que containers não quebrem */
.container,
.wrapper,
.section {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-regular);
    background: var(--bg-darker);
    color: var(--text-primary);
    line-height: 1.5;
    letter-spacing: var(--letter-spacing-normal);
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ============================================
   SCROLLBAR CUSTOMIZADA
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #2a2a2a;
    border: 2px solid var(--bg-darker);
    border-radius: 10px;
    transition: var(--transition);
}

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

/* Firefox support */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-darker);
}

/* ============================================
   LAYOUT PRINCIPAL
   ============================================ */

.app-container {
    display: flex;
    min-height: 100vh;
    background: var(--bg-darker);
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: #0a0a0a;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
    transition: var(--transition);
}

.sidebar-header {
    padding: var(--spacing-6) var(--spacing-6);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 22px;
    /* box-shadow removed for flat design */
}

.logo-image {
    width: 44px;
    height: 44px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
}

/* Alternativa: se quiser manter o fundo com gradiente */
.logo-icon-image {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    box-shadow: var(--shadow-glow);
}

.logo-icon-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.logo-text {
    font-size: 24px;
    font-weight: var(--font-weight-bold);
    letter-spacing: var(--letter-spacing-tight);
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    padding: var(--spacing-5) 0;
    flex: 1;
}

.nav-section {
    margin-bottom: var(--spacing-8);
}

.nav-section-title {
    padding: 0 var(--spacing-6) var(--spacing-3);
    font-size: 11px;
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px var(--spacing-6);
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    font-weight: var(--font-weight-medium);
    font-size: 15px;
    border-radius: var(--radius-sm);
    margin: 0 var(--spacing-3);
}

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

.nav-link.active {
    color: var(--text-primary);
    background: rgba(147, 51, 234, 0.15);
    font-weight: var(--font-weight-semibold);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}

.nav-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: calc(100% - 280px);
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
}

/* Header */
.header {
    background: var(--bg-primary);
    padding: 26px 0 var(--spacing-4);
    position: relative;
    z-index: 50;
    transition: var(--transition);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.header-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--spacing-8);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
}

.header-left {
    flex: 1;
    max-width: 500px;
}

.search-box {
    position: relative;
}

.search-input {
    width: 100%;
    padding: var(--spacing-3) var(--spacing-4) var(--spacing-3) 44px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-regular);
    transition: var(--transition);
}

.search-input::placeholder {
    color: var(--text-muted);
    font-weight: var(--font-weight-regular);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-action {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}

.header-action:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

#themeToggle {
    position: relative;
}

#themeToggle:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: transparent;
}

#themeToggle i {
    font-size: 20px;
    transition: transform 0.3s ease;
}

#themeToggle:hover i {
    transform: rotate(20deg);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    margin-left: 10px;
}

.user-menu:hover {
    background: transparent;
    opacity: 0.8;
}

.user-avatar {
    width: 37px;
    height: 37px;
    border-radius: 50%;
    background: rgba(147, 51, 234, 0.2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
}

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

.user-name {
    font-size: 15px;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 1.3;
}

.user-email {
    font-size: 13px;
    font-weight: 400;
    color: #666;
    line-height: 1.3;
}

/* Content Area */
.content-area {
    flex: 1;
    padding: var(--spacing-8);
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    overflow-x: hidden;
}

.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    letter-spacing: var(--letter-spacing-tight);
    color: var(--text-primary);
    margin-bottom: var(--spacing-2);
    line-height: 1.2;
}

.page-subtitle {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-regular);
    color: var(--text-secondary);
    line-height: 1.5;
}

.page-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* ============================================
   CARDS & COMPONENTS
   ============================================ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: var(--spacing-6);
    transition: var(--transition);
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

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

.card-title {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-tight);
    color: var(--text-primary);
    line-height: 1.3;
}

.card-body {
    color: var(--text-secondary);
}

/* Metric Cards */
.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

.metric-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-4px);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 16px;
}

.metric-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    font-weight: var(--font-weight-medium);
    letter-spacing: var(--letter-spacing-normal);
}

.metric-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: rgba(147, 51, 234, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.metric-value {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    letter-spacing: var(--letter-spacing-tight);
    color: var(--text-primary);
    margin-bottom: var(--spacing-1);
    line-height: 1.2;
}

.metric-change {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.metric-change.positive {
    color: var(--success);
}

.metric-change.negative {
    color: var(--error);
}

/* Grid Layouts */
.grid {
    display: grid;
    gap: 24px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-2);
    padding: var(--spacing-3) var(--spacing-5);
    border: none;
    border-radius: var(--radius);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-normal);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: var(--font-family);
    line-height: 1.4;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    /* box-shadow removed */
}

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

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

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-success {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-success:hover {
    transform: translateY(-2px);
    /* box-shadow removed */
}

.btn-icon {
    padding: 10px;
    width: 40px;
    height: 40px;
}

/* ============================================
   FORMS
   ============================================ */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-2);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    letter-spacing: var(--letter-spacing-normal);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: var(--spacing-3) var(--spacing-4);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    font-family: var(--font-family);
    font-weight: var(--font-weight-regular);
    line-height: 1.5;
    transition: var(--transition);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
    font-weight: var(--font-weight-regular);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

input[type="file"] {
    cursor: pointer;
}

input[type="file"]::-webkit-file-upload-button {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    color: var(--text-primary);
    cursor: pointer;
    margin-right: 12px;
    font-family: var(--font-family);
}

input[type="file"]::-webkit-file-upload-button:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* ============================================
   TABLES
   ============================================ */

.table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: var(--bg-sidebar);
}

.table th {
    padding: var(--spacing-4);
    text-align: left;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.table td {
    padding: var(--spacing-4);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-regular);
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background: var(--bg-card-hover);
}

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

/* ============================================
   ALERTS & NOTIFICATIONS
   ============================================ */

.alert {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
    color: var(--error);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--info);
    color: var(--info);
}

/* ============================================
   BADGES & STATUS
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.badge-error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.badge-primary {
    background: rgba(147, 51, 234, 0.2);
    color: var(--primary);
}

/* ============================================
   AUTH PAGES
   ============================================ */

.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--bg-darker);
    position: relative;
    overflow: hidden;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 40px;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-xl);
    position: relative;
    z-index: 1;
}

.auth-card-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.auth-card h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.auth-card-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    color: var(--primary-light);
}

/* ============================================
   UTILITIES
   ============================================ */

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mt-3 {
    margin-top: 24px;
}

.mt-4 {
    margin-top: 32px;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 24px;
}

.mb-4 {
    margin-bottom: 32px;
}

.flex {
    display: flex;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gap-1 {
    gap: 8px;
}

.gap-2 {
    gap: 16px;
}

.gap-3 {
    gap: 24px;
}

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

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

/* ============================================
   MOBILE MENU & OVERLAY
   ============================================ */

.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 10px 12px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 20px;
    transition: var(--transition);
    margin-right: 12px;
}

.mobile-menu-toggle:hover {
    background: var(--bg-card);
    border-color: var(--primary);
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.mobile-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* ============================================
   RESPONSIVE
   ============================================ */

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

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .header-container {
        padding: 0 var(--spacing-4);
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .user-info {
        display: none;
    }

    .main-content {
        width: calc(100% - 280px);
        max-width: 100%;
    }
}

@media (max-width: 768px) {

    /* Mobile Menu Toggle */
    .mobile-menu-toggle {
        display: block;
    }

    .mobile-overlay {
        display: block;
    }

    /* Sidebar Mobile */
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
        width: 280px;
        max-width: 85vw;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
    }

    /* Grids */
    .grid-2,
    .grid-3,
    .grid-4,
    .products-grid,
    .metrics-grid {
        grid-template-columns: 1fr !important;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Header */
    .header {
        padding: 12px 16px;
        position: sticky;
        top: 0;
        z-index: 100;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border-color);
    }

    .header-container {
        padding: 0 var(--spacing-3);
    }

    .header-left {
        max-width: none;
        flex: 1;
    }

    .search-box {
        display: none;
    }

    .header-right {
        gap: 8px;
    }

    .user-menu {
        flex-direction: row;
        gap: 8px;
    }

    .user-info {
        display: none;
    }

    .user-avatar {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .header-action {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    /* Content Area */
    .content-area {
        padding: 16px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Cards */
    .card {
        border-radius: var(--radius);
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .card-body {
        padding: var(--spacing-4);
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Buttons */
    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }

    .btn-sm {
        padding: 6px 12px;
        font-size: 12px;
    }

    /* Forms */
    .form-group {
        margin-bottom: var(--spacing-4);
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .form-input,
    .form-select,
    textarea {
        padding: 10px 12px;
        font-size: 14px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Tables - Scroll horizontal em mobile */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .table {
        min-width: 600px;
        width: 100%;
        box-sizing: border-box;
    }

    /* Page Header */
    .page-header {
        margin-bottom: var(--spacing-4);
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .page-title {
        font-size: 24px !important;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .page-subtitle {
        font-size: 14px !important;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Sidebar adjustments */
    .sidebar-header {
        padding: var(--spacing-4);
    }

    .logo-text {
        font-size: 20px;
    }

    .nav-link {
        padding: 10px var(--spacing-4);
        font-size: 14px;
    }

    .nav-icon {
        width: 20px;
        height: 20px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {

    html,
    body {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .app-container {
        width: 100%;
        max-width: 100vw;
    }

    .content-area {
        padding: 12px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .page-title {
        font-size: 20px !important;
        word-wrap: break-word;
    }

    .btn {
        padding: 8px 14px;
        font-size: 13px;
        width: auto;
        max-width: 100%;
        box-sizing: border-box;
    }

    .card-body {
        padding: var(--spacing-3);
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Auth Pages */
    .auth-wrapper {
        padding: 20px;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
    }

    .auth-card {
        padding: 24px 20px;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }

    .auth-card h2 {
        font-size: 24px;
        word-wrap: break-word;
    }

    .auth-card-subtitle {
        font-size: 13px;
        word-wrap: break-word;
    }

    .auth-logo {
        margin-bottom: 20px;
    }

    .logo-image {
        width: 32px;
        height: 32px;
    }

    .logo-text {
        font-size: 22px;
    }

    .header-container {
        padding: 0 var(--spacing-2);
    }

    .sidebar {
        max-width: 90vw;
    }
}

/* ============================================
   SCROLLBAR
   ============================================ */

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

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

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

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

/* ============================================
   LIGHT THEME
   ============================================ */

[data-theme="light"] {
    /* Fundos */
    --bg-primary: #ffffff;
    /* Fundo da página: Branco puro */
    --bg-sidebar: #f8fafc;
    /* Sidebar: Cinza azulado suave */
    --bg-header: #f1f5f9;
    /* Header: Slate 100 */
    --bg-card: #ffffff;
    /* Cards: Branco puro */
    --bg-card-hover: #f1f5f9;
    /* Hover: Slate 100 */
    --bg-secondary: #f1f5f9;
    /* Inputs/Badges: Slate 100 */
    --bg-darker: #f1f5f9;
    /* Scrollbar track: Slate 100 */

    /* Texto - Família Slate para elegância */
    --text-primary: #1e293b;
    /* Slate 800 */
    --text-secondary: #475569;
    /* Slate 600 */
    --text-muted: #94a3b8;
    /* Slate 400 */

    /* Bordas */
    --border-color: #e2e8f0;
    /* Slate 200 */
    --border-hover: #cbd5e1;
    /* Slate 300 */

    /* Cores de Destaque */
    --primary: #9333ea;
    --primary-light: #a855f7;
    --primary-dark: #7e22ce;
    --primary-glow: rgba(147, 51, 234, 0.1);

    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;

    /* Sombras específicas para o tema claro */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .sidebar {
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    box-shadow: 1px 0 0 0 rgba(0, 0, 0, 0.02);
    /* Sombra sutil na direita */
}

[data-theme="light"] .header {
    background: var(--bg-header) !important;
    box-shadow: none !important;
    border: none !important;
}

/* Cards com elevação sutil no tema claro */
[data-theme="light"] .metric-card-dashboard,
[data-theme="light"] .chart-container,
[data-theme="light"] .gauge-container,
[data-theme="light"] .transactions-section,
[data-theme="light"] .card,
[data-theme="light"] .table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

[data-theme="light"] .filter-modal {
    background: var(--bg-card);
    border-color: var(--border-color);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .filter-select {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="light"] ::-webkit-scrollbar-track {
    background: #f1f1f1;
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

[data-theme="light"] .date-range-picker {
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    color: var(--text-primary) !important;
}

[data-theme="light"] .date-range-picker:hover {
    background: #e2e8f0 !important;
    border-color: var(--primary) !important;
}

/* Ajustes específicos para inputs no tema claro */
[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="email"],
[data-theme="light"] input[type="password"],
[data-theme="light"] select,
[data-theme="light"] textarea {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

[data-theme="light"] input:focus,
[data-theme="light"] select:focus,
[data-theme="light"] textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--bg-card);
}

/* Ajustes para tabelas no tema claro */
[data-theme="light"] .table th {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-weight: 600;
}

[data-theme="light"] .table td {
    border-bottom-color: var(--border-color);
    color: var(--text-secondary);
}

[data-theme="light"] .table tr:hover td {
    background: var(--bg-card-hover);
}

/* ============================================
   NOTIFICATION TOAST
   ============================================ */

.notification-toast {
    position: fixed;
    top: 24px;
    right: 24px;
    background: #10b981;
    color: white;
    padding: 14px 24px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-xl), 0 0 20px rgba(16, 185, 129, 0.2);
    z-index: 99999;
    transform: translateX(calc(100% + 40px));
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.notification-toast.show {
    transform: translateX(0);
}

.notification-toast.error {
    background: var(--error);
    box-shadow: var(--shadow-xl), 0 0 20px rgba(239, 68, 68, 0.2);
}

.notification-icon {
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}