/* ===================================
   ITIL2 - Material Design (Google Style)
   Inspired by Google's Material Design 3
   =================================== */

@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;600;700&family=Roboto:wght@300;400;500;700&display=swap');

:root {
    /* Primary Colors - Google Blue */
    --brand-primary: #1a73e8;
    --brand-secondary: #4285f4;
    --brand-accent: #1a73e8;
    --brand-background: #e5e7eb;
    --brand-surface: #ffffff;

    /* Text Colors - Slate Palette (harmoniza com azul) */
    --brand-text: #1e293b;          /* slate-800 - texto principal */
    --brand-text-secondary: #475569; /* slate-600 - texto secundario */
    --brand-muted: #64748b;          /* slate-500 - texto muted */
    --brand-text-tertiary: #94a3b8;  /* slate-400 - texto terciario/disabled */
    --brand-border: #cbd5e1;         /* slate-300 - bordas */

    /* Link Colors - Blue Palette (escuro) */
    --link-color: #2563eb;           /* blue-600 - link padrao */
    --link-hover: #1d4ed8;           /* blue-700 - link hover */
    --link-visited: #4338ca;         /* indigo-700 - link visitado */

    /* Sidebar - Google Style */
    --sidebar-gradient-start: #ffffff;
    --sidebar-gradient-end: #ffffff;
    --sidebar-text: #475569;         /* slate-600 */
    --sidebar-active-bg: #e8f0fe;
    --sidebar-active-text: #1a73e8;

    /* UI Elements */
    --surface-elevated: #ffffff;
    --surface-border: #dadce0;
    --button-surface: #f1f3f4;
    --button-border: #dadce0;
    --button-text: #202124;

    /* Status Colors - Google Palette */
    --color-success: #1e8e3e;
    --color-danger: #d93025;
    --color-warning: #f9ab00;
    --color-info: #1a73e8;

    /* Shadows - Google Style */
    --shadow-sm: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
    --shadow-md: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 2px 6px 2px rgba(60, 64, 67, 0.15);
    --shadow-lg: 0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
    --shadow-xl: 0 2px 3px 0 rgba(60, 64, 67, 0.3), 0 6px 10px 4px rgba(60, 64, 67, 0.15);

    /* Border Radius - Google Style (more subtle) */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-base: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    font-family: 'Google Sans', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    background: var(--brand-background);
    color: var(--brand-text);
    font-size: 14px;
    line-height: 1.5;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===================================
   Links - Blue Dark Style
   =================================== */
a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* Links em contextos especiais */
.text-muted a {
    color: var(--brand-text-secondary);
}

.text-muted a:hover {
    color: var(--link-color);
}

/* Reset para botoes e elementos que nao devem parecer links */
a.btn,
a.nav-link,
a.dropdown-item,
a.list-group-item,
a.badge,
a.card {
    color: inherit;
}

a.btn:hover,
a.badge:hover {
    text-decoration: none;
}

/* ===================================
   Typography - Google Style
   =================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Google Sans', 'Roboto', -apple-system, sans-serif;
    font-weight: 500;
    color: var(--brand-text);
    letter-spacing: 0;
    line-height: 1.3;
    margin-bottom: 0.5em;
}

h1 { font-size: 2rem; font-weight: 400; }
h2 { font-size: 1.5rem; font-weight: 400; }
h3 { font-size: 1.25rem; font-weight: 500; }
h4 { font-size: 1.125rem; font-weight: 500; }
h5 { font-size: 1rem; font-weight: 500; }
h6 { font-size: 0.875rem; font-weight: 500; }

.text-white,
.text-white h1,
.text-white h2,
.text-white h3,
.text-white h4,
.text-white h5,
.text-white h6,
.text-white p,
.text-white small,
.text-white span,
.text-white .card-title,
.text-white .card-subtitle,
.text-white .card-text,
.card.text-white,
.card.text-white h1,
.card.text-white h2,
.card.text-white h3,
.card.text-white h4,
.card.text-white h5,
.card.text-white h6,
.card.text-white p,
.card.text-white small,
.card.text-white span,
.card.text-white .card-title,
.card.text-white .card-subtitle,
.card.text-white .card-body,
.card.text-white .card-body * {
    color: #ffffff !important;
}

.card-header.text-white,
.card-header.text-white h5,
.card-header.text-white h6,
.card-header.text-white span {
    color: #ffffff !important;
}

.text-muted {
    color: var(--brand-muted) !important;
}

/* ===================================
   Cards - Google Style
   =================================== */
.card {
    background: var(--brand-surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    box-shadow: none;
    color: var(--brand-text);
    transition: var(--transition-base);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-sm);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--surface-border);
    padding: 16px 24px;
    font-weight: 500;
    font-size: 16px;
    color: var(--brand-text);
}

.card-header.bg-primary {
    background: var(--brand-primary) !important;
    color: #ffffff;
    border-bottom: none;
}

/* Garantir texto branco em card-headers coloridos */
.card-header.bg-primary h5,
.card-header.bg-primary h6,
.card-header.bg-primary span,
.card-header.bg-primary i,
.card-header.bg-secondary h5,
.card-header.bg-secondary h6,
.card-header.bg-secondary span,
.card-header.bg-secondary i,
.card-header.bg-success h5,
.card-header.bg-success h6,
.card-header.bg-success span,
.card-header.bg-success i,
.card-header.bg-info h5,
.card-header.bg-info h6,
.card-header.bg-info span,
.card-header.bg-info i,
.card-header.bg-danger h5,
.card-header.bg-danger h6,
.card-header.bg-danger span,
.card-header.bg-danger i,
.card-header.bg-dark h5,
.card-header.bg-dark h6,
.card-header.bg-dark span,
.card-header.bg-dark i {
    color: #ffffff !important;
}

.card-body {
    padding: 24px;
    background: var(--brand-surface);
    color: var(--brand-text);
}

/* ===================================
   Buttons - Google Style (Pill Shape)
   =================================== */
.btn {
    font-family: 'Google Sans', 'Roboto', sans-serif;
    font-weight: 500;
    font-size: 14px;
    padding: 10px 24px;
    border-radius: var(--radius-full);
    border: none;
    transition: var(--transition-base);
    box-shadow: none;
    letter-spacing: 0.1px;
}

.btn:hover {
    box-shadow: var(--shadow-sm);
}

.btn:active {
    box-shadow: none;
}

.btn-primary {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #ffffff !important;
}

.btn-primary:hover {
    background: #1557b0;
    border-color: #1557b0;
    color: #ffffff !important;
}

.btn-primary:focus,
.btn-primary:active {
    background: #1557b0;
    border-color: #1557b0;
    color: #ffffff !important;
    box-shadow: none;
}

.btn-success {
    background: var(--color-success);
    border-color: var(--color-success);
    color: #ffffff !important;
}

.btn-success:hover {
    background: #137333;
    border-color: #137333;
    color: #ffffff !important;
}

.btn-warning {
    background-color: var(--color-warning);
    border-color: var(--color-warning);
    color: #202124 !important;
}

.btn-danger {
    background-color: var(--color-danger);
    border-color: var(--color-danger);
    color: #ffffff !important;
}

.btn-danger:hover {
    background-color: #c5221f;
    border-color: #c5221f;
}

.btn-info {
    background-color: var(--color-info);
    border-color: var(--color-info);
    color: #ffffff !important;
}

.btn-outline-primary {
    color: var(--brand-primary);
    border: 1px solid var(--surface-border);
    background: transparent;
}

.btn-outline-primary:hover {
    background-color: #e8f0fe;
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.btn-secondary {
    background-color: #f1f3f4;
    border-color: #f1f3f4;
    color: var(--brand-text) !important;
}

.btn-secondary:hover {
    background-color: #e8eaed;
    border-color: #e8eaed;
    color: var(--brand-text) !important;
}

.btn-outline-secondary {
    color: var(--brand-muted);
    border: 1px solid var(--surface-border);
    background: transparent;
}

.btn-outline-secondary:hover {
    background-color: #f1f3f4;
    color: var(--brand-text);
    border-color: var(--surface-border);
}

.btn-sm {
    padding: 6px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 15px;
}

/* ===================================
   Forms - Google Style
   =================================== */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1px solid var(--surface-border) !important;
    padding: 10px 16px;
    background: var(--brand-surface);
    color: var(--brand-text);
    font-size: 14px;
    transition: var(--transition-base);
    height: auto;
}

