/* ???????????????????????????????????????????????????????????????
   MeuVizinho Admin — site.css
   ??????????????????????????????????????????????????????????????? */

:root {
    --sidebar-w: 240px;
    --topbar-h: 56px;
    --primary:   #2d6a4f;
    --primary-dk:#1b4332;
    --primary-lt:#d8f3dc;
    --accent:    #52b788;
    --bg-body:   #f4f6f8;
    --bg-card:   #ffffff;
    --text-main: #212529;
    --text-muted:#6c757d;
    --border:    #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,.10);
    --radius:    10px;
    --sidebar-bg:#1b4332;
    --sidebar-hover:#2d6a4f;
    --topbar-bg: #2d6a4f;
    --transition:.2s ease;
}

html, body {
    height: 100%;
    font-size: 15px;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    padding: 0;
}

/* ?? Topbar ??????????????????????????????????????????????????? */
.admin-topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-h);
    background: var(--topbar-bg);
    z-index: 1030;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.admin-brand {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: .3px;
}

.sidebar-toggle {
    color: rgba(255,255,255,.85) !important;
    transition: color var(--transition);
}
.sidebar-toggle:hover { color: #fff !important; }

/* ?? Layout wrapper ??????????????????????????????????????????? */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
    padding-top: var(--topbar-h);
}

/* ?? Sidebar ?????????????????????????????????????????????????? */
.admin-sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    min-height: calc(100vh - var(--topbar-h));
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    bottom: 0;
    z-index: 1020;
    transition: width var(--transition), transform var(--transition);
    overflow-x: hidden;
    overflow-y: auto;
    flex-shrink: 0;
}

.admin-sidebar.collapsed {
    width: 0;
    transform: translateX(-100%);
}

.sidebar-nav {
    padding: 1.25rem .75rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-section-label {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,.35);
    padding: .5rem .75rem .25rem;
    text-transform: uppercase;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem .85rem;
    border-radius: 8px;
    color: rgba(255,255,255,.78);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
}
.sidebar-link i { font-size: 1.05rem; flex-shrink: 0; }
.sidebar-link:hover {
    background: rgba(255,255,255,.1);
    color: #fff;
}
.sidebar-link.active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(82,183,136,.35);
}

/* sub-item da sidebar (ex: Planos dentro de Pagamentos) */
.sidebar-link-sub {
    font-size: .85rem;
    padding-left: 2.4rem;  /* recua o texto visualmente, mas mantém ícone alinhado */
    color: rgba(255,255,255,.65);
}
.sidebar-link-sub::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,.35);
    margin-right: .5rem;
    flex-shrink: 0;
}
.sidebar-link-sub i {
    display: none;   /* esconde o ícone, usa o bullet acima */
}
.sidebar-link-sub.active::before {
    background: #fff;
}
.sidebar-link-sub.active {
    background: rgba(255,255,255,.12);
    color: #fff;
    box-shadow: none;
}

/* ?? Content ?????????????????????????????????????????????????? */
.admin-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition);
    min-width: 0;
}
.admin-content.expanded { margin-left: 0; }

.admin-page-inner {
    flex: 1;
    padding: 1.75rem 2rem;
}

.admin-footer {
    padding: 1rem 2rem;
    font-size: .8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    background: var(--bg-card);
}

/* ?? Page header ?????????????????????????????????????????????? */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: .75rem;
}

.page-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.page-subtitle {
    font-size: .85rem;
    color: var(--text-muted);
    margin: .15rem 0 0;
}

/* ?? Stat cards (Dashboard) ??????????????????????????????????? */
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.35rem 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1.1rem;
    transition: box-shadow var(--transition), transform var(--transition);
}
.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.stat-icon.green  { background: #d8f3dc; color: #2d6a4f; }
.stat-icon.blue   { background: #dbeafe; color: #1d4ed8; }
.stat-icon.orange { background: #ffedd5; color: #c2410c; }
.stat-icon.purple { background: #ede9fe; color: #6d28d9; }

.stat-value {
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-main);
}
.stat-label {
    font-size: .82rem;
    color: var(--text-muted);
    margin-top: .2rem;
}

/* ?? Admin card ??????????????????????????????????????????????? */
.admin-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}

.admin-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fafbfc;
}

.admin-card-header h6 {
    font-weight: 700;
    font-size: .9rem;
    color: var(--text-main);
    margin: 0;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.admin-card-body { padding: 1.25rem; }

/* ?? Tabela moderna ??????????????????????????????????????????? */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}
.admin-table thead th {
    background: #f8fafc;
    font-weight: 700;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--text-muted);
    padding: .75rem 1rem;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
.admin-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}
.admin-table tbody tr:last-child { border-bottom: none; }
.admin-table tbody tr:hover { background: #f8fafc; }
.admin-table td {
    padding: .7rem 1rem;
    vertical-align: middle;
}

/* badge de status dentro da celula de anuncio fica compacto */
.td-anuncio-nome  { vertical-align: middle; line-height: 1.3; }
.td-anuncio-badge { display: inline-block; margin-top: .25rem; }

/* ?? Thumbnail ???????????????????????????????????????????????? */
.thumb {
    width: 44px; height: 44px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border);
}
.thumb-placeholder {
    width: 44px; height: 44px;
    border-radius: 8px;
    background: #e9ecef;
    display: flex; align-items: center; justify-content: center;
    color: #adb5bd;
    font-size: 1.1rem;
    border: 1px solid var(--border);
}

