/* 
 * Farol de Busca – Painel UI
 * Tema: Shopify Polaris Admin (2024)
 * Sidebar escura, cards elevados, tipografia Inter, micro-animações
 */

/* ═══════════════════════════════════════════════════════════════
   TOKENS — Polaris Design Tokens
   ═══════════════════════════════════════════════════════════════ */
:root {
    /* Surface & Background */
    --p-bg: #f1f1f1;
    --p-bg-surface: #ffffff;
    --p-bg-surface-hover: #f6f6f7;
    --p-bg-surface-active: #f0f0f1;
    --p-bg-surface-secondary: #f7f7f8;
    --p-bg-input: #ffffff;

    /* Sidebar */
    --p-sidebar-bg: #1a1a1a;
    --p-sidebar-bg-hover: rgba(255, 255, 255, 0.06);
    --p-sidebar-bg-active: rgba(255, 255, 255, 0.10);
    --p-sidebar-text: rgba(255, 255, 255, 0.70);
    --p-sidebar-text-active: #ffffff;
    --p-sidebar-accent: #36fba1;
    --p-sidebar-border: rgba(255, 255, 255, 0.08);

    /* Text */
    --p-text: #303030;
    --p-text-subdued: #616161;
    --p-text-disabled: #b5b5b5;
    --p-text-critical: #d72c0d;
    --p-text-success: #008060;
    --p-text-warning: #b98900;
    --p-text-highlight: #2c6ecb;
    --p-text-on-dark: #e3e5e7;

    /* Interactive */
    --p-interactive: #2c6ecb;
    --p-interactive-hover: #1f5199;
    --p-interactive-pressed: #103262;

    /* Border */
    --p-border: #e1e3e5;
    --p-border-hover: #c9cccf;
    --p-border-focus: #005bd3;
    --p-border-subdued: #eaeaea;

    /* Icon */
    --p-icon: #5c5f62;
    --p-icon-hover: #1a1c1d;

    /* Action Primary (Shopify green / dark) */
    --p-action-primary: #303030;
    --p-action-primary-hover: #1a1a1a;
    --p-action-primary-pressed: #0d0d0d;
    --p-action-primary-disabled: #f1f1f1;

    /* Action Secondary */
    --p-action-secondary: #ffffff;
    --p-action-secondary-hover: #f7f7f8;

    /* Status Colors */
    --p-success: #008060;
    --p-success-bg: #aee9d1;
    --p-success-bg-subdued: #f1f8f5;
    --p-critical: #d72c0d;
    --p-critical-bg: #fed3d1;
    --p-critical-bg-subdued: #fff4f4;
    --p-warning: #b98900;
    --p-warning-bg: #ffea8a;
    --p-warning-bg-subdued: #fff5ea;
    --p-info: #2c6ecb;
    --p-info-bg: #a4e8f2;
    --p-info-bg-subdued: #eef9fb;
    --p-highlight-bg: #dfe3e8;

    /* Dimensions */
    --sidebar-w: 240px;
    --header-h: 56px;

    /* Radii */
    --p-radius-050: 2px;
    --p-radius-100: 6px;
    --p-radius-200: 8px;
    --p-radius-300: 12px;
    --p-radius-400: 16px;
    --p-radius-full: 9999px;

    /* Shadows — Shopify style: subtle, layered */
    --p-shadow-100: 0px 1px 0px 0px rgba(0, 0, 0, 0.05);
    --p-shadow-200: 0px 1px 2px 0px rgba(0, 0, 0, 0.15), 0px 0px 5px 0px rgba(0, 0, 0, 0.05);
    --p-shadow-300: 0px 2px 8px -2px rgba(0, 0, 0, 0.14), 0px 4px 12px -2px rgba(0, 0, 0, 0.08);
    --p-shadow-card: 0px 0px 0px 1px rgba(0, 0, 0, 0.04), 0px 1px 3px 0px rgba(0, 0, 0, 0.1);
    --p-shadow-card-hover: 0px 0px 0px 1px rgba(0, 0, 0, 0.04), 0px 3px 8px 0px rgba(0, 0, 0, 0.12);

    /* Spacing */
    --p-space-1: 4px;
    --p-space-2: 8px;
    --p-space-3: 12px;
    --p-space-4: 16px;
    --p-space-5: 20px;
    --p-space-6: 24px;
    --p-space-8: 32px;
    --p-space-10: 40px;

    /* Transitions */
    --p-duration-100: 100ms;
    --p-duration-200: 200ms;
    --p-duration-300: 300ms;
    --p-ease: cubic-bezier(0.25, 0.1, 0.25, 1);

    /* ── Aliases legados (views antigas usam estas variáveis) ── */
    --text: var(--p-text);
    --text-muted: var(--p-text-subdued);
    --brand: var(--p-interactive);
    --brand-light: var(--p-info-bg-subdued);
    --success: var(--p-success);
    --danger: var(--p-critical);
    --bg: var(--p-bg);
    --bg-alt: var(--p-bg-surface-secondary);
    --border: var(--p-border);
}

/* ═══════════════════════════════════════════════════════════════
   BASE RESET
   ═══════════════════════════════════════════════════════════════ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    background: var(--p-bg);
    color: var(--p-text);
    overflow-x: hidden;
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--p-text);
    margin-top: 0;
    font-weight: 600;
    letter-spacing: -0.01em;
}

a {
    color: var(--p-interactive);
    text-decoration: none;
}

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

small,
.text-muted {
    color: var(--p-text-subdued);
}

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

/* ═══════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════ */
.painel-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR — Dark Shopify-style
   ═══════════════════════════════════════════════════════════════ */
