/* ============================================================
   G360_Friday — App Stylesheet
   Stack: Bootstrap 5 + custom
   ============================================================ */

/* ── Custom properties ────────────────────────────────── */
:root {
  --g360-purple:    #6C63FF;
  --g360-purple-lt: #EEF0FF;
  --g360-gray-50:   #F8F9FC;
  --g360-gray-100:  #F1F3F7;
  --g360-gray-200:  #E2E8F0;
  --g360-gray-600:  #64748B;
  --g360-gray-900:  #0F172A;
  --navbar-h:       58px;
  --sidebar-w:      220px;
  --radius:         10px;
  --shadow-card:    0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
}

/* ── Base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--g360-gray-50);
  color: var(--g360-gray-900);
  font-size: .9rem;
  line-height: 1.6;
}

/* ── Navbar ──────────────────────────────────────────── */
.g360-navbar {
  background: #1E1B4B;
  min-height: var(--navbar-h);
  box-shadow: 0 1px 0 rgba(255,255,255,.08);
  position: sticky;
  top: 0;
  z-index: 1030;
}

/* Toggler mobile */
.g360-toggler {
  background: transparent;
  border: none;
  padding: .25rem .35rem;
  line-height: 1;
}
.g360-toggler:focus { box-shadow: none; }

/* Menú expandido en mobile */
@media (max-width: 991.98px) {
  #mainNav {
    background: #161340;
    border-top: 1px solid rgba(255,255,255,.08);
    padding: .5rem 0 .25rem;
    margin: 0 -12px;
    padding-left: 12px;
    padding-right: 12px;
  }
  #mainNav .dropdown-menu {
    background: #1a1748;
    border: none;
    padding-left: .5rem;
  }
  #mainNav .dropdown-item {
    color: #CBD5E1;
  }
  #mainNav .dropdown-item:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
  }
  #mainNav .dropdown-item.active {
    background: rgba(255,255,255,.12);
    color: #fff;
  }
  .btn-company-select {
    width: 100%;
    text-align: left;
    margin-bottom: .25rem;
  }
}

/* Nav link activo */
.g360-navbar .nav-link.active {
  color: #fff !important;
  background: rgba(255,255,255,.15);
}

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  background: var(--g360-purple);
  border-radius: 7px;
  color: #fff;
  font-size: 1rem;
}
.brand-name {
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  letter-spacing: -.3px;
}
.brand-accent { color: var(--g360-purple); }

.btn-company-select {
  background: rgba(255,255,255,.1);
  color: #CBD5E1;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 6px;
  font-size: .82rem;
}
.btn-company-select:hover { background: rgba(255,255,255,.18); color: #fff; }

.company-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
}
.company-dot-sm {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 2px;
}

.g360-navbar .nav-link {
  color: #CBD5E1;
  font-size: .84rem;
  border-radius: 6px;
  padding: .35rem .65rem;
}
.g360-navbar .nav-link:hover { color: #fff; background: rgba(255,255,255,.1); }

.avatar-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  font-weight: 600;
  font-size: .75rem;
  color: #fff;
}

.user-menu-btn {
  background: transparent;
  border: none;
  padding: .25rem .5rem;
  border-radius: 6px;
}
.user-menu-btn:hover { background: rgba(255,255,255,.1); }

/* ── Page wrapper ────────────────────────────────────── */
.page-wrapper {
  min-height: calc(100vh - var(--navbar-h));
}

