/* =============================================================================
   FINANÇAS GO! - CSS Principal
   ============================================================================= */

:root {
    --primary-50: #ecfdf5;
    --primary-100: #d1fae5;
    --primary-200: #a7f3d0;
    --primary-300: #6ee7b7;
    --primary-400: #34d399;
    --primary-500: #10b981;
    --primary-600: #059669;
    --primary-700: #047857;
    --primary-800: #065f46;
    --primary-900: #064e3b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1f2937;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* =============================================================================
   CUSTOM SCROLLBAR
   ============================================================================= */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    /* slate-300 */
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
    /* slate-400 */
}

/* Dark mode scrollbar */
.dark ::-webkit-scrollbar-thumb {
    background: #475569;
    /* slate-600 */
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
    /* slate-500 */
}

/* =============================================================================
   UTILITIES
   ============================================================================= */

.bg-gray-50 {
    background-color: #f9fafb;
}

.bg-white {
    background-color: #ffffff;
}

.bg-emerald-50 {
    background-color: #ecfdf5;
}

.bg-red-50 {
    background-color: #fef2f2;
}

.bg-yellow-50 {
    background-color: #fffbeb;
}

.text-gray-400 {
    color: #9ca3af;
}

.text-gray-500 {
    color: #6b7280;
}

.text-gray-600 {
    color: #4b5563;
}

.text-gray-700 {
    color: #374151;
}

.text-gray-900 {
    color: #111827;
}

.text-white {
    color: #ffffff;
}

.text-emerald-500 {
    color: #10b981;
}

.text-emerald-600 {
    color: #059669;
}

.text-emerald-700 {
    color: #047857;
}

.text-red-500 {
    color: #ef4444;
}

.text-red-600 {
    color: #dc2626;
}

.text-red-700 {
    color: #b91c1c;
}

.text-yellow-700 {
    color: #a16207;
}

.border-gray-200 {
    border-color: #e5e7eb;
}

.border-emerald-200 {
    border-color: #a7f3d0;
}

.border-red-200 {
    border-color: #fecaca;
}

.border-yellow-200 {
    border-color: #fde68a;
}

.rounded {
    border-radius: 0.25rem;
}

.rounded-lg {
    border-radius: 0.5rem;
}

.rounded-xl {
    border-radius: 0.75rem;
}

.rounded-2xl {
    border-radius: 1rem;
}

.rounded-full {
    border-radius: 9999px;
}

