/* ==========================================================================
   GTD-ABILITY TECNOLOGIA - INTERFACE SaaS ULTRA CLEAN (KANBAN & CARDS)
   ========================================================================== */

:root {
  --bg: #f1f5f9;                /* Slate 100 - Fundo profissional de Dashboard */
  --surface: #ffffff;           /* Fundo dos cards brancos */
  --surface-2: #f8fafc;         /* Slate 50 - Subtons para inputs e cabeçalhos */
  --text: #0f172a;              /* Slate 900 - Contraste tipográfico premium */
  --muted: #64748b;             /* Slate 500 - Legendas e textos auxiliares */
  --line: #e2e8f0;              /* Slate 200 - Divisores discretos */
  
  --primary: #4f46e5;           /* Indigo 600 - Corporativo e elegante */
  --primary-dark: #4338ca;      
  --success: #10b981;           /* Esmeralda para status OK */
  --warning: #f59e0b;           /* Âmbar para atenções e pendências */
  --danger: #ef4444;            /* Vermelho suave para erros ou recusas */
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(15,23,42,0.08), 0 2px 4px -1px rgba(15,23,42,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15,23,42,0.05);
  --radius: 12px;
}

* { 
  box-sizing: border-box; 
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select {
  font: inherit;
}

/* --- SEÇÃO DE AUTENTICAÇÃO CENTRALIZADA --- */
.auth-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 16px;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 440px;
  padding: 36px 32px;
}
.auth-header { text-align: center; margin-bottom: 24px; }
.brand-badge { display: inline-flex; padding: 6px 14px; background: #1e1b4b; color: #fff; font-weight: 800; font-size: 0.85rem; border-radius: 6px; margin-bottom: 12px; }
.auth-header h1 { margin: 0 0 4px; font-size: 1.6rem; font-weight: 700; letter-spacing: -0.025em; }
.brand-sub { margin: 0; color: var(--muted); font-size: 0.95rem; }

.auth-tabs { display: flex; background: var(--line); padding: 4px; border-radius: 8px; margin-bottom: 24px; gap: 2px; }
.tab-btn { flex: 1; background: transparent; border: none; padding: 10px 4px; font-size: 0.88rem; font-weight: 600; color: var(--muted); border-radius: 6px; cursor: pointer; text-align: center; }
.tab-btn.active { background: var(--surface); color: var(--text) !important; box-shadow: var(--shadow-sm); }
.auth-forms-container .auth-form { display: none; }
.auth-forms-container .auth-form.show { display: grid; gap: 16px; }

/* --- CORE FORMULÁRIOS --- */
.form { display: grid; gap: 16px; }
label { display: grid; gap: 6px; font-size: 0.88rem; font-weight: 600; color: var(--text); }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 11px 14px; font-size: 0.95rem; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.08); }

.primary-btn, .secondary-btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 18px; border-radius: 8px; font-size: 0.9rem; font-weight: 600; cursor: pointer; border: none; width: 100%; transition: all 0.15s ease; }
.primary-btn { background: var(--primary); color: #fff; }
.primary-btn:hover { background: var(--primary-dark); }
.secondary-btn { background: var(--surface); border: 1px solid var(--line); color: var(--text); box-shadow: var(--shadow-sm); }
.secondary-btn:hover { background: var(--surface-2); }
.ghost-btn { background: transparent; color: var(--danger); border: none; font-weight: 600; cursor: pointer; }

/* --- LAYOUT DA BARRA SUPERIOR (TOPBAR CORRIGIDA) --- */
.topbar { 
  background: var(--surface); 
  border-bottom: 1px solid var(--line); 
  position: sticky; 
  top: 0; 
  z-index: 50; 
  box-shadow: var(--shadow-sm); 
  width: 100%;
}
.topbar-inner { 
  max-width: 1440px;      /* Restringe ao tamanho exato da linha vermelha tracejada */
  margin: 0 auto;         /* Centraliza perfeitamente no monitor */
  padding: 14px 20px;     /* Recuo lateral idêntico aos painéis de baixo */
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  gap: 16px; 
}

/* --- MURAL DE AVISOS (TICKER ALINHADO SEM REGRAS CONFLITANTES) --- */
#mural-avisos-ticker { 
  width: 100%;
  background: #fff3cd;
  border-bottom: 1px solid #ffeeba;
}
.ticker-inner-wrapper {
  max-width: 1440px;      /* Trava na mesma largura exata do painel central */
  margin: 0 auto;         /* Força a centralização na tela */
  padding: 12px 20px;     /* O recuo lateral de 20px mata o vazamento da linha vermelha */
  box-sizing: border-box;
}

