/* Dashboard Layout Container */
.app-layout {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-main);
}

/* Sidebar Styles */
.sidebar {
    width: 270px;
    background-color: var(--surface);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column; /*Muda a direcao dos itens da barra lateral*/
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
    padding: 1.5rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-logo-img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.brand-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sidebar-user-badge {
    padding: 1rem 1.25rem;
    background: var(--surface-subtle);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #047857 100%);
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px var(--primary-glow);
}

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

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
}

.user-role-tag {
    font-size: 0.725rem;
    color: var(--primary);
    font-weight: 500;
}

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

.nav-section-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 700;
    padding: 0.75rem 0.75rem 0.35rem 0.75rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    border-radius: var(--radius-md);
    color: #4b5563;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-bottom: 0.25rem;
}

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

.nav-item.active {
    background-color: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
    border: 1px solid var(--primary-border);
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-subtle);
    flex-shrink: 0;
    margin-top: auto;
    background: var(--surface);
}

.btn-logout-sidebar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #dc2626;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    padding: 0.6rem;
    border-radius: var(--radius-sm);
    transition: background 0.2s ease;
}

.btn-logout-sidebar:hover {
    background-color: var(--error-bg);
}

/* App Main Wrapper */
.app-main-wrapper {
    margin-left: 270px;
    width: calc(100% - 270px);
    min-height: 100vh;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

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

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.topbar-title-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-toggle-sidebar {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: var(--radius-sm);
}

.btn-toggle-sidebar:hover {
    background-color: var(--surface-subtle);
}

.topbar-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    line-height: 1.25;
}

.topbar-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    border: 1px solid var(--primary-border);
    font-weight: 500;
    white-space: nowrap;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background-color: var(--primary);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.3); }
    100% { opacity: 1; transform: scale(1); }
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.role-switcher-tabs {
    display: flex;
    align-items: center;
    background: var(--surface-subtle);
    padding: 0.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    gap: 0.25rem;
    flex-shrink: 0;
}

.role-switcher-tabs .tab-btn,
.tab-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 0.45rem 0.9rem;
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.role-switcher-tabs .tab-btn:hover,
.tab-btn:hover {
    color: var(--text-main);
}

