/* ============================================================
   REGULAÇÃO MUNICIPAL E CONTROLE DE VIAGENS
   Estilo visual inspirado no sistema Fiorilli
   Paleta: Verde (#00A651), Branco, Verde Escuro, Vermelho
   ============================================================ */

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

:root {
    --primary: #00A651;
    --primary-dark: #008C44;
    --primary-darker: #006B35;
    --primary-light: #E8F5E9;
    --secondary: #2E7D32;
    --accent-red: #D32F2F;
    --accent-red-light: #FFEBEE;
    --accent-orange: #F57C00;
    --accent-blue: #1565C0;
    --accent-blue-light: #E3F2FD;
    --bg-body: #F0F2F5;
    --bg-white: #FFFFFF;
    --bg-sidebar: #1B3A26;
    --bg-topbar: #FFFFFF;
    --text-primary: #212529;
    --text-secondary: #6C757D;
    --text-light: #ADB5BD;
    --text-sidebar: #C8E6C9;
    --border-color: #DEE2E6;
    --border-light: #E9ECEF;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --sidebar-width: 260px;
    --topbar-height: 56px;
    --transition: all 0.25s ease;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* === TOP BAR === */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: var(--bg-topbar);
    border-bottom: 3px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.sidebar-toggle:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}
.logo-icon {
    font-size: 1.5rem;
    color: var(--primary);
}
.logo-text {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-dark);
    letter-spacing: -0.5px;
}

.system-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-left: 1px solid var(--border-color);
    padding-left: 12px;
    display: none;
}

@media (min-width: 992px) {
    .system-title { display: inline; }
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.municipio-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: none;
}
@media (min-width: 768px) {
    .municipio-label { display: inline-flex; align-items: center; gap: 4px; }
}

.user-menu { position: relative; }
.user-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 5px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: var(--transition);
}
.user-btn:hover { border-color: var(--primary); background: var(--primary-light); }
.user-btn .fa-user-circle { font-size: 1.2rem; color: var(--primary); }
.user-btn .fa-chevron-down { font-size: 0.65rem; color: var(--text-secondary); }
.user-name { display: none; }
@media (min-width: 576px) { .user-name { display: inline; } }

.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    z-index: 1001;
    overflow: hidden;
}
.user-dropdown.show { display: block; }
.user-dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-primary);
    transition: var(--transition);
}
.user-dropdown a:hover { background: var(--primary-light); color: var(--primary); }
.user-dropdown .logout-link { border-top: 1px solid var(--border-light); color: var(--accent-red); }
.user-dropdown .logout-link:hover { background: var(--accent-red-light); }

/* === SIDEBAR === */
.sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 999;
    transition: var(--transition);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

.sidebar.collapsed { left: calc(-1 * var(--sidebar-width)); }

.sidebar-nav { padding: 8px 0; }

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-section {
    padding: 16px 20px 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(200,230,201,0.5);
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--text-sidebar);
    font-size: 0.9rem;
    transition: var(--transition);
    border-left: 3px solid transparent;
    position: relative;
}
.nav-item a:hover {
    background: rgba(255,255,255,0.08);
    color: #FFFFFF;
}
.nav-item.active > a {
    background: rgba(0,166,81,0.2);
    color: #FFFFFF;
    border-left-color: var(--primary);
    font-weight: 600;
}
.nav-item a i { width: 20px; text-align: center; font-size: 0.95rem; }

.nav-badge {
    background: var(--accent-red);
    color: #FFF;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: auto;
}

/* Submenus */
.submenu-toggle { cursor: pointer; }
.submenu-arrow {
    margin-left: auto;
    font-size: 0.65rem;
    transition: transform 0.25s ease;
}
.has-submenu.open .submenu-arrow { transform: rotate(90deg); }

.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0,0,0,0.15);
}
.has-submenu.open .submenu { max-height: 500px; }

.submenu li a {
    padding: 8px 20px 8px 52px;
    font-size: 0.85rem;
    color: rgba(200,230,201,0.75);
}
.submenu li a:hover { color: #FFF; }
.submenu li.active a { color: #FFF; font-weight: 600; }
.submenu li a i { font-size: 0.8rem; }

/* === MAIN CONTENT === */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    min-height: calc(100vh - var(--topbar-height));
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}
.main-content.expanded { margin-left: 0; }

.content-wrapper {
    flex: 1;
    padding: 24px;
}

@media (max-width: 991px) {
    .sidebar { left: calc(-1 * var(--sidebar-width)); }
    .sidebar.mobile-open { left: 0; }
    .main-content { margin-left: 0; }
}

/* === FOOTER === */
.main-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-light);
    background: var(--bg-white);
    flex-wrap: wrap;
    gap: 8px;
}

