/* ==========================================================================
   EAZIM AGRO — PURE FINANCIAL MOBILE & TABLET APP UI STYLESHEET
   Design Principles:
   - Zero gradients anywhere (100% solid, calm fintech surfaces)
   - Zero unnecessary borders or heavy bold typography
   - Proper rounded bezel clipping (inner surfaces never poke out of corners)
   - Clean bKash / modern mobile banking shortcut grid & list rows
   ========================================================================== */

:root {
  /* Calm Solid App Palette (Zero Gradients) */
  --primary: #0d694b;
  --primary-dark: #094f38;
  --primary-soft: #e9f5f0;

  --green: #12805c;
  --green-soft: #e8f6f0;

  --amber: #b86e00;
  --amber-soft: #fff4e3;

  --red: #c93737;
  --red-soft: #fdeeee;

  --blue: #2362b0;
  --blue-soft: #ebf3fc;

  --purple: #6347b5;
  --purple-soft: #f2effc;

  --teal: #0e7480;
  --teal-soft: #e8f6f8;

  /* App Surfaces */
  --app-bg: #f4f6f8;
  --card-bg: #ffffff;
  --subtle-bg: #f8f9fb;
  --muted-bg: #eef1f4;
  --divider: #edf0f3;
  --input-border: #d8dee4;

  /* Calm App Typography Colors */
  --text-main: #1b242c;
  --text-body: #3c4854;
  --text-muted: #6c7885;
  --text-light: #94a0ad;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-pill: 999px;

  --card-shadow: 0 1px 4px rgba(16, 28, 38, 0.04);
  --sheet-shadow: 0 14px 38px rgba(15, 25, 35, 0.16);

  --font-sans: 'Plus Jakarta Sans', 'Noto Sans Bengali', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[data-theme="dark"] {
  --primary: #17996f;
  --primary-dark: #112620;
  --primary-soft: #16332a;
  --green: #22b07d;
  --green-soft: #143328;
  --amber: #e59824;
  --amber-soft: #332611;
  --red: #e55c5c;
  --red-soft: #361a1c;
  --blue: #5294e2;
  --blue-soft: #172a40;
  --purple: #957be5;
  --purple-soft: #251f3d;
  --teal: #34a8b5;
  --teal-soft: #152f33;

  --app-bg: #0e1418;
  --card-bg: #161f24;
  --subtle-bg: #1c272d;
  --muted-bg: #233038;
  --divider: #24313a;
  --input-border: #31414d;

  --text-main: #edf2f5;
  --text-body: #c6d1d9;
  --text-muted: #8a99a6;
  --text-light: #647380;
}

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

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background: #e4e8ec;
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
}

body.studio-dark {
  background: #070b0d;
}

.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ==========================================================================
   PREVIEW BAR (Outside the App Screen — Plain Controls Only)
   ========================================================================== */
.preview-chrome-wrap {
  position: sticky;
  top: 0;
  z-index: 1200;
}

.mobile-preview-toggle,
.mobile-preview-backdrop {
  display: none;
}

.preview-bar {
  background: #172126;
  color: #e8eef2;
  padding: 8px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.preview-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.preview-logo {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #0d694b;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
}

.preview-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.preview-group {
  display: inline-flex;
  background: #233038;
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.p-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: #b8c5cf;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  padding: 5px 9px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.p-btn:hover {
  color: #ffffff;
}

.p-btn.active {
  background: #0d694b;
  color: #ffffff;
}

.p-btn-flow {
  background: #2b3b45;
  color: #ffffff;
  border-radius: 7px;
  padding: 5px 10px;
}

.net-toggle {
  appearance: none;
  border: 0;
  border-radius: var(--r-pill);
  padding: 5px 11px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
}

.net-toggle.online {
  background: #144938;
  color: #8bf0c9;
}

.net-toggle.offline {
  background: #4d3312;
  color: #fbd38d;
}

/* Subtle Page Direction Strip (Outside Phone) */
.page-flow-strip {
  background: #1f2b32;
  color: #c2cfd8;
  padding: 5px 14px;
  font-size: 11.5px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.flow-chip {
  appearance: none;
  border: 0;
  background: #2c3b44;
  color: #eef3f7;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 5px;
  cursor: pointer;
}

.flow-chip.current {
  background: #0d694b;
  color: #ffffff;
}

/* ==========================================================================
   DEVICE VIEWPORT & STRICT ROUNDED BEZEL CLIPPING (Fixes corner bleed!)
   ========================================================================== */
.viewport-stage {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 18px 12px 28px;
}

.viewport-stage.mode-fluid {
  padding: 0;
}

.device-frame {
  width: 100%;
  background: var(--app-bg);
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  position: relative;
  /* Strict overflow clipping ensures inner white surfaces NEVER poke past rounded corners */
  overflow: hidden;
  isolation: isolate;
  container-type: inline-size;
  container-name: appframe;
}

.viewport-stage.mode-small .device-frame {
  max-width: 360px;
  height: 720px;
  border-radius: 28px;
  border: 7px solid #1b242b;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.viewport-stage.mode-mobile .device-frame {
  max-width: 412px;
  height: 830px;
  border-radius: 32px;
  border: 8px solid #1b242b;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.22);
}

.viewport-stage.mode-tablet .device-frame {
  max-width: 880px;
  height: 820px;
  border-radius: 24px;
  border: 8px solid #1b242b;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.22);
}

.viewport-stage.mode-fluid .device-frame {
  max-width: 100%;
  min-height: calc(100vh - 68px);
  border-radius: 0;
  border: 0;
}

/* Simulated Phone Status Bar */
.sim-status-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 7px 18px 5px;
  background: var(--primary-dark);
  color: rgba(255, 255, 255, 0.9);
  font-size: 11px;
  font-weight: 500;
  flex-shrink: 0;
}

.viewport-stage.mode-small .sim-status-bar,
.viewport-stage.mode-mobile .sim-status-bar,
.viewport-stage.mode-tablet .sim-status-bar {
  display: flex;
}

/* ==========================================================================
   APP SHELL (Scaffold: Top Header + Scrollable Body + Bottom Nav / Tablet Rail)
   ========================================================================== */
.app-shell {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.nav-rail {
  display: none;
  width: 215px;
  flex-shrink: 0;
  background: var(--card-bg);
  border-right: 1px solid var(--divider);
  flex-direction: column;
  overflow: hidden;
}

.nav-rail-head {
  padding: 16px;
  background: var(--primary);
  color: #ffffff;
}

.nav-rail-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.rail-group-title {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 10px 10px 4px;
}

.rail-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-body);
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  border-radius: 9px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.rail-btn:hover {
  background: var(--subtle-bg);
}

.rail-btn.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.app-main {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--app-bg);
}

