/* TeamTrack - layout and small overrides on top of Bootstrap 5.
   Bootstrap does the components; this file only does the app shell. */

:root {
  --sidebar-w: 240px;
  --topbar-h: 56px;
  --sidebar-bg: #1e2532;
  --sidebar-fg: #a8b3c4;
  --sidebar-fg-active: #ffffff;
  --content-bg: #f4f6f9;
}

body {
  background: var(--content-bg);
  font-size: 0.925rem;
}

.app-shell { display: flex; min-height: 100vh; }

/* --- Sidebar ------------------------------------------------------------ */

.app-sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1040;
  transition: transform .2s ease;
}

.sidebar-brand {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 0 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.brand-mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 7px;
  background: #4f7cff;
  color: #fff;
  font-weight: 700;
  font-size: .8rem;
}

.brand-name { color: #fff; font-weight: 600; letter-spacing: .01em; }

.sidebar-nav { padding: .75rem .5rem; flex: 1; overflow-y: auto; }

.nav-link-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .55rem .75rem;
  margin-bottom: .1rem;
  border-radius: 7px;
  color: var(--sidebar-fg);
  text-decoration: none;
  font-size: .9rem;
}

.nav-link-item:hover { background: rgba(255, 255, 255, .06); color: var(--sidebar-fg-active); }
.nav-link-item.active { background: #4f7cff; color: #fff; }

.sidebar-note { padding: .5rem .75rem; font-size: .82rem; color: #6b7688; }

.sidebar-footer {
  padding: .75rem 1rem;
  font-size: .75rem;
  color: #5d6879;
  border-top: 1px solid rgba(255, 255, 255, .07);
}

.ico { width: 16px; height: 16px; flex: 0 0 16px; }

/* --- Main column -------------------------------------------------------- */

.app-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid #e3e8ef;
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.app-content { padding: 1.5rem; flex: 1; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.page-title { font-size: 1.35rem; font-weight: 600; margin: 0; }

/* --- Reusable pieces ---------------------------------------------------- */

.card { border: 1px solid #e3e8ef; border-radius: 10px; }
.card-header { background: #fff; border-bottom: 1px solid #eef1f6; font-weight: 600; }

.stat-card .stat-value { font-size: 1.6rem; font-weight: 600; line-height: 1.2; }
.stat-card .stat-label { font-size: .8rem; color: #6b7688; text-transform: uppercase; letter-spacing: .04em; }

.table > :not(caption) > * > * { padding: .6rem .75rem; }

/* --- Responsive --------------------------------------------------------- */

@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(-100%); }
  .app-sidebar.open { transform: translateX(0); }
  .app-main { margin-left: 0; }
}

/* --- Pieces added in phases 2-8 ----------------------------------------- */

.sidebar-divider {
  height: 1px;
  background: rgba(255, 255, 255, .08);
  margin: .6rem .75rem;
}

.avatar {
  width: 28px; height: 28px;
  flex: 0 0 28px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #e5ebf7;
  color: #3a5bbf;
  font-size: .72rem;
  font-weight: 700;
}

.empty-state { padding: 2rem 1.25rem; text-align: center; }

.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.card-footer { background: #fff; border-top: 1px solid #eef1f6; }

.table thead th {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #6b7688;
  font-weight: 600;
  border-bottom-width: 1px;
}

.badge { font-weight: 600; font-size: .72rem; padding: .35em .6em; }

/* --- Public pages (login, invitation, password reset) ------------------- */

.public-body {
  background: var(--content-bg);
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.public-card-wrap { width: 100%; max-width: 400px; }

.public-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  margin-bottom: 1.25rem;
  font-weight: 600;
  font-size: 1.05rem;
}

/* --- Notifications and the attendance clock ----------------------------- */

.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 17px; height: 17px;
  padding: 0 4px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: #dc3545;
  color: #fff;
  font-size: .66rem;
  font-weight: 700;
  line-height: 1;
}

.notif-menu { width: 320px; max-height: 420px; overflow-y: auto; }

.notif-item { white-space: normal; padding: .6rem 1rem; border-left: 3px solid transparent; }
.notif-item.unread { background: #f2f6ff; border-left-color: #4f7cff; }
.notif-item:hover { background: #e9eff9; }

.smaller { font-size: .72rem; }

.clock-pill {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .25rem .7rem;
  border-radius: 999px;
  background: #e8f5ec;
  color: #1c6b3a;
  font-size: .8rem;
  font-weight: 600;
}

.clock-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #23a35a;
  animation: clock-pulse 2s ease-in-out infinite;
}

@keyframes clock-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .3; }
}

.notice-strip {
  border: 1px solid #e3e8ef;
  border-left: 3px solid #4f7cff;
  border-radius: 8px;
  background: #fff;
  padding: .75rem 1rem;
  margin-bottom: 1rem;
}

.notif-row.unread { background: #f2f6ff; border-left: 3px solid #4f7cff; }
.min-w-0 { min-width: 0; }
