/* ==========================================================================
   Gurvia CRM — Tablet / iPad Responsive Template
   Design tokens extracted from Gurvia MobileApp.svg
   ========================================================================== */

:root {
  --g-teal: #3c9d9b;
  --g-teal-600: #318786;
  --g-teal-300: #4badab;
  --g-teal-100: #dff0ef;
  --g-green: #52de97;
  --g-navy: #394a6d;
  --g-navy-700: #2b3855;
  --g-muted: #97adac;
  --g-soft: #f0f5f5;
  --g-line: #e3ecec;
  --g-card: #ffffff;
  --g-ink: #2b3855;
  --g-sub: #6a7a87;

  --c-orange: #e96948;
  --c-yellow: #fedf97;
  --c-pink: #f28aa1;
  --c-purple: #8e7ab5;
  --c-blue: #4e73c4;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  --shadow-sm: 0 2px 6px rgba(57, 74, 109, 0.06);
  --shadow-md: 0 8px 24px rgba(57, 74, 109, 0.08);
  --shadow-lg: 0 18px 40px rgba(57, 74, 109, 0.10);

  --font-display: "Urbanist", "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --font-body: "Urbanist", "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --safe-top: max(0px, env(safe-area-inset-top));
  --safe-bottom: max(0px, env(safe-area-inset-bottom));
  --safe-left: max(0px, env(safe-area-inset-left));
  --safe-right: max(0px, env(safe-area-inset-right));

  --side-w: 228px;
  --side-w-collapsed: 80px;
  --transition-duration: 300ms;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  color: var(--g-ink);
  background: var(--g-soft);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
}

a { color: inherit; text-decoration: none; }

/* ========================= App shell ========================= */
.g-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  transition: grid-template-columns var(--transition-duration) ease;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

.g-app.is-collapsed {
  grid-template-columns: var(--side-w-collapsed) 1fr;
}

/* ========================= Sidebar ========================= */
.g-side {
  position: sticky;
  top: var(--safe-top);
  height: calc(100vh - var(--safe-top) - var(--safe-bottom));
  background: var(--g-card);
  border-right: 1px solid var(--g-line);
  display: flex;
  flex-direction: column;
  padding: 22px 16px 20px;
  z-index: 20;
  transition: width var(--transition-duration) ease;
  width: var(--side-w);
  overflow: hidden;
}

.g-side.is-collapsed {
  width: var(--side-w-collapsed);
}

.g-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 8px 20px;
  border-bottom: 2px solid var(--g-teal);
  margin-bottom: 18px;
  transition: padding var(--transition-duration) ease;
  position: relative;
  min-height: 64px;
}
.g-brand__logo {
  transition: opacity var(--transition-duration) ease;
}
.g-brand__logo--expand {
  width: 120px;
  height: auto;
  opacity: 1;
}
.g-brand__logo--collapse {
  width: 40px;
  height: auto;
  opacity: 0;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.g-side.is-collapsed .g-brand {
  padding: 12px 8px 20px;
  justify-content: center;
}

.g-side.is-collapsed .g-brand__logo--expand {
  opacity: 0;
}

.g-side.is-collapsed .g-brand__logo--collapse {
  opacity: 1;
}

.g-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.g-nav a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  color: var(--g-navy);
  font-weight: 600;
  font-size: 15px;
  transition: background-color .2s ease, color .2s ease, transform .2s ease, padding var(--transition-duration) ease, justify-content var(--transition-duration) ease;
  position: relative;
}
.g-nav a i {
  width: 22px;
  font-size: 17px;
  color: var(--g-teal);
  text-align: center;
  flex-shrink: 0;
  transition: color .2s ease;
}
.g-nav a span {
  transition: opacity var(--transition-duration) ease, transform var(--transition-duration) ease;
  white-space: nowrap;
}
.g-nav a:hover {
  background: var(--g-teal-100);
  color: var(--g-navy-700);
}
.g-nav a.active {
  background: linear-gradient(90deg, var(--g-teal) 0%, var(--g-teal-300) 100%);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.g-nav a.active i { color: #fff; }

.g-side.is-collapsed .g-nav a {
  padding: 11px 8px;
  justify-content: center;
}

.g-side.is-collapsed .g-nav a span {
  opacity: 0;
  transform: translateX(-10px);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateX(-10px) translateY(-50%);
  background: var(--g-navy);
  color: #fff;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  z-index: 1000;
  box-shadow: var(--shadow-md);
}

.g-side.is-collapsed .g-nav a:hover span {
  opacity: 1;
  transform: translateX(10px) translateY(-50%);
}

.g-side__foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.g-sync-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--g-teal) 0%, var(--g-teal-300) 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.g-sync-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}
.g-sync-btn:hover::before {
  left: 100%;
}
.g-sync-btn:hover { 
  transform: translateY(-2px); 
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 255, 255, 0.4);
}
.g-sync-btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}
.g-sync-btn i { 
  font-size: 15px; 
  transition: font-size var(--transition-duration) ease;
  z-index: 1;
  position: relative;
}
.g-sync-btn span {
  transition: opacity var(--transition-duration) ease, transform var(--transition-duration) ease;
  white-space: nowrap;
  z-index: 1;
  position: relative;
}
.g-sync-meta {
  font-size: 11.5px;
  color: var(--g-muted);
  text-align: center;
  font-weight: 500;
  transition: opacity var(--transition-duration) ease;
}

