/* =============================================
   WebBooster BOT Manager - CSS Principal
   ============================================= */

:root {
    --sidebar-width: 240px;
    --sidebar-bg: #1a1a2e;
    --sidebar-hover: #16213e;
    --sidebar-active: #0f3460;
    --topbar-height: 56px;
    --brand-green: #25d366;
    --brand-green-dark: #1da851;
}

/* ── Reset / Base ──────────────────────────── */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f0f2f5;
    color: #333;
    overflow-x: hidden;
}

/* ── LOGIN ─────────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    padding: 1rem;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

.login-logo .bi-whatsapp {
    font-size: 3rem;
    color: var(--brand-green);
    display: block;
    margin-bottom: 0.5rem;
}

.login-logo h4 {
    margin: 0;
    font-weight: 700;
    color: #1a1a2e;
    font-size: 1.4rem;
}

.btn-login {
    background: var(--brand-green);
    border-color: var(--brand-green);
    font-weight: 600;
    padding: 0.65rem;
    font-size: 1rem;
    transition: background 0.2s;
}

.btn-login:hover {
    background: var(--brand-green-dark);
    border-color: var(--brand-green-dark);
}

/* ── APP SHELL ─────────────────────────────── */
#app-shell {
    display: flex;
    min-height: 100vh;
}

/* ── SIDEBAR ───────────────────────────────── */
#sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    transition: transform 0.3s ease;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    min-height: var(--topbar-height);
}

.sidebar-brand {
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.5px;
}

.sidebar-menu {
    list-style: none;
    padding: 0.75rem 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.2rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    font-size: 0.92rem;
}

.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
    border-left-color: var(--brand-green);
}

.sidebar-link.active {
    background: var(--sidebar-active);
    color: #fff;
    border-left-color: var(--brand-green);
}

.sidebar-link .bi {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 0.9rem 1.2rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1035;
}

/* ── MAIN WRAPPER ──────────────────────────── */
#main-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── TOPBAR ────────────────────────────────── */
.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* ── MAIN CONTENT ──────────────────────────── */
.main-content {
    padding: 1.5rem;
    flex: 1;
}

/* ── PAGE HEADER ───────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page-header h3 {
    margin: 0;
    font-weight: 700;
    font-size: 1.4rem;
    color: #1a1a2e;
}

/* ── CARDS ─────────────────────────────────── */
.card {
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    border-radius: 12px;
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    border-radius: 12px 12px 0 0 !important;
    padding: 1rem 1.25rem;
    font-weight: 600;
}

/* ── TABLES ────────────────────────────────── */
.table-responsive {
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    border-bottom: 2px solid #e9ecef;
}

.table td {
    vertical-align: middle;
    font-size: 0.9rem;
}

.table tbody tr:hover {
    background: #f8fff9;
}

/* ── BADGES ────────────────────────────────── */
.badge-status-ativo   { background: #d4edda; color: #155724; }
.badge-status-inativo { background: #f8d7da; color: #721c24; }

/* ── STATS CARDS (dashboard) ───────────────── */
.stat-card {
    border-radius: 12px;
    padding: 1.25rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    opacity: 0.85;
    margin-top: 0.2rem;
}

/* ── MENU EDITOR ───────────────────────────── */
.menu-item-row {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    padding: 0.75rem;
}

.menu-item-row:hover {
    border-color: #ced4da;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.item-order-badge {
    width: 28px;
    height: 28px;
    background: var(--sidebar-active);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.btn-move {
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

/* WhatsApp fields dentro do item */
.whatsapp-fields {
    background: #f8fff9;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 0.5rem;
}

/* ── BREADCRUMB ────────────────────────────── */
.breadcrumb {
    font-size: 0.85rem;
}

.breadcrumb-item a {
    color: var(--brand-green-dark);
    text-decoration: none;
}

/* ── CONTATOS TABLE ────────────────────────── */
.minutos-normal  { color: #198754; font-weight: 600; }
.minutos-warning { color: #fd7e14; font-weight: 600; }
.minutos-danger  { color: #dc3545; font-weight: 600; }

/* ── LOADING ───────────────────────────────── */
.loading-center {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* ── EMPTY STATE ───────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #999;
}

.empty-state .bi {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

/* ── TOASTS ────────────────────────────────── */
.toast-success { --bs-toast-header-color: #155724; border-left: 4px solid #198754; }
.toast-error   { --bs-toast-header-color: #842029; border-left: 4px solid #dc3545; }
.toast-info    { --bs-toast-header-color: #084298; border-left: 4px solid #0d6efd; }

/* ── RESPONSIVE ────────────────────────────── */
@media (max-width: 991.98px) {
    #sidebar {
        transform: translateX(-100%);
    }

    #sidebar.open {
        transform: translateX(0);
    }

    #main-wrapper {
        margin-left: 0;
    }

    #sidebar-overlay.show {
        display: block !important;
    }
}

@media (max-width: 575.98px) {
    .main-content {
        padding: 1rem;
    }

    .page-header h3 {
        font-size: 1.2rem;
    }
}
