:root {
    --bg-dark: #055a2c;
    --bg-card: #0b7137;
    --primary: #0b7137;
    --primary-hover: #9edc3b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #14522f;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    /* Button Colors */
    --btn-primary-bg: #22c55e;
    --btn-primary-text: #ffffff;
}

/* Light Mode Variables override */
body.light-mode {
    --bg-dark: #f1f5f9;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
}

/* Adjust gradients/bg for light mode */
body.light-mode #login-screen {
    background: radial-gradient(circle at top right, #e2e8f0, #cbd5e1);
}

body.light-mode .content {
    background: #f8fafc;
}

body.light-mode .vehicle-card:hover {
    background: #f8fafc;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

#top-save-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 6px;
    width: 0;
    background: linear-gradient(90deg, #0f766e, #22c55e, #bbf7d0);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.95);
    z-index: 10001;
    transform-origin: left center;
}

.top-save-bar-active {
    animation: topSaveBar 1.2s ease-out forwards;
}

@keyframes topSaveBar {
    0% {
        width: 0;
        opacity: 1;
    }
    60% {
        width: 80%;
        opacity: 1;
    }
    100% {
        width: 100%;
        opacity: 0;
    }
}

.app-container {
    width: 100%;
    height: 100%;
}

.hidden {
    display: none !important;
}

/* Splash Screen */
.splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.splash-content {
    text-align: center;
}

.splash-icon-card {
    width: 140px;
    height: 140px;
    border-radius: 32px;
    background: #064e3b;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem auto;
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.65);
}

.splash-icon {
    font-size: 5rem;
    color: var(--primary);
    margin-bottom: 1rem;
    animation: pulse 2s infinite;
    filter: drop-shadow(0 0 10px rgba(11, 113, 55, 0.5));
}

.splash-logo {
    width: 110px;
    height: auto;
}

.splash-title {
    font-size: 2.5rem;
    margin: 1rem 0;
    font-weight: 700;
    opacity: 0;
    animation: fadeUp 0.8s forwards 0.3s;
}

/* Loader GIF Styles */
.loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    width: 100%;
}

.loader-gif {
    width: 64px;
    height: auto;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}



/* Login Screen */
#login-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    background: radial-gradient(circle at top right, #0b7137, #055a2c);
}

.login-card {
    background: rgba(11, 113, 55, 0.4);
    backdrop-filter: blur(10px);
    padding: 2.5rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: fadeUp 0.5s ease-out;
}

.login-card .btn-primary {
    background: var(--primary-hover);
    color: var(--bg-dark);
}

.login-card input::placeholder {
    color: #ffffff;
    opacity: 1;
}

#login-screen .input-wrapper input:focus,
#login-screen .input-wrapper select:focus {
    border-color: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.6), 0 10px 25px -10px rgba(0, 0, 0, 0.7);
    outline: none;
    transform: translateY(-1px);
}

.password-timeline {
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    justify-content: center;
    min-height: 1.25rem;
}

.password-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: transparent;
}

.password-dot.filled {
    background: #22c55e;
    border-color: #22c55e;
}

.password-timeline-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
}

#login-screen #password-helper {
    margin-top: 0.25rem;
    margin-bottom: 0.75rem;
    text-align: center;
    padding: 0.3rem 0.75rem;
    background: rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    color: var(--danger);
    font-weight: 500;
}

#login-screen #password {
    -webkit-text-security: disc;
}

#login-screen #password.password-visible {
    -webkit-text-security: none;
}

.form-footer {
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

.form-footer a {
    color: white;
    text-decoration: none;
}

.form-footer a:hover {
    text-decoration: underline;
}

.login-card#card-register .form-footer {
    margin-top: 0.5rem;
}

.logo i {
    font-size: 3.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
    display: inline-block;
    filter: drop-shadow(0 0 5px rgba(11, 113, 55, 0.3));
}

.logo img {
    width: 72px;
    height: 72px;
    margin-bottom: 0.75rem;
    display: inline-block;
}

.logo h1 {
    font-size: 1.5rem;
    margin: 0.5rem 0 0.2rem;
}

.logo p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

/* Dashboard Layout */
#dashboard-screen {
    display: flex;
    height: 100%;
    position: relative;
}

#dashboard-screen.sidebar-hidden .sidebar {
    display: none;
}

#dashboard-screen.sidebar-hidden .content {
    flex: 1;
}

.refresh-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #9edc3b;
    color: #064e3b;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.refresh-btn:hover {
    background: #bbf47a;
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 8px 15px rgba(0,0,0,0.4);
}

.key-photo-preview {
    margin-top: 0.75rem;
}

.key-photo-preview-inner {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
}

.key-photo-preview-inner img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.key-photo-preview-inner span {
    font-size: 0.85rem;
    color: #ffffff;
}

.desktop-sidebar-toggle {
    position: absolute;
    top: 1.25rem;
    left: -10px;
    z-index: 1101;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 999px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ffffff;
    transition: background 0.2s, transform 0.2s;
}

.desktop-sidebar-toggle i {
    font-size: 1.3rem;
    transition: transform 0.2s;
}

.desktop-sidebar-toggle i.sidebar-arrow-in {
    animation: sidebarArrowIn 0.2s ease-out;
}

.desktop-sidebar-toggle i.sidebar-arrow-out {
    animation: sidebarArrowOut 0.2s ease-out;
}

@keyframes sidebarArrowIn {
    0% { transform: translateX(0); }
    50% { transform: translateX(-4px); }
    100% { transform: translateX(0); }
}

@keyframes sidebarArrowOut {
    0% { transform: translateX(0); }
    50% { transform: translateX(4px); }
    100% { transform: translateX(0); }
}

@media (max-width: 768px) {
    .desktop-sidebar-toggle {
        display: none;
    }
}

.refresh-btn:active {
    background: #064e3b;
    color: #9edc3b;
    transform: scale(0.9);
}

.refresh-btn.spinning i {
    animation: spin 1s linear infinite;
}

.refresh-btn.spinning {
    background: #064e3b;
    color: #9edc3b;
    opacity: 0.8;
    pointer-events: none;
    cursor: wait;
    box-shadow: none;
}

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

