*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--area-font-family);
    background: var(--area-color-bg);
    color: var(--area-color-text);
    margin: 0;
    min-height: 100vh;
}

.area-shell {
    display: flex;
    min-height: 100vh;
}

.area-sidebar {
    width: 264px;
    min-width: 264px;
    background: var(--area-color-sidebar);
    border-right: 1px solid var(--area-color-border);
    display: flex;
    flex-direction: column;
    padding: 1.25rem 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
}

.area-sidebar-brand {
    padding: 0.5rem 1.5rem 1.25rem;
    border-bottom: 1px solid var(--area-color-border);
    margin-bottom: 0.75rem;
}

.area-brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--area-color-forest);
    letter-spacing: -0.02em;
}

.area-nav {
    flex: 1;
    padding: 0 0.75rem;
}

.area-menu-item {
    display: block;
    padding: 0.625rem 0.75rem;
    border-radius: var(--area-radius-sm);
    color: var(--area-color-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    margin-bottom: 0.125rem;
}

.area-menu-item:hover {
    background: var(--area-color-surface-soft);
    color: var(--area-color-text);
}

.area-menu-item-active {
    background: var(--area-color-forest-soft) !important;
    color: var(--area-color-forest) !important;
    font-weight: 600;
    border-left: 3px solid var(--area-color-forest);
}

.area-sidebar-footer {
    padding: 0.75rem 1.5rem;
    border-top: 1px solid var(--area-color-border);
}

.area-main {
    flex: 1;
    margin-left: 264px;
    padding: 0;
}

.area-content {
    padding: 2rem 2.5rem;
    max-width: 1200px;
}

.area-page-header {
    margin-bottom: 2rem;
}

.area-page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--area-color-text);
    margin: 0 0 0.25rem;
}

.area-page-subtitle {
    font-size: 0.95rem;
    color: var(--area-color-muted);
    margin: 0.25rem 0 0;
}

.area-page-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
}

.area-panel {
    background: var(--area-color-surface);
    border: 1px solid var(--area-color-border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 2px rgba(27, 31, 29, 0.04);
}

.area-panel-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--area-color-text);
    margin: 0 0 0.75rem;
}

.area-text-muted { color: var(--area-color-muted); }

.area-button-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    background: var(--area-color-action);
    border: 1px solid var(--area-color-action);
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}

.area-button-primary:hover {
    background: var(--area-color-action-hover);
    color: #fff;
    text-decoration: none;
}

.area-button-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--area-color-text);
    background: var(--area-color-surface);
    border: 1px solid var(--area-color-border);
    border-radius: var(--area-radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}

.area-button-secondary:hover {
    background: var(--area-color-surface-soft);
}

.area-button-danger {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--area-color-danger);
    background: transparent;
    border: 1px solid var(--area-color-danger);
    border-radius: var(--area-radius-sm);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.area-button-danger:hover {
    background: var(--area-color-danger);
    color: #fff;
}

.area-button-sm { padding: 0.25rem 0.625rem; font-size: 0.8rem; }

.area-summary-grid {
    display: grid;
    gap: 1.25rem;
}

.area-next-steps {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--area-color-surface-soft);
    border-radius: var(--area-radius-sm);
}

.area-next-steps h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
}

.area-next-steps ol {
    margin: 0;
    padding-left: 1.25rem;
}

.area-next-steps li {
    padding: 0.25rem 0;
    color: var(--area-color-muted);
}

.area-table-wrapper {
    overflow-x: auto;
}

.area-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.area-table th {
    text-align: left;
    padding: 0.625rem 0.75rem;
    font-weight: 600;
    color: var(--area-color-muted);
    border-bottom: 1px solid var(--area-color-border);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.area-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--area-color-border);
}

.area-table tbody tr:hover {
    background: var(--area-color-surface-soft);
}

.ac-badge {
    display: inline-block;
    padding: 0.2rem 0.625rem;
    font-size: 0.775rem;
    font-weight: 500;
    border-radius: 999px;
    background: var(--area-color-surface-soft);
    color: var(--area-color-muted);
}

.ac-badge-success {
    background: #E7F0EC;
    color: var(--area-color-success);
}

.ac-badge-warning {
    background: #FFF8E1;
    color: var(--area-color-warning);
}

.ac-badge-danger {
    background: #FDECEC;
    color: var(--area-color-danger);
}

.ac-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.25rem;
    font-size: 0.875rem;
    color: var(--area-color-muted);
}

