* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --azul-marinho: #2c3e50;
    --bege: #c9ada1;
    --cinza-claro: #f5f3f1;
    --branco: #ffffff;
    --cinza-escuro: #666666;
    --verde-aceito: #27ae60;
    --vermelho-erro: #e74c3c;
    --laranja-aviso: #f39c12;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--cinza-claro) 0%, #f0ebe4 100%);
    color: var(--azul-marinho);
    min-height: 100vh;
    padding: 0;
    margin: 0;
}

.container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* SIDEBAR */
.sidebar {
    width: 280px;
    background: var(--azul-marinho);
    color: var(--branco);
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo i {
    color: var(--bege);
}

.sidebar-subtitle {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-info {
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.1);
    font-size: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-badge {
    display: inline-block;
    background: var(--bege);
    color: var(--azul-marinho);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 11px;
}

.nav-menu {
    flex: 1;
    padding: 20px 0;
    list-style: none;
}

.nav-menu li {
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.nav-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.3s ease;
}

.nav-menu li a i {
    width: 20px;
    text-align: center;
}

.nav-menu li:hover {
    border-left-color: var(--bege);
    background: rgba(255, 255, 255, 0.05);
}

.nav-menu li.active {
    border-left-color: var(--bege);
    background: rgba(0, 0, 0, 0.2);
}

.nav-menu li.active a {
    color: var(--branco);
    font-weight: 600;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-logout {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--branco);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: var(--vermelho-erro);
    border-color: var(--vermelho-erro);
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.header {
    background: var(--branco);
    padding: 20px 30px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--azul-marinho);
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--cinza-claro);
    border: 1px solid #d0c8c0;
    border-radius: 6px;
    padding: 8px 12px;
    width: 250px;
    transition: all 0.3s ease;
}

.search-box:focus-within {
    border-color: var(--bege);
    box-shadow: 0 0 0 3px rgba(201, 173, 161, 0.1);
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    flex: 1;
    font-size: 13px;
    color: var(--azul-marinho);
}

.search-box input::placeholder {
    color: #999;
}

.btn-primary {
    background: var(--azul-marinho);
    color: var(--branco);
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-primary:hover {
    background: #1a2634;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.2);
}

/* CONTENT AREA */
.content-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    background: linear-gradient(135deg, var(--cinza-claro) 0%, #f0ebe4 100%);
}

.view {
    display: none;
}

.view.active {
    display: block;
}

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

.stat-card {
    background: var(--branco);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

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

.stat-label {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--azul-marinho);
    margin-bottom: 8px;
}

.stat-change {
    font-size: 12px;
    color: var(--verde-aceito);
}

/* LOGO UPLOAD */
.logo-upload-section {
    background: var(--branco);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #e0e0e0;
}

.logo-upload-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--azul-marinho);
}

.logo-preview-area {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.logo-box {
    width: 120px;
    height: 120px;
    background: var(--cinza-claro);
    border: 2px dashed var(--bege);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.logo-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.logo-box-placeholder {
    color: #999;
    font-size: 12px;
    text-align: center;
}

.upload-input {
    padding: 8px 12px;
    background: var(--cinza-claro);
    border: 1px solid #d0c8c0;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-input:hover {
    border-color: var(--bege);
}

/* FOLDER TREE */
.folder-tree {
    background: var(--branco);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    margin-bottom: 30px;
}

.folder-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--azul-marinho);
}

.folder-list {
    list-style: none;
}

.folder-item {
    padding: 10px;
    margin: 5px 0;
    background: var(--cinza-claro);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 3px solid transparent;
}

.folder-item:hover {
    background: #eae4dc;
    border-left-color: var(--bege);
}

.folder-item.active {
    background: var(--azul-marinho);
    color: var(--branco);
    border-left-color: var(--bege);
    font-weight: 600;
}

.folder-item i {
    color: var(--bege);
    font-size: 16px;
}

