@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@300;400;500;600;700&display=swap');

:root {
  --brand-1: #a3123a;
  --brand-2: #e0762e;
  --brand-dark: #4a0e1f;
  --surface: #faf3f0;
  --card-bg: #ffffff;
  --muted: #6f5f62;
  --border: #ecdcd7;
  --row-hover: #fdf1ec;
  --danger: #c53f3f;
  --warning: #e2a117;
  --success: #1a9b7d;
  --brand-soft: #fbe6e0;
  --brand-soft-2: #fdeee0;
}

* { box-sizing: border-box; }

body {
  font-family: 'Source Sans 3', sans-serif;
  background:
    radial-gradient(circle at 8% 0%, #fbe9df 0, transparent 33%),
    radial-gradient(circle at 92% 100%, #f7dfe4 0, transparent 28%),
    var(--surface);
  color: #2a1a1d;
  font-size: .9rem;
}

body.auth-screen {
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 8% 0%, rgba(224,118,46,.22) 0, transparent 33%),
    radial-gradient(circle at 92% 100%, rgba(163,18,58,.18) 0, transparent 28%),
    linear-gradient(135deg, #4a0e1f 0%, #8a1638 52%, #e0762e 100%);
}

.app-navbar {
  background: linear-gradient(135deg, #4a0e1f 0%, #8a1638 52%, #e0762e 100%);
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(74,14,31,.35);
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.brand {
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
  flex-shrink: 0;
}
.brand i { font-size: 1.3rem; }

.nav-menu { display: flex; gap: .2rem; }

.nav-link-item {
  color: rgba(255,255,255,.72);
  text-decoration: none;
  padding: .5rem .8rem;
  border-radius: 8px;
  font-size: .84rem;
  font-weight: 600;
  transition: all .15s;
  white-space: nowrap;
}
.nav-link-item:hover { color: #fff; background: rgba(255,255,255,.1); }
.nav-link-item.active { color: #fff; background: rgba(255,255,255,.18); }

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

.nav-btn {
  color: rgba(255,255,255,.85);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  text-decoration: none;
  padding: .4rem .75rem;
  border-radius: 8px;
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
}
.nav-btn:hover { background: rgba(255,255,255,.18); color: #fff; }

.nav-db-label {
  color: rgba(255,255,255,.7);
  font-size: .72rem;
  padding: .3rem .6rem;
}

.content-wrap { padding: 1.75rem 2rem; max-width: 1150px; margin: 0 auto; }

.page-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.25rem; }
.page-header h1 { font-size: 1.3rem; font-weight: 700; color: var(--brand-dark); margin: 0; }
.page-header .subtitle { font-size: .8rem; color: var(--muted); margin-top: .15rem; }

.card-box {
  background: var(--card-bg);
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(74,14,31,.08);
  border: 1px solid var(--border);
  padding: 1.25rem 1.4rem;
}

.table-card {
  background: var(--card-bg);
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(74,14,31,.08);
  border: 1px solid var(--border);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

table.dt { width: 100%; border-collapse: collapse; }
.dt th {
  text-align: left; font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--muted); padding: .7rem .9rem; border-bottom: 1px solid var(--border);
}
.dt td { padding: .6rem .9rem; font-size: .85rem; color: #3a2a2d; border-bottom: 1px solid #f6ece8; vertical-align: middle; }
.dt tbody tr:last-child td { border-bottom: none; }
.dt tbody tr:hover { background: var(--row-hover); }

.btn-brand {
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  color: #fff; border: none; border-radius: 10px;
  padding: .55rem 1.1rem; font-size: .84rem; font-weight: 600;
  text-decoration: none; display: inline-flex; align-items: center; gap: .4rem;
  cursor: pointer;
}
.btn-brand:hover { opacity: .92; color: #fff; }

.btn-outline-brand {
  background: #fff; color: var(--brand-1); border: 1.5px solid var(--brand-1);
  border-radius: 10px; padding: .5rem 1rem; font-size: .82rem; font-weight: 600;
  text-decoration: none; display: inline-flex; align-items: center; gap: .4rem;
}
.btn-outline-brand:hover { background: var(--brand-soft); color: var(--brand-1); }

.badge-pill {
  display: inline-block; padding: .2rem .6rem; border-radius: 20px; font-size: .7rem; font-weight: 600;
}
.badge-active { background: #d1fae5; color: #065f46; }
.badge-inactive { background: #e5e7eb; color: #374151; }
.badge-present { background: #d1fae5; color: #065f46; }
.badge-absent { background: #fee2e2; color: #b91c1c; }

.avatar-thumb {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--brand-soft);
}
.avatar-placeholder {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-1);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .8rem;
}
.avatar-lg {
  width: 110px; height: 110px; border-radius: 14px; object-fit: cover;
  border: 2px solid var(--border);
}
.avatar-lg-placeholder {
  width: 110px; height: 110px; border-radius: 14px;
  background: var(--brand-soft); color: var(--brand-1);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 2rem;
}

.form-label { font-size: .78rem; font-weight: 600; color: #374151; }

.session-card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px;
  padding: .9rem 1.1rem; margin-bottom: .75rem; box-shadow: 0 2px 8px rgba(74,14,31,.06);
}
.session-card .date-badge {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2)); color: #fff;
  font-weight: 700; flex-shrink: 0;
}
.session-card .date-badge .day { font-size: 1.1rem; line-height: 1; }
.session-card .date-badge .mon { font-size: .6rem; text-transform: uppercase; }

.flash-msgs { max-width: 1150px; margin: 1rem auto 0; padding: 0 2rem; }

@media (max-width: 576px) {
  .app-navbar { padding: 0 .85rem; height: 54px; }
  .content-wrap { padding: 1rem .85rem; }
  .flash-msgs { padding: 0 .85rem; }
  table.dt th, table.dt td { padding: .55rem .6rem; font-size: .8rem; }
  .card-box { padding: 1rem 1.1rem; }
  .page-header h1 { font-size: 1.1rem; }
  .btn-brand, .btn-outline-brand { padding: .5rem .85rem; font-size: .8rem; }
}
