/* 
 * Goes Design System v1 (Light Theme) - Componentes Base 
 */

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

.btn-primary {
    background-color: var(--goes-primary);
    color: #FFFFFF;
    font-weight: 700;
    padding: 10px 20px;
    min-height: 48px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: var(--goes-primary-hover);
    box-shadow: var(--shadow-md);
}

.btn-primary-glow {
    background-color: var(--goes-primary);
    color: #FFFFFF;
    font-weight: 700;
    padding: 10px 20px;
    min-height: 48px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-primary-glow);
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    border: none;
    cursor: pointer;
}

.btn-primary-glow:hover {
    background-color: var(--goes-primary-hover);
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.6);
}

.btn-secondary {
    background-color: var(--goes-surface);
    color: var(--goes-text-secondary);
    font-weight: 600;
    padding: 10px 20px;
    min-height: 48px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--goes-border);
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
}

.btn-secondary:hover {
    color: var(--goes-text-heading);
    border-color: var(--goes-text-muted);
}

.btn-ghost {
    background-color: transparent;
    color: var(--goes-primary);
    font-weight: 700;
    font-size: 14px;
    transition: all 0.2s ease-in-out;
    font-family: 'Inter', sans-serif;
    border: none;
    cursor: pointer;
    padding: 10px 16px;
    min-height: 48px;
    border-radius: var(--radius-sm);
}

.btn-ghost:hover {
    color: var(--goes-primary-hover);
    background-color: var(--goes-border-light);
}

.btn-destructive {
    background-color: transparent;
    color: var(--goes-error);
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    padding: 8px 12px;
    min-height: 48px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease-in-out;
    border: none;
    cursor: pointer;
}

.btn-destructive:hover {
    background-color: var(--goes-error-bg);
}

/* =========================================================================
   INPUTS
   ========================================================================= */

.label-base {
    display: block;
    font-size: 10px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    color: var(--goes-text-muted);
    text-transform: uppercase;
    margin-bottom: 6px;
    letter-spacing: 0.05em;
}