.form-control:hover, .form-select:hover {
    border-color: var(--brand-text);
}

.form-control:focus, .form-select:focus {
    border-color: var(--brand-primary);
    border-width: 2px;
    padding: 9px 15px;
    box-shadow: none;
    outline: none;
    background: var(--brand-surface);
}

.form-control::placeholder {
    color: var(--brand-muted);
    opacity: 1;
}

.form-label {
    font-weight: 500;
    font-size: 12px;
    color: var(--brand-muted);
    margin-bottom: 8px;
    letter-spacing: 0.4px;
}

.form-check-input {
    width: 18px;
    height: 18px;
    border: 2px solid var(--surface-border);
    border-radius: 2px;
    cursor: pointer;
    accent-color: var(--brand-primary);
}

.form-check-input:checked {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.form-check-input:focus {
    border-color: var(--brand-primary);
    box-shadow: none;
}

/* ===================================
   Badges - Google Style
   =================================== */
.badge {
    font-weight: 500;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    letter-spacing: 0;
    text-transform: none;
}

.bg-primary {
    background: #e8f0fe !important;
    color: var(--brand-primary) !important;
}

.bg-success {
    background: #ceead6 !important;
    color: var(--color-success) !important;
}

.bg-warning {
    background: #fef7e0 !important;
    color: #b06000 !important;
}

.bg-info {
    background: #e8f0fe !important;
    color: var(--brand-primary) !important;
}

.bg-danger {
    background: #fce8e6 !important;
    color: var(--color-danger) !important;
}

.bg-secondary {
    background: #e8eaed !important;
    color: var(--brand-muted) !important;
}

.bg-purple {
    background: #7c3aed !important;
    color: #ffffff !important;
}

/* ===================================
   Central de Ajuda - Card Headers Coloridos
   =================================== */
.ajuda-card-header.bg-primary {
    background: #0d6efd !important;
    color: #ffffff !important;
}
.ajuda-card-header.bg-info {
    background: #0dcaf0 !important;
    color: #ffffff !important;
}
.ajuda-card-header.bg-success {
    background: #198754 !important;
    color: #ffffff !important;
}
.ajuda-card-header.bg-warning {
    background: #ffc107 !important;
    color: #1a1a2e !important;
}
.ajuda-card-header.bg-danger {
    background: #dc3545 !important;
    color: #ffffff !important;
}
.ajuda-card-header.bg-secondary {
    background: #6c757d !important;
    color: #ffffff !important;
}
.ajuda-card-header.bg-dark {
    background: #212529 !important;
    color: #ffffff !important;
}
.ajuda-card-header.bg-dark h5,
.ajuda-card-header.bg-dark i {
    color: #ffffff !important;
}
.ajuda-card-header h5,
.ajuda-card-header i {
    color: inherit !important;
}
.ajuda-card-header.bg-warning h5,
.ajuda-card-header.bg-warning i {
    color: #1a1a2e !important;
}

/* Cards de link nas operacoes da pagina de ajuda */
a.card h6,
a.card .card-body h6 {
    color: #1e293b !important;
}
a.card small.text-muted,
a.card .card-body small.text-muted {
    color: #64748b !important;
}

/* ===================================
   Tables - Google Style
   =================================== */
.table {
    font-size: 14px;
    color: var(--brand-text);
    border-collapse: collapse;
}

.table thead {
    background: #f8f9fa !important;
}

.table thead th {
    font-weight: 500;
    font-size: 12px;
    text-transform: none;
    letter-spacing: 0;
    color: var(--brand-muted) !important;
    background: #f8f9fa !important;
    border: none;
    border-bottom: 1px solid var(--surface-border);
    padding: 14px 16px;
    white-space: nowrap;
}

.table tbody tr {
    color: var(--brand-text);
    background: var(--brand-surface);
    border-bottom: 1px solid var(--surface-border);
    transition: var(--transition-fast);
}

.table tbody tr:hover {
    background: #f8f9fa;
}

.table tbody td {
    padding: 14px 16px;
    border: none;
    vertical-align: middle;
}

/* ===================================
   List Groups - Google Style
   =================================== */
.list-group-item {
    background: var(--brand-surface);
    border: 1px solid var(--surface-border);
    border-radius: 0;
    margin-bottom: 0;
    padding: 14px 16px;
    transition: var(--transition-base);
    font-size: 14px;
}

.list-group-item:first-child {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.list-group-item:last-child {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.list-group-item:hover {
    background: #f8f9fa;
}

/* ===================================
   Alerts - Google Style
   =================================== */
.alert {
    border-radius: var(--radius-md);
    border: none;
    font-size: 14px;
    padding: 16px 20px;
    font-weight: 400;
}

.alert-info {
    background-color: #e8f0fe;
    color: var(--brand-primary);
}

.alert-success {
    background-color: #ceead6;
    color: var(--color-success);
}

.alert-warning {
    background-color: #fef7e0;
    color: #b06000;
}

.alert-danger {
    background-color: #fce8e6;
    color: var(--color-danger);
}

/* ===================================
   Modal - Google Style
   =================================== */
.modal {
    z-index: 1060 !important;
}

.modal-backdrop {
    z-index: 1055 !important;
}

.modal-content {
    background: var(--brand-surface);
    color: var(--brand-text);
    border-radius: var(--radius-xl);
    border: none;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    background: transparent;
    color: var(--brand-text);
    border-bottom: none;
    padding: 24px 24px 16px;
}

.modal-header .modal-title {
    font-weight: 500;
    font-size: 24px;
}

.modal-body {
    background: var(--brand-surface);
    color: var(--brand-text);
    padding: 0 24px 24px;
}

.modal-footer {
    background: var(--brand-surface);
    border-top: none;
    padding: 16px 24px 24px;
    justify-content: flex-end;
    gap: 8px;
}

/* ===================================
   Sidebar Navigation - Google Style
   =================================== */
body.layout {
    display: flex;
    min-height: 100vh;
    background: var(--brand-background);
}

#sidebar {
    flex: 0 0 280px;
    width: 280px;
    min-height: 100vh;
    background: var(--brand-surface);
    color: var(--sidebar-text);
    border-right: 1px solid var(--surface-border);
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
    gap: 0;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* overflow removido - controlado por sidebar.css */
    z-index: 100;
}

.sidebar-header {
    display: flex;
    align-items: center;
    padding: 16px 12px;
    border-bottom: none;
    min-height: 64px;
    width: 100%;
    gap: 12px;
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-primary);
    color: #ffffff;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.sidebar-text {
    flex: 1;
}

.sidebar-header h4 {
    font-weight: 500;
    font-size: 18px;
    margin: 0;
    color: #ffffff !important;
}

.sidebar-header p {
    font-size: 12px;
    color: var(--brand-muted);
    margin: 0;
}

#sidebar .nav {
    width: 100%;
    flex: 1;
    padding: 8px 0;
    display: flex;
    flex-direction: column;
}

#sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--sidebar-text);
    border-radius: var(--radius-full);
    transition: var(--transition-base);
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    margin-bottom: 2px;
}

#sidebar .nav-link i {
    width: 24px;
    font-size: 20px;
    text-align: center;
    flex-shrink: 0;
}

#sidebar .nav-link span {
    flex: 1;
}

#sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #93c5fd !important;
}

#sidebar .nav-link.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    font-weight: 500;
}

#sidebar .nav-link.active::before {
    display: none;
}

/* Sidebar Collapsed State */
#sidebar.collapsed {
    width: 72px;
    flex: 0 0 72px;
}

#sidebar.collapsed .sidebar-text,
#sidebar.collapsed .nav-link span,
#sidebar.collapsed .sidebar-header p,
#sidebar.collapsed .sidebar-header h4 {
    opacity: 0;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
}

#sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 16px 8px;
}

#sidebar.collapsed .sidebar-logo-icon {
    margin-right: 0 !important;
}

#sidebar.collapsed .sidebar-brand {
    justify-content: center;
}

/* Estilos collapsed movidos para seção "Sidebar Collapsed State" abaixo */

/* Badge de notificação no sidebar */
.sidebar-badge {
    background-color: #dc3545;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    text-align: center;
    line-height: 14px;
    flex: 0 0 auto !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#sidebar.collapsed .sidebar-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 9px;
    padding: 1px 4px;
    min-width: 14px;
}

/* Outros estilos collapsed na seção "Sidebar Collapsed State" */

