/* ============================================================
   CHIP PANEL – PREMIUM DARK BLUE THEME
   Ultra Modern & Animated
============================================================ */

/* ============================================================
   RESET & BASE
============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #0a0f1c 0%, #0d1529 50%, #0a1628 100%);
    background-attachment: fixed;
    color: #e2e8f0;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    transition: padding-left .32s cubic-bezier(0.4, 0, 0.2, 1);
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(37, 99, 235, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(30, 64, 175, 0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
    animation: bgPulse 15s ease-in-out infinite;
}

.skip-link {
    position: fixed;
    top: -48px;
    left: 16px;
    background: #1d4ed8;
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    z-index: 12000;
    transition: top .2s ease;
}

.skip-link:focus {
    top: 16px;
}

@keyframes bgPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ============================================================
   SIDEBAR PREMIUM
============================================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 78px;
    height: 100vh;
    background: linear-gradient(180deg, #0d1320 0%, #0a1018 100%);
    border-right: 1px solid rgba(30, 58, 138, 0.35);
    padding: 25px 14px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    transition: all .32s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    box-shadow: 
        4px 0 30px rgba(0, 0, 0, 0.4),
        inset -1px 0 0 rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.5), transparent);
}

.sidebar.open {
    width: 260px;
}

.sidebar.collapsed {
    width: 78px;
}

.side-title {
    font-size: 1.4rem;
    text-align: center;
    font-weight: 800;
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 1;
    transition: all .32s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: -0.5px;
    margin-bottom: 10px;
}

.sidebar:not(.open) .side-title,
.sidebar.collapsed .side-title {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

/* ============================================================
   MENU LINKS
============================================================ */
.sidebar a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    color: #94a3b8;
    border-radius: 12px;
    text-decoration: none;
    transition: all .25s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.sidebar a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, #3b82f6, #1d4ed8);
    transform: scaleY(0);
    transition: transform .25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0 4px 4px 0;
}

.sidebar a::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(59, 130, 246, 0.05));
    opacity: 0;
    transition: opacity .25s ease;
    border-radius: 12px;
}

.sidebar a:hover {
    color: #f1f5f9;
    transform: translateX(6px);
}

.sidebar a:focus-visible,
.sidebar-toggle:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

.sidebar a:hover::before {
    transform: scaleY(1);
}

.sidebar a:hover::after {
    opacity: 1;
}

.sidebar a.active {
    color: #f1f5f9;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.25), rgba(59, 130, 246, 0.12));
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.22);
}

.sidebar a.active::before {
    transform: scaleY(1);
}

.sidebar a i {
    font-size: 1.25rem;
    transition: all .25s ease;
    position: relative;
    z-index: 1;
}

.sidebar a:hover i {
    color: #60a5fa;
    transform: scale(1.15);
    filter: drop-shadow(0 0 8px rgba(96, 165, 250, 0.5));
}

.sidebar:not(.open) a span,
.sidebar.collapsed a span {
    display: none;
}

.sidebar:not(.open) a:hover::after,
.sidebar.collapsed a:hover::after {
    content: attr(title);
    opacity: 1;
    position: fixed;
    left: 92px;
    inset: auto;
    background: #0f172a;
    border: 1px solid rgba(96, 165, 250, 0.35);
    color: #e2e8f0;
    padding: 6px 10px;
    border-radius: 8px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10001;
}

.sidebar a span {
    position: relative;
    z-index: 1;
}

/* ============================================================
   TOGGLE BUTTON
============================================================ */
.sidebar-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all .32s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
    box-shadow: 
        0 4px 20px rgba(37, 99, 235, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.sidebar-toggle i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    line-height: 1;
}