/* === PAGE HEADER === */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}
.page-header h1 i { color: var(--primary); }

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.breadcrumb a { color: var(--primary); }
.breadcrumb .separator { color: var(--text-light); }

/* === CARDS === */
.card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}
.card-header {
    padding: 14px 20px;
    border-bottom: 2px solid var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.card-header h2 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-header h2 i { color: var(--primary); }
.card-body { padding: 20px; }
.card-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

/* === DASHBOARD STATS === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border-left: 4px solid var(--primary);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card.blue { border-left-color: var(--accent-blue); }
.stat-card.orange { border-left-color: var(--accent-orange); }
.stat-card.red { border-left-color: var(--accent-red); }
.stat-card.green { border-left-color: var(--primary); }

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.stat-card.green .stat-icon { background: var(--primary-light); color: var(--primary); }
.stat-card.blue .stat-icon { background: var(--accent-blue-light); color: var(--accent-blue); }
.stat-card.orange .stat-icon { background: #FFF3E0; color: var(--accent-orange); }
.stat-card.red .stat-icon { background: var(--accent-red-light); color: var(--accent-red); }

.stat-info h3 { font-size: 1.6rem; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.stat-info p { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; }

/* === TABLES === */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
table thead th {
    background: var(--primary-light);
    color: var(--primary-darker);
    font-weight: 600;
    padding: 10px 14px;
    text-align: left;
    border-bottom: 2px solid var(--primary);
    white-space: nowrap;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
table tbody tr:hover { background: #F8FFF8; }
table tbody tr:nth-child(even) { background: #FAFAFA; }
table tbody tr:nth-child(even):hover { background: #F8FFF8; }

/* === BADGES === */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
}
.badge-success { background: #E8F5E9; color: #2E7D32; }
.badge-danger { background: #FFEBEE; color: #C62828; }
.badge-warning { background: #FFF8E1; color: #E65100; }
.badge-info { background: #E3F2FD; color: #1565C0; }
.badge-primary { background: #E8F5E9; color: #00A651; }
.badge-secondary { background: #ECEFF1; color: #546E7A; }

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.btn-primary { background: var(--primary); color: #FFF; }
.btn-primary:hover { background: var(--primary-dark); color: #FFF; }

.btn-success { background: #2E7D32; color: #FFF; }
.btn-success:hover { background: #1B5E20; color: #FFF; }

.btn-danger { background: var(--accent-red); color: #FFF; }
.btn-danger:hover { background: #B71C1C; color: #FFF; }

.btn-warning { background: var(--accent-orange); color: #FFF; }
.btn-warning:hover { background: #E65100; color: #FFF; }

.btn-info { background: var(--accent-blue); color: #FFF; }
.btn-info:hover { background: #0D47A1; color: #FFF; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

.btn-sm { padding: 5px 10px; font-size: 0.78rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }

.btn-group { display: flex; gap: 4px; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.btn-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* === FORMS === */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.form-group label .required { color: var(--accent-red); }

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-white);
    transition: var(--transition);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,166,81,0.15);
}
.form-control:disabled, .form-control[readonly] {
    background: #F5F5F5;
    color: var(--text-secondary);
}

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

.form-text {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.input-group {
    display: flex;
    align-items: stretch;
}
.input-group .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* === ALERTS === */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 4px solid;
}
.alert-success { background: #E8F5E9; border-color: var(--primary); color: #1B5E20; }
.alert-danger { background: #FFEBEE; border-color: var(--accent-red); color: #B71C1C; }
.alert-warning { background: #FFF8E1; border-color: var(--accent-orange); color: #E65100; }
.alert-info { background: #E3F2FD; border-color: var(--accent-blue); color: #0D47A1; }

/* === MODAL === */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.show { display: flex; }

.modal {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-header {
    padding: 16px 20px;
    border-bottom: 2px solid var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-dark);
}
.modal-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
}
.modal-close:hover { color: var(--accent-red); }
.modal-body { padding: 20px; }
.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* === PAGINATION === */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 16px;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--text-primary);
    transition: var(--transition);
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.pagination .active { background: var(--primary); color: #FFF; border-color: var(--primary); }
.pagination .disabled { color: var(--text-light); pointer-events: none; }

/* === TOOLBAR / FILTER BAR === */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}
.toolbar-search {
    display: flex;
    gap: 8px;
    flex: 1;
    max-width: 400px;
}
.toolbar-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 16px;
    padding: 16px;
    background: #F8F9FA;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}
.filter-bar .form-group { margin-bottom: 0; min-width: 150px; }

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
}
.empty-state i { font-size: 3rem; color: var(--text-light); margin-bottom: 16px; }
.empty-state h3 { font-size: 1.1rem; margin-bottom: 8px; color: var(--text-primary); }
.empty-state p { font-size: 0.88rem; margin-bottom: 16px; }

/* === LOGIN PAGE MODERNA === */
.login-page.login-regulacao-page {
    min-height: 100vh;
    background: #ffffff;
    padding: 0;
    overflow-x: hidden;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    background: #fff;
}

.login-hero-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(28px, 5vw, 52px);
    color: #fff;
    overflow: hidden;
    background:
        radial-gradient(circle at 84% 0%, rgba(125, 211, 252, 0.28) 0, rgba(125, 211, 252, 0.28) 190px, transparent 191px),
        radial-gradient(circle at 62% 58%, rgba(255, 255, 255, 0.10) 0, rgba(255, 255, 255, 0.10) 98px, transparent 99px),
        radial-gradient(circle at -5% 105%, rgba(255, 255, 255, 0.09) 0, rgba(255, 255, 255, 0.09) 150px, transparent 151px),
        linear-gradient(135deg, #0f2a60 0%, #1565c0 46%, #02a9d8 100%);
}

.login-hero-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(90deg, rgba(0,0,0,.45), rgba(0,0,0,.08));
    pointer-events: none;
}

.login-brand-top,
.login-hero-content,
.login-hero-footer { position: relative; z-index: 1; }

.login-brand-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 1.35rem;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.28);
    box-shadow: 0 12px 34px rgba(2, 6, 23, .18);
}

.login-brand-top strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -.02em;
}
.login-brand-top span {
    display: block;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .14em;
    opacity: .78;
}

.login-hero-content {
    max-width: 650px;
    margin-top: 54px;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.13);
    border: 1px solid rgba(255,255,255,.2);
    font-weight: 700;
    font-size: .82rem;
    margin-bottom: 24px;
}

.login-hero-content h1 {
    font-size: clamp(2.25rem, 5vw, 4.4rem);
    line-height: .98;
    letter-spacing: -.06em;
    font-weight: 900;
    margin-bottom: 22px;
    max-width: 760px;
}

.login-hero-content p {
    max-width: 620px;
    color: rgba(255,255,255,.84);
    font-size: 1.02rem;
    line-height: 1.75;
    margin-bottom: 34px;
}

.hero-feature-list {
    display: grid;
    gap: 14px;
    max-width: 660px;
}

.hero-feature-item {
    display: flex;
    align-items: center;
    gap: 14px;
    color: rgba(255,255,255,.92);
    font-weight: 600;
}

.hero-feature-item i {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: #f8fafc;
    background: rgba(15, 23, 42, .18);
    border: 1px solid rgba(255,255,255,.16);
    box-shadow: 0 10px 24px rgba(0,0,0,.14);
}

.login-hero-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: rgba(255,255,255,.72);
    font-size: .82rem;
    margin-top: 46px;
}

.login-form-panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 38px 28px;
    background:
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.login-version-badge {
    position: absolute;
    top: 22px;
    right: 26px;
    color: #8a97a8;
    font-size: .72rem;
    font-weight: 700;
}

.login-form-card {
    width: 100%;
    max-width: 330px;
}

.login-form-heading {
    margin-bottom: 26px;
}

.login-form-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    color: #0f6bdc;
    background: #eaf4ff;
    box-shadow: 0 12px 30px rgba(21,101,192,.12);
    margin-bottom: 14px;
}

.login-form-heading span {
    display: block;
    color: #1565c0;
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 8px;
}

.login-form-heading h2 {
    color: #102033;
    font-size: 1.45rem;
    line-height: 1.15;
    font-weight: 850;
    letter-spacing: -.03em;
    margin-bottom: 8px;
}

.login-form-heading p {
    color: #6b7788;
    font-size: .88rem;
    line-height: 1.55;
}

.login-alert {
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: .84rem;
}

.modern-login-form { margin-bottom: 18px; }
.login-field-group { margin-bottom: 16px; }
.login-field-group label {
    display: block;
    color: #334155;
    font-weight: 750;
    font-size: .8rem;
    margin-bottom: 7px;
}

.login-input-wrap {
    position: relative;
}

.login-input-wrap i {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #7b8da3;
    font-size: .9rem;
    pointer-events: none;
}

.login-input-wrap .form-control {
    width: 100%;
    height: 44px;
    padding: 10px 14px 10px 40px;
    border: 1px solid #d9e4f2;
    border-radius: 10px;
    background: #f3f7fd;
    color: #132033;
    font-size: .92rem;
    transition: all .2s ease;
    box-shadow: none;
}

.login-input-wrap .form-control:focus {
    outline: none;
    border-color: #1683d8;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(22, 131, 216, .12);
}

.login-submit-btn {
    width: 100%;
    height: 46px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #fff;
    font-weight: 800;
    background: linear-gradient(135deg, #1769e0 0%, #00a6d6 100%);
    box-shadow: 0 16px 34px rgba(21,101,192,.28);
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.login-submit-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.02);
    box-shadow: 0 20px 42px rgba(21,101,192,.34);
}

.login-submit-btn:active { transform: translateY(0); }

.login-support-card {
    margin-top: 18px;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #d8eafa;
    background: linear-gradient(180deg, #f6fbff 0%, #eef7ff 100%);
    color: #425466;
    font-size: .78rem;
}

.login-support-card strong {
    color: #1d4f8f;
}

.login-support-card p {
    margin: 8px 0 12px;
    line-height: 1.55;
}

.login-credentials-grid {
    display: grid;
    grid-template-columns: 62px 1fr;
    gap: 6px 10px;
    align-items: center;
}
.login-credentials-grid span {
    color: #718096;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.login-credentials-grid strong {
    color: #102033;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: .76rem;
}

.login-form-footer {
    text-align: center;
    margin-top: 22px;
    color: #7b8798;
    font-size: .76rem;
    line-height: 1.5;
}
.login-form-footer strong,
.login-form-footer span { display: block; }
.login-form-footer strong { color: #334155; }

@media (max-width: 980px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-hero-panel {
        min-height: auto;
        padding: 28px 24px 34px;
    }
    .login-hero-content {
        margin-top: 34px;
        max-width: 100%;
    }
    .login-hero-content h1 { max-width: 760px; }
    .login-form-panel { padding: 34px 22px 44px; }
    .login-version-badge { top: 14px; right: 18px; }
}

@media (max-width: 560px) {
    .login-hero-panel { padding: 22px 18px 28px; }
    .login-brand-top span { font-size: .66rem; }
    .login-hero-content h1 { font-size: 2rem; }
    .login-hero-content p { font-size: .93rem; }
    .hero-feature-item { align-items: flex-start; font-size: .88rem; }
    .login-hero-footer { flex-direction: column; margin-top: 30px; }
    .login-form-panel { padding: 30px 16px 38px; }
    .login-form-card { max-width: 100%; }
}

/* === CALENDAR VIEW === */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border-light);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.calendar-header-cell {
    background: var(--primary-light);
    padding: 8px;
    text-align: center;
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--primary-dark);
    text-transform: uppercase;
}
.calendar-cell {
    background: var(--bg-white);
    min-height: 90px;
    padding: 6px;
    font-size: 0.78rem;
}
.calendar-cell.other-month { background: #F8F9FA; color: var(--text-light); }
.calendar-cell.today { background: #F1FFF1; }
.calendar-day-num { font-weight: 600; margin-bottom: 4px; font-size: 0.82rem; }
.calendar-event {
    display: block;
    padding: 2px 6px;
    margin-bottom: 2px;
    border-radius: 3px;
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: var(--primary-light);
    color: var(--primary-dark);
    cursor: pointer;
}
.calendar-event:hover { background: var(--primary); color: #FFF; }

/* === UTILITIES === */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-secondary); }
.text-success { color: var(--primary); }
.text-danger { color: var(--accent-red); }
.text-warning { color: var(--accent-orange); }
.text-info { color: var(--accent-blue); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }

.w-100 { width: 100%; }

.hidden { display: none !important; }

/* === PRINT === */
@media print {
    .top-bar, .sidebar, .main-footer, .toolbar, .btn, .pagination { display: none !important; }
    .main-content { margin: 0 !important; }
    .content-wrapper { padding: 0 !important; }
    .card { box-shadow: none; border: 1px solid #ccc; }
}

/* === RESPONSIVE === */
@media (max-width: 767px) {
    .content-wrapper { padding: 16px; }
    .stats-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .toolbar { flex-direction: column; }
    .toolbar-search { max-width: 100%; }
    .filter-bar { flex-direction: column; }
    .filter-bar .form-group { width: 100%; }
    .card-header { flex-direction: column; align-items: flex-start; }
    .card-footer { flex-direction: column; }
    .card-footer .btn { width: 100%; justify-content: center; }
}

/* === OVERLAY SIDEBAR MOBILE === */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 998;
}
.sidebar-overlay.show { display: block; }

/* === TABS === */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 20px;
    gap: 0;
    overflow-x: auto;
}
.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* === PROGRESS / STATUS TIMELINE === */
.status-timeline {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 16px 0;
    flex-wrap: wrap;
}
.status-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    position: relative;
}
.status-step::after {
    content: '';
    width: 24px;
    height: 2px;
    background: var(--border-color);
}
.status-step:last-child::after { display: none; }
.status-step .step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-color);
    flex-shrink: 0;
}
.status-step.completed .step-dot { background: var(--primary); }
.status-step.current .step-dot { background: var(--accent-blue); box-shadow: 0 0 0 3px rgba(21,101,192,0.2); }
.status-step.completed { color: var(--primary); }
.status-step.current { color: var(--accent-blue); font-weight: 600; }

/* === DETAIL VIEW === */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
}
.detail-item {
    padding: 8px 0;
}
.detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}
.detail-value {
    font-size: 0.92rem;
    color: var(--text-primary);
}

/* === LOADING === */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}
.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   MODERNIZAÇÃO 2026 — camada visual azul e responsiva
   Mantém compatibilidade com as classes originais do sistema.
   ============================================================ */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-darker: #1e3a8a;
    --primary-light: #eff6ff;
    --secondary: #0f766e;
    --bg-body: #f6f8fc;
    --bg-sidebar: #0f172a;
    --text-sidebar: #dbeafe;
    --border-color: #d7deea;
    --border-light: #e8edf5;
    --shadow-sm: 0 8px 22px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 16px 40px rgba(15, 23, 42, 0.10);
    --shadow-lg: 0 24px 70px rgba(15, 23, 42, 0.16);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
}

body {
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, .10), transparent 360px),
        linear-gradient(180deg, #f8fbff 0%, #f3f6fb 100%);
}

.top-bar {
    border-bottom: 1px solid rgba(37, 99, 235, .18);
    backdrop-filter: blur(14px);
    background: rgba(255,255,255,.94);
}

.sidebar {
    background: linear-gradient(180deg, #0f172a 0%, #111827 52%, #0b1220 100%);
    box-shadow: 12px 0 35px rgba(15,23,42,.15);
}

.sidebar-nav .nav-list > li.active > a,
.nav-item.active > a {
    background: linear-gradient(90deg, rgba(37,99,235,.28), rgba(14,165,233,.10));
    border-left-color: #38bdf8;
}

.sidebar-nav .nav-list > li > a:hover,
.nav-item a:hover {
    background: rgba(255,255,255,.08);
    transform: translateX(2px);
}

.page-header {
    padding: 22px 24px;
    border: 1px solid rgba(37,99,235,.10);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 52%, #eef6ff 100%);
    box-shadow: var(--shadow-sm);
}

.page-header h1 {
    color: #0f172a;
    letter-spacing: -0.03em;
}

.card,
.stat-card,
.metric-card {
    border: 1px solid rgba(148, 163, 184, .20);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    border-bottom: 1px solid rgba(37,99,235,.14);
    background: linear-gradient(90deg, rgba(37,99,235,.06), rgba(14,165,233,.04));
}

.card-header h2,
.card-header h2 i,
.page-header h1 i {
    color: var(--primary-dark);
}

.btn {
    border-radius: 12px;
    font-weight: 700;
    letter-spacing: -0.01em;
    box-shadow: none;
}

.btn-primary {
    border: none;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    box-shadow: 0 12px 28px rgba(37,99,235,.24);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-1px);
}

.form-control,
input[type="text"], input[type="date"], input[type="time"], input[type="number"], input[type="email"], input[type="password"], select, textarea {
    border-radius: 12px;
    border-color: #dbe4f0;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
    outline: none;
}

table {
    border-collapse: separate;
    border-spacing: 0;
}

table thead th {
    background: #f8fafc;
    color: #334155;
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

table tbody tr:hover {
    background: #f8fbff;
}

.badge {
    border-radius: 999px;
    padding: 4px 9px;
    font-weight: 800;
}

.automation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.automation-card {
    position: relative;
    padding: 18px;
    border: 1px solid rgba(37,99,235,.14);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.automation-card::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, #2563eb, #06b6d4);
}

.automation-card h3 {
    margin: 0 0 8px;
    color: #0f172a;
    font-size: 1.05rem;
}

.automation-card p {
    color: #64748b;
    margin: 0;
}

@media (max-width: 768px) {
    .content-wrapper { padding: 16px; }
    .page-header { padding: 18px; }
    .page-header h1 { font-size: 1.25rem; }
    .card-body { padding: 16px; }
    .stats-grid { grid-template-columns: 1fr !important; }
    .table-responsive { border-radius: var(--radius-md); overflow-x: auto; }
}
