/* ==========================================================================
   LINOSFISCAL SAAS - MODERN DESIGN SYSTEM & UI/UX STYLESHEET
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    
    /* Brand Colors */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --secondary: #64748b;
    --success: #10b981;
    --success-light: #ecfdf5;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --info: #06b6d4;
    --info-light: #ecfeff;
    
    /* Neutral / Dark Palette */
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: #2563eb;
    --sidebar-text: #94a3b8;
    --sidebar-text-bright: #f8fafc;
    
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --border-focus: #3b82f6;
    --text-main: #1e293b;
    --text-muted: #64748b;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.04);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.04);
    
    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-full: 9999px;
}

body {
    font-family: var(--font-main) !important;
    background-color: var(--bg-body) !important;
    color: var(--text-main) !important;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
}

/* ==========================================================================
   CARDS & CONTAINERS
   ========================================================================== */
.card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-sm) !important;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md) !important;
}

.card-header {
    background-color: transparent !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 1.1rem 1.4rem !important;
    font-weight: 600;
}

.card-header h6, .card-header .card-title {
    font-weight: 700 !important;
    font-size: 1rem;
    color: var(--text-main) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body {
    padding: 1.4rem !important;
}

.card-footer {
    background-color: #fafafa !important;
    border-top: 1px solid var(--border-color) !important;
    padding: 1rem 1.4rem !important;
    border-bottom-left-radius: var(--radius-lg) !important;
    border-bottom-right-radius: var(--radius-lg) !important;
}

/* ==========================================================================
   STAT CARDS & METRIC WIDGETS
   ========================================================================== */
.stat-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 1.25rem;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    border-top-left-radius: var(--radius-lg);
    border-bottom-left-radius: var(--radius-lg);
}

.stat-card.stat-success::before { background: var(--success); }
.stat-card.stat-warning::before { background: var(--warning); }
.stat-card.stat-info::before { background: var(--info); }
.stat-card.stat-danger::before { background: var(--danger); }

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.825rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-icon.icon-primary { background: var(--primary-light); color: var(--primary); }
.stat-icon.icon-success { background: var(--success-light); color: var(--success); }
.stat-icon.icon-warning { background: var(--warning-light); color: var(--warning); }
.stat-icon.icon-info { background: var(--info-light); color: var(--info); }
.stat-icon.icon-danger { background: var(--danger-light); color: var(--danger); }

/* ==========================================================================
   CERTIFICATE STATUS ALERT WIDGET
   ========================================================================== */
.cert-status-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cert-status-info h5 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    color: #f8fafc;
}

.cert-status-info p {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 0;
}

/* ==========================================================================
   BUTTONS & ACTIONS
   ========================================================================== */
.btn {
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: none;
}

.btn-primary {
    background: var(--primary) !important;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
}
.btn-primary:hover {
    background: var(--primary-hover) !important;
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success) !important;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.25);
}
.btn-success:hover {
    background: #059669 !important;
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.35);
    transform: translateY(-1px);
}

.btn-info {
    background: var(--info) !important;
    color: #ffffff !important;
}

.btn-warning {
    background: var(--warning) !important;
    color: #ffffff !important;
}

.btn-danger {
    background: var(--danger) !important;
}

.style-action {
    padding: 0.3rem 0.55rem !important;
    font-size: 0.8rem !important;
    border-radius: var(--radius-sm) !important;
    margin-right: 0.2rem;
}

.button-voltar {
    padding: 0.35rem 0.85rem !important;
    font-size: 0.85rem !important;
}

/* ==========================================================================
   FORM INPUTS & CONTROLS
   ========================================================================== */
.form-control {
    font-family: var(--font-main);
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-sm) !important;
    font-size: 0.9rem !important;
    padding: 0.55rem 0.85rem !important;
    color: var(--text-main) !important;
    background-color: #ffffff !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    border-color: var(--border-focus) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

.form-control:disabled, .form-control[readonly] {
    background-color: #f1f5f9 !important;
    color: #64748b !important;
    cursor: not-allowed;
}

label {
    font-size: 0.825rem !important;
    font-weight: 600 !important;
    color: #334155 !important;
    margin-bottom: 0.35rem !important;
}