.spinning {
    animation: spin 1s linear infinite;
}

@media (max-width: 768px) {
    .refresh-btn {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 48px;
        height: 48px;
        font-size: 1.4rem;
        z-index: 10002;
    }
}

.sidebar {
    width: 260px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.sidebar nav {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.25rem;
    display: flex;
    flex-direction: column;
}

.brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.nav-item {
    background: #16a34a; /* verde claro */
    border: none;
    color: #ffffff;
    width: 100%;
    text-align: left;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s;
    margin-bottom: 0.5rem;
    position: relative;
}

.nav-badge {
    position: absolute;
    top: 6px;
    right: 10px;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--danger);
    color: #ffffff;
    font-size: 0.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.nav-item:hover {
    background: #22c55e; /* hover um pouco mais claro */
    color: #ffffff;
}

.nav-item.active {
    background: #064e3b; /* verde escuro */
    color: #ffffff;
}

.nav-item.logout {
    background: var(--danger);
    color: #ffffff;
}

.nav-item.logout:hover {
    background: #b91c1c;
    color: #ffffff;
}

.nav-dropdown {
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.nav-dropdown.open {
    display: flex;
}

.nav-subitem {
    font-size: 0.9rem;
    padding-left: 2.5rem;
}

.spacer {
    flex: 1;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.avatar {
    width: 40px;
    height: 40px;
    background: var(--border);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
}

.details {
    display: flex;
    flex-direction: column;
}

.details span {
    font-weight: 500;
    font-size: 0.9rem;
}

.details small {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Content Area */
.content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    position: relative;
    background: linear-gradient(to bottom right, #055a2c, #022c15);
}

/* Forms */
.form-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    max-width: 600px;
    margin: 0 auto;
}

.settings-card {
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* Custom Scrollbar for settings card */
.settings-card::-webkit-scrollbar {
    width: 8px;
}

.settings-card::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.settings-card::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

/* Sidebar Branding Updates */
.sidebar-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    margin-bottom: 2rem;
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
    margin-bottom: 0.75rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.sidebar-system-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.sidebar-close-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 1100;
    transition: background 0.2s, color 0.2s, transform 0.2s;
}

.sidebar-close-btn:hover {
    background: rgba(0, 0, 0, 0.15);
    color: var(--danger);
    transform: scale(1.05);
}


.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .input-group {
    flex: 1;
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0.25rem; /* Reduced gap for mobile stacking */
    }
}

.input-group {
    margin-bottom: 0.75rem;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.photo-mode-options {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.photo-mode-options label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input,
.input-wrapper select {
    width: 100%;
    padding: 0.65rem 1rem 0.65rem 2.5rem;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.95rem;
    transition: all 0.2s;
    appearance: none;
    /* Remove default arrow */
    -webkit-appearance: none;
    -moz-appearance: none;
}

.input-wrapper input::placeholder {
    color: #ffffff;
    opacity: 1;
}

/* Add custom arrow for selects */
.input-wrapper:has(select)::after {
    content: '';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 7px solid var(--primary-hover);
    pointer-events: none;
}

.input-wrapper input:focus,
.input-wrapper select:focus {
    border-color: #9edc3b; /* Light Green */
    box-shadow: 0 0 0 3px rgba(158, 220, 59, 0.2);
    outline: none;
}

.input-wrapper select {
    appearance: none;
    cursor: pointer;
}



.icon-left {
    position: absolute;
    left: 1rem;
    color: var(--primary-hover);
    pointer-events: none;
    font-size: 1.1rem;
}

.icon-right {
    position: absolute;
    right: 1rem;
    color: var(--primary-hover);
    cursor: pointer;
    transition: color 0.2s;
    font-size: 1.1rem;
}

.icon-right:hover {
    color: var(--primary);
}

.btn-primary {
    width: 100%;
    padding: 0.85rem;
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    filter: brightness(0.9);
    transform: translateY(-2px);
}

.btn-success {
    width: 100%;
    padding: 0.85rem;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-success:hover {
    filter: brightness(1.1);
}

.btn-secondary {
    padding: 0.85rem;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    border-color: var(--text-main);
    color: var(--text-main);
}

.msg-error {
    color: var(--danger);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    min-height: 1.2em;
}

/* Views & Headers */
.view header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.view header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.stats {
    display: flex;
    gap: 1rem;
}

.stat-pill {
    background: var(--bg-card);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-pill.moving {
    border-color: var(--warning);
    color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
}

/* Map */
.map-container {
    width: 100%;
    /* height: 500px; Removed fixed height */
    flex: 1;
    /* Take remaining space */
    min-height: 0;
    /* Fix for flex child overflow */
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    z-index: 1;
}

#yard-map {
    height: 100%;
    width: 100%;
}

/* Views Layout Adjustments */
#view-overview {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.dashboard-placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dashboard-placeholder-logo {
    width: 160px;
    height: 160px;
    object-fit: contain;
    border-radius: 24px;
    background: rgba(0, 0, 0, 0.08);
    padding: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
}

#view-register {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

/* Custom spacing for Register View as requested */
#view-register header {
    margin-bottom: 2rem;
    /* Reduced from 4rem */
}

#view-register .input-group {
    margin-bottom: 0.65rem; /* Further reduced for compactness */
}

#view-register label {
    margin-bottom: 0.15rem;
    font-size: 0.85rem;
}

#view-register .form-card {
    padding: 1.25rem; /* Reduced from 2rem */
    max-height: 85vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

#view-register .form-card::-webkit-scrollbar {
    width: 6px;
}

#view-register .form-card::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

#register-form input::placeholder {
    color: var(--text-muted);
    opacity: 0.3;
}

/* Close Button on Card */
.card-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .card-header-actions {
        margin-bottom: 0.75rem;
    }
}

.card-header-actions h2 {
    margin-bottom: 0 !important;
}

.btn-close-card {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-close-card:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--danger);
}



/* Search Bar */
.search-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 1rem;
}

.search-input-wrapper input {
    width: 100%;
    border: none;
    background: transparent;
    padding: 0.85rem 0;
    color: var(--text-main);
    font-size: 1rem;
    height: auto;
}

