* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: #eef2f9;
    height: 100vh;
    overflow: hidden;
}

/* LAYOUT PRINCIPAL */
.app-wrapper {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* SIDEBAR AZUL PROFISSIONAL */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #0a2e4d 0%, #062238 100%);
    color: white;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0,0,0,0.08);
    z-index: 10;
    flex-shrink: 0;
}

.logo-area {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo-area h2 {
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-area h2 i {
    color: #5bc0ff;
    font-size: 1.5rem;
}

.nav-menu {
    flex: 1;
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: 12px;
    color: #d4e6f1;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    font-size: 0.875rem;
    user-select: none;
}

.nav-item i {
    width: 22px;
    font-size: 1.1rem;
    text-align: center;
}

.nav-item:hover {
    background: rgba(91, 192, 255, 0.15);
    color: white;
}

.nav-item.active {
    background: #1a6d9f;
    color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.user-bottom {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.82rem;
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
    background: #f5f7fc;
    min-width: 0;
}

/* CARDS PROFISSIONAIS */
.page-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #0a2e4d;
    margin-bottom: 24px;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-modern {
    background: white;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.04);
    padding: 22px 26px;
    margin-bottom: 22px;
    border: 1px solid #e9edf2;
    transition: box-shadow 0.2s;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

/* BOTÕES */
.btn {
    border: none;
    padding: 9px 20px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
    background: #f0f3f8;
    color: #1a4c6e;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.btn-primary {
    background: #1a6d9f;
    color: white;
    box-shadow: 0 2px 6px rgba(26,109,159,0.25);
}

.btn-primary:hover {
    background: #0e5a86;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(26,109,159,0.3);
}

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

.btn-success:hover {
    background: #1e9751;
    transform: translateY(-1px);
}

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

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

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

.btn-outline {
    border: 1px solid #cbdae9;
    background: white;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.75rem;
}

/* GRIDS */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

/* TABELAS */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid #ecf1f7;
    font-size: 0.875rem;
}

th {
    font-weight: 600;
    color: #1e4a6e;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: #f8fafd;
}

tr:hover td {
    background: #fafcff;
}

/* BADGES */
.badge {
    background: #e3f0fa;
    color: #1a6d9f;
    padding: 3px 10px;
    border-radius: 40px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-admin {
    background: #fde8e8;
    color: #c0392b;
}

.badge-consultor {
    background: #fff3cd;
    color: #856404;
}

.badge-representante {
    background: #d4edda;
    color: #155724;
}

/* INPUTS */
.input-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    align-items: center;
}

.input-group input,
.input-group select,
.input-group textarea,
textarea {
    padding: 10px 16px;
    border: 1.5px solid #dce3ec;
    border-radius: 50px;
    background: white;
    flex: 1;
    outline: none;
    transition: all 0.2s;
    font-size: 0.875rem;
    min-width: 140px;
}

.input-group textarea {
    border-radius: 12px;
}

.input-group input:focus,
.input-group select:focus {
    border-color: #5bc0ff;
    box-shadow: 0 0 0 3px rgba(91,192,255,0.15);
}

.input-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #3a5a7a;
    white-space: nowrap;
}

/* MODAL BODY VERTICAL FORM */
.modal-body .form-group {
    margin-bottom: 14px;
}

.modal-body .form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #3a5a7a;
    margin-bottom: 5px;
}

.modal-body .form-group input,
.modal-body .form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #dce3ec;
    border-radius: 10px;
    outline: none;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.modal-body .form-group input:focus,
.modal-body .form-group select:focus {
    border-color: #5bc0ff;
    box-shadow: 0 0 0 3px rgba(91,192,255,0.15);
}

/* LOGIN */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 46, 77, 0.94);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.login-card {
    background: white;
    border-radius: 32px;
    width: 400px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 30px 60px rgba(0,0,0,0.3);
}

.login-card h2 {
    font-size: 1.8rem;
    color: #0a2e4d;
    margin-bottom: 6px;
}

.login-card p {
    color: #4a627a;
    margin-bottom: 24px;
}

.login-card .input-group {
    flex-direction: column;
}

.login-card .input-group input {
    width: 100%;
    border-radius: 12px;
    text-align: left;
}

