/* ============================================================
   Embral - CSS Customizado (complementa TailwindCSS CDN)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* Variáveis de cores – baseadas no logo Embral (azul escuro + dourado) */
:root {
    --color-primary: #1e40af;
    --color-primary-light: #3b82f6;
    --color-primary-dark: #1e3a8a;
    --color-gold: #d97706;
    --color-gold-light: #fbbf24;
    --color-sidebar-bg: #0f172a;
    --color-sidebar-text: #e2e8f0;
    --color-header-bg: #1e40af;
    --color-bg: #f1f5f9;
    --color-card-bg: #ffffff;
    --sidebar-width: 260px;
    --header-height: 64px;
    --radius: 0.75rem;
    --shadow: 0 1px 3px 0 rgb(0 0 0/0.1), 0 1px 2px -1px rgb(0 0 0/0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0/0.1), 0 2px 4px -2px rgb(0 0 0/0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0/0.1), 0 4px 6px -4px rgb(0 0 0/0.1);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--color-bg);
    color: #1e293b;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* ===== LAYOUT PRINCIPAL ===== */
.app-wrapper {
    display: flex;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background: #0f172a;
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 50;
    transition: transform 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

/* --- Brand / Logo --- */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.sidebar-brand-logo {
    width: 42px;
    height: 42px;
    background: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.sidebar-brand-logo img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.sidebar-brand-name {
    font-size: 1rem;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.sidebar-brand-sub {
    font-size: 0.625rem;
    color: #fbbf24;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-top: 1px;
}

/* --- Navigation --- */
.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0 0.5rem;
    overflow-y: auto;
}

.sidebar-group {
    margin-bottom: 0.25rem;
}

.sidebar-group-label {
    display: block;
    padding: 0.625rem 1.25rem 0.25rem;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #475569;
}

.sidebar-link {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.25rem 0.6rem 1rem;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.845rem;
    font-weight: 500;
    border-radius: 0;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
    position: relative;
    line-height: 1.4;
}

.sidebar-link:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.05);
    border-left-color: rgba(255, 255, 255, 0.2);
}

.sidebar-link.active {
    color: #fff;
    background: rgba(59, 130, 246, 0.15);
    border-left-color: #3b82f6;
}

.sidebar-link-icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 7px;
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.04);
    transition: background 0.15s ease;
}

.sidebar-link.active .sidebar-link-icon {
    background: rgba(59, 130, 246, 0.25);
    color: #60a5fa;
}

.sidebar-link:hover .sidebar-link-icon {
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-link-icon svg {
    width: 15px !important;
    height: 15px !important;
    flex-shrink: 0;
}

/* --- User Footer --- */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1d4ed8, #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.68rem;
    color: #64748b;
    text-transform: capitalize;
}

.sidebar-user-logout {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    text-decoration: none;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.sidebar-user-logout:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.sidebar-user-logout svg {
    width: 16px;
    height: 16px;
}

/* Mobile sidebar overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 40;
}

.sidebar-overlay.active {
    display: block;
}

@media (max-width: 1023px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }
}



/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

@media (max-width: 1023px) {
    .main-content {
        margin-left: 0;
    }
}

/* ===== HEADER ===== */
.app-header {
    background: var(--color-primary);
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 30;
    box-shadow: var(--shadow-md);
}

.header-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.375rem;
    border-radius: 0.5rem;
}

.header-menu-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

@media (max-width: 1023px) {
    .header-menu-btn {
        display: flex;
    }
}

.header-title {
    color: white;
    font-weight: 600;
    font-size: 1rem;
    flex: 1;
}