/* Solid Flat App Header (Like bKash / Modern Mobile Banking) */
.app-header {
  background: var(--primary);
  color: #ffffff;
  padding: 12px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

.app-header-home {
  padding: 12px 15px 14px;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

/* Top-Right Round Profile Picture Trigger (Replaces Top-Right Three Dots) */
.profile-trigger-btn {
  appearance: none;
  border: 2px solid rgba(255, 255, 255, 0.35);
  padding: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

.profile-trigger-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-trigger-inner img,
.profile-drawer-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-trigger-inner .avatar-user-ico {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.profile-drawer-avatar .avatar-user-ico {
  width: 25px;
  height: 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.avatar-user-ico svg {
  width: 100%;
  height: 100%;
}

.theme-mode-box {
  margin: 6px 6px 2px;
  padding: 9px;
  border-radius: 10px;
  background: var(--subtle-bg);
}

.theme-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 3px;
  border-radius: 8px;
  background: var(--muted-bg);
  margin-top: 7px;
}

.theme-mode-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  padding: 6px 6px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.theme-mode-btn svg {
  width: 13.5px;
  height: 13.5px;
  flex-shrink: 0;
}

.theme-mode-btn.active {
  background: var(--card-bg);
  color: var(--text-main);
  font-weight: 600;
  box-shadow: var(--card-shadow);
}

.profile-status-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid var(--primary);
}

.header-back-btn,
.header-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.header-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-sub {
  margin: 1px 0 0;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.82);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* bKash-style Tap-for-Balance / Summary Pill inside Home Header */
.balance-pill-btn {
  appearance: none;
  border: 0;
  background: #ffffff;
  color: var(--primary);
  border-radius: var(--r-pill);
  padding: 5px 11px 5px 7px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 5px;
}

.balance-pill-ico {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

/* Scrollable App Content */
.app-scroll-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 12px 24px;
  -webkit-overflow-scrolling: touch;
}

.viewport-stage.mode-fluid .app-scroll-body {
  overflow-y: visible;
  padding-bottom: 84px;
}

.app-scroll-body.app-scroll-body-login {
  display: flex;
  flex-direction: column;
}

/* Flat Bottom Navigation Bar with Elevated Round Dark Center Home Button */
.app-bottom-nav {
  flex-shrink: 0;
  position: relative;
  z-index: 25;
  overflow: visible;
  background: var(--card-bg);
  border-top: 1px solid var(--divider);
  box-shadow: 0 -4px 16px rgba(10, 22, 32, 0.08);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  padding: 6px 4px 8px;
}

[data-theme="dark"] .app-bottom-nav {
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.35);
}

.bnav-item {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 2px 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.bnav-item svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.9;
}

.bnav-item.active {
  color: var(--primary);
  font-weight: 600;
}

/* Center Home Button: Round Dark BG Placed Slightly Above X-Axis Center Line */
.bnav-item.bnav-center-home {
  padding-top: 0;
  gap: 3px;
}

.bnav-home-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #16222a;
  color: #ffffff;
  border: 3.5px solid var(--card-bg);
  margin-top: -22px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 5px 14px rgba(12, 22, 30, 0.2);
  transition: transform 0.14s ease, background-color 0.14s ease;
}

[data-theme="dark"] .bnav-home-circle {
  background: #0d694b;
}

.bnav-item.bnav-center-home:active .bnav-home-circle {
  transform: scale(0.94);
}

.bnav-home-circle svg {
  width: 21px;
  height: 21px;
  stroke-width: 2;
}

/* ==========================================================================
   HALF-SCREEN SLIDE DRAWERS (Left->Right Options & Right->Left Profile)
   ========================================================================== */
.drawer-backdrop {
  position: absolute;
  inset: 0;
  z-index: 90;
  background: rgba(12, 20, 26, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.side-drawer {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  min-width: 196px;
  max-width: 430px;
  z-index: 100;
  background: var(--card-bg);
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(10, 20, 28, 0.24);
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.viewport-stage.mode-fluid .drawer-backdrop,
.viewport-stage.mode-fluid .side-drawer {
  position: fixed;
}

/* Left-to-Right Half-Screen Drawer (Options Menu) */
.side-drawer.drawer-left {
  left: 0;
  transform: translateX(-104%);
  border-top-right-radius: 16px;
  border-bottom-right-radius: 16px;
}

.side-drawer.drawer-left.open {
  transform: translateX(0);
}

/* Right-to-Left Half-Screen Drawer (Top-Right Profile Menu) */
.side-drawer.drawer-right {
  right: 0;
  transform: translateX(104%);
  border-top-left-radius: 16px;
  border-bottom-left-radius: 16px;
}

.side-drawer.drawer-right.open {
  transform: translateX(0);
}

.drawer-top-accent {
  height: 4px;
  background: var(--primary);
  flex-shrink: 0;
}

.drawer-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
}

/* Right-to-Left Profile Drawer Styling (Matches eazimsystem Top-Right Menu) */
.profile-identity-box {
  padding: 14px 13px 12px;
  border-bottom: 1px solid var(--divider);
  background: var(--subtle-bg);
}

.profile-drawer-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  font-size: 19px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 9px;
}

.profile-role-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  background: var(--green-soft);
  color: var(--green);
  font-size: 10.5px;
  font-weight: 500;
}

.profile-role-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.profile-menu-btn {
  appearance: none;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  padding: 10px 8px;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.profile-menu-btn:hover {
  background: var(--subtle-bg);
}

.profile-menu-ico {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-menu-ico svg {
  width: 16px;
  height: 16px;
}

.profile-drawer-footer {
  padding: 11px 12px;
  border-top: 1px solid var(--divider);
  background: var(--subtle-bg);
}

/* Left-to-Right Options Drawer Compact List */
.opt-drawer-head {
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--divider);
}

.opt-sec-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 10px 4px 5px;
  letter-spacing: 0.01em;
}

.opt-sec-label:first-child {
  padding-top: 2px;
}

.opt-drawer-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
}

