/* =============================================================================
   Meu Cuidado — Estilos globais
   Design: teal/azul-esverdeado | Foco em acessibilidade para público sênior
   ============================================================================= */

/* ── Importa fonte Nunito (legível, amigável) ──────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');

/* ── Variáveis de cor e espaçamento ───────────────────────────────────────── */
:root {
    /* Paleta teal */
    --teal-900:  #04342C;
    --teal-800:  #085041;
    --teal-700:  #0F6E56;
    --teal-600:  #0D6E6E;   /* cor principal */
    --teal-500:  #1A9999;
    --teal-400:  #1D9E75;
    --teal-200:  #9FE1CB;
    --teal-100:  #E1F5EE;
    --teal-50:   #F0FAFA;

    /* Neutros */
    --gray-900:  #1A2E2E;
    --gray-700:  #3D5555;
    --gray-500:  #5A7A7A;
    --gray-300:  #C8E0E0;
    --gray-100:  #F3F8F8;
    --white:     #FFFFFF;

    /* Semânticas */
    --success-bg:   #EAF3DE;
    --success-text: #27500A;
    --warning-bg:   #FAEEDA;
    --warning-text: #633806;
    --danger-bg:    #FCEBEB;
    --danger-text:  #791F1F;
    --info-bg:      #E6F1FB;
    --info-text:    #0C447C;

    /* Tipografia — tamanhos maiores para público sênior */
    --font-base:  17px;
    --font-sm:    15px;
    --font-xs:    13px;
    --font-lg:    19px;
    --font-xl:    22px;
    --font-2xl:   26px;
    --font-3xl:   32px;

    /* Layout */
    --sidebar-width: 240px;
    --topbar-height: 60px;
    --radius:        10px;
    --radius-lg:     14px;
    --radius-sm:     6px;
    --shadow-card:   0 1px 3px rgba(13,110,110,.08), 0 1px 2px rgba(13,110,110,.04);
}

/* ── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Nunito', sans-serif;
    font-size: var(--font-base);
    line-height: 1.65;
    color: var(--gray-900);
    background: var(--gray-100);
    -webkit-font-smoothing: antialiased;
}

/* ── Tipografia ───────────────────────────────────────────────────────────── */
h1 { font-size: var(--font-3xl); font-weight: 800; color: var(--teal-800); }
h2 { font-size: var(--font-2xl); font-weight: 700; color: var(--teal-800); }
h3 { font-size: var(--font-xl);  font-weight: 700; color: var(--teal-700); }
h4 { font-size: var(--font-lg);  font-weight: 700; }
p  { line-height: 1.7; }

a { color: var(--teal-600); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--teal-800); }

/* ── Layout principal: sidebar + conteúdo ─────────────────────────────────── */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--teal-600);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: transform .25s ease;
}

.sidebar__logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 18px 16px;
    border-bottom: 1px solid rgba(255,255,255,.12);
}

.sidebar__logo-icon {
    width: 40px; height: 40px;
    background: rgba(255,255,255,.18);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.sidebar__logo-icon svg { width: 22px; height: 22px; fill: white; }

.sidebar__logo-name {
    color: white;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.1;
}

.sidebar__logo-sub {
    color: rgba(255,255,255,.6);
    font-size: 12px;
    margin-top: 2px;
}

/* Nav groups */
.sidebar__nav    { padding: 12px 10px; flex: 1; }
.sidebar__group  { margin-bottom: 8px; }
.sidebar__group-label {
    color: rgba(255,255,255,.45);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    padding: 6px 10px 4px;
    display: block;
}

.sidebar__item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: rgba(255,255,255,.78);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 2px;
    transition: background .15s, color .15s;
}

.sidebar__item:hover {
    background: rgba(255,255,255,.12);
    color: white;
    text-decoration: none;
}

.sidebar__item.active {
    background: rgba(255,255,255,.2);
    color: white;
    font-weight: 700;
}

.sidebar__item svg {
    width: 20px; height: 20px;
    flex-shrink: 0;
    opacity: .85;
}

.sidebar__item.active svg { opacity: 1; }

/* Rodapé da sidebar (usuário logado) */
.sidebar__footer {
    padding: 12px 10px 16px;
    border-top: 1px solid rgba(255,255,255,.1);
}

