:root {
    /* Menu */
    --fundo-menu-color: #003342;
    --border-menu-color: #003342;
    --letra-menu-color: #ffffff;
    /* Fim Menu */

    --primary-color: #2a6e83;
    /* Indigo 500 Originar 6366f1*/
    --primary-hover: #003342;
    /* Indigo 600 Originala 4f46e5 */
    --secondary-color: #ec4899;
    /* Pink 500 */
    --background-color: #f3f4f6;
    /* Gray 100 */
    --surface-color: #ffffff;
    --text-color: #1f2937;
    /* Gray 800 */
    --text-muted: #6b7280;
    /* Gray 500 */
    --border-color: #e5e7eb;
    /* Gray 200 */
    --success-color: #10b981;
    --error-color: #ef4444;
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 64px;
    --header-height: 64px;
    --transition-speed: 0.3s;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body, input, select, textarea, button {
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--transition-speed);
    border: none;
    text-align: center;
}

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

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

.btn-secondary {
    background-color: white;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--background-color);
}

.btn-tertiary {
    background-color: #d8d6d6;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-tertiary:hover {
    background-color: #000;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #1e293b;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.95rem;
    transition: all 0.2s ease-in-out;
    background-color: #ffffff;
}

.form-control:hover {
    border-color: #cbd5e1;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(42, 110, 131, 0.15);
}

/* Login & Register Pages */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    /*background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
    background: linear-gradient(135deg, #2a6e83 0%, #001f29 100%);
}

.auth-card {
    background: var(--surface-color);
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.auth-logo {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    display: block;
}

.auth-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.auth-footer {
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary-color);
    font-weight: 600;
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--surface-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-speed);
    position: fixed;
    height: 100vh;
    z-index: 10;
}

.sidebar-Escuro {
    width: var(--sidebar-width);
    background-color: var(--fundo-menu-color);
    border-right: 1px solid var(--border-menu-color);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-speed);
    position: fixed;
    height: 100vh;
    z-index: 10;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    font-weight: bold;
    font-size: 1.25rem;
    color: var(--primary-color);
}

.sidebar-logo-img {
    max-width: 100%;
    transition: all var(--transition-speed);
}

.sidebar-logo-img.logo-horizontal {
    display: block;
    max-height: 40px;
}

.sidebar-logo-img.logo-vertical {
    display: none;
    max-height: 45px;
}

.sidebar.collapsed .logo-horizontal {
    display: none;
}

.sidebar.collapsed .logo-vertical {
    display: block;
    margin: 0 auto;
}

.sidebar.collapsed .sidebar-logo {
    display: none;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-color);
    transition: background-color var(--transition-speed);
    white-space: nowrap;
    overflow: hidden;
}

.nav-item:hover {
    background-color: var(--background-color);
    color: var(--primary-color);
}

.nav-item-Escuro {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--letra-menu-color);
    transition: background-color var(--transition-speed);
    white-space: nowrap;
    overflow: hidden;
}

.nav-item-Escuro:hover {
    background-color: var(--background-color);
    color: var(--primary-color);
}

/* Active states for sidebar menu items */
.nav-item.active {
    background-color: rgba(42, 110, 131, 0.08) !important;
    color: var(--primary-color) !important;
    font-weight: 700 !important;
    border-left: 4px solid var(--primary-color);
    padding-left: calc(1.5rem - 4px);
}

.nav-item-Escuro.active {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: var(--primary-color) !important;
    font-weight: 700 !important;
    border-left: 4px solid var(--primary-color);
    padding-left: calc(1.5rem - 4px);
}

.submenu-item.active {
    background-color: rgba(42, 110, 131, 0.04) !important;
    color: var(--primary-color) !important;
    font-weight: 700 !important;
}


.nav-icon {
    margin-right: 1rem;
    width: 24px;
    text-align: center;
}

.sidebar.collapsed .nav-text {
    display: none;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition-speed);
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed+.main-content,
body.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* Topbar */
.topbar {
    height: var(--header-height);
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 9;
}

.toggle-sidebar-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--text-muted);
    transition: color var(--transition-speed);
}