.role-switcher-tabs .tab-btn.active,
.tab-btn.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.user-profile-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-email {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.btn-logout-topbar {
    color: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    transition: background 0.2s ease;
}

.btn-logout-topbar:hover {
    background-color: var(--error-bg);
}

/* Main Content */
.main-content {
    padding: 2rem;
    flex: 1 0 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

/* Application Footer */
.app-footer {
    margin-top: auto;
    flex-shrink: 0;
    width: 100%;
    padding: 1rem 2rem;
    border-top: 1px solid var(--border-subtle);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.app-footer-left {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.app-footer-left strong {
    color: var(--text-main);
    font-weight: 600;
}

.app-footer-right {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.app-footer-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid var(--primary-border);
    font-size: 0.72rem;
    font-weight: 700;
}

/* Hero Heatmap Card */
.heatmap-hero-card {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.heatmap-hero-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    border: 1px solid var(--primary-border);
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    margin-bottom: 0.5rem;
}

.heatmap-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main);
}

.heatmap-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--surface-subtle);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    font-size: 0.775rem;
    color: var(--text-muted);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.legend-box {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-box.low { background: #d1fae5; }
.legend-box.med { background: #6ee7b7; }
.legend-box.high { background: #10b981; }
.legend-box.peak { background: #047857; }

.heatmap-chart-container {
    min-height: 280px;
}

/* Dashboard Banner */
.dashboard-banner {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    box-shadow: 0 10px 20px var(--primary-glow);
    flex-wrap: wrap;
    gap: 1.5rem;
}

.dashboard-banner h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.dashboard-banner p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.banner-stat {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.stat-label {
    font-size: 0.775rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.85;
}

.stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0.2rem 0;
}

.stat-progress {
    font-size: 0.775rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
}

/* KPI Cards Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-width: 0;
    overflow: hidden;
}

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

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-icon.emerald { background: #ecfdf5; color: #059669; }
.kpi-icon.blue { background: #eff6ff; color: #2563eb; }
.kpi-icon.amber { background: #fffbeb; color: #d97706; }
.kpi-icon.purple { background: #faf5ff; color: #9333ea; }

.kpi-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.kpi-label {
    font-size: 0.775rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-value {
    font-size: clamp(1.15rem, 1.4vw, 1.35rem);
    font-weight: 700;
    color: var(--text-main);
    margin: 0.15rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-badge {
    font-size: 0.725rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-badge.positive { color: #059669; }
.kpi-badge.warning { color: #d97706; }

/* Charts Layout */
.charts-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.chart-card {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    min-width: 300px;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

.chart-header {
    margin-bottom: 1rem;
}

.chart-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
}

.chart-subtitle {
    font-size: 0.775rem;
    color: var(--text-muted);
}

.apex-chart-container {
    min-height: 320px;
}

/* Sales Pipeline Cards */
.pipeline-section {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.pipeline-section h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

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

.pipeline-column {
    background: var(--surface-subtle);
    border-radius: var(--radius-sm);
    padding: 1rem;
    border: 1px solid var(--border-subtle);
}

.pipeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.85rem;
}

.count-badge {
    background: var(--surface);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    border: 1px solid var(--border-subtle);
}

.pipeline-card {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.85rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-sm);
}

.pipeline-card.success {
    border-left: 4px solid var(--primary);
}

.pipeline-card strong {
    display: block;
    font-size: 0.875rem;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.pipeline-card .amount {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
}

.pipeline-card .date {
    font-size: 0.725rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Data Tables */
.table-card {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

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

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

.table-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
}

.badge-tag {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
}

.badge-tag.emerald { background: var(--primary-light); color: var(--primary); }
.badge-tag.warning { background: var(--error-bg); color: var(--error); }

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    text-align: left;
}

.data-table th {
    background: var(--surface-subtle);
    color: var(--text-muted);
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-main);
}

.status-badge {
    font-size: 0.725rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
}

.status-badge.success { background: #ecfdf5; color: #059669; }
.status-badge.warning { background: #fffbeb; color: #d97706; }
.status-badge.alert { background: #fef2f2; color: #dc2626; }
.status-badge.info { background: #eff6ff; color: #2563eb; }

.table-input {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    font-family: inherit;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    width: 100%;
    max-width: 220px;
}

.btn-action, .btn-save {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.48rem 0.95rem;
    font-size: 0.825rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    user-select: none;
    text-decoration: none;
}

.btn-action {
    background: #f8fafc;
    color: #334155;
    border: 1.5px solid #cbd5e1;
}

.btn-action:hover {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #94a3b8;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08);
}

.btn-save {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
    border: 1px solid #047857;
    box-shadow: 0 2px 4px rgba(5, 150, 105, 0.25);
}

.btn-save:hover {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
    color: white;
    border-color: #065f46;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
}

/* ============================================================= */
/* DEVELOPER ERROR & DIAGNOSTICS CONSOLE - MODERN CRM DESIGN     */
/* ============================================================= */

.dev-console-card {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.04), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
    overflow: hidden;
    margin-top: 2rem;
    transition: box-shadow 0.3s ease;
}

.dev-console-card:hover {
    box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.07);
}

.dev-console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.5rem 1.75rem;
    background: linear-gradient(180deg, #ffffff 0%, var(--surface-subtle) 100%);
    border-bottom: 1px solid var(--border-subtle);
}

.dev-title-box h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.dev-radar-dot {
    position: relative;
    display: inline-flex;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
}

.dev-radar-dot::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.4);
    animation: devRadarPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes devRadarPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.8); opacity: 0; }
}

.dev-title-box p {
    font-size: 0.825rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.dev-header-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.dev-badge-counter {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.775rem;
    font-weight: 700;
    color: #065f46;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
}

.dev-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.48rem 0.95rem;
    font-size: 0.825rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    user-select: none;
    font-family: inherit;
    line-height: 1.4;
}

.dev-btn-refresh {
    background: #ffffff;
    color: #334155;
    border-color: #cbd5e1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.dev-btn-refresh:hover {
    background: #f8fafc;
    color: var(--primary);
    border-color: var(--primary-border);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.dev-btn-clear {
    background: #fff5f5;
    color: #dc2626;
    border-color: #fecaca;
}

.dev-btn-clear:hover {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fca5a5;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px -2px rgba(220, 38, 38, 0.15);
}

/* Toolbar: Filters & Search */
.dev-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 1.75rem;
    background: #fbfdfc;
    border-bottom: 1px solid var(--border-subtle);
}

.dev-filter-group {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    padding: 0.3rem;
    border-radius: 9999px;
    gap: 0.25rem;
    border: 1px solid #e2e8f0;
}

.dev-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.38rem 0.95rem;
    font-size: 0.775rem;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
}

.dev-filter-pill:hover {
    color: #1e293b;
    background: rgba(255, 255, 255, 0.6);
}

.dev-filter-pill.active {
    background: #ffffff;
    color: var(--text-main);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.dev-filter-pill.active[data-level="ERROR"] {
    background: #fee2e2;
    color: #b91c1c;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.1);
}

.dev-filter-pill.active[data-level="WARNING"] {
    background: #fef3c7;
    color: #b45309;
    box-shadow: 0 2px 4px rgba(217, 119, 6, 0.1);
}

.dev-filter-pill.active[data-level="INFO"] {
    background: #e0f2fe;
    color: #0369a1;
    box-shadow: 0 2px 4px rgba(2, 132, 199, 0.1);
}

.dev-filter-pill.active[data-level="ALL"] {
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(5, 150, 105, 0.12);
}

.dev-search-wrapper {
    position: relative;
    min-width: 260px;
    max-width: 380px;
    flex: 1;
}

.dev-search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    display: flex;
    align-items: center;
}

.dev-search-input {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2.35rem;
    font-size: 0.85rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 9999px;
    background: #ffffff;
    color: var(--text-main);
    transition: all 0.2s ease;
    font-family: inherit;
    outline: none;
}

.dev-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: #ffffff;
}

/* Action button in table cell */
.btn-log-inspect {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.32rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    border: 1px solid var(--primary-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.18s ease;
    text-decoration: none;
}

.btn-log-inspect:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px var(--primary-glow);
}

/* ============================================================= */
/* DEVELOPER ERROR DETAILS MODAL                                 */
/* ============================================================= */

.dev-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.68);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: devFadeIn 0.2s ease-out;
}