.sidebar__user {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 6px 10px;
    border-radius: var(--radius);
    cursor: default;
    transition: background .15s;
}
.sidebar__user:hover { background: var(--teal-50); }

.sidebar__avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--teal-600);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 15px; color: white;
    flex-shrink: 0;
}

.sidebar__user-name {
    color: var(--teal-800);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.sidebar__user-plan {
    color: var(--gray-500);
    font-size: 12px;
}

/* ── Área principal ───────────────────────────────────────────────────────── */
.main-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Topbar ───────────────────────────────────────────────────────────────── */
.topbar {
    height: var(--topbar-height);
    background: var(--white);
    border-bottom: 1px solid var(--gray-300);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar__title {
    font-size: var(--font-xl);
    font-weight: 800;
    color: var(--teal-800);
}

.topbar__right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar__plan-badge {
    font-size: var(--font-xs);
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 99px;
    border: 1px solid var(--gray-300);
    background: var(--teal-50);
    color: var(--teal-800);
    text-decoration: none;
    white-space: nowrap;
}

.topbar__plan-badge:hover { background: var(--teal-100); text-decoration: none; }
.topbar__plan-badge.expiring { background: var(--warning-bg); color: var(--warning-text); border-color: #FAC775; }
.topbar__plan-badge.expired  { background: var(--danger-bg);  color: var(--danger-text);  border-color: #F7C1C1; }

.topbar__icon-btn {
    width: 40px; height: 40px;
    border-radius: var(--radius);
    border: 1px solid var(--gray-300);
    background: var(--white);
    display: flex; align-items: center; justify-content: center;
/*    cursor: pointer; */
    transition: background .15s;
    color: var(--gray-500);
    text-decoration: none;
}

.topbar__icon-btn:hover { background: var(--teal-50); text-decoration: none; }
.topbar__icon-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; }

/* ── Conteúdo das páginas ─────────────────────────────────────────────────── */
.page-content {
    flex: 1;
    padding: 28px;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.page-header__title { font-size: var(--font-2xl); font-weight: 800; color: var(--teal-800); }
.page-header__sub   { font-size: var(--font-sm); color: var(--gray-500); margin-top: 3px; }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-300);
    padding: 20px 22px;
    box-shadow: var(--shadow-card);
}

.card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card__title { font-size: var(--font-lg); font-weight: 700; color: var(--teal-800); }
.card__link  { font-size: var(--font-sm); color: var(--teal-500); font-weight: 600; text-decoration: none; }
.card__link:hover { text-decoration: underline; }

/* Cards de métricas (dashboard) */
.metric-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-300);
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 5px; height: 100%;
    background: var(--accent-color, var(--teal-600));
}

.metric-card__label {
    font-size: var(--font-xs);
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 8px;
}

.metric-card__value {
    font-size: 30px;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1;
}

.metric-card__unit {
    font-size: var(--font-sm);
    color: var(--gray-500);
    margin-left: 4px;
    font-weight: 600;
}

.metric-card__sub {
    font-size: var(--font-xs);
    color: var(--gray-500);
    margin-top: 8px;
}

/* Grids */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

/* ── Badges e pills de status ─────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: var(--font-xs);
    font-weight: 700;
    white-space: nowrap;
}

.badge-success { background: var(--success-bg); color: var(--success-text); }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger-text);  }
.badge-info    { background: var(--info-bg);    color: var(--info-text);    }
.badge-teal    { background: var(--teal-100);   color: var(--teal-800);     }
.badge-gray    { background: #F1EFE8;           color: #5F5E5A;             }

/* ── Botões ───────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: var(--radius);
    border: none;
    font-family: 'Nunito', sans-serif;
    font-size: var(--font-base);
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, transform .1s;
    white-space: nowrap;
}

.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.btn-primary {
    background: var(--teal-600);
    color: white;
}
.btn-primary:hover { background: var(--teal-800); color: white; }

.btn-outline {
    background: white;
    color: var(--teal-600);
    border: 1.5px solid var(--teal-600);
}
.btn-outline:hover { background: var(--teal-50); }

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid #F7C1C1;
}
.btn-danger:hover { background: #F7C1C1; }

.btn-sm {
    padding: 7px 14px;
    font-size: var(--font-sm);
}

.btn-lg {
    padding: 14px 28px;
    font-size: var(--font-lg);
}

.btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

/* ── Formulários ──────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

.form-label {
    display: block;
    font-size: var(--font-sm);
    font-weight: 700;
    color: var(--gray-500);
    margin-bottom: 7px;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-family: 'Nunito', sans-serif;
    font-size: var(--font-base);   /* 17px — grande para público sênior */
    color: var(--gray-900);
    background: white;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius);
    outline: none;
    transition: border-color .15s;
}

