/* ==========================================================================
   AIRH Mobile Portal — Neumorphic Themes (Classic / Orange / Dark)
   ========================================================================== */

/* ---------------------------------------------------------------------------
   Theme Variables
   --------------------------------------------------------------------------- */
.mob-portal { --mob-bg: #e0e5ec; --mob-surface: #e0e5ec; --mob-text: #44476a; --mob-text2: #7b7f9e; --mob-text3: #a3a5c3; --mob-accent: #6c63ff; --mob-accent2: #a78bfa; --mob-success: #34d399; --mob-warn: #fbbf24; --mob-danger: #f87171; --mob-shadow-light: #ffffff; --mob-shadow-dark: #a3b1c6; --mob-card-bg: #e0e5ec; --mob-inset-bg: #d1d9e6; --mob-radius: 16px; --mob-radius-lg: 24px; --mob-radius-full: 50%; }
.mob-portal[data-mob-theme="orange"] { --mob-bg: #f5a623; --mob-surface: #f5a623; --mob-text: #fff; --mob-text2: rgba(255,255,255,.75); --mob-text3: rgba(255,255,255,.5); --mob-accent: #fff; --mob-accent2: rgba(255,255,255,.85); --mob-success: #fff; --mob-warn: #fff; --mob-danger: #fff; --mob-shadow-light: rgba(255,255,255,.35); --mob-shadow-dark: rgba(170,110,0,.35); --mob-card-bg: #f5a623; --mob-inset-bg: #e09518; }
.mob-portal[data-mob-theme="dark"] { --mob-bg: #1e1e2e; --mob-surface: #1e1e2e; --mob-text: #e0e0e8; --mob-text2: #8888a8; --mob-text3: #55557a; --mob-accent: #f5a623; --mob-accent2: #fbbf24; --mob-success: #34d399; --mob-warn: #fbbf24; --mob-danger: #f87171; --mob-shadow-light: rgba(255,255,255,.05); --mob-shadow-dark: rgba(0,0,0,.55); --mob-card-bg: #252538; --mob-inset-bg: #16162a; }

/* ---------------------------------------------------------------------------
   Base
   --------------------------------------------------------------------------- */
.mob-portal {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--mob-bg);
  font-family: 'Inter', -apple-system, sans-serif;
  color: var(--mob-text);
  overflow: hidden;
  display: flex; flex-direction: column;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* ---------------------------------------------------------------------------
   Neumorphic helpers
   --------------------------------------------------------------------------- */
.mob-neu-raised { box-shadow: 6px 6px 12px var(--mob-shadow-dark), -6px -6px 12px var(--mob-shadow-light); }
.mob-neu-raised-sm { box-shadow: 3px 3px 6px var(--mob-shadow-dark), -3px -3px 6px var(--mob-shadow-light); }
.mob-neu-inset { box-shadow: inset 3px 3px 6px var(--mob-shadow-dark), inset -3px -3px 6px var(--mob-shadow-light); }
.mob-neu-flat { box-shadow: 2px 2px 5px var(--mob-shadow-dark), -2px -2px 5px var(--mob-shadow-light); }

/* ---------------------------------------------------------------------------
   Form inputs (neumorphic)
   --------------------------------------------------------------------------- */
.mob-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: var(--mob-text);
  background: var(--mob-bg);
  box-shadow: inset 3px 3px 6px var(--mob-shadow-dark), inset -3px -3px 6px var(--mob-shadow-light);
  outline: none;
  transition: box-shadow 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}
.mob-input:focus {
  box-shadow: inset 3px 3px 6px var(--mob-shadow-dark), inset -3px -3px 6px var(--mob-shadow-light), 0 0 0 2px var(--mob-accent);
}
select.mob-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237b7f9e' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
textarea.mob-input {
  resize: none;
  min-height: 80px;
}
.mob-form-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--mob-text2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 8px;
}
.mob-form-group {
  margin-bottom: 16px;
}
.mob-form-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.mob-form-row > * {
  flex: 1;
}
.mob-btn-primary {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  background: var(--mob-accent);
  cursor: pointer;
  letter-spacing: 0.5px;
  box-shadow: 4px 4px 10px var(--mob-shadow-dark), -4px -4px 10px var(--mob-shadow-light);
  transition: transform 0.1s, box-shadow 0.2s;
}
.mob-btn-primary:active {
  transform: scale(0.98);
  box-shadow: inset 3px 3px 6px var(--mob-shadow-dark), inset -3px -3px 6px var(--mob-shadow-light);
}
.mob-btn-primary--danger {
  background: var(--mob-danger);
}
/* Inline editable inputs (inside info rows) */
.mob-input-inline {
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--mob-text3);
  color: var(--mob-text);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  padding: 4px 2px;
  text-align: right;
  outline: none;
  max-width: 140px;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.mob-input-inline:focus {
  border-bottom-color: var(--mob-accent);
}
select.mob-input-inline {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%237b7f9e' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
  padding-right: 14px;
  cursor: pointer;
}

.mob-btn-cancel {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--mob-text3);
  background: transparent;
  cursor: pointer;
  margin-top: 8px;
}

