* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-primary-start: #02577a;
    --color-primary-end: #89d6fb;
    --color-dark-1: #012c39;
    --color-dark-2: #001b27;
    --color-white: #ffffff;
    --color-light: #f5f5f5;
    --color-success: #28a745;
    --color-error: #dc3545;
    --color-warning: #ffc107;
    --app-topbar-height: 48px;
    --sidebar-width: min(300px, 88vw);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--page-bg);
    min-height: 100vh;
    color: var(--page-text);
}

body.app-body.sidebar-open {
    overflow: hidden;
}

/* Largura total do conteúdo (não centralizado em coluna estreita) */
.page-container,
.container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 1.25rem 1.5rem;
    box-sizing: border-box;
}

@media (min-width: 1400px) {
    .page-container,
    .container {
        padding-left: 1.75rem;
        padding-right: 1.75rem;
    }
}

/* Barra superior */
.app-topbar {
    position: sticky;
    top: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--app-topbar-height);
    padding: 0.25rem 0.65rem;
    background: var(--topbar-bg);
    color: var(--topbar-text);
    box-shadow: 0 1px 0 var(--border), 0 2px 12px rgba(0, 0, 0, 0.12);
    width: 100%;
}

html[data-theme="dark"] .app-topbar {
    box-shadow: 0 1px 0 var(--border), 0 2px 12px rgba(0, 0, 0, 0.4);
}

.app-topbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.app-topbar-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 0.65rem;
}

/* Pendência: demandas sem responsável (gestores/líderes) */
.app-topbar-pendencia {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    color: #7f1d1d;
    background: #fecaca;
    border: 1px solid rgba(127, 29, 29, 0.25);
    white-space: nowrap;
    max-width: min(42vw, 14rem);
    overflow: hidden;
    text-overflow: ellipsis;
}

html[data-theme="dark"] .app-topbar-pendencia {
    color: #fecaca;
    background: rgba(127, 29, 29, 0.45);
    border-color: rgba(254, 202, 202, 0.35);
}

.app-topbar-pendencia:hover {
    filter: brightness(1.05);
}

.app-topbar-pendencia-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #b91c1c;
    flex-shrink: 0;
}

.app-menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: background 0.2s;
}

.app-menu-btn:hover {
    background: var(--topbar-btn-hover);
}

.app-menu-btn-bar {
    display: block;
    width: 18px;
    height: 2px;
    margin: 0 auto;
    background: currentColor;
    border-radius: 1px;
}

.app-topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.app-topbar-logo {
    height: 32px;
    width: auto;
    background: var(--color-white);
    padding: 4px;
    border-radius: 5px;
    flex-shrink: 0;
}

.app-topbar-title {
    font-size: clamp(0.9rem, 2vw, 1.15rem);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sidebar deslizante */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: var(--backdrop-scrim);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.sidebar-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
}

.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    width: var(--sidebar-width);
    height: 100vh;
    max-height: 100dvh;
    background: linear-gradient(180deg, var(--sidebar-bg-start) 0%, var(--sidebar-bg-end) 100%);
    color: var(--sidebar-link);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    overflow-y: auto;
    padding-top: calc(var(--app-topbar-height) + 0.5rem);
}

.app-sidebar.is-open {
    transform: translateX(0);
}

.app-sidebar-inner {
    padding: 0.75rem 0 1.5rem;
}

.app-sidebar-heading {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: var(--sidebar-heading-opacity);
    padding: 0.5rem 1.25rem 0.75rem;
    margin: 0;
}

.app-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.app-sidebar-link {
    display: block;
    padding: 0.75rem 1.25rem;
    color: var(--sidebar-link);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: background 0.2s, border-color 0.2s;
}

.app-sidebar-link--icon {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.app-sidebar-link-label {
    flex: 1;
    min-width: 0;
}

.app-sidebar-link-label--stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.05rem;
}

.app-sidebar-link-text-sub {
    font-size: 0.72rem;
    font-weight: 400;
    line-height: 1.2;
    opacity: 0.78;
}

.app-sidebar-ico {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    opacity: 0.92;
}

.app-sidebar-link:hover {
    background: rgba(137, 214, 251, 0.12);
    border-left-color: var(--color-primary-end);
}

.app-sidebar-link.is-active {
    background: rgba(137, 214, 251, 0.18);
    border-left-color: var(--color-primary-end);
}

.app-sidebar-group {
    border-radius: 0;
}

