:root {
  --bni-red: #CF2027;
  --bni-red-dark: #A8181E;
  --bni-red-deep: #8E1419;
  --bni-red-soft: #FDECEC;
  --bni-red-hover: #E02830;
  --bni-navy: #1A1A1A;
  --bni-navy-soft: #2A2A2A;
  --bni-gold: #D4A017;
  --bni-gold-hover: #E6B422;
  --bg: #F5F5F5;
  --card: #FFFFFF;
  --text: #1A1A1A;
  --muted: #6B7280;
  --border: #E5E7EB;
  --success: #16A34A;
  --warning: #D97706;
  --danger: #CF2027;
  --info: #2563EB;
  --sidebar-width: 260px;
  --header-height: 64px;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  --font: "Be Vietnam Pro", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  background: linear-gradient(180deg, #F3F4F6 0%, var(--bg) 45%, #EEEEEE 100%);
  color: var(--text);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
.btn-bni {
  background: var(--bni-red);
  border-color: var(--bni-red);
  color: #fff;
  font-weight: 600;
}
.btn-bni:hover {
  background: var(--bni-red-hover);
  border-color: var(--bni-red-hover);
  color: #fff;
}
.btn-outline-bni {
  background: #fff;
  border: 1px solid var(--bni-red);
  color: var(--bni-red);
  font-weight: 600;
}
.btn-outline-bni:hover {
  background: var(--bni-red-soft);
  border-color: var(--bni-red);
  color: var(--bni-red-dark);
}

.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1050;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.25rem 0 1rem;
  background-color: var(--bni-red);
  background-image: url('../images/bni-header-bg.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #fff;
  box-shadow: 0 2px 8px rgba(160, 20, 25, .25);
}
.app-header .brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 0;
  flex: 0 1 auto;
}
.app-header-toggle {
  flex-shrink: 0;
  border-color: rgba(255,255,255,.55) !important;
  color: #fff !important;
  background: transparent !important;
  padding: .35rem .55rem;
}
.app-header-toggle:hover {
  background: rgba(255,255,255,.15) !important;
  border-color: #fff !important;
  color: #fff !important;
}
.app-header-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-left: auto;
  flex-shrink: 0;
}
.app-header-actions .text-muted {
  color: rgba(255,255,255,.85) !important;
}
.app-header-actions .btn-outline-secondary {
  border-color: rgba(255,255,255,.55);
  color: #fff;
  background: transparent;
}
.app-header-actions .btn-outline-secondary:hover {
  background: rgba(255,255,255,.15);
  border-color: #fff;
  color: #fff;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  padding-top: var(--header-height);
}
.sidebar {
  width: var(--sidebar-width);
  background: #FAFAFA;
  color: var(--text);
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  z-index: 1040;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform .25s ease;
  border-right: 1px solid var(--border);
}
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: #fff; color: var(--bni-red);
  display: grid; place-items: center; font-weight: 800;
}
.brand-logo {
  width: 46px !important;
  height: 46px !important;
  max-width: 46px !important;
  max-height: 46px !important;
  border-radius: 10px;
  object-fit: contain;
  background: #fff;
  padding: 3px;
  flex-shrink: 0;
  display: block;
}
.topbar-logo {
  width: 28px !important;
  height: 28px !important;
  max-width: 28px !important;
  max-height: 28px !important;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
  padding: 2px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}