/* ---------------------------------------------------------------------------
   Top bar
   --------------------------------------------------------------------------- */
.mob-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 12px) + 8px) 20px 14px;
  flex-shrink: 0;
}
.mob-topbar__title { font-size: 18px; font-weight: 800; letter-spacing: -.3px; }
.mob-topbar__actions { display: flex; gap: 10px; }
.mob-topbar__btn {
  width: 38px; height: 38px; border-radius: var(--mob-radius-full);
  background: var(--mob-surface); border: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--mob-text2); cursor: pointer;
  transition: all .2s;
}
.mob-topbar__btn:active { box-shadow: inset 2px 2px 5px var(--mob-shadow-dark), inset -2px -2px 5px var(--mob-shadow-light); }
.mob-topbar__btn svg { width: 18px; height: 18px; }

/* ---------------------------------------------------------------------------
   Page content area
   --------------------------------------------------------------------------- */
.mob-page {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 8px 20px 100px;
  scroll-behavior: smooth;
}
.mob-page::-webkit-scrollbar { display: none; }

/* ---------------------------------------------------------------------------
   Tab nav (bottom)
   --------------------------------------------------------------------------- */
.mob-tabnav {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-around;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0));
  background: var(--mob-surface); z-index: 10;
}
.mob-tabnav::before {
  content: ''; position: absolute; top: 0; left: 20px; right: 20px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--mob-shadow-dark), transparent); opacity: .15;
}
.mob-tabnav__item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: none; cursor: pointer;
  color: var(--mob-text3); font-size: 10px; font-weight: 600;
  padding: 6px 12px; border-radius: 14px;
  transition: all .25s;
  -webkit-tap-highlight-color: transparent;
}
.mob-tabnav__item svg { width: 22px; height: 22px; transition: transform .25s; }
.mob-tabnav__item.is-active { color: var(--mob-accent); }
.mob-tabnav__item.is-active svg { transform: scale(1.15); }

/* ---------------------------------------------------------------------------
   Profile card
   --------------------------------------------------------------------------- */
.mob-profile {
  display: flex; flex-direction: column; align-items: center;
  padding: 24px 0 16px; gap: 14px;
}
.mob-profile__avatar {
  width: 90px; height: 90px; border-radius: var(--mob-radius-full);
  background: var(--mob-surface); display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 800; color: var(--mob-accent);
  overflow: hidden;
}
.mob-profile__avatar img { width: 100%; height: 100%; object-fit: cover; }
.mob-profile__name { font-size: 22px; font-weight: 800; text-align: center; }
.mob-profile__sub { font-size: 13px; color: var(--mob-text2); text-align: center; }

/* ---------------------------------------------------------------------------
   Info card / row
   --------------------------------------------------------------------------- */