.app-sidebar-group-summary {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    list-style: none;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--sidebar-link);
    border-left: 3px solid transparent;
    transition: background 0.2s, border-color 0.2s;
    user-select: none;
}

.app-sidebar-group-summary::-webkit-details-marker {
    display: none;
}

.app-sidebar-group-summary:hover {
    background: rgba(137, 214, 251, 0.12);
    border-left-color: var(--color-primary-end);
}

.app-sidebar-group-title {
    flex: 1;
    min-width: 0;
}

.app-sidebar-chevron {
    flex-shrink: 0;
    opacity: 0.85;
    transition: transform 0.2s ease;
}

.app-sidebar-group[open] .app-sidebar-chevron {
    transform: rotate(90deg);
}

.app-sidebar-group-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-bottom: 0.35rem;
}

.app-sidebar-link--sub {
    padding-left: 2.35rem;
    font-size: 0.9rem;
    font-weight: 400;
}

.app-sidebar-link--distribuicao .app-sidebar-badge,
.app-sidebar-link--demandas .app-sidebar-badge {
    margin-left: auto;
    flex-shrink: 0;
}

.app-sidebar-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    background: #b91c1c;
    color: #fff;
}

html[data-theme="dark"] .app-sidebar-badge {
    background: #f87171;
    color: #450a0a;
}

.app-sidebar-badge--tramite-hoje {
    background: #c2410c;
    color: #fff;
}

html[data-theme="dark"] .app-sidebar-badge--tramite-hoje {
    background: #fb923c;
    color: #431407;
}

.app-topbar-tramite {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    max-width: min(48vw, 16rem);
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid transparent;
}

.app-topbar-tramite--equipe {
    color: #1e3a8a;
    background: #dbeafe;
    border-color: rgba(30, 58, 138, 0.2);
}

html[data-theme="dark"] .app-topbar-tramite--equipe {
    color: #bfdbfe;
    background: rgba(30, 58, 138, 0.45);
    border-color: rgba(191, 219, 254, 0.25);
}

.app-topbar-tramite--minhas {
    color: #9a3412;
    background: #ffedd5;
    border-color: rgba(154, 52, 18, 0.2);
}

html[data-theme="dark"] .app-topbar-tramite--minhas {
    color: #fdba74;
    background: rgba(154, 52, 18, 0.35);
    border-color: rgba(253, 186, 116, 0.2);
}

.app-topbar-tramite:hover {
    filter: brightness(1.04);
}

/* Agenda de atualizações (perfil Atualização de Sistema) — pílulas distintas das demandas */
.app-topbar-atualizacao {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    max-width: min(48vw, 16rem);
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid transparent;
}

.app-topbar-atualizacao--hoje {
    color: #5b21b6;
    background: #ede9fe;
    border-color: rgba(91, 33, 182, 0.22);
}

html[data-theme="dark"] .app-topbar-atualizacao--hoje {
    color: #ddd6fe;
    background: rgba(91, 33, 182, 0.42);
    border-color: rgba(221, 214, 254, 0.28);
}

.app-topbar-atualizacao--checklist {
    color: #0f766e;
    background: #ccfbf1;
    border-color: rgba(15, 118, 110, 0.25);
}

html[data-theme="dark"] .app-topbar-atualizacao--checklist {
    color: #5eead4;
    background: rgba(15, 118, 110, 0.38);
    border-color: rgba(94, 234, 212, 0.22);
}

.app-topbar-atualizacao:hover {
    filter: brightness(1.04);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.user-info-dropdown {
    position: relative;
}

.user-info-trigger {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background 0.3s;
}

.user-info-trigger:hover {
    background: var(--topbar-btn-hover);
}

.user-name {
    font-size: 0.82rem;
    color: inherit;
    font-weight: 500;
}

.user-photo {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.5);
    background: var(--color-white);
}

.user-photo-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: linear-gradient(135deg, var(--color-primary-start) 0%, var(--color-primary-end) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: var(--color-white);
    font-weight: 600;
    font-size: 0.95rem;
}

.dropdown-arrow {
    font-size: 0.7rem;
    color: inherit;
    transition: transform 0.3s;
}

.user-info-trigger.active .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--dropdown-bg);
    border: 1px solid var(--dropdown-border);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    margin-top: 0.5rem;
    display: none;
    z-index: 1100;
    overflow: hidden;
}

.app-topbar .user-info-dropdown {
    position: relative;
    z-index: 1100;
}