.sidebar-toggle:hover {
    transform: scale(1.1) rotate(180deg);
    box-shadow: 
        0 6px 30px rgba(37, 99, 235, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

.sidebar-toggle:active {
    transform: scale(0.95) rotate(180deg);
}

body.sidebar-open .sidebar-toggle {
    left: 270px;
}

/* ============================================================
   MAIN CONTENT AREA
============================================================ */

.content,
.chip-container {
    margin-left: 15px; /* mesma largura da sidebar collapsada */
    padding: 2rem;
    padding-top: 3.5rem;
    transition: all .32s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 900px) {
    .content,
    .chip-container {
        padding: 1rem;
        padding-top: 4.5rem;
    }

    body.sidebar-open .sidebar-toggle {
        left: 210px;
    }

    .sidebar.open {
        width: 200px;
    }
}

/* Conteúdo quando sidebar está ABERTA */
.sidebar.open ~ .content,
.sidebar.open ~ .chip-container {
    margin-left: 125px; /* mesma largura da sidebar aberta */
}

body.sidebar-open .content,
body.sidebar-open .chip-container {
    margin-left: 125px;
}

/* ============================================================
   TOASTS + VIEW TRANSITIONS
============================================================ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 11000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast-message {
    min-width: 220px;
    max-width: 360px;
    padding: 12px 14px;
    border-radius: 10px;
    color: #f8fafc;
    font-weight: 600;
    opacity: 0;
    transform: translateY(-6px);
    transition: .2s ease;
    box-shadow: 0 8px 20px rgba(2, 6, 23, 0.45);
}

.toast-message.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success { background: #166534; }
.toast-error { background: #991b1b; }
.toast-info { background: #1d4ed8; }

::view-transition-group(*),
::view-transition-old(*),
::view-transition-new(*) {
    animation-duration: 0.25s;
    animation-timing-function: cubic-bezier(0.19, 1, 0.22, 1);
}

/* ============================================================
   MOVIMENTAÇÃO
============================================================ */
.mov-container {
    max-width: 950px;
    margin: 0 auto;
    padding: 10px 20px;
}

.search-box { width: 100%; margin: 0 auto 25px auto; position: relative; }
.search-box input {
    width: 100%; background: #0f172a; border: 1px solid #334155; padding: 14px 18px;
    border-radius: 14px; color: #e2e8f0; font-size: 17px; box-shadow: 0 0 12px #0004;
}
.search-box input:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 12px #2563eb80; }
.search-box i { position: absolute; right: 18px; top: 14px; color: #64748b; font-size: 18px; }

.autocomplete-list {
    position: absolute; background: #1e293b; border: 1px solid #334155; width: 100%;
    margin-top: 4px; border-radius: 10px; max-height: 220px; overflow-y: auto;
    display: none; z-index: 999; box-shadow: 0 0 18px #0006;
}
.autocomplete-item { padding: 12px 15px; cursor: pointer; color: #e2e8f0; font-size: 15px; }
.autocomplete-item:hover { background: #374151; }

.filters { margin: 20px 0 30px 0; text-align: center; }
.filter-btn {
    display: inline-block; padding: 10px 18px; border-radius: 25px; margin-right: 10px;
    cursor: pointer; font-size: 14px; background: #1e293b; border: 1px solid #334155;
    color: #cbd5e1; transition: .25s;
}
.filter-btn.active { background: #3b82f6; color: white; }
.filter-btn:hover { transform: translateY(-2px); }

.timeline-wrapper { margin-top: 20px; }
.timeline-item { display: flex; gap: 18px; position: relative; padding-bottom: 30px; animation: fadeIn .35s ease-in-out; }
.timeline-item:before {
    content: ""; position: absolute; left: 12px; top: 0; width: 3px; height: 100%;
    background: #1e293b; border-radius: 10px;
}
.timeline-icon {
    width: 26px; height: 26px; border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #2563eb); display: flex;
    justify-content: center; align-items: center; color: white; z-index: 10;
    font-size: 13px; box-shadow: 0 0 12px #1d4ed880;
}
.timeline-card {
    flex: 1; background: #0f172a; padding: 18px 20px; border-radius: 14px;
    border-left: 3px solid #3b82f6; box-shadow: 0 0 16px #0005;
}
.badges { margin-bottom: 8px; }
.badge { display: inline-block; padding: 4px 9px; border-radius: 6px; font-size: 12px; margin-right: 6px; color: white; }
.b-evento { background: #6366f1; }
.b-movimento { background: #0ea5e9; }
.b-aparelho { background: #14b8a6; }
.timeline-title { font-size: 18px; font-weight: bold; color: #f1f5f9; margin-bottom: 6px; }
.timeline-date { color: #94a3b8; font-size: 14px; margin-bottom: 10px; }
.timeline-desc { color: #cbd5e1; font-size: 15px; }
#loading { text-align: center; color: #3b82f6; font-size: 16px; margin-top: 20px; display: none; }

.chip-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    animation: fadeUp .6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   HEADER PREMIUM
============================================================ */
.chip-header {
    background: linear-gradient(135deg, rgba(13, 19, 32, 0.95), rgba(11, 21, 43, 0.95));
    border: 1px solid rgba(30, 58, 138, 0.4);
    padding: 1.8rem 2rem;
    margin-bottom: 2.5rem;
    border-radius: 20px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset;
    animation: slideDown .6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
}

.chip-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.6), transparent);
}

.chip-header::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.1) 0%, transparent 70%);
    pointer-events: none;
    animation: headerGlow 5s ease-in-out infinite;
}

@keyframes headerGlow {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

.chip-header-content {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    position: relative;
    z-index: 1;
}

.icon-wrapper {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.25), rgba(59, 130, 246, 0.15));
    padding: 1rem;
    border-radius: 16px;
    box-shadow: 
        0 8px 24px rgba(37, 99, 235, 0.3),
        0 0 0 1px rgba(59, 130, 246, 0.3) inset;
    animation: iconPulse 3s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes iconPulse {
    0%, 100% { box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3), 0 0 0 1px rgba(59, 130, 246, 0.3) inset; }
    50% { box-shadow: 0 8px 32px rgba(37, 99, 235, 0.5), 0 0 0 1px rgba(59, 130, 246, 0.5) inset; }
}

.icon-wrapper i {
    font-size: 1.8rem;
    color: #60a5fa;
    filter: drop-shadow(0 0 10px rgba(96, 165, 250, 0.5));
}

.chip-title {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #f1f5f9, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.chip-subtitle {
    color: #64748b;
    font-size: 0.95rem;
    margin-top: 4px;
}

/* ============================================================
   CARDS PREMIUM – CORRIGIDO COM ESPAÇAMENTO ENTRE CARDS
============================================================ */
.chip-card {
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.95), rgba(15, 23, 42, 0.95));
    border-radius: 20px;
    border: 1px solid rgba(30, 58, 138, 0.4);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset;
    animation: fadeUp .6s cubic-bezier(0.4, 0, 0.2, 1);
    animation-fill-mode: both;
    transition: all .35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
    margin-bottom: 48px;  /* Espaço entre um card e outro */
}

.chip-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.4), transparent);
}