.search-input-wrapper input::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

.search-input-wrapper input:focus {
    outline: none !important;
    box-shadow: none !important;
}

.icon-clear {
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
    margin-left: 0.25rem;
}

.icon-clear:hover {
    color: var(--primary);
}

.search-bar button {
    width: auto;
    padding: 0 1.5rem;
    background: #22c55e;
    border: none;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.search-bar button:hover {
    background: #16a34a;
}

/* Sector Filters */
.sector-filter-section {
    margin-bottom: 1.5rem;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.filter-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.filter-title {
    font-size: 0.95rem;
    color: var(--text-main);
    margin: 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-toggle-icon {
    font-size: 1.2rem;
    color: var(--text-muted);
    transition: transform 0.3s;
}

.sector-filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid var(--border);
    transition: all 0.3s ease-in-out;
}

.sector-filter-container.mobile-hidden {
    display: none;
}

.sector-filter-select-wrapper {
    display: none;
}

.sector-badge-filter {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    user-select: none;
    min-width: 40px;
    position: relative;
}

.sector-badge-filter:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateY(-2px);
}

.sector-badge-filter.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.sector-badge-filter.active::after {
    content: "✓";
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 0.6rem;
    background: rgba(15, 23, 42, 0.85);
    color: #bbf7d0;
    border-radius: 999px;
    padding: 1px 3px;
    line-height: 1;
}

.sector-badge-filter .count {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.sector-badge-filter.active .count {
    background: rgba(255, 255, 255, 0.25);
}

.sector-badge-filter.all {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-weight: 700;
    border-color: rgba(255, 255, 255, 0.1);
}

.sector-badge-filter.all:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.sector-badge-filter.all.active {
    background: var(--primary);
    border-color: var(--primary);
}

/* Occupied Status (Green) */
.sector-badge-filter.occupied {
    background: #22c55e;
    border-color: #22c55e;
    color: #022c15;
    font-weight: 700;
}

.sector-badge-filter.occupied:hover {
    background: #16a34a;
    border-color: #16a34a;
    color: white;
}

.sector-badge-filter.occupied.active {
    background: #15803d;
    border-color: #15803d;
    color: white;
}

.sector-badge-filter.occupied .count {
    background: rgba(0, 0, 0, 0.15);
    color: inherit;
}

/* Empty Status (Red) */
.sector-badge-filter.empty {
    border-color: transparent;
    /* Neutral for empty */
    color: rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.15);
    opacity: 1;
}

.sector-badge-filter.empty:hover {
    background: rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.6);
}

.sector-badge-filter.empty.active {
    background: var(--text-muted);
    color: white;
    border-color: var(--text-muted);
}

/* Mobile Specific Styles for Filters */
@media (max-width: 768px) {
    .sector-filter-container {
        display: none;
    }

    .sector-filter-select-wrapper {
        display: block;
        padding: 0 1rem 1rem 1rem;
    }

    .sector-filter-select-wrapper.mobile-hidden {
        display: none;
    }
}

/* Desktop: Disable toggle behavior visual cues */
@media (min-width: 769px) {
    .sector-filter-container {
        padding-top: 0.5rem;
        border-top: none;
    }
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
    padding: 0.5rem 0;
}

/* Empty State Styling */
.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem;
    color: var(--text-muted);
    text-align: center;
    width: 100%;
}

.empty-state i {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    color: var(--border);
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.2rem;
    font-weight: 500;
    margin: 0;
}

/* Estilos antigos dos cards removidos - usando nova estrutura */

.card-info {
    flex: 1;
}

.card-header-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.card-info h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-main);
}

.model-badge {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
}

.card-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.status-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-parked {
    background: #064e3b;
    color: #ffffff;
}

.status-moving {
    background: rgba(11, 113, 55, 0.1);
    color: var(--primary);
}

.status-removed {
    background: var(--danger);
    color: white;
    font-weight: 700;
}

/* User Status Badges */
.user-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.user-status.status-active {
    color: var(--success);
}

.user-status.status-blocked {
    color: var(--danger);
}

.user-status.sector-has-vehicles {
    background: #064e3b;
    color: #ffffff;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
}

.user-status.sector-empty {
    background: #b91c1c;
    color: #ffffff;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
}

.sector-badge {
    font-size: 0.75rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.card-action {
    color: var(--border);
    font-size: 1.5rem;
    transition: 0.2s;
}

.vehicle-card:hover .card-action {
    color: var(--primary);
    transform: translateX(4px);
}

/* Timeline/Detail */
.vehicle-detail {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 1.5rem;
    border: 1px solid var(--border);
}

.vehicle-detail .detail-map {
    display: none;
}

/* Timeline Redesign with Icons */
.timeline {
    margin: 1.5rem 0;
    border-left: 2px solid var(--border);
    padding-left: 0;
    /* Align icons on the line */
    margin-left: 1rem;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    padding-left: 2rem;
}

/* Remove old dot */
.timeline-item::before {
    display: none;
}

.timeline-icon {
    position: absolute;
    left: -15px;
    /* Centered on border (2px) approx */
    top: 0;
    width: 32px;
    height: 32px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

.timeline-icon i {
    font-size: 1.1rem;
}

.timeline-icon.entry {
    color: #064e3b;
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.18);
}

.timeline-photo-modal-content {
    max-width: 700px;
}

.timeline-photo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.timeline-photo-wrapper img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 12px;
    border: 1px solid var(--border);
    object-fit: contain;
}

.timeline-photo-nav {
    background: rgba(0, 0, 0, 0.4);
    border: none;
    color: #ffffff;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.timeline-photo-nav:hover {
    background: rgba(0, 0, 0, 0.7);
}

.timeline-photo-indicator {
    margin-top: 0.75rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.timeline-icon.exit {
    color: #7f1d1d;
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.18);
}

.timeline-icon.move {
    color: #78350f;
    border-color: var(--warning);
    background: rgba(245, 158, 11, 0.2);
}

.actions {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    background: rgba(6, 78, 59, 0.35);
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: space-between;
}

