/* LuxLight Theme - Sistema Figueiredo Nunes Serviços */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* Sidebar */
.sidebar {
    width: 260px;
    height: 100vh;
    background: #2c3e50;
    position: fixed;
    left: 0;
    top: 0;
    padding: 20px 0;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.sidebar .logo {
    padding: 0 25px 30px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 30px;
}

.sidebar .logo h2 {
    color: #f39c12;
    font-size: 20px;
    font-weight: 600;
}

.sidebar .logo p {
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    margin-top: 5px;
}

.sidebar nav ul {
    list-style: none;
    padding: 0;
}

.sidebar nav ul li {
    margin-bottom: 5px;
}

.sidebar nav ul li a {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar nav ul li a:hover,
.sidebar nav ul li a.active {
    background: rgba(243, 156, 18, 0.1);
    color: #f39c12;
    border-left-color: #f39c12;
}

.sidebar nav ul li a i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

/* User Info */
.user-info {
    background: rgba(255,255,255,0.05);
    margin: 0 15px 20px;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #f39c12;
}

.user-info h3 {
    color: #fff;
    font-size: 14px;
    margin-bottom: 8px;
}

.user-info p {
    color: rgba(255,255,255,0.7);
    font-size: 11px;
    margin-bottom: 5px;
}

.user-info .permission-badge {
    display: inline-block;
    background: #f39c12;
    color: #2c3e50;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 5px;
}

.user-info .logout-btn {
    background: #e74c3c;
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-size: 11px;
    margin-top: 10px;
    display: inline-block;
    transition: background 0.3s ease;
}

.user-info .logout-btn:hover {
    background: #c0392b;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    padding: 30px;
    min-height: 100vh;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.header h1 {
    color: #2c3e50;
    font-size: 28px;
    font-weight: 600;
}

.header .subtitle {
    color: #666;
    font-size: 14px;
    margin-top: 5px;
}

.user-indicator {
    background: white;
    padding: 10px 20px;
    border-radius: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-indicator .avatar {
    width: 32px;
    height: 32px;
    background: #f39c12;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

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

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-left: 4px solid #f39c12;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.stat-card .icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    margin-bottom: 15px;
}

.stat-card .value {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.stat-card .label {
    color: #666;
    font-size: 14px;
}

.stat-card .change {
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
}

.stat-card .change.positive {
    color: #27ae60;
}

.stat-card .change.negative {
    color: #e74c3c;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden;
    margin-bottom: 20px;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.card-body {
    padding: 25px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    border-color: #f39c12;
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.1);
    outline: none;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #f39c12;
    color: white;
}

.btn-primary:hover {
    background: #e67e22;
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(243, 156, 18, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left-color: #27ae60;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left-color: #e74c3c;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left-color: #f39c12;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left-color: #17a2b8;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 20px;
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

.table tbody tr {
    border-bottom: 1px solid #dee2e6;
}

.table tbody tr:last-child {
    border-bottom: 1px solid #dee2e6;
}

.table td {
    border-bottom: none;
}

/* Permission Levels */
.permission-level {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.permission-level-1 { background: #e9ecef; color: #6c757d; }
.permission-level-2 { background: #cce5ff; color: #0066cc; }
.permission-level-3 { background: #fff3cd; color: #856404; }
.permission-level-4 { background: #d4edda; color: #155724; }
.permission-level-5 { background: #f8d7da; color: #721c24; }

/* Login Page Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header .logo {
    width: 60px;
    height: 60px;
    background: #f39c12;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 24px;
    color: white;
}

.login-header h1 {
    color: #2c3e50;
    font-size: 24px;
    margin-bottom: 5px;
}

.login-header p {
    color: #666;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
}

/* Table Responsive */
.table-responsive {
    overflow-x: auto;
}

/* Additional utilities */
.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-20 { margin-bottom: 20px; }
.mt-20 { margin-top: 20px; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-10 { gap: 10px; }
.gap-15 { gap: 15px; }
.gap-20 { gap: 20px; }

/* User Profile Link e Logout Button no Header */
.logout-btn-header {
    background: #e74c3c;
    color: white;
    padding: 8px 12px;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.logout-btn-header:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.user-profile-link:hover {
    opacity: 0.8;
    transform: translateY(-1px);
    transition: all 0.3s ease;
}

.user-indicator {
    background: white;
    padding: 10px 20px;
    border-radius: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Produtos Específicos */
.products-table {
    width: 100%;
    border-collapse: collapse;
}

.products-table th,
.products-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.products-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.products-table tr:hover {
    background: #f8f9fa;
}

.product-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
}

.product-image {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.fallback-icon {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.product-image-dashboard {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.product-image-dashboard img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.product-image-large {
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.product-image-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.product-type {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.product-type-iluminação { background: #fff3cd; color: #856404; }
.product-type-mobiliário { background: #d1ecf1; color: #0c5460; }
.product-type-acessórios { background: #f8d7da; color: #721c24; }
.product-type-lighting { background: #fff3cd; color: #856404; }
.product-type-wall---ceiling-lamp-indoor { background: #fff3cd; color: #856404; }
.product-type-furniture { background: #d1ecf1; color: #0c5460; }
.product-type-accessories { background: #f8d7da; color: #721c24; }

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.stat-info h3 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
}

.stat-info p {
    margin: 5px 0 0 0;
    color: #7f8c8d;
    font-size: 14px;
}

/* Botões pequenos */
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-outline {
    background: transparent;
    border: 1px solid #dee2e6;
    color: #6c757d;
}

.btn-outline:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    color: #495057;
}

/* Badges */
.badge {
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
    text-transform: uppercase;
}

.badge-primary { background: #007bff; color: white; }
.badge-info { background: #17a2b8; color: white; }
.badge-success { background: #28a745; color: white; }
.badge-secondary { background: #6c757d; color: white; }
.badge-danger { background: #dc3545; color: white; }
.badge-warning { background: #ffc107; color: #212529; }

/* Grid system */
.row {
    display: flex;
    gap: 20px;
    margin: 0 -10px;
}

.col-md-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
    padding: 0 10px;
}

@media (max-width: 768px) {
    .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Form control pequeno */
.form-control-sm {
    padding: 6px 10px;
    font-size: 12px;
    height: auto;
}

/* Padding zero para cards */
.p-0 { padding: 0 !important; }
.p-20 { padding: 20px; }

/* Avatar pequeno */
.avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f39c12;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 12px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    overflow-y: auto;
    padding: 20px;
}

.modal.show {
    display: block;
}

/* Modal de Gerenciamento de Perfis */
.modal-perfis .modal-content {
    max-width: 500px;
    margin: 30px auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

/* Modal de Novo Perfil */
.modal-novo-perfil .modal-content {
    max-width: 350px;
    margin: 30px auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
    transform: translateY(0);
    transition: transform 0.3s ease;
    z-index: 1065 !important;
}

/* Modal de Editar Perfil */
.modal-editar-perfil .modal-content {
    max-width: 350px;
    margin: 30px auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
    transform: translateY(0);
    transition: transform 0.3s ease;
    z-index: 1065 !important;
}

/* Regra geral para modal-content - para todos os outros modais */
.modal-content {
    max-width: 600px;
    margin: 30px auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    margin: 0;
    font-size: 15px;
    color: #2c3e50;
}

.modal-body {
    padding: 15px;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
}

/* Ajustes para tabelas dentro do modal */
.modal-perfis .table-sm th,
.modal-perfis .table-sm td {
    padding: 6px 10px;
    font-size: 13px;
    white-space: nowrap;
}

.modal-perfis .table-sm td:last-child {
    white-space: nowrap;
    width: 1%;
}

/* Ajustes para inputs dentro do modal */
.modal .form-group {
    margin-bottom: 12px;
}

.modal .form-group label {
    font-size: 13px;
    margin-bottom: 3px;
    color: #666;
    display: block;
}

.modal .form-control {
    font-size: 13px;
    padding: 6px 10px;
    height: 32px;
}

.modal textarea.form-control {
    min-height: 60px;
    resize: vertical;
}

.modal .row {
    margin: -5px;
}

.modal .row > div {
    padding: 5px;
}

.modal-footer {
    padding: 12px 15px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.modal .btn-sm {
    padding: 4px 10px;
    font-size: 12px;
    height: 26px;
    line-height: 1;
}

.close {
    background: transparent;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0;
    margin: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

/* Notification */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    background: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 1060;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease forwards;
    max-width: 400px;
}

.notification.success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.notification.error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.notification.warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.notification.info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Table Styles */
.table {
    width: 100%;
    margin-bottom: 1rem;
    background-color: transparent;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px;
    vertical-align: middle;
    border-top: 1px solid #dee2e6;
}

.table thead th {
    vertical-align: bottom;
    border-bottom: 2px solid #dee2e6;
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.table tbody tr:hover {
    background-color: rgba(0,0,0,.075);
}

.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: -ms-autohiding-scrollbar;
}

/* Form Styles */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: .5rem;
    color: #495057;
    font-weight: 500;
}

.form-control {
    display: block;
    width: 100%;
    padding: .375rem .75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: .25rem;
    transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}

.form-control:focus {
    color: #495057;
    background-color: #fff;
    border-color: #f39c12;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(243,156,18,.25);
}

.custom-control {
    position: relative;
    display: block;
    min-height: 1.5rem;
    padding-left: 1.5rem;
}

.custom-control-input {
    position: absolute;
    z-index: -1;
    opacity: 0;
}

.custom-control-label {
    position: relative;
    margin-bottom: 0;
    vertical-align: top;
    cursor: pointer;
}

.custom-control-label::before {
    position: absolute;
    top: .25rem;
    left: -1.5rem;
    display: block;
    width: 1rem;
    height: 1rem;
    pointer-events: none;
    content: "";
    background-color: #fff;
    border: 1px solid #adb5bd;
    border-radius: .25rem;
}

.custom-control-label::after {
    position: absolute;
    top: .25rem;
    left: -1.5rem;
    display: block;
    width: 1rem;
    height: 1rem;
    content: "";
    background: no-repeat 50%/50% 50%;
}

.custom-checkbox .custom-control-input:checked ~ .custom-control-label::before {
    background-color: #f39c12;
    border-color: #f39c12;
}

.custom-checkbox .custom-control-input:checked ~ .custom-control-label::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3e%3c/svg%3e");
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 400;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: .375rem .75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: .25rem;
    transition: color .15s ease-in-out,
                background-color .15s ease-in-out,
                border-color .15s ease-in-out,
                box-shadow .15s ease-in-out;
    cursor: pointer;
}

.btn:focus {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(243,156,18,.25);
}

.btn-primary {
    color: #fff;
    background-color: #f39c12;
    border-color: #f39c12;
}

.btn-primary:hover {
    color: #fff;
    background-color: #d68910;
    border-color: #c87f0a;
}

.btn-info {
    color: #fff;
    background-color: #17a2b8;
    border-color: #17a2b8;
}

.btn-info:hover {
    color: #fff;
    background-color: #138496;
    border-color: #117a8b;
}

.btn-success {
    color: #fff;
    background-color: #28a745;
    border-color: #28a745;
}

.btn-success:hover {
    color: #fff;
    background-color: #218838;
    border-color: #1e7e34;
}

.btn-danger {
    color: #fff;
    background-color: #dc3545;
    border-color: #dc3545;
}

.btn-danger:hover {
    color: #fff;
    background-color: #c82333;
    border-color: #bd2130;
}

.btn-outline {
    color: #6c757d;
    background-color: transparent;
    border-color: #6c757d;
}

.btn-outline:hover {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

.btn-sm {
    padding: .25rem .5rem;
    font-size: .875rem;
    line-height: 1.5;
    border-radius: .2rem;
}

/* Alert Styles */
.alert {
    position: relative;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: .25rem;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeeba;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* Utility Classes */
.d-flex { display: flex !important; }
.justify-between { justify-content: space-between !important; }
.align-center { align-items: center !important; }
.gap-10 { gap: 10px !important; }
.text-center { text-align: center !important; }
.mb-20 { margin-bottom: 20px !important; }
.mt-20 { margin-top: 20px !important; }

/* Estilos para valores monetários - evitar quebra de linha */
.currency-value,
.stat-card .value,
.price-display,
strong[style*="color"] {
    white-space: nowrap !important;
    display: inline-block;
}

/* Estilos específicos para tabelas com valores monetários */
.products-table td strong,
.table td strong {
    white-space: nowrap;
    display: inline-block;
}

/* Garantir que símbolos € fiquem junto com números */
.euro-symbol {
    display: inline-block;
    white-space: nowrap;
}

/* Evitar quebra em valores formatados */
.formatted-price {
    white-space: nowrap;
    display: inline-block;
}

@media (max-width: 768px) {
    .modal-content {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .upload-area {
        padding: 20px;
    }
    
    .upload-placeholder p {
        font-size: 14px;
    }
}

/* Imagens na página de alíquotas */
.aliquotas-table td {
    vertical-align: middle;
}

.aliquotas-table .product-image {
    width: 120px;
    height: 90px;
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    background: #f5f5f5;
}

.aliquotas-table .produto-img-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.aliquotas-table .produto-img-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
}

.aliquotas-table .produto-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 12px;
    gap: 5px;
}

.aliquotas-table .produto-img-placeholder i {
    font-size: 20px;
    margin-bottom: 4px;
}

.aliquotas-table .produto-img-placeholder small {
    font-size: 11px;
}

/* Ajuste para produtos sem imagem */
.aliquotas-table .sem-imagem {
    width: 120px;
    height: 90px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: #999;
    font-size: 12px;
}

/* Estilos específicos para o modal de adicionar produto em orçamentos */
#modalProduto .modal-content {
    max-width: 1200px;
    width: 95vw;
    margin: 20px auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    position: relative;
    transform: translateY(0);
    transition: transform 0.3s ease;
    overflow-y: auto;
    max-height: 90vh;
}

/* Garantir que o modal de produto esteja bem centralizado */
#modalProduto {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Responsivo para o modal de produto */
@media (max-width: 768px) {
    #modalProduto .modal-content {
        width: 100%;
        margin: 10px;
        max-width: calc(100vw - 20px);
        max-height: calc(100vh - 40px);
    }
}

/* Melhorar layout interno do modal de produto */
#modalProduto .modal-body {
    padding: 20px;
}

#modalProduto .row {
    margin-bottom: 15px;
}

#modalProduto .form-group {
    margin-bottom: 15px;
}

#modalProduto .form-group label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #495057;
}

/* Estilos para seção do carrinho */
#modalProduto .modal-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

#modalProduto .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

#modalProduto .section-header h4 {
    margin: 0;
    color: #495057;
    font-size: 16px;
}

/* Ajustar larguras dos inputs para melhor alinhamento */
#modalProduto .col-md-2 .form-control,
#modalProduto .col-md-3 .form-control {
    min-width: 100%;
}

/* Melhorar visual dos botões no modal */
#modalProduto .btn-orange {
    background: #f39c12;
    border-color: #f39c12;
    color: white;
    border-radius: 4px;
}

#modalProduto .btn-orange:hover {
    background: #e67e22;
    border-color: #e67e22;
}

/* Separador visual para seções */
#modalProduto .section-separator {
    border-top: 1px solid #dee2e6;
    margin-top: 20px;
    padding-top: 20px;
}

/* Melhorar alinhamento dos inputs com botões */
#modalProduto .d-flex {
    display: flex;
    align-items: end;
    gap: 8px;
}

#modalProduto .flex-grow-1 {
    flex: 1;
}

#modalProduto .position-relative {
    position: relative;
}

/* Garantir que botões tenham a mesma altura dos inputs */
#modalProduto .btn-orange {
    height: 38px;
    min-width: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
}

/* Estilos para botões desativados - devem ficar cinza */
#modalProduto .btn-orange:disabled {
    background: #6c757d !important;
    border-color: #6c757d !important;
    color: #fff !important;
    cursor: not-allowed;
    opacity: 0.65;
}

#modalProduto .btn-orange:disabled:hover {
    background: #6c757d !important;
    border-color: #6c757d !important;
    color: #fff !important;
    transform: none;
}

/* Melhorar aparência da seção de alíquotas */
#modalProduto .section-separator h5 {
    color: #495057;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Estilos para preview de imagem */
#modalProduto .produto-imagem-preview {
    width: 100%;
    height: 120px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    overflow: hidden;
}

#modalProduto .produto-placeholder {
    text-align: center;
    color: #6c757d;
}

#modalProduto .produto-placeholder i {
    font-size: 32px;
    margin-bottom: 8px;
    display: block;
}

/* Nota informativa do modo carrinho */
#modalProduto #nota-carrinho {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
}

/* Modal footer melhorado */
#modalProduto .modal-footer {
    padding: 20px;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

/* Reorganizar seção de alíquota para ficar inline */
#modalProduto .aliquota-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: 10px;
}

#modalProduto .aliquota-section small {
    font-size: 11px;
    color: #6c757d;
    margin-bottom: 5px;
    text-align: center;
    line-height: 1.2;
}

/* Botões do footer alinhados */
#modalProduto .modal-footer .btn {
    margin: 0;
    white-space: nowrap;
}

/* Ordem dos botões: Cancelar, Salvar Alíquota, Adicionar */
#modalProduto .modal-footer .btn-outline {
    order: 1;
}

#modalProduto .modal-footer .btn-warning {
    order: 2;
}

#modalProduto .modal-footer .btn-primary {
    order: 3;
}

/* Grid system para o modal */
#modalProduto .row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -7.5px;
}

#modalProduto .col-md-2,
#modalProduto .col-md-3,
#modalProduto .col-md-4,
#modalProduto .col-md-6,
#modalProduto .col-md-8,
#modalProduto .col-md-12 {
    padding: 0 7.5px;
    box-sizing: border-box;
}

#modalProduto .col-md-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
#modalProduto .col-md-3 { flex: 0 0 25%; max-width: 25%; }
#modalProduto .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
#modalProduto .col-md-6 { flex: 0 0 50%; max-width: 50%; }
#modalProduto .col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
#modalProduto .col-md-12 { flex: 0 0 100%; max-width: 100%; }

/* Responsivo para o grid */
@media (max-width: 768px) {
    #modalProduto .col-md-2,
    #modalProduto .col-md-3,
    #modalProduto .col-md-4,
    #modalProduto .col-md-6,
    #modalProduto .col-md-8 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 10px;
    }
    
    #modalProduto .d-flex {
        flex-direction: column;
        align-items: stretch;
    }
    
    #modalProduto .btn-orange {
        width: 100%;
        margin-top: 10px;
    }
    
    /* Footer responsivo - manter botões organizados */
    #modalProduto .modal-footer {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 8px;
    }
    
    #modalProduto .aliquota-section {
        margin-right: 0;
        margin-bottom: 10px;
        order: 0;
    }
    
    #modalProduto .modal-footer .btn {
        width: 100%;
        order: unset;
    }
    
    /* Ordem mobile: Adicionar, Salvar, Cancelar (de cima para baixo) */
    #modalProduto .modal-footer .btn-primary {
        order: 1;
    }
    
    #modalProduto .modal-footer .btn-warning {
        order: 2;
    }
    
    #modalProduto .modal-footer .btn-outline {
        order: 3;
    }
}