.sidebar {
    width: var(--sidebar-w);
    background: var(--p-sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 200;
    transition: transform var(--p-duration-300) var(--p-ease);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.sidebar-brand {
    padding: 18px 16px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--p-sidebar-border);
}

.sidebar-brand .brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.sidebar-brand .brand-text {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.sidebar-nav {
    padding: 12px 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    color: var(--p-sidebar-text);
    text-decoration: none;
    border-radius: var(--p-radius-200);
    font-size: 13px;
    font-weight: 500;
    transition: all var(--p-duration-200) var(--p-ease);
    cursor: pointer;
    position: relative;
    line-height: 1.4;
}

.nav-item:hover {
    background: var(--p-sidebar-bg-hover);
    color: var(--p-sidebar-text-active);
    text-decoration: none;
}

.nav-item.active {
    background: var(--p-sidebar-bg-active);
    color: var(--p-sidebar-text-active);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    background: var(--p-sidebar-accent);
    border-radius: 0 3px 3px 0;
}

.nav-item .nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0.7;
    font-size: 16px;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
    opacity: 1;
}

.nav-item .nav-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sidebar-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.35);
    padding: 16px 12px 6px;
}

.sidebar-footer {
    padding: 8px;
    border-top: 1px solid var(--p-sidebar-border);
    margin-top: auto;
}

.nav-item.danger {
    color: #e66;
}

.nav-item.danger:hover {
    background: rgba(214, 44, 13, 0.15);
    color: #ff8a80;
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 190;
    opacity: 0;
    transition: opacity var(--p-duration-300) var(--p-ease);
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════
   MAIN CONTENT AREA
   ═══════════════════════════════════════════════════════════════ */
.painel-main {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--p-bg);
}

/* ═══════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════ */
.painel-header {
    height: var(--header-h);
    background: var(--p-bg-surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--p-space-8);
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--p-border-subdued);
    box-shadow: var(--p-shadow-100);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--p-space-4);
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--p-radius-200);
    color: var(--p-text);
    transition: background var(--p-duration-100);
}

.mobile-toggle:hover {
    background: var(--p-bg-surface-hover);
}

.mobile-toggle svg {
    width: 20px;
    height: 20px;
    display: block;
}

.header-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
    color: var(--p-text);
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--p-space-3);
}

.header-search {
    position: relative;
}

.header-search input {
    width: 220px;
    padding: 7px 12px 7px 34px;
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius-200);
    background: var(--p-bg-surface);
    font-size: 13px;
    color: var(--p-text);
    transition: border-color var(--p-duration-200), box-shadow var(--p-duration-200), width var(--p-duration-300);
}

.header-search input:focus {
    outline: none;
    border-color: var(--p-border-focus);
    box-shadow: 0 0 0 2px rgba(0, 91, 211, 0.15);
    width: 280px;
}

.header-search .search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--p-icon);
    pointer-events: none;
}

.header-search .search-icon svg {
    width: 16px;
    height: 16px;
}

.header-user {
    display: flex;
    align-items: center;
    gap: var(--p-space-2);
    background: var(--p-bg-surface);
    padding: 4px 12px 4px 4px;
    border-radius: var(--p-radius-full);
    border: 1px solid var(--p-border);
    cursor: pointer;
    transition: background var(--p-duration-200), box-shadow var(--p-duration-200);
}

.header-user:hover {
    background: var(--p-bg-surface-hover);
    box-shadow: var(--p-shadow-200);
}

.user-avatar {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #7c3aed 0%, #2c6ecb 100%);
    border-radius: var(--p-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #fff;
    font-weight: 700;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--p-text);
}

/* ═══════════════════════════════════════════════════════════════
   CONTENT AREA
   ═══════════════════════════════════════════════════════════════ */
.painel-content {
    padding: var(--p-space-6) var(--p-space-8);
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    animation: fadeIn var(--p-duration-300) var(--p-ease);
}

/* ═══════════════════════════════════════════════════════════════
   PAGE HEADER
   ═══════════════════════════════════════════════════════════════ */
.page-header {
    margin-bottom: var(--p-space-6);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--p-space-4);
}

.page-header .page-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: var(--p-text);
    letter-spacing: -0.02em;
}

.page-header .page-subtitle {
    font-size: 13px;
    color: var(--p-text-subdued);
    margin: 2px 0 0;
}

.page-header-actions {
    display: flex;
    gap: var(--p-space-2);
    align-items: center;
}

/* Legacy support */
.dashboard-header {
    margin-bottom: var(--p-space-6);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--p-space-4);
}

.dashboard-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--p-text);
    margin: 0;
    letter-spacing: -0.02em;
}

.dashboard-header p {
    font-size: 13px;
    color: var(--p-text-subdued);
    margin: 2px 0 0;
}

/* ═══════════════════════════════════════════════════════════════
   STAT CARDS (Summary Cards)
   ═══════════════════════════════════════════════════════════════ */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--p-space-4);
    margin-bottom: var(--p-space-6);
}

.stat-card {
    background: var(--p-bg-surface);
    padding: var(--p-space-5);
    border-radius: var(--p-radius-300);
    border: 1px solid var(--p-border-subdued);
    box-shadow: var(--p-shadow-card);
    transition: box-shadow var(--p-duration-200) var(--p-ease), transform var(--p-duration-200) var(--p-ease);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    box-shadow: var(--p-shadow-card-hover);
    transform: translateY(-1px);
}

.stat-card .stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--p-text-subdued);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--p-text);
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--p-radius-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.stat-icon-green {
    background: var(--p-success-bg-subdued);
    color: var(--p-success);
}

.stat-icon-blue {
    background: var(--p-info-bg-subdued);
    color: var(--p-info);
}

.stat-icon-orange {
    background: var(--p-warning-bg-subdued);
    color: var(--p-warning);
}

.stat-icon-purple {
    background: #f3f0ff;
    color: #7c3aed;
}

.stat-icon-pink {
    background: #fff0f6;
    color: #d6336c;
}