.folder-item.active i {
    color: var(--branco);
}

/* DOCUMENTS LIST */
.documents-section {
    background: var(--branco);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

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

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--azul-marinho);
}

.filter-controls {
    display: flex;
    gap: 10px;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #d0c8c0;
    border-radius: 6px;
    font-size: 12px;
    background: var(--branco);
    color: var(--azul-marinho);
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-select:hover {
    border-color: var(--bege);
}

.documents-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.documents-table thead {
    background: var(--cinza-claro);
    border-top: 1px solid #d0c8c0;
    border-bottom: 1px solid #d0c8c0;
}

.documents-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--azul-marinho);
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
}

.documents-table th:hover {
    background: #e8e0d8;
}

.documents-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.documents-table tr:hover {
    background: #fafafa;
}

.doc-name {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--azul-marinho);
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}

.doc-icon {
    font-size: 16px;
    color: var(--bege);
}

.doc-date {
    color: #999;
    font-size: 12px;
}

.doc-author {
    font-size: 12px;
    color: #666;
}

.doc-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.btn-action {
    background: none;
    border: none;
    color: var(--azul-marinho);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    padding: 4px 8px;
}

.btn-action:hover {
    color: var(--bege);
    transform: scale(1.2);
}

/* Botão de ação destrutiva (delete) — fica vermelho no hover. */
.btn-action-danger:hover {
    color: #c0392b;
}

/* Container flex pra ícone + nome + badges ficarem na mesma linha,
   resolvendo o "ícone numa linha, nome em outra" do bug visual. As
   tags ficam num bloco separado abaixo (multi-line) via .doc-tags. */
.doc-cell-main {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Sobrescreve o flex que estava direto em .doc-name (que só envolvia
   o texto). Agora .doc-name é inline, o flex está no parent .doc-cell-main. */
.doc-cell-main .doc-name {
    display: inline;
    flex: 0 1 auto;
    min-width: 0;
}

/* Handle de redimensionamento das colunas. Drag manual em JS — ver
   GEDApp.attachColumnResizers(). Posicionado no canto direito da th. */
.resizable-table th {
    position: relative;
}
.col-resizer {
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    user-select: none;
    background: transparent;
    transition: background 0.15s;
}
.col-resizer:hover {
    background: rgba(201, 173, 161, 0.5);
}

/* Modal pequeno (confirm dialog, edit tags). */
.modal-sm {
    max-width: 460px;
}
.modal-body {
    padding: 6px 0 14px;
    color: var(--azul-marinho);
}
.btn-danger {
    background: #c0392b;
    color: #fff;
    border: 1px solid #a52f23;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-danger:hover {
    background: #a52f23;
}

/* VERSION HISTORY */
.version-timeline {
    margin-top: 20px;
    padding: 20px;
    background: var(--cinza-claro);
    border-radius: 8px;
    border-left: 3px solid var(--bege);
}

.version-item {
    padding: 12px;
    margin: 8px 0;
    background: var(--branco);
    border-radius: 6px;
    border-left: 3px solid var(--azul-marinho);
    transition: all 0.3s ease;
}

.version-item:hover {
    border-left-color: var(--bege);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.version-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.version-number {
    font-weight: 600;
    color: var(--azul-marinho);
    font-size: 13px;
}

.version-date {
    font-size: 11px;
    color: #999;
}

.version-author {
    font-size: 12px;
    color: #666;
    margin-bottom: 6px;
}

.version-note {
    font-size: 12px;
    color: #555;
    padding-top: 6px;
    border-top: 1px solid #f0f0f0;
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--branco);
    border-radius: 8px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

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

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

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--azul-marinho);
}