@keyframes devFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.dev-modal-card {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 880px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.8);
    overflow: hidden;
    animation: devModalZoom 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid #e2e8f0;
}

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

.dev-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.75rem;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border-bottom: 1px solid #e2e8f0;
}

.dev-modal-header-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.dev-modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.dev-modal-subtitle {
    font-size: 0.775rem;
    color: #64748b;
    margin-top: 0.15rem;
}

.dev-modal-close-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f1f5f9;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.18s ease;
}

.dev-modal-close-btn:hover {
    background: #fee2e2;
    color: #dc2626;
    transform: rotate(90deg);
}

.dev-modal-body {
    padding: 1.5rem 1.75rem;
    overflow-y: auto !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    pointer-events: auto !important;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* 4 Metadata Cards Grid */
.dev-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.85rem;
}

.dev-meta-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    transition: all 0.2s ease;
}

.dev-meta-box:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.dev-meta-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dev-meta-val {
    font-family: 'Consolas', 'Menlo', monospace;
    font-size: 0.825rem;
    font-weight: 600;
    color: #0f172a;
    word-break: break-all;
}

/* Callout Banner for Exception Summary */
.dev-exception-banner {
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-left: 4px solid #ef4444;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.dev-exception-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.dev-exception-type {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #b91c1c;
}

.dev-exception-location {
    font-family: 'Consolas', monospace;
    font-size: 0.75rem;
    background: #fee2e2;
    color: #991b1b;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
}

.dev-exception-message {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.45;
}

/* Terminal / Code Editor for Stack Trace */
.dev-terminal-container {
    background: #090d16;
    border-radius: 12px;
    border: 1px solid #1e293b;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.dev-terminal-bar {
    background: #111827;
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #1f2937;
}

.dev-terminal-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dev-terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dev-terminal-dot.red { background: #ef4444; }
.dev-terminal-dot.yellow { background: #f59e0b; }
.dev-terminal-dot.green { background: #10b981; }

.dev-terminal-title {
    font-family: 'Consolas', monospace;
    font-size: 0.725rem;
    color: #94a3b8;
    font-weight: 500;
}

.dev-terminal-code {
    padding: 1.25rem;
    font-family: 'Consolas', 'Fira Code', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    color: #38bdf8;
    background: transparent;
    max-height: 320px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
}

.dev-terminal-code::-webkit-scrollbar {
    width: 6px;
}

.dev-terminal-code::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 3px;
}

/* Footer Controls */
.dev-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.15rem 1.75rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    gap: 1rem;
}

.dev-btn-copy {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.15rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.dev-btn-copy:hover {
    background: #f1f5f9;
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.dev-btn-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary) 0%, #047857 100%);
    border: 1px solid #047857;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    box-shadow: 0 2px 4px rgba(5, 150, 105, 0.2);
}

.dev-btn-close:hover {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(5, 150, 105, 0.3);
}

.dev-copy-toast {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #059669;
    font-weight: 600;
    font-size: 0.8rem;
    background: #ecfdf5;
    padding: 0.3rem 0.75rem;
    border-radius: 9999px;
    border: 1px solid #a7f3d0;
}

/* Mobile Responsiveness */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open,
    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.2);
    }

    .app-main-wrapper {
        margin-left: 0;
        width: 100%;
    }

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

    .topbar {
        padding: 0.5rem 1rem;
    }

    .role-switcher-tabs {
        display: none;
    }

    .main-content {
        padding: 1rem;
    }

    .app-footer {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
        justify-content: center;
    }

    .charts-row {
        flex-direction: column;
    }
}