.actions h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: #ffffff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.actions #move-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.move-fields {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

@media (max-width: 768px) {
    .vehicle-detail .timeline {
        display: none;
    }

    .actions {
        flex-direction: column;
        align-items: stretch;
    }
}

.action-buttons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: flex-end;
    /* Aligns buttons to the right */
}

/* Make action buttons full-width on smaller screens if needed */
@media (max-width: 480px) {
    .action-buttons {
        flex-direction: column;
        width: 100%;
    }

    .action-buttons .btn-primary,
    .action-buttons .btn-secondary {
        width: 100%;
    }
}


.btn-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(11, 113, 55, 0.1);
    color: var(--primary);
    border-color: var(--primary);
}

.btn-icon i {
    font-size: 1.2rem;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 1;
    /* Should be controlled by JS */
    transition: opacity 0.3s ease;
    visibility: visible;
    /* Should be controlled by JS */
}

.modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.modal-content {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    width: 90%;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: scale(1);
    /* Controlled by JS */
    transition: transform 0.3s ease;
}

.modal-overlay.hidden .modal-content {
    transform: scale(0.95);
}

.modal-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    display: block;
}

.modal-icon.success {
    color: var(--success);
}

.modal-icon.error {
    color: var(--danger);
}

.modal-icon.warning {
    color: var(--warning);
}

.modal-icon.info {
    color: var(--primary);
}

.modal-icon.spinner {
    animation: modal-spin 1s linear infinite;
}

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

.modal-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.modal-content p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Making modal buttons not full width by default */
.modal-actions .btn-primary,
.modal-actions .btn-secondary {
    width: auto;
    padding: 0.75rem 1.5rem;
}

.action-buttons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.btn-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border-color: var(--text-main);
}

.btn-icon i {
    font-size: 1.2rem;
}

.btn-danger {
    width: 100%;
    padding: 0.85rem;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.btn-danger:hover {
    filter: brightness(1.1);
}



/* Sector Management Item */
.sector-management-item {
    background: var(--bg-card);
    padding: 1rem 1.5rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.sector-management-item:hover {
    background: #253347;
}

.sector-info-mgmt {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sector-icon-mgmt {
    font-size: 1.5rem;
    color: var(--primary);
}

.sector-details-mgmt h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.sector-details-mgmt p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        height: 100%;
        z-index: 1000;
        transition: left 0.3s ease;
        width: 280px;
    }

    .sidebar.open {
        left: 0;
    }

    .content {
        padding: 1.5rem;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .view header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .stats {
        width: 100%;
        justify-content: space-between;
    }

    .sector-management-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .action-buttons {
        width: 100%;
        justify-content: flex-end;
    }
}

#menu-toggle {
    display: none;
    /* Hidden by default */
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 44px;
    height: 44px;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    color: var(--text-main);
}

@media (max-width: 768px) {
    #menu-toggle {
        display: flex;
    }
}

/* Custom Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay:not(.hidden) {
    opacity: 1;
}

.modal-content {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    width: 90%;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay:not(.hidden) .modal-content {
    transform: scale(1);
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.modal-icon.success {
    color: var(--success);
}

.modal-icon.error {
    color: var(--danger);
}

.modal-icon.warning {
    color: var(--warning);
}

.modal-icon.info {
    color: var(--primary);
}

.modal-content h3 {
    font-size: 1.5rem;
    margin: 0 0 0.5rem;
}

.modal-content p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.5;
}

.modal-content .btn-primary {
    width: auto;
    padding: 0.75rem 2rem;
}

.modal-actions-row {
    display: flex;
    gap: 1rem;
    justify-content: center;
}



.sector-list-vertical {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Action Buttons (General) */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-icon {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    border: none;
    background: var(--primary);
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.btn-icon.danger {
    background: var(--danger);
    color: #ffffff;
}

.btn-icon:hover {
    background: var(--primary-hover);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.3);
}

.btn-icon.danger:hover {
    background: #dc2626;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3);
}

.btn-icon.warning {
    background: var(--warning);
    color: white;
}

.btn-icon.warning:hover {
    background: #d97706;
    box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.3);
}

.btn-icon.success {
    background: var(--success);
    color: white;
}

.btn-icon.success:hover {
    background: #16a34a;
    box-shadow: 0 4px 6px -1px rgba(34, 197, 94, 0.3);
}

/* Fix table cell alignment for actions */
td .action-buttons {
    justify-content: flex-start;
}

/* --- Action & Exit Modals --- */
.action-modal-content {
    max-width: 600px;
    width: 95%;
}

.modal-title-left {
    text-align: left;
    font-size: 1.5rem;
    margin-bottom: 0.2rem;
}

.modal-subtitle-left {
    text-align: left;
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.action-buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 8px;
}

/* Custom Scrollbar for Action Grid */
.action-buttons-grid::-webkit-scrollbar {
    width: 6px;
}

.action-buttons-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.action-buttons-grid::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

.action-buttons-grid::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.action-btn-large {
    background: var(--bg-dark);
    border: 1px solid rgba(34, 197, 94, 0.7);
    border-radius: 12px;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-main);
    box-shadow: 0 16px 32px -18px rgba(0, 0, 0, 0.9);
}

.action-btn-large:hover {
    background: rgba(34, 197, 94, 0.18);
    border-color: var(--primary);
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 20px 40px -18px rgba(0, 0, 0, 0.95);
}

.action-btn-large .action-icon {
    width: 56px;
    height: 56px;
    background: rgba(34, 197, 94, 0.22);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    color: #bbf7d0;
    margin-bottom: 0.5rem;
    box-shadow: 0 16px 32px -18px rgba(0, 0, 0, 0.95);
}

.action-btn-large.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
}

.action-btn-large.danger .action-icon {
    color: var(--danger);
}

.action-btn-large.warning:hover {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning);
}

.action-btn-large.warning .action-icon {
    color: var(--warning);
}

.action-btn-large span {
    font-weight: 600;
    font-size: 1rem;
}

.action-btn-large small {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: underline;
}

/* Exit Form Styling */
.modal-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header-row h3 {
    font-size: 1.25rem;
    margin: 0;
}

