:root {
    --pantone-540c: #003057;
    --pantone-540c-dark: #00213D;
    --pantone-540c-soft: #6f94ab;
    --pantone-540c-glow: rgba(49, 93, 123, 0.16);

    --bg-main: #eef3f8;
    --bg-card: #ffffff;
    --bg-card-soft: #f7fafc;
    --bg-card-blue: #f4f8fb;
    --bg-card-green: #f4faf7;
    --bg-card-amber: #fffaf2;
    --bg-card-rose: #fbf7fa;

    --border-soft: #e5e7eb;
    --text-main: #0f172a;
    --text-soft: #64748b;
    --sidebar-width: 290px;

    --radius-xl: 24px;
    --radius-lg: 18px;
    --shadow-lg: 0 18px 45px rgba(15, 23, 42, 0.10);
    --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
    --shadow-sm: 0 6px 18px rgba(15, 23, 42, 0.06);
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background:
        radial-gradient(circle at top right, rgba(111, 148, 171, 0.10), transparent 22%),
        linear-gradient(180deg, #f7fafd 0%, #eef3f8 100%);
    color: var(--text-main);
}

a {
    text-decoration: none;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
}

.login-card {
    width: 100%;
    max-width: 1120px;
    background: rgba(255,255,255,0.9);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(255,255,255,0.75);
    backdrop-filter: blur(8px);
}

.login-brand {
    background: linear-gradient(180deg, #315d7b 0%, #294f69 45%, #223f54 100%);
    color: #fff;
    padding: 48px;
    display: flex;
    align-items: center;
}

.login-brand h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 16px;
}

.login-brand p {
    color: rgba(255,255,255,0.75);
    line-height: 1.7;
}

.login-form-side {
    padding: 48px 42px;
}

.login-logo {
    width: 62px;
    height: 62px;
    border-radius: 18px;
    background: rgba(49, 93, 123, 0.10);
    color: var(--pantone-540c);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 18px;
}

.input-group-modern .input-group-text {
    background: #fff;
    border-right: 0;
    border-radius: 14px 0 0 14px;
    border-color: var(--border-soft);
    color: var(--text-soft);
}

.input-group-modern .form-control,
.input-modern {
    height: 50px;
    border-color: var(--border-soft);
    border-radius: 14px;
    box-shadow: none;
}

.input-group-modern .form-control {
    border-left: 0;
    border-radius: 0 14px 14px 0;
}

.btn-premium {
    border: 0;
    border-radius: 14px;
    padding: 12px 18px;
    font-weight: 700;
    transition: all 0.22s ease;
    box-shadow: var(--shadow-sm);
}

.btn-primary-premium {
    background: linear-gradient(135deg, var(--pantone-540c), var(--pantone-540c-soft));
    color: #fff;
}

.btn-primary-premium:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 12px 24px var(--pantone-540c-glow);
}

.btn-light-premium {
    background: #fff;
    color: var(--text-main);
    border: 1px solid var(--border-soft);
}

.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: #4A5E7B;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 12px 0 35px rgba(2, 16, 29, 0.18);
}

.sidebar-header {
    padding: 22px 18px 18px;
    border-bottom: 1px solid rgba(0,0,0,0.10);
}

.brand-title {
    font-size: 1.08rem;
    font-weight: 700;
}

.sidebar-menu-area {
    padding: 16px 12px 18px;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.menu a {
    display: flex;
    align-items: center;
    gap: 14px;
    color: rgba(255,255,255,0.88);
    padding: 13px 14px;
    min-height: 52px;
    border-radius: 16px;
    transition: all 0.24s ease;
}

.menu a:hover,
.menu a.active {
    background: rgba(0,0,0,0.10);
    color: #ffffff;
}

.sidebar-user {
    padding: 14px 12px 16px;
    border-top: 1px solid rgba(0,0,0,0.10);
}

.user-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 18px;
    background: rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.06);
}