.opt-drawer-item {
  appearance: none;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  padding: 7px 6px;
  border-radius: 9px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.opt-drawer-item:hover {
  background: var(--subtle-bg);
}

.opt-drawer-ico {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.opt-drawer-ico svg {
  width: 15px;
  height: 15px;
  stroke-width: 1.9;
}

.opt-drawer-txt {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-body);
  line-height: 1.2;
}

@container appframe (min-width: 720px) {
  .nav-rail {
    display: flex;
  }
  .app-bottom-nav {
    display: none;
  }
  .app-scroll-body {
    padding: 16px 20px 28px;
  }
  .opt-drawer-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ==========================================================================
   BKASH / MYGP STYLE APP SHORTCUT SECTIONS (4/5 IN A ROW + 2-ROW SHOW MORE)
   ========================================================================== */
.app-section-card {
  background: var(--card-bg);
  border-radius: var(--r-md);
  padding: 13px 12px;
  margin-bottom: 11px;
  box-shadow: var(--card-shadow);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 11px;
  padding: 0 2px;
}

.section-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
}

.section-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}

.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  row-gap: 12px;
  column-gap: 6px;
}

@container appframe (min-width: 620px) {
  .shortcut-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.shortcut-item {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 2px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  font-family: inherit;
  color: var(--text-body);
}

.shortcut-icon-box {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease;
  position: relative;
}

.shortcut-item:active .shortcut-icon-box {
  transform: scale(0.94);
}

.shortcut-icon-box svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.85;
}

.tint-green { background: var(--green-soft); color: var(--green); }
.tint-blue { background: var(--blue-soft); color: var(--blue); }
.tint-amber { background: var(--amber-soft); color: var(--amber); }
.tint-purple { background: var(--purple-soft); color: var(--purple); }
.tint-teal { background: var(--teal-soft); color: var(--teal); }
.tint-red { background: var(--red-soft); color: var(--red); }
.tint-muted { background: var(--muted-bg); color: var(--text-body); }

.shortcut-label {
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.22;
  color: var(--text-body);
  max-width: 76px;
}

.shortcut-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: var(--r-pill);
  background: var(--amber);
  color: #ffffff;
  font-size: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   EMPLOYEE CHECK-IN CARD & OFFLINE NOTICE BAR (Flat, Clean, Zero Gradient)
   ========================================================================== */
.duty-strip {
  background: var(--card-bg);
  border-radius: var(--r-md);
  padding: 12px 13px;
  margin-bottom: 11px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.duty-clock {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
}

.btn-duty-icon {
  width: 1.15em;
  height: 1.15em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}

.btn-duty-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.offline-notice-card {
  background: var(--amber-soft);
  color: var(--text-main);
  border-radius: var(--r-md);
  padding: 11px 13px;
  margin-bottom: 11px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* ==========================================================================
   CLEAN APP LISTS, COMPACT SUMMARY BAR & ONLINE / OFFLINE TABS
   ========================================================================== */
.data-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  background: var(--muted-bg);
  border-radius: var(--r-sm);
  margin-bottom: 10px;
}

.data-tab-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 7px 6px;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.data-tab-btn.active {
  background: var(--card-bg);
  color: var(--text-main);
  font-weight: 600;
  box-shadow: var(--card-shadow);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

@container appframe (min-width: 480px) {
  .summary-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.summary-box {
  background: var(--card-bg);
  border-radius: var(--r-sm);
  padding: 9px 11px;
  box-shadow: var(--card-shadow);
}

.summary-box span {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

.summary-box strong {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 2px;
}

/* Filter Pills & Search */
.pill-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 8px;
  scrollbar-width: none;
}

.pill-row::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  appearance: none;
  border: 0;
  background: var(--card-bg);
  color: var(--text-body);
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--card-shadow);
}

.filter-pill.active {
  background: var(--primary);
  color: #ffffff;
}

.search-toolbar {
  display: flex;
  gap: 7px;
  align-items: center;
  margin-bottom: 10px;
}

.search-input-wrap {
  flex: 1;
  min-width: 0;
  position: relative;
}

.search-input-wrap input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 34px;
  border-radius: var(--r-sm);
  border: 0;
  background: var(--card-bg);
  color: var(--text-main);
  font-family: inherit;
  font-size: 13px;
  box-shadow: var(--card-shadow);
}