.close-icon {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}

.close-icon:hover {
    color: var(--danger);
}

.vehicle-summary {
    background: var(--bg-dark);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    border: 1px solid var(--border);
}

.summary-item label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.summary-item span {
    font-weight: 600;
    font-size: 1rem;
}

/* Sector List Vertical (Admin) */
.sector-list-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Sector Item */
.sector-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.sector-item:hover {
    border-color: var(--primary);
    transform: translateX(2px);
    background: rgba(11, 113, 55, 0.05);
}

.sector-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.sector-name {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-main);
    min-width: 40px;
}

.sector-item .btn-icon {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
}

.sector-board-wrapper {
    max-width: 100%;
}

.sector-board-info-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.sector-board-info-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sector-board-info-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.sector-board-info-text {
    font-weight: 600;
}

.sector-board-datetime {
    font-size: 0.9rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.sector-board-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.sector-board-select-group {
    flex: 1;
    min-width: 220px;
}

.sector-board-toggle-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    white-space: nowrap;
}

.sector-board-toggle-group span {
    font-size: 0.9rem;
}

.sector-board-queue {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.sector-board-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-main);
    min-width: 180px;
    cursor: pointer;
    transition: all 0.2s;
}

.sector-board-card:hover {
    border-color: var(--primary-hover);
    background: rgba(11, 113, 55, 0.4);
    transform: translateY(-2px);
}

.sector-board-card-plate {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.sector-board-card-model {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.sector-board-card-meta {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    margin-top: 0.35rem;
}

.sector-board-card-arrow {
    opacity: 0.7;
}

/* --- Responsive & Mobile Styles --- */

/* Hide Mobile Header by default (Desktop) */
.mobile-header {
    display: none;
    background: var(--bg-card);
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.brand-mobile {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.menu-toggle {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
    position: relative;
    z-index: 1001;
    /* Ensure button is above sidebar */
}

/* User Management Table */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.user-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
    /* Force scroll on small screens */
}

.user-table th,
.user-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.user-table th {
    color: #ffffff;
    background: var(--bg-dark);
    font-weight: 500;
    font-size: 0.85rem;
}

.user-table td {
    font-size: 0.95rem;
    color: #ffffff; /* Texto em branco */
}

.user-table tr.user-pending-access {
    background: rgba(239, 68, 68, 0.18);
}

.btn-icon-small {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.4rem;
    border-radius: 4px;
    transition: 0.2s;
}

.btn-icon-small.edit {
    color: var(--primary);
}

.btn-icon-small.edit:hover {
    background: rgba(59, 130, 246, 0.1);
}

.btn-icon-small.delete {
    color: var(--danger);
}

.btn-icon-small.delete:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Mobile Breakpoint */
@media (max-width: 768px) {

    /* Layout Changes */
    #dashboard-screen {
        flex-direction: column;
    }

    .mobile-header {
        display: flex;
    }

    .sidebar-close-btn {
        display: flex;
    }

    /* Sidebar as Overlay/Offcanvas */
    .sidebar {
        position: fixed;
        top: 0;
        right: -100%;
        /* Hidden by default (Right side) */
        left: auto;
        /* Unset left */
        height: 100vh;
        width: 80%;
        max-width: 300px;
        z-index: 1000;
        transition: right 0.3s ease-in-out;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
        /* Shadow on left */
    }

    .sidebar.active {
        right: 0;
        left: auto;
    }

    /* Sidebar Overlay (Backdrop) */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 900;
        /* Behind sidebar (1000) but above content */
        backdrop-filter: blur(2px);
    }

    /* Content Area */
    .form-card {
        padding: 1rem;
        width: 100%;
        max-width: none;
        margin: 0;
        border-radius: 0;
    }

    /* Map Height */
    .map-container {
        height: 400px;
    }

    .content {
        padding: 0.5rem; /* Reduced to give more space */
        height: calc(100vh - 60px);
    }

    .form-row {
        flex-direction: column;
        gap: 1.25rem;
    }

    /* Grid Adjustments */
    .results-grid {
        grid-template-columns: 1fr;
        /* Single column on mobile */
    }

    /* Login Screen */
    .login-card {
        width: 90%;
        padding: 2rem 1.5rem;
    }

    /* Stats in Header */
    .view header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .stats {
        width: 100%;
        display: flex;
        gap: 0.5rem;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .stat-pill {
        white-space: nowrap;
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    /* Action Modal */
    .action-buttons-grid {
        grid-template-columns: repeat(2, 1fr);
        /* 2 columns for buttons */
    }

    .action-btn-large {
        padding: 1rem 0.5rem;
    }

    .action-btn-large .action-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .action-btn-large span {
        font-size: 0.9rem;
        text-align: center;
    }

    .action-btn-large small {
        display: none;
        /* Hide description on very small screens to save space */
    }

    /* Generic Mobile Icon Button Size */
    .btn-icon,
    .sector-item .btn-icon {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
    }
}

/* Modal Overlay Base Styles (High Z-Index Fix) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    /* Ensure it's on top of everything */
    padding: 1rem;
    pointer-events: auto;
    /* Ensure clicks are captured */
}

/* External Spinner */
#modal-top-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto 1.5rem auto;
}

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

.modal-content {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    width: 100%;
    max-width: 400px;
    text-align: center;
    animation: fadeUp 0.3s ease-out;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    pointer-events: auto;
    /* Ensure content is clickable */
}

.modal-content.modal-no-scroll {
    overflow-y: hidden;
}

.modal-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
    display: block;
}

