/* ==============================================================================
   THÉRMICA SOLUÇÕES - PAINEL ADMINISTRATIVO (ESTILOS SAAS)
   ============================================================================== */

:root {
    --bg-dark: #070F1C;
    --bg-sidebar: #0A1629;
    --bg-surface: #0F2038;
    --bg-input: #071322;
    --border-color: rgba(56, 189, 248, 0.15);
    --border-focus: #00B4D8;

    --primary: #0284C7;
    --primary-hover: #00B4D8;
    --cyan: #38BDF8;
    --danger: #EF4444;
    --success: #10B981;

    --text-white: #FFFFFF;
    --text-muted: #94A3B8;
    --text-sub: #CBD5E1;

    --font: 'Plus Jakarta Sans', sans-serif;
    --transition: all 0.25s ease;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

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

body.admin-body {
    font-family: var(--font);
    background-color: var(--bg-dark);
    color: var(--text-sub);
    min-height: 100vh;
    line-height: 1.5;
}

/* ==============================================================================
   TELA DE AUTENTICAÇÃO / LOGIN / SETUP
   ============================================================================== */

.auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: radial-gradient(circle at 50% 30%, rgba(0, 180, 216, 0.12) 0%, transparent 70%), var(--bg-dark);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

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

.auth-logo {
    width: 54px;
    height: 54px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #0284C7 0%, #00B4D8 100%);
    color: #FFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin: 0 auto 1.2rem auto;
    box-shadow: 0 0 20px rgba(0, 180, 216, 0.4);
}

.auth-header h2 {
    color: var(--text-white);
    font-size: 1.5rem;
    font-weight: 700;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.3rem;
}

.setup-notice {
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid var(--border-color);
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--cyan);
    font-size: 0.85rem;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 1.4rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.8rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.2rem;
}

.auth-footer a {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: none;
}

.auth-footer a:hover {
    color: var(--cyan);
}

.auth-feedback {
    margin-top: 1.2rem;
    padding: 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    display: none;
    text-align: center;
}

.auth-feedback.error {
    display: block;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--danger);
    color: #F87171;
}

.auth-feedback.success {
    display: block;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--success);
    color: #34D399;
}

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

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

/* SIDEBAR */
.sidebar {
    width: 270px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.brand-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #0284C7 0%, #00B4D8 100%);
    color: #FFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.brand-info {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-white);
    letter-spacing: 0.5px;
}

.brand-role {
    font-size: 0.75rem;
    color: var(--cyan);
    font-weight: 600;
}

.sidebar-nav {
    padding: 1.2rem 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
    position: relative;
}

.nav-item i {
    font-size: 1.1rem;
    width: 22px;
}

.nav-item:hover {
    background: rgba(56, 189, 248, 0.08);
    color: var(--text-white);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(2, 132, 199, 0.25) 0%, rgba(0, 180, 216, 0.1) 100%);
    color: var(--cyan);
    border-left: 3px solid var(--cyan);
}

.badge-count {
    margin-left: auto;
    background: var(--primary);
    color: #FFF;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-weight: 700;
}

.sidebar-footer {
    padding: 1.2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.btn-view-site {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-sub);
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 600;
}

.btn-view-site:hover {
    background: rgba(56, 189, 248, 0.1);
    color: var(--cyan);
    border-color: var(--cyan);
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1rem;
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--radius-sm);
    color: #F87171;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.15);
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.top-header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 1.4rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-info h1 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-white);
}

.page-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.content-body {
    padding: 2rem;
    max-width: 1200px;
    width: 100%;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==============================================================================
   CARDS E FORMULÁRIOS
   ============================================================================== */

.card-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.8rem;
    margin-bottom: 1.6rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 1.4rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.card-title i {
    color: var(--cyan);
}

.card-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.2rem;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
}

.form-group {
    margin-bottom: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-sub);
}

.form-group input,
.form-group select,
.form-group textarea {
    background: var(--bg-input);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    color: var(--text-white);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 10px rgba(0, 180, 216, 0.25);
}

.form-group small {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.image-edit-preview-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.4rem;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.75rem 1.4rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn * {
    pointer-events: none;
}

.btn-primary {
    background: linear-gradient(135deg, #0284C7 0%, #00B4D8 100%);
    color: #FFF;
}

.btn-primary:hover {
    box-shadow: 0 4px 15px rgba(0, 180, 216, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-white);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.btn-sm {
    padding: 0.5rem 0.9rem;
    font-size: 0.8rem;
}

.btn-block {
    width: 100%;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #F87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: var(--danger);
    color: #FFF;
}

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

.admin-table-wrapper {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.88rem;
}

.admin-table th {
    background: rgba(7, 19, 34, 0.6);
    padding: 1rem 1.2rem;
    font-weight: 700;
    color: var(--text-white);
    border-bottom: 1px solid var(--border-color);
}

.admin-table td {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-sub);
}

.admin-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.status-badge.active {
    background: rgba(16, 185, 129, 0.15);
    color: #34D399;
}

.status-badge.inactive {
    background: rgba(148, 163, 184, 0.15);
    color: #94A3B8;
}

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

/* ==============================================================================
   SEÇÃO DE PIXELS
   ============================================================================== */

.pixel-card-header {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 1.2rem;
}

.pixel-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #FFF;
}

.meta-icon { background: #1877F2; }
.google-icon { background: #EA4335; }
.tiktok-icon { background: #000000; border: 1px solid rgba(255, 255, 255, 0.2); }

/* ==============================================================================
   GALERIA DE ADMIN
   ============================================================================== */

.gallery-admin-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.2rem;
}

.gallery-admin-card {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}

.gallery-admin-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.gallery-admin-info {
    padding: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gallery-admin-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==============================================================================
   MODAL
   ============================================================================== */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 9999;
}

.modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 580px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-white);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

/* ==============================================================================
   TOAST NOTIFICATION
   ============================================================================== */

.admin-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 0.9rem 1.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 10000;
    display: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.admin-toast.success {
    display: block;
    background: #10B981;
    color: #FFF;
}

.admin-toast.error {
    display: block;
    background: #EF4444;
    color: #FFF;
}

/* Responsividade */
@media (max-width: 900px) {
    .dashboard-layout { flex-direction: column; }
    .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border-color); }
    .form-grid-3, .form-grid-2 { grid-template-columns: 1fr; }
    .gallery-admin-grid { grid-template-columns: repeat(2, 1fr); }
}
