/* ============================================
   1. DESIGN TOKENS
   ============================================ */
:root {
    --primary: #3A4D5E;
    --primary-hover: #2E3E4C;
    --primary-light: rgba(58, 77, 94, 0.08);
    --secondary: #C3C2C0;
    --secondary-hover: #A8A7A5;
    --bg: #F0EFED;
    --bg-light: #F5F5F3;
    --surface: #FFFFFF;
    --border: #D4D3D1;
    --text: #3A4D5E;
    --text-muted: #7A8A94;
    --text-light: #FFFFFF;
    --danger: #E55B5B;
    --danger-hover: #D04A4A;
    --success: #4CAF50;
    --success-bg: #E8F5E9;
    --error-bg: #FDECEA;
    --info: #2196F3;
    --info-bg: #E3F2FD;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --max-width: 1200px;
    --nav-height: 70px;
    --transition: 0.2s ease;
    --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ============================================
   2. RESET & BASE
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img,
svg {
    max-width: 100%;
    height: auto;
    display: block;
}

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

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

ul,
ol {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    color: var(--text);
    font-weight: 600;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.35rem; }

/* ============================================
   3. LAYOUT
   ============================================ */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 60px 0;
}

.section--alt {
    background-color: var(--surface);
}

.main-content {
    flex: 1;
}

/* ============================================
   4. CARDS & GRIDS
   ============================================ */
.grid {
    display: grid;
    gap: 24px;
}

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

@media (min-width: 768px) {
    .grid--2 { grid-template-columns: repeat(2, 1fr); }
    .grid--3 { grid-template-columns: repeat(2, 1fr); }
    .grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .grid--3 { grid-template-columns: repeat(3, 1fr); }
    .grid--4 { grid-template-columns: repeat(4, 1fr); }
}

.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
    transition: box-shadow var(--transition), transform var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card__icon {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--primary);
}

.card__icon svg {
    width: 24px;
    height: 24px;
}

.card h3 {
    margin-bottom: 12px;
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ============================================
   5. BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
}

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

.btn--primary:hover {
    background: var(--primary-hover);
    color: var(--text-light);
}

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

.btn--secondary:hover {
    background: var(--primary);
    color: var(--text-light);
}

.btn--danger {
    background: var(--danger);
    color: var(--text-light);
}

.btn--danger:hover {
    background: var(--danger-hover);
    color: var(--text-light);
}

.btn--sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn--block {
    width: 100%;
}

/* ============================================
   6. FORMS
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.95rem;
    font-family: var(--font);
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(58, 77, 94, 0.15);
}

.form-control::placeholder {
    color: var(--text-muted);
}

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

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237A8A94' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* ============================================
   7. ALERTS / FLASH MESSAGES
   ============================================ */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert--success {
    background: var(--success-bg);
    color: #2E7D32;
    border-left: 4px solid var(--success);
}

.alert--error {
    background: var(--error-bg);
    color: #C62828;
    border-left: 4px solid var(--danger);
}

.alert--info {
    background: var(--info-bg);
    color: #1565C0;
    border-left: 4px solid var(--info);
}

/* ============================================
   8. LOGIN PAGE
   ============================================ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px;
}

.login-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}

.login-card__logo {
    display: block;
    height: 44px;
    margin: 0 auto 24px;
}

.login-card h2 {
    text-align: center;
    margin-bottom: 28px;
}

/* ============================================
   9. ADMIN SIDEBAR LAYOUT
   ============================================ */
:root {
    --sidebar-width: 260px;
    --sidebar-collapsed: 68px;
    --sidebar-bg: #2B3A47;
    --sidebar-hover: rgba(255, 255, 255, 0.08);
    --sidebar-active: rgba(255, 255, 255, 0.12);
    --sidebar-text: rgba(255, 255, 255, 0.7);
    --sidebar-text-active: #FFFFFF;
    --topbar-height: 56px;
}

.admin-body {
    flex-direction: row;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1100;
    transition: width 0.25s ease;
    overflow: hidden;
}

.sidebar__header {
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

/* Pin button */
.sidebar__pin {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.3);
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.sidebar__pin svg {
    width: 16px;
    height: 16px;
}

.sidebar__pin:hover {
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.08);
}

