/* ========================================================================== 
   SGCM — ATUALIZAÇÃO VISUAL 4.0
   Camada de apresentação isolada. Não altera regras de negócio ou eventos.
   ========================================================================== */

:root {
    --sgcm-navy-950: #03263d;
    --sgcm-navy-900: #063451;
    --sgcm-navy-800: #0a4461;
    --sgcm-teal-600: #0aa99f;
    --sgcm-teal-500: #12b9ad;
    --sgcm-cyan-500: #10b7e9;
    --sgcm-surface: #ffffff;
    --sgcm-canvas: #f6f8fb;
    --sgcm-border: #e8edf3;
    --sgcm-text: #14213a;
    --sgcm-muted: #7b8497;
    --sidebar-width: 246px;
    --header-height: 72px;
}

/* ============================= LOGIN ===================================== */
.login-screen {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 56%) minmax(430px, 44%);
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
    background: #eef5f7;
    isolation: isolate;
}

.login-background {
    position: absolute;
    inset: 0;
    z-index: -2;
    background: url('assets/brand/sgcm-login-background.png') center center / cover no-repeat;
}

.login-background::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255,255,255,.08) 0%, rgba(255,255,255,0) 52%, rgba(0,31,57,.05) 100%);
    pointer-events: none;
}

.login-left {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-width: 0;
    padding: clamp(38px, 5vh, 64px) 32px clamp(32px, 5vh, 58px) clamp(80px, 12vw, 230px);
}

.login-left-content {
    display: flex;
    flex-direction: column;
    width: min(100%, 500px);
    min-height: min(830px, calc(100vh - 76px));
}

.login-brand-logo {
    display: block;
    width: 252px;
    height: 120px;
    object-fit: contain;
    object-position: left center;
    margin: 0 0 clamp(42px, 7vh, 72px) -11px;
}

.login-hero-copy h1 {
    max-width: 520px;
    margin: 0;
    color: #10213c;
    font-size: clamp(34px, 3vw, 52px);
    line-height: 1.12;
    letter-spacing: -.045em;
    font-weight: 760;
}

.login-hero-copy h1 span { color: var(--sgcm-teal-600); }
.login-hero-accent {
    width: 58px;
    height: 4px;
    margin: 24px 0 22px;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--sgcm-teal-500), var(--sgcm-cyan-500));
}
.login-hero-copy > p {
    max-width: 410px;
    color: #556175;
    font-size: 15px;
    line-height: 1.72;
}

.login-benefits {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 25px 34px;
    margin-top: 41px;
}
.login-benefit {
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.login-benefit-icon {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    border-radius: 16px;
    color: var(--sgcm-teal-600);
    background: linear-gradient(145deg, rgba(18,185,173,.13), rgba(16,183,233,.07));
    font-size: 22px;
}
.login-benefit span:last-child { min-width: 0; }
.login-benefit strong {
    display: block;
    margin-bottom: 5px;
    color: #16243a;
    font-size: 14px;
    font-weight: 700;
}
.login-benefit small {
    display: block;
    color: #70798a;
    font-size: 11px;
    line-height: 1.55;
}

.login-compliance {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 13px;
    width: min(100%, 410px);
    margin-top: auto;
    padding: 13px 17px;
    border: 1px solid rgba(18,185,173,.18);
    border-radius: 12px;
    background: rgba(255,255,255,.34);
    backdrop-filter: blur(8px);
    box-shadow: 0 10px 28px rgba(20,53,74,.04);
}
.login-compliance-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(145deg, var(--sgcm-teal-500), var(--sgcm-cyan-500));
    box-shadow: 0 7px 18px rgba(18,185,173,.24);
}
.login-compliance strong {
    display: block;
    color: #27354a;
    font-size: 11px;
    font-weight: 700;
}
.login-compliance small {
    display: block;
    margin-top: 3px;
    color: #758093;
    font-size: 9.5px;
}

.login-right {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 0;
    min-height: 100vh;
    padding: 34px clamp(34px, 6vw, 104px) 34px 28px;
    border: 0;
    background: transparent;
    backdrop-filter: none;
}

