/* ========================================
   QBC Software Suite - Estilos Base
   Framework CSS sobre Bootstrap 5
   ======================================== */

/* --- Variables CSS (Temas) --- */
:root {
    --qbc-primary: #0d6efd;
    --qbc-secondary: #6c757d;
    --qbc-success: #198754;
    --qbc-danger: #dc3545;
    --qbc-warning: #ffc107;
    --qbc-info: #0dcaf0;
    --qbc-sidebar-width: 250px;
    --qbc-navbar-height: 56px;
    --qbc-font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

    /* Light theme (default) */
    --qbc-bg: #f8f9fa;
    --qbc-bg-card: #ffffff;
    --qbc-text: #212529;
    --qbc-text-muted: #6c757d;
    --qbc-border: #dee2e6;
    --qbc-navbar-bg: #ffffff;
    --qbc-sidebar-bg: #212529;
    --qbc-sidebar-text: #adb5bd;
    --qbc-sidebar-hover: #495057;
    --qbc-sidebar-active: #0d6efd;
    --qbc-table-hover: #f8f9fa;
    --qbc-input-bg: #ffffff;
    --qbc-shadow: 0 0.125rem 0.25rem rgba(0,0,0,.075);
}

/* Dark theme */
[data-theme="dark"] {
    --qbc-bg: #1a1d21;
    --qbc-bg-card: #212529;
    --qbc-text: #e9ecef;
    --qbc-text-muted: #adb5bd;
    --qbc-border: #495057;
    --qbc-navbar-bg: #2c3034;
    --qbc-sidebar-bg: #111315;
    --qbc-sidebar-text: #adb5bd;
    --qbc-sidebar-hover: #343a40;
    --qbc-sidebar-active: #0d6efd;
    --qbc-table-hover: #2c3034;
    --qbc-input-bg: #343a40;
    --qbc-shadow: 0 0.125rem 0.25rem rgba(0,0,0,.3);
}

/* --- Base --- */
body {
    font-family: var(--qbc-font-family);
    background-color: var(--qbc-bg);
    color: var(--qbc-text);
    min-height: 100vh;
}

a {
    color: var(--qbc-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* --- Navbar --- */
.navbar.bg-dark {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.navbar-logo {
    height: 35px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.navbar-logo:hover {
    transform: scale(1.05);
}

.qbc-navbar {
    background-color: var(--qbc-navbar-bg);
    border-bottom: 1px solid var(--qbc-border);
    box-shadow: var(--qbc-shadow);
    height: var(--qbc-navbar-height);
    z-index: 1030;
}

.qbc-navbar .navbar-brand {
    font-weight: 700;
    color: var(--qbc-primary);
    font-size: 1.25rem;
}

.qbc-navbar .navbar-brand span {
    color: var(--qbc-text-muted);
    font-weight: 400;
    font-size: 0.85rem;
    margin-left: 8px;
}

.qbc-navbar .nav-link {
    color: var(--qbc-text);
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s;
}

.qbc-navbar .nav-link:hover {
    background-color: var(--qbc-table-hover);
    text-decoration: none;
}

.qbc-navbar .nav-link.active {
    color: var(--qbc-primary);
    font-weight: 600;
}

.qbc-navbar .nav-link i {
    margin-right: 6px;
    width: 18px;
    text-align: center;
}

/* --- Main Content --- */
.qbc-main {
    padding: 1.5rem;
    min-height: calc(100vh - var(--qbc-navbar-height) - 60px);
}

/* --- Cards --- */
.qbc-card {
    background-color: var(--qbc-bg-card);
    border: 1px solid var(--qbc-border);
    border-radius: 0.5rem;
    box-shadow: var(--qbc-shadow);
    margin-bottom: 1.5rem;
}

.qbc-card .card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--qbc-border);
    font-weight: 600;
    padding: 1rem 1.25rem;
}

.qbc-card .card-body {
    padding: 1.25rem;
}

/* Stats cards */
.qbc-stat-card {
    border-left: 4px solid var(--qbc-primary);
    transition: transform 0.2s;
}

.qbc-stat-card:hover {
    transform: translateY(-2px);
}

.qbc-stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--qbc-text);
}

