/* Duhaa RWT mobile pages - UI v4 (same brand as the admin UI: blue gradient, white cards,
   Noto Sans Arabic). Loaded last by the rwt_*.html templates. */
:root {
  --rwt-font: "Noto Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  --rwt-primary: #0a5bd6;
  --rwt-primary-700: #0046ad;
  --rwt-primary-50: #eef4ff;
  --rwt-navy: #001f3f;
  --rwt-bg: #f5f7fb;
  --rwt-border: #e6ebf2;
  --rwt-input-border: #dbe3ee;
  --rwt-text: #1e293b;
  --rwt-muted: #64748b;
  --rwt-grad: linear-gradient(150deg, #0a55c8 0%, #0046ad 55%, #0b3a8a 100%);
}

html { background: var(--rwt-bg); }

body {
  min-height: 100vh;
  background: var(--rwt-bg) !important;
  color: var(--rwt-text) !important;
  font-family: var(--rwt-font) !important;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .btn, .form-control, .form-select, input, select, textarea, button { font-family: var(--rwt-font) !important; }

/* Page headers */
.hero, .top, .rwt-hero {
  position: relative;
  overflow: hidden;
  background: var(--rwt-grad) !important;
  color: #fff !important;
  border-radius: 0 0 28px 28px !important;
  padding-top: max(22px, env(safe-area-inset-top)) !important;
  box-shadow: 0 14px 34px rgba(0, 70, 173, .22) !important;
}

.hero::after, .top::after, .rwt-hero::after {
  content: "";
  position: absolute;
  inset-inline-end: -70px;
  bottom: -110px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  pointer-events: none;
}

.rwt-hero::before { display: none; }

.hero h1, .hero h2, .hero h3, .hero h4, .top h1, .top h2, .top h3, .top h4 { color: #fff !important; font-weight: 800 !important; }
.hero .text-white-50, .top .text-white-50, .hero .small, .top .small { color: rgba(255, 255, 255, .78) !important; }

.avatar {
  border: 3px solid rgba(255, 255, 255, .55) !important;
  border-radius: 22px !important;
  background: #fff !important;
  box-shadow: 0 10px 26px rgba(0, 20, 60, .25) !important;
}

/* Cards */
.card, .cardx, .rwt-card, .metric {
  border: 1px solid var(--rwt-border) !important;
  border-radius: 18px !important;
  background: #fff !important;
  box-shadow: 0 6px 20px rgba(15, 23, 42, .06) !important;
  overflow: hidden;
}

.metric { min-height: 88px; display: flex; flex-direction: column; justify-content: center; }
.metric b { color: var(--rwt-navy) !important; font-weight: 800; }
.label, .small-muted, .install-tip { color: var(--rwt-muted) !important; }
.value { color: var(--rwt-text) !important; font-weight: 700; }

.border.rounded-4.p-3.mb-2.bg-white {
  border-color: var(--rwt-border) !important;
  border-radius: 14px !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .04);
}

/* Forms */
.form-label { font-weight: 700; color: var(--rwt-text); font-size: 14px; }

.form-control, .form-select {
  min-height: 50px !important;
  border: 1px solid var(--rwt-input-border) !important;
  border-radius: 14px !important;
  background-color: #f8fafc !important;
  color: var(--rwt-text) !important;
  font-size: 15px;
}

.form-control:focus, .form-select:focus {
  border-color: var(--rwt-primary) !important;
  background-color: #fff !important;
  box-shadow: 0 0 0 3px rgba(10, 91, 214, .12) !important;
}

.form-check-input:checked { background-color: var(--rwt-primary) !important; border-color: var(--rwt-primary) !important; }

/* Buttons */
.btn { min-height: 48px; border-radius: 14px !important; font-weight: 700 !important; }

.btn-primary, .btn-success, .btn-dark {
  background: linear-gradient(135deg, #0a5bd6, #0046ad) !important;
  border: 0 !important;
  color: #fff !important;
  box-shadow: 0 10px 22px rgba(0, 70, 173, .22) !important;
}

.btn-danger { background: #dc2626 !important; border: 0 !important; color: #fff !important; }
.btn-outline-danger { background: #fff !important; border: 1px solid #fecaca !important; color: #b91c1c !important; }
.btn-outline-secondary, .btn-outline-dark, .btn-secondary {
  background: #fff !important;
  border: 1px solid var(--rwt-border) !important;
  color: #475569 !important;
}
.btn-outline-primary { background: #fff !important; border: 1px solid #bfd4f6 !important; color: var(--rwt-primary-700) !important; }
.btn-light { background: rgba(255, 255, 255, .95) !important; border: 1px solid rgba(255, 255, 255, .7) !important; color: var(--rwt-primary-700) !important; }

.gpsbox, .gps-box {
  background: var(--rwt-primary-50) !important;
  border: 1px solid #cfe0fb !important;
  border-radius: 14px !important;
  color: #1e40af !important;
}

.alert { border-radius: 14px !important; font-size: 14px; }
.badge, .request-badge { border-radius: 999px !important; padding: .45rem .75rem !important; font-weight: 600 !important; }

/* Employee login page */
body.rwt-login-v2 { background: var(--rwt-bg) !important; }
.rwt-hero { padding-bottom: 110px !important; border-radius: 0 0 32px 32px !important; }
.rwt-logo { border-radius: 20px !important; box-shadow: 0 12px 28px rgba(0, 20, 60, .28) !important; }
.rwt-brand h1 { font-weight: 800 !important; }
.rwt-card { border-radius: 22px !important; box-shadow: 0 20px 50px rgba(0, 31, 63, .12) !important; }
.rwt-card-title .icon { background: var(--rwt-primary-50) !important; color: var(--rwt-primary) !important; border-radius: 16px !important; }
.rwt-card-title h2 { color: var(--rwt-navy); font-weight: 800 !important; }
.rwt-input { height: 54px !important; border-radius: 14px !important; border-color: var(--rwt-input-border) !important; background: #f8fafc !important; font-family: var(--rwt-font) !important; }
.rwt-input:focus { border-color: var(--rwt-primary) !important; box-shadow: 0 0 0 3px rgba(10, 91, 214, .12) !important; background: #fff !important; }
.rwt-login-btn {
  height: 54px !important;
  border-radius: 14px !important;
  background: linear-gradient(135deg, #0a5bd6, #0046ad) !important;
  font-family: var(--rwt-font) !important;
  font-weight: 700 !important;
  box-shadow: 0 12px 26px rgba(0, 70, 173, .26) !important;
}
.rwt-install { border-color: var(--rwt-border) !important; border-radius: 18px !important; }
.rwt-install-icon { background: var(--rwt-primary-50) !important; color: var(--rwt-primary) !important; }
.rwt-install button { background: var(--rwt-navy) !important; border-radius: 12px !important; font-family: var(--rwt-font) !important; }

@media (min-width: 900px) {
  .rwt-hero { background: var(--rwt-grad) !important; border-radius: 0 !important; padding-bottom: 60px !important; }
}

main.container { padding-bottom: calc(28px + env(safe-area-inset-bottom)) !important; }

@media (max-width: 480px) {
  .hero, .top { border-radius: 0 0 24px 24px !important; }
  .card-body { padding: 16px !important; }
  .avatar { width: 80px !important; height: 80px !important; }
}

/* ---- Employee portal v4.1: shared layout of rwt_base.html ---- */
.rwt-wrap { max-width: 640px; margin: 0 auto; padding-inline: 16px; }
.rwt-top { padding-bottom: 26px !important; }
.rwt-main { padding-top: 18px; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.rwt-page-title { font-size: 21px; font-weight: 800; margin: 0 0 4px; color: #fff; }
.rwt-section-title { font-size: 16px; font-weight: 800; color: var(--rwt-navy); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.rwt-section-title i { color: var(--rwt-primary); }

.rwt-profile { display: flex; align-items: center; gap: 14px; }
.rwt-profile-text { flex: 1; min-width: 0; }
.rwt-name { font-size: 20px; font-weight: 800; margin: 2px 0; color: #fff; overflow-wrap: anywhere; }
.rwt-avatar { width: 64px; height: 64px; flex: 0 0 64px; border-radius: 18px; overflow: hidden; background: #fff; display: grid; place-items: center; color: var(--rwt-primary); font-size: 34px; border: 3px solid rgba(255, 255, 255, .55); }
.rwt-avatar img { width: 100%; height: 100%; object-fit: cover; }
.rwt-icon-btn { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .16); color: #fff; font-size: 20px; text-decoration: none; }
.rwt-icon-btn:hover { background: rgba(255, 255, 255, .26); color: #fff; }

/* Attendance card: the state decides the colour and the only button offered */
.rwt-attend { border-top: 4px solid #94a3b8 !important; }
.rwt-attend.is-in { border-top-color: #16a34a !important; }
.rwt-state { font-size: 13px; font-weight: 700; padding: 4px 12px; border-radius: 999px; background: #f1f5f9; color: #475569; }
.rwt-attend.is-in .rwt-state { background: #dcfce7; color: #166534; }
.rwt-state i { font-size: 8px; vertical-align: middle; }
.rwt-clock { font-size: 40px; font-weight: 800; color: var(--rwt-navy); text-align: center; margin: 10px 0 2px; letter-spacing: 1px; }
.rwt-attend-info { text-align: center; font-size: 14px; color: var(--rwt-muted); margin-bottom: 14px; }
.rwt-gps { display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 10px; font-size: 14px; }
.rwt-gps.is-error { background: #fef2f2 !important; border-color: #fecaca !important; color: #b91c1c !important; }
.rwt-camera { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 64px; margin-bottom: 10px; padding: 10px; border: 2px dashed #bfd4f6; border-radius: 14px; background: #f8fbff; color: var(--rwt-primary-700); font-weight: 700; cursor: pointer; text-align: center; }
.rwt-camera img { width: 56px; height: 56px; object-fit: cover; border-radius: 12px; }
.rwt-attach { min-height: 54px; font-weight: 600; font-size: 14px; }
.rwt-attend .btn-lg { min-height: 58px; font-size: 18px; }
.rwt-attend .btn-success { background: linear-gradient(135deg, #16a34a, #15803d) !important; box-shadow: 0 10px 22px rgba(22, 163, 74, .25) !important; }

.rwt-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rwt-stats .metric { padding: 14px; }
.rwt-stats .metric b { font-size: 18px; }
.rwt-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid #eef2f7; }
.rwt-row:last-child { border-bottom: 0; }

/* Requests and attendance history */
.rwt-request .card-body { padding: 14px 16px !important; }
.rwt-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rwt-facts span { background: #f1f5f9; border-radius: 999px; padding: 4px 10px; font-size: 12.5px; color: #334155; }
.rwt-reason { margin-top: 10px; font-size: 14px; color: #334155; white-space: pre-line; }
.rwt-decision { margin-top: 10px; padding: 8px 12px; border-radius: 12px; background: var(--rwt-primary-50); color: #1e3a8a; font-size: 13.5px; }
.rwt-day { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid #eef2f7; }
.rwt-day:last-child { border-bottom: 0; }
.rwt-day-date { flex: 0 0 92px; font-weight: 700; font-size: 13px; color: var(--rwt-navy); }
.rwt-day-punches { display: flex; flex-wrap: wrap; gap: 6px; }
.rwt-punch { font-size: 12.5px; border-radius: 999px; padding: 3px 10px; }
.rwt-punch.is-in { background: #dcfce7; color: #166534; }
.rwt-punch.is-out { background: #fee2e2; color: #991b1b; }

/* Request form */
.rwt-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rwt-type input { position: absolute; opacity: 0; pointer-events: none; }
.rwt-type span { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border: 1px solid var(--rwt-input-border); border-radius: 14px; background: #f8fafc; font-weight: 700; font-size: 13px; color: #475569; cursor: pointer; }
.rwt-type span i { font-size: 20px; color: var(--rwt-muted); }
.rwt-type input:checked + span { border-color: var(--rwt-primary); background: var(--rwt-primary-50); color: var(--rwt-primary-700); box-shadow: 0 0 0 2px rgba(10, 91, 214, .15); }
.rwt-type input:checked + span i { color: var(--rwt-primary); }
.rwt-type input:focus-visible + span { outline: 2px solid var(--rwt-primary); }
.rwt-hint { font-size: 13px; color: #475569; background: #f8fafc; border-radius: 12px; padding: 8px 12px; }

/* Bottom navigation, like a phone app */
.rwt-tabbar { position: fixed; inset-inline: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border-top: 1px solid var(--rwt-border); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -6px 20px rgba(15, 23, 42, .06); }
.rwt-tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 10px; font-size: 12px; font-weight: 700; color: #64748b; text-decoration: none; }
.rwt-tabbar a i { font-size: 21px; }
.rwt-tabbar a.is-active { color: var(--rwt-primary); }
@media (min-width: 700px) { .rwt-tabbar { max-width: 640px; margin: 0 auto; border-radius: 16px 16px 0 0; } }