.search-input-wrap input:focus {
  outline: 1.5px solid var(--primary);
}

.search-input-wrap .s-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  display: flex;
}

/* Clean Borderless App List Items & Universal Standardized List System
   Rules:
   1. Zero profile pictures/avatars in any list page
   2. First column is always [Smooth Expand/Collapse] + SL#
   3. Rightmost corner is always Three-Dot (⋮) Action Dropdown
   4. Smooth in-place expand/collapse & filter panel (zero scroll jump) */
.app-list-card {
  background: var(--card-bg);
  border-radius: var(--r-md);
  box-shadow: var(--card-shadow);
  overflow: visible;
  position: relative;
}

.app-list-row {
  padding: 10px 12px;
  border-bottom: 1px solid var(--divider);
}

.app-list-row:first-child {
  border-top-left-radius: var(--r-md);
  border-top-right-radius: var(--r-md);
}

.app-list-row:last-child {
  border-bottom: 0;
  border-bottom-left-radius: var(--r-md);
  border-bottom-right-radius: var(--r-md);
}

/* Top List Page Bar (Title + Filter Toggle + Primary Add Action) */
.list-top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.list-top-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.filter-toggle-btn {
  appearance: none;
  border: 1px solid var(--divider);
  background: var(--card-bg);
  color: var(--text-body);
  border-radius: var(--r-pill);
  min-height: 33px;
  padding: 5px 14px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--card-shadow);
}

.filter-toggle-btn.is-active {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: transparent;
}

.filter-count-badge {
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--primary);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Smooth Collapsible Filter Panel (No jump, smooth height & opacity) */
.filter-collapse-wrap {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.25s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease, margin-bottom 0.25s ease;
  margin-bottom: 0;
}

.filter-collapse-wrap.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-bottom: 10px;
}

.filter-collapse-inner {
  overflow: hidden;
  min-height: 0;
}

.filter-card-body {
  background: var(--card-bg);
  border-radius: var(--r-md);
  padding: 12px;
  box-shadow: var(--card-shadow);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

@container appframe (min-width: 520px) {
  .filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@container appframe (min-width: 720px) {
  .filter-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.filter-grid .app-input,
.filter-grid .app-select {
  min-height: 34px;
  padding: 5px 9px;
  font-size: 12px;
}

.filter-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--divider);
}

/* Compact Toolbar matching eazimsystem (Rows per page + Export + Search + Bulk Actions) */
.list-toolbar-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  margin-bottom: 9px;
}

.toolbar-left-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.rows-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.rows-select-wrap .rows-per-page-select {
  padding-right: 24px;
}

.rows-select-wrap .select-down-icon {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  pointer-events: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.rows-select-wrap .select-down-icon svg {
  width: 14px;
  height: 14px;
}

.rows-per-page-select {
  appearance: none;
  -webkit-appearance: none;
  height: 34px;
  padding: 0 9px;
  border-radius: var(--r-pill);
  border: 1px solid var(--divider);
  background: var(--card-bg);
  color: var(--text-body);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
}

/* Floating Dropdown Anchor (Used for Export Menu, Bulk Actions Menu, and 3-Dot Row Action Menu) */
.pop-anchor {
  position: relative;
  display: inline-flex;
}

.toolbar-drop-btn {
  appearance: none;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--divider);
  background: var(--card-bg);
  color: var(--text-body);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.toolbar-drop-btn.bulk-btn {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: transparent;
}

.pop-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 5px);
  min-width: 176px;
  max-width: 235px;
  background: var(--card-bg);
  border: 1px solid var(--divider);
  border-radius: 12px;
  padding: 5px;
  box-shadow: 0 10px 28px rgba(12, 22, 32, 0.16);
  z-index: 80;
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s cubic-bezier(0.22, 1, 0.36, 1);
}

.pop-menu.align-left {
  left: 0;
  right: auto;
}

.pop-menu.drop-up {
  top: auto;
  bottom: calc(100% + 5px);
  transform: translateY(4px) scale(0.98);
}