/* ?? Badges por tipo ?????????????????????????????????????????? */
.badge-tipo {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .3em .7em;
    border-radius: 6px;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .2px;
}
.badge-servico     { background: #dbeafe; color: #1d4ed8; }
.badge-comercio    { background: #d1fae5; color: #065f46; }
.badge-profissional{ background: #e5e7eb; color: #374151; }

/* ?? Botões de ação ??????????????????????????????????????????? */
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .3rem .65rem;
    border-radius: 6px;
    font-size: .8rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all var(--transition);
    white-space: nowrap;
}
.btn-action-view   { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.btn-action-edit   { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.btn-action-delete { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.btn-action:hover  { filter: brightness(.93); }

/* ?? Barra de filtros ????????????????????????????????????????? */
.filter-bar {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: #fafbfc;
}

/* ?? Formulário admin ????????????????????????????????????????? */
.form-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}

.form-section-title {
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--text-muted);
    margin-bottom: 1rem;
    padding-bottom: .6rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: .4rem;
}

.form-label { font-weight: 600; font-size: .87rem; color: #374151; }

.form-control, .form-select {
    border-radius: 8px;
    border-color: var(--border);
    font-size: .9rem;
    padding: .5rem .8rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(82,183,136,.2);
}

/* ?? Upload de imagem ????????????????????????????????????????? */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
    background: #fafbfc;
}
.upload-area:hover {
    border-color: var(--accent);
    background: #f0fdf4;
}
.upload-area input[type=file] { display: none; }

#imgPreview {
    max-height: 180px;
    border-radius: 10px;
    object-fit: contain;
    border: 1px solid var(--border);
    display: none;
    margin: 0 auto;
}

/* ?? Paginação ???????????????????????????????????????????????? */
.admin-pagination .page-link {
    border-radius: 6px !important;
    margin: 0 2px;
    border-color: var(--border);
    color: var(--primary);
    font-size: .85rem;
    padding: .35rem .65rem;
}
.admin-pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ?? Details card ????????????????????????????????????????????? */
.detail-photo {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.detail-photo-placeholder {
    height: 200px;
    background: #f1f3f5;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    color: #adb5bd;
    font-size: 3rem;
    border: 1px solid var(--border);
}

.detail-row {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .7rem 0;
    border-bottom: 1px solid #f1f3f5;
}
.detail-row:last-child { border-bottom: none; }
.detail-icon { color: var(--accent); font-size: 1rem; margin-top: .1rem; flex-shrink: 0; }
.detail-key  { font-size: .78rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.detail-val  { font-size: .95rem; color: var(--text-main); }

/* ?? Alertas ?????????????????????????????????????????????????? */
.alert { border-radius: var(--radius); border: none; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-danger  { background: #fee2e2; color: #991b1b; }

/* ?? Responsive ??????????????????????????????????????????????? */
@media (max-width: 768px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.mobile-open { transform: translateX(0); width: var(--sidebar-w); }
    .admin-content { margin-left: 0; }
    .admin-page-inner { padding: 1rem; }
}

/* ?? Barra de ações do formulário ????????????????????????????? */
.form-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-top: 1rem;
    box-shadow: var(--shadow-sm);
}

/* ?? Botão principal de submit ???????????????????????????????? */
.btn-submit-primary {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .55rem 1.4rem;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), box-shadow var(--transition);
}
.btn-submit-primary:hover:not(:disabled) {
    background: var(--primary-dk);
    box-shadow: 0 3px 10px rgba(45,106,79,.35);
}
.btn-submit-primary:disabled {
    opacity: .7;
    cursor: not-allowed;
}
.btn-warning-custom {
    background: #d97706 !important;
}
.btn-warning-custom:hover:not(:disabled) {
    background: #b45309 !important;
    box-shadow: 0 3px 10px rgba(217,119,6,.35) !important;
}

/* ?? Badges de perfil de usuário ??????????????????????????? */
.badge-admin    { background: #dcfce7; color: #166534; }   /* verde — Ativo / Confirmado */
.badge-user     { background: #f1f5f9; color: #475569; }   /* cinza — Pendente / usuario */
.badge-comercio { background: #fef9c3; color: #854d0e; }   /* amarelo — Pausado */

/* ?? Força da senha ??????????????????????????????????????????? */
.senha-forca-bar {
    height: 5px;
    background: #e2e8f0;
    border-radius: 99px;
    margin-top: .5rem;
    overflow: hidden;
}
.senha-forca-fill {
    height: 100%;
    width: 0;
    border-radius: 99px;
    transition: width .3s ease, background-color .3s ease;
}

/* ?? Tela de Login ???????????????????????????????????????????? */
.auth-body {
    background: linear-gradient(135deg, var(--primary-dk) 0%, var(--primary) 60%, var(--accent) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-wrapper {
    width: 100%;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.auth-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    padding: 2.5rem 2.25rem;
    width: 100%;
    max-width: 420px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo-icon {
    width: 64px;
    height: 64px;
    background: var(--primary-lt);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: .75rem;
}

.auth-brand {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary-dk);
    margin: 0;
    letter-spacing: -.5px;
}

.auth-brand-sub {
    font-size: .82rem;
    color: var(--text-muted);
    margin: .2rem 0 0;
}