.g-side.is-collapsed .g-sync-btn {
  padding: 12px;
  border-radius: 12px;
  width: 48px;
  height: 48px;
  position: relative;
}

.g-side.is-collapsed .g-sync-btn span {
  opacity: 0;
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateX(-10px) translateY(-50%);
  background: var(--g-navy);
  color: #fff;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  z-index: 1000;
  box-shadow: var(--shadow-md);
}

.g-side.is-collapsed .g-sync-btn:hover span {
  opacity: 1;
  transform: translateX(10px) translateY(-50%);
}

.g-side.is-collapsed .g-sync-meta {
  opacity: 0;
}

/* ========================= Main area ========================= */
.g-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.g-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(240, 245, 245, 0.85);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--g-line);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.g-topbar__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--g-card);
  border: 1px solid var(--g-line);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  color: var(--g-navy);
  font-size: 18px;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
.g-topbar__toggle:hover {
  background: var(--g-teal-100);
  color: var(--g-navy-700);
}
.g-topbar__title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--g-navy);
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin: 0;
}
.g-topbar__title small {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--g-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 2px;
}
.g-topbar__spacer { flex: 1; }
.g-topbar__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--g-card);
  border: 1px solid var(--g-line);
  color: var(--g-navy);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
}
.g-topbar__chip i { color: var(--g-teal); }
.g-topbar__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--g-teal);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}

.g-content {
  padding: 26px 28px 36px;
}

/* ========================= KPI cards ========================= */
.g-kpi {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--g-teal) 0%, var(--g-teal-300) 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 22px 22px 20px;
  box-shadow: var(--shadow-md);
  isolation: isolate;
}
.g-kpi::after {
  content: "";
  position: absolute;
  inset: auto -40px -60px auto;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  z-index: -1;
}
.g-kpi__num {
  font-family: var(--font-display);
  font-size: clamp(42px, 5vw, 58px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}
.g-kpi__lbl {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.02em;
}
.g-kpi__icon {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
  font-size: 18px;
  color: #fff;
}
.g-kpi--soft {
  background: var(--g-card);
  color: var(--g-navy);
}
.g-kpi--soft::after { background: var(--g-teal-100); }
.g-kpi--soft .g-kpi__lbl { color: var(--g-muted); }
.g-kpi--soft .g-kpi__icon {
  background: var(--g-teal-100);
  color: var(--g-teal);
}

/* ========================= Generic Card ========================= */
.g-card {
  background: var(--g-card);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--g-line);
}
.g-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.g-card__title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  color: var(--g-navy);
  letter-spacing: -0.01em;
  margin: 0;
}
.g-card__subtitle {
  font-size: 12px;
  color: var(--g-muted);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0;
}
.g-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--g-teal-100);
  color: var(--g-teal-600);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
}

/* ========================= Next Visit card ========================= */
.g-next {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--g-navy) 0%, #4b5f87 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-md);
}
.g-next__label {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 700;
}
.g-next__name {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  margin: 6px 0 4px;
  letter-spacing: -0.015em;
}
.g-next__meta {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.g-next__meta span i { margin-right: 6px; color: var(--g-green); }
.g-next__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  color: var(--g-navy);
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .2s ease;
}
.g-next__cta:hover { transform: translateY(-1px); }
.g-next__cta i { color: var(--g-teal); }
.g-next::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(82, 222, 151, 0.2);
}

/* ========================= Progress ring ========================= */
.g-ring-wrap {
  display: grid;
  place-items: center;
  padding: 10px 0 16px;
}
.g-ring {
  position: relative;
  width: 180px;
  height: 180px;
}
.g-ring__pct {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 800;
  color: var(--g-navy);
  letter-spacing: -0.02em;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.g-ring__pct small {
  display: block;
  font-size: 11px;
  color: var(--g-muted);
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.15em;
  margin-top: 4px;
}
.g-ring-legend {
  display: flex;
  gap: 18px;
  justify-content: center;
  padding-top: 4px;
  font-size: 12.5px;
  color: var(--g-sub);
  font-weight: 600;
}
.g-ring-legend .dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: middle;
}