.stat-footer {
    margin-top: var(--p-space-3);
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-footer.positive {
    color: var(--p-success);
}

.stat-footer.negative {
    color: var(--p-critical);
}

.stat-footer.neutral {
    color: var(--p-text-subdued);
}

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD GRID
   ═══════════════════════════════════════════════════════════════ */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--p-space-5);
    margin-bottom: var(--p-space-5);
}

.dashboard-card-full,
.dashboard-grid>.dashboard-card:only-child {
    grid-column: 1 / -1;
}

/* ═══════════════════════════════════════════════════════════════
   CARDS (Polaris Card)
   ═══════════════════════════════════════════════════════════════ */
.dashboard-card {
    background: var(--p-bg-surface);
    padding: var(--p-space-5);
    border-radius: var(--p-radius-300);
    border: 1px solid var(--p-border-subdued);
    box-shadow: var(--p-shadow-card);
    transition: box-shadow var(--p-duration-200) var(--p-ease);
}

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

.card-title {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 var(--p-space-4) 0;
    color: var(--p-text);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title a {
    font-size: 13px;
    color: var(--p-interactive);
    font-weight: 500;
    text-decoration: none;
}

.card-title a:hover {
    text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════
   TABLES — Shopify Polaris Data Table
   ═══════════════════════════════════════════════════════════════ */
.table-responsive {
    overflow-x: auto;
    margin: calc(-1 * var(--p-space-5));
    margin-top: 0;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13px;
}

.table th {
    padding: 10px var(--p-space-5);
    font-size: 12px;
    font-weight: 600;
    color: var(--p-text-subdued);
    border-bottom: 1px solid var(--p-border);
    background: var(--p-bg-surface-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.table td {
    padding: 12px var(--p-space-5);
    border-bottom: 1px solid var(--p-border-subdued);
    color: var(--p-text);
    vertical-align: middle;
}

.table tbody tr {
    transition: background var(--p-duration-100);
}

.table tbody tr:hover td {
    background: var(--p-bg-surface-hover);
}

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

/* ═══════════════════════════════════════════════════════════════
   BUTTONS — Polaris Button System
   ═══════════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--p-radius-200);
    cursor: pointer;
    transition: all var(--p-duration-200) var(--p-ease);
    text-decoration: none;
    border: 1px solid var(--p-border);
    background: var(--p-action-secondary);
    color: var(--p-text);
    box-shadow: var(--p-shadow-100);
    line-height: 1.4;
    white-space: nowrap;
    font-family: inherit;
}

.btn:hover {
    background: var(--p-bg-surface-hover);
    border-color: var(--p-border-hover);
    text-decoration: none;
    color: var(--p-text);
}

.btn:active {
    background: var(--p-bg-surface-active);
    transform: scale(0.98);
}

.btn:focus-visible {
    outline: 2px solid var(--p-border-focus);
    outline-offset: 2px;
}

/* Primary */
.btn-primary {
    background: var(--p-action-primary);
    color: #ffffff;
    border-color: var(--p-action-primary);
    box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.08), inset 0px -1px 0px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
    background: var(--p-action-primary-hover);
    border-color: var(--p-action-primary-hover);
    color: #ffffff;
}

.btn-primary:active {
    background: var(--p-action-primary-pressed);
}

/* Critical / Destructive */
.btn-critical {
    background: var(--p-critical);
    color: #ffffff;
    border-color: var(--p-critical);
}

.btn-critical:hover {
    background: #b22212;
    border-color: #b22212;
    color: #ffffff;
}

/* Plain (link-style) */
.btn-plain {
    background: transparent;
    border: none;
    box-shadow: none;
    color: var(--p-interactive);
    padding: 4px 8px;
}

.btn-plain:hover {
    background: var(--p-bg-surface-hover);
    color: var(--p-interactive-hover);
}

/* Light */
.btn-light {
    background: transparent;
    border: 1px solid var(--p-border);
    box-shadow: none;
}

.btn-light:hover {
    background: var(--p-bg-surface-hover);
}

/* Success */
.btn-success {
    background: var(--p-success);
    color: #fff;
    border-color: var(--p-success);
}

/* Sizes */
.btn-lg {
    padding: 10px 24px;
    font-size: 14px;
    border-radius: var(--p-radius-200);
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

.btn-icon {
    padding: 6px;
    min-width: 32px;
    min-height: 32px;
}

.btn-icon svg {
    width: 16px;
    height: 16px;
}

.btn-block {
    width: 100%;
}

.btn-group {
    display: flex;
    gap: var(--p-space-2);
}

/* ═══════════════════════════════════════════════════════════════
   BADGES — Polaris Badge
   ═══════════════════════════════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 650;
    border-radius: var(--p-radius-full);
    text-transform: capitalize;
    line-height: 1.4;
    letter-spacing: 0.01em;
}

.badge-active,
.badge-ativo,
.badge-ganho {
    background: var(--p-success-bg);
    color: #0a4d3c;
}

.badge-inactive,
.badge-inativo,
.badge-pausado {
    background: var(--p-highlight-bg);
    color: var(--p-text);
}

.badge-novo {
    background: var(--p-info-bg);
    color: #1c4d7e;
}

.badge-contato,
.badge-negociacao {
    background: var(--p-warning-bg);
    color: #5e4200;
}

.badge-perdido {
    background: var(--p-critical-bg);
    color: #73170d;
}

.badge-rascunho,
.badge-draft {
    background: #f0f0f1;
    color: var(--p-text-subdued);
}

.badge-publicado,
.badge-published {
    background: var(--p-success-bg);
    color: #0a4d3c;
}

.badge-agendado,
.badge-scheduled {
    background: #fef3c7;
    color: #92400e;
}

.badge-neutral,
.badge-pendente {
    background: #e4e5e7;
    color: var(--p-text);
}

.badge-ativa,
.badge-publicada {
    background: var(--p-success-bg);
    color: #0a4d3c;
}

.badge-encerrada {
    background: #f0f0f1;
    color: var(--p-text-subdued);
}

.badge-gestor {
    background: linear-gradient(135deg, #2c6ecb, #7c3aed);
    color: #fff;
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 2px 10px;
}

/* ═══════════════════════════════════════════════════════════════
   FORM CONTROLS — Polaris
   ═══════════════════════════════════════════════════════════════ */
.form-group {
    margin-bottom: var(--p-space-5);
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    font-size: 13px;
    color: var(--p-text);
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius-200);
    background: var(--p-bg-input);
    color: var(--p-text);
    transition: border-color var(--p-duration-200), box-shadow var(--p-duration-200);
    box-sizing: border-box;
    font-family: inherit;
    line-height: 1.4;
}

.form-control:focus {
    outline: none;
    border-color: var(--p-border-focus);
    box-shadow: 0 0 0 2px rgba(0, 91, 211, 0.15);
}

.form-control::placeholder {
    color: var(--p-text-disabled);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235c5f62' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
    cursor: pointer;
}

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

/* Checkbox / Radio Polaris style */
input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--p-interactive);
    cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════
   FILTER BAR
   ═══════════════════════════════════════════════════════════════ */
.filter-bar {
    display: flex;
    gap: var(--p-space-3);
    align-items: center;
    padding: var(--p-space-4);
    background: var(--p-bg-surface);
    border: 1px solid var(--p-border-subdued);
    border-radius: var(--p-radius-300);
    box-shadow: var(--p-shadow-card);
    margin-bottom: var(--p-space-5);
}

.filter-bar .form-control {
    flex: 1;
}

/* ═══════════════════════════════════════════════════════════════
   PROGRESS BAR
   ═══════════════════════════════════════════════════════════════ */
.progress-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-track {
    flex: 1;
    height: 6px;
    background: var(--p-bg-surface-active);
    border-radius: var(--p-radius-full);
    max-width: 100px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--p-interactive);
    border-radius: var(--p-radius-full);
    transition: width var(--p-duration-300) var(--p-ease);
}

.progress-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--p-text-subdued);
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════
   MODALS — Polaris Modal
   ═══════════════════════════════════════════════════════════════ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn var(--p-duration-200);
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    background: var(--p-bg-surface);
    border-radius: var(--p-radius-400);
    width: 100%;
    max-width: 500px;
    box-shadow: var(--p-shadow-300);
    animation: modalSlideUp var(--p-duration-300) var(--p-ease);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--p-space-5) var(--p-space-5) var(--p-space-4);
    border-bottom: 1px solid var(--p-border-subdued);
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--p-icon);
    padding: 4px;
    border-radius: var(--p-radius-100);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--p-duration-100);
}

.modal-close:hover {
    background: var(--p-bg-surface-hover);
}

.modal-body {
    padding: var(--p-space-5);
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: var(--p-space-4) var(--p-space-5);
    border-top: 1px solid var(--p-border-subdued);
    display: flex;
    justify-content: flex-end;
    gap: var(--p-space-2);
}

/* ═══════════════════════════════════════════════════════════════
   TOAST SYSTEM
   ═══════════════════════════════════════════════════════════════ */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: #1a1a1a;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: var(--p-radius-200);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--p-shadow-300);
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
    animation: toastSlideUp var(--p-duration-300) var(--p-ease);
    max-width: 400px;
}

.toast.toast-success::before {
    content: '✓';
    color: var(--p-sidebar-accent);
    font-weight: 700;
}

.toast.toast-error::before {
    content: '✕';
    color: #ff6b6b;
    font-weight: 700;
}

.toast.toast-info::before {
    content: 'ℹ';
    color: var(--p-info-bg);
    font-weight: 700;
}

.toast-dismiss {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 0 0 0 8px;
    font-size: 16px;
    margin-left: auto;
}

.toast-dismiss:hover {
    color: #fff;
}

/* ═══════════════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: var(--p-space-4);
    opacity: 0.6;
}

.empty-state h3 {
    font-size: 16px;
    margin-bottom: 6px;
}

.empty-state p {
    color: var(--p-text-subdued);
    margin-bottom: var(--p-space-5);
    font-size: 14px;
}

/* ═══════════════════════════════════════════════════════════════
   ALERT / BANNER
   ═══════════════════════════════════════════════════════════════ */
.alert {
    padding: var(--p-space-4);
    border-radius: var(--p-radius-200);
    font-size: 13px;
    display: flex;
    align-items: flex-start;
    gap: var(--p-space-3);
    margin-bottom: var(--p-space-5);
    border: 1px solid;
}

.alert-success {
    background: var(--p-success-bg-subdued);
    border-color: var(--p-success-bg);
    color: #0a4d3c;
}

.alert-critical {
    background: var(--p-critical-bg-subdued);
    border-color: var(--p-critical-bg);
    color: #73170d;
}

.alert-warning {
    background: var(--p-warning-bg-subdued);
    border-color: var(--p-warning-bg);
    color: #5e4200;
}

.alert-info {
    background: var(--p-info-bg-subdued);
    border-color: var(--p-info-bg);
    color: #1c4d7e;
}

/* ═══════════════════════════════════════════════════════════════
   CHART CONTAINER
   ═══════════════════════════════════════════════════════════════ */
.chart-container {
    position: relative;
}

/* ═══════════════════════════════════════════════════════════════
   GRID UTILITIES
   ═══════════════════════════════════════════════════════════════ */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--p-space-5);
    align-items: start;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--p-space-5);
    align-items: start;
}