.sidebar--pinned .sidebar__pin {
    color: var(--sidebar-text-active);
    transform: rotate(45deg);
}

.sidebar__logo {
    display: flex;
    align-items: center;
    overflow: hidden;
}

.sidebar__logo-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: none;
}

.sidebar__logo-full {
    height: 28px;
    width: auto;
}

.sidebar__nav {
    flex: 1;
    padding: 12px 8px;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s ease;
    white-space: nowrap;
    position: relative;
}

.sidebar__link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar__link:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

.sidebar__link--active {
    background: var(--sidebar-active);
    color: var(--sidebar-text-active);
}

.sidebar__link--active::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 6px;
    bottom: 6px;
    width: 3px;
    background: var(--text-light);
    border-radius: 0 3px 3px 0;
}

.sidebar__link--subtle {
    font-size: 0.85rem;
    padding: 8px 12px;
}

.sidebar__divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 8px 12px;
}

.sidebar__section-label {
    padding: 8px 12px 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.35);
    white-space: nowrap;
    overflow: hidden;
}

.sidebar__footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 8px;
}

.sidebar__user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    margin-bottom: 4px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    border-radius: 8px;
    transition: background-color 0.15s;
}

.sidebar__user:hover {
    background: rgba(255, 255, 255, 0.08);
}

.sidebar__avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    flex-shrink: 0;
}

.sidebar__user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.sidebar__user-name {
    color: var(--sidebar-text-active);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar__user-role {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar__actions {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Collapsed state */
.sidebar--collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar--collapsed .sidebar__logo-icon {
    display: block;
}

.sidebar--collapsed .sidebar__logo-full {
    display: none;
}

.sidebar--collapsed .sidebar__pin {
    display: none;
}

.sidebar--collapsed .sidebar__link span,
.sidebar--collapsed .sidebar__section-label span,
.sidebar--collapsed .sidebar__user-info {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar--collapsed .sidebar__link {
    justify-content: center;
    padding: 10px;
}

.sidebar--collapsed .sidebar__user {
    justify-content: center;
}

.sidebar--collapsed .sidebar__header {
    justify-content: center;
    padding: 20px 8px;
}

.sidebar--collapsed .sidebar__link--active::before {
    left: -8px;
}

/* Hover expand: collapsed sidebar expands on hover */
@media (min-width: 768px) {
    .sidebar--collapsed:hover {
        width: var(--sidebar-width);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
    }

    .sidebar--collapsed:hover .sidebar__logo-icon {
        display: none;
    }

    .sidebar--collapsed:hover .sidebar__logo-full {
        display: block;
    }

    .sidebar--collapsed:hover .sidebar__pin {
        display: flex;
    }

    .sidebar--collapsed:hover .sidebar__link span,
    .sidebar--collapsed:hover .sidebar__section-label span,
    .sidebar--collapsed:hover .sidebar__user-info {
        opacity: 1;
        width: auto;
    }

    .sidebar--collapsed:hover .sidebar__link {
        justify-content: flex-start;
        padding: 10px 12px;
    }

    .sidebar--collapsed:hover .sidebar__user {
        justify-content: flex-start;
    }

    .sidebar--collapsed:hover .sidebar__header {
        justify-content: space-between;
        padding: 20px 16px;
    }
}

/* Pin visible when sidebar is expanded (not collapsed) */
.sidebar:not(.sidebar--collapsed) .sidebar__pin {
    display: flex;
}

/* When pinned, keep pin visible */
.sidebar--pinned .sidebar__pin {
    display: flex;
}

/* Main area */
.admin-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.25s ease;
}

.sidebar--collapsed ~ .admin-main {
    margin-left: var(--sidebar-collapsed);
}

/* Top bar */
.admin-topbar {
    display: flex;
    align-items: center;
    height: var(--topbar-height);
    padding: 0 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1050;
    gap: 12px;
}

.admin-topbar__toggle {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    color: var(--text);
    transition: background var(--transition);
}

.admin-topbar__toggle:hover {
    background: var(--primary-light);
}

.admin-topbar__toggle svg {
    width: 22px;
    height: 22px;
}

.admin-topbar__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    flex: 1;
}

.admin-topbar__collapse {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: all var(--transition);
}

.admin-topbar__collapse:hover {
    background: var(--primary-light);
    color: var(--text);
}

.admin-topbar__collapse svg {
    width: 18px;
    height: 18px;
    transition: transform 0.25s ease;
}

.sidebar--collapsed ~ .admin-main .admin-topbar__collapse svg {
    transform: rotate(180deg);
}

/* Flash inside admin */
.admin-flash {
    padding: 20px 24px 0;
}

/* Admin content */
.admin-content {
    flex: 1;
    padding: 24px;
}

.admin-content__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

/* Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1099;
}

.sidebar-overlay--visible {
    display: block;
}

/* Mobile */
@media (max-width: 767px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        width: var(--sidebar-width);
    }

    .sidebar--open {
        transform: translateX(0);
    }

    .sidebar--collapsed {
        width: var(--sidebar-width);
    }

    .admin-main {
        margin-left: 0;
    }

    .sidebar--collapsed ~ .admin-main {
        margin-left: 0;
    }

    .admin-topbar__toggle {
        display: flex;
    }

    .admin-topbar__collapse {
        display: none;
    }

    .admin-content {
        padding: 16px;
    }

    .admin-flash {
        padding: 16px 16px 0;
    }
}

/* ============================================
   10. ADMIN TABLE
   ============================================ */
.table-wrapper {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 14px 20px;
    text-align: left;
    font-size: 0.9rem;
}

.table th {
    background: var(--primary-light);
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.table td {
    border-bottom: 1px solid var(--border);
}

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

.table tr:hover td {
    background: rgba(58, 77, 94, 0.03);
}

.table__actions {
    display: flex;
    gap: 8px;
    white-space: nowrap;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge--admin {
    background: var(--primary-light);
    color: var(--primary);
}

.badge--equipe {
    background: var(--info-bg);
    color: #1565C0;
}

.badge--cliente {
    background: #F0EFED;
    color: var(--text-muted);
}

.badge--active {
    background: var(--success-bg);
    color: #2E7D32;
}

.badge--inactive {
    background: var(--error-bg);
    color: #C62828;
}

/* ============================================
   11. TOOL CARDS (Dashboard)
   ============================================ */
.tool-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
    display: flex;
    flex-direction: column;
    transition: box-shadow var(--transition), transform var(--transition);
}

.tool-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.tool-card__icon {
    width: 56px;
    height: 56px;
    background: var(--primary-light);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--primary);
}

.tool-card__icon svg {
    width: 28px;
    height: 28px;
}

.tool-card h3 {
    margin-bottom: 8px;
}

.tool-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
    flex: 1;
}

