/* ===== Mobile: eliminar scroll horizontal ===== */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

#app {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Todos os containers e grids respeitam o viewport */
*, *::before, *::after {
    min-width: 0;
}

main {
    overflow-x: hidden;
    max-width: 100%;
}

/* Textos longos não estouram */
.font-mono, [class*="font-mono"] {
    word-break: break-all;
}

/* Tabelas sempre com scroll contido */
table {
    width: 100%;
}

/* Inputs não estouram o container */
input, select, textarea {
    max-width: 100%;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: #0A0A0C; }
::-webkit-scrollbar-thumb { background: #1A1A1E; border-radius: 10px; }

/* ===== Sidebar ===== */
.sidebar-item-active {
    background-color: #1A1A1E;
    border-left: 3px solid #F6A200;
}

/* ===== Transições ===== */
.fade-in {
    animation: fadeIn 0.2s ease-in-out;
}

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

/* ===== Login ===== */
.login-card {
    background: linear-gradient(145deg, #141416, #0F0F12);
    border: 1px solid rgba(246, 162, 0, 0.08);
}

.login-input {
    background-color: #0A0A0C !important;
    border: 1px solid #1A1A1E !important;
    color: #ffffff !important;
    transition: border-color 0.2s;
}

.login-input:focus {
    border-color: #F6A200 !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(246, 162, 0, 0.15) !important;
}

/* ===== Selects e inputs do form (dark theme) ===== */
select.login-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

select.login-input option {
    background-color: #0A0A0C;
    color: #ffffff;
}

textarea.login-input {
    background-color: #0A0A0C !important;
}

input[type="date"].login-input::-webkit-calendar-picker-indicator {
    filter: invert(0.5);
}

/* ===== Accordion (details/summary) ===== */
details.av-section summary {
    list-style: none;
}
details.av-section summary::-webkit-details-marker {
    display: none;
}
details.av-section summary::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: auto;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    transition: transform 0.2s;
    flex-shrink: 0;
}
details.av-section[open] summary::after {
    transform: rotate(180deg);
}

/* ===== Checkboxes dark ===== */
.av-check {
    accent-color: #F6A200;
}

/* ===== Loading spinner ===== */
.spinner {
    border: 2px solid #1A1A1E;
    border-top: 2px solid #F6A200;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 0.6s linear infinite;
}

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