/* =========================================================
   ECOSSISTEMA YBYRÁ — CSS ÚNICO COMPATÍVEL
   Arquivo consolidado para o novo base.html
   Ordem: legado -> base institucional -> módulos escopados -> ajustes finais
========================================================= */


/* =========================================================
   LEGADO PRESERVADO: styles(6).css
========================================================= */


:root {
  /* IDENTIDADE YBYRÁ */
  --verde-base: #177762;
  --verde-principal: #02A588;
  --verde-hover: #14AA8C;
  --verde-soft: #41B9B5;
  --verde-sucesso: #A0D759;

  --amarelo-kpi: #F8D80D;

  --bg-body: #F2F2F2;
  --bg-card: #FFFFFF;

  --text: #1F2937;
  --muted: #6B7280;
  --border: #E0E0E0;
  --white: #FFFFFF;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    background: linear-gradient(180deg, #f7faf9 0%, #eef5f2 100%);
    color: var(--yb-text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.main-content,
.page-shell {
    width: 100%;
}

.page-shell {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 28px 18px 42px;
}

/* ==========================================================
   HEADER / APP HEADER
========================================================== */

.app-header {
    background:
        linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(45, 139, 87, 0.08)),
        var(--yb-surface);
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius-lg);
    box-shadow: var(--yb-shadow-sm);
    padding: 22px;
}

.app-header--internal {
    margin-bottom: 22px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.app-header__brand {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.app-header__logo {
    width: 88px;
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.app-header__titles {
    min-width: 0;
}

.app-header__eyebrow {
    display: inline-block;
    margin-bottom: 6px;
    color: var(--yb-primary);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.app-header__title {
    margin: 0;
    color: var(--yb-secondary);
    font-size: 1.85rem;
    line-height: 1.15;
    font-weight: 700;
}

.app-header__subtitle {
    margin: 8px 0 0;
    color: var(--yb-text-soft);
    max-width: 760px;
    font-size: 0.98rem;
}

.page-header__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ==========================================================
   LAYOUT
========================================================== */

.content-grid {
    display: grid;
    gap: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.detail-item {
    background: var(--yb-surface-soft);
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius-md);
    padding: 16px;
}

.detail-item--full {
    grid-column: 1 / -1;
}

.detail-label {
    display: block;
    margin-bottom: 6px;
    color: var(--yb-text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.detail-value {
    color: var(--yb-text);
    font-size: 1rem;
    font-weight: 700;
    word-break: break-word;
}

/* ==========================================================
   CARDS
========================================================== */

.card {
    background: var(--yb-surface);
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius-lg);
    box-shadow: var(--yb-shadow-sm);
    overflow: hidden;
}

.card-elevated {
    box-shadow: var(--yb-shadow-md);
}

.card-header,
.card-footer {
    padding: 18px 20px;
    border-bottom: 1px solid var(--yb-border);
}

.card-footer {
    border-top: 1px solid var(--yb-border);
    border-bottom: none;
    background: #fbfdfc;
}

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

.card-body {
    padding: 20px;
}

.card-body--no-padding {
    padding: 0;
}

.card-title {
    margin: 0;
    color: var(--yb-secondary);
    font-size: 1.15rem;
    font-weight: 700;
}

.card-subtitle {
    margin: 6px 0 0;
    color: var(--yb-text-soft);
    font-size: 0.92rem;
}

/* ==========================================================
   STAT CARDS
========================================================== */

.stat-card {
    padding: 18px;
    min-height: 130px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background:
        linear-gradient(180deg, rgba(15, 118, 110, 0.03), rgba(45, 139, 87, 0.02)),
        var(--yb-surface);
}

.stat-card__label {
    color: var(--yb-text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card__value {
    margin-top: 8px;
    color: var(--yb-secondary);
    font-size: 2rem;
    line-height: 1;
    font-weight: 700;
}

.stat-card__hint {
    margin-top: 10px;
    color: var(--yb-text-soft);
    font-size: 0.9rem;
}

/* ==========================================================
   FORM
========================================================== */

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group--span-2 {
    grid-column: span 2;
}

.form-label {
    color: var(--yb-secondary);
    font-size: 0.92rem;
    font-weight: 700;
}

.form-control {
    width: 100%;
    min-height: 46px;
    padding: 12px 14px;
    border: 1px solid var(--yb-border-strong);
    border-radius: 12px;
    background: #fff;
    color: var(--yb-text);
    outline: none;
    transition: var(--transition);
}

.form-control::placeholder {
    color: #8aa098;
}

.form-control:focus {
    border-color: var(--yb-primary);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

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

.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.form-actions--left {
    justify-content: flex-start;
}

/* ==========================================================
   BUTTONS
========================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 0.94rem;
    font-weight: 700;
    transition: var(--transition);
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--yb-primary), var(--yb-accent));
    color: #fff;
    box-shadow: 0 8px 18px rgba(15, 118, 110, 0.22);
}

.btn-primary:hover {
    filter: brightness(0.98);
}

.btn-secondary {
    background: #fff;
    color: var(--yb-secondary);
    border-color: var(--yb-border-strong);
}

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

.btn-sm {
    min-height: 36px;
    padding: 8px 12px;
    font-size: 0.86rem;
    border-radius: 10px;
}

.btn-disabled,
.btn[disabled] {
    opacity: 0.55;
    pointer-events: none;
    cursor: not-allowed;
}

/* ==========================================================
   TABLES
========================================================== */

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

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

.table-professional thead th {
    background: #f7fbf9;
    color: var(--yb-secondary);
    font-size: 0.84rem;
    font-weight: 700;
    text-align: left;
    padding: 14px 16px;
    border-bottom: 1px solid var(--yb-border);
    white-space: nowrap;
}

.table-professional tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #edf3f0;
    vertical-align: middle;
    color: var(--yb-text);
    font-size: 0.93rem;
}

.table-professional tbody tr:hover {
    background: #fbfefd;
}

.table-code {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--yb-primary-light);
    color: var(--yb-primary-dark);
    font-size: 0.82rem;
    font-weight: 700;
}

.table-primary-text {
    color: var(--yb-text);
    font-weight: 700;
}

.table-secondary-text {
    color: var(--yb-text-soft);
    font-size: 0.86rem;
    margin-top: 3px;
}

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

.table-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-meta__badge {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--yb-primary-light);
    color: var(--yb-primary-dark);
    font-size: 0.84rem;
    font-weight: 700;
}

/* ==========================================================
   BADGES
========================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
    border: 1px solid transparent;
}

.badge-soft {
    background: #eef5f2;
    color: var(--yb-secondary);
    border-color: #dbe7e1;
}

.badge-success {
    background: var(--yb-success-bg);
    color: var(--yb-success);
    border-color: #bde4ca;
}

.badge-warning {
    background: var(--yb-warning-bg);
    color: var(--yb-warning);
    border-color: #f1ddb0;
}

.badge-danger {
    background: var(--yb-danger-bg);
    color: var(--yb-danger);
    border-color: #f5c7c3;
}

.badge-dark {
    background: var(--yb-dark-bg);
    color: var(--yb-dark);
    border-color: #cad6d2;
}

/* ==========================================================
   PAGINATION
========================================================== */

.pagination-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.pagination-info {
    color: var(--yb-text-soft);
    font-size: 0.92rem;
    font-weight: 700;
}

.pagination-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ==========================================================
   EMPTY STATE
========================================================== */

.empty-state {
    padding: 42px 20px;
    text-align: center;
}

.empty-state__icon {
    font-size: 2.3rem;
    margin-bottom: 10px;
}

.empty-state__title {
    margin: 0;
    color: var(--yb-secondary);
    font-size: 1.2rem;
    font-weight: 700;
}

.empty-state__text {
    max-width: 620px;
    margin: 10px auto 0;
    color: var(--yb-text-soft);
    font-size: 0.95rem;
}

.empty-state__actions {
    margin-top: 18px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ==========================================================
   INFO BANNER
========================================================== */

.info-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    padding: 18px;
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(45, 139, 87, 0.05));
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius-md);
}

.info-banner__content {
    flex: 1 1 420px;
}

.info-banner__title {
    margin: 0;
    color: var(--yb-secondary);
    font-size: 1.05rem;
    font-weight: 700;
}

.info-banner__text {
    margin: 8px 0 0;
    color: var(--yb-text-soft);
    font-size: 0.94rem;
}

.info-banner__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ==========================================================
   TEXT HELPERS
========================================================== */

.text-right {
    text-align: right;
}

/* ==========================================================
   ALERTS / FLASH
========================================================== */

.alert {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    font-size: 0.93rem;
    font-weight: 700;
}

.alert-success {
    background: var(--yb-success-bg);
    color: var(--yb-success);
    border-color: #bde4ca;
}

.alert-danger {
    background: var(--yb-danger-bg);
    color: var(--yb-danger);
    border-color: #f5c7c3;
}

.alert-warning {
    background: var(--yb-warning-bg);
    color: var(--yb-warning);
    border-color: #f1ddb0;
}

.alert-info {
    background: #e7f1fb;
    color: #155b96;
    border-color: #c2dbf5;
}

/* ==========================================================
   RESPONSIVIDADE
========================================================== */

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

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

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

    .form-group--span-2,
    .detail-item--full {
        grid-column: auto;
    }

    .app-header__title {
        font-size: 1.55rem;
    }
}

@media (max-width: 768px) {
    .page-shell {
        padding: 18px 12px 28px;
    }

    .app-header,
    .card-body,
    .card-header,
    .card-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .app-header__brand {
        align-items: flex-start;
    }

    .app-header__logo {
        width: 64px;
    }

    .app-header__title {
        font-size: 1.35rem;
    }

    .app-header__subtitle {
        font-size: 0.92rem;
    }

    .btn,
    .btn-sm {
        width: 100%;
    }

    .page-header__actions,
    .form-actions,
    .pagination-actions,
    .empty-state__actions,
    .info-banner__actions,
    .table-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .pagination-wrap,
    .info-banner {
        align-items: stretch;
    }

    .table {
        min-width: 760px;
    }
}

@media (max-width: 480px) {
    .app-header__brand {
        flex-direction: column;
        gap: 12px;
    }

    .app-header__logo {
        width: 56px;
    }

    .stat-card__value {
        font-size: 1.7rem;
    }

    .card-title {
        font-size: 1.02rem;
    }

    .table {
        min-width: 680px;
    }
}

/* ==========================================================
   BASE LAYOUT
========================================================== */

.layout-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    background: linear-gradient(180deg, #f7faf9 0%, #eef5f2 100%);
}

.sidebar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(180deg, #16332b 0%, #1d433a 100%);
    color: #f4fbf8;
    padding: 22px 16px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    min-height: 100vh;
}

.sidebar__top {
    margin-bottom: 20px;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 8px;
    border-radius: 16px;
}

.sidebar__logo {
    width: 62px;
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar__brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar__eyebrow {
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    font-weight: 700;
    color: #b7ddd0;
}

.sidebar__title {
    font-size: 1.25rem;
    line-height: 1.1;
    color: #ffffff;
}

.sidebar__subtitle {
    margin-top: 4px;
    font-size: 0.82rem;
    color: #c7dfd7;
}

.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    margin-top: 8px;
}

.sidebar__link {
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 12px 14px;
    border-radius: 12px;
    color: #e7f4ef;
    font-weight: 700;
    transition: var(--transition);
}

.sidebar__link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.sidebar__link.is-active {
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.95), rgba(45, 139, 87, 0.95));
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.16);
}

