/* ARQUIVO: admin/css/admin.css */

/* ADMIN 2.0 - PROFESSIONAL THEME */
:root {
    --primary-dark: #2c3e50;
    --accent-gold: #FFD700;
    --bg-light: #f4f6f9;
    --text-main: #34495e;
    --card-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

body.admin-mode { background-color: var(--bg-light); font-family: 'Lato', sans-serif; }

/* SIDEBAR STYLES */
.master-sidebar { border-right: 2px solid var(--accent-gold); }
.master-icon-logo { font-size: 1.5rem; color: var(--accent-gold); animation: pulse-gold 2s infinite; }

@keyframes pulse-gold {
    0% { transform: scale(1); text-shadow: 0 0 0 rgba(255, 215, 0, 0.4); }
    50% { transform: scale(1.1); text-shadow: 0 0 10px rgba(255, 215, 0, 0.8); }
    100% { transform: scale(1); text-shadow: 0 0 0 rgba(255, 215, 0, 0.4); }
}

/* HEADER & TOP BAR */
.admin-header { margin-bottom: 30px; border-bottom: 1px solid #dfe6e9; padding-bottom: 15px; display: flex; justify-content: space-between; align-items: flex-end; }
.admin-header h1 { font-family: 'Montserrat', sans-serif; font-weight: 900; color: var(--primary-dark); margin-bottom: 5px; }
.admin-header p { color: #7f8c8d; margin: 0; font-size: 0.9rem; }

.header-actions { display: flex; align-items: center; gap: 15px; }
.badge-status-system {
    background: #e1f7e3; color: #2ecc71; padding: 6px 14px;
    border-radius: 20px; font-size: 0.8rem; font-weight: 700;
    display: flex; align-items: center; gap: 8px; border: 1px solid #c3e6cb;
}

/* STATS GRID */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px; margin-bottom: 30px;
}

.stat-card {
    background: white; border-radius: 12px; padding: 20px;
    display: flex; align-items: center; gap: 20px;
    box-shadow: var(--card-shadow); transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(0,0,0,0.08); }

.stat-icon {
    width: 50px; height: 50px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: white;
}
.stat-info h3 { margin: 0 0 5px 0; font-size: 0.75rem; color: #95a5a6; text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px; }
.stat-info span { font-size: 1.8rem; font-weight: 900; color: var(--primary-dark); line-height: 1; }

/* Stat Colors */
.stat-card.blue .stat-icon { background: linear-gradient(135deg, #3498db, #2980b9); box-shadow: 0 4px 10px rgba(52,152,219,0.3); }
.stat-card.green .stat-icon { background: linear-gradient(135deg, #2ecc71, #27ae60); box-shadow: 0 4px 10px rgba(46,204,113,0.3); }
.stat-card.purple .stat-icon { background: linear-gradient(135deg, #9b59b6, #8e44ad); box-shadow: 0 4px 10px rgba(155,89,182,0.3); }
.stat-card.orange .stat-icon { background: linear-gradient(135deg, #e67e22, #d35400); box-shadow: 0 4px 10px rgba(230,126,34,0.3); }

/* CARDS & CONTAINERS */
.admin-card {
    background: white; border-radius: 12px;
    box-shadow: var(--card-shadow); margin-bottom: 30px; overflow: hidden;
}
.card-header {
    padding: 20px; background: #ffffff; border-bottom: 1px solid #f1f2f6;
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px;
}
.card-header h3 { margin: 0; font-size: 1.1rem; color: var(--primary-dark); font-weight: 700; }
.card-body { padding: 20px; }

/* FILTERS & INPUTS */
.filter-group { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search-box { position: relative; display: flex; align-items: center; }
.search-box i { position: absolute; left: 12px; color: #95a5a6; pointer-events: none; }
.admin-search-input { padding: 10px 10px 10px 38px; border: 1px solid #dfe6e9; border-radius: 8px; width: 280px; outline: none; transition: border-color 0.2s; font-family: inherit; }
.admin-search-input:focus { border-color: #3498db; box-shadow: 0 0 0 3px rgba(52,152,219,0.1); }
.admin-select { padding: 10px; border: 1px solid #dfe6e9; border-radius: 8px; background-color: #f8f9fa; font-family: inherit; outline: none; cursor: pointer; }

/* CONTROLS AREA */
.compact-card .card-body { padding: 15px 20px; }
.flex-row { display: flex; gap: 20px; align-items: center; }
.justify-between { justify-content: space-between; width: 100%; }
.controls-area { display: flex; align-items: center; gap: 10px; }
.small-select { padding: 6px 10px; font-size: 0.85rem; }
.small-btn { padding: 6px 15px; font-size: 0.85rem; }

.btn-admin-action {
    background: var(--primary-dark); color: white; border: none;
    padding: 10px 20px; border-radius: 6px; cursor: pointer; font-weight: bold; transition: 0.2s;
}
.btn-admin-action:hover { background: #34495e; transform: translateY(-1px); }

/* TABLE STYLES */
.table-responsive { width: 100%; overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 680px; }
.admin-table th { background: #f8f9fa; border-bottom: 2px solid #eee; padding: 15px; text-align: left; text-transform: uppercase; font-size: 0.75rem; color: #95a5a6; letter-spacing: 0.5px; font-weight: 700; }
.admin-table td { padding: 12px 15px; border-bottom: 1px solid #f1f2f6; vertical-align: middle; }
.admin-table tr:hover { background-color: #fafbfc; }
.table-footer { padding: 15px 20px; border-top: 1px solid #eee; text-align: right; color: #95a5a6; font-size: 0.85rem; background: #fafafa; }

/* USER CELLS */
.user-cell { display: flex; align-items: center; gap: 12px; }
.table-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid white; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.user-info-text { display: flex; flex-direction: column; }
.user-info-text strong { font-size: 0.9rem; color: var(--primary-dark); }
.user-info-text small { color: #b2bec3; font-size: 0.8rem; }

/* ACTION BUTTONS (TABLE) */
.btn-ban-action { background: white; color: #95a5a6; border: 1px solid #dfe6e9; width: 34px; height: 34px; border-radius: 6px; cursor: pointer; transition: 0.2s; display: inline-flex; align-items: center; justify-content: center; }
.btn-ban-action:hover { background: #fee; color: #e74c3c; border-color: #e74c3c; }
.btn-ban-action.banned { background: #e74c3c; color: white; border-color: #e74c3c; }
.btn-icon-save { background: var(--primary-dark); color: white; border: none; width: 34px; height: 34px; border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.btn-icon-save:hover { background: #34495e; }

/* POSTS MODERATION GRID */
.admin-feed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; padding: 10px 0; }
.admin-post-card { background: white; border: 1px solid #eee; border-radius: 8px; overflow: hidden; position: relative; box-shadow: 0 2px 10px rgba(0,0,0,0.03); transition: transform 0.2s; }
.admin-post-card:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.08); }
.admin-post-header { padding: 10px 15px; background: #fafafa; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; color: #555; }
.btn-delete-post { background: transparent; color: #e74c3c; border: none; font-size: 1rem; width: 30px; height: 30px; border-radius: 4px; cursor: pointer; transition: 0.2s; }
.btn-delete-post:hover { background: #fee; }
.admin-post-img { width: 100%; height: 160px; object-fit: cover; }
.admin-post-text { padding: 15px; font-size: 0.9rem; color: #2c3e50; margin: 0; line-height: 1.4; }

/* --- GRID DE INTERFACES (NOVO) --- */
.interfaces-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px; margin-top: 20px;
}

.interface-card {
    background: white; border-radius: 16px; padding: 30px;
    position: relative; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #eee; transition: all 0.3s ease;
    display: flex; flex-direction: column; gap: 15px;
}
.interface-card:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0,0,0,0.1); }

.if-icon { width: 60px; height: 60px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; margin-bottom: 10px; }
.if-bg-icon { position: absolute; bottom: -20px; right: -20px; font-size: 8rem; opacity: 0.05; pointer-events: none; transform: rotate(-15deg); }

.if-content h3 { margin: 0 0 5px 0; font-size: 1.2rem; color: var(--primary-dark); font-weight: 800; }
.if-content p { color: #7f8c8d; font-size: 0.9rem; margin-bottom: 20px; line-height: 1.4; }

.btn-access-interface {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    padding: 12px 20px; border-radius: 8px; text-decoration: none;
    font-weight: 700; font-size: 0.9rem; transition: 0.2s; border: none; cursor: pointer; width: 100%;
}
.btn-access-interface.disabled { background: #eee; color: #aaa; cursor: not-allowed; }

/* TEMAS */
/* Nutricionista */
.nutri-theme { border-bottom: 4px solid #2ecc71; }
.nutri-theme .if-icon { background: #eafaf1; color: #2ecc71; }
.nutri-theme .btn-access-interface:not(.disabled) { background: #2ecc71; color: white; }
.nutri-theme .btn-access-interface:not(.disabled):hover { background: #27ae60; box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3); }

/* Estudante (Roxo) */
.student-theme { border-bottom: 4px solid #764ba2; }
.student-theme .if-icon { background: #f3e8ff; color: #764ba2; }
.student-theme .btn-access-interface:not(.disabled) { background: #764ba2; color: white; }
.student-theme .btn-access-interface:not(.disabled):hover { background: #5b3a7d; box-shadow: 0 4px 12px rgba(118, 75, 162, 0.3); }

/* Personal */
.pe-theme { border-bottom: 4px solid #e67e22; }
.pe-theme .if-icon { background: #fdf2e9; color: #e67e22; }

/* Médico */
.doctor-theme { border-bottom: 4px solid #3498db; }
.doctor-theme .if-icon { background: #eaf6fc; color: #3498db; }

/* Responsive */
@media (max-width: 768px) {
    .header-actions { display: none; }
    .filter-group { width: 100%; }
    .search-box, .admin-search-input { width: 100%; }

    .admin-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .card-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .controls-area,
    .flex-row,
    .justify-between {
        width: 100%;
        flex-wrap: wrap;
        gap: 10px;
    }

    .admin-table {
        min-width: 560px;
    }

    .admin-table th,
    .admin-table td {
        padding: 10px;
    }

    .interfaces-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .interface-card {
        padding: 20px;
    }
}
/* =======================================================
 * OFF-CANVAS SEARCH DRAWER (PORTAL PATTERN) - GLOBAL
 * ======================================================= */
.insta-search-drawer {
    position: fixed; top: 0; left: 0; width: 100%; max-width: 350px; height: 100vh;
    background-color: #ffffff; box-shadow: 4px 0 15px rgba(0,0,0,0.1); z-index: 10000; 
    transform: translateX(-100%); transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    display: flex; flex-direction: column;
}
.insta-search-drawer.active { transform: translateX(0); }
.insta-drawer-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 15px 15px; }
.insta-drawer-header h2 { font-size: 1.2rem; font-weight: 800; color: #1a1a1a; margin: 0; }
.insta-close-btn { background: none; border: none; font-size: 1.2rem; color: #65676b; cursor: pointer; transition: color 0.2s ease; }
.insta-close-btn:hover { color: #e74c3c; }

/* Input Trapping Box */
.insta-drawer-search-container { padding: 0 15px 15px; border-bottom: 1px solid #eaeaea; }
.insta-input-wrapper { position: relative; width: 100%; }
.insta-input-wrapper i { position: absolute; top: 50%; left: 12px; transform: translateY(-50%); color: #8e8e8e; font-size: 0.9rem; pointer-events: none; }
.insta-drawer-input { width: 100%; padding: 10px 10px 10px 35px; background-color: #efefef; border: none; border-radius: 8px; font-size: 0.95rem; color: #1a1a1a; outline: none; transition: background-color 0.2s; }
.insta-drawer-input:focus { background-color: #e4e4e4; }

/* UX: Sidebar trigger read-only feel */
.sidebar-search input, .mobile-menu-search input { cursor: pointer; }

/* Content Rendering */
.insta-results-area { padding: 15px; overflow-y: auto; flex: 1; }
.insta-user-item { display: flex; align-items: center; padding: 10px; text-decoration: none; color: inherit; border-radius: 8px; transition: background-color 0.2s ease; cursor: pointer; }
.insta-user-item:hover { background-color: #f0f2f5; }
.insta-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; margin-right: 12px; border: 1px solid #eaeaea; }
.insta-user-info { display: flex; flex-direction: column; overflow: hidden; }
.insta-username { font-weight: 700; font-size: 0.95rem; color: #1a1a1a; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.insta-name { font-size: 0.85rem; color: #65676b; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }

/* States */
.insta-state-msg { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px 10px; color: #65676b; }
.insta-state-title { font-weight: 700; color: #1a1a1a; margin-bottom: 5px; }
.insta-state-desc { font-size: 0.9rem; }
.insta-loader-container { display: flex; justify-content: center; padding: 30px 0; }
.insta-spinner { width: 30px; height: 30px; border: 3px solid #f3f3f3; border-top: 3px solid #53954a; border-radius: 50%; animation: insta-spin 1s linear infinite; }
@keyframes insta-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }