/* ============================================================
   app.css  —  Tema verde Jurkovich  (Bootstrap 5 override)
   Sistema de Controle de Uso
   ============================================================ */

/* ── Variáveis ─────────────────────────────────────────── */
:root {
  --verde-escuro:  #0D2014;
  --verde-sidebar: #1A3A28;
  --verde-primary: #1A7340;
  --verde-hover:   #1A5A37;
  --verde-light:   #C3F0D7;
  --verde-ultra:   #F0FDF4;
  --cinza-fundo:   #F4F6F8;
  --sidebar-w:     220px;
  --ambar:         #d97706;
  --ambar-bg:      #fef3c7;
  --cinza-status:  #94a3b8;
}

/* ── Reset base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--cinza-fundo);
  color: #1e293b;
  margin: 0;
  min-height: 100vh;
}

/* ── Layout geral ────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }
.main-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--verde-escuro);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  min-height: 100vh;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-brand {
  background: #08140D;
  padding: 18px 16px 14px;
  text-align: center;
  border-bottom: 1px solid #1A3A28;
}
.sidebar-brand h6 {
  color: #fff; font-weight: 800; letter-spacing: 1.5px;
  font-size: .85rem; margin: 0; text-transform: uppercase;
}
.sidebar-brand small { color: #86efac; font-size: .65rem; display: block; margin-top: 2px; }

.sidebar-nav { flex: 1; padding: 10px 0; }
.sidebar-section {
  color: #86efac; font-size: .68rem; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; padding: 14px 16px 4px;
}
.sidebar-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px; color: #C8EBD7; text-decoration: none;
  font-size: .85rem; transition: background .15s, color .15s;
  border-left: 3px solid transparent;
}
.sidebar-item:hover, .sidebar-item.active {
  background: var(--verde-hover); color: #fff; border-left-color: #4ade80;
}
.sidebar-item .icon { font-size: 1rem; opacity: .8; min-width: 18px; text-align: center; }

.sidebar-footer { border-top: 1px solid #1A3A28; padding: 10px 0; }
.sidebar-footer .sidebar-item:hover { background: #641C1C; }

/* ── Header / Topbar ─────────────────────────────────────── */
.topbar {
  background: var(--verde-primary);
  height: 52px; display: flex; align-items: center;
  padding: 0 20px; justify-content: space-between;
  flex-shrink: 0; box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.topbar-title { color: #fff; font-weight: 700; font-size: 1rem; letter-spacing: .5px; }
.topbar-right { display: flex; align-items: center; gap: 18px; color: #d1fae5; font-size: .82rem; }
.topbar-user { font-weight: 600; }

/* ── Page body ───────────────────────────────────────────── */
.page-body { flex: 1; padding: 24px; overflow-y: auto; }

/* ── Card padrão ─────────────────────────────────────────── */
.card { border: none; border-radius: 10px; box-shadow: 0 1px 6px rgba(0,0,0,.08); }
.card-header-verde {
  background: var(--verde-primary); color: #fff;
  border-radius: 10px 10px 0 0 !important; padding: 12px 18px;
  font-weight: 600; font-size: .9rem; display: flex; align-items: center; gap: 8px;
}

/* ── Botões ──────────────────────────────────────────────── */
.btn-verde {
  background: var(--verde-primary); color: #fff; border: none;
  border-radius: 7px; padding: 7px 18px; font-weight: 600; font-size: .85rem;
  transition: background .15s, transform .1s;
}
.btn-verde:hover { background: var(--verde-hover); color: #fff; transform: translateY(-1px); }
.btn-verde:disabled { background: #94a3b8; transform: none; }

.btn-outline-verde {
  border: 1.5px solid var(--verde-primary); color: var(--verde-primary);
  border-radius: 7px; padding: 7px 18px; font-weight: 600; font-size: .85rem;
  background: transparent; transition: all .15s;
}
.btn-outline-verde:hover { background: var(--verde-primary); color: #fff; }

/* ── Tabelas ─────────────────────────────────────────────── */
.table-jurkovich thead th {
  background: var(--verde-primary); color: #fff; font-weight: 600;
  font-size: .82rem; border: none; padding: 10px 12px; white-space: nowrap;
}
.table-jurkovich tbody tr { font-size: .84rem; }
.table-jurkovich tbody tr:nth-child(odd)  { background: var(--verde-ultra); }
.table-jurkovich tbody tr:nth-child(even) { background: #fff; }
.table-jurkovich tbody tr:hover { background: #bbf7d0; cursor: pointer; }
.table-jurkovich td { padding: 8px 12px; vertical-align: middle; }
.table-jurkovich { border-radius: 0 0 10px 10px; overflow: hidden; }

/* ── Formulários ─────────────────────────────────────────── */
.form-control:focus, .form-select:focus {
  border-color: var(--verde-primary); box-shadow: 0 0 0 3px rgba(26,115,64,.15);
}
.form-label { font-size: .82rem; font-weight: 600; color: #374151; margin-bottom: 3px; }

/* ── Badges de status (colaborador online/ocioso/offline) ──── */
.badge-online  { background: #dcfce7; color: #166534; }
.badge-ocioso  { background: var(--ambar-bg); color: var(--ambar); }
.badge-offline { background: #f1f5f9; color: var(--cinza-status); }

/* ── Login page ──────────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0D2014 0%, #1A5A37 100%);
}
.login-card {
  width: 420px; max-width: 95vw; background: #fff; border-radius: 14px;
  overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-header { background: var(--verde-primary); padding: 28px 30px 22px; text-align: center; color: #fff; }
.login-header h1 { font-size: 1.1rem; font-weight: 800; letter-spacing: 1px; margin: 0; }
.login-header p  { color: #C3F0D7; font-size: .8rem; margin: 4px 0 0; }
.login-body { padding: 30px; }
.login-body .form-control { height: 44px; border-radius: 8px; }
.login-btn {
  width: 100%; height: 44px; background: var(--verde-primary);
  color: #fff; border: none; border-radius: 8px; font-weight: 700; font-size: 1rem;
  transition: background .15s;
}
.login-btn:hover { background: var(--verde-hover); }

/* ── Dashboard cards ─────────────────────────────────────── */
.stat-card { border-radius: 12px; padding: 20px; color: #fff; display: flex; align-items: center; gap: 16px; }
.stat-card .stat-icon { font-size: 2.2rem; opacity: .85; }
.stat-card .stat-num  { font-size: 2rem; font-weight: 800; line-height: 1; }
.stat-card .stat-lbl  { font-size: .8rem; opacity: .9; }

/* ── Alerts ──────────────────────────────────────────────── */
.alert-verde { background: var(--verde-ultra); border-left: 4px solid var(--verde-primary); color: #166534; }

/* ── Linha do tempo de atividade (relatorio_atividade.php) ── */
.timeline-hora {
  display: flex; flex-direction: column; align-items: center; flex: 1; min-width: 0;
}
.timeline-barra {
  width: 100%; height: 28px; display: flex; border-radius: 4px; overflow: hidden;
  background: #f1f5f9; border: 1px solid #e2e8f0;
}
.timeline-barra .seg-ativo  { background: #22c55e; }
.timeline-barra .seg-ocioso { background: var(--ambar); }
.timeline-hora .lbl { font-size: .68rem; color: #64748b; margin-top: 3px; }

/* ── Linha por colaborador (modo "Todos" em relatorio_atividade.php) ── */
.atividade-linha {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 0; border-bottom: 1px solid #f1f5f9;
}
.atividade-linha:last-child { border-bottom: none; }
.atividade-nome {
  width: 160px; flex-shrink: 0; font-size: .8rem; font-weight: 600; color: #374151;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .page-body { padding: 16px; }
}
