/* ============================================
   FINOPS DASHBOARD - CSS STYLES
   ============================================ */

:root {
    /* Primary Colors - Refined for Scandinavian Minimalism */
    --primary: #2c3e50;
    --primary-dark: #1a252f;
    --primary-light: #5d6d7e;
    --primary-subtle: rgba(44, 62, 80, 0.05);
    
    /* Status Colors */
    --success: #10b981;
    --success-subtle: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-subtle: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-subtle: rgba(239, 68, 68, 0.1);
    --info: #06b6d4;
    --info-subtle: rgba(6, 182, 212, 0.1);
    --orange: #f97316;
    --orange-subtle: rgba(249, 115, 22, 0.1);
    
    /* Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --header-height: 70px;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 250ms ease;
    --transition-slow: 350ms ease;
}

/* ============================================
   BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
  /*  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; */
    font-family: "Poppins", sans-serif;
    background-color: var(--gray-100);
    color: var(--gray-800);
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: linear-gradient(45deg, #0C2450 50%, #21889B 100%);
    border-right: 1px solid var(--gray-200);
    color: white;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: width var(--transition);
}

.sidebar-header {
    padding: 24px;
    padding-bottom: 6px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
}

.logo i {
    font-size: 32px;
    color: var(--primary);
}
.logo span {
    color: var(--primary);
}

.linha-vertical {
    width: 100%;
    margin-left: 0;
    border-bottom: 1.5px solid rgb(212 212 212 / 61%);
    margin-bottom: 5%;
    margin-top: 5%;
}

.sidebar-nav {
    flex: 1;
    list-style: none;
    padding: 0px 12px;
    overflow-y: auto;

}

.sidebar-nav .nav-item {
    margin-bottom: 4px;
}

.sidebar-nav .nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgb(199, 199, 199);
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
    font-weight: 500;
}

.sidebar-nav .nav-item a:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.sidebar-nav .nav-item.active a {
    border: 1.5px solid white;
    border-radius: 8px;
    color: white;
    font-weight: 600;
}
.sidebar-nav .nav-item.active a:hover {
    color: var(--primary);
}

.sidebar-nav .nav-item a i {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tenant-selector label {
    display: block;
    font-size: 12px;
    color: var(--gray-400);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tenant-selector .form-select {
    background-color: transparent;
    border: 1px solid var(--gray-200);
    color: white;
    font-size: 13px;
}

.tenant-selector .form-select:focus {
    background-color: transparent;
    border-color: var(--gray-200);
    box-shadow: 0 0 0 3px var(--primary-subtle);
}

.tenant-selector .form-select option {
    background-color: white;
    color: var(--gray-800);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left var(--transition);
    background-color: #c9c9c96e;
}

/* ============================================
   HEADER
   ============================================ */
.top-header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 24px;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.sidebar-toggle {
    display: none;
    font-size: 24px;
    color: var(--gray-600);
}

.header-title {
    flex: 1;
}

.header-title h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 2px;
}

.header-title p {
    font-size: 13px;
    color: var(--gray-500);
    margin: 0;
}

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

.last-update {
    font-size: 12px;
    color: var(--gray-400);
}

/* ============================================
   CONTENT SECTIONS
   ============================================ */
.content-section {
    display: none;
    padding: 24px;
    animation: fadeIn 0.3s ease;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   METRIC CARDS
   ============================================ */
.metric-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    transition: all var(--transition-fast);
}

.metric-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.metric-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.bg-primary-subtle {
    background: var(--primary-subtle);
    color: var(--primary);
}

.bg-danger-subtle {
    background: var(--danger-subtle);
    color: var(--danger);
}

.bg-warning-subtle {
    background: var(--warning-subtle);
    color: var(--warning);
}

.bg-orange-subtle {
    background: var(--orange-subtle);
    color: var(--orange);
}

.bg-success-subtle {
    background: var(--success-subtle);
    color: var(--success);
}

.metric-info {
    flex: 1;
}

.metric-label {
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 500;
}

.metric-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.alert-card .metric-value {
    color: var(--danger);
}

.warning-card .metric-value {
    color: var(--warning);
}

/* ============================================
   STAT CARDS (GRADIENT)
   ============================================ */
.stat-card {
    border-radius: var(--border-radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    color: white;
    box-shadow: var(--shadow-md);
    height: 85%;
}

.stat-card i {
    font-size: 40px;
    opacity: 0.9;
}

.stat-label {
    font-size: 13px;
    opacity: 0.9;
    display: block;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    margin: 0;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.bg-gradient-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
}

.bg-gradient-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: white;
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    background: white;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
}

.card-header h5 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 20px;
}

.chart-card {
    height: 100%;
}

.chart-card .card-body {
    min-height: 300px;
}

/* ============================================
   TABLES
   ============================================ */
.table {
    margin-bottom: 0;
}

.table thead th {
    background: var(--gray-50);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-600);
    border-bottom: 2px solid var(--gray-200);
    padding: 12px 16px;
    white-space: nowrap;
}

.table tbody td {
    padding: 14px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--gray-100);
    font-size: 13px;
}

.table tbody tr:hover {
    background-color: var(--gray-50);
}

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

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.alarm {
    background: var(--danger-subtle);
    color: var(--danger);
}

.status-badge.warning {
    background: var(--warning-subtle);
    color: #b45309;
}

.status-badge.ok {
    background: var(--success-subtle);
    color: var(--success);
}

.status-badge.info {
    background: var(--info-subtle);
    color: var(--info);
}

.status-badge.public {
    background: var(--orange-subtle);
    color: var(--orange);
}

.status-badge.private {
    background: var(--primary-subtle);
    color: var(--primary);
}