/* ========================= Tables ========================= */
.g-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}
.g-table thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--g-muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--g-line);
  background: transparent;
}
.g-table tbody td {
  padding: 14px;
  border-bottom: 1px solid var(--g-line);
  color: var(--g-navy);
  font-weight: 500;
}
.g-table tbody tr:last-child td { border-bottom: none; }
.g-table tbody tr:hover { background: var(--g-soft); }
.g-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--g-teal-100);
  color: var(--g-teal-600);
  display: inline-grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  margin-right: 10px;
}
.g-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.g-pill--ok   { background: #e2f7ec; color: #2a8a57; }
.g-pill--warn { background: #fff1d9; color: #b27200; }
.g-pill--due  { background: #fde1d9; color: #b84020; }
.g-pill--info { background: var(--g-teal-100); color: var(--g-teal-600); }

/* ========================= Filters row ========================= */
.g-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}
.g-search {
  position: relative;
  flex: 1 1 260px;
  min-width: 220px;
}
.g-search input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border-radius: 999px;
  background: var(--g-card);
  border: 1px solid var(--g-line);
  font-size: 14px;
  color: var(--g-navy);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.g-search input:focus {
  border-color: var(--g-teal);
  box-shadow: 0 0 0 3px rgba(60,157,155,0.15);
}
.g-search i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--g-muted);
}
.g-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, color .2s ease;
}
.g-btn--primary { background: var(--g-teal); color: #fff; box-shadow: var(--shadow-sm); }
.g-btn--primary:hover { background: var(--g-teal-600); transform: translateY(-1px); }
.g-btn--ghost { background: var(--g-card); color: var(--g-navy); border-color: var(--g-line); }
.g-btn--ghost:hover { border-color: var(--g-teal); color: var(--g-teal-600); }
.g-btn--dark { background: var(--g-navy); color: #fff; }
.g-btn--dark:hover { background: var(--g-navy-700); }

/* ========================= Visits calendar ========================= */
.g-cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}
.g-cal__day {
  background: var(--g-card);
  border: 1px solid var(--g-line);
  border-radius: var(--radius-md);
  padding: 12px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color .2s ease, transform .2s ease;
}
.g-cal__day:hover { border-color: var(--g-teal); transform: translateY(-2px); }
.g-cal__day.is-today {
  background: linear-gradient(160deg, var(--g-teal) 0%, var(--g-teal-300) 100%);
  color: #fff;
  border-color: transparent;
}
.g-cal__date {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-weight: 700;
  font-size: 14px;
}
.g-cal__date small {
  font-weight: 600;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.75;
}
.g-cal__item {
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--g-teal-100);
  color: var(--g-teal-600);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.g-cal__day.is-today .g-cal__item {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

/* ========================= Detailer slide viewer ========================= */
.g-detailer {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 20px;
}
.g-slide {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--g-teal) 0%, var(--g-navy) 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.g-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 85% 15%, rgba(82,222,151,0.3), transparent 45%);
}
.g-slide__pdf {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 24px 80px;
  box-sizing: border-box;
  overflow: hidden;
}
.g-slide__pdf .reveal {
  width: 100%;
  height: 100%;
}
.g-slide__pdf .slides,
.g-slide__pdf section {
  width: 100%;
  height: 100%;
}
.g-slide__pdf section {
  overflow: hidden;
}
.g-slide__pdf section iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
.g-slide__pdf iframe { width:100%; height:100%; border:0; }
.g-slide__pdf-loader {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  font-weight: 700;
  pointer-events: none;
}
.g-slide__nav {
  position: absolute;
  bottom: 18px;
  right: 22px;
  display: flex;
  gap: 8px;
  z-index: 2;
}
.g-slide__nav button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.22);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: background .2s ease;
}
.g-slide__nav button:hover { background: rgba(255,255,255,0.4); }
.g-slide__counter {
  position: absolute;
  top: 18px;
  left: 22px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.1em;
  z-index: 2;
}

.g-thumbs {
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: flex-start;
  overflow-y: auto;
  max-height: min(72vh, 720px);
  padding-right: 6px;
}
.g-thumbs::-webkit-scrollbar {
  width: 8px;
}
.g-thumbs::-webkit-scrollbar-thumb {
  background: rgba(60, 157, 155, 0.25);
  border-radius: 999px;
}
.g-thumbs::-webkit-scrollbar-track {
  background: transparent;
}
.g-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  padding: 18px 14px;
  background: var(--g-card);
  border: 1px solid var(--g-line);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color .2s ease, transform .2s ease;
  text-align: center;
}
.g-thumb:hover, .g-thumb.active { border-color: var(--g-teal); transform: translateY(-1px); }
.g-thumb__img {
  width: 100%;
  max-width: 220px;
  height: 120px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 16px;
  background: var(--g-line);
}
.g-thumb__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.g-thumb__ttl, .g-thumb__small {
  width: 100%;
  text-align: center;
}
.g-thumb__ix {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--g-teal-100);
  color: var(--g-teal-600);
  font-weight: 800;
  font-size: 13px;
  flex: 0 0 auto;
}
.g-thumb.active .g-thumb__ix { background: var(--g-teal); color: #fff; }
.g-thumb__ttl { font-size: 13.5px; font-weight: 700; color: var(--g-navy); line-height: 1.2; }
.g-thumb__small { font-size: 13px; font-weight: 700; }
.g-thumb__sub { font-size: 11.5px; color: var(--g-muted); margin-top: 2px; }

/* ========================= Inputs list ========================= */
.g-inv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: var(--g-card);
  border: 1px solid var(--g-line);
  border-radius: var(--radius-md);
  transition: border-color .2s ease;
}
.g-inv + .g-inv { margin-top: 10px; }
.g-inv:hover { border-color: var(--g-teal); }
.g-inv__left { display: flex; align-items: center; gap: 14px; }
.g-inv__ic {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--g-teal-100);
  color: var(--g-teal-600);
  display: grid;
  place-items: center;
  font-size: 18px;
}
.g-inv__name { font-weight: 700; color: var(--g-navy); font-size: 15px; }
.g-inv__meta { font-size: 12px; color: var(--g-muted); margin-top: 2px; }
.g-inv__right { display: flex; align-items: center; gap: 14px; }
.g-inv__qty {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  color: var(--g-navy);
  letter-spacing: -0.02em;
}
.g-inv__stepper {
  display: inline-flex;
  align-items: center;
  background: var(--g-soft);
  border-radius: 999px;
  padding: 2px;
}
.g-inv__stepper button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--g-card);
  color: var(--g-teal-600);
  font-weight: 700;
  cursor: pointer;
}
.g-inv__stepper span {
  min-width: 36px;
  text-align: center;
  font-weight: 800;
  color: var(--g-navy);
}

/* ========================= Settings ========================= */
.g-settings-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 22px;
}
.g-settings-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--g-card);
  border-radius: var(--radius-lg);
  padding: 12px;
  border: 1px solid var(--g-line);
  height: fit-content;
}
.g-settings-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  font-weight: 600;
  color: var(--g-navy);
  font-size: 14px;
}
.g-settings-nav a i { color: var(--g-teal); width: 18px; text-align: center; }
.g-settings-nav a.active { background: var(--g-teal-100); color: var(--g-teal-600); }

.g-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.g-field label { font-size: 12.5px; font-weight: 700; color: var(--g-navy); letter-spacing: 0.02em; }
.g-field input, .g-field select, .g-field textarea {
  border: 1px solid var(--g-line);
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 14px;
  background: var(--g-card);
  color: var(--g-navy);
  outline: none;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
}
.g-field input:focus, .g-field select:focus, .g-field textarea:focus {
  border-color: var(--g-teal);
  box-shadow: 0 0 0 3px rgba(60,157,155,0.12);
}
.g-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--g-line);
}
.g-toggle:last-child { border-bottom: none; }
.g-toggle__t { font-weight: 700; color: var(--g-navy); font-size: 14px; }
.g-toggle__s { font-size: 12.5px; color: var(--g-muted); margin-top: 2px; }
.g-switch { position: relative; width: 46px; height: 26px; }
.g-switch input { opacity: 0; width: 0; height: 0; }
.g-switch span {
  position: absolute;
  inset: 0;
  background: #d6dede;
  border-radius: 999px;
  transition: .2s;
  cursor: pointer;
}
.g-switch span::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.g-switch input:checked + span { background: var(--g-teal); }
.g-switch input:checked + span::before { transform: translateX(20px); }

/* ========================= Utility ========================= */
.g-section { margin-bottom: 26px; }
.g-section__h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.g-section__t {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--g-navy);
  letter-spacing: -0.01em;
  margin: 0;
}
.g-section__t small {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--g-muted);
  margin-left: 8px;
}

.g-stack-sm > * + * { margin-top: 12px; }

/* chart host */
.g-chart-host {
  position: relative;
  width: 100%;
  height: 240px;
}

/* Mobile menu overlay */
.g-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(43, 56, 85, 0.45);
  backdrop-filter: blur(4px);
  z-index: 15;
}

/* ==========================================================================
   Responsive — tablet first
   ========================================================================== */

/* iPad landscape (≥1024) — keep full grid */
@media (max-width: 1200px) {
  :root { --side-w: 208px; }
  .g-content { padding: 22px 22px 30px; }
}

/* iPad portrait (768–1023) — collapse sidebar to icons only */
@media (max-width: 1023px) {
  :root { --side-w: 82px; }
  .g-brand__name, .g-nav a span, .g-sync-btn span, .g-sync-meta { display: none; }
  .g-brand { justify-content: center; padding: 12px 0 20px; }
  .g-nav a { justify-content: center; padding: 12px 0; }
  .g-nav a i { width: auto; font-size: 19px; }
  .g-sync-btn { padding: 12px; border-radius: 16px; }
  .g-detailer { grid-template-columns: 1fr; }
  .g-settings-grid { grid-template-columns: 1fr; }
  .g-cal { grid-template-columns: repeat(4, 1fr); }
  .g-topbar { padding: 14px calc(22px + var(--safe-right)) 14px calc(22px + var(--safe-left)); }
  .g-content { padding: 20px 22px 30px; }
}

/* Small tablet / large phone (<768) */
@media (max-width: 767px) {
  .g-app { grid-template-columns: 1fr; }
  .g-app.is-collapsed { grid-template-columns: 1fr; }
  .g-side {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    width: 240px;
    transform: translateX(-100%);
    transition: transform .3s ease;
    padding: 22px 16px 20px;
  }
  .g-side.is-open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .g-side.is-open ~ .g-backdrop { display: block; }
  .g-side.is-collapsed { width: 240px; transform: translateX(-100%); }
  :root { --side-w: 0px; }
  .g-nav a span, .g-sync-btn span, .g-sync-meta { display: block; }
  .g-brand { justify-content: flex-start; }
  .g-nav a { justify-content: flex-start; padding: 11px 12px; }
  .g-side.is-collapsed .g-nav a span,
  .g-side.is-collapsed .g-sync-btn span,
  .g-side.is-collapsed .g-sync-meta { display: block; }
  .g-side.is-collapsed .g-brand { justify-content: flex-start; }
  .g-side.is-collapsed .g-nav a { justify-content: flex-start; padding: 11px 12px; }
  .g-topbar__toggle { display: inline-flex; align-items: center; justify-content: center; }
  .g-cal { grid-template-columns: repeat(2, 1fr); }
  .g-slide__title { font-size: 22px; }
  .g-slide__content { max-width: 85%; }
  .g-content { padding: 18px 16px 28px; }
  .g-next__name { font-size: 22px; }
}

/* reveal animation */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.g-rise { animation: fadeUp .45s ease both; }
.g-rise-1 { animation-delay: .05s; }

/* ========================= Login page ========================= */
body.login-page {
  min-height: 100vh;
  width: 100%;
  height: 100%;
  position: fixed;
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  color: var(--g-ink);
  background: linear-gradient(135deg, var(--g-teal) 0%, #2a7b79 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

body.login-page .login-wrapper {
  width: 100%;
  height: 100%;
  display: none; /* Hidden initially, shown after splash */
  align-items: center;
  justify-content: center;
  padding: 20px calc(20px + var(--safe-left)) 20px calc(20px + var(--safe-right));
}

body.login-page .login-container {
  width: 100%;
  max-width: 420px;
  height: auto;
}

body.login-page .login-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.login-page .login-header {
  background: linear-gradient(135deg, var(--g-teal) 0%, #2a7b79 100%);
  padding: 40px 30px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

body.login-page .login-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

body.login-page .login-header::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

body.login-page .logo {
  width: 90px;
  height: 90px;
  margin: 0 auto 22px;
  position: relative;
  z-index: 1;
}

body.login-page .logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

body.login-page .login-title {
  display: none;
}

body.login-page .login-subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  margin: 8px 0 0;
  position: relative;
  z-index: 1;
}

body.login-page .login-body {
  padding: 40px 30px;
}

body.login-page .form-group {
  margin-bottom: 24px;
}

body.login-page .form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--g-ink);
  margin-bottom: 8px;
}

body.login-page .form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--g-line);
  border-radius: 12px;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--g-ink);
  transition: all 0.3s ease;
  background: #fff;
  -webkit-appearance: none;
  appearance: none;
}

body.login-page .form-control:focus {
  outline: none;
  border-color: var(--g-teal);
  box-shadow: 0 0 0 3px rgba(60, 157, 155, 0.16);
}

body.login-page .form-control::placeholder {
  color: var(--g-sub);
}

body.login-page .form-check {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

body.login-page .form-check input {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--g-teal);
  margin-right: 8px;
  -webkit-appearance: none;
  appearance: none;
}

body.login-page .form-check label {
  font-size: 13px;
  color: var(--g-sub);
  cursor: pointer;
  margin: 0;
}

body.login-page .login-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--g-teal) 0%, #2a7b79 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(60, 157, 155, 0.3);
  margin-bottom: 16px;
  -webkit-appearance: none;
  appearance: none;
}

body.login-page .login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(60, 157, 155, 0.4);
}

body.login-page .login-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(60, 157, 155, 0.3);
}

body.login-page .error-msg {
  color: #e74c3c;
  font-size: 12px;
  margin-top: 4px;
  display: none;
}

body.login-page .error-msg.show {
  display: block;
}

body.login-page .signup-link,
body.login-page .forgot-link {
  display: none;
}

@media (max-width: 1024px) {
  body.login-page .login-header {
    padding: 35px 25px;
  }

  body.login-page .login-body {
    padding: 35px 25px;
  }
}

@media (max-width: 768px) {
  body.login-page .login-wrapper {
    padding: 15px calc(15px + var(--safe-left)) 15px calc(15px + var(--safe-right));
  }

  body.login-page .login-container {
    max-width: 100%;
  }

  body.login-page .login-header {
    padding: 30px 20px;
  }

  body.login-page .login-body {
    padding: 30px 20px;
  }

  body.login-page .logo {
    width: 54px;
    height: 54px;
    margin: 0 auto 16px;
  }

  body.login-page .login-subtitle {
    font-size: 13px;
  }

  body.login-page .form-control {
    padding: 11px 14px;
    font-size: 16px;
  }

  body.login-page .login-btn {
    padding: 13px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  body.login-page .login-wrapper {
    padding: 10px calc(10px + var(--safe-left)) 10px calc(10px + var(--safe-right));
  }

  body.login-page .login-header {
    padding: 25px 16px;
  }

  body.login-page .login-body {
    padding: 25px 16px;
  }

  body.login-page .logo {
    width: 50px;
    height: 50px;
    margin: 0 auto 12px;
  }

  body.login-page .form-group {
    margin-bottom: 20px;
  }

  body.login-page .form-label {
    font-size: 12px;
    margin-bottom: 6px;
  }

  body.login-page .form-control {
    padding: 10px 12px;
    font-size: 16px;
    border-radius: 10px;
  }

  body.login-page .login-btn {
    padding: 12px;
    font-size: 14px;
    margin-bottom: 14px;
    border-radius: 10px;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  body.login-page .login-header {
    padding: 20px 25px;
  }

  body.login-page .login-body {
    padding: 20px 25px;
  }

  body.login-page .logo {
    width: 74px;
    height: 74px;
    margin: 0 auto 12px;
  }

  body.login-page .login-btn {
    padding: 12px;
    margin-bottom: 12px;
  }
}

/* ========================= Splash Screen ========================= */
.splash-screen {
  position: fixed;
  inset: 0;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
}

.splash-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
}

.splash-logo {
  width: 180px;
  height: 180px;
}

.splash-svg {
  width: 100%;
  height: 100%;
}

.drawPath {
  stroke-linecap: round;
  stroke-linejoin: round;
}

.drawPath.path0,
.drawPath.path1 {
  fill: none;
}

.splash-text {
  color: rgba(43, 56, 85, 0.7);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin: 0;
  opacity: 0;
}
.g-rise-2 { animation-delay: .1s; }
.g-rise-3 { animation-delay: .15s; }
.g-rise-4 { animation-delay: .2s; }

/* Tabulator table styling */
.g-table .tabulator-table {
  border: none !important;
  background: transparent !important;
}

.g-table .tabulator-table .tabulator-row {
  border: none !important;
  border-bottom: 1px solid #eef2f3 !important;
  background: transparent !important;
  padding: 0 !important;
  vertical-align: middle !important;
}

.g-table .tabulator-table .tabulator-row:hover {
  background: rgba(57, 74, 109, 0.02) !important;
}

.g-table .tabulator-table .tabulator-cell {
  border: none !important;
  padding: 12px 12px !important;
  font-size: 14px !important;
  line-height: 1.4 !important;
  color: var(--g-ink) !important;
  vertical-align: middle !important;
  text-align: left !important;
}

.g-table .tabulator-table .tabulator-cell:first-child {
  padding-left: 0 !important;
}

.g-table .tabulator-table .tabulator-cell:last-child {
  padding-right: 0 !important;
}

.g-table .tabulator-header {
  border: none !important;
  background: var(--g-soft) !important;
  border-bottom: 1px solid #eef2f3 !important;
}

.g-table .tabulator-header .tabulator-col {
  border: none !important;
  background: transparent !important;
}

.g-table .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title {
  color: var(--g-navy) !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  padding: 12px 0 !important;
}

.g-table .tabulator-footer {
  border: none !important;
  background: transparent !important;
}

.g-table .tabulator-footer .tabulator-paginator {
  justify-content: center !important;
  padding: 16px 0 !important;
}

.g-table .tabulator-footer .tabulator-page {
  background: transparent !important;
  border: 1px solid #eef2f3 !important;
  color: var(--g-sub) !important;
  border-radius: var(--radius-sm) !important;
  margin: 0 2px !important;
  padding: 6px 12px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  transition: all 0.2s ease !important;
}

.g-table .tabulator-footer .tabulator-page.active {
  background: var(--g-teal) !important;
  border-color: var(--g-teal) !important;
  color: white !important;
}

.g-table .tabulator-footer .tabulator-page:hover:not(.active) {
  background: var(--g-soft) !important;
  border-color: var(--g-line) !important;
}

.g-table .tabulator-footer .tabulator-pages {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
}

/* FULLSCREEN BUTTON */
.g-fullscreen-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  background: rgba(0, 123, 191, 0.1);
  border: 1px solid rgba(0, 123, 191, 0.2);
  border-radius: 12px;
  color: var(--g-teal);
  font-size: 18px;
  cursor: pointer;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all var(--transition-duration) ease;
}

