﻿/* ===== Tema Claro Dani Melo (branco + marrons do logo) ===== */
:root {
    /* tons do logo */
    --accent: #7A4A2A;
    /* marrom médio (para links/destaques) */
    --accent-strong: #5F371E;
    /* marrom mais escuro (para botões, títulos) */
    /* fundo e painéis */
    --bg: #ffffff;
    /* fundo principal branco */
    --panel: #f9f6f4;
    /* sidebar e painéis */
    --soft: #fdfcfc;
    /* caixas internas */
    /* textos */
    --text: #5F371E;
    /* marrom escuro */
    --muted: #7A4A2A;
    /* marrom médio (secundário) */
}

/* ===== Reset/estrutura ===== */
html,
body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
}

a {
    text-decoration: none;
    color: var(--accent);
}

a:hover {
    color: var(--accent-strong);
}

/* Layout principal */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--panel);
    padding: 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-right: 1px solid #e1dcd9;
}

/* Marca */
.brand {
    display: flex;

    /* Destaque para rascunho recém-criado */
    .new-draft-row {
        animation: flashHighlight 2.4s ease-in-out 1;
    }
    @keyframes flashHighlight {
        0% { background-color: #fff8c6; }
        50% { background-color: #d8f9d2; }
        100% { background-color: inherit; }
    }
    align-items: center;
    justify-content: center;
    padding: 12px 0;
}

.brand-logo {
    max-height: 180px;
    width: auto;
    display: block;
}

/* Menu lateral */
.menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.menu-sep {
    height: 1px;
    background: #e1dcd9;
    margin: 6px 0;
}

.menu-item {
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--text);
    background: transparent;
}

.menu-item:hover {
    background: #ece7e4;
}

.menu-item.active {
    background: #ece7e4;
    border: 1px solid #e1dcd9;
}

.menu-item.disabled {
    opacity: .55;
    cursor: not-allowed
}

/* Rodapé da sidebar */
.sidebar-footer {
    margin-top: auto;
    color: var(--muted);
}

/* Área de conteúdo */
.content {
    flex: 1;
}

/* ===== Topbar (mobile) ===== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 1040;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: var(--panel);
    border-bottom: 1px solid #e1dcd9;
}

.topbar-title {
    font-weight: 600;
    color: var(--accent-strong);
}

/* ===== Sidebar responsiva ===== */
@media (max-width: 991.98px) {
    .layout {
        position: relative;
    }
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        z-index: 1050;
        width: 260px;
        transition: left .25s ease;
        box-shadow: 0 4px 18px rgba(0,0,0,.18);
    }
    .sidebar.open {
        left: 0;
    }
    .content {
        flex: 1;
        width: 100%;
    }
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.35);
        backdrop-filter: blur(2px);
        z-index: 1045;
        opacity: 0;
        pointer-events: none;
        transition: opacity .25s ease;
    }
    .sidebar-backdrop.show { opacity: 1; pointer-events: all; }
}

/* Ajustes extras para telas muito pequenas */
@media (max-width: 575.98px) {
    .brand-logo { max-height: 120px; }
    .kpi-value { font-size: 22px; }
    .kpi-card { padding: 12px; }
}

/* Títulos/KPIs */
.page-title {
    margin: 0;
    font-weight: 800;
    letter-spacing: .3px;
    color: var(--accent-strong);
}

.kpi-card {
    background: var(--soft);
    border: 1px solid #e1dcd9;
    border-radius: 16px;
    padding: 16px;
}

.kpi-title {
    color: var(--muted);
    font-size: 13px;
}

.kpi-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--accent-strong);
}

/* Cartões/formulários */
.card-like {
    background: var(--soft);
    border: 1px solid #e1dcd9;
    border-radius: 16px;
}

.form-control,
.form-select {
    background: #fff;
    border-color: #cbbfb8;
    color: var(--text);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 .15rem rgba(122, 74, 42, .25);
}

.form-text {
    color: var(--muted);
}

/* Pequenas dicas inline ao lado dos botões nos labels */
.inline-hint {
    font-size: 11.5px;
    font-weight: 400;
    color: var(--muted);
    line-height: 1.2;
    white-space: nowrap;
}

@media (max-width: 992px){
    .inline-hint { white-space: normal; }
}

/* Tabela */
.table> :not(caption)>*>* {
    background-color: transparent;
    color: var(--text);
    border-color: #e1dcd9 !important;
}

.table-dark-subtle {
    background: #f3eeeb;
    color: var(--text);
}

/* Botões */
.actions {
    display: inline-flex;
    gap: .5rem;
}

.btn-action {
    min-width: 90px;
    /* largura mínima igual para ambos */
    height: 30px;
    /* altura fixa */
    padding: 0 12px;
    /* espaçamento horizontal */
    display: flex;
    align-items: center;
    /* centraliza verticalmente */
    justify-content: center;
    /* centraliza horizontalmente */
    font-size: 16px;
    font-weight: 500;
    border-radius: 8px;
    box-sizing: border-box;
    line-height: 1.2;
}

.btn-outline-primary.btn-action,
.btn-outline-danger.btn-action {
    /* se quiser, força a mesma altura em todas as linhas */
    line-height: 1.2;
}


.btn-primary {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
}

.btn-primary:hover {
    filter: brightness(1.1);
}

.btn-outline-primary {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-outline-primary:hover {
    background: var(--accent);
    color: #fff;
}

.btn-outline-danger {
    border-color: #b54848;
    color: #b54848;
}

.btn-outline-danger:hover {
    background: #b54848;
    color: #fff;
}

/* Alertas */
.alert-success {
    background: #eaf4ed;
    color: var(--accent-strong);
    border: 1px solid #c9e1d0;
}

.alert-danger {
    background: #fceaea;
    color: #a94442;
    border: 1px solid #e0b4b4;
}

.alert-warning {
    background: #fff6e5;
    color: #8a6d3b;
    border: 1px solid #e7d3a8;
}

/* ações na tabela: botões com mesma largura/altura */
.actions {
    display: inline-flex;
    gap: .5rem;
}

.btn-action {
    min-width: 84px;
    text-align: center;
    padding: .35rem .6rem;
    line-height: 1.2;
}

/* (garantia) aparência do danger outline */
.btn-outline-danger {
    border-color: #dc3545;
    color: #dc3545;
}

.btn-outline-danger:hover {
    background: #dc3545;
    color: #fff;
}

/* Animação de remoção suave (mini carrinho) */
.fade-out {
    opacity: 0 !important;
    transition: opacity .18s ease;
}