/* =====================================================
   ===== CARDS =========================================
===================================================== */

.card-dashboard {
    --card-color: var(--primary);

    background: var(--bg-card);
    color: var(--text);
    border: none;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.card-dashboard::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--card-color);
}

.card-dashboard .icon {
    color: var(--card-color);
}

/* VARIANTES */
.card-blue   { --card-color: #3b82f6; }
.card-green  { --card-color: #22c55e; }
.card-yellow { --card-color: #f59e0b; }
.card-red    { --card-color: #ef4444; }
.card-purple { --card-color: #a855f7; }
.card-aqua   { --card-color: #06b6d4; }


/* =====================================================
   ===== STATUS ========================================
===================================================== */

.badge-status {
    --status-color: var(--success);

    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    min-width: 90px;
    text-align: center;

    background: color-mix(in srgb, var(--status-color) 15%, transparent);
    color: var(--status-color);
}

.status-novo        { --status-color:#22c55e; }
.status-contato     { --status-color:#3b82f6; }
.status-convertido  { --status-color:#a855f7; }
.status-pago        { --status-color:#22c55e; }
.status-pendente    { --status-color:#f59e0b; }
.status-atrasado    { --status-color:#ef4444; }
.status-cancelado   { --status-color:#6b7280; }


/* =====================================================
   ===== TEXTOS ========================================
===================================================== */

.text-muted,
.text-secondary {
    color: var(--text-muted) !important;
}


/* =====================================================
   ===== TOPO DA PÁGINA ================================
===================================================== */

.topo-pagina h5 {
    margin: 0;
}

@media (max-width: 768px) {

    .topo-pagina {
        flex-direction: column;
        align-items: center !important;
        text-align: center;
        gap: 10px;
    }

    .topo-pagina button {
        width: 100%;
        max-width: 250px;
    }
}


/* =====================================================
   ===== KANBAN ========================================
===================================================== */

.kanban-column {
    min-height: 500px;
    padding: 10px;
    background: var(--bg-sidebar);
    border-radius: 10px;

    max-height: 500px;
    overflow-y: auto;
    scroll-behavior: smooth;

    padding-right: 10px;
}

/* SCROLL */

.kanban-column::-webkit-scrollbar {
    width: 10px;
}

.kanban-column::-webkit-scrollbar-track {
    background: var(--bg-hover);
    border-radius: 5px;
}

.kanban-column::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
    border: 2px solid var(--text-muted);
}

.kanban-column::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}


/* CARDS */

.kanban-card {
    background: var(--bg-hover);
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 8px;
    color: var(--text);
    transition: 0.2s;
}

.kanban-card:hover {
    background: var(--bg-card);
}

.kanban-card .status-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}

.kanban-card .status-row label {
    font-weight: bold;
    color: var(--text);
}

.kanban-card .status-row select {
    flex: 1;
    padding: 2px 6px;
    font-size: 0.9rem;
}


/* =====================================================
   ===== BOTÕES ========================================
===================================================== */

.btn-dark {
    background: var(--bg-hover);
    color: var(--text);
}

.btn-dark:hover {
    background: var(--bg-card);
}


/* =====================================================
   ===== INPUTS ========================================
===================================================== */

.input-group-text {
    background: var(--bg-hover);
    color: var(--text-muted);
}

.form-control,
.form-select {
    background: var(--bg-hover) !important;
    color: var(--text);
    border: 1px solid transparent;
}

.form-control:focus,
.form-select:focus {
    border: 1px solid var(--primary);
    box-shadow: none;
}

/* PLACEHOLDER GLOBAL */
.form-control::placeholder {
    color: var(--text-muted);
    opacity: 1; /* importante para Firefox */
}

/* versões antigas de navegador (extra seguro) */
.form-control::-webkit-input-placeholder {
    color: var(--text-muted);
}

.form-control:-ms-input-placeholder {
    color: var(--text-muted);
}


/* =====================================================
   ===== BUSCA =========================================
===================================================== */

.busca-box {
    min-width: 220px;
    max-width: 300px;
    color: var(--text);
}

.busca-box .form-control {
    background: var(--bg-hover) !important;
    color: var(--text) !important;
    border: none !important;
    border-radius: 0 20px 20px 0 !important;
    padding-right: 35px;
    box-shadow: none !important;
}

.busca-box input {
    background: var(--bg-hover) !important;
    color: var(--text);
}

.busca-box input::placeholder {
    color: var(--text-muted);
}

.busca-box .input-group-text {
    background: var(--bg-hover);
    color: var(--text-muted);
    border-radius: 20px 0 0 20px;
}

.btn-limpar {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    display: none;
}

.btn-limpar:hover {
    color: var(--text);
}

/* ===== SELECT SYSTEM ===== */
.status-select,
.form-select,
select.form-control {

    background: var(--bg-hover) !important;
    color: var(--text) !important;

    border: 1px solid var(--border-color) !important;
    border-radius: var(--sys-border-radius);

    transition: var(--transition-fast);
}

/* foco */
.status-select:focus,
.form-select:focus,
select.form-control:focus {

    background: var(--bg-hover);
    color: var(--text);

    border-color: var(--primary);
    box-shadow: none;
}

/* opções internas */
select option {
    background: var(--bg-card);
    color: var(--text);
}

/* =====================================================
   ===== PROGRESS ======================================
===================================================== */

.progress {
    background: var(--sys-card-bg);
    border-radius: 10px;
}

.progress-bar {
    transition: width 0.8s ease;
}


/* =====================================================
   ===== UTILIDADES DE BACKGROUND ======================
===================================================== */

.bg-sys-danger  { background-color: var(--sys-danger) !important; }
.bg-sys-warning { background-color: var(--sys-warning) !important; }
.bg-sys-success { background-color: var(--sys-success) !important; }

/* =====================================
    TOAST SYSTEM
===================================== */

/* CONTAINER */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
}

/* ===============================
   TOAST BASE
================================ */
.toast-custom {
    font-family: 'Inter', sans-serif;
    background: var(--surface-2);
    color: var(--text);
    border-radius: var(--sys-border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    min-width: 320px;
    display: flex;
    position: relative;
}

/* ===============================
   BARRA LATERAL (IGUAL CARD STATUS)
================================ */
.toast-custom::before {
    content: "";
    width: 5px;
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
}

/* STATUS COLORS */
.toast-success::before {
    background: var(--sys-success);
}

.toast-danger::before {
    background: var(--sys-danger);
}

.toast-warning::before {
    background: var(--sys-warning);
}

.toast-info::before {
    background: var(--primary);
}

/* ===============================
   CONTENT
================================ */
.toast-content {
    padding: 14px 18px;
    width: 100%;
}

/* HEADER */
.toast-header-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.toast-title {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* MESSAGE */
.toast-message {
    color: var(--text-muted);
    font-size: 14px;
}

/* CLOSE BUTTON */
.toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition-fast);
}

.toast-close:hover {
    color: var(--text);
}

/* ===============================
   PROGRESS BAR
================================ */
.progress-bar-timer {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: var(--primary);
}

/* ===============================
   ANIMAÇÕES
================================ */
@keyframes slideIn {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

@keyframes progressFill {
    from { width: 0%; }
    to { width: 100%; }
}

.slide-in {
    animation: slideIn .4s ease forwards;
}

.slide-out {
    animation: slideOut .4s ease forwards;
}