.g-fullscreen-btn:hover {
  background: var(--g-teal);
  border-color: var(--g-teal);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.g-fullscreen-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.g-fullscreen-btn.is-fullscreen .fa-solid:before {
  content: "\f066"; /* fa-compress */
}

.g-fullscreen-btn .fa-solid:before {
  content: "\f065"; /* fa-expand */
}

/* Responsive adjustments */
@media (max-width: 767px) {
  .g-fullscreen-btn {
    bottom: calc(15px + var(--safe-bottom));
    right: calc(15px + var(--safe-right));
    width: 44px;
    height: 44px;
    font-size: 16px;
  }
}

/* ==========================================================================
   Capacitor Native Overrides — iPad / Tablet safe-area integration
   ========================================================================== */

/* Push fullscreen button into safe area on notched iPads */
.g-fullscreen-btn {
  bottom: calc(20px + var(--safe-bottom));
  right: calc(20px + var(--safe-right));
}

/* G-topbar should clear the status bar */
.g-topbar {
  padding-top: calc(14px + var(--safe-top));
}

/* Splash screen should respect safe areas */
.splash-screen {
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

/* Prevent native text selection / long-press callout on Capacitor */
.g-app, .g-side, .g-main {
  -webkit-user-select: none;
  user-select: none;
}

/* Capacitor status-bar background overlay (optional coloured bar) */
.g-statusbar-bg {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--safe-top);
  background: var(--g-teal);
  z-index: 100;
}

/* ──────────────────────────────────────────────────────────
   SweetAlert2 custom overrides
   ────────────────────────────────────────────────────────── */

.swal-popup {
  border-radius: 20px !important;
  font-family: 'Urbanist', sans-serif !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18) !important;
}

.swal-confirm {
  border-radius: 12px !important;
  padding: 12px 32px !important;
  font-weight: 600 !important;
  font-size: 15px !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.swal-confirm:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(60,157,155,0.35) !important;
}

.swal-cancel,
.swal-deny {
  border-radius: 12px !important;
  padding: 12px 32px !important;
  font-weight: 600 !important;
  font-size: 15px !important;
}

/* Animate.css — just the classes used by SweetAlert2 showClass */
@keyframes shakeX {
  from, to { transform: translate3d(0, 0, 0); }
  10%, 30%, 50%, 70%, 90% { transform: translate3d(-10px, 0, 0); }
  20%, 40%, 60%, 80% { transform: translate3d(10px, 0, 0); }
}
.animate__animated.animate__shakeX {
  animation-name: shakeX;
  animation-duration: 0.6s;
}
/* ── Sync Indicator (topbar) ───────────────────────────────────── */

.g-sync-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  margin-right: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(255,255,255,0.12);
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  cursor: default;
  transition: background 0.3s;
}

.g-sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.g-sync-label {
  white-space: nowrap;
}

/* Green — synced */
.g-sync--synced .g-sync-dot {
  background: #52de97;
  box-shadow: 0 0 6px rgba(82,222,151,0.6);
}

/* Orange — syncing / pending */
.g-sync--pending .g-sync-dot {
  background: #f9a825;
  box-shadow: 0 0 6px rgba(249,168,37,0.6);
  animation: gSyncPulse 1.2s ease-in-out infinite;
}

/* Red — failed */
.g-sync--error .g-sync-dot {
  background: #e96948;
  box-shadow: 0 0 6px rgba(233,105,72,0.6);
}