#sidebar.collapsed .sidebar-collapse-btn {
    justify-content: center;
}

#sidebar.collapsed .sidebar-collapse-btn span {
    display: none;
}

#sidebar.collapsed .sidebar-collapse-btn i {
    transform: rotate(180deg);
}

/* Collapse button */
.sidebar-collapse-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--sidebar-text);
    border-radius: var(--radius-full);
    transition: var(--transition-base);
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    margin-top: auto;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
}

.sidebar-collapse-btn:hover {
    background: #f1f3f4;
    color: var(--brand-text);
}

.sidebar-collapse-btn i {
    width: 24px;
    font-size: 20px;
    text-align: center;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

/* Main content adjustment - flex layout handles width automatically */

.divider {
    height: 1px;
    background: var(--surface-border);
    margin: 8px 16px;
}

/* .nav-section-title movido para seção "Sidebar Groups" abaixo */

.main-content {
    flex: 1;
    padding: 24px;
    background: var(--brand-background);
    min-height: 100vh;
}

/* ===================================
   Topbar - Premium Corporate Design
   Modern, Clean, Professional
   =================================== */

/* Keyframes for entrance animation */
@keyframes topbar-fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes brand-glow-pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(99, 148, 255, 0.15);
    }
    50% {
        box-shadow: 0 0 30px rgba(99, 148, 255, 0.25);
    }
}

.topbar {
    /* Premium dark gradient with subtle blue tint */
    background: linear-gradient(
        135deg,
        rgba(15, 23, 42, 0.98) 0%,
        rgba(22, 33, 52, 0.98) 50%,
        rgba(15, 25, 45, 0.98) 100%
    ) !important;

    /* Glassmorphism effect */
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;

    /* Subtle top highlight + bottom shadow line */
    border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.3) !important;

    /* Generous padding for premium feel */
    padding: 0 32px !important;
    margin: -24px -24px 24px -24px !important;

    /* Taller header for elegance */
    height: 72px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;

    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;

    /* Sophisticated layered shadow */
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.05) inset,
        0 4px 12px rgba(0, 0, 0, 0.15),
        0 8px 32px rgba(0, 0, 0, 0.1),
        0 16px 48px rgba(0, 0, 0, 0.05) !important;

    /* Entrance animation */
    animation: topbar-fade-in 0.4s ease-out;

    /* Smooth transitions */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;

    /* Subtle noise texture overlay */
    position: relative;
}

.topbar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.02;
    pointer-events: none;
    mix-blend-mode: overlay;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 24px;
    position: relative;
    z-index: 1;
}

/* ===================================
   Brand Block - Logo + Name
   =================================== */
.topbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 4px 8px;
    border-radius: 0;
    background: transparent;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: visible;
}

/* No glow effect on brand */
.topbar-brand::before {
    display: none;
}

.topbar-brand:hover {
    background: transparent;
    border-color: transparent;
    transform: none;
    box-shadow: none;
}

.topbar-brand:hover::before {
    display: none;
}

/* Logo container - clean and transparent */
.topbar-brand-logo {
    width: auto;
    height: 40px;
    min-width: auto;
    border-radius: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: none;
}

.topbar-brand-logo::after {
    display: none;
}

.topbar-brand:hover .topbar-brand-logo {
    transform: scale(1.02);
    box-shadow: none;
}

.topbar-brand:hover .topbar-brand-logo::after {
    display: none;
}

.topbar-brand-logo img {
    height: 36px;
    width: auto;
    max-height: 36px;
    max-width: none;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
    transition: all 0.3s ease;
    border-radius: 6px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.95);
}

.topbar-brand:hover .topbar-brand-logo img {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2)) brightness(1.02);
}

/* Divider between logo and text - disabled */
.topbar-brand-logo + .topbar-brand-text::before {
    display: none;
}

/* Brand text - Modern typography */
.topbar-brand-text {
    position: relative;
}

.topbar-brand-text h4 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    color: rgba(255, 255, 255, 0.92) !important;
    margin: 0 !important;
    letter-spacing: 0.01em !important;
    line-height: 1.2 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.topbar-brand:hover .topbar-brand-text h4 {
    color: rgba(255, 255, 255, 1) !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* ===================================
   Topbar Right Actions
   =================================== */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 1;
}