.pop-menu.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.pop-item {
  appearance: none;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  padding: 7px 9px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pop-item:hover {
  background: var(--subtle-bg);
}

/* Semantic Action Item Colors matching eazimsystem */
.pop-item.action-view {
  color: #1976d2;
}
.pop-item.action-view:hover {
  background: #eaf2fd;
}

.pop-item.action-edit {
  color: #d97706;
}
.pop-item.action-edit:hover {
  background: #fef3c7;
}

.pop-item.action-delete,
.pop-item.danger {
  color: #dc2626;
}
.pop-item.action-delete:hover,
.pop-item.danger:hover {
  background: #fee2e2;
}

.pop-item.action-print {
  color: #7c3aed;
}
.pop-item.action-print:hover {
  background: #f3e8ff;
}

.pop-item.action-pay,
.pop-item.action-collect {
  color: #0d694b;
}
.pop-item.action-pay:hover,
.pop-item.action-collect:hover {
  background: #e6f4ea;
}

.pop-item.action-map {
  color: #0e7480;
}
.pop-item.action-map:hover {
  background: #e6f6f8;
}

[data-theme="dark"] .pop-item.action-view { color: #60a5fa; }
[data-theme="dark"] .pop-item.action-view:hover { background: #1e293b; }
[data-theme="dark"] .pop-item.action-edit { color: #fbbf24; }
[data-theme="dark"] .pop-item.action-edit:hover { background: #292524; }
[data-theme="dark"] .pop-item.action-delete,
[data-theme="dark"] .pop-item.danger { color: #f87171; }
[data-theme="dark"] .pop-item.action-delete:hover,
[data-theme="dark"] .pop-item.danger:hover { background: #3b181a; }
[data-theme="dark"] .pop-item.action-print { color: #c084fc; }
[data-theme="dark"] .pop-item.action-print:hover { background: #2e1065; }
[data-theme="dark"] .pop-item.action-pay,
[data-theme="dark"] .pop-item.action-collect { color: #34d399; }
[data-theme="dark"] .pop-item.action-pay:hover,
[data-theme="dark"] .pop-item.action-collect:hover { background: #064e3b; }
[data-theme="dark"] .pop-item.action-map { color: #2dd4bf; }
[data-theme="dark"] .pop-item.action-map:hover { background: #134e4a; }

.pop-item svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke-width: 1.9;
}

.pop-divider {
  height: 1px;
  background: var(--divider);
  margin: 4px 3px;
}

/* Standardized List Column Header & Row Anatomy (Symmetric Left SL# and Right Action Padding) */
.std-list-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto 34px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--subtle-bg);
  border-bottom: 1px solid var(--divider);
  border-top-left-radius: var(--r-md);
  border-top-right-radius: var(--r-md);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.std-head-sl {
  display: flex;
  align-items: center;
  gap: 6px;
}

.std-row {
  border-bottom: 1px solid var(--divider);
  position: relative;
  transition: background-color 0.16s ease;
}

.std-row:last-child {
  border-bottom: 0;
  border-bottom-left-radius: var(--r-md);
  border-bottom-right-radius: var(--r-md);
}

.std-row.is-expanded {
  background: rgba(13, 105, 75, 0.025);
}

.std-row.is-selected {
  background: #f0f7f4;
}

[data-theme="dark"] .std-row.is-selected {
  background: #152822;
}

[data-theme="dark"] .std-row.is-expanded {
  background: rgba(23, 153, 111, 0.05);
}

.std-row-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto 34px;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
}

/* Left Side: Optional Checkbox + SL# + Smooth Expand/Collapse Icon (Zero Extra Left Gap) */
.std-sl-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.row-expand-btn {
  appearance: none;
  border: 0;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--subtle-bg);
  color: var(--text-body);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  position: relative;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.row-expand-btn:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.std-row.is-expanded .row-expand-btn {
  background: var(--primary);
  color: #ffffff;
}

/* Smooth Icon Morph: Expand Icon (+) smoothly rotates/fades into Collapse Icon (−) */
.row-expand-btn .ico-exp,
.row-expand-btn .ico-col {
  position: absolute;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.18s ease;
}

.row-expand-btn .ico-exp {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.row-expand-btn .ico-col {
  opacity: 0;
  transform: rotate(-90deg) scale(0.75);
}

.std-row.is-expanded .row-expand-btn .ico-exp {
  opacity: 0;
  transform: rotate(90deg) scale(0.75);
}

.std-row.is-expanded .row-expand-btn .ico-col {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.row-check {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.sl-badge {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  min-width: 20px;
  text-align: left;
}

.std-primary-cell {
  min-width: 0;
  cursor: pointer;
}

.std-metric-cell {
  text-align: right;
  flex-shrink: 0;
}

/* Right Corner: Three-Dot (⋮) Action Dropdown Trigger */
.std-action-cell {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  position: relative;
}

.row-dots-btn {
  appearance: none;
  border: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--amber);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: transform 0.1s ease, opacity 0.15s ease;
}

[data-theme="dark"] .row-dots-btn {
  background: var(--amber);
  color: #ffffff;
}

.row-dots-btn:hover,
.row-dots-btn.is-open {
  background: #a35f00;
  color: #ffffff;
}

[data-theme="dark"] .row-dots-btn:hover,
[data-theme="dark"] .row-dots-btn.is-open {
  background: #c97e0b;
  color: #ffffff;
}

.row-dots-btn svg {
  width: 16px;
  height: 16px;
}

/* Smooth In-Place Row Expand Panel (Zero Scroll Jump!) */
.std-expand-wrap {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.25s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
}

.std-row.is-expanded .std-expand-wrap {
  grid-template-rows: 1fr;
  opacity: 1;
}

.std-expand-inner {
  overflow: hidden;
  min-height: 0;
}

.std-expand-content {
  margin: 0 11px 10px;
  padding: 10px 11px;
  background: var(--subtle-bg);
  border-radius: var(--r-sm);
}

/* List Footer (Showing 1 to X of Y entries + Pagination) */
.list-footer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-top: 1px solid var(--divider);
  font-size: 11.5px;
  color: var(--text-muted);
}

.page-btn-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.page-btn {
  appearance: none;
  border: 1px solid var(--divider);
  background: var(--card-bg);
  color: var(--text-body);
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
}

.page-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* Flat Mini Bar Chart & Duty Calendar for Overview & Employee Hub */
.mini-bar-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  height: 82px;
  padding-top: 8px;
}

.mini-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}

.mini-bar-pair {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 58px;
}

.mini-bar {
  width: 9px;
  border-radius: 3px 3px 0 0;
}

.duty-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  text-align: center;
  font-size: 11px;
}

.duty-cal-cell {
  padding: 6px 2px;
  border-radius: 7px;
  background: var(--subtle-bg);
  color: var(--text-body);
}

.duty-cal-cell.present { background: var(--green-soft); color: var(--green); font-weight: 500; }
.duty-cal-cell.late { background: var(--amber-soft); color: var(--amber); font-weight: 500; }
.duty-cal-cell.leave { background: var(--purple-soft); color: var(--purple); font-weight: 500; }
.duty-cal-cell.offday { background: var(--muted-bg); color: var(--text-muted); }

/* Name Round Initial Badge & List Item Data Prefixes */
.name-initial-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e8ecf2;
  color: #2b3947;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 6px;
  text-transform: uppercase;
}

[data-theme="dark"] .name-initial-badge {
  background: #25333f;
  color: #dbe4ec;
}

.data-prefix {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-right: 3px;
  color: var(--text-muted);
}

.data-prefix svg {
  width: 12.5px;
  height: 12.5px;
  stroke-width: 1.9;
}

.meta-ico-line {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: middle;
}

.meta-ico-line svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  stroke-width: 1.9;
}

/* Compact Icon-Only View Mode Dropdown Button + Horizontal Scrollable Responsive Table View */
.view-mode-drop-btn {
  padding: 0 9px;
  gap: 5px;
  height: 34px;
}

.resp-table-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  border-top-left-radius: var(--r-md);
  border-top-right-radius: var(--r-md);
}

.resp-data-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 12.5px;
  text-align: left;
}

.resp-data-table thead th {
  background: var(--subtle-bg);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  padding: 9px 10px;
  border-bottom: 1px solid var(--divider);
  white-space: nowrap;
}

.resp-data-table tbody td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--divider);
  vertical-align: middle;
  color: var(--text-body);
}

.resp-data-table tbody tr:last-child td {
  border-bottom: 0;
}

.resp-data-table tbody tr.is-selected {
  background: #f0f7f4;
}

[data-theme="dark"] .resp-data-table tbody tr.is-selected {
  background: #152822;
}

.resp-data-table .tbl-sl-col {
  padding-left: 10px;
  width: 1%;
  white-space: nowrap;
}

.resp-data-table .tbl-act-col {
  padding-right: 10px;
  width: 1%;
  white-space: nowrap;
}

.app-list-card.has-floating-bulk .list-footer-bar {
  padding-bottom: 64px;
}

/* Floating Action Button for Selected Rows in List Pages (Fixed over Bottom Bar, Always Visible) */
.floating-bulk-container {
  position: absolute;
  bottom: 72px;
  right: 14px;
  z-index: 95;
  pointer-events: auto;
}

@container appframe (min-width: 720px) {
  .floating-bulk-container {
    bottom: 20px;
    right: 20px;
  }
}

.viewport-stage.mode-fluid .floating-bulk-container {
  position: fixed;
  bottom: 72px;
  right: 18px;
}

@media (min-width: 720px) {
  .viewport-stage.mode-fluid .floating-bulk-container {
    bottom: 20px;
    right: 22px;
  }
}

.floating-bulk-btn {
  appearance: none;
  border: 0;
  height: 44px;
  padding: 0 18px;
  border-radius: var(--r-pill);
  background: #16222a;
  color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(10, 20, 30, 0.35);
  transition: transform 0.14s ease, background-color 0.14s ease;
}

[data-theme="dark"] .floating-bulk-btn {
  background: var(--primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
}

.floating-bulk-btn:active {
  transform: scale(0.96);
}

.floating-bulk-badge {
  background: rgba(255, 255, 255, 0.25);
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  font-weight: 700;
}

.floating-bulk-btn svg {
  width: 15px;
  height: 15px;
}

/* Summary Collapsible Panel (Smooth grid animation matching filter panel) */
.summary-collapse-wrap {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.25s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease, margin-bottom 0.25s ease;
  margin-bottom: 0;
}

.summary-collapse-wrap.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-bottom: 12px;
}

.summary-collapse-inner {
  overflow: hidden;
  min-height: 0;
}

.summary-toggle-btn {
  appearance: none;
  border: 1px solid var(--divider);
  background: var(--card-bg);
  color: var(--text-body);
  border-radius: var(--r-pill);
  min-height: 33px;
  padding: 5px 14px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--card-shadow);
}

.summary-toggle-btn.is-active {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: transparent;
}

.row-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.row-left {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.row-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-main);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.row-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.row-right {
  text-align: right;
  flex-shrink: 0;
}

.row-val {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  display: block;
}

.row-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 7px;
}

