:root {
    --primary-color: #FF6600;
    --primary-dark: #E55A00;
    --primary-light: #FF8533;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #FF6600;
    --info-color: #0dcaf0;
    --dark-bg: #1a1a1a;
    --text-light: #f8f9fa;
}

html {
    height: 100%;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
    color: white !important;
}

.navbar {
    background-color: var(--dark-bg) !important;
    border-bottom: 3px solid var(--primary-color);
}

.navbar-nav .nav-link {
    color: var(--text-light) !important;
    transition: color 0.3s;
    font-size: 0.9rem;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
}

.navbar-nav .nav-link.dashboard-icon {
    color: var(--primary-color) !important;
    background-color: rgba(255, 102, 0, 0.15);
    border-radius: 8px;
    padding: 8px 12px !important;
    margin: 0 5px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(255, 102, 0, 0.3);
}

.navbar-nav .nav-link.dashboard-icon:hover {
    background-color: rgba(255, 102, 0, 0.25);
    box-shadow: 0 4px 8px rgba(255, 102, 0, 0.4);
    transform: translateY(-2px);
}

.navbar-nav .nav-link.dashboard-icon i {
    font-size: 1.3em;
}

.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    border-bottom: 2px solid var(--primary-dark);
}

.table-responsive {
    border-radius: 0.375rem;
}

.btn-action {
    margin: 0 2px;
}

.badge-custom {
    padding: 0.5em 0.75em;
}

.summary-box {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.summary-box h5 {
    color: white;
    margin-bottom: 1rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.summary-item:last-child {
    border-bottom: none;
    font-weight: bold;
    font-size: 1.1rem;
    margin-top: 0.5rem;
    padding-top: 1rem;
}

.login-container {
    min-height: 100vh;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--dark-bg) 0%, #2d2d2d 100%);
    background-attachment: fixed;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
    position: relative;
    width: 100%;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 102, 0, 0.1) 0%, rgba(229, 90, 0, 0.1) 100%);
    z-index: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.login-card {
    position: relative;
    z-index: 1;
    max-width: 400px;
    width: 100%;
}

.form-floating label {
    color: #6c757d;
}

.alert {
    border-radius: 0.5rem;
}

.modal-header {
    background-color: var(--primary-color);
    color: white;
    border-bottom: 2px solid var(--primary-dark);
}

.modal-header .btn-close {
    filter: invert(1);
}

.stats-card {
    transition: transform 0.2s;
}

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

.stats-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

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

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

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

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

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

.border-primary {
    border-color: var(--primary-color) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.badge.bg-primary {
    background-color: var(--primary-color) !important;
}

.alert-primary {
    background-color: rgba(255, 102, 0, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-dark);
}

a {
    color: var(--primary-color);
}

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

/* Footer fixo no fundo */
body > .container-fluid.flex-grow-1 {
    flex: 1 0 auto;
    min-height: 0;
}

footer {
    margin-top: auto;
    flex-shrink: 0;
    width: 100%;
    position: relative;
}

/* Menu Dashboard Dropdown ao Hover */
.dropdown-hover {
    position: relative;
}

.dropdown-hover > .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    background-color: #2d2d2d;
    border: 1px solid rgba(255, 102, 0, 0.3);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 220px;
    padding: 8px 0;
    z-index: 1000;
    animation: fadeIn 0.2s ease-in;
}

.dropdown-hover:hover > .dropdown-menu {
    display: block;
}

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

.dropdown-hover .dropdown-menu .dropdown-item {
    color: var(--text-light) !important;
    padding: 10px 20px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dropdown-hover .dropdown-menu .dropdown-item:hover {
    background-color: rgba(255, 102, 0, 0.2);
    color: var(--primary-color) !important;
    padding-left: 25px;
}

.dropdown-hover .dropdown-menu .dropdown-item i {
    width: 20px;
    text-align: center;
}

.dropdown-hover .dropdown-menu .dropdown-divider {
    border-color: rgba(255, 102, 0, 0.3);
    margin: 8px 0;
}

/* Submenu vertical */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu > .dropdown-item {
    position: relative;
}

.dropdown-submenu > .dropdown-item .float-end {
    margin-left: auto;
    font-size: 0.8em;
}

.dropdown-submenu-menu {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    margin-left: 0;
    background-color: #2d2d2d;
    border: 1px solid rgba(255, 102, 0, 0.3);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 200px;
    padding: 8px 0;
    z-index: 1001;
    animation: slideInRight 0.2s ease-in;
    white-space: nowrap;
}

.dropdown-submenu:hover > .dropdown-submenu-menu {
    display: block;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.dropdown-submenu-menu .dropdown-item {
    color: var(--text-light) !important;
    padding: 8px 20px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}.dropdown-submenu-menu .dropdown-item:hover {
    background-color: rgba(255, 102, 0, 0.2);
    color: var(--primary-color) !important;
    padding-left: 25px;
}.dropdown-submenu-menu .dropdown-item i {
    width: 20px;
    text-align: center;
}

/* Responsividade - em telas pequenas, usar dropdown normal */
@media (max-width: 991px) {
    .dropdown-hover > .dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        border: none;
        background-color: transparent;
    }
    
    .dropdown-hover:hover > .dropdown-menu,
    .dropdown-hover.show > .dropdown-menu {
        display: block;
    }
    
    .dropdown-submenu-menu {
        position: static;
        margin: 0;
        padding-left: 20px;
        box-shadow: none;
        border: none;
        background-color: rgba(255, 102, 0, 0.1);
    }
}

/* Tabela de Artigos mais compacta */
#tabela_artigos_lista {
    font-size: 0.875rem;
}

#tabela_artigos_lista thead th {
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
}

#tabela_artigos_lista tbody td {
    padding: 0.4rem 0.5rem;
    vertical-align: middle;
}

/* Colunas mais pequenas: Categoria, Subcategoria */
#tabela_artigos_lista thead th:nth-child(1),
#tabela_artigos_lista tbody td:nth-child(1) {
    width: 100px;
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}#tabela_artigos_lista thead th:nth-child(2),
#tabela_artigos_lista tbody td:nth-child(2) {
    width: 120px;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Colunas de preços mais pequenas */
#tabela_artigos_lista thead th:nth-child(7),
#tabela_artigos_lista tbody td:nth-child(7),
#tabela_artigos_lista thead th:nth-child(8),
#tabela_artigos_lista tbody td:nth-child(8),
#tabela_artigos_lista thead th:nth-child(9),
#tabela_artigos_lista tbody td:nth-child(9),
#tabela_artigos_lista thead th:nth-child(11),
#tabela_artigos_lista tbody td:nth-child(11) {
    width: 110px;
    max-width: 110px;
    white-space: nowrap;
    text-align: right;
}

/* Taxa IVA e Stock mais pequenas */
#tabela_artigos_lista thead th:nth-child(10),
#tabela_artigos_lista tbody td:nth-child(10),
#tabela_artigos_lista thead th:nth-child(12),
#tabela_artigos_lista tbody td:nth-child(12) {
    width: 80px;
    max-width: 80px;
    text-align: center;
}

/* Estado e Ações mais pequenas */
#tabela_artigos_lista thead th:nth-child(13),
#tabela_artigos_lista tbody td:nth-child(13),
#tabela_artigos_lista thead th:nth-child(14),
#tabela_artigos_lista tbody td:nth-child(14) {
    width: 90px;
    max-width: 90px;
    text-align: center;
}

#tabela_artigos_lista .badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
}

#tabela_artigos_lista .btn-sm {
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
}