.avatar {
    width: 46px;
    height: 46px;
    min-width: 46px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(0,0,0,0.20);
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
}

.user-role {
    margin: 4px 0 0;
    font-size: 0.77rem;
    color: rgba(255,255,255,0.65);
}

.content {
    flex: 1;
    min-width: 0;
    padding: 26px;
}

.topbar-premium {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
    padding: 22px 24px;
    background: rgba(255,255,255,0.72);
    border: 1px solid rgba(255,255,255,0.45);
    border-radius: 24px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
}

.topbar-title {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
}

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

.card-premium {
    border: 1px solid rgba(255,255,255,0.65);
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(252,253,255,0.96));
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.stat-card {
    padding: 24px;
    min-height: 155px;
}

.stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.stat-badge {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.stat-badge.blue {
    background: rgba(88, 128, 155, 0.12);
    color: #3b6685;
}

.stat-badge.green {
    background: rgba(108, 159, 129, 0.14);
    color: #44785a;
}

.stat-badge.amber {
    background: rgba(224, 177, 86, 0.14);
    color: #9b6d15;
}

.stat-badge.rose {
    background: rgba(183, 134, 162, 0.14);
    color: #8b5b79;
}

.stat-trend {
    font-size: 0.82rem;
    font-weight: 700;
    color: #3f6d57;
    background: #e8f5ee;
    padding: 6px 10px;
    border-radius: 999px;
}

.stat-label {
    font-size: 0.93rem;
    color: var(--text-soft);
    margin-bottom: 10px;
}

.stat-value {
    margin: 0;
    font-size: 2.2rem;
    line-height: 1;
    font-weight: 800;
}

.section-card {
    padding: 24px;
}

.section-title {
    margin: 0;
    font-size: 1.12rem;
    font-weight: 700;
}

.section-subtitle {
    margin: 4px 0 0;
    color: var(--text-soft);
    font-size: 0.9rem;
}

.table-modern-wrapper {
    border: 1px solid #edf2f7;
    border-radius: 20px;
    overflow: hidden;
    background: #fff;
}

.table-modern thead th {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    color: #334155;
    font-size: 0.84rem;
    font-weight: 700;
    text-transform: uppercase;
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 18px;
    white-space: nowrap;
}

.table-modern tbody td {
    padding: 16px 18px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.92rem;
    vertical-align: middle;
}

.badge-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.badge-ativo {
    background: #e9f6ef;
    color: #3f7a59;
}

.badge-inativo {
    background: #fdf3df;
    color: #a16d16;
}

.badge-admin {
    background: #e8f1fb;
    color: #426c8d;
}

.badge-user {
    background: #f4f7fb;
    color: #55657c;
}

.profile-preview {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid #eef3f8;
}

.empty-box {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-soft);
}

@media (max-width: 991px) {
    .content {
        padding: 18px;
    }
}