.select2-container--default .select2-selection--single {
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-sm) !important;
    height: 38px !important;
    padding: 4px 8px !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 28px !important;
    color: var(--text-main) !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px !important;
}

/* ==========================================================================
   TABLES & DATATABLES
   ========================================================================== */
.table {
    color: var(--text-main) !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

.table thead th {
    background-color: #f8fafc !important;
    color: #475569 !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    border-top: none !important;
    border-bottom: 2px solid var(--border-color) !important;
    padding: 0.85rem 1rem !important;
    vertical-align: middle;
}

.table tbody td {
    padding: 0.85rem 1rem !important;
    vertical-align: middle !important;
    border-top: 1px solid #f1f5f9 !important;
    font-size: 0.875rem;
}

.table-hover tbody tr:hover {
    background-color: #f8fafc !important;
}

/* ==========================================================================
   BADGES & PILLS
   ========================================================================== */
.badge {
    font-weight: 700;
    padding: 0.35em 0.75em;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    letter-spacing: 0.02em;
}

.badge-soft-success {
    background-color: var(--success-light) !important;
    color: #047857 !important;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-soft-danger {
    background-color: var(--danger-light) !important;
    color: #b91c1c !important;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-soft-warning {
    background-color: var(--warning-light) !important;
    color: #b45309 !important;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-soft-info {
    background-color: var(--info-light) !important;
    color: #0e7490 !important;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

/* ==========================================================================
   SIDEBAR & NAVBAR MODERN STYLING
   ========================================================================== */
.main-sidebar {
    background-color: var(--sidebar-bg) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.brand-link {
    background-color: #090e1a !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 1.1rem 1rem !important;
    text-align: center;
}

.brand-text {
    font-family: var(--font-main);
    font-size: 1.15rem;
    font-weight: 800 !important;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-sidebar .nav-item .nav-link {
    border-radius: var(--radius-md) !important;
    margin: 0.15rem 0.6rem !important;
    padding: 0.65rem 0.9rem !important;
    color: var(--sidebar-text) !important;
    font-weight: 500 !important;
    font-size: 0.88rem !important;
    transition: all 0.2s ease;
}

.nav-sidebar .nav-item .nav-link:hover {
    background-color: var(--sidebar-hover) !important;
    color: var(--sidebar-text-bright) !important;
}

.nav-sidebar .nav-item .nav-link.active {
    background-color: var(--sidebar-active) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35) !important;
    font-weight: 600 !important;
}

.nav-sidebar .nav-header {
    color: #475569 !important;
    font-size: 0.72rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.08em;
    padding: 1rem 1.4rem 0.35rem !important;
    text-transform: uppercase;
}

.main-header.navbar {
    background-color: #ffffff !important;
    border-bottom: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-sm);
    padding: 0.6rem 1.2rem !important;
}

/* ==========================================================================
   STAT CARDS & METRICS
   ========================================================================== */
.stat-card {
    background: #ffffff !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg) !important;
    padding: 1.25rem 1.5rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    box-shadow: var(--shadow-sm) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md) !important;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em;
    color: #64748b !important;
    margin-bottom: 0.35rem;
}

.stat-value {
    font-size: 1.35rem !important;
    font-weight: 800 !important;
    line-height: 1.2;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.icon-success {
    background: #ecfdf5 !important;
    color: #10b981 !important;
}

.icon-primary {
    background: #eff6ff !important;
    color: #2563eb !important;
}

.icon-warning {
    background: #fffbeb !important;
    color: #f59e0b !important;
}

.icon-danger {
    background: #fef2f2 !important;
    color: #ef4444 !important;
}

/* ==========================================================================
   MISC HELPERS
   ========================================================================== */
.uppercase {
    text-transform: uppercase;
}

.content-wrapper {
    background-color: var(--bg-body) !important;
    padding-top: 1rem;
}

.whatsapp-btn {
    background-color: #25d366 !important;
    color: #ffffff !important;
    font-weight: 600;
}
.whatsapp-btn:hover {
    background-color: #128c7e !important;
    color: #ffffff !important;
}