@media (max-width: 768px) {

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════════
   AUTH PAGES
   ═══════════════════════════════════════════════════════════════ */
body.auth-body {
    background: var(--p-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.auth-card {
    background: var(--p-bg-surface);
    padding: 40px;
    border-radius: var(--p-radius-400);
    box-shadow: var(--p-shadow-300);
    border: 1px solid var(--p-border-subdued);
    animation: fadeIn var(--p-duration-300) var(--p-ease);
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo .logo-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #36fba1 0%, #2c6ecb 100%);
    border-radius: var(--p-radius-300);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 16px;
}

.auth-logo h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--p-text);
    margin: 0 0 4px;
    letter-spacing: -0.02em;
}

.auth-logo p {
    color: var(--p-text-subdued);
    font-size: 14px;
    margin: 0;
}

.auth-alert {
    background: var(--p-critical-bg-subdued);
    color: #73170d;
    padding: 12px;
    border-radius: var(--p-radius-200);
    font-size: 13px;
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid var(--p-critical-bg);
}

.auth-card .form-group {
    margin-bottom: var(--p-space-4);
}

.auth-card .form-control {
    padding: 10px 14px;
    font-size: 14px;
}

.auth-card .btn-primary {
    padding: 10px 24px;
    width: 100%;
    font-size: 14px;
    margin-top: 8px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    color: var(--p-text-subdued);
}

.auth-footer a {
    color: var(--p-interactive);
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════
   GESTOR SPECIFIC (base)
   ═══════════════════════════════════════════════════════════════ */
.gestor-stat-card {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.gestor-stat-card .stat-label {
    color: rgba(255, 255, 255, 0.5);
}

.gestor-stat-card .stat-value {
    color: #ffffff;
}

.gestor-stat-card .stat-icon {
    background: rgba(255, 255, 255, 0.08);
}

.gestor-card {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
}

.gestor-card .card-title {
    color: #ffffff;
}

.gestor-card .card-title a {
    color: #fbbf24;
}

.gestor-card .table {
    color: rgba(255, 255, 255, 0.8);
}

.gestor-card .table th {
    color: rgba(255, 255, 255, 0.4);
    background: transparent;
    border-color: rgba(255, 255, 255, 0.06);
}

.gestor-card .table td {
    border-color: rgba(255, 255, 255, 0.06);
}

.gestor-card .table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.04);
}

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastSlideUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes toastFadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--p-border);
    border-top-color: var(--p-interactive);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile First Sidebar
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
    }

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

    .painel-header {
        padding: 0 var(--p-space-4);
    }

    .mobile-toggle {
        display: flex;
    }

    .painel-content {
        padding: var(--p-space-4);
    }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--p-space-3);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-search {
        display: none;
    }

    .header-user .user-name {
        display: none;
    }
}

@media (max-width: 480px) {
    .stats-row {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════════
   SKELETON LOADING (optional utility)
   ═══════════════════════════════════════════════════════════════ */
.skeleton {
    background: linear-gradient(90deg, var(--p-bg-surface-hover) 25%, var(--p-bg-surface-active) 50%, var(--p-bg-surface-hover) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--p-radius-100);
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ═══════════════════════════════════════════════════════════════
   SCROLLBAR GLOBAL (Chrome/Edge)
   ═══════════════════════════════════════════════════════════════ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--p-border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--p-border-hover);
}

/* ═══════════════════════════════════════════════════════════════
   SELECTION
   ═══════════════════════════════════════════════════════════════ */
::selection {
    background: rgba(44, 110, 203, 0.2);
    color: var(--p-text);
}

/* ═══════════════════════════════════════════════════════════════
   1. BREADCRUMB
   ═══════════════════════════════════════════════════════════════ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--p-text-subdued);
    margin-bottom: var(--p-space-4);
    flex-wrap: wrap;
    padding: 0;
    list-style: none;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.breadcrumb-item a {
    color: var(--p-text-subdued);
    text-decoration: none;
    transition: color var(--p-duration-100);
    font-weight: 500;
}

.breadcrumb-item a:hover {
    color: var(--p-text);
    text-decoration: none;
}

.breadcrumb-item.active {
    color: var(--p-text);
    font-weight: 500;
}

.breadcrumb-sep {
    color: var(--p-border-hover);
    flex-shrink: 0;
    margin: 0 1px;
}

/* ═══════════════════════════════════════════════════════════════
   2. PAGINATION
   ═══════════════════════════════════════════════════════════════ */
.pagination-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--p-space-4) var(--p-space-5);
    border-top: 1px solid var(--p-border-subdued);
    font-size: 13px;
    gap: var(--p-space-4);
    flex-wrap: wrap;
}

.pagination-info {
    color: var(--p-text-subdued);
    font-size: 12px;
    white-space: nowrap;
}

.pagination {
    display: flex;
    gap: 3px;
    align-items: center;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius-200);
    background: var(--p-action-secondary);
    color: var(--p-text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--p-duration-100);
    font-family: inherit;
    line-height: 1;
    box-shadow: var(--p-shadow-100);
}

.pagination-btn:hover {
    background: var(--p-bg-surface-hover);
    border-color: var(--p-border-hover);
    color: var(--p-text);
    text-decoration: none;
}

.pagination-btn.active {
    background: var(--p-action-primary);
    color: #fff;
    border-color: var(--p-action-primary);
    box-shadow: none;
}

.pagination-btn:disabled,
.pagination-btn[aria-disabled="true"] {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

.pagination-ellipsis {
    padding: 0 4px;
    color: var(--p-text-subdued);
    font-size: 13px;
    line-height: 32px;
}

/* ═══════════════════════════════════════════════════════════════
   3. COMMAND PALETTE (⌘K)
   ═══════════════════════════════════════════════════════════════ */
.cmdbar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9000;
    align-items: flex-start;
    justify-content: center;
    padding: 80px 20px 20px;
}

.cmdbar-overlay.active {
    display: flex;
}

.cmdbar {
    width: 100%;
    max-width: 560px;
    background: var(--p-bg-surface);
    border-radius: var(--p-radius-400);
    box-shadow: var(--p-shadow-300), 0 0 0 1px rgba(0, 0, 0, .08);
    overflow: hidden;
    animation: modalSlideUp var(--p-duration-200) var(--p-ease);
}