.login-card {
    position: relative;
    width: min(100%, 420px);
    max-width: 420px;
    padding: 35px 36px 24px;
    overflow: visible;
    border: 1px solid rgba(225,231,239,.95);
    border-radius: 20px;
    background: rgba(255,255,255,.985);
    box-shadow: 0 26px 70px rgba(0, 32, 61, .25), 0 2px 10px rgba(0, 32, 61, .08);
}
.login-card::before { display: none; }
.login-card-header { margin-bottom: 22px; text-align: center; }
.login-card-logo {
    display: block;
    width: 70px;
    height: 61px;
    margin: 0 auto 12px;
    object-fit: contain;
    filter: drop-shadow(0 9px 16px rgba(12,179,169,.18));
}
.login-card-title {
    margin: 0 0 5px;
    color: #14213a;
    font-size: 21px;
    line-height: 1.25;
    letter-spacing: -.025em;
    font-weight: 750;
}
.login-card-subtitle { color: #778094; font-size: 12px; }

.login-card .lgpd-notice {
    min-height: 58px;
    margin: 0 0 20px;
    padding: 10px 12px;
    gap: 10px;
    border: 1px solid rgba(18,185,173,.2);
    border-radius: 11px;
    background: linear-gradient(135deg, #edfcf9, #f3fcfb);
    color: #697386;
    font-size: 10px;
    line-height: 1.35;
}
.login-card .lgpd-notice-icon {
    width: 31px;
    height: 31px;
    border-radius: 9px;
    font-size: 12px;
}
.login-card .lgpd-badge {
    padding: 4px 8px;
    border-radius: 20px;
    background: var(--sgcm-teal-500);
    font-size: 9px;
}

.login-card .form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.login-card .form-group { margin-bottom: 15px; }
.login-card .form-group label {
    margin-bottom: 7px;
    color: #293448;
    font-size: 12px;
    font-weight: 560;
}
.login-card .form-control {
    height: 47px;
    padding: 0 14px;
    border: 1px solid #dfe4eb;
    border-radius: 9px;
    color: #243149;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15,23,42,.03);
    font-size: 13px;
}
.login-card .form-control-icon { padding-left: 42px !important; padding-right: 42px; }
.login-card .input-icon { left: 14px; color: #738097; font-size: 13px; }
.login-card .form-control:focus {
    border-color: var(--sgcm-teal-500);
    box-shadow: 0 0 0 3px rgba(18,185,173,.11);
}
.login-card .password-toggle { right: 11px; color: #758096; }

.login-card .login-options {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 1px 0 17px;
}
.login-card .remember-me,
.login-card .forgot-password { font-size: 11px; }
.login-card .remember-me input[type='checkbox'] { width: 16px; height: 16px; }
.login-card .forgot-password { color: var(--sgcm-teal-600); font-weight: 600; }

.login-card .btn-login-submit {
    min-height: 48px;
    padding: 0 20px;
    border-radius: 8px;
    background: linear-gradient(100deg, #18c0b4 0%, #10aeb1 55%, #12b3dc 100%);
    box-shadow: 0 10px 26px rgba(11,177,177,.25);
    font-size: 13px;
    font-weight: 700;
}
.login-card .btn-login-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(11,177,177,.33);
}
.login-card .btn-biometria {
    width: 100%;
    min-height: 44px;
    margin-top: 11px;
    border: 1px solid rgba(18,185,173,.35);
    border-radius: 8px;
    color: var(--sgcm-teal-600);
    background: #f4fffd;
}
.login-card .login-terms {
    margin: 17px 0 0;
    color: #7f8796;
    font-size: 10px;
    line-height: 1.45;
}
.login-card .login-terms a { color: var(--sgcm-teal-600); font-weight: 600; }
.login-card-version {
    margin: 18px 0 0;
    color: #a0a7b4;
    text-align: center;
    font-size: 9.5px;
}

@media (max-width: 1120px) {
    .login-screen { grid-template-columns: minmax(0, 52%) minmax(410px, 48%); }
    .login-left { padding-left: 55px; align-items: flex-start; }
    .login-left-content { min-height: min(760px, calc(100vh - 64px)); }
    .login-brand-logo { width: 215px; height: 102px; margin-bottom: 35px; }
    .login-benefits { gap: 18px; margin-top: 30px; }
    .login-compliance { margin-top: 28px; }
    .login-right { padding-right: 36px; }
}

@media (max-width: 820px) {
    .login-screen {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100svh;
        padding: 24px;
        background: #f8fafc;
    }
    .login-background,
    .login-left { display: none; }
    .login-right {
        width: 100%;
        min-height: auto;
        padding: 0;
        background: transparent;
    }
    .login-card {
        width: min(100%, 410px);
        max-width: 410px;
        padding: 31px 28px 23px;
        border: 0;
        border-radius: 18px;
        box-shadow: 0 18px 55px rgba(15,35,55,.11);
    }
    .login-card .form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .login-card .login-options { flex-direction: row; align-items: center; }
}

@media (max-width: 460px) {
    .login-screen { padding: 0; background: #fff; }
    .login-card {
        width: 100%;
        max-width: none;
        min-height: 100svh;
        padding: 28px 28px 22px;
        border-radius: 0;
        box-shadow: none;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    .login-card-logo { width: 61px; height: 52px; }
    .login-card-title { font-size: 25px; }
    .login-card-subtitle { font-size: 14px; }
    .login-card .lgpd-notice { margin-top: 8px; min-height: 73px; font-size: 12px; }
    .login-card .lgpd-notice-icon { width: 34px; height: 34px; }
    .login-card .form-group label { font-size: 14px; }
    .login-card .form-control { height: 52px; font-size: 14px; }
    .login-card .remember-me,
    .login-card .forgot-password { font-size: 12px; }
    .login-card .btn-login-submit { min-height: 53px; border-radius: 9px; font-size: 15px; }
    .login-card .login-terms { font-size: 11.5px; }
    .login-card-version { display: none; }
}

@media (max-width: 360px) {
    .login-card { padding-left: 20px; padding-right: 20px; }
    .login-card .form-row { gap: 9px; }
    .login-card .login-options { gap: 8px; }
    .login-card .remember-me,
    .login-card .forgot-password { font-size: 10.5px; }
}

/* ======================== SISTEMA PRINCIPAL =============================== */
.main-system {
    background: var(--sgcm-canvas);
    color: var(--sgcm-text);
}

/* Menu lateral */
.main-system .sidebar {
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    overflow: hidden;
    border-right: 1px solid rgba(52,219,207,.24);
    border-radius: 0 25px 25px 0;
    background:
        radial-gradient(circle at 112% 20%, rgba(11,205,190,.14), transparent 35%),
        radial-gradient(circle at 15% 92%, rgba(17,182,218,.12), transparent 30%),
        linear-gradient(175deg, #052f49 0%, #033350 47%, #052b44 100%);
    box-shadow: 10px 0 30px rgba(5,47,73,.12), inset -1px 0 rgba(255,255,255,.05);
}
.main-system .sidebar::before,
.main-system .sidebar::after {
    content: '';
    position: absolute;
    width: 220px;
    height: 460px;
    border: 1px solid rgba(34,211,197,.15);
    border-radius: 50%;
    pointer-events: none;
}
.main-system .sidebar::before { top: -115px; right: -162px; transform: rotate(9deg); }
.main-system .sidebar::after { bottom: -290px; left: -120px; }

.main-system .sidebar-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 91px;
    padding: 20px 22px 16px;
    border-bottom: 0;
}
.sidebar-brand-symbol {
    width: 47px;
    height: 47px;
    object-fit: contain;
    flex: 0 0 auto;
    filter: drop-shadow(0 8px 13px rgba(10,198,186,.22));
}
.sidebar-brand-copy { display: flex; flex-direction: column; min-width: 0; }
.sidebar-brand-copy strong {
    color: #fff;
    font-size: 24px;
    line-height: 1;
    letter-spacing: .02em;
    font-weight: 760;
}
.sidebar-brand-copy span {
    margin-top: 5px;
    color: rgba(255,255,255,.78);
    font-size: 8.5px;
    line-height: 1.35;
}
.main-system .sidebar-nav {
    position: relative;
    z-index: 1;
    flex: 1;
    min-height: 0;
    padding: 3px 16px 10px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(62,213,203,.28) transparent;
}
.main-system .sidebar-nav::-webkit-scrollbar { width: 4px; }
.main-system .sidebar-nav::-webkit-scrollbar-thumb { background: rgba(62,213,203,.28); border-radius: 99px; }
.main-system .nav-section {
    position: relative;
    margin: 12px 6px 4px;
    padding: 0 0 6px;
    color: #42c9c0;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .105em;
}
.main-system .nav-section::after {
    content: '';
    display: inline-block;
    width: 76px;
    height: 1px;
    margin: 0 0 2px 9px;
    background: linear-gradient(90deg, rgba(56,205,196,.45), transparent);
}
.main-system .nav-item {
    display: flex;
    align-items: center;
    min-height: 37px;
    gap: 11px;
    margin: 2px 0;
    padding: 8px 12px;
    border: 0;
    border-radius: 8px;
    color: rgba(239,250,255,.84);
    font-size: 11px;
    line-height: 1.2;
    font-weight: 450;
    white-space: nowrap;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}
.main-system .nav-item i {
    width: 18px;
    color: rgba(224,247,250,.92);
    font-size: 14px;
}
.main-system .nav-item:hover {
    color: #fff;
    background: rgba(255,255,255,.075);
    transform: translateX(2px);
}
.main-system .nav-item.active {
    color: #fff;
    border-left: 0;
    background: linear-gradient(102deg, #11b9ac 0%, #10c8bf 55%, #0fc6d6 100%);
    box-shadow: 0 8px 20px rgba(9,190,182,.2), inset 0 1px rgba(255,255,255,.18);
}
.main-system .nav-item.active i { color: #fff; }
.main-system .sidebar-footer {
    position: relative;
    z-index: 1;
    padding: 10px 16px 17px;
}
.sidebar-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    width: 100%;
    min-height: 42px;
    border: 1px solid rgba(61,209,200,.28);
    border-radius: 9px;
    color: rgba(255,255,255,.86);
    background: rgba(0,29,49,.24);
    cursor: pointer;
    font: 500 11px 'Inter', sans-serif;
    transition: .2s ease;
}
.sidebar-logout:hover { color: #fff; border-color: rgba(61,209,200,.55); background: rgba(18,185,173,.14); }

/* Cabeçalho */
.main-system .header {
    left: var(--sidebar-width);
    height: var(--header-height);
    padding: 0 29px 0 25px;
    gap: 24px;
    border-bottom: 1px solid #edf0f4;
    background: rgba(255,255,255,.97);
    box-shadow: 0 3px 16px rgba(20,33,58,.025);
    backdrop-filter: blur(14px);
}
.main-system .header-left { min-width: 0; gap: 14px; }
.main-system .hamburger-btn {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #edf0f3;
    border-radius: 50%;
    color: #687386;
    background: #fff;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(26,45,70,.06);
}
.main-system .header-title { display: none; }
.main-system .header-selectors { margin-left: 0; gap: 9px; }
.main-system .header-selector label {
    color: #8992a1;
    font-size: 9px;
    font-weight: 600;
}
.main-system .header-selector select {
    min-width: 91px;
    height: 34px;
    padding: 0 27px 0 10px;
    border: 1px solid #e4e9ef;
    border-radius: 8px;
    color: #4e596b;
    font-size: 10px;
}
.main-system .header-selector:last-child select { min-width: 155px; max-width: 205px; }
.header-search {
    position: relative;
    flex: 1 1 340px;
    max-width: 430px;
    min-width: 180px;
    margin: 0 auto;
}
.header-search > i {
    position: absolute;
    top: 50%;
    left: 15px;
    z-index: 1;
    color: #9ca5b2;
    font-size: 11px;
    transform: translateY(-50%);
}
.header-search input {
    width: 100%;
    height: 37px;
    padding: 0 16px 0 37px;
    border: 1px solid #eff1f4;
    border-radius: 20px;
    outline: 0;
    color: #344156;
    background: #fafbfc;
    font: 400 10.5px 'Inter', sans-serif;
    transition: .2s ease;
}
.header-search input:focus {
    border-color: rgba(18,185,173,.42);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(18,185,173,.08);
}
.main-system .header-right { gap: 9px; }
.main-system .apoio-btn {
    height: 35px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 10px;
}
.main-system .notification-btn {
    width: 35px;
    height: 35px;
    border: 0;
    border-radius: 50%;
    color: #596579;
    background: transparent;
}
.main-system .notification-badge {
    top: -1px;
    right: -1px;
    min-width: 15px;
    height: 15px;
    padding: 0 4px;
    font-size: 8px;
}
.main-system .header-user {
    gap: 9px;
    padding: 4px 5px;
    border-radius: 11px;
}
.main-system .user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: linear-gradient(145deg, #0ea394, #04716f);
    font-size: 10px;
    box-shadow: 0 6px 15px rgba(8,131,124,.16);
}
.main-system .user-name { color: #2c374b; font-size: 10.5px; }
.main-system .user-role { color: #929aa8; font-size: 8.5px; }

/* Conteúdo geral */
.main-system .main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
    padding: 22px 28px 36px;
    background:
        radial-gradient(circle at 100% 0%, rgba(18,185,173,.035), transparent 25%),
        #f7f9fc;
}
.main-system .module-content { animation: sgcm-content-enter .24s ease-out; }
@keyframes sgcm-content-enter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.main-system .page-header { margin-bottom: 17px; }
.main-system .page-title {
    margin: 0 0 4px;
    color: #17253c;
    font-size: 21px;
    line-height: 1.25;
    letter-spacing: -.025em;
    font-weight: 740;
}
.main-system .page-subtitle { color: #9199a7; font-size: 10px; }

/* Dashboard */
#module-dashboard .stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13px;
    margin-bottom: 14px;
}
#module-dashboard .stat-card {
    position: relative;
    min-width: 0;
    min-height: 103px;
    padding: 15px 15px 13px;
    overflow: hidden;
    border: 1px solid #edf0f4;
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 6px 20px rgba(30,45,70,.045);
}
#module-dashboard .stat-card::after {
    content: '';
    position: absolute;
    right: 12px;
    bottom: 15px;
    width: 53px;
    height: 24px;
    opacity: .9;
    background:
        linear-gradient(130deg, transparent 0 17%, #14b8a6 18% 21%, transparent 22% 36%, #14b8a6 37% 40%, transparent 41% 52%, #14b8a6 53% 56%, transparent 57% 66%, #14b8a6 67% 70%, transparent 71%);
    clip-path: polygon(0 72%, 15% 72%, 28% 25%, 42% 69%, 56% 42%, 70% 64%, 84% 30%, 100% 55%, 100% 100%, 0 100%);
}
#module-dashboard .stat-card-header {
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
#module-dashboard .stat-card-icon {
    order: -1;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: #079b8f !important;
    background: #ecfaf7 !important;
    font-size: 13px;
}
#module-dashboard .stat-card-title { color: #778194; font-size: 9px; font-weight: 550; }
#module-dashboard .stat-card-value {
    margin: 0 0 4px 44px;
    color: #253248;
    font-size: clamp(18px, 1.65vw, 24px);
    line-height: 1;
    font-weight: 720;
}
#module-dashboard .stat-card-change {
    margin-left: 44px;
    color: #43b57b;
    font-size: 8px;
}
#module-dashboard .dash-indicators-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 14px;
}
#module-dashboard .dash-indicator-card {
    min-height: 56px;
    padding: 10px 13px;
    border: 1px solid #edf0f4;
    border-radius: 10px;
    background: rgba(255,255,255,.82);
    box-shadow: 0 4px 14px rgba(30,45,70,.03);
}
#module-dashboard .dash-indicator-icon { width: 32px; height: 32px; border-radius: 9px; font-size: 12px; }
#module-dashboard .dash-indicator-label { color: #8a93a2; font-size: 8.5px; }
#module-dashboard .dash-indicator-value { color: #2a374c; font-size: 13px; }

#module-dashboard .content-grid {
    gap: 14px;
    margin-bottom: 14px;
}
#module-dashboard .content-card {
    margin-bottom: 14px;
    overflow: hidden;
    border: 1px solid #edf0f4;
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 6px 21px rgba(30,45,70,.04);
}
#module-dashboard .content-grid .content-card { margin-bottom: 0; }
#module-dashboard .card-header {
    min-height: 49px;
    padding: 13px 16px;
    border-bottom: 1px solid #f0f2f5;
}
#module-dashboard .card-title {
    color: #344156;
    font-size: 10.5px;
    font-weight: 650;
}
#module-dashboard .card-title i { margin-right: 6px; color: #0ca99f; }
#module-dashboard .card-badge {
    padding: 5px 9px;
    border: 0;
    border-radius: 14px;
    color: #6f798a;
    background: #f6f8fa;
    font-size: 8px;
}
#module-dashboard .card-body { padding: 14px 16px; }
#module-dashboard .chart-container { min-height: 180px; }
#module-dashboard .content-grid:nth-of-type(3) .chart-container { min-height: 215px; }
#module-dashboard .quick-action-btn {
    border: 1px solid #e7edf2;
    border-radius: 9px;
    background: #fbfcfd;
    color: #526075;
}
#module-dashboard .quick-action-btn i { color: #0ca99f; }
#module-dashboard .kpi-bar-fill,
#module-dashboard .progress-fill { background: linear-gradient(90deg, #11b9ad, #13c7bd) !important; }