/* ============================================
   12. CHECKBOX FIELD
   ============================================ */
.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.form-check label {
    margin-bottom: 0;
    font-weight: 400;
}

/* ============================================
   13. DROPZONE & FILE LIST
   ============================================ */
.dropzone {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.dropzone:hover,
.dropzone--active {
    border-color: var(--primary);
    background-color: rgba(58, 77, 94, 0.04);
}

.dropzone__input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.dropzone__icon {
    width: 40px;
    height: 40px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.dropzone__content p {
    margin: 4px 0;
    color: var(--text-muted);
}

.file-list {
    margin-top: 12px;
}

.file-list__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-light);
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.file-list__name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 12px;
}

.file-list__size {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-right: 12px;
    white-space: nowrap;
}

.file-list__remove {
    background: none;
    border: none;
    color: var(--danger, #dc3545);
    cursor: pointer;
    padding: 2px 6px;
    font-size: 1.1rem;
    line-height: 1;
}

/* ============================================
   14. DOCUMENT VIEWER
   ============================================ */
.doc-viewer-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
    margin-top: 24px;
}

@media (max-width: 900px) {
    .doc-viewer-layout {
        grid-template-columns: 1fr;
    }
}

.doc-viewer {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    min-height: 500px;
}

.doc-viewer__iframe {
    width: 100%;
    height: 80vh;
    min-height: 500px;
    border: none;
}

.doc-viewer__image-wrap {
    padding: 24px;
    text-align: center;
    overflow: auto;
}

.doc-viewer__image {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.doc-viewer__tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    background: var(--bg-light);
}

.doc-viewer__tab {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s;
}

.doc-viewer__tab:hover {
    color: var(--text);
}

