/* ===========================================
   Kids Safety Tracker — Mobile-First Stylesheet
   =========================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:    #2563eb;
  --primary-d:  #1d4ed8;
  --primary-lt: #eff6ff;
  --success:    #16a34a;
  --success-lt: #dcfce7;
  --warning:    #d97706;
  --warning-lt: #fef9c3;
  --danger:     #dc2626;
  --danger-lt:  #fee2e2;
  --info:       #0891b2;
  --info-lt:    #e0f7fa;
  --purple:     #7c3aed;
  --secondary:  #6b7280;
  --bg:         #f8fafc;
  --card-bg:    #ffffff;
  --border:     #e2e8f0;
  --text:       #1e293b;
  --text-muted: #64748b;
  --sidebar-w:  240px;
  --navbar-h:   60px;
  --mobile-nav: 60px; /* bottom nav height on mobile */
  --radius:     10px;
  --shadow:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:  0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:  0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
}

body { font-family: 'Inter', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; }

/* ════════════════════════════════════════
   NAVBAR
   ════════════════════════════════════════ */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--navbar-h);
  background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1rem;
  box-shadow: var(--shadow);
  gap: .5rem;
}
.nav-brand {
  display: flex; align-items: center; gap: .5rem;
  font-weight: 700; font-size: 1rem; color: var(--primary);
  min-width: 0;
}
.nav-brand span:last-child {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-icon { font-size: 1.3rem; flex-shrink: 0; }

/* Hamburger — mobile only */
.nav-menu-btn {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border: none; background: none;
  cursor: pointer; border-radius: 8px; color: var(--text);
  font-size: 1.2rem; flex-shrink: 0;
  transition: background .15s;
}
.nav-menu-btn:hover { background: var(--bg); }
@media (min-width: 900px) { .nav-menu-btn { display: none; } }

.nav-user { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }

/* Role badge */
.nav-role-badge {
  padding: .2em .65em; border-radius: 20px;
  font-size: .7rem; font-weight: 700; white-space: nowrap;
  display: none;
}
@media (min-width: 480px) { .nav-role-badge { display: inline-flex; } }

/* ── Profile Button ───────────────────────────────────────── */
.profile-dropdown { position: relative; }

.profile-btn {
  display: flex; align-items: center; gap: .5rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: .25rem .75rem .25rem .28rem;
  cursor: pointer; font-family: inherit; color: var(--text);
  transition: background .15s, border-color .15s, box-shadow .15s;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.profile-btn:hover {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(37,99,235,.15);
}
.profile-btn:active { transform: scale(.98); }

.profile-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff; display: inline-flex; align-items: center;
  justify-content: center; font-size: .72rem; font-weight: 700;
  flex-shrink: 0; letter-spacing: -.5px;
}

.nav-username {
  font-size: .82rem; font-weight: 600; color: var(--text);
  display: none; max-width: 110px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@media (min-width: 560px) { .nav-username { display: block; } }

.chevron {
  font-size: .55rem; color: var(--text-muted);
  transition: transform .2s ease;
  margin-left: .1rem;
}
.profile-btn[aria-expanded="true"] .chevron,
.profile-menu.open + .profile-btn .chevron { transform: rotate(180deg); }

/* ── Dropdown Panel ───────────────────────────────────────── */
.profile-menu {
  display: none;
  position: absolute; right: 0; top: calc(100% + 8px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  min-width: 230px;
  box-shadow: 0 8px 30px rgba(0,0,0,.13), 0 2px 8px rgba(0,0,0,.07);
  z-index: 300;
  overflow: hidden;
}
.profile-menu.open {
  display: block;
  animation: dropIn .18s cubic-bezier(.16,1,.3,1);
}

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-8px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

/* Header strip */
.profile-menu-header {
  padding: 1rem 1.1rem .9rem;
  background: linear-gradient(135deg, #1e40af 0%, #4f46e5 100%);
  display: flex; align-items: center; gap: .75rem;
}
.profile-menu-header-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.25);
  color: #fff; display: flex; align-items: center;
  justify-content: center; font-size: .85rem; font-weight: 700;
  flex-shrink: 0; letter-spacing: -.5px;
  border: 2px solid rgba(255,255,255,.4);
}
.profile-menu-header-text { display: flex; flex-direction: column; min-width: 0; }
.profile-menu-header-text strong {
  font-size: .875rem; font-weight: 700; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.profile-menu-header-text small {
  font-size: .72rem; color: rgba(255,255,255,.75);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Menu body */
.profile-menu-body { padding: .4rem; }

.profile-menu-item {
  display: flex; align-items: center; gap: .7rem;
  padding: .65rem .85rem;
  border-radius: 9px;
  font-size: .875rem; font-weight: 500; color: var(--text);
  text-decoration: none;
  transition: background .12s, color .12s;
  cursor: pointer;
}
.profile-menu-item:hover { background: var(--bg); color: var(--primary); }

.profile-menu-item-icon {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem; flex-shrink: 0;
  background: var(--primary-lt);
}

.profile-menu-divider {
  height: 1px; background: var(--border);
  margin: .3rem .85rem;
}

/* Logout item */
.profile-menu-logout { color: var(--danger); }
.profile-menu-logout:hover {
  background: #fff5f5; color: var(--danger);
}
.profile-menu-logout .profile-menu-item-icon {
  background: #fff0f0;
}

/* ════════════════════════════════════════
   SIDEBAR
   ════════════════════════════════════════ */
.app-shell {
  display: flex;
  padding-top: var(--navbar-h);
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid var(--border);
  position: fixed; left: 0; top: var(--navbar-h); bottom: 0;
  overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column;
  z-index: 150;
  transform: translateX(-100%);
  transition: transform .25s ease;
}
.sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
@media (min-width: 900px) {
  .sidebar { transform: translateX(0); box-shadow: none; }
}

.sidebar-nav { list-style: none; padding: .75rem 0; flex: 1; }
.sidebar-nav li a {
  display: flex; align-items: center; gap: .5rem;
  padding: .7rem 1.25rem; font-size: .875rem; color: var(--text);
  text-decoration: none; margin: .1rem .75rem .1rem 0;
  border-radius: 0 8px 8px 0;
  transition: background .15s, color .15s;
}
.sidebar-nav li a:hover, .sidebar-nav li a.active {
  background: var(--primary-lt); color: var(--primary); font-weight: 600;
}

/* Sidebar account section */
.sidebar-account {
  border-top: 1px solid var(--border); padding: .85rem 1rem;
}
.sidebar-account-info {
  display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem;
}
.sidebar-account-info .profile-avatar { width: 34px; height: 34px; font-size: .8rem; }
.sidebar-account-info div { display: flex; flex-direction: column; min-width: 0; }
.sidebar-account-info strong { font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-account-info small  { font-size: .72rem; color: var(--text-muted); }

.sidebar-account-links { display: flex; flex-direction: column; gap: .2rem; }
.sidebar-account-link {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .6rem; border-radius: 7px;
  font-size: .82rem; color: var(--text); text-decoration: none;
  transition: background .15s, color .15s;
}
.sidebar-account-link:hover, .sidebar-account-link.active {
  background: var(--primary-lt); color: var(--primary); font-weight: 600;
}
.sidebar-logout { color: var(--danger) !important; }
.sidebar-logout:hover { background: var(--danger-lt) !important; }

/* Overlay behind mobile sidebar */
.sidebar-overlay {
  display: none; position: fixed; inset: 0; z-index: 140;
  background: rgba(0,0,0,.45);
}
.sidebar-overlay.visible { display: block; }

/* ════════════════════════════════════════
   MOBILE BOTTOM NAV
   ════════════════════════════════════════ */
.mobile-bottom-nav {
  display: flex;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: #fff; border-top: 1px solid var(--border);
  height: var(--mobile-nav);
  box-shadow: 0 -2px 10px rgba(0,0,0,.08);
}
@media (min-width: 900px) { .mobile-bottom-nav { display: none; } }

.mobile-nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-decoration: none; color: var(--text-muted);
  font-size: .65rem; font-weight: 500; gap: .15rem;
  padding: .4rem .25rem;
  border-top: 2px solid transparent;
  transition: color .15s, border-color .15s;
  min-width: 0;
}
.mobile-nav-item:hover, .mobile-nav-item.active {
  color: var(--primary); border-top-color: var(--primary);
}
.mobile-nav-item .mn-icon { font-size: 1.15rem; line-height: 1; }
.mobile-nav-item span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ════════════════════════════════════════
   MAIN CONTENT
   ════════════════════════════════════════ */
.main-content {
  flex: 1;
  margin-left: 0;
  padding: 1.25rem 1rem;
  min-height: calc(100vh - var(--navbar-h));
  /* Extra bottom padding on mobile for bottom nav */
  padding-bottom: calc(var(--mobile-nav) + 1rem);
}
@media (min-width: 900px) {
  .main-content {
    margin-left: var(--sidebar-w);
    padding: 1.5rem;
    padding-bottom: 1.5rem;
  }
}

/* ════════════════════════════════════════
   TYPOGRAPHY & UTILITIES
   ════════════════════════════════════════ */
.page-header {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.page-header h2 { font-size: 1.3rem; font-weight: 700; }
.text-muted  { color: var(--text-muted); font-size: .875rem; }
.text-center { text-align: center; }
.mt-4 { margin-top: 1.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-2 { margin-top: .5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: .5rem; }
.p-3  { padding: 1rem; }

/* ════════════════════════════════════════
   ALERTS
   ════════════════════════════════════════ */
.alert {
  padding: .85rem 1.1rem; border-radius: 8px;
  margin-bottom: 1rem; font-size: .875rem;
  display: flex; align-items: flex-start; gap: .5rem;
}
.alert-success { background: var(--success-lt); color: #14532d; border-left: 4px solid var(--success); }
.alert-error   { background: var(--danger-lt);  color: #7f1d1d; border-left: 4px solid var(--danger); }
.alert-info    { background: var(--info-lt);    color: #164e63; border-left: 4px solid var(--info); }
.alert-warning { background: var(--warning-lt); color: #78350f; border-left: 4px solid var(--warning); }

/* ════════════════════════════════════════
   CARDS
   ════════════════════════════════════════ */
.card {
  background: var(--card-bg); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .5rem;
  padding: .9rem 1.25rem; border-bottom: 1px solid var(--border);
}
.card-header h3 { font-size: .95rem; font-weight: 600; }
.card-body   { padding: 1.25rem; }
.card-footer { padding: .75rem 1.25rem; border-top: 1px solid var(--border); }

/* ════════════════════════════════════════
   STATS GRID
   ════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .75rem;
  margin-bottom: 1.25rem;
}
@media (min-width: 600px) {
  .stats-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
}
.stat-card {
  border-radius: var(--radius); padding: 1.1rem;
  display: flex; align-items: center; gap: .75rem;
  color: #fff; box-shadow: var(--shadow-md);
}
.stat-blue   { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.stat-green  { background: linear-gradient(135deg, #16a34a, #15803d); }
.stat-purple { background: linear-gradient(135deg, #7c3aed, #6d28d9); }
.stat-orange { background: linear-gradient(135deg, #d97706, #b45309); }
.stat-icon  { font-size: 1.75rem; flex-shrink: 0; }
.stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: .75rem; opacity: .85; margin-top: .2rem; }

/* ════════════════════════════════════════
   TABLES
   ════════════════════════════════════════ */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th, .table td { padding: .6rem .9rem; text-align: left; border-bottom: 1px solid var(--border); }
.table th { font-weight: 600; background: #f8fafc; white-space: nowrap; }
.table tbody tr:hover { background: #f8fafc; }
.table-sm td, .table-sm th { padding: .45rem .7rem; }

/* ════════════════════════════════════════
   BADGES
   ════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .2em .6em; border-radius: 20px;
  font-size: .72rem; font-weight: 600; white-space: nowrap;
}
.badge-success   { background: var(--success-lt); color: var(--success); }
.badge-warning   { background: var(--warning-lt); color: var(--warning); }
.badge-danger    { background: var(--danger-lt);  color: var(--danger); }
.badge-info      { background: var(--info-lt);    color: var(--info); }
.badge-primary   { background: var(--primary-lt); color: var(--primary); }
.badge-secondary { background: #f1f5f9; color: var(--secondary); }

/* Role badges */
.role-admin       { background: #fef3c7; color: #92400e; }
.role-teacher     { background: #dbeafe; color: #1e40af; }
.role-bus_incharge{ background: #dcfce7; color: #14532d; }
.role-gate        { background: #ede9fe; color: #4c1d95; }
.role-parent      { background: #fce7f3; color: #831843; }

/* ════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .35rem; padding: .5rem 1rem; border-radius: 7px;
  font-size: .875rem; font-weight: 600; cursor: pointer;
  text-decoration: none; border: 1px solid transparent;
  transition: background .15s, box-shadow .15s, transform .1s;
  white-space: nowrap; line-height: 1.4;
}
.btn:active { transform: scale(.97); }
.btn-sm     { padding: .35rem .75rem; font-size: .8rem; }
.btn-xs     { padding: .2rem .55rem; font-size: .75rem; }
.btn-block  { width: 100%; }
.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); }
.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-warning   { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #b45309; }
.btn-danger    { background: var(--danger);  color: #fff; }
.btn-danger:hover  { background: #b91c1c; }
.btn-outline   { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-ghost     { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover   { background: var(--bg); }

/* ════════════════════════════════════════
   FORMS
   ════════════════════════════════════════ */
.form-group { margin-bottom: 1rem; }
label { display: block; font-size: .82rem; font-weight: 600; color: var(--text); margin-bottom: .35rem; }
.form-control {
  width: 100%; padding: .55rem .85rem;
  border: 1px solid var(--border); border-radius: 7px;
  font-size: .9rem; font-family: inherit; color: var(--text);
  background: #fff; transition: border-color .15s, box-shadow .15s;
}
.form-control:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
select.form-control { cursor: pointer; }
.form-hint { font-size: .75rem; color: var(--text-muted); margin-top: .25rem; display: block; }
.input-group { position: relative; display: flex; }
.input-group .form-control { border-radius: 7px 0 0 7px; flex: 1; }
.input-toggle {
  padding: 0 .75rem; border: 1px solid var(--border); border-left: none;
  border-radius: 0 7px 7px 0; background: #f8fafc; cursor: pointer;
  font-size: 1rem; transition: background .15s;
}
.input-toggle:hover { background: #f1f5f9; }

/* Password strength meter */
.strength-bar-wrap {
  height: 5px; background: #e5e7eb; border-radius: 4px;
  margin-top: .5rem; overflow: hidden;
}
.strength-bar {
  height: 100%; width: 0; border-radius: 4px;
  transition: width .3s ease, background-color .3s ease;
}

/* ════════════════════════════════════════
   LOGIN PAGE
   ════════════════════════════════════════ */
.login-body {
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 40%, #7c3aed 100%);
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
}
.login-wrapper { width: 100%; display: flex; justify-content: center; }
.login-card {
  background: #fff; border-radius: 16px;
  padding: 2rem 1.75rem; width: 100%; max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.login-header { text-align: center; margin-bottom: 1.75rem; }
.login-icon { font-size: 2.5rem; margin-bottom: .5rem; }
.login-header h1 { font-size: 1.4rem; font-weight: 700; color: var(--primary); }
.login-header p  { font-size: .85rem; color: var(--text-muted); margin-top: .25rem; }
.login-footer { text-align: center; margin-top: 1.25rem; color: var(--text-muted); }

/* ════════════════════════════════════════
   STUDENT CARDS GRID
   ════════════════════════════════════════ */
.students-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 560px) {
  .students-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1100px) {
  .students-grid { grid-template-columns: repeat(3, 1fr); }
}

.student-card {
  background: #fff; border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  overflow: hidden;
}
.student-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1rem; border-bottom: 1px solid var(--border);
  gap: .5rem; flex-wrap: wrap;
}
.student-card-name { font-weight: 700; font-size: .95rem; }
.student-card-uid  { font-size: .75rem; color: var(--text-muted); }
.student-card-body { padding: .85rem 1rem; }
.student-card-meta { font-size: .8rem; color: var(--text-muted); margin-bottom: .75rem; }
.student-card-actions { display: flex; flex-wrap: wrap; gap: .4rem; padding: .75rem 1rem; border-top: 1px solid var(--border); }

/* ════════════════════════════════════════
   JOURNEY TIMELINE (Parent view)
   ════════════════════════════════════════ */
.journey-steps { display: flex; flex-direction: column; gap: 0; }
.journey-step {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .6rem 0; position: relative;
}
.journey-step:not(:last-child)::after {
  content: ''; position: absolute;
  left: 14px; top: 36px; bottom: -6px; width: 2px;
  background: var(--border);
}
.journey-step.done::after { background: var(--success); }
.step-icon {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem; flex-shrink: 0; border: 2px solid var(--border);
  background: #fff; position: relative; z-index: 1;
}
.journey-step.done .step-icon { border-color: var(--success); background: var(--success-lt); }
.step-info { flex: 1; min-width: 0; }
.step-label { font-size: .82rem; font-weight: 600; }
.step-time  { font-size: .72rem; color: var(--text-muted); margin-top: .1rem; }
.journey-step.pending .step-label { color: var(--text-muted); font-weight: 400; }

/* ════════════════════════════════════════
   TABS
   ════════════════════════════════════════ */
.tab-nav { display: flex; border-bottom: 2px solid var(--border); gap: .25rem; margin-bottom: 1.25rem; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tab-nav::-webkit-scrollbar { height: 0; }
.tab-btn {
  padding: .6rem 1.1rem; font-size: .875rem; font-weight: 600;
  border: none; background: none; cursor: pointer; color: var(--text-muted);
  border-bottom: 3px solid transparent; margin-bottom: -2px;
  white-space: nowrap; transition: color .15s, border-color .15s;
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ════════════════════════════════════════
   MODALS
   ════════════════════════════════════════ */
.modal {
  display: none; position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,.5); padding: 1rem;
  align-items: flex-start; justify-content: center;
  overflow-y: auto; padding-top: 5vh;
}
.modal.open { display: flex; }
.modal-box {
  background: #fff; border-radius: 14px; width: 100%; max-width: 520px;
  box-shadow: var(--shadow-lg); overflow: hidden;
  animation: slideUp .2s ease;
}
@keyframes slideUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:none; } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1rem; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--text-muted); line-height: 1; padding: .1rem .3rem; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 1.25rem; }
.modal-footer { padding: .85rem 1.25rem; border-top: 1px solid var(--border); display: flex; gap: .5rem; justify-content: flex-end; }

/* ════════════════════════════════════════
   OTP INPUT
   ════════════════════════════════════════ */
.otp-group { display: flex; gap: .5rem; justify-content: center; }
.otp-input {
  width: 54px; height: 62px; text-align: center; font-size: 1.5rem;
  font-weight: 700; border: 2px solid var(--border); border-radius: 10px;
  background: #fff; transition: border-color .15s, box-shadow .15s;
}
.otp-input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
@media (max-width: 400px) {
  .otp-input { width: 44px; height: 52px; font-size: 1.25rem; }
}

/* ════════════════════════════════════════
   CHANGE PASSWORD PAGE
   ════════════════════════════════════════ */
.change-pw-wrapper { display: flex; justify-content: center; }
.change-pw-card {
  max-width: 500px; width: 100%; padding: 1.75rem;
}
.pw-tips {
  background: var(--primary-lt); border-left: 4px solid var(--primary);
  border-radius: 8px; padding: .9rem 1.1rem; margin-bottom: 1.5rem;
}
.pw-tips h4  { font-size: .85rem; color: var(--primary); margin-bottom: .4rem; font-weight: 700; }
.pw-tips ul  { margin: 0; padding-left: 1.1rem; }
.pw-tips li  { font-size: .82rem; color: var(--text); margin-bottom: .2rem; }

/* ════════════════════════════════════════
   MISC
   ════════════════════════════════════════ */
.empty-state {
  text-align: center; padding: 3rem 1rem; color: var(--text-muted);
}
.empty-state p { font-size: .95rem; margin-top: .5rem; }
.divider { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }
.actions-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }

/* ════════════════════════════════════════
   AD CONTAINERS
   ════════════════════════════════════════ */
.ad-container {
  margin: 1.5rem 0; border-radius: var(--radius);
  overflow: hidden; background: #fff;
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.ad-label {
  font-size: .65rem; font-weight: 600; color: var(--text-muted);
  text-align: right; padding: .2rem .5rem;
  background: var(--bg); border-bottom: 1px solid var(--border);
  letter-spacing: .04em; text-transform: uppercase;
}
.ad-image-link { display: block; }
.ad-image { width: 100%; height: auto; display: block; max-height: 200px; object-fit: cover; }
.ad-script-wrap { padding: .5rem; }

.ad-pos-top    { order: -1; }
.ad-pos-bottom { margin-top: 2rem; }
.ad-pos-sidebar { /* handled by position context */ }

/* Role-specific mobile nav: only show items relevant to role */
.mobile-bottom-nav { padding-bottom: env(safe-area-inset-bottom, 0); }

/* ════════════════════════════════════════
   HANDOVER FEATURE
   ════════════════════════════════════════ */
.btn-handover {
  background: linear-gradient(135deg, #059669, #16a34a);
  color: #fff; border: none; border-radius: 8px;
  padding: .45rem .9rem; font-size: .8rem; font-weight: 600;
  cursor: pointer; text-decoration: none; display: inline-flex;
  align-items: center; gap: .35rem; transition: opacity .15s;
}
.btn-handover:hover { opacity: .88; }
