  /* =========================================================
    PAINEL DE PLANTÃO – CSS OFICIAL V2.0
    Visual: Modern SaaS Dashboard with Glassmorphism
    Autor: Anderson de Souza
  ========================================================= */

  /* =========================================================
    VARIÁVEIS GLOBAIS (THEME) - Atualizado
  ========================================================= */
  :root {
    /* Cores base - Dark Professional */
    --bg: #0a0f1c;
    --bg-gradient: linear-gradient(135deg, #0a0f1c 0%, #13162b 100%);
    --panel: rgba(19, 22, 43, 0.85);
    --panel-solid: #13162b;
    --card: rgba(25, 30, 56, 0.75);
    --card-solid: #191e38;
    
    /* Bordas e efeitos glassmorphism */
    --border: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.12);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.05);
    
    /* Texto */
    --text: #f0f5ff;
    --text-muted: rgba(240, 245, 255, 0.7);
    --text-light: rgba(240, 245, 255, 0.5);
    
    /* Cores de destaque */
    --primary: #3b82f6;
    --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --primary-light: rgba(59, 130, 246, 0.15);
    --primary-glow: 0 0 20px rgba(59, 130, 246, 0.3);
    
    /* Cores de estado */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    
    /* Bordas */
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 20px;
    --radius-full: 999px;
    
    /* Sombras e profundidade */
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 50px -12px rgba(0, 0, 0, 0.5);
    --shadow-inset: inset 0 2px 4px 0 rgba(0, 0, 0, 0.2);
    
    /* Transições */
    --transition-fast: 0.15s ease;
    --transition: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* =========================================================
    RESET & BASE STYLES
  ========================================================= */
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  html {
    height: 100%;
    scroll-behavior: smooth;
  }

  body {
    min-height: 100%;
    font-family: 'Inter', 'Poppins', system-ui, -apple-system, sans-serif;
    background: var(--bg-gradient);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  /* Gradientes de fundo sofisticados */
  body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
      radial-gradient(600px at 20% 15%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
      radial-gradient(600px at 80% 85%, rgba(16, 185, 129, 0.06) 0%, transparent 50%),
      radial-gradient(400px at 50% 50%, rgba(239, 68, 68, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
  }

  /* =========================================================
    LAYOUT & CONTAINER
  ========================================================= */
  .app {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 20px 48px;
    position: relative;
  }

  /* =========================================================
    HEADER / TOPBAR
  ========================================================= */
  .topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
    background: var(--panel);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    transition: var(--transition);
  }

  .topbar:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-lg);
  }

/* 🔥 PERMITE CLIQUE NORMAL NO RESTO DA PÁGINA */
.app,
.grid-3,
.card,
.info,
.card * {
  position: relative;
  z-index: 20;
}

  .brand {
    display: flex;
    align-items: center;
    gap: 16px;
  }

  .actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
  }

  .actions .btn {
    font-size: 12px;
    padding: 9px 14px;
  }

  .logo {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    background: var(--primary-gradient);
    border-radius: 14px;
    box-shadow: var(--primary-glow);
    font-size: 24px;
    transition: var(--transition);
  }

  .logo:hover {
    transform: rotate(10deg) scale(1.05);
  }

  .titles h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text) 0%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .titles p {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--text-muted);
    max-width: 500px;
  }

  /* =========================================================
    BOTÕES - Design Atualizado
  ========================================================= */
  .btn {
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--glass-bg);
    color: var(--text);
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
  }

  .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: var(--transition-slow);
  }

  .btn:hover::before {
    left: 100%;
  }

  .btn:hover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
    box-shadow: var(--primary-glow);
  }

  .btn.primary {
    background: var(--primary-gradient);
    border: none;
    color: white;
    font-weight: 600;
  }

  .btn.primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.4);
  }

  .btn.small {
    padding: 8px 14px;
    font-size: 13px;
  }

  .btn:active {
    transform: translateY(0);
  }

  .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
  }

  .btn.danger {
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--danger);
  }

  .btn.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.15);
    color: var(--danger);
  }

  /* Variantes de cor — diferenciam as ações do topo */
  .btn.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    color: #fff;
  }

  .btn.success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.4);
  }

  .btn.cyan {
    border-color: rgba(6, 182, 212, 0.35);
    color: #22d3ee;
  }

  .btn.cyan:hover {
    background: rgba(6, 182, 212, 0.12);
    border-color: var(--info);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.15);
    color: #22d3ee;
  }

  .btn.accent {
    border-color: rgba(139, 92, 246, 0.35);
    color: #a78bfa;
  }

  .btn.accent:hover {
    background: rgba(139, 92, 246, 0.12);
    border-color: #8b5cf6;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
    color: #a78bfa;
  }

  /* =========================================================
    COLABORADORES
  ========================================================= */
  .colab-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .colab-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
  }

  .colab-item:hover {
    border-color: var(--border-light);
    background: rgba(59, 130, 246, 0.04);
  }

  .colab-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
  }

  .colab-nome {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
  }

  .badge-status {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .badge-status.ativo {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.25);
  }

  .badge-status.inativo {
    background: rgba(239, 68, 68, 0.08);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
  }

  .colab-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
  }

  /* Toggle collapsível */
  .card-head--toggle {
    cursor: pointer;
    user-select: none;
  }

  .card-head--toggle:hover h2 {
    color: var(--primary);
    transition: var(--transition-fast);
  }

  .toggle-chevron {
    margin-left: auto;
    font-size: 18px;
    color: var(--text-muted);
    transition: transform 0.25s ease;
    line-height: 1;
  }

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

  .card-body--collapsible {
    display: none;
  }

  .card-body--collapsible.open {
    display: block;
  }

  /* =========================================================
    INFO CARDS
  ========================================================= */
  .info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
  }

  .info-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
  }

  .info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
  }

  .info-card:hover {
    border-color: var(--border-light);
    transform: translateY(-4px);
    box-shadow: var(--shadow);
  }

  .info-card h3 {
    margin: 0 0 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .info-card h3::before {
    content: '📋';
    font-size: 14px;
  }

  .info-card ul {
    margin: 0;
    padding-left: 20px;
    font-size: 14px;
    color: var(--text-muted);
  }

  .info-card li {
    margin-bottom: 8px;
    padding-left: 8px;
  }

  .info-card li:last-child {
    margin-bottom: 0;
  }

  .info-card strong {
    color: var(--text);
    font-weight: 600;
  }

  /* =========================================================
    MAIN GRID LAYOUT
  ========================================================= */
  .grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
  }

  /* =========================================================
    CARD COMPONENTS
  ========================================================= */
  .card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
  }

  .card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow);
  }

  .card.highlight {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, var(--card) 100%);
    box-shadow: var(--primary-glow), var(--shadow);
  }

  .card.highlight::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
  }

  .card-head {
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.1);
  }

  .card-head h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .card-head h2::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    display: inline-block;
  }

  .card-actions {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(59, 130, 246, 0.3);
  }

  .card-body {
    padding: 24px;
  }

  /* =========================================================
    WEEKEND SUMMARY STYLES
  ========================================================= */
  .kv {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
  }

  .kv .left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .kv .title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
  }

  .kv .sub {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
  }

  .kv .pill {
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
  }

  /* =========================================================
    MONTH LIST STYLES
  ========================================================= */
  .month-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .month-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 16px 20px;
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition-fast);
    cursor: pointer;
  }

  .month-item:hover {
    background: rgba(59, 130, 246, 0.05);
    border-color: var(--primary);
    transform: translateX(4px);
  }

  .month-item .when {
    flex: 1;
  }

  .month-item .when b {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--text);
  }

  .month-item .when span {
    font-size: 13px;
    color: var(--text-muted);
  }

  .month-item .who {
    flex: 2;
    text-align: right;
  }

  .month-item .empty {
    font-style: italic;
    color: var(--text-light);
    font-size: 14px;
  }

  /* =========================================================
    FORM STYLES
  ========================================================= */
  .filters {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 24px;
  }

  .field {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
  }

  .field input,
  .field select {
    border: 1px solid var(--border);
    background: var(--glass-bg);
    color: var(--text);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition-fast);
  }
  .field select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    background-color: var(--glass-bg);
    color: var(--text);
    border: 1px solid var(--border);

    /* força tema escuro do SO */
    color-scheme: dark;
  }

  /* Lista */
  .field select option {
    background-color: #0f172a; /* igual ao panel */
    color: #e5edff;
  }

  /* Hover / foco (parcial no Chrome, total no Firefox) */
  .field select option:hover {
    background-color: rgba(59,130,246,.25);
    color: #fff;
  }

  /* Selecionado */
  .field select option:checked {
    background-color: rgba(59,130,246,.65);
    color: #fff;
  }

  .field input:focus,
  .field select:focus {
    outline: none;
    border-color: var(--text);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: rgba(59, 130, 246, 0.05);
  }

  .field.inline {
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  .field.inline label {
    margin: 0;
  }

  /* =========================================================
    TABLE STYLES
  ========================================================= */
  .table-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: auto;
    background: var(--card);
  }

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

  .table thead {
    background: rgba(0, 0, 0, 0.2);
  }

  .table th {
    padding: 16px 20px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--text);
    transition: var(--transition-fast);
  }

  .table tbody tr {
    transition: var(--transition-fast);
  }

  .table tbody tr:hover {
    background: rgba(59, 130, 246, 0.08);
  }

  .table tbody tr:hover td {
    color: var(--text);
  }

  /* =========================================================
    MODAL STYLES
  ========================================================= */
  .modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
  }

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

  .modal {
    width: min(600px, 100%);
    background: var(--panel-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
  }

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

  .modal-head {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
  }

  .modal-head h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
  }

  .modal-head .x {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition-fast);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .modal-head .x:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
  }

  .modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .modal-foot {
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: rgba(0, 0, 0, 0.1);
  }

  /* =========================================================
    TOAST STYLES
  ========================================================= */
  .toast {
    position: fixed;
    left: 50%;
    bottom: 32px;
    transform: translateX(-50%) translateY(100px);
    background: var(--panel-solid);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 16px 24px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    z-index: 2000;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }

  /* =========================================================
    INPUT MONTH
  ========================================================= */
  .input-month {
    border: 1px solid var(--border);
    background: var(--glass-bg);
    color: var(--text);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    color-scheme: dark;
    outline: none;
    transition: var(--transition-fast);
    cursor: pointer;
  }

  .input-month:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  }

  /* =========================================================
    ESTATÍSTICAS POR COLABORADOR
  ========================================================= */
  .stats-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .stats-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
  }

  .stats-item:hover {
    border-color: var(--border-light);
    background: rgba(59, 130, 246, 0.04);
    transform: translateX(3px);
  }

  .stats-rank {
    width: 30px;
    font-size: 18px;
    text-align: center;
    flex-shrink: 0;
  }

  .stats-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
  }

  .stats-bar-wrap {
    flex: 2;
    height: 6px;
    background: var(--border);
    border-radius: var(--radius-full);
    overflow: hidden;
  }

  .stats-bar {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: var(--radius-full);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 4px;
  }

  .stats-count {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
    min-width: 24px;
    text-align: right;
    flex-shrink: 0;
  }

  .empty-stats {
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
    padding: 24px 0;
    font-style: italic;
  }

  /* =========================================================
    RANKING DE PLANTÕES (dashboard estilo BI)
  ========================================================= */
  .rank-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }

  .rank-kpi {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 14px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    min-width: 0;
  }

  .rank-kpi.is-leader {
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.06);
  }

  .rank-kpi-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
  }

  .rank-kpi-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .rank-kpi.is-leader .rank-kpi-value {
    font-size: 15px;
  }

  .rank-kpi-sub {
    font-size: 11px;
    color: var(--text-muted);
  }

  .rank-block {
    margin-top: 24px;
  }

  .rank-block-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    margin-bottom: 12px;
  }

  /* Barra de distribuição 100% */
  .rank-dist-bar {
    display: flex;
    height: 26px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--glass-bg);
  }

  .rank-dist-seg {
    height: 100%;
    min-width: 2px;
    transition: filter var(--transition-fast);
  }

  .rank-dist-seg:hover {
    filter: brightness(1.18);
  }

  .rank-dist-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 12px;
  }

  .rank-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: var(--text-muted);
  }

  .rank-legend-item strong {
    color: var(--text);
  }

  .rank-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
  }

  /* Gráfico de barras horizontais */
  .rank-chart {
    --label-w: 190px;
    --val-gutter: 66px;
  }

  .rank-chart-plot {
    position: relative;
  }

  .rank-grid {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--label-w);
    right: var(--val-gutter);
    pointer-events: none;
  }

  .rank-gridline {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border);
  }

  .rank-gridline:first-child {
    background: var(--border-light);
  }

  .rank-chart-rows {
    position: relative;
  }

  .rank-chart-row {
    display: grid;
    grid-template-columns: var(--label-w) 1fr;
    align-items: center;
    height: 40px;
    padding-right: var(--val-gutter);
  }

  .rank-chart-label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding-right: 12px;
  }

  .rank-badge {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    background: var(--border);
    color: var(--text-muted);
  }

  .rank-chart-row.is-1 .rank-badge { background: #f59e0b; color: #1a1205; }
  .rank-chart-row.is-2 .rank-badge { background: #94a3b8; color: #0b1220; }
  .rank-chart-row.is-3 .rank-badge { background: #d97706; color: #1a1205; }

  .rank-chart-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .rank-chart-track {
    position: relative;
    height: 22px;
  }

  .rank-chart-bar {
    height: 100%;
    border-radius: 0 5px 5px 0;
    background: linear-gradient(90deg, #1d4ed8, #3b82f6);
    min-width: 2px;
    transform-origin: left;
    animation: rankGrow 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .rank-chart-row.is-1 .rank-chart-bar { background: linear-gradient(90deg, #b45309, #f59e0b); }
  .rank-chart-row.is-2 .rank-chart-bar { background: linear-gradient(90deg, #64748b, #94a3b8); }
  .rank-chart-row.is-3 .rank-chart-bar { background: linear-gradient(90deg, #b45309, #d97706); }

  .rank-chart-val {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
  }

  .rank-chart-val small {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-left: 4px;
  }

  .rank-axis {
    display: grid;
    grid-template-columns: var(--label-w) 1fr;
    padding-right: var(--val-gutter);
    margin-top: 4px;
  }

  .rank-axis-inner {
    position: relative;
    height: 16px;
  }

  .rank-axis-inner span {
    position: absolute;
    top: 0;
    font-size: 11px;
    color: var(--text-light);
  }

  @keyframes rankGrow {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
  }

  @media (max-width: 900px) {
    .rank-kpis { grid-template-columns: repeat(2, 1fr); }
  }

  @media (max-width: 640px) {
    .rank-chart { --label-w: 112px; --val-gutter: 46px; }
    .rank-chart-name,
    .rank-chart-val { font-size: 12px; }
  }

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

  /* =========================================================
    PÁGINA PÚBLICA – CARDS DE PLANTÃO
  ========================================================= */
  .pub-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
  }

  .pub-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1.5px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
    letter-spacing: 0.5px;
  }

  .pub-details {
    flex: 1;
  }

  .pub-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
    margin-bottom: 3px;
  }

  .pub-dates {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 3px;
  }

  .pub-obs {
    font-size: 12px;
    color: var(--text-light);
    font-style: italic;
    margin-bottom: 6px;
  }

  .pub-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: var(--success);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    margin-top: 2px;
  }

  .pub-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    animation: live-pulse 1.8s ease-in-out infinite;
  }

  @keyframes live-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.4; transform: scale(0.75); }
  }

  .pub-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 0;
    color: var(--text-light);
  }

  .pub-empty-icon {
    font-size: 28px;
    opacity: 0.35;
  }

  .pub-empty-text {
    font-size: 13px;
    font-style: italic;
  }

  /* =========================================================
    PÁGINA PÚBLICA – TABELA
  ========================================================= */
  .table tbody tr {
    transition: background var(--transition-fast);
  }

  .table tbody tr:hover {
    background: rgba(255, 255, 255, 0.025);
  }

  .table tbody tr.row-current {
    background: rgba(59, 130, 246, 0.06);
    border-left: 3px solid var(--primary);
  }

  .cell-suporte {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .cell-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
  }

  .cell-empty {
    color: var(--text-light);
    font-style: italic;
    font-size: 13px;
  }

  /* =========================================================
    FOOTER
  ========================================================= */
  .footer {
    margin-top: 48px;
    padding: 24px;
    text-align: center;
    color: var(--text-light);
    font-size: 13px;
    border-top: 1px solid var(--border);
  }

  /* =========================================================
    UTILITY CLASSES
  ========================================================= */
  .hidden {
    display: none !important;
  }

  .grow {
    flex-grow: 1;
  }

  .hint {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    padding: 12px;
    background: rgba(59, 130, 246, 0.05);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary);
  }

  /* =========================================================
    RESPONSIVE DESIGN
  ========================================================= */
  @media (max-width: 1024px) {
    .grid-3 {
      grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
  }

  @media (max-width: 768px) {
    .app {
      padding: 16px 16px 32px;
    }
    
    .topbar {
      flex-direction: column;
      align-items: stretch;
      gap: 16px;
      padding: 20px;
    }
    
    .actions {
      width: 100%;
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }
    
    .btn {
      flex: 1;
      min-width: 120px;
    }
    
    .info {
      grid-template-columns: 1fr;
    }
    
    .grid-3 {
      grid-template-columns: 1fr;
    }
    
    .filters {
      flex-direction: column;
    }
    
    .field {
      min-width: 100%;
    }
    
    .modal-body {
      padding: 20px;
    }
    
    .kv {
      flex-direction: column;
      gap: 12px;
    }
    
    .kv .pill {
      align-self: flex-start;
    }
  }

  @media (max-width: 480px) {
    .card-head {
      flex-direction: column;
      align-items: stretch;
      gap: 12px;
    }
    
    .card-actions {
      justify-content: flex-start;
    }
    
    .month-item {
      flex-direction: column;
      align-items: stretch;
      gap: 12px;
    }
    
    .month-item .who {
      text-align: left;
    }
  }

  /* =========================================================
    LOADING STATES & ANIMATIONS
  ========================================================= */
  @keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
  }

  .loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  }

  /* Focus styles for accessibility */
  :focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
  }

  /* Selection color */
  ::selection {
    background: rgba(59, 130, 246, 0.3);
    color: var(--text);
  }