.input-base {
    width: 100%;
    height: 48px;
    min-height: 48px;
    border: 1px solid var(--goes-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    padding: 0 12px;
    background-color: var(--goes-surface);
    color: var(--goes-text-main);
    font-family: 'Inter', sans-serif;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease-in-out;
    outline: none;
}

.input-base::placeholder {
    color: var(--goes-border);
}

.input-base:focus {
    border-color: var(--goes-primary);
    box-shadow: 0 0 0 1px var(--goes-primary);
}

.input-error {
    border-color: var(--goes-error);
}

.input-error:focus {
    border-color: var(--goes-error);
    box-shadow: 0 0 0 1px var(--goes-error);
}

.select-base {
    width: 100%;
    height: 48px;
    min-height: 48px;
    border: 1px solid var(--goes-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    padding: 0 36px 0 12px;
    /* Espaço para o ícone descritivo/chevron */
    background-color: var(--goes-surface);
    color: var(--goes-text-main);
    font-family: 'Inter', sans-serif;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease-in-out;
    outline: none;
    appearance: none;
}

.select-base:focus {
    border-color: var(--goes-primary);
    box-shadow: 0 0 0 1px var(--goes-primary);
}

.textarea-base {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--goes-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    padding: 12px;
    background-color: var(--goes-surface);
    color: var(--goes-text-main);
    font-family: 'Inter', sans-serif;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    outline: none;
    resize: vertical;
}

.textarea-base:focus {
    border-color: var(--goes-primary);
    box-shadow: 0 0 0 1px var(--goes-primary);
}

@media (max-width: 768px) {
    .btn-primary,
    .btn-primary-glow,
    .btn-secondary,
    .btn-ghost,
    .btn-destructive {
        min-height: 48px;
        padding-left: 16px;
        padding-right: 16px;
    }

    .input-base,
    .select-base,
    .textarea-base {
        font-size: 16px;
    }
}

.help-text {
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    color: var(--goes-text-secondary);
    margin-top: 4px;
}

.error-text {
    font-size: 12px;
    color: var(--goes-error);
    font-family: 'Inter', sans-serif;
    margin-top: 4px;
    font-weight: 500;
}

/* =========================================================================
   TOGGLES
   ========================================================================= */

.toggle-group {
    display: flex;
    background-color: var(--goes-surface);
    border: 1px solid var(--goes-border-light);
    border-radius: var(--radius-md);
    padding: 4px;
    gap: 4px;
}

.toggle-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    color: var(--goes-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.toggle-item:hover {
    color: var(--goes-text-heading);
    background-color: var(--goes-bg);
}

.toggle-item-income.active {
    background-color: var(--goes-success-bg, #ECFDF5);
    color: var(--goes-success, #059669);
    border-color: rgba(16, 185, 129, 0.2);
    box-shadow: var(--shadow-sm);
}

.toggle-item-expense.active {
    background-color: var(--goes-bg, #F9FAFB);
    color: var(--goes-text-heading, #111827);
    border-color: var(--goes-border, #E5E7EB);
    box-shadow: var(--shadow-sm);
}

/* =========================================================================
   CARDS (Seção / Formulário)
   ========================================================================= */

.card {
    background-color: var(--goes-surface);
    border: 1px solid var(--goes-border);
    border-radius: var(--radius-md);
    /* 12px */
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    text-align: left;
    transition: box-shadow 0.2s ease-in-out;
}

.card-lg {
    background-color: var(--goes-surface);
    border: 1px solid var(--goes-border);
    border-radius: var(--radius-lg);
    /* 24px */
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    text-align: left;
    transition: box-shadow 0.2s ease-in-out;
}

.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--goes-border-light);
    background-color: var(--goes-surface);
}

.card-title {
    font-size: 13px;
    /* Changed to match typical text-sm or text-[17px] if larger, but using text-xs uppercase pattern */
    /* Wait, prompt says: .card-title (texto pequeno uppercase tracking-widest) */
    font-size: 10px;
    font-weight: 800;
    font-family: 'Inter', sans-serif;
    color: var(--goes-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    /* tracking-wider/widest */
}

.card-subtitle {
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    color: var(--goes-text-secondary);
}

.card-body {
    padding: 24px;
    /* p-6 */
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--goes-border-light);
    background-color: var(--goes-bg);
}

/* =========================================================================
   KPI CARDS (Dashboard)
   ========================================================================= */

.kpi-card {
    background-color: var(--goes-surface);
    border: 1px solid var(--goes-border-light);
    /* dashboard specific */
    border-radius: var(--radius-lg);
    /* 24px */
    box-shadow: var(--shadow-sm);
    font-family: 'Inter', sans-serif;
    padding: 24px;
    /* p-6 */
    transition: box-shadow 0.2s ease-in-out;
}

.kpi-card:hover {
    /* optional hover sem exageros */
    box-shadow: var(--shadow-md);
}

.kpi-label {
    font-size: 10px;
    font-weight: 800;
    font-family: 'Inter', sans-serif;
    color: var(--goes-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 12px;
}

.kpi-value {
    font-size: 32px;
    font-weight: 900;
    font-family: 'Inter', sans-serif;
    color: var(--goes-text-heading);
    line-height: 1;
}

.kpi-meta {
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: var(--goes-text-secondary);
}

.kpi-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    /* rounded-2xl */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    /* text-xl */
}

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

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 9999px;
    /* Pill shape */
    font-size: 10px;
    font-weight: 800;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: var(--goes-badge-bg, var(--goes-border-light));
    color: var(--goes-badge-text, var(--goes-text-secondary));
}

.badge::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--goes-badge-marker, var(--goes-text-muted));
}

.badge-success {
    --goes-badge-bg: var(--goes-success-bg);
    --goes-badge-text: var(--goes-success);
    --goes-badge-marker: #10B981;
    /* emerald-500 */
}

.badge-warning {
    --goes-badge-bg: var(--goes-warning-bg);
    --goes-badge-text: var(--goes-warning);
    --goes-badge-marker: #F59E0B;
    /* amber-500 */
}

.badge-error {
    --goes-badge-bg: var(--goes-error-bg);
    --goes-badge-text: var(--goes-error);
    --goes-badge-marker: #EF4444;
    /* red-500 */
}

.badge-info {
    --goes-badge-bg: var(--goes-info-bg);
    --goes-badge-text: var(--goes-info);
    --goes-badge-marker: #3B82F6;
    /* blue-500 */
}

/* Variações específicas de OS */
.badge-indigo {
    --goes-badge-bg: #EEF2FF;
    /* indigo-50 */
    --goes-badge-text: #4338CA;
    /* indigo-700 */
    --goes-badge-marker: #6366F1;
    /* indigo-500 */
}

.badge-orange {
    --goes-badge-bg: #FFF7ED;
    /* orange-50 */
    --goes-badge-text: #C2410C;
    /* orange-700 */
    --goes-badge-marker: #F97316;
    /* orange-500 */
}

.badge-gray {
    --goes-badge-bg: #F9FAFB;
    /* gray-50 */
    --goes-badge-text: #4B5563;
    /* gray-700 */
    --goes-badge-marker: #9CA3AF;
    /* gray-400 */
}

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

.table {
    width: 100%;
    text-align: left;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    border-collapse: collapse;
}

.table thead {
    background-color: var(--goes-surface);
    border-bottom: 1px solid var(--goes-border-light);
}

.table th {
    padding: 20px 32px;
    /* px-8 py-5 */
    font-size: 10px;
    font-weight: 800;
    color: var(--goes-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    /* tracking-widest */
}

.table tbody tr {
    border-bottom: 1px solid var(--goes-border-light);
    transition: background-color 0.2s ease-in-out;
}

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

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

.table td {
    padding: 20px 32px;
    /* px-8 py-5 */
}

.table-actions {
    text-align: right;
    width: 96px;
    /* w-24 */
}

/* =========================================================================
   NAVBAR
   ========================================================================= */

.navbar {
    background-color: var(--goes-surface);
    border-bottom: 1px solid var(--goes-border-light);
    box-shadow: var(--shadow-sm);
    height: 48px;
    display: flex;
    align-items: center;
}

.nav-link {
    height: 48px;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--goes-text-secondary);
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease-in-out;
}

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

.nav-link-active {
    color: #f97316;
    /* Laranja da navbar atual */
    font-weight: 700;
    border-bottom-color: #f97316;
    background-color: rgba(255, 237, 213, 0.3);
    /* orange-50 com opacidade */
}

/* =========================================================================
   SWEETALERT2 GLOBAL OVERRIDES (goes-swal-*)
   ========================================================================= */

.goes-swal-popup {
    background-color: var(--goes-surface) !important;
    border-radius: var(--radius-lg) !important;
    /* 24px per DS */
    box-shadow: var(--shadow-xl) !important;
    border: 1px solid var(--goes-border-light) !important;
    padding: 32px 24px 24px 24px !important;
    font-family: 'Inter', sans-serif !important;
}

.goes-swal-title {
    color: var(--goes-text-heading) !important;
    font-size: 20px !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em !important;
    margin-bottom: 8px !important;
    padding: 0 !important;
}

.goes-swal-text {
    color: var(--goes-text-secondary) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
    margin-top: 0 !important;
    margin-bottom: 24px !important;
}

.goes-swal-icon {
    margin-top: 0 !important;
    margin-bottom: 24px !important;
    border-width: 0 !important;
    /* Remove swal default border */
}

/* Custom Icon Colors based on DS */
.swal2-icon.swal2-success {
    border-color: var(--goes-success) !important;
    color: var(--goes-success) !important;
}

.swal2-icon.swal2-error {
    border-color: var(--goes-error) !important;
    color: var(--goes-error) !important;
}

.swal2-icon.swal2-warning {
    border-color: var(--goes-warning) !important;
    color: var(--goes-warning) !important;
}

.swal2-icon.swal2-info {
    border-color: var(--goes-info) !important;
    color: var(--goes-info) !important;
}

/* Icon specific overrides (making them solid/softer) */
.swal2-icon.swal2-success [class^="swal2-success-line"] {
    background-color: var(--goes-success) !important;
}

.swal2-icon.swal2-success .swal2-success-ring {
    border-color: rgba(16, 185, 129, 0.2) !important;
}

.swal2-icon.swal2-error [class^="swal2-x-mark-line"] {
    background-color: var(--goes-error) !important;
}

.swal2-icon.swal2-error .swal2-x-mark {
    border-color: rgba(239, 68, 68, 0.2) !important;
}

.swal2-icon.swal2-info .swal2-info-content {
    color: var(--goes-info) !important;
}

.swal2-icon.swal2-info {
    border-color: rgba(59, 130, 246, 0.2) !important;
}

.swal2-icon.swal2-warning .swal2-warning-content {
    color: var(--goes-warning) !important;
}

.swal2-icon.swal2-warning {
    border-color: rgba(245, 158, 11, 0.2) !important;
}


.goes-swal-actions {
    gap: 12px !important;
    margin-top: 0 !important;
    width: 100% !important;
    justify-content: flex-end !important;
}

/* Buttons inside swal (inheriting from .btn-*) */
.goes-swal-confirm,
.goes-swal-cancel,
.goes-swal-deny {
    margin: 0 !important;
    font-family: 'Inter', sans-serif !important;
}

/* =========================================================================
   NATIVE MODALS (OVERLAYS, CONTAINERS, SIZES, CONTENT)
   ========================================================================= */

.modal-overlay {
    position: fixed;
    inset: 0;
    /* top:0, left:0, right:0, bottom:0 */
    background-color: rgba(15, 23, 42, 0.45);
    /* gray-900 with opacity */
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    /* Base for standard native modals (elevated to avoid dropdown/fabrik overlaps) */
    padding: 16px;
    /* fallback spacing on mobile */
}

/* Base Modal Container */
.modal {
    background-color: var(--goes-surface);
    border: 1px solid var(--goes-border);
    border-radius: var(--radius-lg);
    font-family: 'Inter', sans-serif;
    /* 24px */
    box-shadow: var(--shadow-xl);
    /* Heavy floating shadow */
    max-height: 90vh;
    /* Don't exceed screen height */
    overflow: hidden;
    /* Hide anything that spills out */
    display: flex;
    flex-direction: column;
    width: 100%;
    /* Default 100% width, bounded by max-width sizing classes */
    animation: fadeInScale 0.2s ease-out forwards;
}

/* Modal Sizes */
.modal-sm {
    max-width: 420px;
}

.modal-md {
    max-width: 720px;
}

.modal-lg {
    max-width: 980px;
}

/* Header */
.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--goes-border-light);
    background-color: var(--goes-surface);
    /* or gray-50 if wanted */
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

/* Title */
.modal-title {
    font-size: 18px;
    /* Slightly smaller than SweetAlert titles */
    font-weight: 800;
    color: var(--goes-text-heading);
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.01em;
    margin: 0;
}

/* Close Button (X) */
.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--goes-text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    font-family: 'Inter', sans-serif;
}

.modal-close:hover {
    color: var(--goes-text-heading);
    background-color: var(--goes-bg);
}

/* Body */
.modal-body {
    padding: 24px;
    font-family: 'Inter', sans-serif;
    overflow-y: auto;
    /* Scroll internally if body is too long */
    /* Custom scrollbar to look sleek inside modal */
    scrollbar-width: thin;
    flex: 1;
    /* take remaining height */
}

/* Footer (Actions) */
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--goes-border-light);
    background-color: var(--goes-bg);
    font-family: 'Inter', sans-serif;
    /* Usually slightly darker/grayer */
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Simple animation class */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* =========================================================================
   STATES (EMPTY & LOADING)
   ========================================================================= */