.soft-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 500;
  background: var(--subtle-bg);
  color: var(--text-muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: 10.5px;
  font-weight: 500;
}

.st-green { background: var(--green-soft); color: var(--green); }
.st-amber { background: var(--amber-soft); color: var(--amber); }
.st-red { background: var(--red-soft); color: var(--red); }
.st-blue { background: var(--blue-soft); color: var(--blue); }
.st-muted { background: var(--muted-bg); color: var(--text-muted); }

.row-details-box {
  margin-top: 9px;
  padding: 10px 11px;
  background: var(--subtle-bg);
  border-radius: var(--r-sm);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

@container appframe (min-width: 540px) {
  .detail-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.detail-item span {
  display: block;
  font-size: 10.5px;
  color: var(--text-muted);
}

.detail-item strong {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-main);
}

/* ==========================================================================
   MULTI-STEP FORM STEPPER (Multi-row visible, Arrows, Outline Active vs Solid Done)
   ========================================================================== */
.step-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px 4px;
  padding: 12px 10px;
  background: var(--card-bg);
  border-radius: var(--r-md);
  margin-bottom: 11px;
  box-shadow: var(--card-shadow);
}

.step-node-wrap {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.step-btn {
  appearance: none;
  border: 0;
  background: transparent;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 58px;
  max-width: 82px;
  cursor: pointer;
  padding: 2px;
}

.step-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  border: 1.5px solid var(--input-border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.16s ease;
}

/* Active step: ALWAYS Outline only, NO solid fill background */
.step-btn.active .step-dot {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

/* Completed (non-active) step: Solid filled color */
.step-btn.done .step-dot {
  background: var(--green);
  border: 2px solid var(--green);
  color: #ffffff;
}

.step-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  color: var(--text-light);
  margin-bottom: 15px;
  flex-shrink: 0;
  transition: color 0.16s ease;
}

.step-arrow svg {
  width: 14px;
  height: 14px;
}

.step-arrow.is-colored {
  color: var(--green);
}

.step-name {
  margin-top: 5px;
  font-size: 10.5px;
  font-weight: 400;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.15;
}

.step-btn.active .step-name {
  color: var(--primary);
  font-weight: 600;
}

.step-btn.done .step-name {
  color: var(--green);
  font-weight: 500;
}

/* Form Layout */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 11px;
}