/* Gray — offline */
.g-sync--offline .g-sync-dot {
  background: #9e9e9e;
}

@keyframes gSyncPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(1.3); }
}

.animate__animated {
  animation-fill-mode: both;
}

/* ========================= Avatar dropdown ========================= */
.g-avatar {
  position: relative;
  display: inline-block;
}
.g-avatar__btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--g-teal);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  font-family: 'Urbanist', sans-serif;
}
.g-avatar__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(60,157,155,0.35);
}
.g-avatar__btn--photo {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: transparent;
}
.g-avatar__dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 240px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  padding: 16px;
  z-index: 1100;
  display: none;
  flex-direction: column;
  gap: 4px;
}
.g-avatar__dropdown.show {
  display: flex;
}
.g-avatar__info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 4px 12px;
  border-bottom: 1px solid #eef2f8;
  margin-bottom: 4px;
}
.g-avatar__info-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--g-teal);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
}
.g-avatar__info-avatar--photo {
  background-size: cover;
  background-position: center;
  color: transparent;
}
.g-avatar__info-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}
.g-avatar__name {
  font-weight: 700;
  font-size: 14px;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.g-avatar__role {
  font-size: 12px;
  color: var(--g-teal);
  font-weight: 600;
}
.g-avatar__email {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.g-avatar__menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.g-avatar__menu li a,
.g-avatar__menu li button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Urbanist', sans-serif;
  transition: background 0.15s;
  text-align: left;
}
.g-avatar__menu li a:hover,
.g-avatar__menu li button:hover {
  background: #f1f5f9;
}
.g-avatar__menu li a i,
.g-avatar__menu li button i {
  width: 18px;
  text-align: center;
  font-size: 14px;
  color: #64748b;
}
.g-avatar__menu li button.logout-btn {
  color: #ef4444;
}
.g-avatar__menu li button.logout-btn i {
  color: #ef4444;
}

/* ========================= Visits Page Layout ========================= */
.g-visits-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  align-items: start;
}
.g-visits-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.g-visits-right {
  min-width: 0;
}

/* ========================= Calendar Navigation (icon buttons) ========================= */
.g-cal-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.g-btn--icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s, box-shadow 0.2s, color 0.2s;
  flex-shrink: 0;
  padding: 0;
}
.g-btn--icon:hover {
  background: var(--g-teal);
  color: #fff;
  border-color: var(--g-teal);
  box-shadow: 0 2px 8px rgba(60,157,155,0.3);
}
.g-btn--icon i {
  font-size: 14px;
  pointer-events: none;
}
.g-btn--icon--today {
  width: auto;
  padding: 0 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  gap: 5px;
  letter-spacing: 0.3px;
}

/* Week label */
#topbar-week-label,
#schedule-week-label {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}

/* ========================= Account List Panel (Left Column) ========================= */
.g-account-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  background: #fafbfc;
}
.g-account-search i {
  color: #94a3b8;
  font-size: 14px;
  flex-shrink: 0;
}
.g-account-search__input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: #1e293b;
  font-family: inherit;
}
.g-account-search__input::placeholder {
  color: #b0bec5;
  font-weight: 400;
}

/* Account list container */
.g-account-list {
  display: flex;
  flex-direction: column;
  height: calc(100% - 53px);
}
.g-account-list__empty {
  text-align: center;
  padding: 32px 16px;
  color: #94a3b8;
}
.g-account-list__empty i {
  font-size: 36px;
  display: block;
  margin-bottom: 10px;
  color: #cbd5e1;
}
.g-account-list__empty p {
  font-size: 13px;
  font-weight: 500;
  margin: 0;
}
.g-account-list__items {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex: 1;
}