.btn-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-close:hover {
    color: var(--vermelho-erro);
}

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

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--azul-marinho);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #d0c8c0;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--bege);
    box-shadow: 0 0 0 3px rgba(201, 173, 161, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.btn-secondary {
    background: var(--cinza-claro);
    color: var(--azul-marinho);
    border: 1px solid #d0c8c0;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #e8e0d8;
}

/* LOGIN */
.login-container {
    display: flex;
    height: 100vh;
    background: linear-gradient(135deg, var(--azul-marinho) 0%, #1a2634 100%);
    align-items: center;
    justify-content: center;
}

.login-card {
    background: var(--branco);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 380px;
}

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

.login-logo-image {
    max-width: 200px;
    height: auto;
    margin-bottom: 20px;
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--azul-marinho);
    margin-bottom: 10px;
}

.login-subtitle {
    font-size: 13px;
    color: #999;
    margin-bottom: 30px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.login-form .form-group {
    margin-bottom: 0;
}

.btn-login {
    background: var(--azul-marinho);
    color: var(--branco);
    border: none;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-login:hover {
    background: #1a2634;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.3);
}

/* AUDIT */
.audit-report {
    background: var(--branco);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.audit-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.audit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.audit-table th {
    background: var(--cinza-claro);
    padding: 10px;
    text-align: left;
    font-weight: 600;
    color: var(--azul-marinho);
    border-bottom: 1px solid #d0c8c0;
}

.audit-table td {
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.audit-table tr:hover {
    background: #fafafa;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.status-upload {
    background: #e3f2fd;
    color: #1976d2;
}

.status-view {
    background: #f3e5f5;
    color: #7b1fa2;
}

.status-delete {
    background: #ffebee;
    color: #c62828;
}

.status-modify {
    background: #fff3e0;
    color: #f57c00;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 15px;
    color: var(--bege);
}

.empty-state-text {
    font-size: 14px;
    margin-bottom: 5px;
}

.empty-state-subtext {
    font-size: 12px;
    color: #ccc;
}

@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }

    .content-wrapper {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex-direction: row;
        height: auto;
        padding: 0;
    }

    .sidebar-header,
    .user-info,
    .sidebar-footer {
        display: none;
    }

    .nav-menu {
        display: flex;
        padding: 0;
        gap: 0;
        flex: 1;
    }

    .nav-menu li {
        flex: 1;
        border: none;
    }

    .nav-menu li a {
        justify-content: center;
        flex-direction: column;
        padding: 10px;
    }

    .search-box {
        width: 100%;
        max-width: 300px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================
   Sprint F — Integração com backend: alert, badge, tags,
   modal de versões, toast e seletor de cliente.
   ========================================================== */

.alert {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 12px;
}
.alert i {
    margin-right: 6px;
}
.alert-error {
    background: #fef0f0;
    color: #a52323;
    border: 1px solid #f3c0c0;
}
.alert-success {
    background: #f0f8f1;
    color: #2a7a3c;
    border: 1px solid #c3e1c8;
}

.loading-state {
    padding: 40px;
    text-align: center;
    color: var(--azul-marinho);
    opacity: 0.8;
    font-size: 14px;
}
.loading-state i {
    margin-right: 8px;
}

.badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    vertical-align: middle;
}
.badge-warn {
    background: #fff4e0;
    color: #a86b1d;
    border: 1px solid #f0d8a8;
}

.doc-tags {
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.tag {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(201, 173, 161, 0.18);
    color: var(--azul-marinho);
    border-radius: 999px;
    font-size: 11px;
}

.client-switcher {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid #d0c8c0;
    border-radius: 6px;
    font-size: 12px;
}
.client-switcher select {
    border: none;
    background: transparent;
    font-size: 13px;
    font-family: inherit;
    color: var(--azul-marinho);
    outline: none;
}

/* Sprint J — seletor de unidade. Mesma cara do client-switcher mas com
   ícone fa-industry e estilo levemente distinto pra não confundir. */
.unit-switcher {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(201, 173, 161, 0.15);
    border: 1px solid #d0c8c0;
    border-radius: 6px;
    font-size: 12px;
    margin-left: 6px;
}
.unit-switcher select {
    border: none;
    background: transparent;
    font-size: 13px;
    font-family: inherit;
    color: var(--azul-marinho);
    outline: none;
    cursor: pointer;
}
.unit-switcher-empty {
    opacity: 0.6;
}

.btn-action[disabled],
.btn-action[disabled]:hover {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ----- Modal ----- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal {
    background: #fff;
    border-radius: 10px;
    width: min(560px, 92vw);
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 18px 20px;
    border-bottom: 1px solid #ebe5df;
}
.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--azul-marinho);
}
.modal-subtitle {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 2px;
}
.btn-close {
    background: transparent;
    border: none;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    color: var(--azul-marinho);
}
.modal-body {
    padding: 16px 20px 22px;
    overflow-y: auto;
}
.version-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.version-list-item {
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid #f1ece6;
}
.version-list-item:last-child {
    border-bottom: none;
}
.version-list-item .version-number {
    font-weight: 700;
    color: var(--bege);
    font-size: 16px;
}
.version-meta {
    font-size: 13px;
}
.version-meta .version-author {
    opacity: 0.75;
    font-size: 12px;
}
.version-meta .version-notes {
    margin-top: 4px;
    padding: 6px 8px;
    background: #faf7f3;
    border-radius: 4px;
    font-size: 12px;
}

/* ----- Toasts ----- */
.toast-host {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    max-width: 360px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    animation: toast-in 0.2s ease-out;
    pointer-events: auto;
}
.toast-leaving {
    opacity: 0;
    transition: opacity 0.25s ease-out;
}
.toast-error {
    background: #a52323;
    color: #fff;
}
.toast-success {
    background: #2a7a3c;
    color: #fff;
}
.toast-info {
    background: #34495e;
    color: #fff;
}

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

/* ==========================================================
   Sprint G — Subpastas, breadcrumb, logo na sidebar/login.
   ========================================================== */

.login-client-logo {
    margin: 12px 0 18px;
    text-align: center;
}
.login-client-logo img {
    max-height: 60px;
    max-width: 100%;
    object-fit: contain;
}

.sidebar-header-split {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.sidebar-brand {
    flex: 1;
    min-width: 0;
}
.sidebar-client-logo {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
.sidebar-client-logo img {
    max-height: 40px;
    max-width: 100px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 3px;
}
.sidebar-logo-edit {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--bege);
    color: var(--azul-marinho);
    border: none;
    cursor: pointer;
    font-size: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.sidebar-client-logo:hover .sidebar-logo-edit {
    opacity: 1;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 30px;
    font-size: 13px;
    color: var(--azul-marinho);
    background: rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid #ebe5df;
    flex-wrap: wrap;
}
.breadcrumb-link {
    color: var(--azul-marinho);
    text-decoration: none;
    opacity: 0.75;
    cursor: pointer;
}
.breadcrumb-link:hover {
    opacity: 1;
    text-decoration: underline;
}
.breadcrumb-current {
    font-weight: 600;
    color: var(--bege);
}
.breadcrumb-sep {
    opacity: 0.4;
    margin: 0 2px;
}

.btn-secondary {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.7);
    color: var(--azul-marinho);
    border: 1px solid #d0c8c0;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}
.btn-secondary:hover {
    background: #fff;
    border-color: var(--bege);
}

.row-folder {
    cursor: pointer;
    transition: background 0.15s ease;
}
.row-folder:hover {
    background: rgba(201, 173, 161, 0.08);
}

.doc-name-link {
    color: var(--azul-marinho);
    text-decoration: none;
    border-bottom: 1px dotted transparent;
    transition: border-color 0.15s ease;
}
.doc-name-link:hover {
    border-bottom-color: var(--bege);
}

/* ==========================================================
   Sprint H — Gestão de Usuários e Clientes.
   ========================================================== */

.role-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.role-super_admin {
    background: #f6efe0;
    color: #8a6d1a;
}
.role-admin {
    background: #e6f0fb;
    color: #1e5fa8;
}
.role-user {
    background: #eef2f7;
    color: #34495e;
}

.badge-ok {
    background: #e8f4ea;
    color: #2a7a3c;
    border: 1px solid #c3e1c8;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: inline-block;
}
.badge-off {
    background: #f1ece6;
    color: #8c7d70;
    border: 1px solid #d8cfc4;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: inline-block;
}

code.slug,
code.password-display {
    background: rgba(201, 173, 161, 0.18);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Menlo', 'Consolas', monospace;
    font-size: 12px;
    color: var(--azul-marinho);
}
code.password-display {
    display: inline-block;
    margin-top: 6px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    user-select: all;
}

.form-hint {
    margin-top: 4px;
    font-size: 11px;
    opacity: 0.7;
    color: var(--azul-marinho);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #ebe5df;
}

.user-form .form-group input[disabled],
.client-form .form-group input[disabled],
.user-form .form-group select[disabled] {
    background: #f5f0eb;
    cursor: not-allowed;
    opacity: 0.7;
}

.user-form .form-group input[type='checkbox'],
.client-form .form-group input[type='checkbox'] {
    width: auto;
    margin-right: 6px;
    vertical-align: middle;
}

.muted {
    opacity: 0.5;
    font-size: 12px;
}

/* ==========================================================
   Sprint G — Página de Auditoria.
   ========================================================== */

.audit-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    padding: 16px;
    background: rgba(201, 173, 161, 0.08);
    border-radius: 8px;
    margin-bottom: 18px;
}
.audit-filter {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 130px;
}
.audit-filter label {
    font-size: 11px;
    font-weight: 600;
    color: var(--azul-marinho);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.audit-filter input,
.audit-filter select {
    padding: 8px 10px;
    border: 1px solid #d0c8c0;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
}
.audit-filter input:focus,
.audit-filter select:focus {
    outline: none;
    border-color: var(--bege);
    box-shadow: 0 0 0 3px rgba(201, 173, 161, 0.15);
}
.audit-filter-actions {
    flex-direction: row;
    gap: 6px;
    align-items: stretch;
    flex-wrap: wrap;
}
.audit-scope-hint {
    width: 100%;
    font-size: 11px;
    color: var(--azul-marinho);
    opacity: 0.7;
    padding-top: 4px;
}
.audit-scope-hint i {
    margin-right: 4px;
    color: var(--bege);
}

.audit-table td {
    vertical-align: top;
}
.audit-action {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: #f1ece6;
    color: var(--azul-marinho);
}
.audit-action-login {
    background: #e8f4ea;
    color: #2a7a3c;
}
.audit-action-login_failed {
    background: #fef0f0;
    color: #a52323;
}
.audit-action-logout {
    background: #f1ece6;
    color: #5a4e44;
}
.audit-action-view {
    background: #eef2f7;
    color: #34495e;
}
.audit-action-upload {
    background: #e6f0fb;
    color: #1e5fa8;
}
.audit-action-download {
    background: #f6efe0;
    color: #8a6d1a;
}
.audit-action-modify {
    background: #fff4e0;
    color: #a86b1d;
}
.audit-action-delete {
    background: #fef0f0;
    color: #a52323;
}
.audit-action-restore {
    background: #e8f4ea;
    color: #2a7a3c;
}

.audit-details {
    font-size: 12px;
    color: var(--azul-marinho);
    opacity: 0.8;
    font-family: 'Menlo', 'Consolas', monospace;
    word-break: break-word;
}

.audit-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 4px;
    border-top: 1px solid #ebe5df;
    margin-top: 4px;
}
.audit-pagination-info {
    font-size: 12px;
    color: var(--azul-marinho);
    opacity: 0.7;
}
.audit-pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}
.audit-page-indicator {
    font-size: 12px;
    color: var(--azul-marinho);
    min-width: 80px;
    text-align: center;
}