.chip-card:nth-child(1) { animation-delay: 0.1s; }
.chip-card:nth-child(2) { animation-delay: 0.2s; }
.chip-card:nth-child(3) { animation-delay: 0.3s; }

.chip-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(59, 130, 246, 0.3) inset,
        0 0 60px rgba(37, 99, 235, 0.1);
    border-color: rgba(59, 130, 246, 0.5);
}

.chip-card-header {
    background: linear-gradient(135deg, rgba(13, 19, 32, 0.8), rgba(15, 23, 42, 0.8));
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(30, 58, 138, 0.3);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.card-icon {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(59, 130, 246, 0.1));
    padding: 0.75rem;
    border-radius: 12px;
    color: #60a5fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon i {
    color: #60a5fa;
    font-size: 1.2rem;
}

/* Título */
.card-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #f1f5f9;
}

.card-content {
    padding: 2rem;
}


/* ============================================================
   FORMS
============================================================ */
.chip-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full {
    grid-column: span 3;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: 0.3px;
}

.form-group input,
.form-group select,
.form-group textarea {
    background: linear-gradient(135deg, rgba(14, 23, 41, 0.9), rgba(15, 23, 42, 0.9));
    border: 1px solid rgba(30, 41, 59, 0.8);
    padding: 0.9rem 1rem;
    border-radius: 12px;
    color: #e2e8f0;
    font-size: 0.95rem;
    transition: all .25s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #475569;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: rgba(59, 130, 246, 0.4);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #3b82f6;
    box-shadow: 
        0 0 0 3px rgba(59, 130, 246, 0.15),
        0 0 20px rgba(37, 99, 235, 0.2);
    background: rgba(14, 23, 41, 1);
}