.modal-actions-row {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.detail-header {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.detail-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.detail-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.detail-title {
    font-size: 1.5rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-model-span {
    font-size: 0.9rem;
    background: var(--warning);
    color: #111827;
    font-weight: 600;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    margin-left: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.btn-close-detail {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.2rem;
}

.btn-close-detail:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
    transform: scale(1.05);
}

.btn-view-photos {
    background: #16a34a;
    border: 1px solid #16a34a;
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.2rem;
}

.btn-view-photos:hover {
    background: #22c55e;
    border-color: #22c55e;
    color: #ffffff;
    transform: scale(1.05);
}

.timeline-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.timeline-content {
    font-size: 0.95rem;
    margin-top: 0.2rem;
}

/* Vehicle Plaque (Tooltip) */
.vehicle-plaque {
    background: var(--bg-card) !important;
    border: 1px solid var(--primary) !important;
    color: var(--text-main) !important;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    font-size: 0.8rem;
    padding: 2px 6px;
}

.vehicle-plaque::before {
    border-top-color: var(--primary) !important;
}

/* Leaflet Customization */
.leaflet-popup-content-wrapper {
    background: var(--bg-card);
    color: var(--text-main);
}

.leaflet-popup-tip {
    background: var(--bg-card);
}

/* Custom Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal-overlay.active,
.modal-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: all;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

#confirm-modal,
#custom-modal {
    z-index: 11000;
}

.refresh-modal-content {
    max-width: 260px;
    text-align: center;
    padding: 2rem 2.5rem;
}

.refresh-modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 999px;
    margin: 0 auto 1rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #064e3b;
    color: #9edc3b;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
}

.refresh-modal-icon i {
    font-size: 2rem;
}

.refresh-modal-text {
    color: var(--text-main);
    font-weight: 500;
}

.modal-content {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    width: 100%;
    max-width: 400px;
    text-align: center;
    animation: fadeUp 0.3s ease-out;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

/* Header Actions & Close Modal Button */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-close-modal-mobile {
    display: none;
    background: transparent;
    border: 2px solid var(--primary-hover);
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-close-modal-mobile:hover {
    background: rgba(158, 220, 59, 0.12);
    color: #ffffff;
}

/* Mobile Adjustments */
@media (max-width: 768px) {

    .sidebar nav .nav-item i {
        display: none;
    }

    .sidebar nav .nav-item .nav-dropdown-arrow {
        display: inline-block;
    }

    .sidebar nav .nav-item[data-view="sector-board"] {
        display: none !important;
    }

    .brand-mobile i {
        display: none;
    }

    .filter-title i {
        display: none;
    }

    .icon-left {
        display: none;
    }

    .view header h2 i {
        display: none;
    }

    .form-card h3 i {
        display: none;
    }

    .card-header-actions h2 i {
        display: none;
    }

    .input-wrapper input,
    .input-wrapper select {
        padding-left: 1rem;
    }

    .sector-badge-filter.empty {
        display: none !important;
    }

    /* User Management Modal Style */
    #view-users,
    #view-sectors {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 2000;
        background: var(--bg-dark);
        /* or card */
        padding: 1rem;
        overflow-y: auto;
        /* Animation */
        animation: slideUp 0.3s ease-out;
    }

    #view-users.hidden,
    #view-sectors.hidden {
        display: none !important;
    }

    #view-users .stats .stat-pill {
        display: none;
    }

    .vehicle-detail {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 2100;
        margin-top: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
        padding: 1rem;
        display: flex;
        align-items: stretch;
        justify-content: flex-start;
        background: var(--bg-dark);
    }

    .vehicle-detail.hidden {
        display: none !important;
    }

    .btn-close-modal-mobile {
        display: inline-flex;
    }

    /* Adjust header in management modals */
    /* Adjust header in management modals */
    #view-users header,
    #view-sectors header,
    #view-slots header,
    #view-reports header,
    #view-settings header,
    #view-backup header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1.5rem;
        padding-bottom: 1.25rem;
        border-bottom: 1px solid var(--border);
        gap: 0.5rem;
    }

    .vehicle-detail-card {
        background: var(--bg-card);
        border-radius: 16px;
        border: 1px solid var(--border);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
        padding: 0.75rem 1rem 0.75rem;
        display: flex;
        flex-direction: column;
        width: 100%;
        max-height: 100%;
        overflow-y: auto;
    }

    .vehicle-detail .detail-header {
        margin-bottom: 1rem;
        position: sticky;
        top: 0;
        z-index: 2205;
        padding-bottom: 0.75rem;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border);
    }

    .vehicle-detail .detail-map {
        display: none;
    }

    .vehicle-detail .timeline {
        background: var(--bg-card);
        border-radius: 12px;
        border: 1px solid var(--border);
        padding: 1rem 1.25rem;
        margin: 0;
        margin-top: 1rem;
    }

    .vehicle-detail .timeline.empty {
        display: none;
    }

    .vehicle-detail .actions {
        margin-top: 1rem;
        border-top: 1px solid var(--border);
        padding-top: 0.75rem;
    }

    #view-users header h2,
    #view-sectors header h2,
    #view-slots header h2,
    #view-reports header h2,
    #view-settings header h2 {
        font-size: 1.15rem;
        margin: 0;
        flex: 1;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }

    #view-users header h2 i,
    #view-sectors header h2 i,
    #view-slots header h2 i,
    #view-reports header h2 i,
    #view-settings header h2 i {
        vertical-align: middle;
        margin-right: 0.4rem;
        font-size: 1.25rem;
    }

    #view-users .header-actions,
    #view-sectors .header-actions,
    #view-slots .header-actions {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    #view-users .stats {
        gap: 0.4rem;
    }

    /* Responsive labels for buttons */
    @media (max-width: 420px) {
        #view-users .btn-label {
            display: none;
        }

        #view-users .btn-primary {
            padding: 0 0.75rem !important;
            min-width: 36px;
        }
    }

    @media (min-width: 421px) and (max-width: 580px) {
        #view-users .btn-label {
            font-size: 0;
        }

        #view-users .btn-label::after {
            content: "Novo";
            font-size: 0.9rem;
        }
    }

    /* User Management Cards */
    .user-table thead {
        display: none;
    }

    .user-table,
    .user-table tbody,
    .user-table tr,
    .user-table td {
        display: block;
        width: 100%;
        min-width: 0;
        /* Reset min-width to avoid overflow */
    }

    .user-table tr {
        margin-bottom: 1.5rem;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 0;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        overflow: hidden;
    }

    .user-table tr.user-pending-access {
        background: rgba(239, 68, 68, 0.22);
        border-color: var(--danger);
    }

    .user-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        padding: 0.75rem 1rem;
        /* Added horizontal padding */
        border-bottom: 1px solid var(--border);
        color: #ffffff !important; /* Garantir texto branco em mobile */
    }

    /* Header Style for First Child (Name) */
    .user-table td:first-child {
        background: rgba(59, 130, 246, 0.1);
        /* Primary color light bg */
        border-bottom: 1px solid var(--border);
        padding: 1rem;
        font-weight: 700;
        color: var(--primary);
    }

    .user-table td:first-child strong {
        font-size: 1.1rem;
        color: #ffffff;
    }

    .user-table td:last-child {
        border-bottom: none;
        justify-content: center;
        /* Center buttons */
        gap: 0.75rem;
        margin-top: 0;
        padding: 1rem;
        border-top: 1px solid var(--border);
        background: rgba(0, 0, 0, 0.1);
        /* Slight darker bg for footer */
    }

    /* Action Buttons in Mobile Card - Fix for Inline & Larger */
    .user-table .action-buttons {
        display: flex;
        flex-direction: row !important;
        /* Force inline */
        gap: 1rem;
        width: 100%;
        margin-top: 0.5rem;
    }

    .user-table .btn-icon {
        flex: 1;
        /* Make buttons expand to fill width */
        height: 50px;
        /* Larger touch target */
        display: flex;
        justify-content: center;
        align-items: center;
        border-radius: 12px;
        font-size: 1.4rem;
        /* Larger icon */
        background: var(--bg-dark);
        border: 1px solid var(--border);
        color: var(--text-main);
    }

    .user-table .btn-icon:hover {
        transform: translateY(-2px);
    }

    /* Specific Button Colors */
    .user-table .btn-icon.warning {
        /* Edit/Block */
        background: rgba(245, 158, 11, 0.15);
        border-color: var(--warning);
        color: var(--warning);
    }

    .user-table .btn-icon.success {
        /* Activate */
        background: rgba(16, 185, 129, 0.15);
        border-color: var(--success);
        color: var(--success);
    }

    .user-table .btn-icon.danger {
        /* Delete */
        background: rgba(239, 68, 68, 0.15);
        border-color: var(--danger);
        color: var(--danger);
    }

    /* Override pseudo-element for Name in header if desired, or keep it */
    .user-table td:first-child::before {
        display: none;
        /* Hide 'Nome' label in the header strip for cleaner look */
    }

    /* Labels via pseudo-elements */
    .user-table td::before {
        font-weight: 600;
        color: var(--text-muted);
        font-size: 0.9rem;
        text-align: left;
    }

    .user-table td:nth-of-type(1)::before {
        content: "Nome";
    }

    .user-table td:nth-of-type(2)::before {
        content: "E-mail";
    }

    .user-table td:nth-of-type(3)::before {
        content: "Cargo";
    }

    .user-table td:nth-of-type(4)::before {
        content: "Status";
    }

    .user-table td:nth-of-type(5)::before {
        content: "";
        display: none;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge-success {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Refueling Table Checkbox */
.user-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Vehicle Grid & Cards */
.vehicle-grid,
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
    padding: 0.5rem 0;
}

.vehicle-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    min-height: 180px;
    height: auto;
}