.qbc-stat-card .stat-label {
    font-size: 0.875rem;
    color: var(--qbc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.qbc-stat-card .stat-icon {
    font-size: 2.5rem;
    color: var(--qbc-primary);
    opacity: 0.3;
}

.qbc-stat-card.border-success { border-left-color: var(--qbc-success); }
.qbc-stat-card.border-success .stat-icon { color: var(--qbc-success); }
.qbc-stat-card.border-warning { border-left-color: var(--qbc-warning); }
.qbc-stat-card.border-warning .stat-icon { color: var(--qbc-warning); }
.qbc-stat-card.border-danger { border-left-color: var(--qbc-danger); }
.qbc-stat-card.border-danger .stat-icon { color: var(--qbc-danger); }
.qbc-stat-card.border-info { border-left-color: var(--qbc-info); }
.qbc-stat-card.border-info .stat-icon { color: var(--qbc-info); }

/* --- Tables --- */
.qbc-table {
    background-color: var(--qbc-bg-card);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--qbc-shadow);
}

.qbc-table table {
    margin-bottom: 0;
}

.qbc-table thead th {
    background-color: var(--qbc-bg);
    border-bottom: 2px solid var(--qbc-border);
    color: var(--qbc-text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.qbc-table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--qbc-border);
    color: var(--qbc-text);
}

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

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

/* --- Forms --- */
.qbc-form .form-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--qbc-text);
    margin-bottom: 0.35rem;
}

.qbc-form .form-control,
.qbc-form .form-select {
    background-color: var(--qbc-input-bg);
    color: var(--qbc-text);
    border-color: var(--qbc-border);
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
}

.qbc-form .form-control:focus,
.qbc-form .form-select:focus {
    border-color: var(--qbc-primary);
    box-shadow: 0 0 0 0.2rem rgba(13,110,253,.15);
}

.qbc-form .form-text {
    color: var(--qbc-text-muted);
    font-size: 0.8rem;
}

/* --- Badges --- */
.badge-license-trial { background-color: #6c757d; }
.badge-license-basic { background-color: #0d6efd; }
.badge-license-professional { background-color: #198754; }
.badge-license-enterprise { background-color: #6f42c1; }

.badge-log-debug { background-color: #6c757d; }
.badge-log-info { background-color: #0dcaf0; color: #000; }
.badge-log-warning { background-color: #ffc107; color: #000; }
.badge-log-error { background-color: #dc3545; }
.badge-log-critical { background-color: #6f42c1; }

/* --- Page Header --- */
.qbc-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--qbc-border);
}

.qbc-page-header h1,
.qbc-page-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--qbc-text);
}

/* --- Footer --- */
.qbc-footer {
    background-color: var(--qbc-bg-card);
    border-top: 1px solid var(--qbc-border);
    padding: 1rem;
    text-align: center;
    color: var(--qbc-text-muted);
    font-size: 0.8rem;
}

.footer-qcb {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%) !important;
    border-top: 3px solid #0d6efd;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

.footer-logo {
    height: 30px;
    width: auto;
    max-width: 130px;
    object-fit: contain;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.footer-logo:hover {
    opacity: 1;
}

.footer-qcb .text-muted {
    color: #adb5bd !important;
}

/* --- Utilities --- */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cursor-pointer {
    cursor: pointer;
}

/* --- Dashboard Stat Cards (colorful) --- */
.dash-card {
    transition: transform 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.dash-card:hover {
    transform: translateY(-5px);
}

.dash-card .card-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* --- Tables --- */
.table th {
    font-weight: 500;
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* --- Animations --- */
.fade-in {
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .qbc-main {
        padding: 1rem;
    }

    .qbc-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .qbc-stat-card .stat-value {
        font-size: 1.5rem;
    }

    .qbc-table {
        overflow-x: auto;
    }

    .footer-logo {
        height: 25px;
        max-width: 110px;
    }

    .navbar-logo {
        height: 30px;
        max-width: 120px;
    }
}

@media (max-width: 576px) {
    .qbc-navbar .navbar-brand span {
        display: none;
    }
}

/* --- Print --- */
@media print {
    .qbc-navbar,
    .qbc-footer,
    .btn,
    .no-print {
        display: none !important;
    }

    .qbc-main {
        padding: 0;
    }

    .qbc-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