/* ============================================================
   BUTTONS
============================================================ */
.chip-btn {
    padding: 1rem 1.8rem;
    margin-top: 0.5rem;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 4px 20px rgba(37, 99, 235, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    align-self: flex-start;
}

.chip-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left .5s ease;
}

.chip-btn:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 8px 30px rgba(37, 99, 235, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}

.chip-btn:hover::before {
    left: 100%;
}

.chip-btn:active {
    transform: translateY(-1px);
}

.chip-btn.save {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
}

.chip-btn.save:hover {
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.5);
}

.chip-btn.cancel {
    background: linear-gradient(135deg, #475569, #334155) !important;
    box-shadow: 0 4px 20px rgba(71, 85, 105, 0.3);
}

.chip-btn.cancel:hover {
    box-shadow: 0 8px 30px rgba(71, 85, 105, 0.4);
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all .25s ease;
    box-shadow: 0 2px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.5);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

/* ============================================================
   SEARCH
============================================================ */
.search-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-wrapper i,
.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    transition: all .25s ease;
    font-size: 0.95rem;
}

.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 2.8rem;
    background: linear-gradient(135deg, rgba(14, 23, 41, 0.9), rgba(15, 23, 42, 0.9));
    border: 1px solid rgba(30, 41, 59, 0.8);
    border-radius: 14px;
    color: #e2e8f0;
    font-size: 0.95rem;
    transition: all .25s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input::placeholder {
    color: #64748b;
}

.search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.search-input:focus + i,
.search-input:focus + .search-icon,
.search-wrapper:hover i,
.search-wrapper:hover .search-icon {
    color: #3b82f6;
}

/* ============================================================
   TABLE PREMIUM
============================================================ */
.chip-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.chip-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.chip-table thead {
    background: linear-gradient(135deg, rgba(13, 19, 32, 0.98), rgba(15, 23, 42, 0.98));
    position: sticky;
    top: 0;
    z-index: 10;
}

.chip-table th {
    padding: 1.1rem 1rem;
    color: #60a5fa;
    border-bottom: 2px solid rgba(30, 58, 138, 0.5);
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-align: left;
    white-space: nowrap;
}

.chip-table tbody tr {
    transition: all .25s ease;
    border-bottom: 1px solid rgba(31, 42, 60, 0.5);
}

.chip-table tbody tr:hover {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.15), rgba(37, 99, 235, 0.1));
    transform: scale(1.005);
}

.chip-table td {
    padding: 1rem;
    color: #cbd5e1;
    white-space: nowrap;
}

.empty-message {
    text-align: center;
    color: #64748b;
    padding: 3rem !important;
    font-size: 1rem;
    font-style: italic;
}

/* ============================================================
   STATUS BADGES – PREMIUM DARK BLUE THEME
============================================================ */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

/* ============================================================
   VERDE – STATUS POSITIVOS
============================================================ */
.status-ativo,
.status-disponivel {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(5, 150, 105, 0.15));
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.45);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.25);
}

/* ============================================================
   CINZA – INATIVO / SEM MOVIMENTO
============================================================ */
.status-inativo {
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.25), rgba(75, 85, 99, 0.15));
    color: #d1d5db;
    border: 1px solid rgba(107, 114, 128, 0.4);
    box-shadow: 0 0 15px rgba(107, 114, 128, 0.2);
}