.user-dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--dropdown-text);
    text-decoration: none;
    transition: background 0.3s;
    border-bottom: 1px solid var(--dropdown-border);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: var(--dropdown-hover);
}

.dropdown-item.logout {
    color: var(--color-error);
    font-weight: 500;
}

.dropdown-item.logout:hover {
    background: #f8d7da;
}

/* Área principal em largura total */
.app-main {
    width: 100%;
    min-height: calc(100vh - var(--app-topbar-height) - 72px);
    padding: 0.65rem 0 0;
    box-sizing: border-box;
}

/* Catálogo de soluções: formulário usa largura útil total */
.catalogo-solucao-form-card {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

.catalogo-solucao-form-card #corpo_texto {
    min-height: min(52vh, 36rem);
    width: 100%;
    box-sizing: border-box;
}

/* Atribuição automática: texto introdutório em largura total do card */
.atribuicao-automatica-intro {
    color: var(--page-text-muted);
    width: 100%;
    max-width: none;
    margin: 0 0 0.25rem 0;
    box-sizing: border-box;
    line-height: 1.55;
}

/* Atribuição automática — painel em lote */
.atrib-auto-card .card-header {
    flex-wrap: wrap;
    gap: 0.75rem;
}
.atrib-auto-bulk {
    display: grid;
    grid-template-columns: minmax(14rem, 1fr) minmax(18rem, 2fr);
    gap: 1rem;
    margin-top: 1.25rem;
    align-items: stretch;
}
@media (max-width: 900px) {
    .atrib-auto-bulk {
        grid-template-columns: 1fr;
    }
}
.atrib-auto-panel {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    min-height: 280px;
    max-height: min(52vh, 28rem);
}
.atrib-auto-panel-head {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.atrib-auto-panel-title {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--page-text);
}
.atrib-auto-panel-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.atrib-auto-panel-tools--wrap {
    flex-direction: column;
    align-items: stretch;
}
/* Evita o campo de filtro “esticar” no eixo vertical (coluna) e roubar espaço da lista */
.atrib-auto-panel-tools--wrap .atrib-auto-filter {
    flex: 0 0 auto;
    width: 100%;
    min-height: 0;
    max-height: 2.35rem;
}
.atrib-auto-filter {
    flex: 1 1 10rem;
    min-width: 0;
}
.atrib-auto-quick-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.atrib-auto-scroll {
    overflow: auto;
    flex: 1 1 auto;
    padding: 0.35rem 0.5rem 0.65rem;
}
.atrib-auto-checkline {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.35rem 0.25rem;
    margin: 0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.35;
}
.atrib-auto-checkline:hover {
    background: var(--surface-hover);
}
.atrib-auto-checkline--rotina {
    padding-left: 0.5rem;
}
.atrib-auto-checkline input {
    margin-top: 0.2rem;
    flex-shrink: 0;
}
.atrib-auto-muted {
    color: var(--page-text-muted);
    font-size: 0.9rem;
}
.atrib-auto-details {
    border-bottom: 1px solid var(--border);
}
.atrib-auto-details:last-child {
    border-bottom: none;
}
.atrib-auto-summary {
    cursor: pointer;
    font-weight: 600;
    padding: 0.45rem 0.25rem;
    list-style: none;
    color: var(--page-text);
}
.atrib-auto-summary::-webkit-details-marker {
    display: none;
}
.atrib-auto-summary::before {
    content: '▸ ';
    opacity: 0.55;
}
.atrib-auto-details[open] > .atrib-auto-summary::before {
    content: '▾ ';
}
.atrib-auto-modulo {
    margin: 0 0 0.5rem 0.65rem;
    padding-left: 0.5rem;
    border-left: 2px solid var(--border);
}
.atrib-auto-modulo-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    margin-bottom: 0.25rem;
}
.atrib-auto-modulo-title {
    font-weight: 500;
    font-size: 0.9rem;
    flex: 1 1 auto;
}
.atrib-auto-linkbtn {
    padding: 0.1rem 0.35rem !important;
    font-size: 0.8rem !important;
    color: var(--color-primary-end, #02577a) !important;
    text-decoration: underline;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    min-height: 0;
}
.atrib-auto-linkbtn:hover {
    opacity: 0.85;
}
.atrib-auto-actionbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 1rem 0 0 0;
    padding: 0.85rem 1rem;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.atrib-auto-resumo {
    margin: 0;
    font-size: 0.95rem;
    flex: 1 1 12rem;
}
.atrib-auto-resumo-hint {
    display: block;
    font-size: 0.82rem;
    color: var(--page-text-muted);
    margin-top: 0.25rem;
}
.atrib-auto-actionbar-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.atrib-auto-sec-title {
    margin: 1.75rem 0 0.75rem 0;
    font-size: 1.1rem;
}
.atrib-auto-comp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
    gap: 1rem;
}
.atrib-auto-user-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.85rem;
    background: var(--surface);
}
.atrib-auto-user-card-head {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}
.atrib-auto-user-card-empty {
    margin: 0;
}
.atrib-auto-comp-list {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.88rem;
}
.atrib-auto-comp-item {
    margin-bottom: 0.45rem;
    list-style: disc;
}
.atrib-auto-comp-path {
    display: inline;
    vertical-align: middle;
}
.atrib-auto-comp-remove {
    display: inline;
    margin-left: 0.35rem;
    vertical-align: middle;
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.card-title {
    font-size: 1.5rem;
    color: var(--page-text);
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary-start) 0%, var(--color-primary-end) 100%);
    color: var(--color-white);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(2, 87, 122, 0.4);
}