.mob-card {
  background: var(--mob-card-bg); border-radius: var(--mob-radius);
  padding: 16px; margin-bottom: 14px;
}
.mob-card__title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; color: var(--mob-text3); margin-bottom: 12px;
}
.mob-info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border-radius: 12px; margin-bottom: 6px;
  background: var(--mob-surface);
}
.mob-info-row:last-child { margin-bottom: 0; }
.mob-info-row__label { font-size: 13px; color: var(--mob-text2); }
.mob-info-row__value { font-size: 13px; font-weight: 700; color: var(--mob-text); text-align: right; max-width: 55%; word-break: break-word; }

/* ---------------------------------------------------------------------------
   Habilitation / EPI item
   --------------------------------------------------------------------------- */
.mob-hab-item, .mob-epi-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 14px;
  background: var(--mob-surface); margin-bottom: 8px;
  transition: all .2s;
}
.mob-hab-item:active, .mob-epi-item:active { transform: scale(.98); }

.mob-item-icon {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.mob-item-icon--valid { background: rgba(52,211,153,.15); color: var(--mob-success); }
.mob-item-icon--warn { background: rgba(251,191,36,.15); color: var(--mob-warn); }
.mob-item-icon--danger { background: rgba(248,113,113,.15); color: var(--mob-danger); }

.mob-item-body { flex: 1; min-width: 0; }
.mob-item-body__name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mob-item-body__sub { font-size: 11px; color: var(--mob-text2); margin-top: 2px; }

.mob-item-badge {
  font-size: 10px; font-weight: 800; padding: 3px 10px; border-radius: 20px;
  white-space: nowrap; flex-shrink: 0;
}
.mob-item-badge--valid { background: rgba(52,211,153,.15); color: #059669; }
.mob-item-badge--warn { background: rgba(251,191,36,.15); color: #d97706; }
.mob-item-badge--danger { background: rgba(248,113,113,.15); color: #dc2626; }
.mob-portal[data-mob-theme="dark"] .mob-item-badge--valid { color: #34d399; }
.mob-portal[data-mob-theme="dark"] .mob-item-badge--warn { color: #fbbf24; }
.mob-portal[data-mob-theme="dark"] .mob-item-badge--danger { color: #f87171; }

/* ---------------------------------------------------------------------------
   Clock / Pointage
   --------------------------------------------------------------------------- */
.mob-clock { display: flex; flex-direction: column; align-items: center; padding: 20px 0; }
.mob-clock__time { font-size: 56px; font-weight: 800; letter-spacing: -2px; font-variant-numeric: tabular-nums; }
.mob-clock__date { font-size: 14px; color: var(--mob-text2); margin-top: 4px; font-weight: 600; }
.mob-clock__status {
  margin-top: 16px; font-size: 13px; font-weight: 700;
  padding: 6px 18px; border-radius: 20px;
}
.mob-clock__status--in { background: rgba(52,211,153,.15); color: #059669; }
.mob-clock__status--out { background: var(--mob-inset-bg); color: var(--mob-text3); }
.mob-portal[data-mob-theme="dark"] .mob-clock__status--in { color: #34d399; }

.mob-clock__btn-wrap { margin-top: 28px; position: relative; }
.mob-clock__btn {
  width: 130px; height: 130px; border-radius: var(--mob-radius-full);
  background: var(--mob-surface); border: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; cursor: pointer;
  transition: all .15s; color: var(--mob-accent);
}
.mob-clock__btn:active { box-shadow: inset 4px 4px 10px var(--mob-shadow-dark), inset -4px -4px 10px var(--mob-shadow-light); transform: scale(.97); }
.mob-clock__btn svg { width: 36px; height: 36px; }
.mob-clock__btn span { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; }

.mob-clock__btn--out { color: var(--mob-danger); }

/* Pulse ring */
.mob-clock__pulse {
  position: absolute; inset: -12px; border-radius: var(--mob-radius-full);
  border: 2px solid var(--mob-accent); opacity: 0;
  animation: mob-pulse 2s ease-out infinite;
  pointer-events: none;
}
@keyframes mob-pulse { 0% { transform: scale(.9); opacity: .6; } 100% { transform: scale(1.15); opacity: 0; } }

.mob-clock__worked {
  margin-top: 24px; text-align: center;
}
.mob-clock__worked-label { font-size: 11px; color: var(--mob-text3); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.mob-clock__worked-time { font-size: 28px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }

.mob-today-entries { margin-top: 20px; width: 100%; }
.mob-entry-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 12px; margin-bottom: 6px;
  background: var(--mob-surface);
}
.mob-entry-dot { width: 8px; height: 8px; border-radius: var(--mob-radius-full); flex-shrink: 0; }
.mob-entry-dot--open { background: var(--mob-success); box-shadow: 0 0 6px rgba(52,211,153,.5); }
.mob-entry-dot--closed { background: var(--mob-text3); }
.mob-entry-info { flex: 1; }
.mob-entry-info__site { font-size: 13px; font-weight: 700; }
.mob-entry-info__time { font-size: 11px; color: var(--mob-text2); }
.mob-entry-info__dur { font-size: 12px; font-weight: 700; color: var(--mob-accent); }

/* ---------------------------------------------------------------------------
   Bottom sheet (mobile portal version)
   --------------------------------------------------------------------------- */
.mob-sheet-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.35);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  z-index: 100; opacity: 0; visibility: hidden;
  transition: opacity .3s, visibility .3s;
}
.mob-sheet-overlay.is-open { opacity: 1; visibility: visible; }

.mob-sheet {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 101;
  background: var(--mob-surface); border-radius: 24px 24px 0 0;
  transform: translateY(100%); transition: transform .35s cubic-bezier(.32,.72,0,1);
  max-height: 85vh; display: flex; flex-direction: column;
}
.mob-sheet.is-open { transform: translateY(0); }

.mob-sheet__handle {
  display: flex; justify-content: center; padding: 10px 0 4px;
}
.mob-sheet__pill {
  width: 36px; height: 4px; border-radius: 4px;
  background: var(--mob-text3); opacity: .4;
}
.mob-sheet__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 20px 12px;
}
.mob-sheet__title { font-size: 17px; font-weight: 800; }
.mob-sheet__close {
  width: 30px; height: 30px; border-radius: var(--mob-radius-full);
  background: var(--mob-surface); border: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--mob-text2); cursor: pointer;
}
.mob-sheet__body {
  flex: 1; overflow-y: auto; padding: 0 20px 24px;
  -webkit-overflow-scrolling: touch;
}

/* ---------------------------------------------------------------------------
   Theme switcher
   --------------------------------------------------------------------------- */
.mob-theme-switch {
  display: flex; gap: 8px; padding: 4px; border-radius: 14px;
  background: var(--mob-inset-bg);
}
.mob-theme-switch__opt {
  width: 28px; height: 28px; border-radius: 10px;
  border: 2px solid transparent; cursor: pointer;
  transition: all .2s;
}
.mob-theme-switch__opt:hover { transform: scale(1.1); }
.mob-theme-switch__opt.is-active { border-color: var(--mob-text); box-shadow: 0 0 0 2px var(--mob-shadow-light); }
.mob-theme-switch__opt--classic { background: #e0e5ec; }
.mob-theme-switch__opt--orange { background: #f5a623; }
.mob-theme-switch__opt--dark { background: #1e1e2e; }

/* ---------------------------------------------------------------------------
   Empty state
   --------------------------------------------------------------------------- */
.mob-empty { text-align: center; padding: 32px 16px; color: var(--mob-text3); font-size: 13px; font-weight: 600; }

/* ---------------------------------------------------------------------------
   Section count badge
   --------------------------------------------------------------------------- */
.mob-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; border-radius: 10px; padding: 0 6px;
  font-size: 11px; font-weight: 800; background: var(--mob-accent); color: var(--mob-bg);
  margin-left: 6px;
}
.mob-portal[data-mob-theme="orange"] .mob-count { background: rgba(255,255,255,.3); color: #fff; }

/* ---------------------------------------------------------------------------
   Skeleton
   --------------------------------------------------------------------------- */
.mob-skeleton { background: var(--mob-inset-bg); border-radius: 12px; animation: mob-skel 1.2s ease-in-out infinite alternate; }
@keyframes mob-skel { from { opacity: .5; } to { opacity: 1; } }