.cmdbar-input-wrap {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--p-border-subdued);
    gap: 12px;
}

.cmdbar-input-wrap svg {
    color: var(--p-icon);
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.cmdbar-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    font-family: inherit;
    color: var(--p-text);
    background: transparent;
    line-height: 1.4;
}

.cmdbar-input::placeholder {
    color: var(--p-text-disabled);
}

.cmdbar-results {
    max-height: 340px;
    overflow-y: auto;
}

.cmdbar-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--p-text-subdued);
    font-size: 13px;
}

.cmdbar-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--p-text-disabled);
    padding: 12px 18px 4px;
}

.cmdbar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    cursor: pointer;
    transition: background var(--p-duration-100);
    font-size: 13px;
    color: var(--p-text);
    text-decoration: none;
}

.cmdbar-item:hover,
.cmdbar-item.focused {
    background: var(--p-bg-surface-hover);
    text-decoration: none;
    color: var(--p-text);
}

.cmdbar-item svg {
    color: var(--p-icon);
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.cmdbar-item-label {
    flex: 1;
    font-weight: 500;
}

.cmdbar-item-sub {
    font-size: 11px;
    color: var(--p-text-subdued);
    margin-top: 1px;
}

.cmdbar-item-shortcut {
    font-size: 11px;
    color: var(--p-text-disabled);
    background: var(--p-bg-surface-secondary);
    padding: 2px 6px;
    border-radius: var(--p-radius-100);
    border: 1px solid var(--p-border-subdued);
    white-space: nowrap;
    font-family: inherit;
}

.cmdbar-footer {
    padding: 9px 18px;
    border-top: 1px solid var(--p-border-subdued);
    display: flex;
    gap: 14px;
    font-size: 11px;
    color: var(--p-text-disabled);
    align-items: center;
}

.cmdbar-footer span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cmdbar-kbd {
    background: var(--p-bg-surface-secondary);
    border: 1px solid var(--p-border-subdued);
    border-radius: var(--p-radius-050);
    padding: 1px 5px;
    font-size: 10px;
    font-family: inherit;
    color: var(--p-text-subdued);
    display: inline-flex;
    align-items: center;
}

/* Trigger hint on search input */
.cmdbar-trigger-hint {
    font-size: 11px;
    color: var(--p-text-disabled);
    background: var(--p-bg-surface-secondary);
    border: 1px solid var(--p-border-subdued);
    border-radius: var(--p-radius-100);
    padding: 1px 7px;
    white-space: nowrap;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════
   4. SKELETON LOADING + TOP LOADER
   ═══════════════════════════════════════════════════════════════ */
/* Top progress bar (NProgress-style) */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--p-interactive);
    z-index: 9999;
    transition: width 0.3s ease, opacity 0.4s ease;
    border-radius: 0 2px 2px 0;
}

.page-loader.loading {
    width: 85%;
}

.page-loader.done {
    width: 100%;
    opacity: 0;
}

/* Skeleton variants */
.skeleton-card {
    background: var(--p-bg-surface);
    padding: var(--p-space-5);
    border-radius: var(--p-radius-300);
    border: 1px solid var(--p-border-subdued);
    box-shadow: var(--p-shadow-card);
}

.skeleton-line {
    height: 12px;
    border-radius: var(--p-radius-100);
    margin-bottom: 8px;
}

.skeleton-line-lg {
    height: 28px;
    margin-bottom: 12px;
}

.skeleton-line-sm {
    height: 10px;
    width: 60%;
}

/* ═══════════════════════════════════════════════════════════════
   5. SIDEBAR COLAPSÁVEL
   ═══════════════════════════════════════════════════════════════ */
.sidebar-collapse-btn {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    border-top: 1px solid var(--p-sidebar-border);
    cursor: pointer;
    color: rgba(255, 255, 255, 0.35);
    transition: color var(--p-duration-100), background var(--p-duration-100);
}

.sidebar-collapse-btn:hover {
    background: var(--p-sidebar-bg-hover);
    color: rgba(255, 255, 255, 0.7);
}

.sidebar-collapse-btn svg {
    width: 16px;
    height: 16px;
    transition: transform var(--p-duration-300) var(--p-ease);
    flex-shrink: 0;
}

/* Collapsed state */
.sidebar.collapsed {
    width: 60px;
}

.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-item>span:not(.nav-icon),
.sidebar.collapsed .sidebar-section-title,
.sidebar.collapsed .sidebar-brand>div:last-child {
    display: none;
}

.sidebar.collapsed .sidebar-brand {
    justify-content: center;
    padding: 16px 0;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 10px 0;
}

.sidebar.collapsed .nav-item::before {
    left: 0;
}

.sidebar.collapsed .sidebar-collapse-btn {
    justify-content: center;
    padding: 10px 0;
}

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

.sidebar.collapsed+.painel-main,
.painel-main.sidebar-collapsed {
    margin-left: 60px;
}

/* Tooltip on collapsed nav items */
.sidebar.collapsed .nav-item {
    position: relative;
}

.sidebar.collapsed .nav-item .nav-tooltip {
    display: flex;
}

.nav-tooltip {
    display: none;
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background: #1a1a1a;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: var(--p-radius-200);
    white-space: nowrap;
    pointer-events: none;
    box-shadow: var(--p-shadow-200);
    z-index: 300;
}

.nav-tooltip::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: #1a1a1a;
}

/* ═══════════════════════════════════════════════════════════════
   6. FILTER CHIPS
   ═══════════════════════════════════════════════════════════════ */
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: var(--p-space-4);
    animation: fadeIn var(--p-duration-200);
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 4px 3px 10px;
    background: var(--p-info-bg-subdued);
    border: 1px solid rgba(44, 110, 203, 0.25);
    border-radius: var(--p-radius-full);
    font-size: 12px;
    font-weight: 500;
    color: var(--p-interactive);
}