.toggle-sidebar-btn:hover {
    color: var(--primary-color);
}

.user-menu {
    position: relative;
}

/* === Topbar Premium Dropdown === */
.prem-user-pill {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.35rem 0.8rem 0.35rem 0.35rem;
    border-radius: 30px;
    transition: all 0.2s ease;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}
.prem-user-pill:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}
.prem-user-pill .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #38bdf8;
}
.prem-user-info {
    text-align: left;
    line-height: 1.2;
}
.prem-user-name {
    font-weight: 700;
    font-size: 0.88rem;
    color: #0f172a;
    display: block;
}
.prem-user-role {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: capitalize;
    display: block;
}

.prem-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 260px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.15), 0 8px 10px -6px rgba(15, 23, 42, 0.1);
    display: none;
    flex-direction: column;
    padding: 0.6rem;
    margin-top: 0.8rem;
    z-index: 1000;
}
.prem-dropdown-menu.show {
    display: flex;
}
.prem-dropdown-header {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 0.5rem;
    background: #f8fafc;
    border-radius: 12px;
}
.prem-dropdown-header .header-name {
    font-weight: 800;
    font-size: 0.95rem;
    color: #0f172a;
    display: block;
}
.prem-dropdown-header .header-email {
    font-size: 0.78rem;
    color: #64748b;
    display: block;
    word-break: break-all;
}
.prem-dropdown-item {
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    font-weight: 600;
    font-size: 0.88rem;
    color: #1e293b;
    transition: all 0.2s ease;
    text-decoration: none;
}
.prem-dropdown-item i {
    color: #0284c7;
    width: 20px;
    font-size: 1.05rem;
}
.prem-dropdown-item:hover {
    background: #f1f5f9;
    color: #0f172a;
}
.prem-dropdown-item.text-error {
    color: #ef4444;
}
.prem-dropdown-item.text-error i {
    color: #ef4444;
}
.prem-dropdown-item.text-error:hover {
    background: #fef2f2;
    color: #dc2626;
}
.prem-dropdown-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 0.5rem 0;
}

/* Content Body */
.content-body {
    padding: 2rem;
    flex: 1;
}

/* Tiles Grid */
.tiles-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.5rem;
}

@media (min-width: 600px) {
    .tiles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .tiles-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1300px) {
    .tiles-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.tile {
    background-color: var(--surface-color);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    cursor: pointer;
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.tile-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
}

.tile-content {
    padding: 1rem;
    flex: 1;
    min-width: 0;
}

.tile-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tile-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    min-width: 0;
}

.tile-description div {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Footer */
.footer {
    padding: 1.5rem;
    text-align: center;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-color);
    transition: background-color var(--transition-speed);
    white-space: nowrap;
    overflow: hidden;
}

.nav-item:hover {
    background-color: var(--background-color);
    color: var(--primary-color);
}

/* Tabulador */

/* Style the tab */
.tab {
    overflow: hidden;
    border: 0;
    background-color: #f1f1f1;
}

/* Style the buttons inside the tab */
.tab button {
    background-color: inherit;
    float: left;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 14px 16px;
    transition: 0.3s;
    font-size: 17px;
}

/* Change background color of buttons on hover */
.tab button:hover {
    background-color: #ddd;
}

/* Create an active/current tablink class */
.tab button.active {
    background-color: #ccc;
}

/* Style the tab content */
.tabcontent {
    display: none;
    padding: 6px 12px;
    border: 0;
    border-top: none;
}

/* Refatoração - Estilos Adicionais */
.login-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 1rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.auth-error {
    color: var(--error-color);
    margin-bottom: 1rem;
}

.btn-full {
    width: 100%;
}

.text-start {
    text-align: left;
}

.mb-1-5 {
    margin-bottom: 1.5rem;
}

.mt-025 {
    margin-top: 0.25rem;
}

.text-sm {
    font-size: 0.8rem;
}

.tile-img-fit {
    object-fit: contain;
    padding: 10px;
}

/* Cards e Layouts Gerais */
.content-card {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.history-item {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
    border-left: 4px solid #e12525;
    /* Default to primary, override inline if needed or specific class */
}

/* Badges */
.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
}