@container appframe (min-width: 460px) {
  .form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.span-full {
  grid-column: 1 / -1;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-body);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  flex-wrap: wrap;
}

.field-label .section-link {
  margin-left: auto;
}

.req {
  color: var(--red);
}

.opt {
  font-size: 10.5px;
  font-weight: 400;
  color: var(--text-light);
}

.app-input, .app-select, .app-textarea {
  width: 100%;
  min-height: 41px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--input-border);
  background: var(--card-bg);
  color: var(--text-main);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 400;
}

.app-textarea {
  min-height: 72px;
  resize: vertical;
}

.app-input:focus, .app-select:focus, .app-textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.app-input[readonly] {
  background: var(--subtle-bg);
}

/* Photo Upload Card (Clickable empty preview -> Static selected image preview + Change/Reset buttons) */
.photo-upload-box {
  background: var(--subtle-bg);
  border-radius: var(--r-md);
  padding: 12px;
  text-align: center;
}

.photo-upload-box.done {
  background: var(--green-soft);
}

.img-upload-preview {
  width: 100%;
  min-height: 116px;
  border-radius: 10px;
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  color: var(--text-muted);
  overflow: hidden;
}

.img-upload-preview.is-empty {
  cursor: pointer;
  border: 1.5px dashed var(--input-border);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.img-upload-preview.is-empty:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.img-upload-preview.has-image {
  cursor: default;
  border: 1px solid var(--divider);
  padding: 4px;
}

.img-upload-preview.nid-preview-box {
  aspect-ratio: 1.58 / 1;
  max-height: 144px;
  margin: 0 auto;
}

.img-upload-preview.photo-preview-box {
  min-height: 126px;
  max-height: 152px;
}

.img-upload-ico {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-upload-ico svg {
  width: 24px;
  height: 24px;
}

.img-upload-hint {
  font-size: 11.5px;
  margin-top: 6px;
  line-height: 1.3;
}

.img-preview-img {
  width: 100%;
  height: 100%;
  max-height: 136px;
  object-fit: contain;
  border-radius: 7px;
  display: block;
}

.img-upload-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 9px;
}

/* Clean Flat Buttons (All follow the Tap for Today Summary pill border radius var(--r-pill)) */
.btn {
  appearance: none;
  border: 0;
  border-radius: var(--r-pill);
  min-height: 38px;
  padding: 8px 18px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.12s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke-width: 2;
}

.btn-sm {
  min-height: 32px;
  padding: 5px 14px;
  font-size: 12px;
  border-radius: var(--r-pill);
}

.btn-sm svg {
  width: 12.5px;
  height: 12.5px;
}

.toolbar-drop-btn svg {
  width: 13.5px;
  height: 13.5px;
  flex-shrink: 0;
}

/* Expandable Form Item Cards (Default Expand View on Stock Forms) */
.stock-form-items-stack {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.stock-form-item-card {
  background: var(--subtle-bg);
  border: 1px solid var(--divider);
  border-radius: var(--r-md);
  overflow: hidden;
}

.stock-form-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--divider);
  cursor: pointer;
}

.stock-form-item-card.is-collapsed .stock-form-item-head {
  border-bottom: 0;
}

.stock-form-item-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 600;
}

.stock-form-item-body {
  padding: 11px;
}

.stock-form-item-card.is-collapsed .stock-form-item-body {
  display: none;
}