/* Melhorar espaçamento dos form-control */
#modalProduto .form-control {
    height: 38px;
    border-radius: 4px;
    border: 1px solid #ced4da;
    padding: 0.375rem 0.75rem;
    font-size: 14px;
}

#modalProduto .form-control:focus {
    border-color: #f39c12;
    box-shadow: 0 0 0 0.2rem rgba(243, 156, 18, 0.25);
}

/* Garantir que todos os botões desativados tenham estilo cinza */
#modalProduto .btn:disabled,
#modalProduto .btn[disabled],
#modalProduto button:disabled,
#modalProduto button[disabled] {
    background: #6c757d !important;
    border-color: #6c757d !important;
    color: #fff !important;
    cursor: not-allowed !important;
    opacity: 0.65 !important;
}

#modalProduto .btn:disabled:hover,
#modalProduto .btn[disabled]:hover,
#modalProduto button:disabled:hover,
#modalProduto button[disabled]:hover {
    background: #6c757d !important;
    border-color: #6c757d !important;
    color: #fff !important;
    transform: none !important;
    opacity: 0.65 !important;
}

/* Estilo específico para botões pequenos desativados */
#modalProduto .btn-sm:disabled {
    font-size: 12px;
    padding: 4px 8px;
}

/* Estilos para áreas de upload nos modais de produtos */
.upload-area {
    min-height: 150px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding: 20px;
    border-style: dashed;
    border-width: 3px;
    border-color: #ddd;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(243, 156, 18, 0.1);
}