.topbar img {
  max-height: 36px;
  width: auto;
}
.brand-text { font-weight: 700; letter-spacing: .02em; line-height: 1.2; color: #fff; }
.brand-text small { display: block; font-weight: 400; opacity: .85; font-size: .75rem; color: #fff; }

.sidebar nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: .75rem .75rem 1.25rem;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
.sidebar nav::-webkit-scrollbar {
  width: 6px;
}
.sidebar nav::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}
.sidebar nav::-webkit-scrollbar-track {
  background: transparent;
}
.nav-link-app {
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem .85rem; border-radius: 10px;
  color: #4B5563; margin-bottom: .2rem;
  font-weight: 500;
  border-left: 3px solid transparent;
}
.nav-link-app i {
  color: #6B7280;
  font-size: 1.05rem;
  width: 1.25rem;
  text-align: center;
}
.nav-link-app:hover {
  background: var(--bni-red-soft);
  color: var(--bni-red-dark);
}
.nav-link-app:hover i { color: var(--bni-red); }
.nav-link-app.active {
  background: var(--bni-red-soft);
  color: var(--bni-red);
  font-weight: 700;
  border-left-color: var(--bni-red);
}
.nav-link-app.active i { color: var(--bni-red); }
.nav-section {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .08em;
  color: #9CA3AF; margin: 1rem .85rem .4rem; font-weight: 700;
}

.main-wrap {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
}
.content { padding: 1.25rem; }

.meeting-live-bar {
  position: sticky;
  top: calc(var(--header-height, 64px) + .5rem);
  z-index: 50;
  margin: 0 0 1rem;
}
.meeting-live-bar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1rem;
  padding: .85rem 1.1rem;
  border-radius: 14px;
  color: #fff;
  background:
    radial-gradient(circle at top right, rgba(255,255,255,.16), transparent 45%),
    linear-gradient(135deg, #8E1419 0%, #CF2027 55%, #A8181E 100%);
  box-shadow: 0 10px 28px rgba(160, 20, 25, .28);
}
.meeting-live-status {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .92rem;
}
.meeting-live-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #86EFAC;
  box-shadow: 0 0 0 0 rgba(134, 239, 172, .7);
  animation: meeting-live-pulse 1.4s infinite;
}
@keyframes meeting-live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(134, 239, 172, .55); }
  70% { box-shadow: 0 0 0 10px rgba(134, 239, 172, 0); }
  100% { box-shadow: 0 0 0 0 rgba(134, 239, 172, 0); }
}
.meeting-live-timer {
  font-size: 1.65rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: .03em;
  min-width: 7.5rem;
  text-align: center;
}
.meeting-live-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
}

.card-soft {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.stat-card {
  padding: 1.1rem 1.2rem;
  height: 100%;
}
.stat-label { color: var(--muted); font-size: .85rem; margin-bottom: .35rem; }
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--bni-red-dark); }
.badge-status {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .35rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 600;
}
.badge-DRAFT { background: #E2E8F0; color: #334155; }
.badge-UPCOMING { background: #DBEAFE; color: #1D4ED8; }
.badge-LIVE { background: #DCFCE7; color: #15803D; }
.badge-COMPLETED { background: #E0E7FF; color: #4338CA; }
.badge-CANCELLED { background: #FEE2E2; color: #B91C1C; }
.badge-PRESENT { background: #DCFCE7; color: #15803D; }
.badge-ABSENT { background: #FEE2E2; color: #B91C1C; }
.badge-LATE { background: #FEF3C7; color: #B45309; }
.badge-ONLINE { background: #DBEAFE; color: #1D4ED8; }
.badge-EXCUSED { background: #F1F5F9; color: #475569; }
.badge-SUBSTITUTE { background: #FEF3C7; color: #92400E; }

.attendance-tabs .nav-link {
  color: var(--bni-navy, #1B365D);
  font-weight: 600;
}
.attendance-tabs .nav-link.active {
  color: var(--bni-red, #C8102E);
  border-bottom-color: #fff;
}
.attendance-stats-list {
  padding-left: 1.25rem;
}
.attendance-stats-list > li::marker {
  font-weight: 700;
  color: var(--bni-navy, #1B365D);
}
.badge-INVITED { background: #E0E7FF; color: #4338CA; }
.badge-CONFIRMED { background: #DBEAFE; color: #1D4ED8; }
.badge-ATTENDED { background: #DCFCE7; color: #15803D; }
.badge-NO_SHOW { background: #FEE2E2; color: #B91C1C; }
.badge-FOLLOWED_UP { background: #F1F5F9; color: #475569; }
.badge-LOW { background: #F1F5F9; color: #475569; }
.badge-MEDIUM { background: #DBEAFE; color: #1D4ED8; }
.badge-HIGH { background: #FEF3C7; color: #B45309; }
.badge-URGENT { background: #FEE2E2; color: #B91C1C; }
.badge-TODO { background: #FEF3C7; color: #B45309; }
.badge-IN_PROGRESS { background: #DBEAFE; color: #1D4ED8; }
.badge-DONE { background: #DCFCE7; color: #15803D; }
.badge-NORMAL { background: #F1F5F9; color: #475569; }
.badge-IMPORTANT { background: #FEF3C7; color: #B45309; }
.badge-MEMBER_OF_THE_WEEK,.badge-BEST_PRESENTATION,.badge-MOST_SUPPORTIVE,.badge-VISITOR_CHAMPION { background: #FEF3C7; color: #92400E; }


.check-item { display: flex; justify-content: space-between; padding: .55rem 0; border-bottom: 1px solid var(--border); }
.check-item:last-child { border-bottom: 0; }
.check-ok { color: var(--success); font-weight: 700; }
.check-no { color: var(--muted); }

.agenda-item {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: .9rem 1rem; margin-bottom: .65rem; cursor: grab;
}
.agenda-item.dragging { opacity: .5; }
.login-page {
  min-height: 100vh;
  display: grid; place-items: center;
  background:
    radial-gradient(circle at top right, rgba(207,32,39,.28), transparent 42%),
    linear-gradient(135deg, #8E1419 0%, #CF2027 48%, #A8181E 100%);
  padding: 1.5rem;
}
.login-card {
  width: 100%; max-width: 420px;
  background: #fff; border-radius: 20px; padding: 2rem;
  box-shadow: 0 30px 60px rgba(0,0,0,.25);
}
.login-brand { text-align: center; margin-bottom: 1.5rem; }
.login-logo {
  width: 88px !important;
  height: 88px !important;
  max-width: 88px !important;
  max-height: 88px !important;
  margin: 0 auto .75rem;
  display: block;
  object-fit: contain;
  background: #fff;
  border-radius: 18px;
  padding: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.login-brand .mark {
  width: 64px; height: 64px; margin: 0 auto .75rem; border-radius: 18px;
  background: var(--bni-red); display: grid; place-items: center;
  font-weight: 800; font-size: 1.4rem; color: #fff;
}

.table > :not(caption) > * > * { vertical-align: middle; }
.avatar-circle {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--bni-red-soft); color: var(--bni-red-dark);
  display: grid; place-items: center; font-weight: 700;
  overflow: hidden; flex-shrink: 0;
}
.avatar-img { object-fit: cover; padding: 0; display: block; }
.profile-hero {
  background: linear-gradient(135deg, var(--bni-red-deep), var(--bni-red));
  color: #fff; border-radius: var(--radius); padding: 1.75rem;
}
.profile-avatar {
  width: 96px; height: 96px; border-radius: 50%;
  object-fit: cover; border: 3px solid rgba(255,255,255,.35);
  flex-shrink: 0; background: #fff;
}
.profile-avatar-fallback {
  display: grid; place-items: center;
  background: #fff; color: var(--bni-red); font-weight: 800; font-size: 2rem;
}
.member-media-preview {
  width: 140px; height: 140px; border-radius: 12px;
  border: 1px solid var(--border); background: #f8fafc;
  overflow: hidden; display: grid; place-items: center; flex-shrink: 0;
}
.member-media-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.member-media-preview-logo { width: 160px; height: 90px; }
.member-media-preview-logo img { object-fit: contain; background: #fff; padding: 6px; }
.member-media-empty {
  width: 100%; height: 100%; display: grid; place-items: center;
  font-weight: 800; color: #94a3b8; font-size: 1.6rem; background: #eef2f7;
}
.member-account-form .card-soft h2 { color: var(--bni-navy); }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-wrap { margin-left: 0; }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.45);
    z-index: 1035;
  }
  .sidebar-backdrop.show { display: block; }
}

.phone-actions { display: inline-flex; align-items: center; gap: .4rem; }
.phone-copy, .phone-call {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  height: 32px; padding: 0 .8rem; border-radius: 999px;
  font-size: .92rem; font-weight: 600; line-height: 1; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.phone-copy {
  border: 1px solid #E2E8F0; background: #F8FAFC; color: var(--text);
  letter-spacing: .02em; font-variant-numeric: tabular-nums;
}
.phone-copy i { color: #94A3B8; font-size: .85rem; }
.phone-copy:hover { background: var(--bni-red-soft); border-color: #F3B8BB; }
.phone-copy:hover i { color: var(--bni-red); }
.phone-call {
  border: 1px solid #BBF7D0; background: #F0FDF4; color: #15803D;
}
.phone-call i { font-size: .8rem; }
.phone-call:hover { background: #16A34A; border-color: #16A34A; color: #fff; }
.phone-copy:active, .phone-call:active { transform: scale(.96); }
@media (max-width: 991.98px) {
  .phone-copy, .phone-call { height: 36px; }
}
.copy-toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: #1f2937; color: #fff; border-radius: 999px; padding: .55rem 1.1rem;
  font-size: .9rem; font-weight: 600; z-index: 3000; box-shadow: 0 10px 30px rgba(0,0,0,.25);
  transition: opacity .2s, transform .2s;
}
.copy-toast i { color: #4ade80; margin-right: .3rem; }
.copy-toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 991.98px) {
  .copy-toast { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
}