/* SGL global table/action overrides */
.data-table th,.users-table th,.calls-table th,.logs-table th,.table-modern thead th{background:#4A5E7B!important;color:#fff!important;border-bottom-color:#3d4f68!important}
.btn-act.btn-view{background:#0EA5E9!important;color:#fff!important}
.btn-act.btn-edit{background:#F59E0B!important;color:#fff!important}
.btn-act.btn-del{background:#EF4444!important;color:#fff!important}
.btn-act i{color:#fff!important}

/* SGL request: filters and list appearance overrides 20260424 */
.data-table th,.users-table th,.calls-table th,.logs-table th,.table-modern thead th{background:#4A5E7B!important;color:#fff!important;border-bottom-color:#3d4f68!important}
.btn-act.btn-view,.action-view{background:#0EA5E9!important;color:#fff!important;border-radius:0!important}
.btn-act.btn-edit,.action-edit{background:#F59E0B!important;color:#fff!important;border-radius:0!important}
.btn-act.btn-del,.action-delete{background:#EF4444!important;color:#fff!important;border-radius:0!important}
.btn-act i,.action-view i,.action-edit i,.action-delete i{color:#fff!important}


/* === SGL: responsividade geral para PC/notebook, tablet e celular === */
img, video, canvas, svg {
    max-width: 100%;
    height: auto;
}

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

.data-table,
.table-modern {
    min-width: max-content;
}

@media (max-width: 1200px) {
    .content {
        padding: 20px !important;
    }
}

@media (max-width: 992px) {
    .app-layout {
        display: block !important;
        height: auto !important;
        min-height: 100vh !important;
        overflow: visible !important;
        padding-top: 55px !important;
    }

    .sidebar {
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        max-height: 45vh !important;
        overflow-y: auto !important;
        border-right: 0 !important;
        border-bottom: 1px solid rgba(255,255,255,.12) !important;
    }

    .content {
        margin-left: 0 !important;
        width: 100% !important;
        height: auto !important;
        min-height: calc(100vh - 55px) !important;
        overflow: visible !important;
        padding: 16px !important;
    }

    .page-header,
    .header-actions,
    .pagination-wrap,
    .topbar-premium {
        align-items: flex-start !important;
        flex-direction: column !important;
    }

    .header-actions,
    .header-actions .counter-box,
    .header-actions .btn-primary,
    .header-actions .btn-export {
        width: 100% !important;
    }

    .filters-grid,
    .filters-grid.filters-small,
    .filters-grid.filters-product,
    .filters-grid.filters-move {
        grid-template-columns: 1fr !important;
    }

    .btn-filter,
    .btn-clear,
    .btn-primary,
    .btn-export,
    .filter-input {
        width: 100% !important;
    }
}

@media (max-width: 576px) {
    body {
        overflow-x: hidden;
    }

    .navbar-fixo {
        padding: 0 10px !important;
    }

    .section-card,
    .card-premium,
    .topbar-premium {
        padding: 14px !important;
    }

    .page-title,
    .topbar-title {
        font-size: 1.25rem !important;
    }

    .page-subtitle,
    .topbar-subtitle {
        font-size: .88rem !important;
    }

    .pagination {
        width: 100% !important;
        overflow-x: auto !important;
        padding-bottom: 4px !important;
    }
}


/* === SGL 2026-05-04: padrão global Excel verde e tabelas sem quebra === */
:root{
    --sgl-btn-excel:#1F8A5B;
    --sgl-btn-excel-hover:#176b46;
}
.content .btn-export,
.content a.btn-export,
.content button.btn-export,
.content .header-actions .btn-export{
    background-color:var(--sgl-btn-excel)!important;
    border-color:var(--sgl-btn-excel)!important;
    color:#ffffff!important;
}
.content .btn-export:hover,
.content a.btn-export:hover,
.content button.btn-export:hover,
.content .header-actions .btn-export:hover{
    background-color:var(--sgl-btn-excel-hover)!important;
    border-color:var(--sgl-btn-excel-hover)!important;
    color:#ffffff!important;
}
.content .btn-export i,
.content a.btn-export i,
.content button.btn-export i{
    color:#ffffff!important;
}
.content table,
.content .table,
.content .data-table,
.content .calls-table,
.content .admin-audit-table,
.content .table-modern,
.content .lista-temp-table{
    table-layout:auto!important;
}
.content table th,
.content table td,
.content .table th,
.content .table td,
.content .data-table th,
.content .data-table td,
.content .calls-table th,
.content .calls-table td,
.content .admin-audit-table th,
.content .admin-audit-table td,
.content .table-modern th,
.content .table-modern td,
.content .lista-temp-table th,
.content .lista-temp-table td{
    white-space:nowrap!important;
    word-break:normal!important;
    overflow-wrap:normal!important;
}
.content .table-wrap,
.content .table-shell,
.content .table-responsive,
.content .table-modern-wrapper,
.content .admin-audit-table-wrap,
.content .calls-table-wrap,
.content .lista-temp-wrap,
.content .sgl-table-wrap{
    overflow-x:auto!important;
    max-width:100%!important;
}


/* === SGL 2026-05-04: pílulas padronizadas para Status, Situação e Ação === */
:root{
    --sgl-pill-success-bg:#1F8A5B;
    --sgl-pill-success-text:#ffffff;
    --sgl-pill-info-bg:#DBEAFE;
    --sgl-pill-info-text:#1E40AF;
    --sgl-pill-danger-bg:#FEE2E2;
    --sgl-pill-danger-text:#991B1B;
    --sgl-pill-warning-bg:#FEF3C7;
    --sgl-pill-warning-text:#92400E;
    --sgl-pill-neutral-bg:#E8EFF7;
    --sgl-pill-neutral-text:#142D47;
}
.content .badge-log,
.content .badge-pill,
.content .badge-status,
.content .status-badge,
.content .status-pill,
.content .status-tag,
.content .audit-badge,
.content .admin-badge,
.content .notif-badge,
.content .mail-badge,
.content .badge,
.content [class*="badge-"][class*="status"],
.content [class*="status-"][class*="badge"]{
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:6px!important;
    min-width:98px!important;
    min-height:24px!important;
    padding:4px 14px!important;
    border-radius:999px!important;
    border:0!important;
    box-shadow:none!important;
    font-size:11px!important;
    line-height:1!important;
    font-weight:900!important;
    text-transform:uppercase!important;
    letter-spacing:.04em!important;
    white-space:nowrap!important;
}
.content .badge-ativo,
.content .badge-sucesso,
.content .badge-concluido,
.content .badge-vigente,
.content .badge-sent,
.content .status-ativo,
.content .status-vigente,
.content .audit-badge.success,
.content .admin-badge.success,
.content .tipo-sucesso{
    background:var(--sgl-pill-success-bg)!important;
    color:var(--sgl-pill-success-text)!important;
}
.content .badge-inativo,
.content .badge-falha,
.content .badge-cancelado,
.content .badge-vencido,
.content .badge-unread,
.content .status-inativo,
.content .status-vencido,
.content .audit-badge.danger,
.content .admin-badge.danger,
.content .tipo-erro,
.content .text-bg-danger{
    background:var(--sgl-pill-danger-bg)!important;
    color:var(--sgl-pill-danger-text)!important;
}
.content .badge-logout,
.content .badge-programado,
.content .badge-read,
.content .badge-admin,
.content .badge-user,
.content .badge-level,
.content .badge-destino,
.content .audit-badge.primary,
.content .admin-badge.info,
.content .tipo-info,
.content .text-bg-primary{
    background:var(--sgl-pill-info-bg)!important;
    color:var(--sgl-pill-info-text)!important;
}
.content .audit-badge.warning,
.content .admin-badge.warning,
.content .tipo-alerta,
.content .status-tag{
    background:var(--sgl-pill-warning-bg)!important;
    color:var(--sgl-pill-warning-text)!important;
}
.content .admin-audit-table thead th{
    text-align:center!important;
}

/* === SGL 2026-05-04: ajuste Logs Administrativos - alinhamento horizontal e linhas verticais === */
.content .admin-audit-table th,
.content .admin-audit-table td{
    border-right:1px solid #D9E2EC!important;
}
.content .admin-audit-table th:first-child,
.content .admin-audit-table td:first-child{
    border-left:1px solid #D9E2EC!important;
}
.content .admin-audit-table td:nth-child(1),
.content .admin-audit-table td:nth-child(2),
.content .admin-audit-table td:nth-child(4),
.content .admin-audit-table td:nth-child(7){
    text-align:center!important;
    vertical-align:top!important;
}
.content .admin-audit-table td:nth-child(4) .audit-badge{
    margin-left:auto!important;
    margin-right:auto!important;
}

/* === SGL 004: zoom em tablet + filtros/botões sem quebra ===
   Mantém pesquisa, filtros e ações na mesma linha em tablets/notebooks/PCs.
   Quando não houver largura suficiente, a linha ganha rolagem horizontal
   em vez de quebrar os botões/filtros para baixo. */
@media (min-width: 768px) {
    html body .filters-grid,
    html body .filters-grid.filters-small,
    html body .filters-grid.filters-product,
    html body .filters-grid.filters-move,
    html body .filter-card form.filters-grid,
    html body .admin-audit-filter form,
    html body .sgl-filter,
    html body form[class*="filter"],
    html body form[class*="search"] {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: flex-end !important;
        gap: 12px !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        padding-bottom: 6px !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-gutter: stable !important;
    }

    html body .filters-grid > *,
    html body .filter-card form.filters-grid > *,
    html body .admin-audit-filter form > *,
    html body .sgl-filter > *,
    html body form[class*="filter"] > *,
    html body form[class*="search"] > * {
        flex: 0 0 auto !important;
        min-width: 150px !important;
        max-width: none !important;
    }

    html body .filters-grid > .filter-field:first-child,
    html body .filter-card form.filters-grid > .filter-field:first-child,
    html body .admin-audit-filter form > div:first-child,
    html body .sgl-filter > div:first-child,
    html body form[class*="filter"] > div:first-child,
    html body form[class*="search"] > div:first-child {
        flex-basis: 260px !important;
        min-width: 240px !important;
    }

    html body .filters-grid .filter-input,
    html body .filter-card form.filters-grid .filter-input,
    html body .admin-audit-filter .form-control,
    html body .admin-audit-filter .form-select,
    html body .sgl-filter .form-control,
    html body .sgl-filter .form-select,
    html body form[class*="filter"] .form-control,
    html body form[class*="filter"] .form-select,
    html body form[class*="search"] .form-control,
    html body form[class*="search"] .form-select {
        width: 100% !important;
        min-width: 0 !important;
    }

    html body .filters-grid .btn,
    html body .filters-grid button,
    html body .filters-grid a,
    html body .filter-card form.filters-grid .btn,
    html body .admin-audit-filter form .btn,
    html body .sgl-filter .btn,
    html body form[class*="filter"] .btn,
    html body form[class*="search"] .btn {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: max-content !important;
        white-space: nowrap !important;
    }

    html body .header-actions,
    html body .sgl-actions,
    html body .notif-actions,
    html body .notif-card-actions,
    html body .btn-row,
    html body .pagination,
    html body .admin-audit-pages,
    html body .admin-audit-pagination,
    html body .pagination-wrap,
    html body .d-flex.flex-wrap {
        flex-wrap: nowrap !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
    }

    html body .header-actions > *,
    html body .sgl-actions > *,
    html body .notif-actions > *,
    html body .notif-card-actions > *,
    html body .btn-row > *,
    html body .pagination > *,
    html body .admin-audit-pages > *,
    html body .admin-audit-pagination > *,
    html body .d-flex.flex-wrap > * {
        flex: 0 0 auto !important;
        width: auto !important;
        white-space: nowrap !important;
    }

    html body .btn,
    html body button[class*="btn"],
    html body a[class*="btn"] {
        white-space: nowrap !important;
    }
}


/* === SGL 2026-05-11: rolagem única no conteúdo === */
html,
body{
    height:100%!important;
    overflow:hidden!important;
}
.app-layout{
    height:100vh!important;
    min-height:0!important;
    overflow:hidden!important;
}
.content{
    height:calc(100vh - 50px)!important;
    min-height:0!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
}
.sidebar{
    max-height:calc(100vh - 50px)!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
}
@media(max-width:576px){
    .app-layout{height:100vh!important;overflow:hidden!important;}
    .content{height:calc(100vh - 50px)!important;overflow-y:auto!important;overflow-x:hidden!important;}
}