.upload-area:hover {
    border-color: #f39c12;
    background: #fff8e6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.2), inset 0 0 0 2px rgba(243, 156, 18, 0.3);
}

.upload-area:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3);
}

.upload-placeholder {
    text-align: center;
    color: #6c757d;
    user-select: none;
    pointer-events: none;
    z-index: 1;
    position: relative;
    padding: 20px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.upload-area:hover .upload-placeholder {
    border-color: #f39c12;
    background: #fff8e6;
}

.upload-placeholder i {
    color: #f39c12 !important;
    font-size: 48px !important;
    margin-bottom: 15px !important;
    display: block;
    opacity: 0.8;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.upload-area:hover .upload-placeholder i {
    transform: scale(1.1);
    color: #e67e22 !important;
}

.upload-placeholder p {
    margin: 8px 0 5px 0 !important;
    font-weight: 600;
    color: #495057 !important;
    font-size: 16px;
}

.upload-placeholder small {
    color: #6c757d !important;
    font-size: 12px;
    display: block;
    margin-top: 5px;
}

/* Animação suave para quando arquivo é selecionado */
.upload-area.has-content {
    animation: contentLoaded 0.5s ease-in-out;
}

@keyframes contentLoaded {
    0% {
        transform: scale(0.95);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Melhorar texto indicativo das áreas */
.upload-area:not(.has-content) .upload-placeholder::before {
    content: "💡 Dica: Você pode arrastar o arquivo aqui";
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: #f39c12;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
    z-index: 10;
}

.upload-area:not(.has-content):hover .upload-placeholder::before {
    opacity: 1;
}

/* Melhorar visual dos botões de remoção */
.upload-area .btn-danger {
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.upload-area .btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.4);
}

/* Corrigir conflito com o placeholder HTML */
.upload-area .upload-placeholder::after {
    content: "✨ Arraste ou clique para selecionar ✨" !important;
    display: block;
    font-size: 11px;
    color: #f39c12;
    margin-top: 8px;
    font-weight: 500;
    opacity: 0.8;
}

/* Remover o placeholder CSS quando há conteúdo */
.upload-area.has-content .upload-placeholder::after {
    display: none !important;
}

/* Melhorar a indicação visual para mobile */
@media (max-width: 768px) {
    .upload-area .upload-placeholder::after {
        content: "📱 Toque para selecionar arquivo" !important;
    }
    
    .upload-area:not(.has-content) .upload-placeholder::before {
        content: "💡 Toque na área para selecionar";
    }
}

/* Quando já tem arquivo selecionado */
.upload-area .image-preview,
.upload-area .schema-preview {
    width: 100%;
    text-align: center;
}

.upload-area .image-preview img,
.upload-area .schema-preview img {
    max-width: 100%;
    max-height: 120px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Upload area quando tem conteúdo */
.upload-area:has(.image-preview:not([style*="display: none"])),
.upload-area:has(.schema-preview:not([style*="display: none"])) {
    border-color: #28a745;
    background: #f8fff8;
    min-height: auto;
}

.upload-area:has(.image-preview:not([style*="display: none"])):hover,
.upload-area:has(.schema-preview:not([style*="display: none"])):hover {
    border-color: #1e7e34;
    background: #f0fff0;
}

/* Fallback para navegadores que não suportam :has() */
.upload-area.has-content {
    border-color: #28a745;
    background: #f8fff8;
    min-height: auto;
}

.upload-area.has-content:hover {
    border-color: #1e7e34;
    background: #f0fff0;
}

/* Melhorar botões de remover dentro das áreas de upload */
.upload-area .btn-danger {
    background: #dc3545;
    border-color: #dc3545;
    font-size: 12px;
    padding: 5px 10px;
    margin-top: 10px;
}

.upload-area .btn-danger:hover {
    background: #c82333;
    border-color: #bd2130;
}

/* Estados das áreas de upload */
.upload-area.drag-over {
    border-color: #f39c12;
    background: #fff8e6;
    transform: scale(1.02);
}

.upload-area.has-content::before {
    content: "✅ Arquivo selecionado";
    background: #28a745;
}

/* Melhorar responsividade das áreas de upload */
@media (max-width: 768px) {
    .upload-area {
        min-height: 120px;
        padding: 15px;
    }
    
    .upload-placeholder i {
        font-size: 36px !important;
    }
    
    .upload-placeholder p {
        font-size: 14px;
    }
    
    .upload-area::before {
        content: "📁 Toque para selecionar";
        font-size: 10px;
        padding: 3px 6px;
    }
}

/* Indicador visual de "clique aqui" */
.upload-area::before {
    content: "👆 Clique aqui para selecionar";
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(45deg, #f39c12, #e67e22);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.upload-area:hover::before {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.4);
}

/* Melhorar a aparência quando há erro */
.upload-area.error {
    border-color: #dc3545;
    background: #fff5f5;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.upload-area.error::before {
    content: "❌ Erro no arquivo";
    background: linear-gradient(45deg, #dc3545, #c82333);
    opacity: 1;
    animation: errorPulse 1s ease-in-out;
}

@keyframes errorPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* =====================================================================
   MODAL: GERENCIAR PERFIS DE ALÍQUOTA (orcamentos.php)
   ===================================================================== */
#modalGerenciarPerfis .modal-dialog {
    max-width: 900px;
    width: 95vw;
    margin: 1.75rem auto;
}

#modalGerenciarPerfis .modal-content {
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

#modalGerenciarPerfis .modal-header {
    background: #212529; /* Dark header igual aos outros modais principais */
    color: #ffffff;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#modalGerenciarPerfis .modal-header .modal-title {
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

#modalGerenciarPerfis .modal-header i {
    font-size: 18px;
}

#modalGerenciarPerfis .btn-close {
    filter: invert(1);
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

#modalGerenciarPerfis .btn-close:hover {
    opacity: 1;
}

#modalGerenciarPerfis .modal-body {
    padding: 0;
    overflow: hidden;
}

#modalGerenciarPerfis iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Scrollbar suave dentro do iframe (se suportado) */
#modalGerenciarPerfis iframe::-webkit-scrollbar {
    width: 8px;
}
#modalGerenciarPerfis iframe::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
}