.vehicle-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.vehicle-header {
    padding: 0.8rem 1rem;
    background: rgba(11, 113, 55, 0.25);
    border-bottom: 1px solid var(--border);
    text-align: center;
    flex-shrink: 0;
}

.vehicle-plate {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--text-main);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    word-break: break-all;
    line-height: 1.2;
}

.vehicle-body {
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.vehicle-status {
    flex-shrink: 0;
}

.vehicle-footer {
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.12);
    border-top: 1px solid rgba(255,255,255,0.08);
    border-radius: 0 0 14px 14px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    justify-content: space-between;
    align-items: center;
    flex: 1;
    min-height: 0;
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: #ffffff; /* Branco */
    line-height: 1.2;
    white-space: nowrap;
    flex-shrink: 0;
}

.detail-row i {
    color: #9edc3b; /* Verde claro */
    font-size: 0.85rem;
    flex-shrink: 0;
}

.detail-row span {
    color: #ffffff; /* Branco */
    flex-shrink: 0;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-badge.parked {
    background: #064e3b;
    color: #fff;
    font-size: 0.75rem;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

.status-badge.moving {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
    font-size: 0.75rem;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
}

.status-badge.removed {
    background: var(--danger);
    color: white;
    font-size: 0.75rem;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Melhorar a legibilidade dos textos nos cards */
.vehicle-footer .detail-row span {
    /* Removido para permitir layout horizontal */
}

@media (max-width: 768px) {
    .vehicle-grid,
    .results-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .vehicle-card {
        min-height: 160px;
    }
    
    .vehicle-header {
        padding: 0.6rem 0.75rem;
    }
    
    .vehicle-plate {
        font-size: 1rem;
        letter-spacing: 1px;
    }
    
    .vehicle-body {
        padding: 0.75rem;
    }
    
    .vehicle-footer {
        padding: 0.6rem;
        gap: 0.5rem 0.75rem;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-around;
    }
    
    .detail-row {
        font-size: 0.75rem;
        gap: 0.3rem;
    }
    
    .detail-row span {
        max-width: 70px;
    }
}

@media (max-width: 480px) {
    .vehicle-grid,
    .results-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .search-bar {
        flex-direction: column;
        gap: 0.5rem;
    }

    .search-input-wrapper {
        width: 100%;
    }

    #search-btn {
        width: 100%;
        height: 45px;
        justify-content: center;
    }

    .vehicle-card {
        flex-direction: column;
        min-height: auto;
    }

    .vehicle-header,
    .vehicle-body,
    .vehicle-footer {
        width: 100%;
        text-align: center;
    }

    .detail-row {
        justify-content: center;
        width: auto;
    }
}

/* Estilos adicionais para melhorar os cards */
.vehicle-card.card-removed {
    border-color: rgba(239, 68, 68, 0.4);
    opacity: 0.9;
}

.vehicle-card.card-removed:hover {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.05);
    opacity: 1;
}

/* Garantir que textos longos não quebrem o layout */
.vehicle-footer .detail-row {
    min-height: auto;
    align-items: center;
}

.vehicle-footer .detail-row span {
    /* Estilos já definidos acima */
}

/* Melhorar a responsividade em telas muito pequenas */
@media (max-width: 360px) {
    .vehicle-grid,
    .results-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        padding: 0.25rem 0;
    }
    
    .vehicle-card {
        min-height: 120px;
    }
    
    .vehicle-header {
        padding: 0.5rem;
    }
    
    .vehicle-plate {
        font-size: 0.9rem;
        letter-spacing: 0.5px;
    }
    
    .vehicle-body {
        padding: 0.5rem;
    }
    
    .vehicle-footer {
        padding: 0.5rem;
        gap: 0.4rem 0.6rem;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-around;
    }
    
    .detail-row {
        font-size: 0.7rem;
        gap: 0.25rem;
    }
    
    .detail-row span {
        max-width: 60px;
    }
    
    .status-badge.parked,
    .status-badge.moving,
    .status-badge.removed {
        font-size: 0.7rem;
        padding: 0.25rem 0.6rem;
    }
}