/* Individual account item */
.g-acct-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  cursor: grab;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
  user-select: none;
}
.g-acct-item:active {
  cursor: grabbing;
}
.g-acct-item:hover {
  background: #f0faf9;
}
.g-acct-item--dragging {
  opacity: 0.5;
  background: #eef2ff;
  box-shadow: inset 0 0 0 2px var(--g-teal);
  transform: scale(0.97);
}
.g-acct-item__icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, #e0f2f1, #b2dfdb);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.g-acct-item__icon i {
  font-size: 14px;
  color: var(--g-teal);
}
.g-acct-item__info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}
.g-acct-item__name {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.g-acct-item__meta {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.g-acct-item__grip {
  color: #cbd5e1;
  font-size: 14px;
  flex-shrink: 0;
  padding: 4px 2px;
}
.g-acct-item:hover .g-acct-item__grip {
  color: var(--g-teal);
}

/* ========================= Plan Visit Popup Form ========================= */
.g-plan-form {
  text-align: left;
  padding: 6px 2px 2px;
}
.g-plan-field {
  margin-bottom: 16px;
}
.g-plan-field--required .g-plan-label::after {
  content: " *";
  color: var(--c-orange);
}
.g-plan-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.g-plan-label i {
  margin-right: 5px;
  color: var(--g-teal);
  font-size: 12px;
}
.g-plan-select {
  width: 100%;
  padding: 11px 36px 11px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 14px;
  font-family: 'Urbanist', sans-serif;
  color: #1e293b;
  background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 12px center;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
  cursor: pointer;
}
.g-plan-select:hover {
  background-color: #fff;
}
.g-plan-select:focus {
  outline: none;
  border-color: var(--g-teal);
  box-shadow: 0 0 0 3px rgba(60,157,155,0.12);
  background-color: #fff;
}
.g-plan-date,
.g-plan-time {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 14px;
  font-family: 'Urbanist', sans-serif;
  color: #1e293b;
  background: #f8fafc;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
  cursor: pointer;
  position: relative;
}
.g-plan-date::-webkit-calendar-picker-indicator,
.g-plan-time::-webkit-calendar-picker-indicator {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  padding: 0;
  margin: 0;
  cursor: pointer;
  opacity: 1;
}
.g-plan-date:hover,
.g-plan-time:hover {
  background-color: #fff;
}
.g-plan-date:focus,
.g-plan-time:focus {
  outline: none;
  border-color: var(--g-teal);
  box-shadow: 0 0 0 3px rgba(60,157,155,0.12);
  background-color: #fff;
}
.g-plan-notes {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 14px;
  font-family: 'Urbanist', sans-serif;
  color: #1e293b;
  background: #f8fafc;
  resize: vertical;
  min-height: 72px;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
  line-height: 1.5;
}
.g-plan-notes:focus {
  outline: none;
  border-color: var(--g-teal);
  box-shadow: 0 0 0 3px rgba(60,157,155,0.12);
  background-color: #fff;
}
.g-plan-notes::placeholder {
  color: #94a3b8;
  font-style: italic;
}
.g-plan-row {
  display: flex;
  gap: 16px;
}
.g-plan-half {
  flex: 1;
  min-width: 0;
}

/* Override SweetAlert2 default input styles inside plan popup */
.g-plan-popup .swal2-input,
.g-plan-popup .swal2-textarea {
  all: unset;
}

/* ========================= Plan Visit Popup button overrides ========================= */
.g-plan-popup .swal2-confirm {
  background: var(--g-teal) !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  padding: 10px 24px !important;
}
.g-plan-popup .swal2-cancel {
  border-radius: 10px !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  padding: 10px 24px !important;
}

/* ========================= Schedule Item Tap Popup ========================= */
.g-schedule-popup {
  text-align: left;
  padding: 4px 2px;
}
.g-schedule-popup__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
}
.g-schedule-popup__row:last-child {
  border-bottom: none;
}
.g-schedule-popup__label {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  min-width: 64px;
  flex-shrink: 0;
}
.g-schedule-popup__label i {
  margin-right: 5px;
  color: var(--g-teal);
  font-size: 12px;
}
.g-schedule-popup__value {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}
.g-schedule-popup__badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  padding: 3px 10px;
  border-radius: 12px;
  letter-spacing: 0.3px;
}

/* Schedule popup button styles */
.g-schedule-item-popup .swal2-title {
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  color: #1e293b !important;
  padding-bottom: 12px !important;
  border-bottom: 2px solid #e0f2f1 !important;
  margin-bottom: 4px !important;
}
.g-schedule-item-popup .swal-edit-btn {
  background: var(--g-teal) !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  padding: 8px 20px !important;
  transition: all 0.2s !important;
  box-shadow: 0 2px 6px rgba(60,157,155,0.25) !important;
}
.g-schedule-item-popup .swal-edit-btn:hover {
  background: #2e8b89 !important;
  box-shadow: 0 4px 12px rgba(60,157,155,0.4) !important;
}
.g-schedule-item-popup .swal-visit-btn {
  border-radius: 10px !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  padding: 8px 20px !important;
  background: #10b981 !important;
  color: #fff !important;
  transition: all 0.2s !important;
}
.g-schedule-item-popup .swal-visit-btn:hover {
  background: #059669 !important;
}
.g-schedule-item-popup .swal2-cancel {
  border-radius: 10px !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  padding: 8px 20px !important;
  background: #ef4444 !important;
  color: #fff !important;
  transition: all 0.2s !important;
}
.g-schedule-item-popup .swal2-cancel:hover {
  background: #dc2626 !important;
}

/* ========================= Responsive ========================= */
@media (max-width: 992px) {
  .g-visits-layout {
    grid-template-columns: 1fr;
  }
  .g-visits-left {
    order: 2;
  }
  .g-visits-right {
    order: 1;
  }
}
@media (max-width: 576px) {
  .g-plan-row {
    flex-direction: column;
    gap: 14px;
  }
  .g-cal-nav {
    gap: 3px;
  }
  .g-btn--icon {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }
  .g-btn--icon i {
    font-size: 12px;
  }
}

/* ========================= Override CalendarJS inline picker nav icons ========================= */
/* CalendarJS uses Material Icons text ("expand_less"/"expand_more").
   This project uses Font Awesome — hide the text and inject FA chevron arrows. */
.lm-calendar-navigation .lm-calendar-icon {
  font-size: 0 !important;           /* hide "expand_less" / "expand_more" text */
  position: relative;
  overflow: visible;
}
.lm-calendar-navigation .lm-calendar-icon::before {
  font-family: "Font Awesome 6 Free", "Font Awesome 6 Free Regular", sans-serif;
  font-weight: 900;
  font-size: 16px;
  line-height: 1;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--g-teal);
  transition: color 0.2s;
}
/* first child = prev month → fa-chevron-left */
.lm-calendar-navigation .lm-calendar-icon:first-child::before {
  content: "\f053";
}
/* last child = next month → fa-chevron-right */
.lm-calendar-navigation .lm-calendar-icon:last-child::before {
  content: "\f054";
}
.lm-calendar-navigation .lm-calendar-icon:hover::before {
  color: var(--g-teal-600);
}