/* Ajustar o botão "+ Novo Perfil" dentro do iframe para combinar */
iframe body .btn-primary {
    background: #0d6efd;
    border-color: #0d6efd;
}
iframe body .btn-primary:hover {
    background: #0b5ed7;
    border-color: #0a58ca;
}

/* Garantir z-index mais alto para modais internos (iframe) */
.modal-novo-perfil,
.modal-editar-perfil {
    z-index: 1065 !important; /* acima do backdrop padrão (1050) */
}

/* Reduzir z-index do backdrop dentro de iframes para evitar sobrepor o modal */
body .modal-backdrop {
    z-index: 1050 !important;
}

/* Modal Detalhes Cliente */
.modal-view-cliente .modal-content {
    max-width: 700px;
    width: 95vw;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.gradient-orange {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
}

.modal-view-cliente .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.modal-view-cliente .modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-view-cliente .modal-body {
    padding: 25px 30px;
}

.modal-view-cliente .modal-body h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #2c3e50;
}

.modal-view-cliente .modal-body p {
    margin: 4px 0;
    font-size: 14px;
    color: #333;
}

.modal-view-cliente .modal-footer {
    padding: 15px 20px;
    display: flex;
    justify-content: flex-end;
    background: #f8f9fa;
}

/* Modais de Alíquotas (Nova / Editar) */
#modalNovaAliquota .modal-content,
#modalEditarAliquota .modal-content {
    max-width: 900px;
    width: 95vw;
}
#modalNovaAliquota .modal-body,
#modalEditarAliquota .modal-body {
    overflow-x: hidden;
} 