/* Action Buttons */
.topbar-right .btn-link {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.65) !important;
    background: transparent;
    border: 1px solid transparent;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.topbar-right .btn-link:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.95) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.topbar-right .btn-link:active {
    transform: translateY(0) scale(0.96);
}

.topbar-right .btn-link i {
    font-size: 1.1rem !important;
    transition: all 0.25s ease;
}

.topbar-right .btn-link:hover i {
    transform: scale(1.1);
}

/* Notification Badge */
.topbar-right .badge {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 8px;
    min-width: 16px;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}

/* User Avatar */
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #2563eb;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
    border: 2px solid rgba(59, 130, 246, 0.15);
}

.user-avatar:hover {
    transform: scale(1.05);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.user-name {
    font-weight: 600;
    font-size: 13px;
    color: #1e293b;
    line-height: 1.3;
}

.user-role {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
}

/* User Dropdown Button */
.topbar-right .dropdown > .btn-link {
    padding: 4px;
    border-radius: 10px;
}

.topbar-right .dropdown > .btn-link i.bi-person-circle {
    font-size: 1rem !important;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.2s ease;
}

.topbar-right .dropdown > .btn-link:hover i.bi-person-circle {
    color: rgba(255, 255, 255, 0.95);
}

/* Divider between sections */
.topbar-right::before {
    content: '';
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.15);
    margin-right: 10px;
    margin-left: 6px;
}

/* ===================================
   Dropdown - Google Style
   =================================== */
.dropdown-menu {
    background: var(--brand-surface);
    color: var(--brand-text);
    border-radius: var(--radius-md);
    border: none;
    box-shadow: var(--shadow-lg);
    padding: 8px 0;
    min-width: 200px;
    z-index: 1050 !important;
}

.dropdown-item {
    padding: 10px 16px;
    color: var(--brand-text);
    font-size: 14px;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 12px;
}

.dropdown-item:hover {
    background: #f1f3f4;
    color: var(--brand-text);
}

.dropdown-item.text-danger {
    color: var(--color-danger);
}

.dropdown-item.text-danger:hover {
    background: #fce8e6;
}

.dropdown-divider {
    margin: 8px 0;
    border-color: var(--surface-border);
}

/* ===================================
   Progress Bar
   =================================== */
.progress {
    height: 4px;
    border-radius: var(--radius-full);
    background: #e8eaed;
    overflow: hidden;
}

.progress-bar {
    background: var(--brand-primary);
    transition: width 0.3s ease;
}

/* ===================================
   Scrollbar - Google Style
   =================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #dadce0;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #bdc1c6;
}

/* ===================================
   Spinner
   =================================== */
.spinner-border {
    border-color: #e8eaed;
    border-right-color: var(--brand-primary);
}

/* ===================================
   Dark Mode
   =================================== */
[data-theme="isp_dark"] {
    --brand-background: #1f1f1f;
    --brand-surface: #292929;
    --brand-text: #e8eaed;
    --brand-muted: #9aa0a6;
    --brand-border: #3c4043;
    --surface-border: #3c4043;
    --sidebar-text: #e8eaed;
    --sidebar-active-bg: rgba(138, 180, 248, 0.12);
    --sidebar-active-text: #8ab4f8;
    /* Links dark mode */
    --link-color: #60a5fa;
    --link-hover: #93c5fd;
    --link-visited: #818cf8;
}

[data-theme="isp_dark"] body {
    background: var(--brand-background);
    color: var(--brand-text);
}

[data-theme="isp_dark"] a {
    color: var(--link-color);
}

[data-theme="isp_dark"] a:hover {
    color: var(--link-hover);
}

[data-theme="isp_dark"] .card,
[data-theme="isp_dark"] .modal-content,
[data-theme="isp_dark"] .dropdown-menu {
    background: var(--brand-surface);
    border-color: var(--surface-border);
    color: var(--brand-text);
}

[data-theme="isp_dark"] .card-header {
    background: transparent;
    border-color: var(--surface-border);
    color: var(--brand-text);
}

[data-theme="isp_dark"] .btn-close {
    filter: invert(1);
}

[data-theme="isp_dark"] #sidebar {
    background: var(--brand-surface);
    border-color: var(--surface-border);
}

