/* ===================== Base / layout (mobile only) ===================== */
:root {
  --brand: #0d6efd;
  --brand-dark: #0b5ed7;
  --ok: #28a745;
  --bg: #f4f6f9;
  --bottom-nav-h: 62px;
}

html, body {
  background: var(--bg);
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

body {
  padding-bottom: calc(var(--bottom-nav-h) + 12px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.app-navbar {
  background: var(--brand);
}

.app-main {
  padding: 10px 12px 16px;
}

/* ===================== Bottom nav ===================== */
.app-bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  max-width: 480px;
  margin: 0 auto;
  height: var(--bottom-nav-h);
  background: #fff;
  border-top: 1px solid #e2e5e9;
  display: flex;
  z-index: 1030;
  box-shadow: 0 -2px 8px rgba(0,0,0,.05);
}
.app-bottom-nav .nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #8a94a6;
  text-decoration: none;
  font-size: .72rem;
}
.app-bottom-nav .nav-item i { font-size: 1.15rem; }
.app-bottom-nav .nav-item.active { color: var(--brand); font-weight: 600; }

/* ===================== Date scroll strip ===================== */
.date-scroll {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  gap: 8px;
  padding: 4px 2px 12px;
  scrollbar-width: none;
}
.date-scroll::-webkit-scrollbar { display: none; }

.date-item {
  scroll-snap-align: center;
  flex: 0 0 30%;
  text-align: center;
  padding: 10px 4px;
  border-radius: 14px;
  background: #fff;
  color: #45505c;
  text-decoration: none;
  border: 2px solid transparent;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.date-item .dow {
  display: block;
  font-size: .72rem;
  text-transform: uppercase;
  opacity: .7;
}
.date-item .dnum {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.3;
}
.date-item .dmon {
  display: block;
  font-size: .65rem;
  opacity: .6;
}
.date-item.is-today:not(.active) {
  border-color: var(--brand);
}
.date-item.active {
  background: var(--brand);
  color: #fff;
}

.selected-date-banner {
  text-align: center;
  font-size: .95rem;
  color: #45505c;
  margin-bottom: 8px;
}
.selected-date-banner .lock-note {
  font-size: .78rem;
  color: #d9822b;
}

/* ===================== Attendance grid ===================== */
.attend-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 6px;
  font-size: .7rem;
  color: #8a94a6;
  text-transform: uppercase;
  font-weight: 600;
}
.attend-header .shift-cols {
  display: flex;
  gap: 6px;
}
.attend-header .shift-col {
  width: 44px;
  text-align: center;
}

.attend-list {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.attend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid #f0f1f3;
}
.attend-row:last-child { border-bottom: none; }

.attend-name {
  font-size: .95rem;
  font-weight: 500;
  color: #2b3440;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex: 1;
  min-width: 0;
}
.attend-name .avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #e7edff;
  color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
  font-weight: 700;
  flex-shrink: 0;
}
.attend-name .name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attend-name .name-chev {
  font-size: .68rem;
  color: #c3c9d1;
  flex-shrink: 0;
}

.shift-group {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.attend-box {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 12px;
  border: 2px solid #d7dce2;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: transparent;
  transition: all .15s ease;
}
.attend-box.checked {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.attend-box.locked {
  opacity: .55;
  background: #f1f2f4;
}
.attend-box:not(.locked) {
  cursor: pointer;
}
.attend-box:not(.locked):active {
  transform: scale(0.92);
}

.empty-state {
  text-align: center;
  color: #8a94a6;
  padding: 40px 16px;
}
.empty-state i { font-size: 2.2rem; margin-bottom: 10px; display: block; }

/* ===================== Employees list ===================== */
.employee-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.employee-card .stats {
  font-size: .78rem;
  color: #8a94a6;
  margin-top: 2px;
}
.employee-card .stats b { color: var(--brand); }
.employee-card .chev { color: #c3c9d1; }

.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #2b3440;
  margin: 4px 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ===================== Stat cards (employee detail) ===================== */
.stat-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.stat-card {
  flex: 1;
  background: #fff;
  border-radius: 14px;
  padding: 10px 6px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.stat-card .num { font-size: 1.3rem; font-weight: 700; }
.stat-card .lbl { font-size: .68rem; color: #8a94a6; margin-top: 2px; }
.stat-card.ok .num { color: var(--ok); }
.stat-card.off .num { color: #dc3545; }
.stat-card.warn .num { color: #adb5bd; }

/* ===================== Month calendar ===================== */
.month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.month-nav a { color: var(--brand); font-size: 1.1rem; }
.month-nav .title { font-weight: 700; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  background: #fff;
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.cal-dow {
  text-align: center;
  font-size: .68rem;
  color: #8a94a6;
  font-weight: 600;
  padding-bottom: 4px;
}
.cal-cell {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: .82rem;
  color: #2b3440;
  background: #f4f6f9;
  position: relative;
}
.cal-cell.pad { background: transparent; }
.cal-cell.present { background: var(--ok); color: #fff; font-weight: 700; }
.cal-cell.half { background: #ffe1a8; color: #8a5a00; font-weight: 700; }
.cal-cell.absent { background: #f8d7da; color: #a71d2a; }
.cal-cell.future { background: #f4f6f9; color: #c3c9d1; }
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--brand); }

.legend {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin: 10px 0 4px;
  font-size: .74rem;
  color: #6b7480;
}
.legend .dot {
  width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 4px;
}
.legend .dot.present { background: var(--ok); }
.legend .dot.half { background: #ffe1a8; }
.legend .dot.absent { background: #f8d7da; }

/* ===================== Modal / form ===================== */
.btn-brand {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn-brand:hover, .btn-brand:active {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
}