.stock-form-chev {
  display: inline-flex;
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.stock-form-item-card.is-collapsed .stock-form-chev {
  transform: rotate(-90deg);
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-soft {
  background: var(--subtle-bg);
  color: var(--text-body);
}

.btn-green {
  background: var(--green);
  color: #ffffff;
}

.btn-red {
  background: var(--red);
  color: #ffffff;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--divider);
}

/* Bottom Sheet / Options Menu Dialog */
dialog.app-sheet {
  border: 0;
  border-radius: 20px;
  background: var(--app-bg);
  color: var(--text-main);
  padding: 0;
  width: min(94vw, 680px);
  max-height: 86vh;
  box-shadow: var(--sheet-shadow);
  overflow: hidden;
}

dialog.app-sheet.wide {
  width: min(96vw, 1020px);
}

dialog.app-sheet::backdrop {
  background: rgba(12, 20, 26, 0.5);
}

.sheet-header {
  padding: 14px 16px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--divider);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sheet-body {
  padding: 14px;
  overflow-y: auto;
  max-height: calc(86vh - 58px);
}

/* Flat Progress Bar & Map Box */
.progress-track {
  width: 100%;
  height: 6px;
  background: var(--muted-bg);
  border-radius: var(--r-pill);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--r-pill);
}

.flat-map-box {
  position: relative;
  height: 230px;
  border-radius: var(--r-md);
  background: var(--teal-soft);
  overflow: hidden;
  margin-bottom: 11px;
  transition: height 0.24s ease;
}

.flat-map-box.pure-map-canvas {
  height: 450px;
}

.flat-map-box.is-fullscreen {
  height: 440px;
}

.flat-map-box.pure-map-canvas.is-fullscreen {
  height: 580px;
}

.map-marker-only {
  position: absolute;
  transform: translate(-50%, -100%);
  appearance: none;
  border: 0;
  background: transparent;
  padding: 2px;
  cursor: pointer;
  color: var(--primary);
  transition: transform 0.14s ease;
}

.map-marker-only:hover {
  transform: translate(-50%, -100%) scale(1.14);
}

.map-marker-pin {
  display: flex;
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.26));
}

.map-marker-pin svg {
  width: 100%;
  height: 100%;
}

.map-pin-btn {
  position: absolute;
  appearance: none;
  border: 0;
  background: var(--card-bg);
  color: var(--text-main);
  padding: 4px 9px;
  border-radius: var(--r-pill);
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.map-pin-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

.check-tile {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--subtle-bg);
  font-size: 13px;
  color: var(--text-main);
  cursor: pointer;
}

.check-tile input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  margin: 0;
}

/* Clean Table for Wide Views */
.clean-table-wrap {
  width: 100%;
  overflow-x: auto;
  background: var(--card-bg);
  border-radius: var(--r-md);
  box-shadow: var(--card-shadow);
}

.clean-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.clean-table th {
  background: var(--subtle-bg);
  color: var(--text-muted);
  font-weight: 500;
  padding: 9px 10px;
  text-align: left;
  border-bottom: 1px solid var(--divider);
  white-space: nowrap;
}

.clean-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--divider);
}

/* Toast */
.toast-stack {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast-msg {
  background: #1b242c;
  color: #ffffff;
  padding: 10px 15px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 400;
  box-shadow: var(--sheet-shadow);
}

/* ==========================================================================
   MOBILE SINGLE-SCREEN MODE & COLLAPSIBLE TOP PREVIEW HEADER
   (Desktop/Tablet keeps full preview header sticky above device frame)
   ========================================================================== */
@media (max-width: 767px) {
  html, body {
    height: 100%;
    overflow: hidden;
  }

  .preview-chrome-wrap {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1300;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
  }

  .preview-chrome {
    display: none;
    width: 100%;
    max-height: 76dvh;
    overflow-y: auto;
    pointer-events: auto;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.34);
  }

  .preview-chrome-wrap.is-mobile-open .preview-chrome {
    display: block;
  }

  .mobile-preview-backdrop.open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1260;
    background: rgba(10, 18, 24, 0.42);
  }

  .mobile-preview-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    appearance: none;
    border: 0;
    height: 20px;
    padding: 0 12px;
    border-radius: 0 0 11px 11px;
    background: #172126;
    color: #e8eef2;
    font-family: inherit;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
    pointer-events: auto;
  }

  .mobile-preview-toggle .mpt-ico {
    width: 11px;
    height: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
  }

  .mobile-preview-toggle .mpt-ico svg {
    width: 11px;
    height: 11px;
  }

  .mobile-preview-toggle.is-open {
    background: var(--primary);
    color: #ffffff;
  }

  .mobile-preview-toggle.is-open .mpt-ico {
    transform: rotate(180deg);
  }

  .viewport-stage {
    padding: 0 !important;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  .viewport-stage.mode-small .device-frame,
  .viewport-stage.mode-mobile .device-frame,
  .viewport-stage.mode-tablet .device-frame,
  .viewport-stage.mode-fluid .device-frame {
    max-width: 100% !important;
    width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  .viewport-stage.mode-small .sim-status-bar,
  .viewport-stage.mode-mobile .sim-status-bar,
  .viewport-stage.mode-tablet .sim-status-bar {
    display: none !important;
  }

  .app-header {
    padding-top: 22px;
  }

  .viewport-stage.mode-fluid .app-scroll-body {
    overflow-y: auto !important;
    padding-bottom: 24px;
  }

  .app-scroll-body.app-scroll-body-login {
    padding-top: 24px;
  }

  .drawer-backdrop,
  .side-drawer {
    position: fixed !important;
  }

  .viewport-stage.mode-fluid .floating-bulk-container {
    position: fixed;
    bottom: 72px;
    right: 14px;
  }

  .toast-stack {
    bottom: 74px;
    right: 12px;
    left: 12px;
  }
}