/* Empty State Container */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    text-align: center;
    background-color: transparent;
    border-radius: var(--radius-md);
}

/* Variant for standalone (not inside a table/card) */
.empty-state-card {
    background-color: var(--goes-surface);
    border: 1px dashed var(--goes-border);
}

.empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--goes-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--goes-text-muted);
    margin-bottom: 20px;
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.02);
}

.empty-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--goes-text-heading);
    margin-bottom: 8px;
}

.empty-text {
    font-size: 14px;
    color: var(--goes-text-secondary);
    max-width: 320px;
    margin: 0 auto 24px auto;
    line-height: 1.5;
}

.empty-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    color: var(--goes-text-secondary);
    font-size: 14px;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--goes-border-light);
    border-top-color: var(--goes-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

/* Skeletons */
.skeleton {
    background: linear-gradient(90deg, var(--goes-bg) 25%, var(--goes-border-light) 50%, var(--goes-bg) 75%);
    background-size: 400% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-pulse {
    0% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0 50%;
    }
}

.skeleton-line {
    height: 16px;
    margin-bottom: 12px;
    width: 100%;
}

.skeleton-line-sm {
    height: 16px;
    width: 60%;
}

.skeleton-line-lg {
    height: 16px;
    width: 85%;
}

.skeleton-block {
    height: 80px;
    width: 100%;
    margin-bottom: 12px;
    border-radius: var(--radius-md);
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}
