/**
 * TEMA MODERNO E CLEAN
 * Sistema de Gestão de Fornecedores
 * Inspirado em design systems modernos
 */

/* ============================================================================
   RESET E BASE
   ============================================================================ */

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

:root {
    --primary-color: #008080;
    --primary-light: #20B2AA;
    --primary-dark: #006666;
    
    --accent-color: #FFBF00;
    --accent-light: #FFD700;
    
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    
    --bg-body: #f9fafb;
    --bg-white: #ffffff;
    --bg-light: #f3f4f6;
    --bg-sidebar: #ffffff;
    
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
    font-family: var(--font-family) !important;
    font-size: 14px !important;
    color: var(--text-primary) !important;
    /* background: var(--bg-body) !important; */
    line-height: 1.6 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: linear-gradient(135deg, rgba(245, 247, 250, 0.9) 0%, rgba(195, 207, 226, 0.9) 100%), url('/assets/img/fundo.svg') center / cover no-repeat fixed !important;
    background-blend-mode: overlay !important;
}

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

.app-container {
    display: flex !important;
    min-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ============================================================================
   SIDEBAR
   ============================================================================ */

.sidebar {
    width: 260px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    border-right: 1px solid var(--border-color) !important;
    display: flex !important;
    flex-direction: column !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    height: 100vh !important;
    z-index: 1000 !important;
    overflow-y: auto !important;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.sidebar-logo {
    max-width: 160px;
    height: auto;
    margin-bottom: 8px;
    filter: drop-shadow(0 2px 4px rgba(107, 114, 128, 0.3));
}

.sidebar-title {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sidebar-menu {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.sidebar-menu ul {
    list-style: none !important;
    padding-left: 0 !important;
    margin: 0 !important;
}

.sidebar-menu li {
    margin: 4px 12px !important;
    padding: 0 !important;
    list-style: none !important;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
}

.sidebar-menu a:hover {
    background: var(--bg-light);
    color: var(--text-primary);
}

.sidebar-menu a.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(0, 128, 128, 0.2);
}

.sidebar-menu i {
    margin-right: 12px;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* ============================================================================
   MAIN CONTENT
   ============================================================================ */

.main-content {
    flex: 1 !important;
    margin-left: 260px !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh !important;
    width: calc(100% - 260px) !important;
}

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

.navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    border-bottom: 1px solid var(--border-color);
    padding: 0 30px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-left h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.user-menu:hover {
    background: var(--bg-light);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

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

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ============================================================================
   BREADCRUMB
   ============================================================================ */

.breadcrumb-container {
    padding: 5px 30px;
    background: transparent !important;
    border-bottom: 1px solid var(--border-color);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb .active {
    color: var(--text-primary);
    font-weight: 500;
}

/* ============================================================================
   PAGE CONTENT
   ============================================================================ */

.page-content {
    flex: 1;
    padding: 30px;
}

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

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

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

/* ============================================================================
   STATS CARDS
   ============================================================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    border: none;
    border-top: 2px solid #000000;
    border-left: 2px solid #000000;
    border-bottom: 2px solid #6b7280;
    border-right: 2px solid #6b7280;
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.stat-card.primary::before {
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
}

.stat-card.success::before {
    background: var(--success-color);
}

.stat-card.warning::before {
    background: var(--warning-color);
}

.stat-card.danger::before {
    background: var(--danger-color);
}

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.stat-card.primary .stat-icon {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
}

.stat-card.success .stat-icon {
    background: var(--success-color);
}

.stat-card.warning .stat-icon {
    background: var(--warning-color);
}

.stat-card.danger .stat-icon {
    background: var(--danger-color);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-trend {
    font-size: 12px;
    margin-top: 8px;
}

.trend-up {
    color: var(--success-color);
}

.trend-down {
    color: var(--danger-color);
}

/* ============================================================================
   CARD/WIDGET
   ============================================================================ */

.card {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    border: none;
    border-top: 2px solid #000000;
    border-left: 2px solid #000000;
    border-bottom: 2px solid #6b7280;
    border-right: 2px solid #6b7280;
    border-radius: 12px;
    margin-bottom: 24px;
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title i {
    color: var(--primary-color);
}

.card-actions {
    display: flex;
    gap: 8px;
}

.card-body {
    padding: 24px;
}

.card-body.no-padding {
    padding: 0;
}

/* ============================================================================
   TABELAS - ESTILO PROFISSIONAL
   ============================================================================ */

.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Roboto', 'Arial', sans-serif;
    font-size: 14px;
    margin: 0;
    background: transparent !important;
}

.table thead {
    background: #f8f9fa;
}

.table thead th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
}

.table thead th:first-child {
    padding-left: 24px;
}

.table thead th:last-child {
    padding-right: 24px;
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

/* Efeito zebra - Linhas alternadas */
.table tbody tr:nth-child(odd) {
    background-color: #ffffff !important;
}

.table tbody tr:nth-child(even) {
    background-color: #f8f9fa !important;
}

.table tbody tr:hover {
    background-color: #e9ecef !important;
}

.table tbody td {
    padding: 16px 20px;
    color: #212529;
    vertical-align: middle;
    border-bottom: 1px solid #dee2e6;
}

.table tbody td:first-child {
    padding-left: 24px;
    font-weight: 500;
}

.table tbody td:last-child {
    padding-right: 24px;
}

/* Ícones na primeira coluna */
.table tbody td .status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    margin-right: 8px;
}

.table tbody td .status-icon.success {
    background: #d1fae5;
    color: #065f46;
}

.table tbody td .status-icon.warning {
    background: #fef3c7;
    color: #92400e;
}

.table tbody td .status-icon.danger {
    background: #fee2e2;
    color: #991b1b;
}

/* Botões de ação na tabela */
.table-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.table-actions .btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.table-actions .btn-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.table-actions .btn-success {
    background: #10b981;
    color: white;
}

.table-actions .btn-primary {
    background: #3b82f6;
    color: white;
}

.table-actions .btn-danger {
    background: #ef4444;
    color: white;
}

.table-actions .btn-warning {
    background: #f59e0b;
    color: white;
}

/* Alinhamento de texto */
.table .text-center {
    text-align: center !important;
}

.table .text-end {
    text-align: right !important;
}

.table .text-start {
    text-align: left !important;
}

/* ============================================================================
   BADGES - ESTILO PROFISSIONAL
   ============================================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #3b82f6;
}

.badge-dark {
    background: #1f2937;
    color: #ffffff;
    border: 1px solid #111827;
}

/* Badges de status específicos para tabelas */
.badge.status-expiring {
    background: #f59e0b;
    color: #ffffff;
    border: none;
}

.badge.status-registered {
    background: #10b981;
    color: #ffffff;
    border: none;
}

.badge.status-flagged {
    background: #1f2937;
    color: #ffffff;
    border: none;
}

/* Suporte para classes bg-* do Bootstrap */
.bg-danger {
    background: #fee2e2 !important;
    color: #991b1b !important;
}

.bg-success {
    background: #d1fae5 !important;
    color: #065f46 !important;
}

.bg-warning {
    background: #fef3c7 !important;
    color: #92400e !important;
}

.bg-info {
    background: #dbeafe !important;
    color: #1e40af !important;
}

/* ============================================================================
   LIST GROUP
   ============================================================================ */

.list-group {
    display: flex;
    flex-direction: column;
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
}

.list-group-item {
    position: relative;
    display: block;
    padding: 12px 16px;
    background-color: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.list-group-item:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.list-group-item:last-child {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    border-bottom: none;
}

.list-group-item:hover {
    background-color: var(--bg-light);
}

/* ============================================================================
   BOTÕES
   ============================================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
}

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

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

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

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

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

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================================
   FORMULÁRIOS
   ============================================================================ */

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 128, 128, 0.1);
}

.input-search {
    position: relative;
}

.input-search input {
    padding-left: 40px;
}

.input-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

/* ============================================================================
   PAGINAÇÃO
   ============================================================================ */

.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
}

.pagination-info {
    font-size: 13px;
    color: var(--text-secondary);
}

.pagination {
    display: flex;
    gap: 4px;
    list-style: none;
}

.pagination li a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.pagination li a:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination li.active a {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination li.disabled a {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================================================
   MODAL
   ============================================================================ */

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ============================================================================
   ALERTS
   ============================================================================ */

.alert {
    padding: 16px 20px;
    border-radius: 10px;
    border-left: 4px solid;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert-success {
    background: #d1fae5;
    border-color: var(--success-color);
    color: #065f46;
}

.alert-danger {
    background: #fee2e2;
    border-color: var(--danger-color);
    color: #991b1b;
}

.alert-warning {
    background: #fef3c7;
    border-color: var(--warning-color);
    color: #92400e;
}

.alert-info {
    background: #dbeafe;
    border-color: var(--info-color);
    color: #1e40af;
}

/* ============================================================================
   LOADING
   ============================================================================ */

.loading-spinner {
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* ============================================================================
   RESPONSIVO
   ============================================================================ */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================
   UTILIDADES
   ============================================================================ */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-secondary { color: var(--text-secondary) !important; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-2 { gap: 16px; }