.btn-success {
    background: var(--color-success);
    color: var(--color-white);
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: var(--color-error);
    color: var(--color-white);
}

.btn-danger:hover {
    background: #c82333;
}

.btn-secondary {
    background: #6c757d;
    color: var(--color-white);
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--page-text);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background: var(--input-bg);
    color: var(--input-text);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary-start);
}

.form-control[type="file"] {
    padding: 0.5rem;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.form-check input[type="checkbox"] {
    margin-right: 0.5rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-check input[type="radio"] {
    margin-right: 0.5rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-check-label {
    margin: 0;
    cursor: pointer;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.table thead {
    background: linear-gradient(135deg, var(--color-primary-start) 0%, var(--color-primary-end) 100%);
    color: var(--color-white);
}

.table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--page-text);
}

.table tbody tr:hover {
    background: var(--surface-hover);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* Alerts */
.flash-messages {
    margin-bottom: 1.5rem;
}

.alert {
    padding: 1rem 1.5rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
}

.close-btn:hover {
    opacity: 1;
}

/* Dashboard */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--surface);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    text-align: center;
    border: 1px solid var(--border);
}

.stat-card h3 {
    font-size: 2.5rem;
    color: var(--color-primary-start);
    margin-bottom: 0.5rem;
}

.stat-card p {
    color: var(--page-text);
    font-size: 1.1rem;
    font-weight: 600;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
    background: var(--page-bg);
}

.login-card {
    background: var(--surface);
    color: var(--page-text);
    padding: 4rem 3.5rem;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--login-card-border);
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo img {
    max-width: 280px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.login-card h2 {
    text-align: center;
    margin-bottom: 2.5rem;
    color: var(--page-text);
    font-size: 1.5rem;
    font-weight: 500;
}

/* Conditional Fields */
.conditional-field {
    display: none;
}

.conditional-field.show {
    display: block;
}

/* Photo Preview */
.photo-preview {
    margin-top: 1rem;
}

.photo-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    border: 2px solid var(--photo-border);
}

/* Rodapé em largura total — compacto */
.app-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 0;
    text-align: center;
    margin-top: auto;
    width: 100%;
    border-top: 1px solid var(--border);
}

.app-footer .page-container {
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
}

@media (min-width: 1400px) {
    .app-footer .page-container {
        padding-left: 1.75rem;
        padding-right: 1.75rem;
    }
}

.app-footer p {
    margin: 0;
    font-size: 0.72rem;
    line-height: 1.3;
}

/* Quill Editor Styles */
#editor-observacoes .ql-container {
    font-size: 14px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--input-bg);
    color: var(--input-text);
    border-color: var(--border);
}

#editor-observacoes .ql-editor {
    min-height: 250px;
    color: var(--input-text);
}

#editor-observacoes .ql-toolbar {
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    background: var(--quill-toolbar-bg);
    border-color: var(--border);
}

#editor-observacoes .ql-container {
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}

/* Layout em coluna para empurrar rodapé ao fim da viewport */
body.app-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.app-body .app-main {
    flex: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        overflow-x: scroll;
    }

    .app-topbar-title {
        max-width: 42vw;
    }
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* Action buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--page-text-muted);
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}