/* ============================================================
   AMARELO – PROCESSOS, MATURAÇÃO
============================================================ */
.status-pendente,
.status-maturando {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.15));
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.45);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.25);
}

/* ============================================================
   AZUL – MATURADO
============================================================ */
.status-maturado {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.35), rgba(37, 99, 235, 0.25));
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.25);
}

/* ============================================================
   ROXO – DESCANSOS
============================================================ */
.status-descanso_1,
.status-descanso_2 {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(124, 58, 237, 0.15));
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.45);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.25);
}

/* ============================================================
   TURQUESA – PRONTO PARA MATURAR
============================================================ */
.status-pronto_para_maturar {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.25), rgba(13, 148, 136, 0.15));
    color: #5eead4;
    border: 1px solid rgba(20, 184, 166, 0.45);
    box-shadow: 0 0 15px rgba(20, 184, 166, 0.25);
}

/* ============================================================
   ROXO NEON – DISPARANDO
============================================================ */
.status-disparando {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(79, 70, 229, 0.2));
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
    animation: disparandoPulse 1s ease-in-out infinite;
}

@keyframes disparandoPulse {
    0%, 100% { box-shadow: 0 0 18px rgba(99, 102, 241, 0.3); }
    50% { box-shadow: 0 0 32px rgba(99, 102, 241, 0.5); }
}

/* ============================================================
   VERMELHO – STATUS CRÍTICOS (BANIDO / RESTRINGIDO / BLOQUEADO)
============================================================ */
.status-banido,
.status-restringido,
.status-bloqueado {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.28), rgba(190, 18, 60, 0.22));
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.55);
    box-shadow:
        0 0 18px rgba(239, 68, 68, 0.25),
        0 0 30px rgba(190, 18, 60, 0.2);
    animation: dangerPulse 1.6s ease-in-out infinite;
}

@keyframes dangerPulse {
    0% {
        box-shadow: 
            0 0 18px rgba(239, 68, 68, 0.25),
            0 0 30px rgba(190, 18, 60, 0.2);
        filter: brightness(1);
    }
    50% {
        box-shadow:
            0 0 32px rgba(239, 68, 68, 0.45),
            0 0 55px rgba(190, 18, 60, 0.35);
        filter: brightness(1.25);
    }
    100% {
        box-shadow: 
            0 0 18px rgba(239, 68, 68, 0.25),
            0 0 30px rgba(190, 18, 60, 0.2);
        filter: brightness(1);
    }
}

/* ============================================================
   TOOLTIP
============================================================ */
.obs-tooltip {
    position: relative;
    cursor: pointer;
    color: #60a5fa;
    transition: all .25s ease;
}

.obs-tooltip:hover {
    color: #93c5fd;
    transform: scale(1.2);
}

.obs-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #e2e8f0;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    white-space: normal;
    max-width: 280px;
    opacity: 0;
    visibility: hidden;
    transition: all .25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.obs-tooltip::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e293b;
    opacity: 0;
    visibility: hidden;
    transition: all .25s ease;
}

.obs-tooltip:hover::after,
.obs-tooltip:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}

/* ============================================================
   MODAL PREMIUM
============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 20000;
    animation: modalOverlayIn .3s ease;
}

@keyframes modalOverlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(135deg, #111827, #0f172a);
    padding: 2rem;
    border-radius: 24px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 
        0 24px 80px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(59, 130, 246, 0.2) inset;
    border: 1px solid rgba(30, 58, 138, 0.5);
    animation: modalSlideIn .4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.6), transparent);
}

.modal-content h2 {
    color: #60a5fa;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(30, 58, 138, 0.4);
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #f1f5f9;
}

.modal-close {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all .25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.25);
    transform: rotate(90deg);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(30, 58, 138, 0.3);
}

.modal-actions .chip-btn {
    flex: 1;
}

/* ============================================================
   LOADING SPINNER
============================================================ */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   SCROLLBAR CUSTOM
============================================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0d1320;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #1e3a8a, #2563eb);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #2563eb, #3b82f6);
}

