/*
 * Teams Platform – custom theme
 * Gentelella-inspired sidebar layout on top of Bootstrap 5.3
 */

/* ── Variables ─────────────────────────────────────────────────────────── */
:root {
  --sidebar-width: 230px;
  --sidebar-bg: #2a3f54;
  --sidebar-text: #e7e7e7;
  --sidebar-hover-bg: #1a2f3e;
  --sidebar-active-bg: #1a2f3e;
  --sidebar-active-border: #1abb9c;
  --nav-top-height: 57px;
  --nav-top-bg: #ededed;
  --brand-primary: #1abb9c;
  --brand-primary-dark: #179b84;
}

/* ── Body / Layout ─────────────────────────────────────────────────────── */
html, body {
  height: 100%;
}

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

/* ── Sidebar ───────────────────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  transition: width 0.25s ease;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

#sidebar .sidebar-brand {
  padding: 1rem 1.25rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  gap: .5rem;
  min-height: var(--nav-top-height);
}

#sidebar .sidebar-brand span.brand-text {
  letter-spacing: .05em;
}

#sidebar .nav-label {
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.4);
  padding: 1.25rem 1.25rem .4rem;
}

#sidebar .nav-link {
  color: var(--sidebar-text);
  padding: .55rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .65rem;
  border-left: 3px solid transparent;
  transition: background .15s, border-color .15s;
  text-decoration: none;
  font-size: .9rem;
}

#sidebar .nav-link:hover {
  background: var(--sidebar-hover-bg);
  color: #fff;
}

#sidebar .nav-link.active {
  background: var(--sidebar-active-bg);
  border-left-color: var(--sidebar-active-border);
  color: #fff;
}

#sidebar .nav-link i {
  width: 1.2rem;
  text-align: center;
  opacity: .75;
}

#sidebar .nav-link.active i,
#sidebar .nav-link:hover i {
  opacity: 1;
}

/* ── Main content area ─────────────────────────────────────────────────── */
#main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

/* ── Top navbar ────────────────────────────────────────────────────────── */
#nav-top {
  height: var(--nav-top-height);
  background: var(--nav-top-bg);
  border-bottom: 1px solid #ddd;
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 99;
}

#nav-top .nav-top-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* ── Page body ─────────────────────────────────────────────────────────── */
.page-body {
  flex: 1;
  padding: 1.5rem;
  background: #f5f5f5;
}

/* ── Cards ─────────────────────────────────────────────────────────────── */
.card {
  border: none;
  border-radius: .5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

.card-header {
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,.06);
  font-weight: 600;
  font-size: .95rem;
}

/* ── Stat tiles ─────────────────────────────────────────────────────────── */
.stat-tile {
  border-left: 4px solid var(--brand-primary);
  padding: 1rem 1.25rem;
  background: #fff;
  border-radius: .4rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
}

.stat-tile .stat-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.stat-tile .stat-label {
  font-size: .8rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* ── Quick-nav cards ─────────────────────────────────────────────────────── */
.quick-nav-card {
  transition: box-shadow .15s ease, transform .15s ease;
}
.quick-nav-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
  transform: translateY(-2px);
}

/* ── Auth pages ─────────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2a3f54;
}

.auth-card {
  width: 100%;
  max-width: 430px;
  border-radius: .75rem;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,.25);
}

.auth-card .auth-header {
  background: var(--brand-primary);
  color: #fff;
  padding: 1.5rem 2rem 1rem;
  text-align: center;
}

.auth-card .auth-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.auth-card .auth-body {
  padding: 2rem;
  background: #fff;
}

/* ── Brand button ───────────────────────────────────────────────────────── */
.btn-brand {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}

.btn-brand:hover {
  background: var(--brand-primary-dark);
  border-color: var(--brand-primary-dark);
  color: #fff;
}

/* ── Spinner overlay ────────────────────────────────────────────────────── */
.btn .spinner-border-sm {
  width: .85rem;
  height: .85rem;
  border-width: .15em;
  vertical-align: middle;
  margin-right: .35rem;
}

/* ── Responsive: collapse sidebar on small screens ──────────────────────── */
@media (max-width: 767.98px) {
  #sidebar {
    width: 0;
    overflow: hidden;
  }

  #sidebar.show {
    width: var(--sidebar-width);
  }

  #main-content {
    margin-left: 0;
  }
}