.filter-chip-label {
    color: var(--p-text-subdued);
    font-weight: 400;
    margin-right: 1px;
    font-size: 11px;
}

.filter-chip-remove {
    background: rgba(44, 110, 203, 0.12);
    border: none;
    cursor: pointer;
    color: var(--p-interactive);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    width: 18px;
    height: 18px;
    border-radius: var(--p-radius-full);
    line-height: 1;
    font-size: 14px;
    transition: background var(--p-duration-100);
}

.filter-chip-remove:hover {
    background: rgba(44, 110, 203, 0.22);
}

/* ═══════════════════════════════════════════════════════════════
   7. DELETE CONFIRM MODAL
   ═══════════════════════════════════════════════════════════════ */
.confirm-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 4000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.confirm-modal-overlay.active {
    display: flex;
}

.confirm-modal-card {
    background: var(--p-bg-surface);
    border-radius: var(--p-radius-400);
    width: 100%;
    max-width: 420px;
    box-shadow: var(--p-shadow-300);
    animation: modalSlideUp var(--p-duration-200) var(--p-ease);
    overflow: hidden;
}

.confirm-modal-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--p-radius-full);
    background: var(--p-critical-bg-subdued);
    margin: 0 auto var(--p-space-4);
    flex-shrink: 0;
}

.confirm-modal-icon-wrap svg {
    width: 24px;
    height: 24px;
    color: var(--p-critical);
}

.confirm-modal-body {
    padding: var(--p-space-8) var(--p-space-6) var(--p-space-5);
    text-align: center;
}

.confirm-modal-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--p-text);
    letter-spacing: -0.01em;
}

.confirm-modal-message {
    font-size: 13px;
    color: var(--p-text-subdued);
    margin: 0;
    line-height: 1.6;
}

.confirm-modal-footer {
    padding: var(--p-space-4) var(--p-space-6) var(--p-space-6);
    display: flex;
    gap: var(--p-space-2);
    justify-content: center;
}

.confirm-modal-footer .btn {
    min-width: 120px;
}

/* ═══════════════════════════════════════════════════════════════
   8. DARK MODE
   ═══════════════════════════════════════════════════════════════ */
[data-theme="dark"] {
    --p-bg: #0d1117;
    --p-bg-surface: #161b22;
    --p-bg-surface-hover: #21262d;
    --p-bg-surface-active: #2d333b;
    --p-bg-surface-secondary: #1c2128;
    --p-bg-input: #161b22;
    --p-text: #e6edf3;
    --p-text-subdued: #8b949e;
    --p-text-disabled: #484f58;
    --p-text-critical: #ff7b72;
    --p-text-success: #3fb950;
    --p-text-warning: #d29922;
    --p-text-highlight: #58a6ff;
    --p-text-on-dark: #e6edf3;
    --p-border: #30363d;
    --p-border-hover: #484f58;
    --p-border-subdued: #21262d;
    --p-border-focus: #2f81f7;
    --p-icon: #8b949e;
    --p-icon-hover: #c9d1d9;
    --p-interactive: #2f81f7;
    --p-interactive-hover: #58a6ff;
    --p-interactive-pressed: #79c0ff;
    --p-action-primary: #238636;
    --p-action-primary-hover: #2ea043;
    --p-action-primary-pressed: #46954a;
    --p-action-primary-disabled: #21262d;
    --p-action-secondary: #21262d;
    --p-action-secondary-hover: #2d333b;
    --p-success: #3fb950;
    --p-success-bg: #033a16;
    --p-success-bg-subdued: #0d2118;
    --p-critical: #f85149;
    --p-critical-bg: #67060c;
    --p-critical-bg-subdued: #340d0f;
    --p-warning: #d29922;
    --p-warning-bg: #3d2f00;
    --p-warning-bg-subdued: #201b00;
    --p-info: #58a6ff;
    --p-info-bg: #0c2d6b;
    --p-info-bg-subdued: #0c1e40;
    --p-highlight-bg: #21262d;
    --p-shadow-card: 0 0 0 1px rgba(255, 255, 255, .06), 0 1px 4px rgba(0, 0, 0, .4);
    --p-shadow-card-hover: 0 0 0 1px rgba(255, 255, 255, .08), 0 4px 12px rgba(0, 0, 0, .5);
    --p-shadow-200: 0 2px 8px rgba(0, 0, 0, .4);
    --p-shadow-300: 0 4px 16px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .06);

    /* re-map aliases */
    --text: var(--p-text);
    --text-muted: var(--p-text-subdued);
    --brand: var(--p-interactive);
    --bg: var(--p-bg);
    --border: var(--p-border);
}

[data-theme="dark"] .sidebar {
    background: #010409;
    --p-sidebar-bg: #010409;
    --p-sidebar-border: rgba(255, 255, 255, .06);
}

[data-theme="dark"] .painel-header {
    background: var(--p-bg-surface);
    border-color: var(--p-border-subdued);
}

[data-theme="dark"] .table th {
    background: var(--p-bg-surface-secondary);
}

[data-theme="dark"] .badge-inactive,
[data-theme="dark"] .badge-inativo {
    background: #21262d;
    color: var(--p-text-subdued);
}

[data-theme="dark"] .auth-card {
    background: var(--p-bg-surface);
    border-color: var(--p-border-subdued);
}

/* Dark mode toggle button */
.dark-mode-toggle {
    background: none;
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius-200);
    padding: 5px;
    cursor: pointer;
    color: var(--p-icon);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--p-duration-100), color var(--p-duration-100), border-color var(--p-duration-100);
    width: 32px;
    height: 32px;
}

.dark-mode-toggle:hover {
    background: var(--p-bg-surface-hover);
    border-color: var(--p-border-hover);
    color: var(--p-icon-hover);
}

.dark-mode-toggle svg {
    width: 16px;
    height: 16px;
}