/* ── Cards ───────────────────────────────────────────── */
.card {
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.card-header {
  border-radius: var(--radius) var(--radius) 0 0 !important;
  font-size: .85rem;
}

/* ── KPI cards ───────────────────────────────────────── */
.kpi-card { border-radius: var(--radius); transition: transform .15s; }
.kpi-card:hover { transform: translateY(-2px); }
.kpi-icon {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  font-size: 1.25rem;
  background: var(--g360-gray-100);
}
.kpi-value { font-size: 1.5rem; font-weight: 700; line-height: 1; }
.kpi-label { font-size: .75rem; color: var(--g360-gray-600); margin-top: 2px; }

/* ── Company card ────────────────────────────────────── */
.company-card {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1rem;
  border: 1px solid var(--g360-gray-200);
  border-radius: var(--radius);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  cursor: pointer;
}
.company-card:hover { border-color: var(--g360-purple); box-shadow: 0 0 0 3px var(--g360-purple-lt); }
.company-card-bar { width: 4px; height: 36px; border-radius: 2px; flex-shrink: 0; }
.company-card-body { flex: 1; }

.company-logo-lg {
  width: 48px; height: 48px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

/* ── Tables ──────────────────────────────────────────── */
.task-table th,
.board-table th {
  font-size: .75rem;
  font-weight: 600;
  color: var(--g360-gray-600);
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 2px solid var(--g360-gray-200);
  background: var(--g360-gray-50);
  padding: .65rem .75rem;
}
.task-table td,
.board-table td { border-color: var(--g360-gray-200); vertical-align: middle; }
.task-table tbody tr:hover,
.board-table tbody tr:hover { background: var(--g360-gray-50); }

.task-title-link:hover { color: var(--g360-purple) !important; }

/* ── Status select (inline dropdown) ─────────────────── */
.status-select {
  border: none;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 500;
  padding: .3rem .6rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  text-align: center;
}
.status-select:focus { outline: 2px solid var(--g360-purple); outline-offset: 2px; }

/* ── Avatars ─────────────────────────────────────────── */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}
.avatar-sm  { width: 28px; height: 28px; font-size: .75rem; }
.avatar-xs  { width: 22px; height: 22px; font-size: .65rem; }
.avatar-stack { display: flex; align-items: center; gap: -4px; }
.avatar-stack .avatar { margin-left: -4px; border: 1px solid #fff; }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* ── Badges (Bootstrap 5 subtle variants) ────────────── */
.bg-secondary-subtle  { background: #F1F5F9 !important; }
.text-secondary-emphasis { color: #64748B !important; }
.bg-primary-subtle    { background: #EFF6FF !important; }
.text-primary-emphasis { color: #1D4ED8 !important; }
.bg-danger-subtle     { background: #FEF2F2 !important; }
.text-danger-emphasis { color: #DC2626 !important; }
.bg-success-subtle    { background: #F0FDF4 !important; }
.text-success-emphasis { color: #16A34A !important; }
.bg-warning-subtle    { background: #FFFBEB !important; }
.text-warning-emphasis { color: #D97706 !important; }
.bg-info-subtle       { background: #EFF6FF !important; }
.text-info-emphasis   { color: #0369A1 !important; }

/* ── Empty states ────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}
.empty-state-lg {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
}

/* ── Task detail meta rows ───────────────────────────── */
.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .4rem 0;
  border-bottom: 1px solid var(--g360-gray-100);
  font-size: .85rem;
}
.meta-row:last-child { border-bottom: none; }
.meta-label { color: var(--g360-gray-600); font-size: .78rem; }

/* ── Comments ────────────────────────────────────────── */
.comment-bubble {
  background: var(--g360-gray-100);
  border-radius: 0 8px 8px 8px;
  padding: .6rem .8rem;
  font-size: .85rem;
}

/* ── Ghost button ────────────────────────────────────── */
.btn-ghost {
  background: transparent;
  border: none;
  color: var(--g360-gray-600);
  border-radius: 6px;
}
.btn-ghost:hover { background: var(--g360-gray-100); color: var(--g360-gray-900); }

/* ── Small xs button ─────────────────────────────────── */
.btn-xs {
  padding: .1rem .4rem;
  font-size: .72rem;
  border-radius: 4px;
}

/* ── Login page ──────────────────────────────────────── */
.login-body { background: var(--g360-gray-100); }

.login-split {
  display: flex;
  min-height: 100vh;
}
.login-brand {
  flex: 1;
  background: linear-gradient(135deg, #1E1B4B 0%, #312E81 60%, #4338CA 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}
.login-brand-content { max-width: 360px; color: #fff; }
.brand-icon-lg {
  width: 56px; height: 56px;
  background: var(--g360-purple);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.75rem;
  color: #fff;
}
.login-brand-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.5px;
}
.login-brand-title span { color: #A5B4FC; }
.login-brand-sub { color: #C7D2FE; font-size: .95rem; }
.login-features { display: flex; flex-direction: column; gap: .75rem; }
.login-feature {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: #E0E7FF;
  font-size: .9rem;
}
.login-feature i { color: #A5B4FC; font-size: 1rem; }

.login-form-panel {
  width: 480px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}
.login-form-wrap { width: 100%; max-width: 360px; }
.login-title    { font-size: 1.5rem; font-weight: 700; }
.login-subtitle { font-size: .88rem; }
.btn-login      { height: 44px; font-weight: 600; }

@media (max-width: 992px) {
  .login-split { flex-direction: column; }
  .login-form-panel { width: 100%; padding: 2rem 1.5rem; }
}

/* ── Calendar ────────────────────────────────────────── */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--g360-gray-200);
  border: 1px solid var(--g360-gray-200);
  border-radius: 8px;
  overflow: hidden;
}
.cal-header-cell {
  background: var(--g360-gray-100);
  text-align: center;
  font-size: .75rem;
  font-weight: 600;
  color: var(--g360-gray-600);
  padding: .5rem;
}
.cal-cell {
  background: #fff;
  min-height: 100px;
  padding: .4rem;
  position: relative;
}
.cal-empty { background: var(--g360-gray-50); }
.cal-today { background: var(--g360-purple-lt) !important; }
.cal-today .cal-day-num { color: var(--g360-purple); font-weight: 700; }
.cal-day-num { font-size: .78rem; color: var(--g360-gray-600); font-weight: 500; margin-bottom: .2rem; }
.cal-event {
  font-size: .72rem;
  padding: 2px 5px;
  border-radius: 4px;
  margin-bottom: 2px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.cal-event:hover { opacity: .85; }
.cal-more { font-size: .68rem; color: var(--g360-gray-600); margin-top: 2px; }

.cal-week-grid {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  gap: 1px;
  background: var(--g360-gray-200);
  border: 1px solid var(--g360-gray-200);
  border-radius: 8px;
  overflow: hidden;
}
.cal-week-header, .cal-week-day-header {
  background: var(--g360-gray-100);
  text-align: center;
  font-size: .75rem;
  font-weight: 600;
  color: var(--g360-gray-600);
  padding: .5rem .25rem;
}
.cal-week-day-header.cal-today { background: var(--g360-purple-lt); color: var(--g360-purple); }
.cal-hour-label {
  background: var(--g360-gray-50);
  font-size: .7rem;
  color: var(--g360-gray-600);
  text-align: right;
  padding: .25rem .5rem;
  border-top: 1px solid var(--g360-gray-200);
}
.cal-hour-cell {
  background: #fff;
  min-height: 44px;
  padding: 2px;
  border-top: 1px solid var(--g360-gray-200);
}

/* ── Breadcrumb ──────────────────────────────────────── */
.breadcrumb { font-size: .8rem; }
.breadcrumb-item a { color: var(--g360-purple); text-decoration: none; }
.breadcrumb-item a:hover { text-decoration: underline; }

/* ── Misc ────────────────────────────────────────────── */
.dropdown-menu {
  font-size: .85rem;
  border: 1px solid var(--g360-gray-200);
  border-radius: 8px;
}
.dropdown-item { padding: .45rem .85rem; border-radius: 5px; margin: 1px 4px; }
.dropdown-item:active { background: var(--g360-purple); }

/* ── Feriados en el calendario ─────────────────────────── */
.cal-holiday-fixed {
  background: #FEF2F2 !important;
  border-top: 2px solid #DC2626 !important;
}
.cal-holiday-extra {
  background: #FFFBEB !important;
  border-top: 2px solid #D97706 !important;
}
.cal-hol-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  font-size: .6rem; color: #fff; flex-shrink: 0;
  margin-top: 2px;
}
.cal-holiday-name {
  font-size: .68rem; font-weight: 600; line-height: 1.2;
  margin: 2px 0 3px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-holiday-name:hover { text-decoration: underline; }

/* Vista semana — feriados */
.cal-wk-holiday-fixed {
  background: #FEF2F2;
  border-bottom: 2px solid #DC2626;
}
.cal-wk-holiday-extra {
  background: #FFFBEB;
  border-bottom: 2px solid #D97706;
}

/* ── Fines de semana en el calendario ──────────────────── */
.cal-weekend-header {
  color: #9CA3AF !important;
  font-weight: 400;
}
.cal-weekend {
  background: #F9FAFB !important;
}
.cal-day-weekend {
  color: #9CA3AF;
}
.cal-day-holiday {
  color: #DC2626 !important;
  font-weight: 700;
}
/* Cuando un feriado cae en fin de semana, prevalece el rojo */
.cal-holiday-fixed .cal-day-num,
.cal-holiday-extra .cal-day-num {
  color: #DC2626 !important;
  font-weight: 700;
}
/* Vista semana — weekends */
.cal-wk-weekend {
  background: #F9FAFB;
  color: #9CA3AF;
}
.cal-hour-weekend {
  background: #F9FAFB;
}

/* Fix dropdown: ver inline style overflow-x:auto en cada tabla */

/* ── Paginación de tablas ─────────────────────────────── */
.g360-table-wrap { position: relative; }

.g360-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .6rem 1rem;
  border-top: 1px solid var(--g360-gray-200);
  background: #FAFAFA;
  border-radius: 0 0 8px 8px;
  flex-wrap: wrap;
  gap: .5rem;
}
.g360-pagination-info {
  font-size: .78rem;
  color: #6B7280;
}
.g360-pagination-info strong { color: #1F2937; }

.g360-pagination-controls {
  display: flex;
  align-items: center;
  gap: .35rem;
}
.g360-pagination-controls .btn {
  min-width: 32px;
  height: 32px;
  padding: 0 .5rem;
  font-size: .78rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.g360-pagination-controls .btn.active {
  background: #1E1B4B;
  border-color: #1E1B4B;
  color: #fff;
}

.g360-per-page {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .78rem;
  color: #6B7280;
}
.g360-per-page select {
  font-size: .78rem;
  padding: .15rem .4rem;
  height: 28px;
  width: auto;
}

/* Filas ocultas por paginación */
.g360-row-hidden { display: none !important; }

/* ── Separador de año en tabla de boards ──────────── */
.board-year-sep td {
  background: #F8F7FF !important;
  border-top: 2px solid #E0E7FF !important;
  padding-top: .4rem !important;
  padding-bottom: .4rem !important;
}

/* ── Ícono día no hábil en tabla de tareas ─────────── */
.non-working-badge {
  display: inline-flex;
  align-items: center;
  cursor: help;
  vertical-align: middle;
  animation: pulse-warn 2s infinite;
}
@keyframes pulse-warn {
  0%, 100% { opacity: 1; }
  50%       { opacity: .55; }
}

/* ── Color púrpura para boards recurrentes ─────────── */
.bg-purple-subtle { background-color: #EDE9FE !important; }
.text-purple { color: #7C3AED !important; }
