/* ============================================================
   Toolk Lead - estilos globais
   ============================================================ */

:root {
    --tl-brand: #183153;
    --tl-accent: #3B82F6;
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, 0.35) transparent;
}

*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background-color: rgba(100, 116, 139, 0.35);
    border-radius: 9999px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    background-color: #f1f5f9;
}

/* ============ Componentes base ============ */

.tl-input {
    width: 100%;
    border-radius: 0.5rem;
    border: 1px solid rgb(203 213 225);
    background-color: #fff;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: rgb(15 23 42);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    outline: none;
}

.tl-input:focus {
    border-color: var(--tl-accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.tl-input::placeholder {
    color: rgb(148 163 184);
}

.tl-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: rgb(100 116 139);
    margin-bottom: 0.35rem;
}

.tl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border-radius: 0.5rem;
    padding: 0.5rem 0.9rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s ease;
    cursor: pointer;
    white-space: nowrap;
    border: 1px solid transparent;
}

.tl-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tl-btn-primary {
    background: var(--tl-brand);
    color: #fff;
}

.tl-btn-primary:hover:not(:disabled) {
    background: #1d3f6e;
}

.tl-btn-accent {
    background: var(--tl-brand);
    color: #fff;
}

.tl-btn-accent:hover:not(:disabled) {
    background: #1d3f6e;
}

.tl-btn-ghost {
    background: transparent;
    color: rgb(71 85 105);
    border-color: rgb(203 213 225);
}

.tl-btn-ghost:hover:not(:disabled) {
    background: rgb(241 245 249);
}

.tl-btn-danger {
    background: rgb(239 68 68);
    color: #fff;
}

.tl-btn-danger:hover:not(:disabled) {
    background: rgb(220 38 38);
}

.tl-btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
}

.tl-btn-xs {
    padding: 0.2rem 0.45rem;
    font-size: 0.7rem;
}

.tl-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    color: rgb(100 116 139);
    background: transparent;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    cursor: pointer;
}

.tl-icon-btn:hover {
    color: rgb(15 23 42);
    background: rgb(241 245 249);
    border-color: rgb(226 232 240);
}

.tl-icon-btn-danger {
    color: rgb(239 68 68);
}

.tl-icon-btn-danger:hover {
    color: rgb(220 38 38);
    background: rgb(254 242 242);
    border-color: rgb(254 226 226);
}

.tl-menu-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.6rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    color: rgb(51 65 85);
    transition: all 0.15s ease;
}

.tl-menu-item:hover {
    background: rgb(241 245 249);
}

.tl-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.1rem;
    height: 2.1rem;
    padding: 0 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid rgb(226 232 240);
    background: #fff;
    color: rgb(71 85 105);
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.15s ease;
}

.tl-page-btn:hover {
    border-color: var(--tl-accent);
    color: var(--tl-accent);
}

.tl-page-btn-active {
    background: var(--tl-brand);
    border-color: var(--tl-brand);
    color: #fff;
}

.tl-page-btn-active:hover {
    color: #fff;
}

.tl-card {
    background: #fff;
    border-radius: 0.75rem;
    border: 1px solid rgb(226 232 240);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.tl-column {
    background: rgb(248 250 252);
    border: 1px solid rgb(226 232 240);
}

.tl-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
}

.tl-badge-red {
    background: rgb(254 226 226);
    color: rgb(185 28 28);
}

.tl-badge-emerald {
    background: rgb(209 250 229);
    color: rgb(6 95 70);
}

.tl-badge-blue {
    background: rgb(219 234 254);
    color: rgb(30 64 175);
}

.tl-badge-violet {
    background: rgb(237 233 254);
    color: rgb(91 33 182);
}

.tl-badge-slate {
    background: rgb(241 245 249);
    color: rgb(71 85 105);
}

.tl-badge-primary {
    background: var(--tl-brand);
    color: #fff;
}

.tl-link {
    color: var(--tl-accent);
    font-size: 0.875rem;
}

.tl-link:hover {
    text-decoration: underline;
}

/* ============ Sidebar ============ */

.tl-sidebar {
    background: #fff;
}

.tl-nav {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: rgb(71 85 105);
    transition: all 0.15s ease;
}

.tl-nav:hover {
    color: #fff;
    background: var(--tl-brand);
}

.tl-nav-active {
    color: #fff;
    background: var(--tl-brand);
    font-weight: 600;
}

.tl-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: #64748b;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
    cursor: pointer;
    text-decoration: none;
}

.tl-tab:hover {
    color: #0f172a;
    background: #f1f5f9;
}

.tl-tab-active {
    color: var(--tl-accent);
    border-bottom-color: var(--tl-accent);
}

.tl-nav-section {
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgb(100 116 139);
    font-weight: 700;
}

/* ============ Tabelas ============ */

.tl-table {
    width: 100%;
    border-collapse: collapse;
}

.tl-table th {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgb(100 116 139);
    font-weight: 600;
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid rgb(226 232 240);
    white-space: nowrap;
}

.tl-table td {
    padding: 0.65rem 0.75rem;
    font-size: 0.85rem;
    border-bottom: 1px solid rgb(241 245 249);
    vertical-align: middle;
}

.tl-table tbody tr:last-child td {
    border-bottom: 0;
}

.tl-table tbody tr:hover {
    background: rgb(248 250 252);
}

/* ============ Kanban ============ */

.tl-kanban-column {
    min-width: 280px;
    max-width: 320px;
    flex-shrink: 0;
    border-radius: 0.75rem;
    background: rgb(248 250 252);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 12rem);
}

.tl-kanban-list {
    overflow-y: auto;
    padding: 0.5rem;
    flex: 1;
    min-height: 60px;
}

.tl-kanban-card {
    background: #fff;
    border: 1px solid rgb(226 232 240);
    border-radius: 0.6rem;
    padding: 0.75rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    cursor: grab;
    transition: all 0.15s ease;
}

.tl-kanban-card:hover {
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
    transform: translateY(-1px);
}

.tl-kanban-card.dragging {
    opacity: 0.6;
    transform: rotate(1deg);
}

/* ============ Toasts ============ */

@keyframes tl-toast-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.tl-toast {
    animation: tl-toast-in 0.25s ease-out;
}

/* ============ Modal ============ */

@keyframes tl-modal-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.tl-modal {
    animation: tl-modal-in 0.2s ease-out;
}

@keyframes tl-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.tl-fade {
    animation: tl-fade-in 0.15s ease-out;
}

/* ============ Timeline ============ */

.tl-timeline {
    position: relative;
}

.tl-timeline::before {
    content: '';
    position: absolute;
    left: 1.05rem;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 2px;
    background: rgb(226 232 240);
}

.tl-timeline-item {
    position: relative;
    padding-left: 3rem;
}

.tl-timeline-dot {
    position: absolute;
    left: 0.6rem;
    top: 0.5rem;
    width: 1rem;
    height: 1rem;
    border-radius: 9999px;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px rgb(226 232 240);
}

/* ============ Misc ============ */

@keyframes tl-pulse-dot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.6; }
}

.tl-pulse-dot {
    animation: tl-pulse-dot 1.5s ease-in-out infinite;
}

.tl-fade-enter {
    animation: tl-fade-in 0.2s ease-out;
}

.tl-loading-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.6);
    z-index: 30;
    border-radius: inherit;
}

.tl-prose {
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ============ Impressao (relatorios PDF via browser) ============ */

@media print {
    .tl-no-print {
        display: none !important;
    }
}

/* ============ Eventos da agenda ============ */

.tl-event-cancelled {
    opacity: 0.7;
}
