/* assets/css/master.css - TEMA PREMIUM + FAB + ABAS FUNCIONAIS */

:root {
    --primary: #D32F2F;
    --primary-dark: #B71C1C;
    --bg-app: #F2F4F8;
    --surface: #FFFFFF;
    --text-main: #1A1A1A;
    --text-grey: #717171;
    --border: #E0E0E0;
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.04);
    --header-height: 60px;
}

body.dark-mode {
    --bg-app: #121212;
    --surface: #1E1E1E;
    --text-main: #E0E0E0;
    --text-grey: #A0A0A0;
    --border: #333;
    --shadow-card: 0 2px 5px rgba(0, 0, 0, 0.5);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    padding-bottom: 80px;
}

/* HEADER APP */
.app-header {
    background: var(--primary);
    color: white;
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.app-title {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* CARDS PREMIUM */
.card {
    background: var(--surface);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-card);
    border: 1px solid transparent;
}

.dark-mode .card {
    border-color: #333;
}

/* --- CORREÇÃO DAS ABAS (O QUE ESTAVA FALTANDO) --- */
.tab-container {
    display: flex;
    background: #E0E0E0;
    border-radius: 8px;
    margin: 10px;
    padding: 3px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: #666;
    font-weight: 600;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
}

.tab-btn.active {
    background: var(--surface);
    color: var(--text-main);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ISSO AQUI FAZ A MÁGICA DE TROCAR A TELA */
.tab-content {
    display: none;
    animation: fadeIn 0.2s ease-in-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- O BOTÃO FLUTUANTE (+) IGUAL DA FOTO --- */
.fab-container {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 999;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 15px;
}

.fab-main {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background-color: #D32F2F;
    color: white;
    box-shadow: 0 4px 15px rgba(211, 47, 47, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    cursor: pointer;
    transition: transform 0.3s;
}

.fab-container.active .fab-main {
    transform: rotate(45deg);
    background-color: #B71C1C;
}

.fab-mini {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    color: white;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px) scale(0.5);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Cores dos botões mini */
.fab-mini.btn-red {
    background: #D32F2F;
}

.fab-mini.btn-orange {
    background: #F57C00;
}

.fab-mini.btn-blue {
    background: #1976D2;
}

/* Animação de entrada */
.fab-container.active .fab-mini {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.fab-container.active .fab-mini:nth-child(2) {
    transition-delay: 0.05s;
}

.fab-container.active .fab-mini:nth-child(3) {
    transition-delay: 0.1s;
}

.fab-container.active .fab-mini:nth-child(4) {
    transition-delay: 0.15s;
}

/* Etiquetas pretas ao lado */
.fab-label {
    position: absolute;
    right: 55px;
    background: rgba(33, 33, 33, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* OUTROS ELEMENTOS (GRID, INPUTS, ETC) */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 5px;
}

.grid-item {
    background: var(--surface);
    border-radius: 12px;
    padding: 15px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: var(--shadow-card);
    cursor: pointer;
    height: 100px;
}

.grid-item .icon-box {
    width: 48px;
    height: 48px;
    background: #FFEBEE;
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65px;
    background: var(--surface);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 900;
    border-top: 1px solid var(--border);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 500;
    width: 25%;
    height: 100%;
}

.nav-item.active {
    color: var(--primary);
}

.input-field {
    width: 100%;
    padding: 12px 0;
    border: none;
    border-bottom: 1px solid #CCC;
    background: transparent;
    margin-bottom: 15px;
    font-size: 1rem;
    color: var(--text-main);
    border-radius: 0;
}

.input-field:focus {
    border-bottom: 2px solid var(--primary);
    outline: none;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
}

.autocomplete-list {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    position: absolute;
    width: 100%;
    z-index: 1000;
}

.autocomplete-item {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

/* TOAST */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: #323232;
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 2000;
}

.toast.show {
    opacity: 1;
}

/* BARRA DE AVISO GLOBAL (CORRIGIDA PARA DESTAQUE) */
.system-broadcast {
    background: #FF9800; /* Laranja: Destaca-se sobre o Vermelho do PDV */
    color: #1A1A1A;      /* Texto escuro para leitura fácil e rápida */
    text-align: center;
    padding: 12px;       /* Um pouco maior para chamar atenção */
    font-size: 0.95rem;
    font-weight: 800;    /* Negrito extra */
    position: sticky;
    top: 0;
    z-index: 2000;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #F57C00; /* Borda sutil para dar acabamento */
    animation: slideDown 0.5s;
}

/* Ícone de fechar mais visível */
.system-broadcast span {
    background: rgba(0,0,0,0.1);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
}
/* --- CORREÇÃO DO MENU DE AÇÕES (ACTION SHEET) --- */

.action-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    /* Faz o menu ficar no rodapé */
    opacity: 0;
    pointer-events: none;
    /* Começa invisível */
    transition: opacity 0.3s;
}

.action-sheet-overlay.active {
    opacity: 1;
    pointer-events: all;
    /* Fica visível quando ativo */
}

.action-sheet {
    background: #FFFFFF;
    width: 100%;
    border-radius: 20px 20px 0 0;
    padding: 20px;
    padding-bottom: 40px;
    transform: translateY(100%);
    /* Começa escondido para baixo */
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.action-sheet-overlay.active .action-sheet {
    transform: translateY(0);
    /* Sobe para a tela */
}

.sheet-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.sheet-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.sheet-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #555;
    text-align: center;
}

.sheet-item:active {
    transform: scale(0.9);
}

.sheet-item .icon-circle {
    width: 50px;
    height: 50px;
    background: #f5f5f5;
    color: #333;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.sheet-item span {
    font-size: 0.7rem;
    font-weight: 600;
}

/* CORES ESPECÍFICAS DOS ÍCONES */
.sheet-item.money .icon-circle {
    background: #E8F5E9;
    color: #2E7D32;
}

.sheet-item.whatsapp .icon-circle {
    background: #E0F2F1;
    color: #00BFA5;
}

.sheet-item.print .icon-circle {
    background: #ECEFF1;
    color: #455A64;
}

.sheet-item.delete .icon-circle {
    background: #FFEBEE;
    color: #C62828;
}

.sheet-item.copy .icon-circle {
    background: #F3E5F5;
    color: #7B1FA2;
}

.sheet-item.status .icon-circle {
    background: #FFF3E0;
    color: #EF6C00;
}

.sheet-item.transfer .icon-circle {
    background: #E3F2FD;
    color: #1565C0;
}
/* ROLAGEM HORIZONTAL */
.scrolling-wrapper {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 10px;
    padding-bottom: 10px;
    /* Espaço para a barra de rolagem não colar */
}
/* --- LISTA DE ITENS EDITÁVEL (NOVA) --- */
.item-edit-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
    transition: all 0.2s;
}

.item-edit-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.item-edit-name {
    font-weight: 700;
    color: #333;
    font-size: 0.95rem;
    line-height: 1.2;
}

.item-edit-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Inputs pequenos e amigáveis */
.input-edit-sm {
    border: 1px solid #ccc;
    background: #f9f9f9;
    border-radius: 4px;
    padding: 8px;
    font-size: 1rem;
    font-weight: bold;
    color: #333;
    text-align: center;
    width: 100%;
}

.input-edit-sm:focus {
    border-color: var(--primary);
    background: white;
    outline: none;
}

.label-sm {
    font-size: 0.7rem;
    color: #888;
    margin-bottom: 2px;
    display: block;
}

.btn-remove-sm {
    background: #FFEBEE;
    color: #D32F2F;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
/* --- ESTILO DO CRM KANBAN (Adicione ao final do master.css) --- */

/* O Quadro Geral */
.kanban-board {
    display: flex;
    gap: 15px;
    height: 100%;
    min-width: 1000px;
    /* Garante que caiba no mobile com rolagem */
    align-items: stretch;
}

/* As Colunas */
.kanban-col {
    flex: 1;
    min-width: 260px;
    /* Largura mínima de cada coluna */
    background: #E0E0E0;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Cabeçalho da Coluna */
.k-header {
    padding: 12px;
    background: #fff;
    border-radius: 8px 8px 0 0;
    font-weight: 800;
    color: #555;
    border-top: 4px solid #ccc;
    /* Cor padrão, muda via HTML */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Contador (0) */
.k-count {
    background: #f0f0f0;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    color: #333;
}

/* Corpo onde ficam os cards */
.k-body {
    padding: 10px;
    overflow-y: auto;
    /* Rolagem vertical dentro da coluna */
    height: 100%;
}

/* O Cartão do Cliente (Lead) */
.k-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: transform 0.2s;
    border-left: 4px solid #ccc;
}

.k-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.btn-mini {
    border: none;
    font-size: 0.75rem;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.btn-mini.green {
    background: #E8F5E9;
    color: #2E7D32;
}