/* Garantir que o grid funcione bem em telas grandes */
@media (min-width: 1200px) {
    .vehicle-grid,
    .results-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 1.5rem;
    }
}

/* Melhorar a acessibilidade e foco */
.vehicle-card:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.vehicle-card:focus:not(:focus-visible) {
    outline: none;
}/* Co
rreção final para evitar corte de dados */
.vehicle-card * {
    box-sizing: border-box;
}

.vehicle-footer .detail-row span {
    /* Estilos já definidos na seção principal */
}

/* Garantir que o conteúdo não seja cortado em nenhuma situação */
.vehicle-card {
    contain: layout style;
}

.vehicle-footer {
    overflow: visible;
}

/* Melhorar a exibição de textos longos */
.detail-row span[title] {
    cursor: help;
}

.detail-row span[title]:hover {
    text-decoration: underline;
    text-decoration-style: dotted;
}/
* Garantir layout horizontal dos dados nos cards */
.vehicle-footer {
    min-height: 40px;
}

.vehicle-footer .detail-row:nth-child(1) {
    order: 1; /* Modelo */
}

.vehicle-footer .detail-row:nth-child(2) {
    order: 2; /* Setor */
}

.vehicle-footer .detail-row:nth-child(3) {
    order: 3; /* Vaga */
}

/* Melhorar a distribuição em telas pequenas */
@media (max-width: 320px) {
    .vehicle-footer {
        padding: 0.4rem;
        gap: 0.3rem 0.5rem;
    }
    
    .detail-row {
        font-size: 0.65rem;
        gap: 0.2rem;
    }
    
    .detail-row span {
        max-width: 50px;
    }
    
    .detail-row i {
        font-size: 0.75rem;
    }
}/
* Garantir cores consistentes nos ícones e textos dos cards */
.vehicle-footer .detail-row i {
    color: #9edc3b !important; /* Verde claro para ícones */
}

.vehicle-footer .detail-row span {
    color: #ffffff !important; /* Branco para textos */
}

.vehicle-footer .detail-row {
    color: #ffffff; /* Cor base branca */
}

/* Manter as cores em hover */
.vehicle-card:hover .detail-row i {
    color: #bbf7d0; /* Verde ainda mais claro no hover */
}

.vehicle-card:hover .detail-row span {
    color: #ffffff; /* Manter branco no hover */
}
/* Sector Filter Button Styling */
.sector-filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    margin-top: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.sector-filter-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sector-filter-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sector-filter-btn.active {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
}

.sector-filter-btn:active {
    transform: translateY(0);
}

/* Custom Scrollbar for Filters if they overflow */
.sector-filter-container::-webkit-scrollbar {
    height: 4px;
}
.sector-filter-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* Ensure mobile select matches aesthetics */
.sector-filter-select-wrapper .input-wrapper {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 0.2rem 0.5rem;
}

.sector-filter-select-wrapper select {
    color: #fff;
    background: transparent;
    font-weight: 500;
}

.sector-filter-select-wrapper select option {
    background: var(--bg-card);
    color: #fff;
}

/* Mobile Sector Filter Optimization */
@media (max-width: 768px) {
    .sector-filter-container {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
        padding: 0.8rem;
        background: rgba(0, 0, 0, 0.2);
        border-radius: 15px;
        max-height: 250px;
        overflow-y: auto;
    }

    .sector-filter-btn {
        padding: 0.5rem 0.2rem;
        font-size: 0.65rem;
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 35px;
        border-radius: 8px;
        letter-spacing: 0;
    }

    /* Make long names span 2 columns if needed, but for now 3-col grid is cleaner */
    .sector-filter-btn[data-sector="all"], 
    .sector-filter-btn[data-sector="removed"] {
        grid-column: span 1;
    }
    
    #sector-filters-header {
        font-size: 0.9rem;
        padding: 0.8rem;
    }
}

/* Static Filters Styling */
.filter-header.no-toggle {
    cursor: default;
}
.filter-header.no-toggle:hover {
    background: transparent;
}
/* Garantir que todos os textos da tabela de usuários sejam brancos */
.user-table td,
.user-table td * {
    color: #ffffff !important;
}

/* Específico para e-mails */
.user-table td[style*="text-transform"] {
    color: #ffffff !important;
}

/* Garantir que links de e-mail também sejam brancos */
.user-table td a {
    color: #ffffff !important;
    text-decoration: none;
}

.user-table td a:hover {
    color: #e5e7eb !important;
    text-decoration: underline;
}/* 
Regras adicionais para garantir texto branco em todas as situações */
@media (max-width: 768px) {
    .user-table td,
    .user-table td *,
    .user-table td strong,
    .user-table td span {
        color: #ffffff !important;
    }
    
    /* Específico para e-mails em mobile */
    .user-table td:nth-of-type(2) {
        color: #ffffff !important;
    }
}

/* Garantir que pseudo-elementos também sejam visíveis */
.user-table td::before {
    color: rgba(255, 255, 255, 0.7) !important;
}