/* Progress Bar in Table */
.usage-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.usage-bar .progress {
    flex: 1;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.usage-bar .progress-bar {
    transition: width var(--transition);
}

.usage-bar .percentage {
    font-size: 12px;
    font-weight: 600;
    min-width: 45px;
    text-align: right;
}

/* ============================================
   FORMS & FILTERS
   ============================================ */
.form-select {
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--gray-300);
    padding: 8px 36px 8px 12px;
    font-size: 13px;
    transition: all var(--transition-fast);
}

.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-subtle);
}

.btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ============================================
   LOADING OVERLAY
   ============================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.active {
    display: flex;
}

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

.loading-content p {
    margin-top: 16px;
    color: var(--gray-600);
    font-weight: 500;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast {
    border-radius: var(--border-radius-sm);
    border: none;
    box-shadow: var(--shadow-lg);
}

.toast-header {
    background: white;
    border-bottom: 1px solid var(--gray-100);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
}

@media (max-width: 768px) {
    .content-section {
        padding: 16px;
    }
    
    .metric-card {
        padding: 16px;
    }
    
    .metric-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .metric-value {
        font-size: 24px;
    }
    
    .header-title h1 {
        font-size: 18px;
    }
    
    .last-update {
        display: none;
    }
    
    .section-header .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .filters {
        width: 100%;
    }
    
    .filters .form-select {
        flex: 1;
    }

    #dadosStorage {
        width: 100% !important;
    }

    #gridStorage {
        grid-template-columns: repeat(2, 1fr) !important;

    }

}

#gridStorage {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

#dadosStorage {
    width: 100% !important;
}
/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-truncate-id {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-truncate-custom {
    max-width: 180px;    /* Ajuste esse valor para o tamanho que desejar */
    white-space: nowrap; /* Impede que o texto pule para a linha de baixo */
    overflow: hidden;    /* Esconde o que sobrar */
    text-overflow: ellipsis; /* Adiciona os "..." automaticamente */
    display: inline-block;
    vertical-align: middle;
}

.cursor-pointer {
    cursor: pointer;
}

.money {
    /* font-family: 'SF Mono', 'Monaco', 'Consolas', monospace; */
    font-family: "Poppins", sans-serif;
    font-weight: 600;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--gray-500);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h6 {
    font-weight: 600;
    margin-bottom: 8px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

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

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

#skuModal .modal-header {
    border-bottom: 0;
}

#skuModal .modal-title {
    font-size: 1.1rem;
    font-weight: 600;
}

#skuTableBody tr td {
    padding: 12px 8px;
}

.anomaly-card {
    transition: transform 0.2s;
    cursor: default;
}

.anomaly-card:hover {
    transform: scale(1.01);
}

.btn-xs {
    padding: 1px 5px;
    font-size: 0.75rem;
    line-height: 1.5;
    border-radius: 3px;
}

.badge-time {
    background: rgba(0,0,0,0.1);
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
}

.anomaly-card {
    transition: transform 0.2s;
    border-left: 4px solid transparent;
}

.anomaly-card.alert-danger { border-left-color: #dc3545; }
.anomaly-card.alert-warning { border-left-color: #ffc107; }

/* Força a tabela a respeitar as larguras definidas */
.table-commitments {
    table-layout: fixed;
    width: 100%;
    border-collapse: collapse;
}

/* Define larguras específicas para cada coluna */
.col-tenant { width: 15%; }
.col-date   { width: 12%; }
.col-money  { width: 15%; }
.col-usage  { width: 20%; } /* Mais espaço para a barra + porcentagem */
.col-updated { width: 10%; }


/* Trava o layout da tabela */
#commitmentsTable {
    table-layout: fixed; /* O segredo principal */
    width: 100%;
    border-collapse: collapse;
}

/* Evita que textos muito longos ou quebras de linha empurrem as colunas */
#commitmentsTable th, 
#commitmentsTable td {
    white-space: nowrap; 
    overflow: hidden;
    text-overflow: ellipsis; /* Adiciona "..." se o texto for maior que a coluna */
    vertical-align: middle;
}

/* Alinhamento das barras de progresso para que fiquem sempre iguais */
.usage-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.usage-bar .progress {
    flex-grow: 1; /* A barra ocupa todo o espaço central disponível */
    height: 8px;
    margin-bottom: 0;
}

.usage-bar .percentage {
    min-width: 48px; /* Impede que a barra mude de tamanho se o número for 9% ou 100% */
    text-align: right;
    font-variant-numeric: tabular-nums; /* Mantém números alinhados verticalmente */
}

#TituloBudgets {
    font-size: 1.5rem;
    margin-bottom: 0px;

}

#SubTituloBudgets {
    margin-bottom: 0px;

}

.chart-area {
    position: relative;
    height: 320px; /* Defina a altura que você deseja para ambos */
    width: 100%;
}



/*.grid_dos_graficos {
    display: grid !important;
    /* Força duas colunas de tamanhos iguais
    grid-template-columns: repeat(2, 1fr) !important; 
    gap: 20px;
    width: 100%;
    align-items: start;
}

/* Isso impede que o card estique a coluna e empilhe 
.grid_dos_graficos > .card {
    min-width: 0; 
    width: 100%;
}

/* Garante que o container do gráfico não quebre o grid 
.chart-container {
    position: relative;
    height: 350px;
    width: 100%;
}*/

/* 1. Define a largura da barra vertical e altura da horizontal */
::-webkit-scrollbar {
  width: 2px;
  height: 10px;
}

/* 2. O "Caminho" (fundo) da barra */
::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

/* 3. A "Alça" (o que você arrasta) */
::-webkit-scrollbar-thumb {
  background: #3c5879;
}

/* 4. Efeito ao passar o mouse */
::-webkit-scrollbar-thumb:hover {
  background: #004494;
}


.badgerole {
    color: black;
}