/**
 * Visimob — Sistema de Orçamentos
 * Estilos customizados sobre Bootstrap 5.3
 *
 * Variáveis globais, sidebar, navbar, cards de status, componentes de
 * cópia de link e ajustes de layout responsivo.
 */

/* ── Fonte ─────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Variáveis ─────────────────────────────────────────────────────── */
:root {
    --bs-font-sans-serif: 'Inter', sans-serif;
    --vm-primary: #1A1A1A;
    --vm-primary-light: #2D2D2D;
    --vm-accent: #d54f4a;
    --vm-accent-hover: #b5403c;
    --vm-bg: #f0f2f5;
    --vm-sidebar-width: 260px;
}

body {
    font-family: var(--bs-font-sans-serif);
    background-color: var(--vm-bg);
}

/* ── Override btn-primary Bootstrap ────────────────────────────────── */
.btn-primary {
    --bs-btn-bg: var(--vm-accent);
    --bs-btn-border-color: var(--vm-accent);
    --bs-btn-hover-bg: var(--vm-accent-hover);
    --bs-btn-hover-border-color: var(--vm-accent-hover);
    --bs-btn-active-bg: var(--vm-accent-hover);
    --bs-btn-active-border-color: var(--vm-accent-hover);
    --bs-btn-disabled-bg: var(--vm-accent);
    --bs-btn-disabled-border-color: var(--vm-accent);
}

.btn-outline-primary {
    --bs-btn-color: var(--vm-accent);
    --bs-btn-border-color: var(--vm-accent);
    --bs-btn-hover-bg: var(--vm-accent);
    --bs-btn-hover-border-color: var(--vm-accent);
    --bs-btn-active-bg: var(--vm-accent-hover);
    --bs-btn-active-border-color: var(--vm-accent-hover);
}

/* ── Texto accent ──────────────────────────────────────────────────── */
.accent {
    color: var(--vm-accent);
}

.text-primary {
    color: var(--vm-accent) !important;
}

/* ── Sidebar ───────────────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--vm-sidebar-width);
    background: var(--vm-primary);
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 1050;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
    color: #fff;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.sidebar-brand:hover {
    color: #fff;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.sidebar-nav .nav-link {
    color: rgba(255, 255, 255, 0.7);
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-nav .nav-link.active {
    color: #fff;
    background: rgba(213, 79, 74, 0.15);
    border-left-color: var(--vm-accent);
}

.sidebar-nav .nav-link i {
    margin-right: 0.75rem;
    font-size: 1.1rem;
    width: 1.2rem;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

.sidebar-user i {
    font-size: 1.2rem;
}

/* ── Mobile navbar ─────────────────────────────────────────────────── */
.mobile-navbar {
    background: var(--vm-primary) !important;
}

/* ── Offcanvas dark ────────────────────────────────────────────────── */
.offcanvas-dark {
    background: var(--vm-primary);
    color: #fff;
}

.offcanvas-dark .nav-link {
    color: rgba(255, 255, 255, 0.7);
    padding: 0.6rem 0;
    font-weight: 500;
}

.offcanvas-dark .nav-link:hover {
    color: #fff;
}

.offcanvas-dark .nav-link i {
    margin-right: 0.75rem;
    width: 1.2rem;
    text-align: center;
}

/* ── Main content ──────────────────────────────────────────────────── */
.main-content {
    margin-left: var(--vm-sidebar-width);
    min-height: 100vh;
}

@media (max-width: 991.98px) {
    .main-content {
        margin-left: 0;
        padding-top: 56px;  /* altura da navbar mobile */
    }
}

/* ── Top bar ───────────────────────────────────────────────────────── */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

/* ── Content wrapper ───────────────────────────────────────────────── */
.content-wrapper {
    padding: 1.5rem;
}

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

/* ── Status badges ─────────────────────────────────────────────────── */
.badge-rascunho {
    background-color: #6b7280 !important;
    color: #fff;
}

.badge-aguardando {
    background-color: #f59e0b !important;
    color: #fff;
}

.badge-recebidos {
    background-color: #3b82f6 !important;
    color: #fff;
}

.badge-aprovado {
    background-color: #10b981 !important;
    color: #fff;
}

.badge-concluido {
    background-color: #6366f1 !important;
    color: #fff;
}

.badge-cancelado {
    background-color: #ef4444 !important;
    color: #fff;
}

/* ── Stat icon (dashboard) ─────────────────────────────────────────── */
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

/* ── Link copy box ─────────────────────────────────────────────────── */
.link-copy-box {
    max-width: 340px;
}

.link-copy-box .form-control {
    font-size: 0.75rem;
    background-color: #f8f9fa;
}

/* ── Cards ─────────────────────────────────────────────────────────── */
.card {
    border-radius: 0.75rem;
}

.card-header {
    border-radius: 0.75rem 0.75rem 0 0 !important;
}

/* ── Public container ──────────────────────────────────────────────── */
.public-container {
    max-width: 900px;
}

/* ── Tables ────────────────────────────────────────────────────────── */
.table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #6b7280;
}

/* ── Quote card selection (public approval) ────────────────────────── */
.quote-card {
    transition: all 0.2s ease;
    cursor: pointer;
}

.quote-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

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

.breadcrumb-item a {
    color: var(--vm-accent);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

/* ── Scrollbar customizada ─────────────────────────────────────────── */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

/* ── Alerts ────────────────────────────────────────────────────────── */
.alert {
    border-radius: 0.75rem;
    border: none;
}

/* ── Forms ─────────────────────────────────────────────────────────── */
.form-control:focus,
.form-select:focus {
    border-color: var(--vm-accent);
    box-shadow: 0 0 0 0.2rem rgba(213, 79, 74, 0.15);
}

.form-check-input:checked {
    background-color: var(--vm-accent);
    border-color: var(--vm-accent);
}

/* ── Item rows (quote form) ────────────────────────────────────────── */
.item-row {
    background: #fafbfc;
    transition: background 0.2s ease;
}

.item-row:hover {
    background: #f0f2f5;
}

/* ── Print styles ──────────────────────────────────────────────────── */
@media print {
    .sidebar,
    .mobile-navbar,
    .top-bar,
    .btn,
    .link-copy-box {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }
}