.form-control:focus { border-color: var(--teal-500); }
.form-control.is-invalid { border-color: #E24B4A; }

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235A7A7A' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 42px;
}

.form-error  { font-size: var(--font-xs); color: #A32D2D; margin-top: 5px; }
.form-hint   { font-size: var(--font-xs); color: var(--gray-500); margin-top: 5px; }
.form-row    { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3  { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* ── Tabelas ──────────────────────────────────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-sm);
}

.data-table th {
    text-align: left;
    padding: 11px 14px;
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 1px solid var(--gray-300);
    background: var(--teal-50);
}

.data-table td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--gray-300);
    color: var(--gray-900);
    vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--teal-50); }

.table-actions { display: flex; gap: 6px; }

/* ── Flash messages ───────────────────────────────────────────────────────── */
.flash-messages { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }

.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: var(--font-base);
    font-weight: 600;
}

.alert svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--success-bg); color: var(--success-text); border: 1px solid #C0DD97; }
.alert-error   { background: var(--danger-bg);  color: var(--danger-text);  border: 1px solid #F7C1C1; }
.alert-warning { background: var(--warning-bg); color: var(--warning-text); border: 1px solid #FAC775; }
.alert-info    { background: var(--info-bg);    color: var(--info-text);    border: 1px solid #B5D4F4; }

/* ── Paginação ────────────────────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding-top: 20px;
    flex-wrap: wrap;
}

.page-link {
    min-width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--teal-600);
    text-decoration: none;
    transition: background .15s;
}

.page-link:hover { background: var(--teal-50); text-decoration: none; }
.page-link.active { background: var(--teal-600); color: white; border-color: var(--teal-600); }
.page-link.disabled { color: var(--gray-300); pointer-events: none; }

/* ── Utilitários ──────────────────────────────────────────────────────────── */
.text-muted    { color: var(--gray-500) !important; }
.text-teal     { color: var(--teal-600); }
.text-success  { color: var(--success-text); }
.text-danger   { color: var(--danger-text); }
.text-warning  { color: var(--warning-text); }
.fw-bold       { font-weight: 700; }
.fw-black      { font-weight: 800; }
.mt-1 { margin-top:  6px; }  .mt-2 { margin-top: 12px; }  .mt-3 { margin-top: 20px; }
.mb-1 { margin-bottom: 6px; }.mb-2 { margin-bottom: 12px; }.mb-3 { margin-bottom: 20px; }
.mb-4 { margin-bottom: 28px; }
.gap-2 { gap: 10px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ── Responsividade básica ────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .sidebar         { transform: translateX(-100%); }
    .sidebar.open    { transform: translateX(0); }
    .main-wrapper    { margin-left: 0; }
    .grid-4          { grid-template-columns: repeat(2, 1fr); }
    .grid-3          { grid-template-columns: repeat(2, 1fr); }
    .grid-2          { grid-template-columns: 1fr; }
    .page-content    { padding: 18px; }
}

@media (max-width: 600px) {
    .grid-4, .grid-3 { grid-template-columns: 1fr; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .page-header     { flex-direction: column; }
    .topbar          { padding: 0 16px; }
}

/* ── Scrollbar personalizada ──────────────────────────────────────────────── */
::-webkit-scrollbar         { width: 6px; }
::-webkit-scrollbar-track   { background: transparent; }
::-webkit-scrollbar-thumb   { background: var(--gray-300); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--teal-500); }

/* ── Transição suave de páginas ───────────────────────────────────────────── */
.page-content { animation: fadeIn .18s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