[data-theme="isp_dark"] .sidebar-header h4 {
    color: #ffffff !important;
}

[data-theme="isp_dark"] #sidebar .nav-link {
    color: var(--sidebar-text);
}

[data-theme="isp_dark"] #sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #93c5fd !important;
}

[data-theme="isp_dark"] #sidebar .nav-link.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
}

[data-theme="isp_dark"] .form-control,
[data-theme="isp_dark"] .form-select {
    background: #3c4043;
    border-color: #5f6368;
    color: var(--brand-text);
}

[data-theme="isp_dark"] .form-control:focus,
[data-theme="isp_dark"] .form-select:focus {
    background: #3c4043;
    border-color: #8ab4f8;
    color: var(--brand-text);
}

[data-theme="isp_dark"] .table {
    color: var(--brand-text);
}

[data-theme="isp_dark"] .table thead th {
    background: #3c4043 !important;
    color: var(--brand-muted) !important;
    border-color: var(--surface-border);
}

[data-theme="isp_dark"] .table tbody tr {
    background: var(--brand-surface);
    border-color: var(--surface-border);
}

[data-theme="isp_dark"] .table tbody tr:hover {
    background: #3c4043;
}

[data-theme="isp_dark"] .list-group-item {
    background: var(--brand-surface);
    border-color: var(--surface-border);
    color: var(--brand-text);
}

[data-theme="isp_dark"] .alert {
    color: var(--brand-text);
}

[data-theme="isp_dark"] h1,
[data-theme="isp_dark"] h2,
[data-theme="isp_dark"] h3,
[data-theme="isp_dark"] h4,
[data-theme="isp_dark"] h5,
[data-theme="isp_dark"] h6 {
    color: var(--brand-text);
}

[data-theme="isp_dark"] .dropdown-item {
    color: var(--brand-text);
}

[data-theme="isp_dark"] .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Topbar is always dark - no special dark mode styles needed */

[data-theme="isp_dark"] .user-avatar {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0.1) 100%);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.2);
}

[data-theme="isp_dark"] .user-name {
    color: #f1f5f9;
}

[data-theme="isp_dark"] .user-role {
    color: #64748b;
}

/* ===================================
   Responsiveness
   =================================== */
@media (max-width: 1024px) {
    #sidebar {
        position: fixed;
        left: 0;
        transform: translateX(-100%);
        z-index: 1000;
    }

    #sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 16px;
    }

    .card-body {
        padding: 16px;
    }

    .topbar {
        padding: 0 16px !important;
        margin: -16px -16px 16px -16px !important;
        height: 64px !important;
    }

    .topbar-brand {
        padding: 6px 12px 6px 6px;
        gap: 12px;
    }

    .topbar-brand-logo {
        width: auto;
        height: 36px;
        min-width: auto;
    }

    .topbar-brand-logo img {
        height: 32px;
        max-height: 32px;
        max-width: none;
    }

    .topbar-brand-text h4 {
        font-size: 15px !important;
    }

    .topbar-right .btn-link {
        width: 36px;
        height: 36px;
    }
}

/* ===================================
   Utility Classes
   =================================== */
.text-primary { color: var(--brand-primary) !important; }
.text-success { color: var(--color-success) !important; }
.text-danger { color: var(--color-danger) !important; }
.text-warning { color: #b06000 !important; }

.hover-lift {
    transition: var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* SLA Status Alerts */
.sla-alert-violado {
    background-color: #fce8e6;
    color: var(--color-danger);
}

.sla-alert-critico {
    background-color: #fef7e0;
    color: #b06000;
}

.sla-alert-alerta {
    background-color: #fef7e0;
    color: #b06000;
}

.sla-alert-cumprido {
    background-color: #ceead6;
    color: var(--color-success);
}

.sla-alert-normal {
    background-color: #e8f0fe;
    color: var(--brand-primary);
}

/* Chat notification - bolinha alinhada à direita do nav-link */
#chat-nav-link.has-unread::after {
    content: '';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
}

/* Submenu */
.submenu {
    padding-left: 16px;
}

.submenu .nav-link {
    padding: 8px 16px;
    font-size: 13px;
}

/* ===================================
   Sidebar Groups - Collapsible Sections
   =================================== */

/* Títulos de seção clicáveis */
.nav-section-title {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--brand-muted);
    padding: 20px 16px 8px;
    margin-top: 4px;
    transition: color 0.2s ease, padding 0.2s ease;
}