.shadow {
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.shadow-lg {
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

.shadow-xl {
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

.min-h-screen {
    min-height: 100vh;
}

.h-full {
    height: 100%;
}

.w-full {
    width: 100%;
}

.flex {
    display: flex;
}

.inline-flex {
    display: inline-flex;
}

.grid {
    display: grid;
}

.hidden {
    display: none;
}

.block {
    display: block;
}

.flex-1 {
    flex: 1 1 0%;
}

.flex-col {
    flex-direction: column;
}

.flex-shrink-0 {
    flex-shrink: 0;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-end {
    justify-content: flex-end;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.gap-8 {
    gap: 2rem;
}

.p-2 {
    padding: 0.5rem;
}

.p-3 {
    padding: 0.75rem;
}

.p-4 {
    padding: 1rem;
}

.p-5 {
    padding: 1.25rem;
}

.p-6 {
    padding: 1.5rem;
}

.p-8 {
    padding: 2rem;
}

.px-3 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.px-6 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.py-3 {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.py-4 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.py-5 {
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
}

.m-0 {
    margin: 0;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mx-4 {
    margin-left: 1rem;
    margin-right: 1rem;
}

.text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}

.text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.text-base {
    font-size: 1rem;
    line-height: 1.5rem;
}

.text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
}

.text-xl {
    font-size: 1.25rem;
    line-height: 1.75rem;
}

.text-2xl {
    font-size: 1.5rem;
    line-height: 2rem;
}

.text-3xl {
    font-size: 1.875rem;
    line-height: 2.25rem;
}

.text-4xl {
    font-size: 2.25rem;
    line-height: 2.5rem;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

.font-extrabold {
    font-weight: 800;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.min-w-0 {
    min-width: 0;
}

.max-w-md {
    max-width: 28rem;
}

.max-w-lg {
    max-width: 32rem;
}

.max-w-xl {
    max-width: 36rem;
}

.max-w-2xl {
    max-width: 42rem;
}

.overflow-hidden {
    overflow: hidden;
}

.overflow-y-auto {
    overflow-y: auto;
}

.space-y-1>*+* {
    margin-top: 0.25rem;
}

.space-y-2>*+* {
    margin-top: 0.5rem;
}

.space-y-4>*+* {
    margin-top: 1rem;
}

.space-y-6>*+* {
    margin-top: 1.5rem;
}

.border {
    border-width: 1px;
}

.border-b {
    border-bottom-width: 1px;
}

.border-t {
    border-top-width: 1px;
}

.border-r {
    border-right-width: 1px;
}

.border-l {
    border-left-width: 1px;
}

.border-2 {
    border-width: 2px;
}

.fixed {
    position: fixed;
}

.absolute {
    position: absolute;
}

.relative {
    position: relative;
}

.sticky {
    position: sticky;
}

.inset-0 {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.inset-y-0 {
    top: 0;
    bottom: 0;
}

.left-0 {
    left: 0;
}

.top-0 {
    top: 0;
}

.right-0 {
    right: 0;
}

.z-10 {
    z-index: 10;
}

.z-20 {
    z-index: 20;
}

.z-30 {
    z-index: 30;
}

.z-50 {
    z-index: 50;
}

.transition-colors {
    transition-property: color, background-color, border-color;
    transition-duration: 150ms;
}

.transition-all {
    transition-property: all;
    transition-duration: 150ms;
}

.duration-200 {
    transition-duration: 200ms;
}

.cursor-pointer {
    cursor: pointer;
}

/* =============================================================================
   NAVIGATION
   ============================================================================= */

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    color: #9ca3af;
    /* text-gray-400 equivalent */
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 150ms ease;
    position: relative;
    border-left: 4px solid transparent;
}

.nav-link:hover {
    color: #ffffff;
    background-color: rgba(5, 150, 105, 0.1);
    /* primary-600/10 */
}

.nav-link.active {
    background-color: rgba(5, 150, 105, 0.1);
    /* primary-600/10 */
    color: #ffffff;
    border-left-color: #10b981;
    /* primary-500 */
}

.nav-link.active-admin {
    background-color: rgba(234, 88, 12, 0.1);
    /* orange-600/10 */
    color: #fdba74;
    /* orange-300 */
    border-left-color: #f97316;
    /* orange-500 */
}

/* =============================================================================
   CARDS
   ============================================================================= */

.card {
    background: white;
    border-radius: 1rem;
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
}

/* =============================================================================
   BUTTONS
   ============================================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 150ms ease;
}

.btn-primary {
    background: linear-gradient(to right, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 6px -1px rgb(16 185 129 / 0.3);
}

.btn-primary:hover {
    background: linear-gradient(to right, #059669, #047857);
    transform: translateY(-1px);
}

.btn-secondary {
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

/* =============================================================================
   FORMS
   ============================================================================= */

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.input,
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #111827;
    background: white;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.input:focus,
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgb(16 185 129 / 0.1);
}

.input::placeholder,
.form-input::placeholder {
    color: #9ca3af;
}

.form-checkbox {
    width: 1rem;
    height: 1rem;
    accent-color: #10b981;
}

/* =============================================================================
   TABLES
   ============================================================================= */

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.table th {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #f9fafb;
}

.table tbody tr:hover {
    background: #f9fafb;
}

/* =============================================================================
   SUMMARY CARDS
   ============================================================================= */

.summary-card {
    background: white;
    border-radius: 1rem;
    border: 1px solid #e5e7eb;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.summary-card-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.summary-card-content {
    flex: 1;
}

.summary-card-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.summary-card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
}

.summary-card-value.positive {
    color: #10b981;
}

.summary-card-value.negative {
    color: #ef4444;
}

/* =============================================================================
   PROGRESS BAR
   ============================================================================= */

.progress-bar {
    height: 0.5rem;
    background: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 300ms ease;
}

/* =============================================================================
   BADGE
   ============================================================================= */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background: #ecfdf5;
    color: #059669;
}

.badge-warning {
    background: #fffbeb;
    color: #d97706;
}

.badge-danger {
    background: #fef2f2;
    color: #dc2626;
}

.badge-info {
    background: #eff6ff;
    color: #2563eb;
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (min-width: 640px) {
    .sm\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .md\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .lg\:block {
        display: block;
    }

    .lg\:hidden {
        display: none;
    }

    .lg\:ml-64 {
        margin-left: 16rem;
    }

    .lg\:p-8 {
        padding: 2rem;
    }

    .lg\:mx-8 {
        margin-left: 2rem;
        margin-right: 2rem;
    }

    .lg\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* =============================================================================
   ANIMATIONS
   ============================================================================= */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeIn {
    animation: fadeIn 200ms ease-out;
}

/* =============================================================================
   DARK MODE OVERRIDES
   ============================================================================= */

.dark body {
    background-color: #0f172a;
    /* dark-900 */
    color: #f1f5f9;
    /* dark-100 */
}

/* Utilities in dark mode */
.dark .bg-white {
    background-color: #1e293b;
}

/* dark-800 */
.dark .bg-gray-50 {
    background-color: #0f172a;
}

/* dark-900 */
.dark .bg-emerald-50 {
    background-color: rgba(16, 185, 129, 0.1);
}

.dark .bg-red-50 {
    background-color: rgba(239, 68, 68, 0.1);
}

.dark .bg-yellow-50 {
    background-color: rgba(245, 158, 11, 0.1);
}

.dark .text-gray-900,
.dark .text-gray-800 {
    color: #f8fafc;
}

.dark .text-gray-700,
.dark .text-gray-600 {
    color: #cbd5e1;
}

.dark .text-gray-500 {
    color: #94a3b8;
}

.dark .text-gray-400 {
    color: #64748b;
}

.dark .border-gray-200 {
    border-color: #334155;
}

/* Fix: changed to dark-700 / slate-700 instead of bright colors */

.dark .card,
.dark .summary-card {
    background: #1e293b;
    /* dark-800 */
    border-color: #334155;
    /* dark-700 */
}

.dark .card-title {
    color: #f8fafc;
}

.dark .btn-secondary {
    background: #1e293b;
    color: #f1f5f9;
    border-color: #475569;
    /* dark-600 */
}

.dark .btn-secondary:hover {
    background: #334155;
    border-color: #64748b;
}

.dark .form-label {
    color: #cbd5e1;
}

.dark .input,
.dark .form-input,
.dark .form-select,
.dark .form-textarea {
    background: #0f172a;
    border-color: #475569;
    color: #f8fafc;
}

.dark .table th {
    background: #172033;
    /* dark-850 */
    color: #94a3b8;
    border-bottom-color: #334155;
    /* dark-700 */
}

.dark .table td {
    border-bottom-color: #334155;
}

.dark .table tbody tr:hover {
    background: #1e293b;
    /* dark-800 */
}

.dark .summary-card-value {
    color: #f8fafc;
}

.dark .summary-card-value.positive {
    color: #34d399;
}

.dark .summary-card-value.negative {
    color: #f87171;
}

.dark .progress-bar {
    background: #334155;
}

/* Layout overrides */
.dark #mobile-sidebar,
.dark aside {
    background-color: #0f172a;
    /* dark-900 (used gradient instead on HTML) */
    border-color: #334155;
}

.dark header {
    border-color: #334155;
}

/* Dashboard specific dark mode border fixes */
.dark .border-gray-100,
.dark .border-gray-50 {
    border-color: #334155;
    /* dark-700 */
}

.dark .bg-white,
.dark .bg-gray-50 {
    background-color: #1e293b;
    /* dark-800 */
}