/* UTILITÁRIOS */
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-item {
    background: #fafcff;
    border-radius: 14px;
    padding: 12px 16px;
    margin-bottom: 8px;
    border: 1px solid #eef2f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-box {
    margin-bottom: 18px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box input,
.search-box select {
    padding: 9px 14px;
    border: 1.5px solid #dce3ec;
    border-radius: 50px;
    outline: none;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.search-box input:focus,
.search-box select:focus {
    border-color: #5bc0ff;
    box-shadow: 0 0 0 3px rgba(91,192,255,0.15);
}

/* GRÁFICOS */
.chart-container {
    position: relative;
    height: 280px;
    width: 100%;
    margin: 16px 0;
}

.chart-container-small {
    position: relative;
    height: 190px;
    width: 100%;
    margin: 12px 0;
}

/* FILE UPLOAD */
.file-upload {
    border: 2px dashed #dce3ec;
    border-radius: 14px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafcff;
}

.file-upload:hover {
    border-color: #5bc0ff;
    background: #f0f8ff;
}

.file-upload i {
    font-size: 1.8rem;
    color: #1a6d9f;
    margin-bottom: 8px;
}

/* MODAL */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.15s ease;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 28px;
    max-width: 520px;
    width: 92%;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.2s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e9edf2;
}

.modal-header h3 {
    font-size: 1.1rem;
    color: #0a2e4d;
    font-weight: 700;
}

.modal-close {
    background: #f0f3f8;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #6c86a3;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #fde8e8;
    color: #e74c3c;
}

.modal-body {
    padding-top: 4px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e9edf2;
    justify-content: flex-end;
}

/* STATUS */
.status-active {
    color: #27ae60;
    font-weight: 600;
}

.status-inactive {
    color: #e74c3c;
    font-weight: 600;
}

.status-pending {
    color: #f39c12;
    font-weight: 600;
}

/* PAGINAÇÃO */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 12px 0;
}

.pagination button {
    padding: 6px 16px;
    border: 1.5px solid #dce3ec;
    border-radius: 40px;
    background: white;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    color: #1a6d9f;
    transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
    background: #1a6d9f;
    color: white;
    border-color: #1a6d9f;
}

.pagination button:disabled {
    color: #bbb;
    cursor: not-allowed;
}

.pagination span {
    font-size: 0.82rem;
    color: #6c86a3;
    font-weight: 500;
}

/* TOAST NOTIFICATIONS */
#toastContainer {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: #1e2d3d;
    color: white;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 240px;
    max-width: 360px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    animation: toastIn 0.3s ease;
    pointer-events: all;
    border-left: 4px solid #5bc0ff;
}

.toast.toast-success { border-left-color: #27ae60; }
.toast.toast-error { border-left-color: #e74c3c; }
.toast.toast-warning { border-left-color: #f39c12; }
.toast.toast-info { border-left-color: #5bc0ff; }

.toast i {
    font-size: 1rem;
    flex-shrink: 0;
}

.toast.toast-success i { color: #27ae60; }
.toast.toast-error i { color: #e74c3c; }
.toast.toast-warning i { color: #f39c12; }
.toast.toast-info i { color: #5bc0ff; }

.toast-out {
    animation: toastOut 0.3s ease forwards;
}

/* LOADING SPINNER */
.loading-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* BARRA DE PROGRESSO */
.progress-bar-wrap {
    background: #e0e9f0;
    border-radius: 20px;
    height: 8px;
    margin-top: 8px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 20px;
    transition: width 0.4s ease;
}

/* PERMISSÕES ADMIN TOGGLE */
.permission-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}

.permission-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8fafd;
    border-radius: 10px;
    border: 1px solid #e9edf2;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.82rem;
}

.permission-item:hover {
    background: #eef5fb;
}

.permission-item input[type="checkbox"] {
    cursor: pointer;
    accent-color: #1a6d9f;
    width: 15px;
    height: 15px;
}

/* ANIMAÇÕES */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

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

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

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

/* RESPONSIVO */
@media (max-width: 768px) {
    .sidebar {
        width: 72px;
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
    }

    .sidebar .nav-item span,
    .sidebar .logo-area h2 span,
    .sidebar .user-bottom span:not(.btn span) {
        display: none;
    }

    .main-content {
        margin-left: 72px;
        padding: 16px;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .card-modern {
        padding: 16px;
    }

    .page-title {
        font-size: 1.3rem;
    }

    .input-group {
        flex-direction: column;
    }

    .login-card {
        width: 92%;
        padding: 28px;
    }

    #toastContainer {
        bottom: 16px;
        right: 16px;
        left: 16px;
    }

    .toast {
        min-width: unset;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 58px;
    }

    .main-content {
        margin-left: 58px;
        padding: 12px;
    }
}

/* PRINT */
@media print {
    .sidebar,
    .login-overlay,
    .btn,
    .search-box,
    #toastContainer,
    .modal-overlay {
        display: none !important;
    }

    .main-content {
        margin: 0;
        padding: 16px;
    }

    .card-modern {
        box-shadow: none;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
}