.ac-empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.ac-empty-state-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--area-color-text);
    margin: 0 0 0.5rem;
}

.ac-empty-state-description {
    color: var(--area-color-muted);
    margin: 0;
}

.ac-flash-container {
    margin-bottom: 1rem;
}

.ac-flash {
    padding: 0.75rem 1rem;
    border-radius: var(--area-radius-sm);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.ac-flash-error {
    background: #FDECEC;
    color: var(--area-color-danger);
    border: 1px solid #F5C6CB;
}

.ac-flash-success {
    background: #E7F0EC;
    color: var(--area-color-success);
    border: 1px solid #C3E6CB;
}

.ac-flash-info {
    background: #E3EDF2;
    color: var(--area-color-info);
    border: 1px solid #BEE5EB;
}

.ac-flash-warning {
    background: #FFF8E1;
    color: var(--area-color-warning);
    border: 1px solid #FFEAA7;
}

.ac-auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--area-color-bg);
}

.ac-auth-card {
    background: var(--area-color-surface);
    border: 1px solid var(--area-color-border);
    border-radius: var(--area-radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.ac-auth-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--area-color-forest);
    text-align: center;
    margin: 0 0 0.5rem;
}

.ac-auth-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--area-color-text);
    text-align: center;
    margin: 0 0 1.5rem;
}

.ac-form { }

.ac-field {
    margin-bottom: 1rem;
}

.ac-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--area-color-text);
    margin-bottom: 0.375rem;
}

.ac-input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    font-size: 0.9rem;
    font-family: var(--area-font-family);
    border: 1px solid var(--area-color-border);
    border-radius: var(--area-radius-sm);
    background: var(--area-color-surface);
    color: var(--area-color-text);
    transition: border-color 0.15s;
}

.ac-input:focus {
    outline: none;
    border-color: var(--area-color-forest);
    box-shadow: 0 0 0 2px var(--area-color-forest-soft);
}

.ac-full-width { width: 100%; justify-content: center; }

.ac-text-muted { color: var(--area-color-muted); font-size: 0.85rem; }

/* List title (primeira coluna, sem aparencia de hyperlink) */
.ac-list-title {
    display: inline-flex; align-items: center; max-width: 100%;
    font-weight: 500; color: var(--area-color-text); line-height: 1.2;
    text-decoration: none;
}
.ac-list-title-link { color: var(--area-color-text); text-decoration: none; }
.ac-list-title-link:hover,
.ac-list-title-link:focus { color: var(--area-color-forest); text-decoration: none; }
.ac-list-subtitle {
    margin-top: 0.0625rem; font-size: 0.8125rem; line-height: 1.2;
    color: var(--area-color-muted);
}

/* Row actions (coluna fixa 40px, posicao relativa) */
.ac-row-actions {
    position: relative; width: 40px; min-width: 40px; max-width: 40px;
    text-align: right; white-space: nowrap; padding: 0 !important;
}

/* Action trigger (icon 3 dots 32x32, circular, sem fundo) */
.ac-action-trigger {
    width: 32px; height: 32px; min-width: 32px; min-height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0; border: 0; border-radius: 999px;
    background: transparent; color: var(--area-color-muted);
    cursor: pointer; vertical-align: middle;
    transition: background 0.15s, color 0.15s;
}
.ac-action-trigger:hover,
.ac-action-trigger:focus { background: var(--area-color-surface-soft); color: var(--area-color-text); outline: none; }
.ac-action-dots {
    display: inline-flex; align-items: center; justify-content: center; gap: 3px;
}
.ac-action-dots span {
    width: 4px; height: 4px; display: block; border-radius: 999px; background: currentColor;
}

/* Action menu (flutuante, refinado) */
.ac-action-menu {
    min-width: 180px; padding: 0.375rem;
    border: 1px solid var(--area-color-border); border-radius: 12px;
    background: var(--area-color-surface);
    box-shadow: 0 14px 34px rgba(27, 31, 29, 0.12);
}
.ac-action-menu-item {
    width: 100%; min-height: 34px; display: flex; align-items: center;
    padding: 0.45rem 0.625rem; border: 0; border-radius: 8px;
    background: transparent; color: var(--area-color-text);
    font-size: 0.875rem; line-height: 1.2; text-align: left;
    text-decoration: none; cursor: pointer;
    font-family: var(--area-font-family);
}
.ac-action-menu-item:hover,
.ac-action-menu-item:focus { background: var(--area-color-surface-soft); color: var(--area-color-text); text-decoration: none; outline: none; }
.ac-action-menu-item-danger { color: var(--area-color-danger); }
.ac-action-menu-item-danger:hover,
.ac-action-menu-item-danger:focus { background: rgba(179, 38, 30, 0.08); color: var(--area-color-danger); }