.btn-install-pwa {
    display: none;
    align-items: center;
    gap: 0.5rem;
    background: var(--color-gold);
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-install-pwa:hover {
    background: var(--color-gold-light);
    transform: translateY(-1px);
}

.btn-install-pwa.visible {
    display: flex;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: white;
}

.header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

.header-user-info {
    display: none;
}

@media (min-width: 640px) {
    .header-user-info {
        display: block;
    }
}

.header-user-name {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
}

.header-user-type {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
}

/* ===== PAGE CONTENT ===== */
.page-content {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

@media (min-width: 768px) {
    .page-content {
        padding: 2rem;
    }
}

@media (max-width: 1023px) {
    .page-content {
        padding: 1rem;
        padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
    }
}

.page-header {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

@media (max-width: 639px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .page-header>div:last-child {
        display: flex;
        flex-wrap: wrap;
        gap: 0.375rem;
    }
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
}

@media (max-width: 639px) {
    .page-title {
        font-size: 1.15rem;
    }
}

.page-subtitle {
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 0.125rem;
}

@media (max-width: 639px) {
    .page-subtitle {
        font-size: 0.75rem;
    }
}

/* ===== CARDS ===== */
.card {
    background: var(--color-card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid #e2e8f0;
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
}

.card-body {
    padding: 1.25rem;
}

/* Stats cards */
.stat-card {
    background: var(--color-card-bg);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

@media (max-width: 639px) {
    .stat-card {
        padding: 0.75rem;
        gap: 0.625rem;
    }
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

@media (max-width: 639px) {
    .stat-icon {
        width: 36px;
        height: 36px;
        border-radius: 0.5rem;
    }

    .stat-icon svg {
        width: 18px;
        height: 18px;
    }
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-value {
    font-size: 1.625rem;
    font-weight: 700;
    line-height: 1;
    color: #0f172a;
}

@media (max-width: 639px) {
    .stat-value {
        font-size: 1.15rem;
    }
}

.stat-label {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.25rem;
}

@media (max-width: 639px) {
    .stat-label {
        font-size: 0.7rem;
    }
}

.stat-change {
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

@media (max-width: 639px) {
    .stat-change {
        font-size: 0.65rem;
        margin-top: 0.25rem;
    }
}

/* ===== BOTÕES ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f1f5f9;
    color: #374151;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-warning {
    background: var(--color-gold);
    color: white;
}

.btn-warning:hover {
    background: var(--color-gold-light);
}

.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}

.btn-outline:hover {
    background: var(--color-primary);
    color: white;
}

.btn-icon {
    padding: 0.5rem;
    border-radius: 0.5rem;
}

/* ===== FORMULÁRIOS ===== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.375rem;
}

.form-label.required::after {
    content: ' *';
    color: #ef4444;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #111827;
    background: white;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary-light);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-control.is-invalid {
    border-color: #ef4444;
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.form-hint {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.form-error {
    font-size: 0.75rem;
    color: #ef4444;
    margin-top: 0.25rem;
}

.form-row {
    display: grid;
    gap: 1rem;
}

.form-row-2 {
    grid-template-columns: repeat(2, 1fr);
}

.form-row-3 {
    grid-template-columns: repeat(3, 1fr);
}

.form-row-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 767px) {

    .form-row-2,
    .form-row-3,
    .form-row-4 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1023px) {

    .form-row-3,
    .form-row-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== TABELAS ===== */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: #f8fafc;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.table td {
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    color: #374151;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.table tbody tr:hover {
    background: #f8fafc;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ===== BUSCA ===== */
.search-box {
    position: relative;
}

.search-box input {
    padding-left: 2.5rem;
    background: white;
}

.search-box svg {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #9ca3af;
}

/* ===== CALENDÁRIO ===== */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e2e8f0;
    border-radius: 0.5rem;
    overflow: hidden;
}

.calendar-day-header {
    background: #f1f5f9;
    padding: 0.5rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
}

.calendar-day {
    background: white;
    min-height: 100px;
    padding: 0.5rem;
    position: relative;
    cursor: default;
    transition: background 0.1s;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: visible;
}

.calendar-day:hover {
    background: #f8fafc;
}

.calendar-day.today {
    background: #eff6ff;
}

.calendar-day.today .day-number {
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-day.other-month {
    background: #fafafa;
    opacity: 0.6;
}

.calendar-day.has-holiday {
    background: #fef2f2;
}

.day-number {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.375rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-event {
    display: block;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    font-weight: 500;
    margin-bottom: 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.calendar-event.leilao {
    background: #dbeafe;
    color: #1d4ed8;
}

.calendar-event.filmagem {
    background: #d1fae5;
    color: #065f46;
}

.calendar-event.reuniao {
    background: #fef3c7;
    color: #92400e;
}

.calendar-event.compromisso {
    background: #ede9fe;
    color: #6d28d9;
}

.calendar-event.outro {
    background: #f1f5f9;
    color: #475569;
}

.calendar-event.feriado {
    background: #fee2e2;
    color: #991b1b;
    font-style: italic;
    cursor: default;
}

.calendar-leilao-img {
    width: 100%;
    height: 50px;
    object-fit: cover;
    border-radius: 0.25rem;
    margin-bottom: 0.125rem;
}

.calendar-event-img-label {
    display: block;
    font-size: 0.6rem;
    font-weight: 500;
    color: #1d4ed8;
    background: #dbeafe;
    border-radius: 0 0 0.25rem 0.25rem;
    padding: 0.05rem 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.125rem;
}

@media (max-width: 767px) {
    .calendar-day {
        min-height: 60px !important;
        padding: 0.15rem !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: visible !important;
    }

    .calendar-day-header {
        padding: 0.25rem;
        font-size: 0.6rem;
    }

    .day-number {
        font-size: 0.7rem;
        width: 22px;
        height: 22px;
        margin-bottom: 0.125rem;
    }

    .calendar-day.today .day-number {
        width: 22px;
        height: 22px;
    }

    .calendar-leilao-img {
        height: 30px;
    }

    .calendar-event {
        font-size: 0.6rem; 
        padding: 0.1rem 0.15rem;
        margin-bottom: 0.1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.2;
        min-height: 1rem;
        display: block !important;
        width: 100% !important;
        border-radius: 0.2rem;
        box-sizing: border-box;
        flex-shrink: 0;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .calendar-event.feriado {
        font-style: italic;
        background: #fee2e2 !important;
        color: #991b1b !important;
        border: 1px solid #fecaca !important;
        display: block !important;
        width: 100% !important;
    }

    .calendar-event-img-label {
        font-size: 0.5rem;
        padding: 0.05rem 0.15rem;
    }
}

/* ===== CRM KANBAN ===== */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    align-items: start;
}

@media (max-width: 1023px) {
    .kanban-board {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.625rem;
    }
}

@media (max-width: 599px) {
    .kanban-board {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .kanban-column {
        width: 100%;
    }

    .kanban-list {
        max-height: none;
        overflow-y: visible;
    }
}

.kanban-column {
    background: #f8fafc;
    border-radius: var(--radius);
    border: 1px solid #e2e8f0;
}

.kanban-header {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kanban-title {
    font-size: 0.875rem;
    font-weight: 700;
}

.kanban-count {
    background: var(--color-primary);
    color: white;
    border-radius: 9999px;
    font-size: 0.7rem;
    padding: 0.1rem 0.5rem;
}

.kanban-list {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    min-height: 100px;
}

.kanban-card {
    background: white;
    border-radius: 0.5rem;
    padding: 0.875rem;
    box-shadow: var(--shadow);
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.15s ease;
}

.kanban-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.kanban-card-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
}

.kanban-card-empresa {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.125rem;
}

.kanban-card-valor {
    font-size: 0.8rem;
    color: #059669;
    font-weight: 600;
    margin-top: 0.5rem;
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ===== UPLOAD ===== */
.upload-zone {
    border: 2px dashed #d1d5db;
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--color-primary-light);
    background: #eff6ff;
}

/* ===== SELECT2 CUSTOMIZAÇÃO ===== */
.select2-container--default .select2-selection--single {
    border: 1px solid #d1d5db !important;
    border-radius: 0.5rem !important;
    height: 38px !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 38px !important;
    padding-left: 0.75rem !important;
    font-size: 0.875rem !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 38px !important;
}

.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

.select2-dropdown {
    border: 1px solid #d1d5db !important;
    border-radius: 0.5rem !important;
    box-shadow: var(--shadow-lg) !important;
}

.select2-search--dropdown .select2-search__field {
    border: 1px solid #d1d5db !important;
    border-radius: 0.375rem !important;
    padding: 0.375rem 0.5rem !important;
    font-size: 0.875rem !important;
}

.select2-container--default .select2-results__option--highlighted {
    background: var(--color-primary) !important;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in {
    animation: slideIn 0.3s ease forwards;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ===== BOTTOM NAVIGATION (mobile app style) ===== */
.bottom-nav {
    display: none;
    /* oculto por padrão, aparece no mobile */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 60;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

/* Visible only on mobile */
@media (max-width: 1023px) {
    .bottom-nav {
        display: flex;
    }
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 0.5rem 0.25rem;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 500;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.15s ease;
    min-width: 0;
    position: relative;
}

.bottom-nav-item svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.bottom-nav-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
    color: var(--color-primary);
}

.bottom-nav-item.active svg {
    transform: translateY(-1px);
}

/* Ponto indicador no item ativo */
.bottom-nav-item.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 3px;
    background: var(--color-primary);
    border-radius: 0 0 3px 3px;
}

/* ===== MOBILE GLOBAL REFINEMENTS ===== */
@media (max-width: 639px) {

    /* Cards mais compactos */
    .card-header {
        padding: 0.75rem 1rem;
    }

    .card-title {
        font-size: 0.8rem;
    }

    .card-body {
        padding: 0.75rem 1rem;
    }

    /* Tables mais compactos */
    .table th {
        padding: 0.5rem 0.625rem;
        font-size: 0.65rem;
    }

    .table td {
        padding: 0.625rem;
        font-size: 0.8rem;
    }

    /* Header mais compacto */
    .app-header {
        height: 52px;
        padding: 0 0.75rem;
        gap: 0.5rem;
    }

    .header-title {
        font-size: 0.875rem;
    }

    .header-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.75rem;
    }

    /* Upload zone */
    .upload-zone {
        padding: 1rem;
    }

    /* Formulários upload (documentos) - empilhar */
    .card-body form.flex {
        flex-direction: column;
    }

    .card-body form.flex>* {
        width: 100% !important;
        min-width: 0 !important;
    }

    /* Grids responsive */
    .grid.grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem !important;
    }

    /* mb-6 -> mb-3 on mobile for tighter spacing */
    .mb-6 {
        margin-bottom: 0.75rem;
    }

    /* Search box no card-header */
    .card-header .search-box {
        width: 100% !important;
    }

    /* Flex gaps menores */
    .gap-6 {
        gap: 0.75rem;
    }

    .gap-4 {
        gap: 0.5rem;
    }

    /* Kanban card compacto */
    .kanban-card {
        padding: 0.625rem;
    }

    .kanban-card-name {
        font-size: 0.8rem;
    }

    .kanban-header {
        padding: 0.625rem 0.75rem;
    }
}

/* Header height CSS var para mobile */
@media (max-width: 639px) {
    :root {
        --header-height: 52px;
    }
}