.doc-viewer__tab--active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 500;
}

.doc-viewer__sheet {
    overflow: auto;
    max-height: 75vh;
    padding: 0;
}

.doc-viewer__sheet table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.doc-viewer__sheet th,
.doc-viewer__sheet td {
    border: 1px solid var(--border);
    padding: 6px 10px;
    text-align: left;
    white-space: nowrap;
}

.doc-viewer__sheet th {
    background: var(--bg-light);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
}

.doc-viewer__sheet tr:hover td {
    background-color: rgba(58, 77, 94, 0.03);
}

/* ============================================
   15. DOCUMENT METADATA SIDEBAR
   ============================================ */
.doc-meta {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    height: fit-content;
}

.doc-meta__title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.doc-meta__list {
    font-size: 0.85rem;
}

.doc-meta__list dt {
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 12px;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.doc-meta__list dt:first-child {
    margin-top: 0;
}

.doc-meta__list dd {
    margin: 2px 0 0 0;
    word-break: break-word;
}

/* ============================================
   16. BADGES
   ============================================ */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.6;
}

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

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

.badge--neutral {
    background: var(--bg-light);
    color: var(--text-muted);
}

.badge-toggle {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.6;
    border: none;
    cursor: pointer;
    transition: filter 0.15s, transform 0.1s;
}

.badge-toggle:hover {
    filter: brightness(0.9);
    transform: scale(1.05);
}

/* ============================================
   17. PROPERTIES LAYOUT
   ============================================ */
.props-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
    margin-top: 24px;
}

@media (max-width: 900px) {
    .props-layout {
        grid-template-columns: 1fr;
    }
}

.props-main {
    min-width: 0;
}

/* ============================================
   18. COMPANY CARDS
   ============================================ */
.company-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.company-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.company-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(58, 77, 94, 0.1);
    transform: translateY(-2px);
}

.company-card__logo {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.company-card__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.company-card__initials {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
}

.company-card__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.company-card__name {
    font-size: 0.95rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

/* ============================================
   19. STORAGE BAR
   ============================================ */
.storage-bar {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 20px;
    margin-bottom: 20px;
}

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

.storage-bar__label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
}

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

.storage-bar__track {
    height: 10px;
    background: var(--bg-light);
    border-radius: 5px;
    overflow: hidden;
}

.storage-bar__fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.4s ease;
    min-width: 2px;
}

.storage-bar__fill--normal {
    background: var(--primary);
}

.storage-bar__fill--warning {
    background: #e6a817;
}

.storage-bar__fill--danger {
    background: var(--danger);
}

.storage-bar__percent {
    display: block;
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================================
   20. DASHBOARD
   ============================================ */
.dashboard-welcome {
    margin-bottom: 24px;
}

.dashboard-welcome h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
}

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

.stat-card__icon {
    width: 44px;
    height: 44px;
    background: var(--primary-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card__icon svg {
    width: 22px;
    height: 22px;
    color: var(--primary);
}

.stat-card__data {
    display: flex;
    flex-direction: column;
}

.stat-card__value {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
}

.stat-card__label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 8px;
}

@media (max-width: 800px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Recent documents list */
.recent-list {
    display: flex;
    flex-direction: column;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    transition: background-color 0.15s;
}

.recent-item:hover {
    background: var(--bg-light);
}

.recent-item__icon {
    width: 36px;
    height: 36px;
    background: var(--primary-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.recent-item__icon svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.recent-item__info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.recent-item__title {
    font-size: 0.88rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-item__meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Activity timeline */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
}

.activity-item__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

.activity-item__dot--view {
    background: var(--primary);
}

.activity-item__dot--download {
    background: var(--success);
}

.activity-item__content {
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
    line-height: 1.4;
    min-width: 0;
}

.activity-item__content em {
    font-style: normal;
    color: var(--primary);
}

.activity-item__time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ============================================
   21. PROFILE
   ============================================ */
.profile-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    flex-shrink: 0;
}

.profile-info {
    font-size: 0.88rem;
}

.profile-info dt {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 12px;
}

.profile-info dt:first-child {
    margin-top: 0;
}

.profile-info dd {
    margin: 2px 0 0 0;
}

/* ============================================
   22. UTILITIES
   ============================================ */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