/* --- CONTENÇÃO CENTRALIZADA DA MAIN CONTENT --- */
.content { 
  max-width: 1440px; 
  margin: 0 auto; 
  padding: 24px 20px; 
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}
.section-head h2 { margin: 0 0 4px; font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; }
.section-head p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.tabs { display: flex; background: var(--line); padding: 4px; border-radius: 8px; gap: 2px; max-width: 100%; margin-top: 16px; }
.tab { flex: 1; background: transparent; border: none; padding: 10px 4px; font-size: 0.88rem; font-weight: 600; color: var(--muted); border-radius: 6px; cursor: pointer; text-align: center; }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* Grid de botões de solicitações do Técnico */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 20px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; justify-content: space-between; align-items: flex-start; text-align: left; box-shadow: var(--shadow-sm); width: 100%; border: none; cursor: pointer; transition: all 0.2s ease; }
.tile:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.tile div { font-weight: 700; color: var(--text); font-size: 1rem; }
.tile span { display: block; font-weight: 400; color: var(--muted); font-size: 0.85rem; margin-top: 4px; }
.icon { background: var(--surface-2); width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 1.1rem; color: var(--primary); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }

/* --- ESTRUTURA KANBAN ADMINISTRATIVA --- */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: start;
}
.kanban-column {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  min-height: 250px;
  display: grid;
  gap: 12px;
}
.kanban-column-header {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kanban-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 10px;
}

/* --- BLOCO FIXO DE SOLICITAÇÕES COM SCROLL INTERNO --- */
.request-list { 
  display: grid; 
  gap: 12px; 
  margin-top: 16px;
  max-height: 400px;         
  overflow-y: auto;          
  padding-right: 6px;        
}

.request-list::-webkit-scrollbar {
  width: 6px;
}
.request-list::-webkit-scrollbar-track {
  background: var(--surface-2);
  border-radius: 4px;
}
.request-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
.request-list::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.request-item { border: 1px solid var(--line); border-radius: 8px; padding: 16px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.request-item p { margin: 4px 0 0; color: var(--muted); font-size: 0.9rem; }

.badge { padding: 4px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; display: inline-flex; width: fit-content; }
.badge.pending { background: #fef3c7; color: #b45309; }
.badge.done { background: #d1fae5; color: #065f46; }
.badge.denied { background: #fee2e2; color: #991b1b; }

.empty { border: 2px dashed var(--line); border-radius: 8px; padding: 24px; text-align: center; color: var(--muted); font-size: 0.9rem; }
.message { display: none; border-radius: 8px; padding: 12px 14px; font-size: 0.9rem; font-weight: 500; }
.message.show { display: block; margin-top: 8px; }
.message.ok { background: #e7f6ef; color: #065f46; border: 1px solid #a7f3d0; }
.message.error { background: #fff0ee; color: #991b1b; border: 1px solid #fecaca; }

.pdf-frame { width: 100%; height: 68vh; border: 1px solid var(--line); border-radius: 8px; }
.script-box { background: #0f172a; color: #f1f5f9; padding: 16px; border-radius: 8px; font-family: monospace; overflow-x: auto; }

/* --- RESPONSIVIDADE DE DISPOSITIVOS --- */
@media (max-width: 1024px) {
  .kanban-board { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .topbar-inner { flex-direction: column; align-items: flex-start; }
  .user-chip { justify-content: flex-start; margin-top: 4px; }
  #mural-avisos-ticker .ticker-inner-wrapper { padding: 12px 16px; }
}