/* ============================================================
   LAVITTA - Admin Panel CSS
   ============================================================ */
:root {
    --teal: #2BBFB3;
    --teal-dark: #1a9e93;
    --teal-deep: #1a3a38;
    --teal-light: #e0f7f5;
    --sidebar-w: 240px;
    --topbar-h: 64px;
    --font: 'DM Sans', sans-serif;
    --font-d: 'Cormorant Garamond', serif;
    --radius: 12px;
    --shadow: 0 2px 16px rgba(0,0,0,0.08);
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-500: #64748b;
    --gray-700: #334155;
    --gray-900: #0f172a;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font); background: var(--gray-50); color: var(--gray-700); display: flex; min-height: 100vh; }

/* ============ SIDEBAR ============ */
.sidebar {
    width: var(--sidebar-w);
    background: var(--teal-deep);
    height: 100vh;
    position: fixed;
    top: 0; left: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-brand img { height: 40px; filter: brightness(10); }
.sidebar-brand span { color: rgba(255,255,255,0.6); font-size: 0.78rem; font-weight: 500; letter-spacing: 1px; text-transform: uppercase; }
.sidebar-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 8px;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}
.nav-item:hover { background: rgba(43,191,179,0.15); color: var(--teal); }
.nav-item.active { background: var(--teal); color: #fff; }
.nav-item i { width: 18px; text-align: center; font-size: 0.95rem; }
.sidebar-footer { padding: 12px; border-top: 1px solid rgba(255,255,255,0.1); }
.nav-item.logout:hover { background: rgba(239,68,68,0.2); color: #f87171; }

/* ============ MAIN ============ */
.admin-main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

/* ============ TOPBAR ============ */
.admin-topbar {
    height: var(--topbar-h);
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow);
}
.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-500);
    font-size: 1.1rem;
    padding: 8px;
    border-radius: 8px;
    display: none;
}
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-link { color: var(--gray-500); text-decoration: none; font-size: 0.85rem; display: flex; align-items: center; gap: 6px; transition: color 0.2s; }
.topbar-link:hover { color: var(--teal); }
.topbar-user { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; font-weight: 500; }
.user-avatar {
    width: 36px; height: 36px;
    background: var(--teal);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-d);
    font-size: 1.1rem;
}