.sidebar__footer {
    margin-top: 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar__user-card {
    padding: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar__user-name {
    color: #ffffff;
    font-size: 0.96rem;
    font-weight: 700;
}

.sidebar__user-meta {
    margin-top: 4px;
    color: #c9ddd6;
    font-size: 0.82rem;
}

.sidebar__logout {
    width: 100%;
}

.main-wrapper {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 22px;
    background: rgba(255, 255, 255, 0.84);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--yb-border);
}

.topbar__left,
.topbar__right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar__brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar__logo {
    width: 42px;
    height: auto;
    object-fit: contain;
}

.topbar__titles {
    display: flex;
    flex-direction: column;
}

.topbar__eyebrow {
    color: var(--yb-primary);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.topbar__title {
    color: var(--yb-secondary);
    font-size: 0.96rem;
    line-height: 1.2;
}

.topbar__user {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.topbar__user-name {
    color: var(--yb-secondary);
    font-size: 0.92rem;
    font-weight: 700;
}

.topbar__user-role {
    color: var(--yb-text-soft);
    font-size: 0.8rem;
}

.flash-stack {
    padding: 18px 18px 0;
}

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

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

    .sidebar {
        position: relative;
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
}

@media (max-width: 768px) {
    .topbar {
        padding: 12px 14px;
        flex-direction: column;
        align-items: stretch;
    }

    .topbar__right {
        justify-content: flex-start;
    }

    .topbar__user {
        align-items: flex-start;
    }

    .flash-stack {
        padding: 14px 12px 0;
    }
}

@media (max-width: 480px) {
    .sidebar__brand {
        align-items: flex-start;
    }

    .sidebar__logo {
        width: 52px;
    }

    .topbar__brand {
        align-items: flex-start;
    }

    .topbar__logo {
        width: 34px;
    }
}


/* =========================================================
   LEGADO PRESERVADO: ui(1).css
========================================================= */


:root {
    --yb-bg: #f3f6f5;
    --yb-surface: #ffffff;
    --yb-surface-soft: #f8fbfa;
    --yb-border: #d9e4df;
    --yb-border-strong: #c7d6d0;

    --yb-text: #143b36;
    --yb-text-soft: #5e7470;
    --yb-text-muted: #7b8e89;

    --yb-primary: #0f8f84;
    --yb-primary-dark: #0d6f68;
    --yb-accent: #24aa9b;

    --yb-success: #1b8d62;
    --yb-success-bg: #e3f3ec;

    --yb-warning: #b7791f;
    --yb-warning-bg: #fff4df;

    --yb-danger: #b42318;
    --yb-danger-bg: #fdeceb;

    --yb-info: #2e69d1;
    --yb-info-bg: #e9f1ff;

    --yb-shadow-sm: 0 6px 18px rgba(16, 53, 45, 0.06);
    --yb-shadow-md: 0 12px 28px rgba(16, 53, 45, 0.1);

    --yb-radius-sm: 10px;
    --yb-radius-md: 16px;
    --yb-radius-lg: 22px;
    --yb-radius-xl: 28px;

    --sidebar-width: 276px;
    --transition: all 0.22s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    background: linear-gradient(180deg, #f7faf9 0%, #eef5f2 100%);
    color: var(--yb-text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

/* ==========================================================
   APP LAYOUT
========================================================== */

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    background: linear-gradient(180deg, #f7faf9 0%, #eef5f2 100%);
}

.main-wrapper {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.page-content {
    min-width: 0;
    width: 100%;
    padding: 22px;
}

/* ==========================================================
   SIDEBAR
========================================================== */

.sidebar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(180deg, #16332b 0%, #1d433a 100%);
    color: #f4fbf8;
    padding: 22px 16px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    min-height: 100vh;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 8px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand img {
    width: 58px;
    height: 58px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    padding: 4px;
}

.sidebar-brand-text {
    min-width: 0;
}

.sidebar-brand-title {
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.1;
    color: #ffffff;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.sidebar-brand-subtitle {
    margin: 6px 0 0;
    font-size: 0.82rem;
    color: #c7dfd7;
    line-height: 1.3;
    font-weight: 600;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    margin-top: 22px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 12px 14px;
    border-radius: 14px;
    color: #e7f4ef;
    font-weight: 700;
    transition: var(--transition);
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.sidebar-link.active {
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.95), rgba(45, 139, 87, 0.95));
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.16);
}

.sidebar-footer {
    margin-top: 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-user {
    padding: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user-role {
    display: inline-block;
    color: #b7ddd0;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.sidebar-user-name {
    margin: 0;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.3;
}

.sidebar-user-meta {
    margin-top: 6px;
    color: #c9ddd6;
    font-size: 0.82rem;
    word-break: break-word;
}

.sidebar-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-weight: 700;
    transition: var(--transition);
}

.sidebar-logout:hover {
    background: rgba(255, 255, 255, 0.14);
}

/* ==========================================================
   TOPBAR
========================================================== */

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 22px;
    background: rgba(255, 255, 255, 0.84);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--yb-border);
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.topbar-brand img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    flex-shrink: 0;
}

.topbar-title-wrap {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar-title {
    margin: 0;
    color: var(--yb-secondary, #1f4d45);
    font-size: 1rem;
    line-height: 1.2;
    font-weight: 800;
}

.topbar-subtitle {
    margin: 3px 0 0;
    color: var(--yb-text-soft);
    font-size: 0.84rem;
}

.topbar-user {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 0;
}

.topbar-user-name {
    color: var(--yb-secondary, #1f4d45);
    font-size: 0.95rem;
    font-weight: 800;
}

.topbar-user-role {
    color: var(--yb-text-soft);
    font-size: 0.82rem;
}

/* ==========================================================
   FLASH / ALERTS
========================================================== */

.stack-md {
    display: grid;
    gap: 12px;
}

.alert {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid transparent;
    font-size: 0.93rem;
    font-weight: 700;
}

.alert-success {
    background: var(--yb-success-bg);
    color: var(--yb-success);
    border-color: #bde4ca;
}

.alert-danger {
    background: var(--yb-danger-bg);
    color: var(--yb-danger);
    border-color: #f5c7c3;
}

.alert-warning {
    background: var(--yb-warning-bg);
    color: var(--yb-warning);
    border-color: #f1ddb0;
}

.alert-info {
    background: #e7f1fb;
    color: #155b96;
    border-color: #c2dbf5;
}

/* ==========================================================
   LEGACY SUPPORT CLASSES
========================================================== */

.page-header {
    display: grid;
    gap: 8px;
    margin-bottom: 22px;
}

.eyebrow,
.page-kicker {
    margin: 0;
    color: var(--yb-primary);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.page-title {
    margin: 0;
    color: var(--yb-text);
    font-size: clamp(1.9rem, 4vw, 3rem);
    line-height: 1.08;
    font-weight: 800;
}

.page-description,
.page-subtitle {
    margin: 0;
    color: var(--yb-text-soft);
    font-size: 1rem;
    line-height: 1.65;
    max-width: 880px;
}

.actions-row,
.actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.text-muted,
.text-soft {
    color: var(--yb-text-muted);
}

.text-right {
    text-align: right;
}

.w-100 {
    width: 100%;
}

/* Cards antigos */
.card,
.form-card,
.filters-card,
.table-card {
    background: var(--yb-surface);
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius-lg);
    box-shadow: var(--yb-shadow-sm);
}

.form-card,
.filters-card,
.table-card {
    padding: 20px;
}

.card-header,
.table-toolbar {
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--yb-border);
}

.card-title {
    margin: 0;
    color: var(--yb-text);
    font-size: 1.08rem;
    font-weight: 800;
}

.card-subtitle {
    margin: 6px 0 0;
    color: var(--yb-text-soft);
    font-size: 0.92rem;
}

/* Form antigo */
.form-grid,
.filters-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.filters-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.form-group.full,
.form-group--span-2 {
    grid-column: 1 / -1;
}

.form-group label,
.form-label {
    color: var(--yb-text);
    font-size: 0.92rem;
    font-weight: 800;
}

.form-group input,
.form-group select,
.form-group textarea,
.form-control {
    width: 100%;
    min-height: 46px;
    padding: 12px 14px;
    border: 1px solid var(--yb-border-strong);
    border-radius: 12px;
    background: #fff;
    color: var(--yb-text);
    outline: none;
    transition: var(--transition);
}

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

.form-group input::placeholder,
.form-group textarea::placeholder,
.form-control::placeholder {
    color: #8aa098;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-control:focus {
    border-color: var(--yb-primary);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Botões antigos */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 0.94rem;
    font-weight: 700;
    transition: var(--transition);
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--yb-primary), var(--yb-accent));
    color: #fff;
    box-shadow: 0 8px 18px rgba(15, 118, 110, 0.22);
}

.btn-secondary {
    background: #fff;
    color: var(--yb-text);
    border-color: var(--yb-border-strong);
}

.btn-ghost,
.btn-neutral {
    background: #eef5f2;
    color: var(--yb-text);
    border-color: var(--yb-border);
}

.btn-sm {
    min-height: 36px;
    padding: 8px 12px;
    font-size: 0.86rem;
    border-radius: 10px;
}

/* Tabelas antigas */
.table-wrapper,
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table,
.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 820px;
}

.data-table thead th,
.table thead th {
    background: #f7fbf9;
    color: var(--yb-text);
    font-size: 0.84rem;
    font-weight: 800;
    text-align: left;
    padding: 14px 16px;
    border-bottom: 1px solid var(--yb-border);
    white-space: nowrap;
}

.data-table tbody td,
.table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #edf3f0;
    vertical-align: middle;
    color: var(--yb-text);
    font-size: 0.93rem;
}

.data-table tbody tr:hover,
.table tbody tr:hover {
    background: #fbfefd;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
    border: 1px solid transparent;
}

.badge-success {
    background: var(--yb-success-bg);
    color: var(--yb-success);
    border-color: #bde4ca;
}

.badge-warning {
    background: var(--yb-warning-bg);
    color: var(--yb-warning);
    border-color: #f1ddb0;
}

.badge-danger {
    background: var(--yb-danger-bg);
    color: var(--yb-danger);
    border-color: #f5c7c3;
}

.badge-info {
    background: var(--yb-info-bg);
    color: var(--yb-info);
    border-color: #cfdefa;
}

.badge-neutral,
.badge-soft,
.badge-dark {
    background: #eef5f2;
    color: var(--yb-text-soft);
    border-color: #dbe7e1;
}

/* Empty state */
.empty-state {
    padding: 42px 20px;
    text-align: center;
}

.empty-state-title {
    margin: 0;
    color: var(--yb-text);
    font-size: 1.2rem;
    font-weight: 800;
}

.empty-state-text {
    max-width: 620px;
    margin: 10px auto 0;
    color: var(--yb-text-soft);
    font-size: 0.95rem;
}

/* ==========================================================
   RESPONSIVO
========================================================== */

@media (max-width: 1024px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .filters-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .topbar {
        padding: 12px 14px;
        flex-direction: column;
        align-items: stretch;
    }

    .topbar-user {
        align-items: flex-start;
    }

    .page-content {
        padding: 14px 12px 22px;
    }

    .form-grid,
    .filters-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full,
    .form-group--span-2 {
        grid-column: auto;
    }

    .actions-row,
    .actions,
    .form-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .btn,
    .btn-sm {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .sidebar-brand {
        align-items: flex-start;
    }

    .sidebar-brand img {
        width: 52px;
        height: 52px;
    }

    .topbar-brand {
        align-items: flex-start;
    }

    .topbar-brand img {
        width: 34px;
        height: 34px;
    }

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

    .data-table,
    .table {
        min-width: 680px;
    }
}


/* =========================================================
   BASE INSTITUCIONAL EXTRAÍDO DO NOVO base.html
   Este bloco prevalece sobre conflitos globais dos arquivos legados.
========================================================= */


:root {
      /* =========================================================
         PALETA OFICIAL YBYRÁ — BRANDING INSTITUCIONAL
      ========================================================= */
      --verde-institucional: #1F5E3B;
      --verde-base: #177762;
      --verde-principal: #02A588;
      --verde-hover: #14AA8C;
      --verde-soft: #41B9B5;
      --verde-sucesso: #A0D759;
      --verde-claro: #6BCB77;

      --azul-tecnologico: #2D9CDB;
      --amarelo-kpi: #F8D80D;
      --amarelo-energia: #F2C94C;
      --laranja-risco: #F2994A;
      --vermelho-critico: #B42318;

      --bg-body: #F2F6F4;
      --bg-card: #FFFFFF;
      --bg-soft: #F6FBFA;
      --bg-soft-2: #EDF8F6;
      --bg-hero: #F8FFFD;

      --text: #1F2937;
      --text-strong: #12342A;
      --muted: #6B7280;
      --muted-2: #7D8A88;
      --border: #D9E6E3;
      --border-strong: #C7D8D4;
      --white: #FFFFFF;

      --danger-bg: #FDECEC;
      --danger-text: #B42318;
      --danger-border: #F4C7C7;

      --warning-bg: #FFF8D8;
      --warning-text: #8A6A00;
      --warning-border: #F2E08A;

      --success-bg: #EEF9D8;
      --success-text: #497A17;
      --success-border: #CFE7A6;

      --info-bg: rgba(45, 156, 219, 0.12);
      --info-text: #1D5F86;
      --info-border: rgba(45, 156, 219, 0.24);

      --shadow-xs: 0 4px 12px rgba(23, 119, 98, 0.05);
      --shadow-sm: 0 6px 18px rgba(23, 119, 98, 0.06);
      --shadow-md: 0 14px 34px rgba(23, 119, 98, 0.10);
      --shadow-lg: 0 20px 48px rgba(18, 52, 42, 0.14);

      --radius-sm: 12px;
      --radius-md: 16px;
      --radius-lg: 22px;
      --radius-xl: 28px;
      --radius-pill: 999px;

      --container: 1320px;
      --transition: all 0.22s ease;

      --font-title: "Poppins", "Segoe UI", Arial, sans-serif;
      --font-body: "Inter", "Segoe UI", Arial, sans-serif;

      /* Compatibilidade com arquivos CSS já existentes */
      --yb-bg: var(--bg-body);
      --yb-surface: var(--bg-card);
      --yb-surface-soft: var(--bg-soft);
      --yb-border: var(--border);
      --yb-border-strong: var(--border-strong);
      --yb-text: var(--text);
      --yb-text-soft: var(--muted);
      --yb-text-muted: var(--muted-2);
      --yb-primary: var(--verde-principal);
      --yb-primary-dark: var(--verde-base);
      --yb-accent: var(--verde-soft);
      --yb-success: var(--success-text);
      --yb-success-bg: var(--success-bg);
      --yb-warning: var(--warning-text);
      --yb-warning-bg: var(--warning-bg);
      --yb-danger: var(--danger-text);
      --yb-danger-bg: var(--danger-bg);
      --yb-info: var(--info-text);
      --yb-info-bg: var(--info-bg);
      --yb-shadow-sm: var(--shadow-sm);
      --yb-shadow-md: var(--shadow-md);
      --yb-radius-sm: var(--radius-sm);
      --yb-radius-md: var(--radius-md);
      --yb-radius-lg: var(--radius-lg);
      --yb-radius-xl: var(--radius-xl);
    }

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

    html,
    body {
      min-height: 100%;
      scroll-behavior: smooth;
    }

    body {
      background:
        radial-gradient(circle at top left, rgba(160, 215, 89, 0.12), transparent 30%),
        radial-gradient(circle at top right, rgba(45, 156, 219, 0.10), transparent 28%),
        var(--bg-body) !important;
      color: var(--text);
      font-family: var(--font-body);
      line-height: 1.55;
      -webkit-font-smoothing: antialiased;
      text-rendering: optimizeLegibility;
    }

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

    img {
      max-width: 100%;
      display: block;
    }

    button,
    input,
    select,
    textarea {
      font: inherit;
    }

    button {
      border: none;
      background: none;
    }

    .page-bg {
      min-height: 100vh;
      background: transparent;
    }

    .container {
      width: 100%;
      max-width: var(--container);
      margin: 0 auto;
      padding: 0 22px;
    }

    /* =========================================================
       TOPO / IDENTIDADE
    ========================================================= */
    .topbar {
      background:
        linear-gradient(135deg, rgba(31, 94, 59, 0.98), rgba(2, 165, 136, 0.96)),
        var(--verde-institucional);
      color: var(--white);
      border-bottom: 1px solid rgba(255,255,255,0.12);
      box-shadow: var(--shadow-md);
      position: relative;
      overflow: hidden;
    }

    .topbar::before {
      content: "";
      position: absolute;
      inset: 0;
      background:
        radial-gradient(circle at top right, rgba(248, 216, 13, 0.18), transparent 24%),
        radial-gradient(circle at bottom left, rgba(65, 185, 181, 0.20), transparent 22%),
        linear-gradient(90deg, rgba(255,255,255,0.06), transparent 42%);
      pointer-events: none;
    }

    .topbar-inner {
      position: relative;
      z-index: 1;
      max-width: var(--container);
      margin: 0 auto;
      padding: 22px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 22px;
      flex-wrap: wrap;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 16px;
      min-width: 280px;
      flex: 1 1 380px;
    }

    .brand-logo-wrap {
      width: 68px;
      height: 68px;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.16);
      border: 1px solid rgba(255,255,255,0.22);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      overflow: hidden;
      backdrop-filter: blur(5px);
      box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
    }

    .brand-logo {
      width: 58px;
      height: 58px;
      object-fit: contain;
      object-position: center;
      background: transparent;
      border-radius: 50%;
    }

    .brand-text {
      min-width: 0;
    }

    .brand-title {
      font-family: var(--font-title);
      font-size: clamp(1.55rem, 3vw, 2rem);
      font-weight: 900;
      line-height: 1.02;
      letter-spacing: 0.4px;
      margin-bottom: 4px;
      text-transform: uppercase;
    }

    .brand-subtitle {
      font-size: 1.03rem;
      font-weight: 800;
      opacity: 0.98;
      margin-bottom: 4px;
    }

    .brand-tagline {
      font-size: 0.94rem;
      opacity: 0.90;
      max-width: 620px;
    }

    .nav {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 10px;
      flex-wrap: wrap;
      flex: 2 1 560px;
    }

    .nav a {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 42px;
      padding: 10px 16px;
      border-radius: var(--radius-pill);
      font-size: 0.94rem;
      font-weight: 900;
      color: rgba(255,255,255,0.98);
      border: 1px solid transparent;
      background: transparent;
      white-space: nowrap;
    }

    .nav a:hover {
      background: rgba(255,255,255,0.15);
      border-color: rgba(255,255,255,0.20);
      transform: translateY(-1px);
    }

    .nav a.active {
      background: rgba(255,255,255,0.22);
      border-color: rgba(255,255,255,0.28);
      box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
    }

    /* =========================================================
       CONTEÚDO
    ========================================================= */
    .main-content {
      padding: 28px 0 44px;
      background: transparent;
    }

    .page-header {
      background:
        linear-gradient(135deg, rgba(255,255,255,0.96), rgba(237,248,246,0.96)),
        var(--bg-hero);
      border: 1px solid var(--border);
      border-radius: 28px;
      padding: 30px;
      margin-bottom: 24px;
      box-shadow: var(--shadow-sm);
      position: relative;
      overflow: hidden;
    }

    .page-header::after {
      content: "";
      position: absolute;
      right: -80px;
      top: -80px;
      width: 220px;
      height: 220px;
      border-radius: 50%;
      background: radial-gradient(circle, rgba(160, 215, 89, 0.18), rgba(45, 156, 219, 0.08), transparent 70%);
      pointer-events: none;
    }

    .page-header > * {
      position: relative;
      z-index: 1;
    }

    .page-header-kicker,
    .kicker,
    .eyebrow,
    .page-kicker {
      display: inline-block;
      font-size: 0.82rem;
      font-weight: 900;
      text-transform: uppercase;
      letter-spacing: 1.5px;
      color: var(--verde-institucional);
      margin-bottom: 10px;
    }

    .page-header h1,
    .page-title {
      font-family: var(--font-title);
      font-size: clamp(2rem, 4vw, 3rem);
      line-height: 1.04;
      margin-bottom: 10px;
      font-weight: 900;
      color: var(--text-strong);
    }

    .page-header p,
    .page-description,
    .page-subtitle {
      color: var(--muted);
      font-size: 1.04rem;
      max-width: 960px;
      line-height: 1.65;
    }

    .card,
    .form-card,
    .filters-card,
    .table-card {
      background: rgba(255,255,255,0.96);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 24px;
      box-shadow: var(--shadow-sm);
    }

    .card + .card,
    .form-card + .card,
    .card + .form-card {
      margin-top: 18px;
    }

    .card-soft,
    .yb-card-soft {
      background: var(--bg-soft);
    }

    .card-title,
    .section-title {
      font-family: var(--font-title);
      font-size: 1.65rem;
      line-height: 1.1;
      font-weight: 900;
      color: var(--text-strong);
      margin-bottom: 8px;
    }

    .card-subtitle,
    .section-subtitle {
      font-size: 1rem;
      color: var(--muted);
      margin-bottom: 18px;
      line-height: 1.6;
    }

    .grid {
      display: grid;
      gap: 18px;
    }

    .grid-2 {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid-3 {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .grid-4 {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    /* =========================================================
       BOTÕES / AÇÕES
    ========================================================= */
    .btn-row,
    .actions-row,
    .actions {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
      align-items: center;
    }

    .btn,
    button,
    input[type="submit"],
    input[type="button"] {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 48px;
      padding: 12px 18px;
      border-radius: 14px;
      border: 1px solid transparent;
      cursor: pointer;
      font-weight: 900;
      font-size: 0.98rem;
      transition: var(--transition);
      white-space: nowrap;
    }

    .btn:hover,
    button:hover,
    input[type="submit"]:hover,
    input[type="button"]:hover {
      transform: translateY(-1px);
    }

    .btn-primary,
    button[type="submit"],
    input[type="submit"] {
      background: linear-gradient(135deg, var(--verde-principal), var(--verde-institucional));
      color: var(--white);
      box-shadow: 0 8px 18px rgba(2, 165, 136, 0.18);
    }

    .btn-primary:hover,
    button[type="submit"]:hover,
    input[type="submit"]:hover {
      background: linear-gradient(135deg, var(--verde-institucional), var(--verde-principal));
      box-shadow: 0 12px 24px rgba(2, 165, 136, 0.22);
    }

    .btn-secondary {
      background: var(--white);
      color: var(--verde-institucional);
      border-color: var(--border-strong);
    }

    .btn-secondary:hover {
      background: var(--bg-soft);
      border-color: var(--verde-soft);
    }

    .btn-ghost {
      background: transparent;
      color: var(--verde-institucional);
      border-color: transparent;
    }

    .btn-ghost:hover {
      background: rgba(20, 170, 140, 0.08);
      border-color: rgba(20, 170, 140, 0.10);
    }

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

    .btn-warning {
      background: var(--warning-bg);
      color: var(--warning-text);
      border-color: var(--warning-border);
    }

    /* =========================================================
       FORMULÁRIOS
    ========================================================= */
    form {
      width: 100%;
    }

    label,
    .form-label {
      display: block;
      margin-bottom: 8px;
      color: var(--text-strong);
      font-size: 0.98rem;
      font-weight: 900;
    }

    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    input[type="time"],
    input[type="month"],
    input[type="search"],
    input[type="file"],
    select,
    textarea,
    .form-control {
      width: 100%;
      min-height: 50px;
      padding: 13px 15px;
      border: 1px solid var(--border);
      border-radius: 14px;
      background: #FFFFFF;
      color: var(--text);
      outline: none;
      transition: var(--transition);
      box-shadow: none;
    }

    input[type="file"] {
      padding: 11px 13px;
    }

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

    input::placeholder,
    textarea::placeholder {
      color: #9AA4B2;
    }

    input:focus,
    select:focus,
    textarea:focus,
    .form-control:focus {
      border-color: var(--verde-principal);
      box-shadow: 0 0 0 4px rgba(2, 165, 136, 0.10);
      background: #FFFFFF;
    }

    input[readonly],
    textarea[readonly] {
      background: #F8FBFA;
      color: var(--muted);
      cursor: default;
    }

    .form-grid,
    .filters-grid {
      display: grid;
      gap: 18px;
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-grid-2 {
      display: grid;
      gap: 18px;
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-grid-3 {
      display: grid;
      gap: 18px;
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .field,
    .form-field,
    .form-group {
      display: flex;
      flex-direction: column;
      gap: 8px;
      min-width: 0;
    }

    .col-3 { grid-column: span 3; }
    .col-4 { grid-column: span 4; }
    .col-6 { grid-column: span 6; }
    .col-8 { grid-column: span 8; }
    .col-12 { grid-column: span 12; }

    .field-help,
    .help-text,
    small,
    .text-muted,
    .text-soft {
      color: var(--muted);
      font-size: 0.9rem;
      line-height: 1.45;
    }

    /* =========================================================
       TABELAS
    ========================================================= */
    .table-wrap,
    .table-responsive {
      width: 100%;
      overflow-x: auto;
      border: 1px solid var(--border);
      border-radius: 18px;
      background: #FFFFFF;
    }

    table,
    .table {
      width: 100%;
      border-collapse: collapse;
      min-width: 720px;
      background: #FFFFFF;
    }

    thead th,
    .table-professional thead th {
      background: #EFF8F5;
      color: var(--verde-institucional);
      text-align: left;
      font-size: 0.93rem;
      font-weight: 900;
      padding: 16px 16px;
      border-bottom: 1px solid var(--border);
      white-space: nowrap;
    }

    tbody td,
    .table-professional tbody td {
      padding: 16px;
      border-bottom: 1px solid #EDF2F1;
      color: var(--text);
      vertical-align: middle;
    }

    tbody tr:hover {
      background: #FAFDFC;
    }

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

    .cell-main,
    .table-primary-text {
      font-weight: 900;
      color: var(--text-strong);
    }

    .codigo-mono,
    .table-code {
      font-family: "Consolas", "Courier New", monospace;
      font-weight: 800;
      color: var(--verde-institucional);
    }

    /* =========================================================
       BADGES / STATUS / ALERTAS
    ========================================================= */
    .badge,
    .pill-success,
    .prof-pill {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 32px;
      padding: 6px 12px;
      border-radius: var(--radius-pill);
      font-size: 0.82rem;
      font-weight: 900;
      white-space: nowrap;
      border: 1px solid transparent;
      line-height: 1.2;
    }

    .badge-success,
    .pill-success {
      background: var(--success-bg);
      color: var(--success-text);
      border-color: var(--success-border);
    }

    .badge-warning {
      background: var(--warning-bg);
      color: var(--warning-text);
      border-color: var(--warning-border);
    }

    .badge-danger {
      background: var(--danger-bg);
      color: var(--danger-text);
      border-color: var(--danger-border);
    }

    .badge-info,
    .badge-secondary,
    .prof-pill {
      background: rgba(65, 185, 181, 0.12);
      color: var(--verde-institucional);
      border-color: rgba(65, 185, 181, 0.20);
    }

    .badge-amanara,
    .badge-risk,
    .badge-critico {
      background: var(--danger-bg);
      color: var(--danger-text);
      border-color: var(--danger-border);
    }

    .alerta-critico,
    .risk-critical {
      border-left: 6px solid var(--danger-text);
      background: var(--danger-bg);
    }

    .alerta-moderado,
    .risk-warning {
      border-left: 6px solid var(--laranja-risco);
      background: var(--warning-bg);
    }

    .alerta-normal,
    .risk-normal {
      border-left: 6px solid var(--verde-sucesso);
      background: var(--success-bg);
    }

    .flash-messages {
      display: grid;
      gap: 12px;
      margin-bottom: 18px;
    }

    .alert {
      border-radius: 16px;
      padding: 14px 16px;
      border: 1px solid var(--border);
      font-weight: 800;
      box-shadow: var(--shadow-xs);
    }

    .alert-success {
      background: var(--success-bg);
      color: var(--success-text);
      border-color: var(--success-border);
    }

    .alert-warning {
      background: var(--warning-bg);
      color: var(--warning-text);
      border-color: var(--warning-border);
    }

    .alert-danger,
    .alert-error {
      background: var(--danger-bg);
      color: var(--danger-text);
      border-color: var(--danger-border);
    }

    .alert-info {
      background: var(--info-bg);
      color: var(--info-text);
      border-color: var(--info-border);
    }

    /* =========================================================
       CARDS DE INDICADORES
    ========================================================= */
    .stat-card {
      background: rgba(255,255,255,0.96);
      border: 1px solid var(--border);
      border-radius: 24px;
      padding: 22px;
      box-shadow: var(--shadow-sm);
      transition: var(--transition);
    }

    .stat-card:hover {
      transform: translateY(-2px);
      box-shadow: var(--shadow-md);
      border-color: rgba(2, 165, 136, 0.22);
    }

    .stat-card.soft {
      background: var(--bg-soft);
    }

    .stat-label {
      font-size: 1rem;
      color: var(--muted);
      margin-bottom: 10px;
      font-weight: 700;
    }

    .stat-value,
    .big-number {
      font-family: var(--font-title);
      font-size: clamp(1.3rem, 2vw, 1.9rem);
      line-height: 1;
      font-weight: 900;
      color: var(--text-strong);
    }

    .stat-value-area {
      display: block;
      max-width: 100%;
      font-size: clamp(1.45rem, 2.4vw, 2.15rem);
      line-height: 1.05;
      white-space: normal;
      overflow-wrap: anywhere;
      word-break: break-word;
    }

    .stat-value.kpi {
      color: var(--warning-text);
    }

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

    .empty-box,
    .empty-state {
      padding: 24px;
      border: 1px dashed var(--border-strong);
      border-radius: 18px;
      background: #FBFDFC;
      color: var(--muted);
      text-align: center;
    }

    hr {
      border: 0;
      border-top: 1px solid var(--border);
      margin: 20px 0;
    }

    .text-right { text-align: right; }
    .w-100 { width: 100%; }

    /* =========================================================
       ASSINATURA INSTITUCIONAL / RODAPÉ
    ========================================================= */
    .institutional-footer {
      margin-top: 38px;
      padding: 18px 0 28px;
      color: var(--muted);
      font-size: 0.88rem;
      text-align: center;
    }

    .institutional-footer strong {
      color: var(--verde-institucional);
    }

    /* =========================================================
       RESPONSIVIDADE
    ========================================================= */
    @media (max-width: 1160px) {
      .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .form-grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
    }

    @media (max-width: 920px) {
      .topbar-inner {
        flex-direction: column;
        align-items: flex-start;
      }

      .nav {
        width: 100%;
        justify-content: flex-start;
      }

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

      .col-3,
      .col-4,
      .col-6,
      .col-8,
      .col-12 {
        grid-column: auto;
      }
    }

    @media (max-width: 640px) {
      .container {
        padding: 0 14px;
      }

      .topbar-inner {
        padding: 16px 14px 18px;
      }

      .brand {
        align-items: flex-start;
        min-width: 0;
      }

      .brand-logo-wrap {
        width: 56px;
        height: 56px;
      }

      .brand-logo {
        width: 48px;
        height: 48px;
      }

      .brand-title {
        font-size: 1.35rem;
      }

      .brand-subtitle {
        font-size: 0.92rem;
      }

      .brand-tagline {
        font-size: 0.84rem;
      }

      .nav {
        gap: 8px;
      }

      .nav a {
        min-height: 40px;
        padding: 9px 13px;
        font-size: 0.90rem;
      }

      .main-content {
        padding: 18px 0 34px;
      }

      .page-header {
        padding: 20px 18px;
        border-radius: 22px;
      }

      .card,
      .form-card,
      .filters-card,
      .table-card,
      .stat-card {
        padding: 18px;
      }

      .btn,
      button,
      input[type="submit"],
      input[type="button"] {
        width: 100%;
      }

      .btn-row,
      .actions-row,
      .actions {
        flex-direction: column;
        align-items: stretch;
      }

      table,
      .table {
        min-width: 640px;
      }
    }

    @media print {
      .topbar,
      .nav,
      .btn,
      button,
      .actions-row,
      .institutional-footer {
        display: none !important;
      }

      body {
        background: #fff !important;
      }

      .card,
      .page-header {
        box-shadow: none;
        border-color: #ddd;
      }
    }


/* =========================================================
   MÓDULO PRESERVADO: admin_layout_refactor(2).css
========================================================= */


/* =========================================================
   YBYRÁ - ADMIN LAYOUT REFACTOR
   Escopo isolado para evitar quebra global
   Use apenas dentro de .ybyra-admin-layout
========================================================= */

.ybyra-admin-layout {
    --yb-bg: #f3f6f5;
    --yb-surface: #ffffff;
    --yb-surface-soft: #f8fbfa;
    --yb-border: #d9e4df;
    --yb-border-strong: #c7d6d0;
    --yb-text: #143b36;
    --yb-text-soft: #5e7470;
    --yb-primary: #0f8f84;
    --yb-primary-strong: #0d6f68;
    --yb-shadow: 0 10px 30px rgba(16, 45, 40, 0.08);
    --yb-shadow-soft: 0 4px 14px rgba(16, 45, 40, 0.06);
    --yb-radius-xl: 28px;
    --yb-radius-lg: 22px;
    --yb-radius-md: 18px;
    --yb-radius-sm: 14px;
    --yb-gap-xs: 10px;
    --yb-gap-sm: 14px;
    --yb-gap-md: 18px;
    --yb-gap-lg: 24px;
    --yb-gap-xl: 32px;
    --yb-page-max: 1280px;
    --yb-page-padding: clamp(16px, 4vw, 32px);
    --yb-card-padding: clamp(18px, 3vw, 28px);
    --yb-section-spacing: clamp(20px, 3vw, 32px);

    background: var(--yb-bg);
    color: var(--yb-text);
    min-height: 100vh;
    width: 100%;
    box-sizing: border-box;
}

.ybyra-admin-layout *,
.ybyra-admin-layout *::before,
.ybyra-admin-layout *::after {
    box-sizing: border-box;
}

.ybyra-admin-layout .yb-page {
    width: 100%;
    max-width: var(--yb-page-max);
    margin: 0 auto;
    padding:
        var(--yb-gap-lg)
        var(--yb-page-padding)
        calc(var(--yb-gap-xl) + 12px);
}

/* =========================================================
   CONTAINER DE CONTEÚDO CENTRALIZADO
========================================================= */

.ybyra-admin-layout .yb-content-narrow {
    width: 100%;
    max-width: 920px;
    margin: 0 auto;
}

/* =========================================================
   HEADER / HERO
========================================================= */

.ybyra-admin-layout .yb-hero {
    background: linear-gradient(135deg, #ffffff 0%, #f6fbfa 100%);
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius-xl);
    box-shadow: var(--yb-shadow-soft);
    padding: clamp(20px, 4vw, 32px);
    margin-bottom: var(--yb-section-spacing);
}

.ybyra-admin-layout .yb-hero-top {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.ybyra-admin-layout .yb-logo {
    width: 54px;
    height: 54px;
    object-fit: contain;
    flex: 0 0 auto;
}

.ybyra-admin-layout .yb-brand {
    min-width: 0;
}

.ybyra-admin-layout .yb-brand-title {
    margin: 0;
    font-size: clamp(1.55rem, 4vw, 2.25rem);
    line-height: 1.1;
    font-weight: 800;
    color: var(--yb-text);
    letter-spacing: 0.02em;
}

.ybyra-admin-layout .yb-brand-subtitle {
    margin: 6px 0 0;
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: var(--yb-text-soft);
    font-weight: 600;
}

.ybyra-admin-layout .yb-session-box {
    display: grid;
    gap: 8px;
    margin-top: 18px;
    padding: 18px;
    border: 1px solid var(--yb-border);
    background: var(--yb-surface);
    border-radius: var(--yb-radius-lg);
}

.ybyra-admin-layout .yb-session-label {
    font-size: 0.95rem;
    color: var(--yb-text-soft);
    margin: 0;
}

.ybyra-admin-layout .yb-session-role {
    font-size: clamp(1.35rem, 3.8vw, 2rem);
    font-weight: 800;
    margin: 0;
    color: var(--yb-text);
}

.ybyra-admin-layout .yb-session-user {
    font-size: 1rem;
    color: var(--yb-text-soft);
    margin: 0;
}

/* =========================================================
   SEÇÕES
========================================================= */

.ybyra-admin-layout .yb-section {
    display: grid;
    gap: var(--yb-gap-md);
    margin-bottom: var(--yb-section-spacing);
}

.ybyra-admin-layout .yb-section-header {
    display: grid;
    gap: 10px;
}

.ybyra-admin-layout .yb-eyebrow {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--yb-text-soft);
    letter-spacing: 0.02em;
}

.ybyra-admin-layout .yb-title {
    margin: 0;
    font-size: clamp(1.8rem, 5vw, 3rem);
    line-height: 1.08;
    font-weight: 800;
    color: var(--yb-text);
}

.ybyra-admin-layout .yb-description {
    margin: 0;
    max-width: 900px;
    font-size: clamp(1rem, 2.7vw, 1.2rem);
    line-height: 1.65;
    color: var(--yb-text);
}

/* =========================================================
   GRID
========================================================= */

.ybyra-admin-layout .yb-grid {
    display: grid;
    gap: var(--yb-gap-lg);
}

.ybyra-admin-layout .yb-grid-2 {
    grid-template-columns: 1fr;
}

.ybyra-admin-layout .yb-grid-3 {
    grid-template-columns: 1fr;
}

@media (min-width: 860px) {
    .ybyra-admin-layout .yb-grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ybyra-admin-layout .yb-grid-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* =========================================================
   CARDS
========================================================= */

.ybyra-admin-layout .yb-card {
    background: var(--yb-surface);
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius-xl);
    box-shadow: var(--yb-shadow-soft);
    padding: var(--yb-card-padding);
    min-width: 0;
}

.ybyra-admin-layout .yb-card-soft {
    background: var(--yb-surface-soft);
}

.ybyra-admin-layout .yb-card-header {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.ybyra-admin-layout .yb-card-title {
    margin: 0;
    font-size: clamp(1.25rem, 3.2vw, 1.85rem);
    line-height: 1.2;
    font-weight: 800;
    color: var(--yb-text);
}

.ybyra-admin-layout .yb-card-text {
    margin: 0;
    color: var(--yb-text);
    line-height: 1.7;
    font-size: 1rem;
}

.ybyra-admin-layout .yb-card-inner {
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius-lg);
    background: #fcfefd;
    padding: clamp(16px, 2.5vw, 22px);
}

.ybyra-admin-layout .yb-summary-value {
    margin: 0;
    font-size: clamp(2rem, 6vw, 3.4rem);
    line-height: 1;
    font-weight: 800;
    color: var(--yb-text);
}

.ybyra-admin-layout .yb-summary-label {
    margin: 10px 0 0;
    color: var(--yb-text-soft);
    font-size: 1rem;
    line-height: 1.4;
}

/* =========================================================
   TAGS / BADGES
========================================================= */

.ybyra-admin-layout .yb-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.ybyra-admin-layout .yb-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid var(--yb-border);
    background: #eef5f2;
    color: var(--yb-text-soft);
    font-weight: 700;
    font-size: 0.98rem;
    white-space: normal;
    text-align: center;
}

.ybyra-admin-layout .yb-badge-green {
    background: #e3f3ec;
    color: #1b8d62;
    border-color: #c8e6d7;
}

.ybyra-admin-layout .yb-badge-blue {
    background: #e9f1ff;
    color: #2e69d1;
    border-color: #cfdefa;
}

.ybyra-admin-layout .yb-badge-red {
    background: #fdecec;
    color: #bf4d4d;
    border-color: #f4d0d0;
}

/* =========================================================
   AÇÕES / BOTÕES
========================================================= */

.ybyra-admin-layout .yb-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.ybyra-admin-layout .yb-btn {
    appearance: none;
    border: 0;
    border-radius: 18px;
    min-height: 56px;
    padding: 14px 22px;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.ybyra-admin-layout .yb-btn:hover {
    transform: translateY(-1px);
}

.ybyra-admin-layout .yb-btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #24aa9b 0%, #0d837b 100%);
    box-shadow: 0 14px 28px rgba(13, 131, 123, 0.18);
}

.ybyra-admin-layout .yb-btn-secondary {
    color: var(--yb-text);
    background: #ffffff;
    border: 1px solid var(--yb-border);
    box-shadow: var(--yb-shadow-soft);
}

.ybyra-admin-layout .yb-btn-block {
    width: 100%;
}

/* =========================================================
   FILTROS
========================================================= */

.ybyra-admin-layout .yb-filter-card {
    background: var(--yb-surface);
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius-xl);
    box-shadow: var(--yb-shadow-soft);
    padding: var(--yb-card-padding);
}

.ybyra-admin-layout .yb-filter-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr;
}

@media (min-width: 720px) {
    .ybyra-admin-layout .yb-filter-grid {
        grid-template-columns: minmax(0, 1.3fr) minmax(160px, 0.8fr) auto;
        align-items: end;
    }
}

.ybyra-admin-layout .yb-field {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.ybyra-admin-layout .yb-label {
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--yb-text);
}

.ybyra-admin-layout .yb-input,
.ybyra-admin-layout .yb-select {
    width: 100%;
    min-height: 56px;
    border-radius: 18px;
    border: 1px solid var(--yb-border-strong);
    background: #fff;
    padding: 0 18px;
    font-size: 1rem;
    color: var(--yb-text);
    outline: none;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.ybyra-admin-layout .yb-input::placeholder {
    color: #96a7a2;
}

.ybyra-admin-layout .yb-input:focus,
.ybyra-admin-layout .yb-select:focus {
    border-color: var(--yb-primary);
    box-shadow: 0 0 0 4px rgba(15, 143, 132, 0.12);
}

/* =========================================================
   FORMULÁRIOS
========================================================= */

.ybyra-admin-layout .form-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ybyra-admin-layout .form-group {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.ybyra-admin-layout .form-group-full {
    grid-column: 1 / -1;
}

.ybyra-admin-layout .form-group label {
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--yb-text);
}

.ybyra-admin-layout .form-group input,
.ybyra-admin-layout .form-group select,
.ybyra-admin-layout .form-group textarea {
    width: 100%;
    min-height: 56px;
    border-radius: 18px;
    border: 1px solid var(--yb-border-strong);
    background: #fff;
    padding: 0 18px;
    font-size: 1rem;
    color: var(--yb-text);
    outline: none;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.ybyra-admin-layout .form-group textarea {
    min-height: 120px;
    padding-top: 14px;
    padding-bottom: 14px;
    resize: vertical;
}

.ybyra-admin-layout .form-group input::placeholder,
.ybyra-admin-layout .form-group textarea::placeholder {
    color: #96a7a2;
}

.ybyra-admin-layout .form-group input:focus,
.ybyra-admin-layout .form-group select:focus,
.ybyra-admin-layout .form-group textarea:focus {
    border-color: var(--yb-primary);
    box-shadow: 0 0 0 4px rgba(15, 143, 132, 0.12);
}

/* =========================================================
   RESUMO
========================================================= */

.ybyra-admin-layout .yb-summary-list {
    display: grid;
    gap: 10px;
}

.ybyra-admin-layout .yb-summary-item {
    margin: 0;
    font-size: 1rem;
    line-height: 1.55;
    color: var(--yb-text);
}

.ybyra-admin-layout .yb-summary-item strong {
    font-weight: 800;
}

/* =========================================================
   TABELA RESPONSIVA
========================================================= */

.ybyra-admin-layout .yb-table-card {
    background: var(--yb-surface);
    border: 1px solid var(--yb-border);
    border-radius: var(--yb-radius-xl);
    box-shadow: var(--yb-shadow-soft);
    overflow: hidden;
}

.ybyra-admin-layout .yb-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0;
}

.ybyra-admin-layout .yb-table {
    width: 100%;
    min-width: 780px;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
}

.ybyra-admin-layout .yb-table thead th {
    position: sticky;
    top: 0;
    background: #f7fbfa;
    z-index: 1;
    text-align: left;
    font-size: 0.96rem;
    font-weight: 800;
    color: var(--yb-text);
    padding: 18px 20px;
    border-bottom: 1px solid var(--yb-border);
    white-space: nowrap;
}

.ybyra-admin-layout .yb-table tbody td {
    padding: 18px 20px;
    border-bottom: 1px solid #edf3f0;
    vertical-align: middle;
    color: var(--yb-text);
    font-size: 0.98rem;
}

.ybyra-admin-layout .yb-table tbody tr:last-child td {
    border-bottom: 0;
}

.ybyra-admin-layout .yb-table-name {
    font-weight: 800;
    font-size: 1rem;
    color: var(--yb-text);
}

.ybyra-admin-layout .yb-table-subtext {
    display: block;
    margin-top: 6px;
    color: var(--yb-text-soft);
    font-size: 0.94rem;
    line-height: 1.45;
}

.ybyra-admin-layout .yb-table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ybyra-admin-layout .yb-mini-btn {
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 16px;
    border: 1px solid var(--yb-border);
    background: #fff;
    color: var(--yb-text);
    font-weight: 800;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ybyra-admin-layout .yb-mini-btn-danger {
    background: #faf4f4;
    color: #8d2f2f;
    border-color: #edd4d4;
}

/* =========================================================
   METRICAS
========================================================= */

.ybyra-admin-layout .yb-metric-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--yb-gap-lg);
}

@media (min-width: 768px) {
    .ybyra-admin-layout .yb-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1180px) {
    .ybyra-admin-layout .yb-metric-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* =========================================================
   UTILITÁRIOS
========================================================= */

.ybyra-admin-layout .yb-stack {
    display: grid;
    gap: 16px;
}

.ybyra-admin-layout .yb-mt-sm { margin-top: 12px; }
.ybyra-admin-layout .yb-mt-md { margin-top: 18px; }
.ybyra-admin-layout .yb-mt-lg { margin-top: 24px; }

.ybyra-admin-layout .yb-text-soft {
    color: var(--yb-text-soft);
}

.ybyra-admin-layout .yb-empty {
    padding: 26px;
    border: 1px dashed var(--yb-border-strong);
    border-radius: var(--yb-radius-lg);
    background: #fbfdfc;
    color: var(--yb-text-soft);
    text-align: center;
    line-height: 1.6;
}

/* =========================================================
   MOBILE EXTRA
========================================================= */

@media (max-width: 860px) {
    .ybyra-admin-layout .form-grid {
        grid-template-columns: 1fr;
    }

    .ybyra-admin-layout .form-group-full {
        grid-column: auto;
    }
}

@media (max-width: 540px) {
    .ybyra-admin-layout .yb-page {
        padding-left: 14px;
        padding-right: 14px;
    }

    .ybyra-admin-layout .yb-card,
    .ybyra-admin-layout .yb-filter-card,
    .ybyra-admin-layout .yb-table-card,
    .ybyra-admin-layout .yb-hero {
        border-radius: 22px;
    }

    .ybyra-admin-layout .yb-btn,
    .ybyra-admin-layout .yb-input,
    .ybyra-admin-layout .yb-select,
    .ybyra-admin-layout .form-group input,
    .ybyra-admin-layout .form-group select,
    .ybyra-admin-layout .form-group textarea {
        min-height: 54px;
    }

    .ybyra-admin-layout .yb-table {
        min-width: 700px;
    }
}


/* =========================================================
   MÓDULO PRESERVADO: arandu(8).css
========================================================= */


/* =========================================================
   ARANDU · PADRÃO VISUAL DO ECOSSISTEMA YBYRÁ
   Arquivo escopado para não sobrescrever o base.html
========================================================= */

/* =========================================================
   HERO ARANDU
========================================================= */

.arandu-hero {
  position: relative;
  overflow: hidden;
}

.arandu-hero::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -80px;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(160, 215, 89, 0.22), rgba(65, 185, 181, 0.08), transparent 70%);
  pointer-events: none;
}

.arandu-hero-topline {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.arandu-role-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  background: rgba(2, 165, 136, 0.10);
  color: var(--verde-base);
  border: 1px solid rgba(2, 165, 136, 0.20);
  font-size: 0.84rem;
  font-weight: 900;
  white-space: nowrap;
}

.arandu-hero h1,
.arandu-hero p,
.arandu-sync-form,
.arandu-tabs {
  position: relative;
  z-index: 1;
}

.arandu-sync-form {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.arandu-sync-form span {
  color: var(--text);
  font-size: 0.96rem;
}

/* =========================================================
   ABAS
========================================================= */

.arandu-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.arandu-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 15px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.78);
  color: var(--verde-base);
  border: 1px solid var(--border);
  font-weight: 900;
  font-size: 0.94rem;
  box-shadow: 0 4px 12px rgba(23, 119, 98, 0.05);
}

.arandu-tabs a:hover {
  background: var(--bg-soft);
  border-color: var(--verde-soft);
  transform: translateY(-1px);
}

.arandu-tabs a.active {
  background: linear-gradient(135deg, var(--verde-base), var(--verde-principal));
  color: var(--white);
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(2, 165, 136, 0.20);
}

/* =========================================================
   INDICADORES
========================================================= */

.arandu-stats {
  margin-bottom: 18px;
}

.arandu-stats .stat-card {
  text-align: center;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.arandu-stats .stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(2, 165, 136, 0.22);
}

.arandu-stats .stat-card span,
.arandu-stats .stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.98rem;
  margin-bottom: 6px;
}

.arandu-stats .stat-card strong,
.arandu-stats .stat-value {
  display: block;
  font-size: clamp(2rem, 5vw, 2.8rem);
  line-height: 1;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 6px;
}

.arandu-stats .stat-card small {
  color: var(--muted);
  font-size: 0.9rem;
}

.arandu-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0 28px;
}

.arandu-kpi-card {
  background: linear-gradient(135deg, #ffffff 0%, #eefaf7 100%);
  border: 1px solid rgba(2, 165, 136, 0.22);
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 10px 24px rgba(23, 119, 98, 0.08);
}

.arandu-kpi-label {
  display: block;
  color: #007c68;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.arandu-kpi-number {
  display: block;
  color: #0f2340;
  font-size: 2rem;
  line-height: 1;
  font-weight: 900;
  margin-bottom: 6px;
}

.arandu-kpi-card p {
  margin: 0;
  color: #496070;
  font-size: 0.92rem;
}

@media (max-width: 900px) {
  .arandu-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .arandu-kpis {
    grid-template-columns: 1fr;
  }
}
/* =========================================================
   GRID / CARDS
========================================================= */

.arandu-main-grid {
  align-items: stretch;
  margin-bottom: 18px;
}

.card-header-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.card-header-line > div {
  min-width: 0;
}

.card-header-line .btn {
  flex-shrink: 0;
}

.professor-action-card {
  min-height: 100%;
}

.professor-safe-panel {
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(248, 216, 13, 0.16), rgba(65, 185, 181, 0.10));
  border: 1px solid rgba(248, 216, 13, 0.35);
  margin-bottom: 16px;
}

.professor-safe-panel strong {
  display: block;
  color: var(--verde-base);
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.professor-safe-panel p {
  color: var(--text);
  font-size: 0.94rem;
  margin-bottom: 8px;
}

/* =========================================================
   BOTÕES
========================================================= */

.arandu-hero .btn-primary,
.arandu-main-grid .btn-primary,
.card .btn-primary {
  background: linear-gradient(135deg, var(--verde-principal), var(--verde-base));
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.20);
  box-shadow: 0 10px 24px rgba(2, 165, 136, 0.22);
}

.arandu-hero .btn-primary:hover,
.arandu-main-grid .btn-primary:hover,
.card .btn-primary:hover {
  background: linear-gradient(135deg, var(--verde-base), var(--verde-principal));
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(2, 165, 136, 0.28);
}

.card .btn-secondary,
.arandu-main-grid .btn-secondary,
summary.btn-secondary {
  background: #F8FFFD;
  color: var(--verde-base);
  border: 1px solid var(--border-strong);
  box-shadow: 0 6px 16px rgba(23, 119, 98, 0.06);
}

.card .btn-secondary:hover,
.arandu-main-grid .btn-secondary:hover,
summary.btn-secondary:hover {
  background: var(--bg-soft-2);
  border-color: var(--verde-soft);
  transform: translateY(-1px);
}

/* =========================================================
   FORMULÁRIOS
========================================================= */

.form-grid {
  display: grid;
  gap: 16px;
}

.form-grid label {
  margin: 0;
}

.professor-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.professor-form-grid .form-actions {
  align-self: end;
}

.form-actions {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

textarea {
  min-height: 120px;
}

details {
  margin-bottom: 8px;
}

details summary {
  list-style: none;
  user-select: none;
  cursor: pointer;
  width: fit-content;
  margin-bottom: 10px;
}

details summary::-webkit-details-marker {
  display: none;
}

details[open] {
  padding: 12px;
  border-radius: 16px;
  background: #FBFDFC;
  border: 1px solid var(--border);
}

details[open] summary {
  margin-bottom: 12px;
}

td form {
  margin-top: 8px;
}

/* =========================================================
   FLASH MESSAGES
========================================================= */

.arandu-flash-list {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.arandu-flash {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}

.arandu-flash--success {
  background: var(--success-bg);
  color: var(--success-text);
  border-color: var(--success-border);
}

.arandu-flash--info {
  background: rgba(65, 185, 181, 0.12);
  color: var(--verde-base);
  border-color: rgba(65, 185, 181, 0.22);
}

.arandu-flash--warning {
  background: var(--warning-bg);
  color: var(--warning-text);
  border-color: var(--warning-border);
}

.arandu-flash--danger,
.arandu-flash--error {
  background: var(--danger-bg);
  color: var(--danger-text);
  border-color: var(--danger-border);
}

/* =========================================================
   MAPA / INFO
========================================================= */

.map-placeholder {
  padding: 20px;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(2, 165, 136, 0.08), rgba(160, 215, 89, 0.12)),
    #FFFFFF;
  border: 1px solid rgba(65, 185, 181, 0.20);
  margin-bottom: 18px;
}

.map-placeholder strong {
  display: block;
  font-size: 1.04rem;
  color: var(--text);
  margin-bottom: 8px;
}

.map-placeholder p {
  color: var(--muted);
}

.arandu-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.arandu-info-grid div {
  padding: 14px;
  border-radius: 16px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}

.arandu-info-grid strong {
  display: block;
  color: var(--verde-base);
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 4px;
}

.arandu-info-grid span {
  display: block;
  color: var(--text);
}

/* =========================================================
   TABELAS
========================================================= */

.arandu-table-wrap {
  border-radius: 20px;
}

.arandu-table-wrap.tall {
  max-height: 520px;
  overflow: auto;
}

.arandu-table-wrap table {
  min-width: 900px;
}

.arandu-table-wrap td,
.arandu-table-wrap th {
  vertical-align: top;
}

.arandu-table-wrap td .btn,
.arandu-table-wrap td button,
.arandu-table-wrap td summary {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 0.86rem;
}

/* =========================================================
   PILLS / STATUS
========================================================= */

.pill-success,
.prof-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid var(--success-border);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.prof-pill {
  background: rgba(65, 185, 181, 0.12);
  color: var(--verde-base);
  border-color: rgba(65, 185, 181, 0.20);
}

/* =========================================================
   BIBLIOTECA PROFESSOR
========================================================= */

.prof-sequence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 18px;
}

.prof-sequence-card {
  background: linear-gradient(180deg, #FFFFFF, #FAFDFC);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.prof-sequence-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(2, 165, 136, 0.24);
}

.prof-sequence-code,
.student-sequence-code {
  color: var(--verde-base);
  font-weight: 900;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.prof-sequence-card h3 {
  font-size: 1.12rem;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 10px;
}

.prof-sequence-card p {
  color: var(--text);
  font-size: 0.96rem;
  margin-bottom: 14px;
}

.prof-sequence-meta,
.student-sequence-meta,
.student-data-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.prof-card-actions {
  margin-top: 10px;
}

.prof-card-actions .btn {
  width: 100%;
}

.prof-empty,
.student-empty,
.empty-state,
.arandu-empty-box {
  padding: 26px;
  border-radius: 20px;
  background: #FBFDFC;
  border: 1px dashed var(--border-strong);
  color: var(--muted);
  text-align: center;
}

/* =========================================================
   ÁREA DO ESTUDANTE
========================================================= */

.student-sequence-grid,
.student-data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}

.student-sequence-card,
.student-data-card {
  background: linear-gradient(180deg, #FFFFFF, #FAFDFC);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.student-sequence-card:hover,
.student-data-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(2, 165, 136, 0.24);
}

.student-sequence-card h3,
.student-data-card h4 {
  color: var(--text);
  font-size: 1.15rem;
  line-height: 1.25;
  margin-bottom: 10px;
}

.student-sequence-card p,
.student-data-desc {
  color: var(--text);
  margin-bottom: 14px;
}

.student-data-location {
  color: var(--verde-base);
  font-weight: 900;
  margin-bottom: 8px;
}

.student-actions {
  margin-top: 12px;
}

.arandu-list {
  display: grid;
  gap: 12px;
}

.arandu-scroll-list {
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.arandu-list-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-radius: 18px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.arandu-list-item:hover {
  border-color: var(--verde-soft);
  background: var(--bg-soft);
}

.arandu-list-item strong {
  color: var(--text);
}

.arandu-list-item p {
  color: var(--muted);
  margin-top: 6px;
}

.arandu-list-item span {
  color: var(--verde-base);
  font-weight: 900;
  white-space: nowrap;
}

/* =========================================================
   ACESSIBILIDADE
========================================================= */

.arandu-tabs a:focus-visible,
.btn:focus-visible,
.prof-link:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(248, 216, 13, 0.75);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .arandu-tabs a,
  .btn,
  .stat-card,
  .prof-sequence-card,
  .student-sequence-card,
  .student-data-card,
  .prof-link {
    transition: none;
  }

  .arandu-tabs a:hover,
  .btn:hover,
  .stat-card:hover,
  .prof-sequence-card:hover,
  .student-sequence-card:hover,
  .student-data-card:hover {
    transform: none;
  }
}

/* =========================================================
   RESPONSIVO
========================================================= */

@media (max-width: 1160px) {
  .arandu-info-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .arandu-hero-topline {
    align-items: flex-start;
  }

  .arandu-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .arandu-tabs a {
    width: 100%;
  }

  .card-header-line {
    flex-direction: column;
    align-items: stretch;
  }

  .card-header-line .btn {
    width: 100%;
  }

  .arandu-sync-form {
    align-items: stretch;
  }

  .arandu-sync-form .btn {
    width: 100%;
  }

  .professor-form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .arandu-hero::after {
    width: 160px;
    height: 160px;
    right: -70px;
    top: -60px;
  }

  .arandu-tabs {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .arandu-tabs a {
    min-height: 44px;
  }

  .arandu-role-badge {
    width: 100%;
  }

  .arandu-stats .stat-card {
    min-height: 116px;
  }

  .prof-sequence-grid,
  .student-sequence-grid,
  .student-data-grid {
    grid-template-columns: 1fr;
  }

  .prof-sequence-card,
  .student-sequence-card,
  .student-data-card {
    padding: 18px;
  }

  .arandu-table-wrap table {
    min-width: 760px;
  }

  .coordenacao-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.coord-summary-card {
  background: linear-gradient(135deg, #ffffff, #eefaf7);
  border: 1px solid rgba(2, 165, 136, 0.25);
  border-radius: 24px;
  padding: 26px;
  min-height: 120px;

  display: flex;
  flex-direction: column;
  justify-content: center;

  transition: all 0.25s ease;
  cursor: pointer;
}

.coord-summary-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(23, 119, 98, 0.12);
}

.coord-summary-card span {
  font-size: 0.85rem;
  font-weight: 900;
  color: #007c68;
  text-transform: uppercase;
}

.coord-summary-card strong {
  font-size: 2.6rem;
  font-weight: 900;
  color: #0f2340;
}

.coord-summary-card small {
  font-size: 0.95rem;
  color: #496070;
}
}



/* =========================================================
   AJUSTES FINAIS DE COMPATIBILIDADE — NÃO REMOVER
   Protege o novo base.html contra conflitos de CSS legado e mantém módulos antigos.
========================================================= */
:root {
  --yb-secondary: var(--text-strong, #12342A);
  --yb-primary-light: rgba(2, 165, 136, 0.12);
  --yb-dark: #12342A;
  --yb-dark-bg: #EAF2EF;
  --container-width: var(--container, 1320px);
}

/* Garante que a topbar institucional do novo base prevaleça sobre layouts admin antigos. */
body > .page-bg > .topbar {
  background:
    linear-gradient(135deg, rgba(31, 94, 59, 0.98), rgba(2, 165, 136, 0.96)),
    var(--verde-institucional) !important;
  color: var(--white) !important;
  position: relative;
  display: block;
  padding: 0;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

body > .page-bg > .topbar .nav a,
body > .page-bg > .topbar .brand,
body > .page-bg > .topbar .brand-title,
body > .page-bg > .topbar .brand-subtitle,
body > .page-bg > .topbar .brand-tagline {
  color: rgba(255,255,255,0.98);
}

/* Evita que botões genéricos afetem elementos usados como abas/summary sem classe. */
summary {
  cursor: pointer;
}

/* Mantém tabelas usáveis no mobile sem estourar layout. */
.table-responsive,
.arandu-table-wrap,
.yb-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Compatibilidade com páginas que usam main/page-content/page-shell dentro do novo container. */
.main-content > .container,
.page-content,
.page-shell {
  min-width: 0;
}

/* Acessibilidade global de foco preservando identidade visual. */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(248, 216, 13, 0.75);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* =========================================================
   YBYRÁ — CAMADA DE COMPATIBILIDADE FINAL (NÃO REMOVE NADA)
   Objetivo: suportar templates refatorados sem regressão
========================================================= */

/* =========================
   LAYOUT / HEADERS
========================= */

.page-header-center {
  text-align: center;
}

.auth-card {
  max-width: 520px;
  margin-inline: auto;
}

/* =========================
   BOTÕES / AÇÕES
========================= */

.btn-full {
  width: 100%;
}

.actions-column {
  flex-direction: column;
  align-items: stretch;
}

.inline-form {
  display: inline;
}

/* =========================
   GRID EXTENDIDO
========================= */

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }
.col-span-4 { grid-column: span 4; }
.col-span-6 { grid-column: span 6; }
.col-span-12 { grid-column: span 12; }

/* =========================
   TEXTOS / UTILIDADES
========================= */

.text-center {
  text-align: center;
}

.text-pre-wrap {
  white-space: pre-wrap;
}

/* =========================
   USUÁRIOS
========================= */

.user-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-name {
  font-weight: 800;
  color: var(--text-strong);
}

.user-email {
  font-size: 0.88rem;
  color: var(--muted);
}

/* =========================
   IMAGENS / EVIDÊNCIAS
========================= */

.preview-img {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #fff;
}

.preview-img-media {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
}

/* =========================
   TAGS / STATUS
========================= */

.tag-success {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid var(--success-border);
}

.tag-warning {
  background: var(--warning-bg);
  color: var(--warning-text);
  border: 1px solid var(--warning-border);
}

.tag-danger {
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid var(--danger-border);
}

/* =========================
   SCORE BAR (RISCO / KPIs)
========================= */

.score-bar {
  height: 10px;
  width: 100%;
  border-radius: 999px;
  background: #e6f2ef;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2ecc71, #f1c40f, #e74c3c);
  transition: width 0.3s ease;
}

/* =========================
   CARD HEADER LINE
========================= */

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

/* =========================
   AJUSTES DE COMPATIBILIDADE
========================= */

.actions-row.compact {
  gap: 6px;
}

.empty-box {
  padding: 22px;
  border: 1px dashed var(--border);
  border-radius: 18px;
  text-align: center;
  color: var(--muted);
}

/* =========================
   RESPONSIVO EXTRA
========================= */

@media (max-width: 768px) {

  .actions-row {
    flex-direction: column;
    align-items: stretch;
  }

  .actions-row.compact {
    flex-direction: column;
  }

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

  .col-span-2,
  .col-span-3,
  .col-span-4,
  .col-span-6,
  .col-span-12 {
    grid-column: auto;
  }

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

/* ==========================================================
   RESPONSIVIDADE MOBILE/TABLET — YBYRÁ
   Ajustes apenas visuais. Não altera funcionalidades.
========================================================== */

@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-3,
  .form-grid-3,
  .filters-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-header {
    padding: 22px;
  }

  .stat-card {
    min-width: 0;
  }

  .stat-value {
    font-size: clamp(1.8rem, 5vw, 2.6rem);
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

@media (max-width: 768px) {
  .container,
  .page-shell,
  .page-content {
    padding-left: 12px;
    padding-right: 12px;
  }

  .grid,
  .grid-2,
  .grid-3,
  .grid-4,
  .form-grid,
  .form-grid-2,
  .form-grid-3,
  .detail-grid,
  .filters-grid {
    grid-template-columns: 1fr !important;
  }

  .page-header {
    padding: 18px;
    border-radius: 18px;
  }

  .page-header h1,
  .page-title {
    font-size: clamp(1.7rem, 8vw, 2.2rem);
  }

  .page-header p,
  .page-description,
  .page-subtitle {
    font-size: 0.95rem;
  }

  .stat-card {
    min-height: auto;
    padding: 16px;
  }

  .stat-value {
    font-size: clamp(1.8rem, 10vw, 2.4rem);
    line-height: 1.05;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .actions-row,
  .actions,
  .btn-row {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .btn,
  button,
  input[type="submit"],
  input[type="button"] {
    width: 100%;
    min-height: 46px;
  }

  .card,
  .form-card,
  .filters-card,
  .table-card {
    padding: 16px;
    border-radius: 18px;
  }

  .table-responsive,
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table,
  .table,
  .data-table {
    min-width: 720px;
  }

  input,
  select,
  textarea {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .page-header h1,
  .page-title {
    font-size: 1.65rem;
  }

  .section-title,
  .card-title {
    font-size: 1.25rem;
  }

  .stat-value {
    font-size: 2rem;
  }

  .help-text,
  .section-subtitle,
  .card-subtitle {
    font-size: 0.88rem;
  }

  .badge-row {
    gap: 6px;
  }

  .badge {
    font-size: 0.72rem;
    padding: 5px 8px;
  }
}

/* =========================================================
   HOTFIX MOBILE/TABLET — APRESENTAÇÃO YBYRÁ
   Seguro: apenas layout, sem alterar funcionalidades
========================================================= */

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.container,
.main-content,
.page-bg,
.page-header,
.card,
.stat-card,
.form-card,
.filters-card,
.table-card,
.chart-box,
.map-container {
  max-width: 100%;
  min-width: 0;
}

.topbar-inner {
  align-items: flex-start;
}

.nav {
  width: 100%;
  justify-content: flex-start;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 0 4px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.nav a {
  flex: 0 0 auto;
}

.grid,
.grid-2,
.grid-3,
.grid-4 {
  min-width: 0;
}

.chart-box,
.chart-box-lg {
  position: relative;
  width: 100%;
  min-height: 320px;
  overflow: hidden;
}

.chart-box canvas,
.chart-box-lg canvas {
  width: 100% !important;
  max-width: 100% !important;
}

.table-wrap,
.table-responsive,
.table-wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-wrap table,
.table-responsive table,
.table-wrapper table,
table {
  width: 100%;
}

.map-container,
#apaDashboardMap {
  width: 100%;
  min-height: 360px;
  overflow: hidden;
  border-radius: 20px;
}

@media (max-width: 1024px) {
  .topbar-inner {
    padding: 20px 16px;
  }

  .brand {
    flex: 1 1 100%;
    min-width: 0;
  }

  .grid-4,
  .grid-3,
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 768px) {
  .topbar-inner {
    padding: 18px 14px;
    gap: 14px;
  }

  .brand {
    align-items: flex-start;
    gap: 12px;
  }

  .brand-logo-wrap {
    width: 58px;
    height: 58px;
  }

  .brand-logo {
    width: 50px;
    height: 50px;
  }

  .brand-title {
    font-size: 1.45rem;
  }

  .brand-subtitle {
    font-size: 0.92rem;
  }

  .brand-tagline {
    font-size: 0.84rem;
  }

  .nav {
    margin-left: -4px;
    margin-right: -4px;
  }

  .nav a {
    min-height: 40px;
    padding: 9px 13px;
    font-size: 0.88rem;
  }

  .main-content {
    padding-top: 18px;
  }

  .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  .page-header {
    padding: 20px;
    border-radius: 22px;
  }

  .page-header h1,
  .page-title {
    font-size: 2rem;
  }

  .card,
  .form-card,
  .filters-card,
  .table-card,
  .stat-card {
    padding: 18px;
    border-radius: 20px;
  }

  .grid,
  .grid-2,
  .grid-3,
  .grid-4,
  .form-grid,
  .filters-grid,
  .detail-grid {
    grid-template-columns: 1fr !important;
  }

  .chart-box,
  .chart-box-lg {
    min-height: 300px;
  }

  .actions-row,
  .actions,
  .btn-row {
    width: 100%;
    align-items: stretch;
  }

  .btn,
  button,
  input[type="submit"],
  input[type="button"] {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .brand {
    flex-direction: row;
  }

  .brand-title {
    font-size: 1.28rem;
  }

  .brand-subtitle {
    font-size: 0.86rem;
  }

  .brand-tagline {
    display: none;
  }

  .page-header h1,
  .page-title {
    font-size: 1.72rem;
  }

  .section-title,
  .card-title {
    font-size: 1.35rem;
  }

  .chart-box,
  .chart-box-lg {
    min-height: 280px;
  }

  .stat-value {
    font-size: 2rem;
  }
}

/* =========================================================
   HOTFIX LOGIN MOBILE — APRESENTAÇÃO
   Reduz escala visual sem alterar funcionalidade
========================================================= */

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

  .main-content {
    padding-top: 14px !important;
  }

  .container {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .page-header {
    padding: 18px 16px !important;
    margin-bottom: 16px !important;
    border-radius: 22px !important;
  }

  .page-header-kicker,
  .kicker,
  .eyebrow,
  .page-kicker {
    font-size: 0.72rem !important;
    letter-spacing: 1.2px !important;
    margin-bottom: 6px !important;
  }

  .page-header h1,
  .page-title {
    font-size: 1.85rem !important;
    line-height: 1.08 !important;
    margin-bottom: 8px !important;
  }

  .page-header p,
  .page-description,
  .page-subtitle {
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
  }

  .card,
  .form-card,
  .filters-card,
  .table-card,
  .auth-card {
    padding: 18px 16px !important;
    border-radius: 22px !important;
  }

  .auth-card {
    max-width: 100% !important;
    margin-inline: auto !important;
  }

  .card-title,
  .section-title,
  .form-card h2,
  .auth-card h2 {
    font-size: 1.55rem !important;
    line-height: 1.12 !important;
    margin-bottom: 12px !important;
  }

  label,
  .form-label {
    font-size: 0.96rem !important;
    margin-bottom: 6px !important;
  }

  .field,
  .form-field,
  .form-group {
    gap: 6px !important;
  }

  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="date"],
  input[type="time"],
  input[type="month"],
  input[type="search"],
  select,
  textarea,
  .form-control {
    min-height: 48px !important;
    padding: 11px 13px !important;
    border-radius: 14px !important;
    font-size: 0.98rem !important;
  }

  input:focus,
  select:focus,
  textarea:focus,
  .form-control:focus {
    box-shadow: 0 0 0 3px rgba(2, 165, 136, 0.18) !important;
    outline: none !important;
  }

  a:focus-visible,
  button:focus-visible,
  .btn:focus-visible,
  input:focus-visible,
  select:focus-visible,
  textarea:focus-visible {
    outline: none !important;
  }

  .btn,
  button,
  input[type="submit"],
  input[type="button"] {
    min-height: 48px !important;
    padding: 11px 14px !important;
    font-size: 0.96rem !important;
    border-radius: 16px !important;
  }

  .help-text,
  small,
  .text-muted,
  .text-soft {
    font-size: 0.86rem !important;
  }

  .institutional-footer {
    margin-top: 22px !important;
    padding-bottom: 18px !important;
    font-size: 0.82rem !important;
  }
}

/* =========================================================
   HOTFIX TOPO MOBILE — REDUZ FAIXA VERDE
========================================================= */

@media (max-width: 640px) {
  .topbar {
    min-height: 0 !important;
    padding: 0 !important;
  }

  .topbar-inner {
    padding: 8px 12px !important;
    min-height: 52px !important;
    gap: 8px !important;
  }

  .brand-logo-wrap {
    width: 42px !important;
    height: 42px !important;
  }

  .brand-logo {
    width: 36px !important;
    height: 36px !important;
  }

  .brand-title {
    font-size: 1.05rem !important;
    line-height: 1.05 !important;
  }

  .brand-subtitle,
  .brand-tagline {
    display: none !important;
  }

  .nav {
    padding: 4px 0 0 !important;
    gap: 6px !important;
  }

  .nav a {
    min-height: 34px !important;
    padding: 7px 10px !important;
    font-size: 0.78rem !important;
  }
}

/* =========================================================
   HOTFIX TOPO MOBILE — REDUZ FAIXA VERDE
========================================================= */

@media (max-width: 640px) {
  .topbar {
    min-height: 0 !important;
    padding: 0 !important;
  }

  .topbar-inner {
    padding: 8px 12px !important;
    min-height: 52px !important;
    gap: 8px !important;
  }

  .brand-logo-wrap {
    width: 42px !important;
    height: 42px !important;
  }

  .brand-logo {
    width: 36px !important;
    height: 36px !important;
  }

  .brand-title {
    font-size: 1.05rem !important;
    line-height: 1.05 !important;
  }

  .brand-subtitle,
  .brand-tagline {
    display: none !important;
  }

  .nav {
    padding: 4px 0 0 !important;
    gap: 6px !important;
  }

  .nav a {
    min-height: 34px !important;
    padding: 7px 10px !important;
    font-size: 0.78rem !important;
  }
}

/* =========================================================
   TOPO MOBILE COMPACTO — SEM PERDER NAVEGAÇÃO
   Mantém todos os links do ecossistema em scroll horizontal
========================================================= */

@media (max-width: 640px) {
  .topbar {
    padding: 0 !important;
    overflow: hidden !important;
  }

  .topbar-inner {
    padding: 10px 12px 8px !important;
    gap: 8px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .brand {
    min-width: 0 !important;
    width: 100% !important;
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
  }

  .brand-logo-wrap {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
  }

  .brand-logo {
    width: 36px !important;
    height: 36px !important;
  }

  .brand-title {
    font-size: 1.08rem !important;
    line-height: 1.05 !important;
    margin: 0 !important;
  }

  .brand-subtitle {
    font-size: 0.78rem !important;
    line-height: 1.15 !important;
    margin: 2px 0 0 !important;
  }

  .brand-tagline {
    display: none !important;
  }

  .nav {
    width: 100% !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    padding: 4px 0 2px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: thin !important;
  }

  .nav a {
    flex: 0 0 auto !important;
    min-height: 32px !important;
    padding: 6px 10px !important;
    font-size: 0.76rem !important;
    border-radius: 999px !important;
    white-space: nowrap !important;
  }

  .main-content {
    padding-top: 12px !important;
  }
}


/* =========================================================
   HOTFIX GRÁFICOS RESPONSIVOS — YBYRÁ
   Mantém dados e lógica; corrige altura/largura no mobile
========================================================= */

.chart-box,
.chart-container,
.dashboard-chart,
.graph-box {
  position: relative !important;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 300px !important;
  height: 300px !important;
  overflow: hidden !important;
}

.chart-box canvas,
.chart-container canvas,
.dashboard-chart canvas,
.graph-box canvas,
canvas {
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  display: block !important;
}

@media (max-width: 920px) {
  .chart-box,
  .chart-container,
  .dashboard-chart,
  .graph-box {
    min-height: 280px !important;
    height: 280px !important;
  }
}

@media (max-width: 640px) {
  .chart-box,
  .chart-container,
  .dashboard-chart,
  .graph-box {
    min-height: 240px !important;
    height: 240px !important;
    margin-top: 14px !important;
  }
}

@media (max-width: 640px) {
  .chart-box {
    height: 260px;
    min-height: 260px;
  }

  .chart-box canvas {
    max-height: 260px;
  }
}