/* ═══════════════════════════════════════════════════════════════
   9. NOTIFICAÇÕES
   ═══════════════════════════════════════════════════════════════ */
.notif-wrap {
    position: relative;
}

.notif-btn {
    position: relative;
    background: none;
    border: 1px solid var(--p-border);
    border-radius: var(--p-radius-200);
    cursor: pointer;
    color: var(--p-icon);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--p-duration-100), color var(--p-duration-100), border-color var(--p-duration-100);
    width: 32px;
    height: 32px;
}

.notif-btn:hover {
    background: var(--p-bg-surface-hover);
    border-color: var(--p-border-hover);
    color: var(--p-icon-hover);
}

.notif-btn svg {
    width: 16px;
    height: 16px;
}

.notif-badge {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 7px;
    height: 7px;
    background: var(--p-critical);
    border-radius: 50%;
    border: 1.5px solid var(--p-bg-surface);
    transition: transform var(--p-duration-200) var(--p-ease);
}

.notif-badge.pulse {
    animation: notifPulse 2s infinite;
}

@keyframes notifPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
}

.notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: -4px;
    width: 320px;
    background: var(--p-bg-surface);
    border: 1px solid var(--p-border-subdued);
    border-radius: var(--p-radius-300);
    box-shadow: var(--p-shadow-300);
    z-index: 1000;
    display: none;
    overflow: hidden;
    animation: modalSlideUp var(--p-duration-200) var(--p-ease);
}

.notif-dropdown.open {
    display: block;
}

.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--p-border-subdued);
}

.notif-header-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--p-text);
}

.notif-mark-all {
    font-size: 12px;
    color: var(--p-interactive);
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
}

.notif-mark-all:hover {
    text-decoration: underline;
}

.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--p-border-subdued);
    cursor: pointer;
    transition: background var(--p-duration-100);
    text-decoration: none;
}

.notif-item:hover {
    background: var(--p-bg-surface-hover);
    text-decoration: none;
}

.notif-item:last-of-type {
    border-bottom: none;
}

.notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--p-interactive);
    flex-shrink: 0;
    margin-top: 4px;
    transition: background var(--p-duration-100);
}

.notif-dot.read {
    background: var(--p-border);
}

.notif-item-content {
    flex: 1;
}

.notif-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--p-text);
    margin-bottom: 2px;
}

.notif-item-sub {
    font-size: 12px;
    color: var(--p-text-subdued);
    line-height: 1.4;
}

.notif-item-time {
    font-size: 11px;
    color: var(--p-text-disabled);
    margin-top: 4px;
}

.notif-footer {
    padding: 10px 16px;
    text-align: center;
    border-top: 1px solid var(--p-border-subdued);
}

.notif-footer a {
    font-size: 12px;
    color: var(--p-interactive);
    font-weight: 500;
}

.notif-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--p-text-subdued);
    font-size: 13px;
}

/* ═══════════════════════════════════════════════════════════════
   10. ONBOARDING CARD
   ═══════════════════════════════════════════════════════════════ */
.onboarding-card {
    background: linear-gradient(135deg, var(--p-info-bg-subdued) 0%, var(--p-bg-surface) 60%);
    border: 1px solid rgba(44, 110, 203, 0.2);
    border-radius: var(--p-radius-300);
    padding: var(--p-space-6);
    margin-bottom: var(--p-space-6);
    position: relative;
    overflow: hidden;
}

.onboarding-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle at center, rgba(44, 110, 203, .07) 0%, transparent 70%);
    pointer-events: none;
}

.onboarding-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--p-space-5);
}

.onboarding-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--p-text);
    margin: 0 0 4px;
    letter-spacing: -0.01em;
}

.onboarding-card-sub {
    font-size: 12px;
    color: var(--p-text-subdued);
}

.onboarding-dismiss {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--p-text-disabled);
    padding: 4px;
    border-radius: var(--p-radius-100);
    display: flex;
    align-items: center;
    transition: color var(--p-duration-100);
}

.onboarding-dismiss:hover {
    color: var(--p-text);
}

.onboarding-steps {
    display: flex;
    flex-direction: column;
    gap: var(--p-space-3);
}

.onboarding-step {
    display: flex;
    align-items: center;
    gap: var(--p-space-4);
    padding: var(--p-space-3) var(--p-space-4);
    background: var(--p-bg-surface);
    border: 1px solid var(--p-border-subdued);
    border-radius: var(--p-radius-200);
    transition: box-shadow var(--p-duration-200);
    text-decoration: none;
}

.onboarding-step:hover {
    box-shadow: var(--p-shadow-card-hover);
    text-decoration: none;
}

.onboarding-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    background: var(--p-interactive);
    color: #fff;
}

.onboarding-step-num.done {
    background: var(--p-success);
}

.onboarding-step-info {
    flex: 1;
}

.onboarding-step-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--p-text);
    margin-bottom: 1px;
}

.onboarding-step-sub {
    font-size: 12px;
    color: var(--p-text-subdued);
}

.onboarding-step-arrow {
    color: var(--p-icon);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.onboarding-progress-bar {
    margin-top: var(--p-space-4);
    display: flex;
    align-items: center;
    gap: var(--p-space-3);
}

.onboarding-progress-bar .progress-track {
    max-width: none;
    flex: 1;
    height: 4px;
}

.onboarding-progress-label {
    font-size: 12px;
    color: var(--p-text-subdued);
    font-weight: 500;
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVO — ajustes para os novos componentes
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .cmdbar-overlay {
        padding-top: 40px;
    }

    .cmdbar {
        border-radius: var(--p-radius-300);
    }

    .notif-dropdown {
        width: calc(100vw - 32px);
        right: auto;
        left: -200px;
    }

    .sidebar.collapsed {
        transform: translateX(-100%);
    }

    .onboarding-card::before {
        display: none;
    }

    .pagination-wrap {
        justify-content: center;
    }

    .pagination-info {
        display: none;
    }
}