/* ============ CONTENT ============ */
.admin-content { flex: 1; padding: 28px; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.page-header h1 { font-family: var(--font-d); font-size: 1.9rem; color: var(--gray-900); }
.page-header p { color: var(--gray-500); font-size: 0.9rem; margin-top: 4px; }

/* ============ STATS ============ */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    border-left: 4px solid;
}
.stat-card.teal  { border-color: var(--teal); }
.stat-card.blue  { border-color: #3b82f6; }
.stat-card.green { border-color: #10b981; }
.stat-card.orange{ border-color: #f59e0b; }
.stat-card.yellow{ border-color: #eab308; }
.stat-card.purple{ border-color: #8b5cf6; }
.stat-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; background: var(--gray-100); color: var(--gray-500); flex-shrink: 0; }
.stat-card.teal  .stat-icon { background: var(--teal-light); color: var(--teal); }
.stat-card.blue  .stat-icon { background: #eff6ff; color: #3b82f6; }
.stat-card.green .stat-icon { background: #d1fae5; color: #10b981; }
.stat-card.orange.stat-icon { background: #fef3c7; color: #f59e0b; }
.stat-value { display: block; font-size: 1.4rem; font-weight: 700; color: var(--gray-900); }
.stat-label { font-size: 0.8rem; color: var(--gray-500); font-weight: 500; }

/* ============ CARDS ============ */
.dashboard-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; }
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--gray-100); }
.card-header h3 { font-size: 0.95rem; font-weight: 600; color: var(--gray-700); display: flex; align-items: center; gap: 8px; }
.card-header h3 i { color: var(--teal); }
.card-link { font-size: 0.82rem; color: var(--teal); text-decoration: none; font-weight: 500; }
.card-body { padding: 16px 20px; }

/* ============ TABLE ============ */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.table th { padding: 10px 12px; text-align: left; font-weight: 600; color: var(--gray-500); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px; background: var(--gray-50); }
.table td { padding: 12px; border-bottom: 1px solid var(--gray-100); color: var(--gray-700); }
.table tbody tr:hover { background: var(--gray-50); }
.table tbody tr:last-child td { border-bottom: none; }

/* ============ BADGES ============ */
.badge { display: inline-block; padding: 3px 10px; border-radius: 50px; font-size: 0.75rem; font-weight: 600; }
.badge-agendado  { background: #dbeafe; color: #1d4ed8; }
.badge-confirmado{ background: #d1fae5; color: #065f46; }
.badge-realizado { background: var(--teal-light); color: var(--teal-dark); }
.badge-faltou    { background: #fee2e2; color: #991b1b; }
.badge-cancelado { background: var(--gray-100); color: var(--gray-500); }
.badge-pendente  { background: #fef3c7; color: #92400e; }
.badge-pago      { background: #d1fae5; color: #065f46; }
.badge-vencido   { background: #fee2e2; color: #991b1b; }
.badge-ativo     { background: #d1fae5; color: #065f46; }
.badge-inativo   { background: var(--gray-100); color: var(--gray-500); }
.badge-novo      { background: #ede9fe; color: #5b21b6; }
.badge-contatado { background: #dbeafe; color: #1d4ed8; }

/* ============ LEADS LIST ============ */
.leads-list { display: flex; flex-direction: column; gap: 12px; }
.lead-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--gray-100); }
.lead-item:last-child { border-bottom: none; }
.lead-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--teal); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--font-d); font-size: 1.1rem; flex-shrink: 0; }
.lead-info { flex: 1; }
.lead-info strong { display: block; font-size: 0.9rem; color: var(--gray-900); }
.lead-info span { font-size: 0.8rem; color: var(--gray-500); }
.lead-wpp { color: #25D366; font-size: 1.3rem; text-decoration: none; }

/* ============ EMPTY STATE ============ */
.empty-state { text-align: center; padding: 40px 20px; color: var(--gray-500); }
.empty-state i { font-size: 2.5rem; color: var(--gray-200); display: block; margin-bottom: 12px; }
.empty-state p { font-size: 0.9rem; }

/* ============ FORMS ============ */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 6px; color: var(--gray-700); }
.form-group label i { color: var(--teal); margin-right: 6px; }
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-family: var(--font);
    font-size: 0.92rem;
    color: var(--gray-900);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(43,191,179,0.1); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ============ BUTTONS ============ */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 8px; font-family: var(--font); font-weight: 600; font-size: 0.9rem; border: none; cursor: pointer; text-decoration: none; transition: all 0.2s; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); }
.btn-outline { background: #fff; color: var(--teal); border: 2px solid var(--teal); }
.btn-outline:hover { background: var(--teal-light); }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 6px 14px; font-size: 0.82rem; }

/* ============ LOGIN PAGE ============ */
.login-page { background: linear-gradient(135deg, #f0faf9 0%, #d4f4f1 100%); justify-content: center; align-items: center; min-height: 100vh; }
.login-wrap { width: 100%; max-width: 420px; padding: 20px; }
.login-brand { text-align: center; margin-bottom: 28px; }
.login-brand img { height: 80px; object-fit: contain; }
.login-brand p { color: var(--gray-500); font-size: 0.9rem; margin-top: 8px; }
.login-card { background: #fff; border-radius: 16px; padding: 40px; box-shadow: 0 20px 60px rgba(43,191,179,0.15); }
.login-card h2 { font-family: var(--font-d); font-size: 1.7rem; color: var(--teal-deep); margin-bottom: 24px; }
.btn-login { width: 100%; justify-content: center; padding: 14px; background: var(--teal); color: #fff; border: none; border-radius: 8px; font-family: var(--font); font-size: 1rem; font-weight: 600; cursor: pointer; transition: background 0.2s; margin-top: 8px; }
.btn-login:hover { background: var(--teal-dark); }
.back-site { display: block; text-align: center; margin-top: 20px; color: var(--gray-500); font-size: 0.88rem; text-decoration: none; }
.back-site:hover { color: var(--teal); }
.alert-error, .alert-success { padding: 12px 16px; border-radius: 8px; font-size: 0.88rem; font-weight: 500; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }

/* ============ ACTIONS ROW ============ */
.actions-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 16px; }
.search-input { flex: 1; max-width: 320px; padding: 10px 14px; border: 2px solid var(--gray-200); border-radius: 8px; font-family: var(--font); font-size: 0.9rem; outline: none; transition: border-color 0.2s; }
.search-input:focus { border-color: var(--teal); }

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .sidebar-toggle { display: flex; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }
}
