/* FILE: public/assets/css/app.css */

/* ── Variables ─────────────────────────────────────────────── */
:root {
    --primary:        #E6007E;
    --primary-dark:   #b50063;
    --primary-light:  #fce7f3;
    --secondary:      #662483;
    /* Bootstrap overrides */
    --bs-primary:     #E6007E;
    --bs-primary-rgb: 230, 0, 126;
    --bs-link-color:  #E6007E;
    --bs-link-hover-color: #b50063;
    /* End Bootstrap overrides */
    --sidebar-bg:     #1a1d23;
    --sidebar-hover:  #252832;
    --sidebar-active: #E6007E;
    --sidebar-width:  240px;
    --topbar-h:       56px;
    --text-main:      #1e2029;
    --text-muted:     #6b7280;
    --border:         #e5e7eb;
    --bg-page:        #f4f6fa;
    --card-bg:        #ffffff;
    --radius:         10px;
    --shadow:         0 1px 4px rgba(0,0,0,.08);
}

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

body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 14px;
    color: var(--text-main);
    background: var(--bg-page);
}

/* ── Layout ─────────────────────────────────────────────────── */
.crm-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 1000;
    transition: transform .25s ease;
}

.sidebar-logo {
    padding: 20px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,.07);
}

.logo-icon {
    width: 34px; height: 34px;
    background: var(--primary);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 16px;
    flex-shrink: 0;
}

.logo-text {
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: .3px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 7px;
    color: rgba(255,255,255,.65);
    text-decoration: none;
    font-weight: 500;
    transition: background .15s, color .15s;
    margin-bottom: 2px;
}
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; }

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,.07);
}

/* ── Main Content ───────────────────────────────────────────── */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    transition: margin-left .25s ease;
    width: calc(100% - var(--sidebar-width));
}

.topbar {
    height: var(--topbar-h);
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    justify-content: space-between;
}

.topbar-title {
    font-size: 1.15rem;
    font-weight: 600;
}

.content-area {
    padding: 24px;
    flex: 1;
    overflow-x: hidden;
}

/* ── Components ─────────────────────────────────────────────── */
.card-crm {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.card-crm-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    display: flex; justify-content: space-between; align-items: center;
}

.card-crm-body {
    padding: 20px;
}

/* Table */
.table { margin-bottom: 0; }
.table thead th {
    background: #f8f9fa;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
}
.table td {
    padding: 12px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
}
.table-hover tbody tr:hover {
    background-color: #fcfcfc;
}

/* Mobile */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show, .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; width: 100%; }
    .sidebar-toggle { display: block; }
}
@media (min-width: 769px) {
    .sidebar-toggle { display: none; }
}

/* ── Logo Fix ────────────────────────────────────────────────── */
.sidebar-logo img {
    max-width: 200px;
    height: auto;
    display: block;
}

/* ── Auth/Login Page ─────────────────────────────────────────── */
.auth-body {
    background-color: var(--bg-page);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.auth-card {
    background: #fff;
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    text-align: center;
}

.auth-logo {
    margin-bottom: 24px;
}
.auth-logo img {
    max-width: 180px;
    height: auto;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--primary);
}

.btn-crm {
    background-color: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
    padding: 10px;
}
.btn-crm:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* ── Toast Notifications ─────────────────────────────────────── */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}
.toast-notification {
    background: #fff;
    border-left: 4px solid var(--primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 16px;
    margin-bottom: 10px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 300px;
    animation: slideIn 0.3s ease-out;
}
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ── Source Badges ───────────────────────────────────────────── */
.source-badge { font-size: .72rem; font-weight: 600; padding: 3px 8px; border-radius: 999px; color: #fff; }
.source-badge.mautic   { background-color: #0dcaf0; color: #000; }
.source-badge.whatsapp { background-color: #25D366; }
.source-badge.manual   { background-color: #6c757d; }