.badge-danger {
    background-color: var(--error-color);
}

.badge-warning {
    background-color: #f59e0b;
    color: black;
}

.badge-success {
    background-color: var(--success-color);
}

.badge-secondary {
    background-color: #6b7280;
}

.badge-info {
    background-color: #3b82f6;
}


/* Tabelas */
.table-container {
    background: var(--surface-color);
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    width: 100%;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

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

.table th {
    background-color: #f9fafb;
    font-weight: 600;
}

.table tr:last-child td {
    border-bottom: none;
}

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

/* Cliente Header */
.client-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

.client-logo-container {
    flex-shrink: 0;
}

.client-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 0.5rem;
    border: 1px solid #eee;
    padding: 0.25rem;
}

.client-logo-placeholder {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    background: #f3f4f6;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}

.client-info-grid {
    display: grid;
    grid-template-columns: auto auto;
    gap: 0.5rem 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.details-grid {
    display: grid;
    gap: 1.5rem;
}

.equipment-card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.equipment-header {
    background-color: #f9fafb;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Utilities Refactor */
.fw-500 {
    font-weight: 500;
}

.flex-gap-05 {
    display: flex;
    gap: 0.5rem;
}

.flex-center-gap-05 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.flex-center-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-end {
    display: flex;
    justify-content: flex-end;
}

.mb-1 {
    margin-bottom: 1rem;
}

.m-0 {
    margin: 0;
}

.pagination-container {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    align-items: center;
}

.page-info-badge {
    padding: 0.5rem 1rem;
    background: white;
    border-radius: 0.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.whitespace-pre-wrap {
    white-space: pre-wrap;
}

.border-left-gray {
    border-left-color: #6c757d !important;
}

.border-left-blue {
    border-left-color: #008cff !important;
}

.btn-disabled-custom {
    opacity: 0.7;
    cursor: not-allowed;
}

.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-p2 {
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.card-p1-5 {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mt-2 {
    margin-top: 2rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

.desc-card-blue {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
    border-left: 4px solid #007bff;
}

.pointer {
    cursor: pointer;
}

.grid-2-col-gap-1-5 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.text-meta {
    font-size: 0.9rem;
    color: #666;
}

.ml-1 {
    margin-left: 1rem;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
}

.span-2 {
    grid-column: span 2;
}

.sidebar-logo-img {
    max-width: 100%;
    height: auto;
    padding: 0.5rem;
}

.menu-label {
    padding: 0 1.5rem;
    margin-top: 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.5);
}

.menu-label-bottom {
    padding: 0 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.5);
}

.sidebar.collapsed .menu-label,
.sidebar.collapsed .menu-label-bottom {
    display: none;
}

/* Toggle do Número de Versão para Ícone quando recolhido */
.sidebar.collapsed .version-full,
.sidebar-Escuro.collapsed .version-full {
    display: none !important;
}

.sidebar.collapsed .version-icon,
.sidebar-Escuro.collapsed .version-icon {
    display: inline-block !important;
    font-size: 1.25rem;
    color: var(--text-muted);
    transition: color var(--transition-speed);
}

.sidebar-Escuro.collapsed .version-icon {
    color: var(--letra-menu-color) !important;
}

.version-link {
    text-decoration: none;
    color: inherit;
    display: block;
    padding: 0.5rem;
    transition: color 0.2s;
}

.version-link:hover {
    color: var(--primary-color);
}

.version-icon {
    display: none;
}


.menu-divider {
    margin: 1rem 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.nav-chevron {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: rgba(0, 0, 0, 0.03);
}

.sidebar-Escuro .submenu {
    background-color: rgba(255, 255, 255, 0.05);
}

.submenu.open {
    max-height: 1000px; /* Valor alto o suficiente para expandir */
}

.nav-item.open .nav-chevron {
    transform: rotate(180deg);
}

.submenu-item .nav-icon {
    font-size: 0.7rem;
    opacity: 0.5;
}

.logout-link {
    margin-top: auto;
    color: var(--error-color);
}

.dropdown-header {
    border-bottom: 1px solid var(--border-color);
    font-weight: bold;
}

.profile-header {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.profile-avatar {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.profile-avatar-placeholder {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.profile-name {
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
}

.profile-role {
    margin: 0 0 1rem 0;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.profile-building {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-color);
    border-radius: 0.25rem;
    margin-bottom: 1rem;
}

.profile-section {
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

.profile-section-title {
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.grid-2-col-gap-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.profile-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.profile-value {
    font-weight: 500;
    color: var(--text-color);
}

.mr-05 {
    margin-right: 0.5rem;
}

.text-secondary-light {
    color: var(--text-secondary);
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-left: 4px solid transparent;
}

.border-l-primary {
    border-left-color: var(--primary-color);
}

.border-l-success {
    border-left-color: var(--success-color);
}

.border-l-error {
    border-left-color: var(--error-color);
}

.border-l-warning {
    border-left-color: var(--warning-color);
}

.stat-label {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
}

.text-success {
    color: var(--success-color);
}

.text-error {
    color: var(--error-color);
}

.text-warning {
    color: var(--warning-color);
}

.progress-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.progress-bg {
    width: 100px;
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
}

.w-40px {
    width: 40px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
/* Toggle Switch Styling */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #d1d5db;
    border-radius: 26px;
    transition: background 0.2s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--primary-color);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(22px);
}

/* Modal Global */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.modal[style*="display: block"],
.modal[style*="display: flex"] {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--surface-color);
    margin: auto;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    animation: modalFadeIn 0.3s;
}

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

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f9fafb;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-color);
}

.modal-close {
    color: var(--text-muted);
    float: right;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover,
.modal-close:focus {
    color: var(--text-color);
    text-decoration: none;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    background-color: #f9fafb;
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

/* Transições Globais de Página e Abas (Aproveitamento de Código) */
.content-body,
.tabcontent,
.auth-card {
    animation: contentFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Colunas de Credenciais Responsivas (Garantem Alinhamento Perfeito em Qualquer Tela) */
.cred-col-servico {
    display: inline-block;
    width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.cred-col-usuario {
    font-family: monospace;
    background: #f3f4f6;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    display: inline-block;
    width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    text-align: left;
}

.cred-col-senha {
    font-family: monospace;
    background: #f3f4f6;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    display: inline-block;
    min-width: calc(21ch + 0.8rem);
    text-align: left;
    vertical-align: middle;
}

@media (max-width: 992px) {
    .cred-col-servico {
        width: 120px;
    }
    .cred-col-usuario {
        width: 140px;
    }
    .cred-col-senha {
        min-width: auto;
        width: 140px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (max-width: 768px) {
    /* Menu Lateral Responsivo (Mobile) */
    .sidebar, .sidebar-Escuro {
        transform: translateX(-100%);
        transition: transform var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
    }

    .sidebar.open, .sidebar-Escuro.open {
        transform: translateX(0);
        box-shadow: 4px 0 25px rgba(0, 0, 0, 0.15);
    }

    /* Ajuste do Conteúdo Principal */
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
    }

    /* Redução de Padding e Ajuste de Títulos */
    .content-body {
        padding: 1rem !important;
        max-width: 100vw !important;
    }

    /* Garantir rolagem das tabelas em mobile */
    .content-body div[style*="overflow-x: auto"] {
        width: 100% !important;
        max-width: 100% !important;
        -webkit-overflow-scrolling: touch;
    }

    .card-p2, .card-p1-5 {
        padding: 1rem !important;
    }

    .header-actions {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem !important;
        margin-bottom: 1.5rem !important;
    }

    .header-actions h2 {
        font-size: 1.35rem !important;
        flex-wrap: wrap !important;
        line-height: 1.3 !important;
    }

    /* Topbar compacta no mobile */
    .topbar {
        padding: 0 1rem;
    }

    .cred-col-servico {
        width: 100px;
    }
    .cred-col-usuario {
        width: 110px;
    }
    .cred-col-senha {
        width: 110px;
    }
}

@media (max-width: 480px) {
    .cred-col-servico {
        width: 70px;
    }
    .cred-col-usuario {
        width: 80px;
    }
    .cred-col-senha {
        width: 80px;
    }
}