/* ============================================================
   ANIMATIONS
============================================================ */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #ffffff80;
  border-top: 2px solid #ffffff;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.6s linear infinite;
  margin-left: 6px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 1100px) {
    .form-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .form-group.full {
        grid-column: span 2;
    }
}

@media (max-width: 750px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    .form-group.full {
        grid-column: span 1;
    }
    .content,
    .chip-container {
        margin-left: 95px !important;
    }
    .chip-title {
        font-size: 1.6rem;
    }
}

@media (max-width: 550px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-toggle {
        left: 15px !important;
    }
    .content,
    .chip-container,
    body.sidebar-open .content,
    body.sidebar-open .chip-container {
        margin-left: 0 !important;
        padding: 1rem;
    }
    .chip-header {
        padding: 1.2rem;
    }
    .chip-card {
        border-radius: 14px;
    }
    .card-content {
        padding: 1.2rem;
    }
    .modal-content {
        margin: 1rem;
        padding: 1.5rem;
        border-radius: 16px;
    }
}

/* Modern chip operations */
.flash-stack{max-width:1600px;margin:16px auto 0;padding:0 1.5rem}.flash{padding:12px 16px;border-radius:14px;margin-bottom:10px;font-weight:700}.flash-success{background:rgba(16,185,129,.16);color:#a7f3d0;border:1px solid rgba(16,185,129,.35)}.flash-error{background:rgba(239,68,68,.16);color:#fecaca;border:1px solid rgba(239,68,68,.35)}
.chip-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:14px;margin:24px 0}.kpi-card{display:block;text-decoration:none;color:#e5eefc;background:linear-gradient(135deg,rgba(15,23,42,.88),rgba(30,41,59,.74));border:1px solid rgba(96,165,250,.18);border-radius:18px;padding:18px;box-shadow:0 14px 35px rgba(0,0,0,.22);transition:.2s}.kpi-card:hover{transform:translateY(-3px);border-color:#60a5fa}.kpi-card span{display:block;color:#94a3b8;font-size:.85rem}.kpi-card strong{font-size:1.55rem}.kpi-card.danger{border-color:rgba(248,113,113,.45)}.kpi-card.warn{border-color:rgba(251,191,36,.45)}
.filters-panel{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin-bottom:18px;padding:14px;border-radius:18px;background:rgba(15,23,42,.55);position:sticky;top:10px;z-index:5}.filters-panel input,.filters-panel select{min-height:42px;border-radius:12px;border:1px solid rgba(148,163,184,.25);background:#0f172a;color:#e2e8f0;padding:0 12px}.quick-actions{display:flex;gap:6px;flex-wrap:wrap;min-width:230px}.quick-actions .btn{background:#1e293b;color:#dbeafe;border:1px solid rgba(96,165,250,.25)}.row-danger{background:rgba(127,29,29,.22)!important}.row-warning{background:rgba(120,53,15,.16)!important}.pagination-bar{display:flex;justify-content:space-between;align-items:center;margin-top:16px;gap:12px}.status-disponivel{background:#065f46;color:#d1fae5}.status-ativo,.status-em_uso{background:#1d4ed8;color:#dbeafe}.status-banido{background:#991b1b;color:#fee2e2}.status-descanso{background:#92400e;color:#fef3c7}.status-inativo{background:#374151;color:#e5e7eb}.status-manutencao{background:#6d28d9;color:#ede9fe}.timeline-box{display:grid;gap:10px;max-height:60vh;overflow:auto}.timeline-item{border-left:3px solid #60a5fa;padding:10px 12px;background:rgba(15,23,42,.55);border-radius:10px}.timeline-item span{float:right;color:#94a3b8;font-size:.85rem}@media(max-width:760px){.pagination-bar{flex-direction:column;align-items:flex-start}.quick-actions{min-width:180px}}

/* Chips listing refinements */
.chip-muted { color: #94a3b8; margin-top: .25rem; }
.chip-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; align-items: end; }
.chip-filters label { display: flex; flex-direction: column; gap: 6px; color: #94a3b8; font-size: .85rem; }
.chip-filter-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.state-message { margin: 16px 0; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(148, 163, 184, .22); }
.state-success { background: rgba(34, 197, 94, .09); color: #bbf7d0; border-color: rgba(34, 197, 94, .25); }
.state-empty { background: rgba(234, 179, 8, .1); color: #fde68a; border-color: rgba(234, 179, 8, .28); }
.state-error { background: rgba(239, 68, 68, .12); color: #fecaca; border-color: rgba(239, 68, 68, .32); }
.quick-actions { min-width: 260px; }
.quick-actions .btn { margin: 2px; }
@media (max-width: 768px) {
  .chip-filter-actions .chip-btn { width: 100%; justify-content: center; }
  .chip-table-wrapper { overflow-x: auto; }
  .quick-actions { min-width: 210px; }
}

/* ============================================================
   Chips page modernization: header, KPIs, filters, table, modals
============================================================ */
.chip-header-actions { justify-content: space-between; flex-wrap: wrap; }
.chip-heading-group { display: flex; align-items: center; gap: 1.2rem; }
.header-actions { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-left: auto; }
.header-actions .chip-btn, .chip-filter-actions .chip-btn { margin-top: 0; text-decoration: none; }

.chip-kpis { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.kpi-card { position: relative; min-height: 128px; display: flex; flex-direction: column; gap: .45rem; overflow: hidden; }
.kpi-card i { width: 38px; height: 38px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; background: rgba(96, 165, 250, .16); color: #93c5fd; }
.kpi-card strong { font-size: 2rem; line-height: 1; color: #f8fafc; }
.kpi-card span { order: 3; font-weight: 700; }
.kpi-success { border-color: rgba(16, 185, 129, .42); }
.kpi-success i { background: rgba(16, 185, 129, .18); color: #6ee7b7; }
.kpi-danger { border-color: rgba(248, 113, 113, .52); }
.kpi-danger i { background: rgba(239, 68, 68, .18); color: #fca5a5; }
.kpi-warning { border-color: rgba(251, 191, 36, .52); }
.kpi-warning i { background: rgba(245, 158, 11, .18); color: #fcd34d; }
.kpi-info i, .kpi-total i, .kpi-neutral i { background: rgba(59, 130, 246, .18); color: #93c5fd; }

.chip-filters { position: static; background: rgba(15, 23, 42, .72); border: 1px solid rgba(96, 165, 250, .16); box-shadow: inset 0 0 0 1px rgba(255,255,255,.02); }
.chip-filters input, .chip-filters select { width: 100%; }
.chip-filter-actions { align-items: center; }

.chip-table-wrapper { overflow-x: auto; border: 1px solid rgba(96, 165, 250, .14); background: rgba(2, 6, 23, .28); }
.chip-table { min-width: 1680px; font-size: .84rem; }
.chip-table thead th { position: sticky; top: 0; z-index: 2; }
.chip-table th, .chip-table td { padding: .72rem .75rem; vertical-align: middle; }
.chip-table tbody tr:nth-child(even) { background: rgba(15, 23, 42, .32); }
.chip-table tbody tr:hover { transform: none; background: rgba(37, 99, 235, .16); }
.chip-table th:first-child, .chip-table td:first-child { position: sticky; left: 0; z-index: 3; background: #0f172a; box-shadow: 10px 0 18px rgba(0,0,0,.18); }
.chip-table thead th:first-child { z-index: 4; }
.quick-actions { min-width: 142px; display: inline-flex; flex-wrap: nowrap; gap: .35rem; }
.action-btn { width: 32px; height: 32px; border-radius: 10px; border: 1px solid rgba(96, 165, 250, .22); background: rgba(30, 41, 59, .92); color: #dbeafe; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: .2s ease; }
.action-btn:hover { transform: translateY(-1px); border-color: #60a5fa; color: #fff; background: #1d4ed8; }
.action-btn:disabled { opacity: .55; cursor: wait; }
.obs-cell { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.row-danger td { background: rgba(127, 29, 29, .20) !important; }
.row-warning td { background: rgba(120, 53, 15, .16) !important; }
.status-em_uso, .status-disparando { background: linear-gradient(135deg, rgba(37,99,235,.28), rgba(29,78,216,.16)); color: #bfdbfe; border: 1px solid rgba(96,165,250,.4); }
.status-banido, .status-bloqueado, .status-restringido { background: linear-gradient(135deg, rgba(153,27,27,.8), rgba(127,29,29,.55)); color: #fee2e2; border: 1px solid rgba(248,113,113,.45); }
.status-manutencao, .status-descanso, .status-descanso_1, .status-descanso_2 { background: linear-gradient(135deg, rgba(146,64,14,.7), rgba(120,53,15,.42)); color: #fef3c7; border: 1px solid rgba(251,191,36,.38); }

.modal-open { overflow: hidden; }
.modal-overlay { padding: 1rem; background: rgba(2, 6, 23, .78); backdrop-filter: blur(10px); }
.modal-content.modal-chip { width: min(980px, 96vw); max-height: 88vh; padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.5rem; border-bottom: 1px solid rgba(96, 165, 250, .18); background: rgba(15, 23, 42, .72); }
.modal-title { color: #f8fafc; font-size: 1.25rem; font-weight: 800; display: flex; align-items: center; gap: .65rem; margin: 0; }
.modal-close { width: 38px; height: 38px; border-radius: 12px; border: 1px solid rgba(148, 163, 184, .22); background: rgba(15, 23, 42, .85); color: #cbd5e1; font-size: 1.6rem; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.modal-close:hover { background: rgba(239, 68, 68, .18); color: #fecaca; border-color: rgba(248, 113, 113, .38); }
.modal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; padding: 1.5rem; overflow-y: auto; }
.modal-grid .full { grid-column: 1 / -1; }
.modal-actions { position: sticky; bottom: -1.5rem; display: flex; justify-content: flex-end; gap: .75rem; padding: 1rem 0 0; background: linear-gradient(180deg, transparent, #0f172a 30%); }
.modal-actions .chip-btn { margin-top: 0; }
.timeline-box { padding: 1.5rem; }
@media (max-width: 900px) {
  .modal-grid { grid-template-columns: 1fr; }
  .chip-header-actions { align-items: flex-start; }
  .header-actions { width: 100%; margin-left: 0; }
  .header-actions .chip-btn { flex: 1; }
}
@media (max-width: 640px) {
  .chip-heading-group { align-items: flex-start; }
  .chip-title { font-size: 1.7rem; }
  .header-actions, .modal-actions { flex-direction: column; align-items: stretch; }
  .header-actions .chip-btn, .modal-actions .chip-btn { width: 100%; }
}

/* Maturation progress for chips */
.maturacao-box { min-width: 150px; max-width: 190px; }
.maturacao-info { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 12px; color: #cbd5e1; gap: 10px; }
.maturacao-info strong { font-size: 13px; color: #f8fafc; }
.maturacao-track { width: 100%; height: 9px; background: #1e293b; border-radius: 999px; overflow: hidden; border: 1px solid rgba(148, 163, 184, .18); }
.maturacao-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #f59e0b, #22c55e); transition: width 0.3s ease; }
.maturacao-fill.is-complete { background: #22c55e; }
.maturacao-warning { padding: 6px 8px; border-radius: 8px; background: #fef3c7; color: #92400e; font-size: 12px; }
.muted { color: #94a3b8; }
.status-maturando, .status-em_maturação, .status-em_maturacao, .status-maturacao, .status-maturação { background: linear-gradient(135deg, rgba(245, 158, 11, .32), rgba(34, 197, 94, .18)); color: #fef3c7; border: 1px solid rgba(245, 158, 11, .42); }
@media (max-width: 768px) { .maturacao-box { min-width: 130px; } }