/* Confirm modal */
.ac-confirm-overlay {
    position: fixed; inset: 0; z-index: 900;
    background: rgba(27,31,29,0.35);
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
}
.ac-confirm-modal {
    background: var(--area-color-surface); border-radius: var(--area-radius-lg);
    padding: 1.75rem; max-width: 440px; width: 100%;
    box-shadow: 0 8px 32px rgba(27,31,29,0.18);
}
.ac-confirm-title { font-size: 1.05rem; font-weight: 600; margin: 0 0 0.5rem; color: var(--area-color-text); }
.ac-confirm-body { font-size: 0.9rem; color: var(--area-color-muted); margin: 0 0 0.5rem; }
.ac-confirm-detail { font-size: 0.82rem; margin: 0 0 1rem; }
.ac-confirm-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.25rem; }

/* Transition helpers */
.ac-dropdown-enter { transition: opacity 0.1s ease, transform 0.1s ease; }
.ac-dropdown-enter-start { opacity: 0; transform: translateY(-4px); }
.ac-dropdown-enter-end { opacity: 1; transform: translateY(0); }
.ac-dropdown-leave { transition: opacity 0.08s ease; }
.ac-dropdown-leave-start { opacity: 1; }
.ac-dropdown-leave-end { opacity: 0; }

@media (max-width: 768px) {
    .ac-action-dropdown { right: auto; left: 0; }
    .area-sidebar { width: 220px; min-width: 220px; }
    .area-main { margin-left: 220px; }
    .area-content { padding: 1.25rem; }
}

/* Utility classes para substituir estilos inline comuns */
.ac-fw-600 { font-weight: 600; }
.ac-mb-1 { margin-bottom: 1rem; }
.ac-mt-1 { margin-top: 1rem; }
.ac-mt-1_5 { margin-top: 1.5rem; }
.ac-mb-1_25 { margin-bottom: 1.25rem; }
.ac-text-center { text-align: center; }
.ac-flex-row { display: flex; gap: 0.75rem; }
.ac-max-w-500 { max-width: 500px; }
.ac-max-w-600 { max-width: 600px; }
.ac-cursor-pointer { cursor: pointer; }
.ac-font-sm { font-size: 0.8rem; }

.area-subnav { display: flex; gap: 0.25rem; margin-bottom: 1.5rem; flex-wrap: wrap; border-bottom: 1px solid var(--area-color-border); padding-bottom: 0.5rem; }

.area-tab {
    display: inline-block;
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--area-color-muted);
    text-decoration: none;
    border-radius: var(--area-radius-sm);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.area-tab:hover { background: var(--area-color-surface-soft); color: var(--area-color-text); }

.area-tab-active {
    background: var(--area-color-forest-soft) !important;
    color: var(--area-color-forest) !important;
    font-weight: 600;
}

/* Detail pages (secoes verticais editoriais — DOC 20) */
.ac-detail-page { display: grid; gap: 0; }
.ac-detail-header { padding-bottom: 1rem; border-bottom: 1px solid var(--area-color-border); }
.ac-detail-kicker { margin-bottom: 0.25rem; color: var(--area-color-muted); font-size: 0.8125rem; font-weight: 500; }
.ac-detail-title { margin: 0; color: var(--area-color-text); font-size: clamp(1.35rem, 2.2vw, 1.9rem); font-weight: 600; line-height: 1.15; }
.ac-detail-summary { max-width: 68ch; margin: 0.375rem 0 0; color: var(--area-color-muted); font-size: 0.9375rem; line-height: 1.45; }
.ac-detail-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.875rem; }
.ac-detail-section { padding: 1rem 0 1.25rem; border-bottom: 1px solid var(--area-color-border); }
.ac-detail-section:last-child { border-bottom: 0; }
.ac-detail-section-header { margin-bottom: 0.75rem; }
.ac-detail-section-header h2 { margin: 0; color: var(--area-color-text); font-size: 1rem; font-weight: 600; line-height: 1.25; }
.ac-detail-section-header p { margin: 0.25rem 0 0; color: var(--area-color-muted); font-size: 0.875rem; line-height: 1.35; }
.ac-detail-section-body { min-width: 0; }
