/* Thangavel Accounts Mobile App Shell */
body.ma-app-mode .navbar, body.ma-app-mode .container, body.ma-app-mode footer,
body.ma-app-mode #shopSelectorBar, body.ma-app-mode #contractorSimpleView,
body.ma-app-mode #adminSinglePageView, body.ma-app-mode #shopOwnerSimpleView { display: none !important; }
body.ma-app-mode.ma-not-logged-in #mobileBottomNav, body.ma-app-mode.ma-not-logged-in #mobileAppRoot { display: none !important; }
body.ma-app-mode:not(.ma-not-logged-in) #mobileLoginScreen { display: none !important; }
.ma-login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem 1.5rem; background: linear-gradient(160deg, #0a0f1e, #1e1b4b); }
.ma-logo { width: 88px; height: 88px; border-radius: 22px; background: linear-gradient(135deg, #0ea5e9, #6366f1); display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 900; color: white; box-shadow: 0 12px 40px rgba(14,165,233,0.35); margin-bottom: 1rem; }
.ma-login-title { font-size: 1.5rem; font-weight: 800; color: white; margin-bottom: 0.25rem; }
.ma-login-sub { font-size: 0.85rem; color: #64748b; margin-bottom: 2rem; }
.ma-login-card { width: 100%; max-width: 380px; background: rgba(30,41,59,0.9); border: 1px solid rgba(255,255,255,0.08); border-radius: 20px; padding: 1.5rem; }
.ma-login-card label { display: block; font-size: 0.75rem; font-weight: 700; color: #94a3b8; margin-bottom: 0.35rem; text-transform: uppercase; }
.ma-login-card select { width: 100%; padding: 0.85rem; border-radius: 12px; border: 1px solid rgba(255,255,255,0.1); background: #0f172a; color: white; font-size: 0.95rem; margin-bottom: 1rem; }
.ma-btn-primary { width: 100%; padding: 0.95rem; border: none; border-radius: 14px; background: linear-gradient(135deg, #0ea5e9, #0284c7); color: white; font-size: 1rem; font-weight: 800; cursor: pointer; margin-top: 0.5rem; }
.ma-btn-green { background: linear-gradient(135deg, #10b981, #059669); }
.ma-btn-red { background: linear-gradient(135deg, #ef4444, #dc2626); margin-top: 0.65rem; }
.ma-bill-acts { white-space: nowrap; text-align: right; }
.ma-bill-acts .ma-pdf-btn, .ma-bill-acts .ma-rename-btn, .ma-bill-acts .ma-del-btn { margin-left: 0.25rem; }
.ma-del-btn {
  border: 1px solid rgba(239,68,68,0.4);
  background: rgba(239,68,68,0.12);
  color: #fca5a5;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.38rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
}
.ma-btn-outline { background: transparent; border: 1px solid rgba(255,255,255,0.15); color: #94a3b8; padding: 0.65rem 1rem; border-radius: 10px; font-weight: 700; font-size: 0.85rem; cursor: pointer; }
.ma-root { min-height: 100vh; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.ma-header {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0.75rem 5.6rem 0.75rem 1rem;
  background: #0a0f1e;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ma-header-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1 1 auto;
  min-width: 0;
}
.ma-header-actions {
  position: absolute;
  top: 50%;
  right: 0.7rem;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  z-index: 60;
}
.ma-header .ma-btn-outline { display: none !important; }
.ma-icon-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.14);
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.ma-icon-btn svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: #ef4444;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ma-icon-btn.ma-icon-reload {
  border-color: rgba(14, 165, 233, 0.5);
  background: rgba(14, 165, 233, 0.16);
  color: #38bdf8;
}
.ma-icon-btn.ma-icon-reload svg { stroke: #38bdf8; }
.ma-header-logo { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, #0ea5e9, #6366f1); display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 0.85rem; color: white; flex-shrink: 0; }
#maHeaderUser { min-width: 0; }
#maHeaderUser h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ma-header h1 { font-size: 1rem; font-weight: 800; color: white; }
.ma-header p { font-size: 0.7rem; color: #64748b; }
.ma-main { padding: 1rem; max-width: 480px; margin: 0 auto; }
.ma-approval-banner,
.ma-bill-alert {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(130% 95% at 0% 0%, rgba(255, 122, 24, 0.40) 0%, rgba(255, 122, 24, 0.10) 36%, rgba(255, 122, 24, 0) 68%),
    #14161c;
  border: 1px solid rgba(255, 140, 50, 0.22);
  border-radius: 18px;
  padding: 1rem;
  margin: 0 0 1rem;
  z-index: 2;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.07);
}
.ma-approval-banner h3,
.ma-bill-alert h3 {
  font-size: 0.92rem;
  font-weight: 800;
  color: #ff9a3c;
  margin-bottom: 0.6rem;
  letter-spacing: 0.01em;
}
.ma-approval-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 154, 60, 0.12);
  border-radius: 12px;
  padding: 0.75rem;
  margin-top: 0.5rem;
}
.ma-approval-actions { display: flex; gap: 0.4rem; margin-top: 0; flex-shrink: 0; }
.ma-approval-actions button { padding: 0.4rem 0.85rem; border-radius: 999px; border: none; font-size: 0.72rem; font-weight: 800; cursor: pointer; }
.ma-btn-approve {
  background: #ff8a1e;
  color: #111;
  border: none;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.72rem;
  font-weight: 800;
}
.ma-btn-reject { background: transparent; color: #fca5a5; border: 1px solid rgba(239,68,68,0.55); }
.ma-balance-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1rem; }
.ma-balance-grid.three { grid-template-columns: 1fr; }
.ma-balance-card { background: rgba(30,41,59,0.85); border: 1px solid rgba(255,255,255,0.08); border-radius: 16px; padding: 1rem; cursor: pointer; }
.ma-balance-card.bills { border-top: 3px solid #06b6d4; }
.ma-balance-card.cash { border-top: 3px solid #10b981; }
.ma-balance-label { font-size: 0.68rem; font-weight: 700; color: #64748b; text-transform: uppercase; }
.ma-balance-value { font-size: 1.1rem; font-weight: 800; font-family: monospace; margin: 0.35rem 0; }
.ma-balance-value.pos { color: #22c55e; }
.ma-balance-value.neg { color: #ef4444; }
.ma-shop-amt.pos { color: #22c55e; }
.ma-shop-amt.neg { color: #ef4444; }
.ma-balance-hint { font-size: 0.65rem; color: #64748b; }
.ma-section-title { font-size: 0.75rem; font-weight: 800; color: #64748b; text-transform: uppercase; margin-bottom: 0.6rem; }
.ma-shop-row { display: flex; justify-content: space-between; align-items: center; gap: 0.7rem; background: rgba(30,41,59,0.6); border-radius: 12px; padding: 0.85rem 1rem; margin-bottom: 0.5rem; cursor: pointer; }
.ma-shop-row-main { flex: 1; min-width: 0; }
.ma-rename-btn {
  flex-shrink: 0;
  border: 1px solid rgba(56,189,248,0.35);
  background: rgba(14,165,233,0.1);
  color: #7dd3fc;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.38rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
}
.ma-shop-name { font-size: 0.92rem; font-weight: 700; color: #f8fafc; letter-spacing: -0.01em; }
.ma-shop-gst { font-size: 0.72rem; font-weight: 400; color: rgba(148, 163, 184, 0.52); letter-spacing: 0.04em; margin-top: 0.12rem; font-family: ui-monospace, monospace; }
.ma-shop-sub { font-size: 0.72rem; font-weight: 500; color: rgba(148, 163, 184, 0.72); margin-top: 0.18rem; }
.ma-shop-amt { font-weight: 600; font-size: 0.85rem; font-family: monospace; }
.ma-list-card { background: rgba(30,41,59,0.7); border-radius: 14px; padding: 1rem; margin-bottom: 0.65rem; }
.ma-filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-bottom: 1rem; }
.ma-filter-row select { padding: 0.65rem; border-radius: 10px; border: 1px solid rgba(255,255,255,0.1); background: #1e293b; color: white; font-size: 0.82rem; }
.ma-dl-btn { width: 100%; text-align: left; padding: 1rem; margin-bottom: 0.6rem; border-radius: 14px; border: 1px solid rgba(14,165,233,0.3); background: rgba(14,165,233,0.1); color: #38bdf8; font-weight: 700; font-size: 0.88rem; cursor: pointer; }
.ma-dl-btn.green { border-color: rgba(16,185,129,0.3); background: rgba(16,185,129,0.1); color: #34d399; }
.ma-dl-btn.amber { border-color: rgba(245,158,11,0.3); background: rgba(245,158,11,0.1); color: #fbbf24; }
.ma-dl-btn.red { border-color: rgba(239,68,68,0.35); background: rgba(239,68,68,0.12); color: #fca5a5; }
.ma-overlay { position: fixed; inset: 0; z-index: 10000; background: #0a0f1e; display: flex; flex-direction: column; }
.ma-overlay-header { display: flex; align-items: center; gap: 0.75rem; padding: 1rem; border-bottom: 1px solid rgba(255,255,255,0.08); }
.ma-overlay-header button { background: none; border: none; color: #38bdf8; font-size: 1.1rem; cursor: pointer; }
.ma-overlay-header h2 { font-size: 1rem; font-weight: 800; color: white; }
.ma-overlay-body { flex: 1; overflow-y: auto; padding: 1rem; }
.ma-drill-shop { background: rgba(30,41,59,0.8); border-radius: 14px; padding: 1rem; margin-bottom: 0.65rem; border-left: 3px solid #06b6d4; }
.ma-drill-shop.cash-type { border-left-color: #10b981; }
.ma-drill-row { display: flex; justify-content: space-between; font-size: 0.82rem; padding: 0.35rem 0; }
.ma-drill-row .lbl { color: #64748b; }
.ma-drill-row .val { font-weight: 700; font-family: monospace; }
html.ma-app-mode .navbar, html.ma-app-mode .container, html.ma-app-mode footer,
html.ma-app-mode #shopSelectorBar, html.ma-app-mode #contractorSimpleView,
html.ma-app-mode #adminSinglePageView, html.ma-app-mode #shopOwnerSimpleView { display: none !important; }

body.ma-app-mode .modal-overlay { z-index: 20000; }

/* Android WebView hang: never keep hidden full-screen GPU blur layers */
html.ma-app-mode *,
html.ma-app-mode *::before,
html.ma-app-mode *::after {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
html.ma-app-mode .modal-overlay {
  display: none !important;
  opacity: 1 !important;
  inset: 0;
  width: auto;
  height: auto;
  max-width: none;
  background: #020617 !important;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  align-items: flex-start;
  padding: 12px;
  transition: none !important;
}
html.ma-app-mode .modal-overlay.active {
  display: flex !important;
  pointer-events: auto;
  height: var(--ma-vvh, 100%);
  max-height: var(--ma-vvh, 100%);
}
html.ma-app-mode .modal-box {
  box-shadow: none;
  margin: auto 0;
  width: 100%;
}

.ma-shop-grid { display: grid; grid-template-columns: 1fr; gap: 0.5rem; }
.ma-dl-grid { display: grid; grid-template-columns: 1fr; gap: 0.6rem; }
.ma-empty { text-align: center; padding: 2.5rem 1rem; color: #64748b; }

@media (min-width: 700px) {
  .ma-header { padding: 1.05rem 6rem 1.05rem 1.75rem; }
  .ma-header-actions { right: 1.5rem; }
  .ma-header-logo { width: 44px; height: 44px; font-size: 1rem; border-radius: 12px; }
  .ma-header h1 { font-size: 1.2rem; }
  .ma-header p { font-size: 0.8rem; }
  .ma-main { max-width: 920px; padding: 1.5rem 2rem 2rem; }
  .ma-balance-grid { gap: 1.15rem; margin-bottom: 1.25rem; }
  .ma-balance-grid.three { grid-template-columns: 1fr 1fr 1fr; }
  .ma-balance-card { padding: 1.35rem 1.4rem; border-radius: 18px; }
  .ma-balance-label { font-size: 0.8rem; }
  .ma-balance-value { font-size: 1.65rem; margin: 0.5rem 0; }
  .ma-balance-hint { font-size: 0.78rem; }
  .ma-btn-primary { font-size: 1.05rem; padding: 1.05rem; max-width: 320px; }
  .ma-section-title { font-size: 0.85rem; margin-bottom: 0.85rem; }
  .ma-shop-grid { grid-template-columns: 1fr 1fr; gap: 0.85rem; }
  .ma-shop-row { padding: 1.1rem 1.2rem; border-radius: 14px; margin-bottom: 0; }
  .ma-shop-name { font-size: 1rem; }
  .ma-shop-sub { font-size: 0.8rem; }
  .ma-shop-amt { font-size: 1rem; }
  .ma-list-card { padding: 1.15rem 1.25rem; }
  .ma-list-card h4 { font-size: 1.05rem; }
  .ma-dl-grid { grid-template-columns: 1fr 1fr; gap: 0.85rem; }
  .ma-dl-btn { margin-bottom: 0; font-size: 1rem; padding: 1.15rem; }
  .ma-filter-row { gap: 0.9rem; }
  .ma-filter-row select { font-size: 0.95rem; padding: 0.8rem; }
  .ma-overlay-body { max-width: 920px; margin: 0 auto; width: 100%; padding: 1.5rem 2rem; }
  .ma-drill-shop { padding: 1.2rem 1.3rem; }
  body.ma-app-mode .mobile-bottom-nav { height: 72px; }
  body.ma-app-mode .mbn-btn { font-size: 0.72rem; }
  body.ma-app-mode .mbn-icon { font-size: 1.35rem; }
}

.ma-grand { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.55rem; margin-bottom: 1rem; }
.ma-grand-item { background: rgba(30,41,59,0.85); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 0.75rem 0.7rem; }
.ma-grand-item .k { font-size: 0.65rem; color: #64748b; font-weight: 700; text-transform: uppercase; }
.ma-grand-item .v { font-size: 0.92rem; font-weight: 800; margin-top: 0.25rem; font-family: ui-monospace, monospace; color: #f8fafc; }
.ma-grand-item .v.cyan { color: #38bdf8; }
.ma-grand-item .v.pos { color: #22c55e; }
.ma-grand-item .v.neg { color: #ef4444; }
.ma-group-metrics strong.pos { color: #22c55e; }
.ma-group-metrics strong.neg { color: #ef4444; }
.ma-ledger td.pos { color: #22c55e; }
.ma-ledger td.neg { color: #ef4444; }
.ma-shop-group { background: rgba(30,41,59,0.75); border: 1px solid rgba(255,255,255,0.08); border-radius: 14px; padding: 1rem; cursor: pointer; border-left: 3px solid #06b6d4; }
.ma-shop-group.cash { border-left-color: #10b981; }
.ma-group-metrics { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.4rem; margin-top: 0.7rem; }
.ma-group-metrics span { display: block; font-size: 0.65rem; color: #64748b; }
.ma-group-metrics strong { display: block; font-size: 0.82rem; color: #e2e8f0; margin-top: 0.15rem; }
.ma-group-metrics strong.pos { color: #22c55e; }
.ma-group-metrics strong.neg { color: #ef4444; }
.ma-back { background: transparent; border: 1px solid rgba(56,189,248,0.35); color: #38bdf8; border-radius: 10px; padding: 0.45rem 0.8rem; font-weight: 700; margin-bottom: 0.85rem; cursor: pointer; }
.ma-table-wrap { overflow-x: auto; border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; }
.ma-ledger { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.ma-ledger th { text-align: left; color: #94a3b8; font-size: 0.7rem; text-transform: uppercase; padding: 0.7rem 0.75rem; background: rgba(15,23,42,0.9); }
.ma-ledger td { padding: 0.7rem 0.75rem; border-top: 1px solid rgba(255,255,255,0.06); color: #e2e8f0; vertical-align: middle; }
.ma-ledger td.num { font-family: ui-monospace, monospace; font-weight: 700; white-space: nowrap; }
.ma-ledger tr.ma-row-click { cursor: pointer; }
.ma-ledger tr.ma-row-click:active { background: rgba(14,165,233,0.08); }
.ma-ledger td.pos { color: #22c55e; }
.ma-ledger td.neg { color: #ef4444; }
.ma-pdf-cell { width: 44px; text-align: center; }
.ma-pdf-btn { background: none; border: none; padding: 0; cursor: pointer; }
.ma-pdf-mark {
  display: inline-flex; align-items: flex-end; justify-content: center;
  width: 28px; height: 34px; padding-bottom: 5px;
  border-radius: 4px 7px 4px 4px;
  background: linear-gradient(180deg, #f87171, #dc2626);
  color: #fff; font-size: 7px; font-weight: 800; letter-spacing: 0.06em;
  box-shadow: 0 3px 8px rgba(220, 38, 38, 0.35);
  position: relative;
}
.ma-pdf-mark:after {
  content: ""; position: absolute; top: 0; right: 0;
  border-style: solid; border-width: 0 7px 7px 0;
  border-color: transparent #0b1220 transparent transparent;
}

body.ma-app-mode .mobile-bottom-nav {
  background: #070b16;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 0.35rem 0.45rem calc(0.4rem + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 24px rgba(0,0,0,0.28);
}
body.ma-app-mode .mbn-btn {
  color: #64748b;
  font-weight: 500;
  font-size: 0.62rem;
  letter-spacing: 0.02em;
  border-radius: 12px;
  margin: 0 2px;
  min-height: 54px;
  gap: 0.18rem;
}
body.ma-app-mode .mbn-icon {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
}
body.ma-app-mode .mbn-icon svg {
  width: 21px; height: 21px;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
body.ma-app-mode .mbn-btn.active {
  color: #7dd3fc;
  background: rgba(14, 165, 233, 0.14);
  font-weight: 600;
}
body.ma-app-mode .mbn-btn.active .mbn-icon svg { stroke: #38bdf8; }
.ma-detail-card { background: rgba(30,41,59,0.85); border-radius: 16px; padding: 1.15rem; border: 1px solid rgba(255,255,255,0.08); }
.ma-detail-card h3 { font-size: 1.15rem; margin-bottom: 0.85rem; color: white; }
.ma-detail-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px solid rgba(255,255,255,0.06); font-size: 0.88rem; }
.ma-detail-row .lbl { color: #64748b; }
.ma-detail-row .val { color: #f8fafc; font-weight: 500; text-align: right; }
.ma-detail-row .val.gst { font-weight: 400; color: rgba(148, 163, 184, 0.55); font-family: ui-monospace, monospace; letter-spacing: 0.04em; }
.ma-detail-card h3 { font-weight: 700; }
.ma-detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-top: 1rem; }
.ma-detail-actions .ma-dl-btn { margin-bottom: 0; text-align: center; }
@media (min-width: 700px) {
  .ma-grand-item { padding: 1rem 1.1rem; }
  .ma-grand-item .k { font-size: 0.75rem; }
  .ma-grand-item .v { font-size: 1.15rem; }
  .ma-ledger { font-size: 0.92rem; }
  .ma-shop-group { padding: 1.15rem 1.2rem; }
  .ma-shop-gst { font-size: 0.8rem; }
}

.ma-amt-chip {
  display: block;
  margin: 0.4rem 0 0.15rem;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 1.12rem;
  font-weight: 600;
  color: #e2e8f0;
}
.ma-amt-chip.pos { color: #22c55e; }
.ma-amt-chip.neg { color: #ef4444; }
.ma-amt-chip.cyan { color: #38bdf8; }
.ma-amt-chip.zero { color: #94a3b8; }
.ma-shop-row .ma-amt-chip { display: inline-flex; margin: 0; font-size: 0.9rem; white-space: nowrap; }
.ma-chip-row { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 1rem; }
.ma-chip {
  border: 1px solid rgba(255,255,255,0.12);
  background: #1e293b;
  color: #cbd5e1;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.ma-chip.active {
  background: rgba(14,165,233,0.18);
  border-color: #38bdf8;
  color: #e0f2fe;
}
.ma-metric-click { cursor: pointer; }
.ma-add-fund-row {
  display: flex;
  justify-content: center;
  margin: 0.35rem 0 1.15rem;
}
.ma-add-fund-row .ma-btn-primary {
  width: auto;
  min-width: 200px;
  max-width: 280px;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 12px;
}
.ma-add-fund-row.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}
.ma-add-fund-row.two .ma-btn-primary {
  width: 100%;
  min-width: 0;
  max-width: none;
}
.ma-company-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin: 0 0 1.1rem;
}
.ma-company-actions.one { grid-template-columns: 1fr; }
.ma-company-actions .ma-btn-primary {
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.82rem 0.6rem;
  border-radius: 12px;
}
.ma-form-card {
  background: #1e293b;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 1rem 1rem 1.15rem;
}
.ma-form-group { margin-bottom: 0.75rem; }
.ma-form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: #94a3b8;
  margin-bottom: 0.32rem;
}
.ma-form-group .form-control {
  width: 100%;
  font-size: 0.92rem;
  font-weight: 500;
  background: #0f172a;
  border: 1px solid rgba(255,255,255,0.1);
  color: #f1f5f9;
  border-radius: 10px;
  padding: 0.72rem 0.8rem;
}
.ma-form-msg { display: none; font-size: 0.82rem; margin-bottom: 0.7rem; }
.ma-form-msg.err, .ma-form-msg.ok { display: block; }
.ma-form-msg.err { color: #f87171; }
.ma-form-msg.ok { color: #4ade80; }

.ma-preview-box { max-width: 750px; width: 100%; }
.ma-preview-body {
  min-height: 280px;
  background: rgba(0,0,0,0.35);
  border-radius: 8px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
}
.ma-preview-view { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; background: #0b1220; border-radius: 8px; }
.ma-preview-img { width: 100%; height: auto; display: block; background: #fff; }
.ma-pdf-pages canvas { width: 100%; height: auto; display: block; margin: 0 0 8px; background: #fff; }
.ma-preview-frame { width: 100%; min-height: 70vh; border: 0; background: #fff; border-radius: 8px; }
.ma-preview-loading { text-align: center; color: #94a3b8; padding: 2.5rem 1rem; font-weight: 700; }
.ma-preview-meta { font-size: 0.82rem; color: #94a3b8; margin-top: 0.75rem; }
.ma-preview-toolbar { margin-top: 0.65rem; }
.ma-preview-toolbar .ma-btn-primary { width: auto; min-width: 140px; padding: 0.7rem 1.1rem; margin-top: 0; }
body.ma-app-mode #modalFilePreview .ma-preview-box {
  max-width: 100% !important;
  width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
}
body.ma-app-mode #previewContainer {
  flex: 1;
  min-height: 0 !important;
  overflow: hidden;
}
body.ma-app-mode .ma-preview-view { min-height: 0; }
body.ma-app-mode .modal-overlay { background: #020617; }
body.ma-app-mode .modal-box {
  background: #1e293b;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(0,0,0,0.45);
}
body.ma-app-mode .modal-header h3 {
  font-size: 0.98rem;
  font-weight: 500;
  color: #e2e8f0;
}
body.ma-app-mode .form-group label {
  font-size: 0.78rem;
  font-weight: 500;
  color: #94a3b8;
  text-transform: none;
}
body.ma-app-mode .form-control {
  font-size: 0.9rem;
  font-weight: 500;
  background: #0f172a;
  border: 1px solid rgba(255,255,255,0.1);
  color: #f1f5f9;
}
body.ma-app-mode #modalPayment .modal-box {
  max-width: 440px;
  padding: 1.2rem 1.15rem 1.35rem;
  border-radius: 20px;
}
body.ma-app-mode #modalPayment .modal-header { margin-bottom: 0.9rem; }
body.ma-app-mode #modalPayment .modal-header h3 {
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
body.ma-app-mode #modalPayment .form-group { margin-bottom: 0.75rem; position: relative; }
body.ma-app-mode .ma-native-hidden-select,
body.ma-app-mode #payShopSelect.ma-native-shop-select { position: absolute; opacity: 0; pointer-events: none; height: 0; width: 0; overflow: hidden; }
body.ma-app-mode #modalPayment form { display: flex; flex-direction: column; }
body.ma-app-mode #btnSubmitPayment,
body.ma-app-mode #btnSubmitPayment.ma-submit-green {
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 168px;
  max-width: 220px;
  margin: 0.75rem auto 0;
  padding: 0.82rem 1.6rem;
  border: none;
  border-radius: 12px;
  background: #16a34a !important;
  color: #fff !important;
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
  box-shadow: none;
}
.ma-shop-picker { position: relative; }
.ma-shop-picker-btn {
  width: 100%;
  text-align: left;
  background: #0f172a;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 0.72rem 0.85rem;
  cursor: pointer;
}
.ma-shop-picker-btn .ma-shop-name,
.ma-shop-picker-item .ma-shop-name {
  display: block;
  font-weight: 700;
  font-size: 0.92rem;
  color: #f8fafc;
}
.ma-shop-picker-btn .ma-shop-gst,
.ma-shop-picker-item .ma-shop-gst {
  display: block;
  font-weight: 400;
  font-size: 0.72rem;
  color: rgba(148,163,184,0.55);
  letter-spacing: 0.04em;
  font-family: ui-monospace, monospace;
  margin-top: 0.12rem;
}
.ma-shop-picker-list {
  display: none;
  position: absolute;
  left: 0; right: 0; top: calc(100% + 6px);
  z-index: 30;
  max-height: 240px;
  overflow-y: auto;
  background: #0f172a;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 0.3rem;
}
.ma-shop-picker.open .ma-shop-picker-list { display: block; }
.ma-shop-picker-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  cursor: pointer;
}
.ma-shop-picker-item.selected,
.ma-shop-picker-item:active { background: rgba(22,163,74,0.12); }

html.ma-light .ma-shop-picker-btn,
html.ma-light .ma-shop-picker-list {
  background: #ffffff;
  border-color: #dbe3ee;
}
html.ma-light .ma-shop-picker-btn .ma-shop-name,
html.ma-light .ma-shop-picker-item .ma-shop-name { color: #0f172a; }
html.ma-light .ma-shop-picker-btn .ma-shop-gst,
html.ma-light .ma-shop-picker-item .ma-shop-gst { color: rgba(100,116,139,0.7); }

@media (min-width: 700px) {
  .ma-amt-chip { font-size: 1.45rem; }
}

html.ma-light, html.ma-light body, body.ma-light.ma-app-mode {
  background: #f4f6fb !important;
  color: #0f172a;
}
html.ma-light .ma-root { background: #f4f6fb; }
html.ma-light .ma-header {
  background: #ffffff;
  border-bottom-color: #e2e8f0;
}
html.ma-light .ma-header h1 { color: #0f172a; }
html.ma-light .ma-header p { color: #64748b; }
html.ma-light .ma-icon-btn {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(220, 38, 38, 0.35);
  color: #dc2626;
}
html.ma-light .ma-approval-banner,
html.ma-light .ma-bill-alert {
  background:
    radial-gradient(130% 95% at 0% 0%, rgba(255, 122, 24, 0.28) 0%, rgba(255, 122, 24, 0.08) 40%, rgba(255, 122, 24, 0) 70%),
    #fff7ed;
  border-color: rgba(255, 140, 50, 0.28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
}
html.ma-light .ma-approval-banner h3,
html.ma-light .ma-bill-alert h3 { color: #ea580c; }
html.ma-light .ma-approval-item {
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(255, 140, 50, 0.18);
}
html.ma-light .ma-balance-card,
html.ma-light .ma-shop-row,
html.ma-light .ma-shop-group,
html.ma-light .ma-grand-item,
html.ma-light .ma-detail-card,
html.ma-light .ma-list-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}
html.ma-light .ma-shop-name,
html.ma-light .ma-detail-card h3,
html.ma-light .ma-detail-row .val,
html.ma-light .ma-grand-item .v,
html.ma-light .ma-group-metrics strong,
html.ma-light .ma-ledger td,
html.ma-light .ma-amt-chip { color: #0f172a; }
html.ma-light .ma-shop-gst,
html.ma-light .ma-shop-sub,
html.ma-light .ma-balance-label,
html.ma-light .ma-balance-hint,
html.ma-light .ma-section-title,
html.ma-light .ma-grand-item .k,
html.ma-light .ma-group-metrics span,
html.ma-light .ma-detail-row .lbl,
html.ma-light .ma-ledger th,
html.ma-light .ma-empty { color: #64748b; }
html.ma-light .ma-amt-chip.pos, html.ma-light .ma-grand-item .v.pos, html.ma-light .ma-ledger td.pos, html.ma-light .ma-group-metrics strong.pos { color: #15803d; }
html.ma-light .ma-amt-chip.neg, html.ma-light .ma-grand-item .v.neg, html.ma-light .ma-ledger td.neg, html.ma-light .ma-group-metrics strong.neg { color: #dc2626; }
html.ma-light .ma-amt-chip.cyan, html.ma-light .ma-grand-item .v.cyan { color: #0369a1; }
html.ma-light .ma-rename-btn {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0369a1;
}
html.ma-light .ma-del-btn {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}
html.ma-light .ma-chip.active { background: #e0f2fe; border-color: #0284c7; color: #0c4a6e; }
html.ma-light .ma-table-wrap { border-color: #e2e8f0; background: #fff; }
html.ma-light .ma-ledger th { background: #f8fafc; }
html.ma-light .ma-ledger td { border-top-color: #eef2f7; }
html.ma-light .ma-filter-row select {
  background: #ffffff;
  color: #0f172a;
  border-color: #dbe3ee;
}
html.ma-light .ma-back {
  color: #0369a1;
  border-color: rgba(3, 105, 161, 0.28);
  background: #fff;
}
html.ma-light .ma-form-card {
  background: #ffffff;
  border-color: #e2e8f0;
}
html.ma-light .ma-form-group label { color: #64748b; }
html.ma-light .ma-form-group .form-control {
  background: #f8fafc;
  border-color: #dbe3ee;
  color: #0f172a;
}
html.ma-light .ma-pdf-mark:after { border-color: transparent #ffffff transparent transparent; }
html.ma-light .ma-dl-btn { background: #eff6ff; border-color: #bfdbfe; color: #0369a1; }
html.ma-light .ma-dl-btn.green { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
html.ma-light .ma-dl-btn.amber { background: #fffbeb; border-color: #fde68a; color: #b45309; }
html.ma-light .ma-dl-btn.red { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
html.ma-light.ma-app-mode .mobile-bottom-nav {
  background: #ffffff;
  border-top-color: #e2e8f0;
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.06);
}
html.ma-light.ma-app-mode .mbn-btn { color: #64748b; }
html.ma-light.ma-app-mode .mbn-btn.active {
  color: #0369a1;
  background: rgba(14, 165, 233, 0.12);
}
html.ma-light.ma-app-mode .mbn-btn.active .mbn-icon svg { stroke: #0284c7; }
html.ma-light.ma-app-mode .modal-overlay { background: #e8eef6; }
html.ma-light.ma-app-mode .modal-box {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
}
html.ma-light.ma-app-mode .modal-header h3 { color: #0f172a; }
html.ma-light.ma-app-mode .form-group label { color: #64748b; }
html.ma-light.ma-app-mode .form-control {
  background: #f8fafc;
  border-color: #dbe3ee;
  color: #0f172a;
}
html.ma-light .ma-overlay { background: #f4f6fb; }
html.ma-light .ma-overlay-header { border-bottom-color: #e2e8f0; }
html.ma-light .ma-overlay-header h2 { color: #0f172a; }

.ta-snack {
  position: fixed;
  top: 68px;
  left: 16px;
  width: 268px;
  height: auto;
  z-index: 40000;
  background: #14532d;
  color: #ecfdf5;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.82rem;
  line-height: 1.35;
  box-shadow: 0 8px 20px rgba(0,0,0,0.28);
}
.ta-snack b {
  display: block;
  font-size: 0.9rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 2px;
}
.ta-snack span { display: block; color: #bbf7d0; }
.ta-snack-warn { background: #78350f; color: #ffedd5; }
.ta-snack-warn span { color: #fed7aa; }
.ta-snack-err { background: #7f1d1d; color: #fee2e2; }
.ta-snack-err span { color: #fecaca; }
html.ma-light .ta-snack { background: #166534; }
html.ma-light .ta-snack-warn { background: #b45309; }
html.ma-light .ta-snack-err { background: #b91c1c; }

html.ma-app-mode.ma-keyboard #mobileBottomNav { display: none !important; }
html.ma-app-mode.ma-keyboard .ta-ai-fab { display: none !important; }
html.ma-app-mode.ma-keyboard .ma-shop-picker-list { display: none !important; }
html.ma-app-mode .ma-shop-picker-list {
  max-height: 160px;
  z-index: 40;
}

.ta-ai-fab {
  position: fixed;
  right: 16px;
  bottom: 84px;
  z-index: 80;
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 16px;
  background: #4f46e5;
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  box-shadow: 0 8px 18px rgba(79,70,229,0.35);
}
.ta-ai-panel {
  position: fixed;
  inset: 0;
  z-index: 30000;
  display: none;
  background: #0b1220;
  padding: 0 0 12px;
}
.ta-ai-panel.ta-ai-open { display: block; }
.ta-ai-head {
  display: block;
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.ta-ai-head h2 { margin: 0; font-size: 1.05rem; color: #fff; }
.ta-ai-head p { margin: 2px 0 0; font-size: 0.72rem; color: #94a3b8; }
.ta-ai-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: #1e293b;
  color: #e2e8f0;
  font-size: 1rem;
}
.ta-ai-msgs {
  height: calc(100vh - 210px);
  overflow-y: auto;
  padding: 12px 14px;
}
.ta-ai-bubble {
  max-width: 92%;
  margin: 0 0 10px;
  padding: 9px 11px;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.45;
  white-space: pre-wrap;
}
.ta-ai-bubble.user { margin-left: auto; background: #1d4ed8; color: #fff; }
.ta-ai-bubble.bot { background: #1e293b; color: #e2e8f0; }
.ta-ai-bubble.wait { color: #94a3b8; }
.ta-ai-chips { display: block; padding: 0 12px 8px; }
.ta-ai-chips button {
  display: inline-block;
  margin: 0 6px 6px 0;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  background: #111827;
  color: #cbd5e1;
  font-size: 0.75rem;
}
.ta-ai-input { padding: 0 12px; }
.ta-ai-input input {
  display: block;
  width: 100%;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: #111827;
  color: #fff;
  padding: 0 12px;
  font-size: 0.95rem;
  margin: 0 0 8px;
}
.ta-ai-input button {
  display: block;
  width: 100%;
  height: 42px;
  border: none;
  border-radius: 12px;
  background: #4f46e5;
  color: #fff;
  font-weight: 700;
}
html.ma-light .ta-ai-panel { background: #f1f5f9; }
html.ma-light .ta-ai-head h2 { color: #0f172a; }
html.ma-light .ta-ai-bubble.bot { background: #fff; color: #0f172a; }
html.ma-light .ta-ai-input input { background: #fff; color: #0f172a; border-color: #dbe3ee; }

/* ERLife-style dark theme: charcoal + mint green + amber glow. No backdrop-filter. */
html.ma-app-mode:not(.ma-light),
html.ma-app-mode:not(.ma-light) body,
body.ma-app-mode:not(.ma-light) {
  background: #08090c !important;
  background-image:
    radial-gradient(120% 70% at 0% 0%, rgba(46, 229, 157, 0.10) 0%, transparent 46%),
    radial-gradient(90% 50% at 100% 8%, rgba(168, 85, 247, 0.08) 0%, transparent 42%) !important;
  color: #f4f7f5;
}
html.ma-app-mode:not(.ma-light) .ma-root {
  background: transparent;
}
html.ma-app-mode:not(.ma-light) .ma-header {
  background: rgba(8, 9, 12, 0.96);
  border-bottom-color: rgba(255,255,255,0.05);
}
html.ma-app-mode:not(.ma-light) .ma-header-logo {
  background: #2ee59d;
  color: #052e1c;
}
html.ma-app-mode:not(.ma-light) .ma-icon-btn.ma-icon-reload {
  border-color: rgba(46, 229, 157, 0.4);
  background: rgba(46, 229, 157, 0.12);
  color: #2ee59d;
}
html.ma-app-mode:not(.ma-light) .ma-icon-btn.ma-icon-reload svg { stroke: #2ee59d; }
html.ma-app-mode:not(.ma-light) .ma-btn-primary,
html.ma-app-mode:not(.ma-light) .ma-btn-green,
html.ma-app-mode:not(.ma-light) .ma-add-fund-row .ma-btn-primary,
html.ma-app-mode:not(.ma-light) #btnSubmitPayment,
html.ma-app-mode:not(.ma-light) #btnSubmitPayment.ma-submit-green {
  background: #2ee59d !important;
  color: #052e1c !important;
  border: none;
  box-shadow: 0 8px 22px rgba(46, 229, 157, 0.18);
}
html.ma-app-mode:not(.ma-light) .ma-balance-card,
html.ma-app-mode:not(.ma-light) .ma-grand-item,
html.ma-app-mode:not(.ma-light) .ma-shop-row,
html.ma-app-mode:not(.ma-light) .ma-list-card,
html.ma-app-mode:not(.ma-light) .ma-shop-group,
html.ma-app-mode:not(.ma-light) .ma-detail-card,
html.ma-app-mode:not(.ma-light) .ma-form-card,
html.ma-app-mode:not(.ma-light) .ma-drill-shop {
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(46, 229, 157, 0.12) 0%, transparent 55%),
    #14161a;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
html.ma-app-mode:not(.ma-light) .ma-balance-card.bills {
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(56, 189, 248, 0.16) 0%, transparent 58%),
    #14161a;
  border-top: 0;
}
html.ma-app-mode:not(.ma-light) .ma-balance-card.cash {
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(46, 229, 157, 0.20) 0%, transparent 58%),
    #14161a;
  border-top: 0;
}
html.ma-app-mode:not(.ma-light) .ma-balance-value.pos,
html.ma-app-mode:not(.ma-light) .ma-shop-amt.pos,
html.ma-app-mode:not(.ma-light) .ma-grand-item .v.pos,
html.ma-app-mode:not(.ma-light) .ma-amt-chip.pos,
html.ma-app-mode:not(.ma-light) .ma-ledger td.pos {
  color: #2ee59d;
}
html.ma-app-mode:not(.ma-light) .ma-grand-item .v.cyan,
html.ma-app-mode:not(.ma-light) .ma-amt-chip.cyan {
  color: #7dd3fc;
}
html.ma-app-mode:not(.ma-light) .ma-shop-group { border-left: 0; }
html.ma-app-mode:not(.ma-light) .ma-shop-group.cash {
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(46, 229, 157, 0.16) 0%, transparent 58%),
    #14161a;
}
html.ma-app-mode:not(.ma-light) .ma-chip {
  background: #1a1c20;
  border-color: rgba(255,255,255,0.08);
  color: #cbd5e1;
  border-radius: 999px;
}
html.ma-app-mode:not(.ma-light) .ma-chip.active {
  background: #2ee59d;
  border-color: #2ee59d;
  color: #052e1c;
}
html.ma-app-mode:not(.ma-light) .ma-filter-row select,
html.ma-app-mode:not(.ma-light) .ma-form-group .form-control,
html.ma-app-mode:not(.ma-light) .form-control,
html.ma-app-mode:not(.ma-light) .ma-shop-picker-btn,
html.ma-app-mode:not(.ma-light) .ma-shop-picker-list,
html.ma-app-mode:not(.ma-light) .ma-login-card select {
  background: #101214;
  border-color: rgba(255,255,255,0.08);
  color: #f4f7f5;
}
html.ma-app-mode:not(.ma-light) .ma-table-wrap {
  border-color: rgba(255,255,255,0.06);
  background: #14161a;
}
html.ma-app-mode:not(.ma-light) .ma-ledger th {
  background: #101214;
  color: #94a3b8;
}
html.ma-app-mode:not(.ma-light) .ma-back {
  color: #2ee59d;
  border-color: rgba(46, 229, 157, 0.35);
}
html.ma-app-mode:not(.ma-light) .ma-rename-btn {
  border-color: rgba(46, 229, 157, 0.3);
  background: rgba(46, 229, 157, 0.1);
  color: #2ee59d;
}
html.ma-app-mode:not(.ma-light) .ma-dl-btn {
  border-color: rgba(46, 229, 157, 0.28);
  background: rgba(46, 229, 157, 0.1);
  color: #2ee59d;
}
html.ma-app-mode:not(.ma-light) .mobile-bottom-nav {
  background: #0c0d10;
  border-top: 1px solid rgba(255,255,255,0.05);
  box-shadow: 0 -10px 28px rgba(0,0,0,0.35);
}
html.ma-app-mode:not(.ma-light) .mbn-btn { color: #6b7280; }
html.ma-app-mode:not(.ma-light) .mbn-btn.active {
  color: #2ee59d;
  background: rgba(46, 229, 157, 0.14);
  font-weight: 700;
}
html.ma-app-mode:not(.ma-light) .mbn-btn.active .mbn-icon svg { stroke: #2ee59d; }
html.ma-app-mode:not(.ma-light) .modal-overlay { background: #08090c !important; }
html.ma-app-mode:not(.ma-light) .modal-box {
  background: #14161a;
  border-color: rgba(255,255,255,0.08);
}
html.ma-app-mode:not(.ma-light) .ma-overlay { background: #08090c; }
html.ma-app-mode:not(.ma-light) .ta-ai-fab {
  background: #2ee59d;
  color: #052e1c;
  border-radius: 50%;
  box-shadow: 0 8px 20px rgba(46, 229, 157, 0.28);
}
html.ma-app-mode:not(.ma-light) .ta-ai-panel { background: #08090c; }
html.ma-app-mode:not(.ma-light) .ta-ai-input button {
  background: #2ee59d;
  color: #052e1c;
}
html.ma-app-mode:not(.ma-light) .ta-ai-bubble.user {
  background: #2ee59d;
  color: #052e1c;
}
html.ma-app-mode:not(.ma-light) .ma-login {
  background: #08090c;
}
html.ma-app-mode:not(.ma-light) .ma-login-card {
  background: #14161a;
  border-color: rgba(255,255,255,0.06);
}
html.ma-app-mode:not(.ma-light) .ma-logo {
  background: #2ee59d;
  color: #052e1c;
  box-shadow: 0 12px 28px rgba(46, 229, 157, 0.22);
}
