/* ═══════════════════════════════════════════════════════════
   GO!WorkTime — Estilos principales
   Basado en el diseño de GO!Customer360 (Telematel)
═══════════════════════════════════════════════════════════ */

:root {
  --sidebar-bg: #1a2035;
  --sidebar-width: 220px;
  --sidebar-text: #a8b2c8;
  --sidebar-text-active: #ffffff;
  --sidebar-hover: rgba(255,255,255,0.07);
  --sidebar-active-bg: rgba(255,255,255,0.12);
  --sidebar-section: #5a6882;
  --sidebar-accent: #4a9eff;

  --header-height: 54px;
  --header-bg: #ffffff;
  --header-border: #e8ecf0;

  --body-bg: #f0f2f5;
  --card-bg: #ffffff;
  --card-shadow: 0 1px 4px rgba(0,0,0,0.08);
  --card-radius: 8px;

  --text-primary: #1a2035;
  --text-secondary: #5a6882;
  --text-muted: #9aa5b8;

  --accent: #4a9eff;
  --accent-dark: #2d7dd2;
  --success: #28a745;
  --warning: #ffc107;
  --danger: #dc3545;

  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--body-bg);
  color: var(--text-primary);
  font-size: 14px;
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 18px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.sidebar-logo a {
  text-decoration: none;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo .logo-icon {
  width: 28px; height: 28px;
  background: var(--accent);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #fff;
  flex-shrink: 0;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--sidebar-section);
  padding: 18px 20px 6px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  border-radius: 0;
}

.sidebar-nav a:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-active);
}

.sidebar-nav a.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-text-active);
}

.sidebar-nav a .nav-dot {
  width: 8px; height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.sidebar-nav a .nav-icon {
  font-size: 15px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

/* Fuentes footer del sidebar */
.sidebar-footer {
  margin-top: auto;
  padding: 12px 0 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar-footer .footer-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--sidebar-section);
  padding: 10px 20px 4px;
}

.sidebar-footer a {
  display: block;
  padding: 4px 20px;
  color: #475569;
  font-size: 11px;
  text-decoration: none;
  transition: color 0.15s;
}

.sidebar-footer a:hover { color: var(--sidebar-text); }

/* ── Header ──────────────────────────────────────────────── */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--header-height);
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
}

.topbar-toggle {
  background: none; border: none; cursor: pointer;
  color: var(--text-secondary); padding: 4px; line-height: 1;
  font-size: 18px;
}

.topbar-search {
  flex: 1;
  max-width: 540px;
}

.topbar-search input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  border: 1px solid var(--header-border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-primary);
  background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239aa5b8' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 10px center;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.topbar-search input:focus {
  border-color: var(--accent);
  background-color: #fff;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.topbar-user {
  font-size: 13px;
  color: var(--text-secondary);
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.btn-logout:hover { background: #fef2f2; border-color: var(--danger); }

/* ── Contenido principal ─────────────────────────────────── */
.main-content {
  flex: 1;
  padding: 28px 28px;
}

.page-header {
  margin-bottom: 22px;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ── Tarjetas ─────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: 20px;
  border: 1px solid #e8ecf0;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f0f2f5;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ── Stats row ───────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  padding: 18px 20px;
  border: 1px solid #e8ecf0;
  box-shadow: var(--card-shadow);
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ── Tabla ───────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
  background: #f8fafc;
  border-bottom: 1px solid #e8ecf0;
}

tbody tr {
  border-bottom: 1px solid #f0f2f5;
  transition: background 0.1s;
}

tbody tr:hover { background: #f8fafc; }

tbody td {
  padding: 11px 14px;
  color: var(--text-primary);
  vertical-align: middle;
}

/* ── Empleado avatar + nombre ────────────────────────────── */
.emp-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.emp-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: #e2e8f0;
  flex-shrink: 0;
}

.emp-avatar-placeholder {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

.emp-name { font-weight: 600; color: var(--text-primary); }
.emp-email { font-size: 11px; color: var(--text-secondary); }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.badge-dept {
  background: #eff6ff;
  color: #1d4ed8;
}

.badge-success { background: #f0fdf4; color: #15803d; }
.badge-warning { background: #fffbeb; color: #b45309; }
.badge-danger  { background: #fef2f2; color: #b91c1c; }

/* ── Filtros / toolbar ───────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.toolbar input,
.toolbar select {
  padding: 7px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-primary);
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}

.toolbar input:focus,
.toolbar select:focus { border-color: var(--accent); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background 0.15s, opacity 0.15s;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-outline { background: #fff; color: var(--text-secondary); border: 1px solid #e2e8f0; }
.btn-outline:hover { background: #f8fafc; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ── Mes selector ────────────────────────────────────────── */
.month-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 4px 6px;
}

.month-nav span {
  font-weight: 600;
  font-size: 13px;
  min-width: 110px;
  text-align: center;
}

.month-nav a {
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 15px;
  transition: background 0.1s;
}
.month-nav a:hover { background: #f0f2f5; }

/* ── Horas progress bar ──────────────────────────────────── */
.hours-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hours-bar-track {
  flex: 1;
  height: 6px;
  background: #e8ecf0;
  border-radius: 3px;
  overflow: hidden;
}

.hours-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s;
}

.hours-value {
  font-weight: 600;
  font-size: 13px;
  min-width: 44px;
  text-align: right;
}

/* ── Alerta/notice ───────────────────────────────────────── */
.notice {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 13px;
  color: #1d4ed8;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.notice-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

/* ── Alert flash ─────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 18px;
}
.alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.alert-danger  { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* ── Login page ──────────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-box {
  background: #fff;
  border-radius: 12px;
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo .logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  background: var(--accent);
  border-radius: 12px;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
}

.login-logo h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.login-logo p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s;
}

.form-control:focus { border-color: var(--accent); }

.validation-msg {
  font-size: 11px;
  color: var(--danger);
  margin-top: 4px;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .main-wrapper { margin-left: 0; }
}