.nav-section-title:hover {
    color: var(--brand-text);
}

/* Chevron do grupo */
.nav-section-title .sidebar-group-chevron {
    font-size: 0.65rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.2s ease;
    opacity: 0.5;
}

.nav-section-title:hover .sidebar-group-chevron {
    opacity: 1;
}

.nav-section-title.collapsed .sidebar-group-chevron {
    transform: rotate(-90deg);
}

/* Container dos itens do grupo */
.sidebar-group-items {
    overflow: hidden;
    max-height: 1000px;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease,
                margin 0.25s ease;
    opacity: 1;
}

.sidebar-group-items.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    margin-bottom: 0;
}

/* Subitens com indentação sutil */
.sidebar-group-items .nav-link {
    padding-left: 20px;
}

/* ===================================
   Sidebar Collapsed State - Improvements
   =================================== */

/* Esconder títulos de seção no modo colapsado */
#sidebar.collapsed .nav-section-title {
    display: none !important;
}

/* Esconder wrapper dos grupos colapsados */
#sidebar.collapsed .sidebar-group-items {
    max-height: none !important;
    opacity: 1 !important;
}

#sidebar.collapsed .divider {
    margin: 4px 8px;
}

/* Centralizar ícones corretamente no modo colapsado */
#sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 12px 0;
    width: 100%;
    position: relative;
}

#sidebar.collapsed .nav-link i {
    margin: 0;
    width: auto;
}

/* Resetar indentação no modo colapsado */
#sidebar.collapsed .sidebar-group-items .nav-link {
    padding-left: 0;
}

/* ===================================
   Sidebar Hover States - Enhanced
   =================================== */

#sidebar .nav-link {
    position: relative;
    overflow: hidden;
}

#sidebar .nav-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: currentColor;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

#sidebar .nav-link:hover::before {
    opacity: 0.06;
}

#sidebar .nav-link.active::before {
    opacity: 0.1;
}

/* ===================================
   Sidebar Transitions - Smooth
   =================================== */

#sidebar {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s ease;
}

#sidebar:not(.collapsed):hover {
    box-shadow: var(--shadow-md);
}

#sidebar .nav-link span {
    transition: opacity 0.2s ease 0.1s,
                width 0.3s ease;
    white-space: nowrap;
}

#sidebar.collapsed .nav-link span {
    transition: opacity 0.1s ease,
                width 0.2s ease;
}

/* ===================================
   Sidebar Tooltips - Collapsed Mode
   =================================== */

/* Estilos para tooltips customizados (Bootstrap) */
#sidebar.collapsed [data-bs-toggle="tooltip"] {
    cursor: pointer;
}

/* ===================================
   Sidebar Mobile - Responsive
   =================================== */

@media (max-width: 767.98px) {
    #sidebar {
        width: 280px;
        max-width: 85vw;
    }

    /* Nunca mostrar modo colapsado no mobile */
    #sidebar.collapsed {
        width: 280px;
    }

    #sidebar.collapsed .nav-link {
        justify-content: flex-start;
        padding: 12px 16px;
    }

    #sidebar.collapsed .nav-link span {
        opacity: 1;
        width: auto;
    }

    #sidebar.collapsed .nav-section-title {
        display: flex !important;
    }

    #sidebar.collapsed .sidebar-group-items .nav-link {
        padding-left: 20px;
    }

    .sidebar-collapse-btn {
        display: none !important;
    }

    /* Títulos de seção visíveis no mobile */
    .nav-section-title {
        padding: 16px 16px 8px;
    }
}

/* ===================================
   Dark Mode - Sidebar Groups
   =================================== */

[data-theme="isp_dark"] .nav-section-title {
    color: var(--brand-muted);
}

[data-theme="isp_dark"] .nav-section-title:hover {
    color: var(--brand-text);
}

[data-theme="isp_dark"] #sidebar .nav-link::before {
    background: #ffffff;
}

[data-theme="isp_dark"] #sidebar .nav-link:hover::before {
    opacity: 0.08;
}

[data-theme="isp_dark"] #sidebar .nav-link.active::before {
    opacity: 0.12;
}
