/* =====================================================
   MEAZUL COMUNICAÇÃO — Chart.js Overrides & Extra CSS
   ===================================================== */

/* Chart containers */
.chart-wrapper {
    position: relative;
    width: 100%;
}

/* Stat pills in topbar */
.topbar-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-full);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--gray-600);
}

.topbar-stat .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Dropdown menus */
.dropdown-menu {
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    padding: 6px;
    font-size: 13.5px;
}

.dropdown-item {
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-sans);
}

.dropdown-item:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.dropdown-item i {
    width: 16px;
    text-align: center;
    color: var(--gray-400);
}

.dropdown-divider {
    border-color: var(--gray-100);
    margin: 4px 0;
}

/* Filter bar */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}

.filter-bar .form-select,
.filter-bar .form-control {
    min-width: 160px;
    font-size: 13px;
    padding: 7px 12px;
}

/* Steps / wizards */
.step-list {
    counter-reset: steps;
}

.step-item {
    display: flex;
    gap: 14px;
    margin-bottom: 20px;
    counter-increment: steps;
}

.step-num {
    width: 32px;
    height: 32px;
    background: var(--primary-100);
    color: var(--primary-700);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.step-body {
    padding-top: 4px;
}

.step-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--gray-800);
}

.step-desc {
    font-size: 12.5px;
    color: var(--gray-500);
    margin-top: 2px;
}

/* Section headers */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-900);
}

/* Role badges */
.role-admin {
    background: var(--red-100);
    color: var(--red-700);
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 11.5px;
    font-weight: 600;
}

.role-supervisor {
    background: var(--orange-100);
    color: var(--orange-700);
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 11.5px;
    font-weight: 600;
}

.role-operator {
    background: var(--primary-50);
    color: var(--primary-700);
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 11.5px;
    font-weight: 600;
}

/* Notification panel */
.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--gray-100);
    transition: var(--transition);
    cursor: pointer;
}

.notif-item:hover {
    background: var(--gray-50);
}

.notif-item.unread {
    background: var(--primary-50);
}

.notif-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.notif-text {
    font-size: 12.5px;
    color: var(--gray-700);
}

.notif-time {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 2px;
}

/* Attachment button */
.attach-btn {
    background: none;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    cursor: pointer;
    transition: var(--transition);
}

.attach-btn:hover {
    border-color: var(--primary-300);
    color: var(--primary-600);
    background: var(--primary-50);
}

/* Sidebar toggle button */
.sidebar-toggle-mobile {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: var(--brand);
    color: #fff;
    border-radius: var(--radius-full);
    border: none;
    font-size: 20px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1100;
    box-shadow: var(--shadow-lg);
}

@media (max-width: 768px) {
    .sidebar-toggle-mobile {
        display: flex;
    }
}

/* Dashboard shortcut cards */
.shortcut-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.shortcut-card:hover {
    border-color: var(--primary-300);
    background: var(--primary-50);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.shortcut-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.shortcut-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    text-align: center;
}

/* Metrics row */
.metric-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
}

.metric-item:last-child {
    border-bottom: none;
}

.metric-label {
    font-size: 13px;
    color: var(--gray-600);
}

.metric-value {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--gray-900);
}

/* =====================================================
   MEAZUL CONVERSÃO — PREMIUM DASHBOARD & COMPONENTS
   ===================================================== */

/* Premium Metric Cards */
.metric-card-premium {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    height: 100%;
}
.metric-card-premium:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.metric-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--gray-500);
    margin-bottom: 16px;
    display: block;
}
.metric-main-val {
    font-size: 32px;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1;
    margin-bottom: 12px;
}
.metric-main-val.text-brand { color: var(--brand); }
.metric-sub-val {
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}
.metric-sub-val.text-success { color: var(--green-600); }
.metric-sub-val.text-brand { color: var(--brand); }

.metric-watermark {
    position: absolute;
    right: -10px;
    bottom: -15px;
    font-size: 80px;
    color: var(--gray-100);
    opacity: 0.6;
    pointer-events: none;
    line-height: 1;
}

/* System Health Card (Dark) */
.health-card {
    background: #0f172a;
    border-radius: var(--radius-lg);
    padding: 24px;
    color: #fff;
    box-shadow: var(--shadow-md);
    height: 100%;
    position: relative;
    overflow: hidden;
}
.health-card::before {
    content: '';
    position: fixed;
    /* simulated glow */
}
.health-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 12px;
}
.health-block {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 14px;
}
.health-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.health-metric-name {
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.health-status-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
}
.health-status-badge.active { color: #4ade80; }
.health-status-badge.active::before {
    content: ''; width: 6px; height: 6px; background: #4ade80; border-radius: 50%;
}
.health-desc {
    font-size: 11px;
    color: #94a3b8;
}
.progress-dark {
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}
.progress-dark .progress-bar { background: var(--brand-light); }

.health-globe {
    opacity: 0.2;
    margin-top: 20px;
    text-align: center;
}

/* Custom Status Pills */
.pill {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.pill::before {
    content: '';
    width: 6px; height: 6px; border-radius: 50%;
}
.pill-active { background: #dcfce7; color: #15803d; }
.pill-active::before { background: #15803d; }
.pill-provisioning { background: #f3f4f6; color: #4b5563; }
.pill-provisioning::before { background: #6b7280; }
.pill-suspended { background: #fee2e2; color: #b91c1c; }
.pill-suspended::before { background: #dc2626; }
.pill-processing { background: #dbeafe; color: #1d4ed8; }
.pill-processing::before { background: #2563eb; }
.pill-validation { background: #fee2e2; color: #b91c1c; }

/* Letter Avatars */
.avatar-letter {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}
.avatar-letter.blue { background: var(--primary-100); color: var(--primary-700); }
.avatar-letter.orange { background: var(--orange-100); color: var(--orange-700); }
.avatar-letter.purple { background: var(--purple-100); color: var(--purple-700); }
.avatar-letter.red { background: var(--red-100); color: var(--red-700); }

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--gray-300);
    transition: .3s;
    border-radius: 24px;
}
.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}
input:checked + .toggle-slider { background-color: var(--brand); }
input:focus + .toggle-slider { box-shadow: 0 0 1px var(--brand); }
input:checked + .toggle-slider:before { transform: translateX(20px); }

/* Rule Pipeline Card */
.rule-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}
.rule-flow {
    display: flex;
    align-items: center;
    gap: 20px;
}
.rule-part {
    display: flex;
    flex-direction: column;
}
.rule-part-label { font-size: 10px; color: var(--gray-400); font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 4px; }
.rule-part-value { font-size: 14px; color: var(--gray-800); font-weight: 600; }
.rule-part-value.highlight { color: var(--brand); }
.rule-arrow { color: var(--gray-300); font-size: 20px; }
.rule-actions { display: flex; align-items: center; gap: 16px; }
.rule-status-text { font-size: 11px; font-weight: 700; color: var(--gray-500); }

/* Left Aside Panel */
.aside-panel {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 24px;
    height: 100%;
}

/* Modals JSON */
.modal-json-content {
    background: #0f172a;
    border-radius: var(--radius-lg);
}
.modal-json-header {
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: #fff;
}
.modal-json-body {
    display: flex;
    gap: 16px;
    padding: 16px;
}
.json-block {
    flex: 1;
    background: #1e293b;
    border-radius: var(--radius-md);
    padding: 16px;
    font-family: monospace;
    font-size: 12px;
    color: #a5b4fc;
    overflow-x: auto;
}