/* Demais módulos com a mesma linguagem visual */
.main-system .module-content:not(#module-dashboard) .content-card,
.main-system .module-content:not(#module-dashboard) .table-container,
.main-system .module-content:not(#module-dashboard) .section-card {
    border: 1px solid #e9edf2;
    border-radius: 12px;
    box-shadow: 0 5px 18px rgba(30,45,70,.035);
}
.main-system .btn-primary {
    border-radius: 8px;
    background: linear-gradient(100deg, #11b8ac, #11b7d7);
    box-shadow: 0 6px 16px rgba(15,179,178,.17);
}

@media (min-width: 1440px) {
    :root { --sidebar-width: 260px; --header-height: 74px; }
    .main-system .main-content { padding-left: 32px; padding-right: 32px; }
    .main-system .nav-item { min-height: 39px; font-size: 11.5px; }
}

@media (max-width: 1180px) {
    :root { --sidebar-width: 225px; }
    .main-system .header { padding-right: 18px; gap: 12px; }
    .main-system .header-selector label { display: none; }
    .main-system .header-selector:last-child select { max-width: 145px; min-width: 130px; }
    #module-dashboard .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .main-system .header-search { display: none; }
    .main-system .apoio-btn span { display: none; }
    .main-system .apoio-btn { width: 35px; padding: 0; justify-content: center; }
    #module-dashboard .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    :root { --header-height: 64px; }
    .main-system .sidebar {
        width: min(286px, 84vw);
        border-radius: 0 22px 22px 0;
        transform: translateX(-105%);
    }
    .main-system .sidebar.open { transform: translateX(0); }
    .main-system .header { left: 0; padding: 0 14px; }
    .main-system .hamburger-btn { display: grid; }
    .main-system .header-selector:first-child { display: none; }
    .main-system .header-selector:last-child select { min-width: 110px; max-width: 145px; }
    .main-system .user-info { display: none; }
    .main-system .main-content { margin-left: 0; padding: 17px 14px 26px; }
    #module-dashboard .page-title { font-size: 19px; }
    #module-dashboard .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    #module-dashboard .stat-card { min-height: 96px; padding: 13px 12px; }
    #module-dashboard .stat-card-value,
    #module-dashboard .stat-card-change { margin-left: 0; }
    #module-dashboard .stat-card::after { right: 9px; bottom: 13px; width: 45px; }
    #module-dashboard .dash-indicators-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
    .main-system .header { gap: 8px; }
    .main-system .header-selectors { max-width: 125px; }
    .main-system .header-selector:last-child select { width: 120px; min-width: 0; }
    .main-system .apoio-btn { display: none; }
    #module-dashboard .stats-grid { grid-template-columns: 1fr 1fr; }
    #module-dashboard .stat-card { min-height: 103px; }
    #module-dashboard .stat-card-title { font-size: 8px; }
    #module-dashboard .stat-card-value { font-size: 18px; }
    #module-dashboard .dash-indicators-row { grid-template-columns: 1fr 1fr; }
}

/* Estado compacto acionado pelo botão do cabeçalho em desktop */
@media (min-width: 769px) {
    .main-system.sidebar-collapsed .sidebar { width: 78px; }
    .main-system.sidebar-collapsed .sidebar-header { justify-content: center; padding-left: 10px; padding-right: 10px; }
    .main-system.sidebar-collapsed .sidebar-brand-symbol { width: 44px; height: 44px; }
    .main-system.sidebar-collapsed .sidebar-brand-copy,
    .main-system.sidebar-collapsed .nav-section,
    .main-system.sidebar-collapsed .nav-item:not(.active)::after,
    .main-system.sidebar-collapsed .sidebar-logout span { display: none; }
    .main-system.sidebar-collapsed .sidebar-nav { padding-left: 12px; padding-right: 12px; }
    .main-system.sidebar-collapsed .nav-item { justify-content: center; width: 48px; min-height: 42px; padding: 8px; font-size: 0; }
    .main-system.sidebar-collapsed .nav-item i { width: auto; font-size: 15px; }
    .main-system.sidebar-collapsed .sidebar-footer { padding-left: 12px; padding-right: 12px; }
    .main-system.sidebar-collapsed .sidebar-logout { width: 48px; }
    .main-system.sidebar-collapsed .header { left: 78px; }
    .main-system.sidebar-collapsed .main-content { margin-left: 78px; }
}

/* ========================================================================== 
   SELEÇÃO MULTICLÍNICA — MESMO PADRÃO VISUAL DO LOGIN
   ========================================================================== */
.clinica-select-screen {
    display: none;
    align-items: center;
    justify-content: flex-end;
    min-height: 100vh;
    padding: 42px clamp(48px, 7vw, 132px) 42px 40px;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(248,252,253,.10), rgba(3,38,61,.08)),
        url('assets/brand/sgcm-login-background.png') center / cover no-repeat;
}
.clinica-select-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 90% 22%, rgba(18,185,173,.10), transparent 25%),
        radial-gradient(circle at 14% 80%, rgba(16,183,233,.045), transparent 28%);
}
.clinica-select-card {
    width: min(100%, 440px);
    max-width: 440px;
    max-height: calc(100vh - 84px);
    padding: 32px 34px 34px;
    overflow: hidden;
    border: 1px solid rgba(225,232,239,.95);
    border-radius: 20px;
    background: rgba(255,255,255,.985);
    box-shadow: 0 30px 85px rgba(1,28,49,.27), 0 0 0 1px rgba(255,255,255,.20);
}
.clinica-select-header {
    margin-bottom: 25px;
    text-align: center;
}
.clinica-select-brand {
    display: block;
    width: 190px;
    height: 79px;
    margin: 0 auto 8px;
    object-fit: contain;
}
.clinica-select-title {
    margin: 0 0 7px;
    color: #152238;
    font-size: 22px;
    line-height: 1.2;
    letter-spacing: -.025em;
    font-weight: 760;
}
.clinica-select-subtitle {
    max-width: 330px;
    margin: 0 auto;
    color: #7d8798;
    font-size: 12px;
    line-height: 1.55;
}
.clinica-list {
    display: flex;
    flex-direction: column;
    gap: 11px;
    max-height: calc(100vh - 292px);
    padding: 2px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(18,185,173,.35) transparent;
}
.clinica-list::-webkit-scrollbar { width: 6px; }
.clinica-list::-webkit-scrollbar-track { background: transparent; }
.clinica-list::-webkit-scrollbar-thumb { border-radius: 10px; background: rgba(18,185,173,.28); }
.clinica-card {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 76px;
    padding: 13px 14px;
    border: 1px solid #e1e7ed;
    border-radius: 10px;
    background: #fbfcfd;
    box-shadow: 0 4px 14px rgba(28,42,65,.025);
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}
.clinica-card:hover {
    border-color: rgba(18,185,173,.58);
    background: #f4fcfb;
    box-shadow: 0 10px 25px rgba(18,185,173,.10);
    transform: translateX(-3px);
}
.clinica-card:focus-visible {
    outline: 3px solid rgba(18,185,173,.18);
    outline-offset: 2px;
}
.clinica-card-icon {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    background: linear-gradient(140deg, var(--sgcm-teal-500), var(--sgcm-cyan-500));
    box-shadow: 0 8px 18px rgba(16,181,185,.19);
    font-size: 17px;
}
.clinica-card-info { min-width: 0; text-align: left; }
.clinica-card-info h4 {
    margin: 0 0 3px;
    overflow: hidden;
    color: #223047;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.clinica-card-info p {
    margin: 0;
    overflow: hidden;
    color: #7d8798;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 720px) {
    .clinica-select-screen {
        align-items: flex-start;
        justify-content: center;
        min-height: 100svh;
        padding: 0;
        overflow-y: auto;
        background: #fff;
    }
    .clinica-select-screen::before { display: none; }
    .clinica-select-card {
        width: 100%;
        max-width: 480px;
        max-height: none;
        min-height: 100svh;
        padding: 29px 21px 35px;
        overflow: visible;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }
    .clinica-select-brand { width: 184px; height: 76px; }
    .clinica-select-title { font-size: 21px; }
    .clinica-select-subtitle { font-size: 11.5px; }
    .clinica-list { max-height: none; overflow: visible; }
    .clinica-card { min-height: 73px; padding: 12px 13px; }
    .clinica-card:hover { transform: none; }
}
