/* CEK METERAN — Modern Colorful Mobile App
   Presentation only; no changes to data, authentication or business logic.
   Loaded after base v10 and approved responsive v3 CSS. */
.mobile-bottom-nav { display: none; }

@media (max-width: 700px) {
  :root {
    --m-ink: #163449;
    --m-muted: #607789;
    --m-teal: #0d9488;
    --m-blue: #2563eb;
    --m-purple: #7c3aed;
    --m-amber: #d97706;
    --m-line: #e5ebf5;
    --m-shadow: 0 9px 26px rgba(30, 61, 105, .075);
  }
  html { background: #f5f7fc; }
  body { background: #f5f7fc; color: var(--m-ink); }
  .layout {
    background:
      radial-gradient(ellipse 280px 220px at 0 90px, rgba(99, 102, 241, .055), transparent 80%),
      radial-gradient(ellipse 300px 230px at 100% 310px, rgba(13, 148, 136, .065), transparent 80%),
      #f5f7fc;
    min-height: 100dvh;
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .main { width: 100% !important; padding-bottom: 4px; }
  .content {
    width: 100%;
    padding: 19px 14px 20px;
    max-width: 100%;
  }
  .topbar {
    background: rgba(255,255,255,.96) !important;
    border-bottom: 1px solid #e9edf7;
    box-shadow: 0 5px 18px rgba(34, 65, 99, .045);
    color: var(--m-ink);
    min-height: 66px;
    z-index: 150 !important;
  }
  .topbar .eyebrow { color: #0e9488; font-size: 9px !important; letter-spacing: .9px !important; font-weight: 800; }
  .topbar h2 { font-size: 16px !important; color: var(--m-ink); letter-spacing: -.3px; }
  .top-right { color: var(--m-muted); }
  .top-right .status-dot { background: #10b981; box-shadow: 0 0 0 4px #dcfce7; }
  .mobile-menu-btn { display: none !important; } /* Bottom 'Lainnya' opens the existing drawer. */
  .mobile-logout {
    display: inline-flex;
    width: 39px;
    height: 39px;
    flex: 0 0 39px;
    border-radius: 13px;
    border-color: #e2eafa;
    color: #475b78;
    background: #f7faff;
  }

  /* Fixed bottom navigation. Drawer/backdrop retain their original higher z-indices. */
  .mobile-bottom-nav {
    position: fixed;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    gap: 2px;
    inset: auto 0 0;
    z-index: 1080;
    box-sizing: border-box;
    width: 100%;
    height: calc(74px + env(safe-area-inset-bottom, 0px));
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom, 0px));
    border: 1px solid #e4ebf6;
    border-bottom: none;
    border-radius: 22px 22px 0 0;
    background: rgba(255,255,255,.98);
    box-shadow: 0 -7px 30px rgba(34,62,109,.12);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
  }
  .mobile-bottom-item {
    appearance: none;
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    min-height: 54px;
    padding: 6px 1px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: #718196;
    text-decoration: none;
    font-family: inherit;
    font-size: 10px;
    font-weight: 750;
    line-height: 1.14;
    letter-spacing: -.15px;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    transition: background .16s ease, color .16s ease;
  }
  .mobile-bottom-item > svg { flex-shrink: 0; width: 21px; height: 21px; }
  .mobile-bottom-item > span:last-child { overflow: hidden; max-width: 100%; text-overflow: ellipsis; }
  .mobile-bottom-item.active { color: #087e75; background: #e2f7f3; }
  .mobile-bottom-item:nth-child(2).active { background: #e8f0ff; color: #1d4ed8; }
  .mobile-bottom-item:nth-child(3).active { background: #f0eafe; color: #6d28d9; }
  .mobile-bottom-item:nth-child(4).active { background: #fff2df; color: #a35a06; }
  .mobile-bottom-item:hover { background: #f0f5fa; }
  .mobile-bottom-item.active:hover { filter: brightness(.985); }
  .mobile-bottom-item:focus-visible,
  .sidebar.mobile-drawer .nav-item:focus-visible,
  .btn:focus-visible,
  .mobile-logout:focus-visible { outline: 3px solid #0d948877; outline-offset: 2px; }
  .mobile-bottom-more-icon {
    display: block;
    flex-shrink: 0;
    width: 21px;
    height: 21px;
    background: radial-gradient(circle at 25% 25%, currentColor 3px, transparent 3.6px),
                radial-gradient(circle at 75% 25%, currentColor 3px, transparent 3.6px),
                radial-gradient(circle at 25% 75%, currentColor 3px, transparent 3.6px),
                radial-gradient(circle at 75% 75%, currentColor 3px, transparent 3.6px);
  }

  /* Catat Meter shortcut: centered above the existing bottom navigation. */
  .layout.has-meter-shortcut { padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px)) !important; }
  .mobile-bottom-nav.has-meter-fab {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: end;
    gap: 1px;
  }
  .mobile-bottom-nav.has-meter-fab .mobile-bottom-item { width: 100%; }
  .mobile-bottom-nav.has-meter-fab .mobile-bottom-more { grid-column: 5; }
  .mobile-bottom-nav .mobile-bottom-fab {
    grid-column: 3;
    position: relative;
    top: -12px;
    min-height: 78px;
    margin: 0;
    padding: 0;
    gap: 3px;
    justify-content: flex-start;
    overflow: visible;
    color: #087f8c;
    background: transparent;
    line-height: 1.15;
    white-space: normal;
  }
  .mobile-bottom-fab-circle {
    width: min(56px, 100%);
    height: 56px;
    min-height: 56px;
    border: 4px solid #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #13a6a3, #0876a1);
    box-shadow: 0 5px 16px rgba(11, 126, 144, .28);
    color: #fff;
    box-sizing: border-box;
  }
  .mobile-bottom-fab-plus { font-size: 31px; line-height: 1; font-weight: 500; margin-top: -3px; }
  .mobile-bottom-nav .mobile-bottom-fab-label {
    display: block;
    max-width: 100%;
    overflow: visible;
    font-size: 9px;
    line-height: 1.16;
    font-weight: 800;
    text-align: center;
    white-space: normal;
    text-overflow: clip;
    color: #087f8c;
  }
  .mobile-bottom-nav .mobile-bottom-fab:hover,
  .mobile-bottom-nav .mobile-bottom-fab.active { background: transparent; }
  .mobile-bottom-nav .mobile-bottom-fab:hover .mobile-bottom-fab-circle { filter: brightness(1.07); }
  .mobile-bottom-nav .mobile-bottom-fab:focus-visible { outline: 3px solid #0d948877; outline-offset: 2px; }
  .catat-meter-legacy-toggle { display: none !important; }
  #catat-meter-form { scroll-margin-top: 85px; }
  .layout.has-meter-shortcut .form-panel .form-actions { bottom: calc(108px + env(safe-area-inset-bottom, 0px)); }

  /* Existing drawer remains the full menu and permissions authority. */
  .sidebar.mobile-drawer {
    background: linear-gradient(160deg, #103d60 0%, #16446c 47%, #173750 100%);
    border-right: 1px solid rgba(255,255,255,.10);
  }
  .sidebar.mobile-drawer .brand { border-bottom-color: rgba(255,255,255,.15); }
  .sidebar.mobile-drawer .nav-item {
    border-radius: 14px;
    min-height: 48px;
    transition: background .14s ease;
  }
  .sidebar.mobile-drawer .nav-item.active {
    background: linear-gradient(95deg, rgba(26, 193, 178, .35), rgba(91, 135, 249, .23));
    box-shadow: inset 3px 0 #52e0ce;
  }

  /* Page titles, content surfaces and touch targets. */
  .page-heading { margin: 0 0 18px; gap: 10px; align-items: flex-start; }
  .page-heading h1 {
    font-family: Manrope, 'DM Sans', sans-serif;
    font-size: clamp(21px, 5.7vw, 26px);
    font-weight: 800;
    letter-spacing: -.75px;
    line-height: 1.25;
    color: #18354a;
  }
  .page-heading p { color: #74849a; font-size: 12px; line-height: 1.55; margin-top: 5px; }
  .page-heading > .btn, .heading-actions .btn { min-height: 42px; }
  .panel, .form-panel, .analytics-panel, .dashboard-tab-panel, .account-stat-card {
    background: #fff;
    border: 1px solid var(--m-line);
    border-radius: 19px;
    box-shadow: var(--m-shadow);
  }
  .panel { margin-bottom: 16px; }
  .panel-head { padding: 16px; border-bottom: 1px solid #edf1f8; }
  .panel-head h3 { color: #234056; font-size: 14px; font-weight: 800; }
  .panel-head p { color: #7c8da0; line-height: 1.55; }
  .btn {
    min-height: 42px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 750;
    padding: 10px 14px;
  }
  .btn.primary {
    background: linear-gradient(120deg, #089e91, #087fbe);
    box-shadow: 0 5px 13px rgba(13,148,136,.18);
    color: #fff;
  }
  .btn.primary:hover { background: linear-gradient(120deg, #078a80, #086caa); }
  .btn.secondary { border-color: #dce6f4; background: #fff; color: #38546a; }
  .btn.danger { color: #a8202c; background: #fff0f1; }
  .btn:disabled { box-shadow: none; }
  .badge { border-radius: 999px; padding: 6px 10px; font-weight: 750; }
  .alert { border-radius: 13px; line-height: 1.5; }
  .inline-link, .text-btn { color: #0b8279; }

  /* Card-based dashboard, with meaningful restrained accent color. */
  .dashboard-section-title { font-size: 14px; color: #344d66; margin: 0 0 12px; }
  .dashboard-stat-section { margin-bottom: 20px; }
  .dashboard-stats-grid, .stats-grid, .report-stats, .analytics-stats, .account-stat-grid {
    gap: 11px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat-card {
    position: relative;
    overflow: hidden;
    min-height: 137px;
    padding: 16px 14px;
    border: 1px solid #e6edf8;
    border-radius: 18px;
    background: linear-gradient(145deg, #fff 40%, #f1fbfa 100%);
    box-shadow: var(--m-shadow);
  }
  .stat-card:nth-child(4n + 2) { background: linear-gradient(145deg, #fff 35%, #edf4ff 100%); }
  .stat-card:nth-child(4n + 3) { background: linear-gradient(145deg, #fff 35%, #f3eeff 100%); }
  .stat-card:nth-child(4n + 4) { background: linear-gradient(145deg, #fff 35%, #fff5e9 100%); }
  .stat-icon { width: 37px; height: 37px; border-radius: 12px; margin-bottom: 12px; }
  .stat-label { min-height: 0; font-size: 11px; font-weight: 650; color: #647a8e; }
  .stat-value { font-size: clamp(19px, 5.4vw, 25px); font-weight: 800; color: #173952; }
  .stat-hint { color: #8695a5; font-size: 10px; }
  .stat-card-link { padding-bottom: 33px; }
  .stat-open-hint { color: #078a80; bottom: 10px; }
  .account-stat-card, .analytics-stat {
    min-width: 0;
    border-radius: 17px;
    padding: 15px;
    background: linear-gradient(145deg, #fff, #f6f9ff);
  }
  .account-stat-card strong, .analytics-stat strong { font-size: clamp(19px, 5.5vw, 25px); color: #214260; }
  .dashboard-tabs, .account-tabs {
    border-radius: 15px;
    border-color: #e4eaf5;
    background: #eaf0f8;
    padding: 5px;
  }
  .dashboard-tab, .account-tab { min-height: 43px; border-radius: 11px; font-size: 12px; }
  .dashboard-tab.active, .account-tab.active { color: #0b8378; background: #fff; box-shadow: 0 4px 10px #1a396014; }
  .dashboard-progress-panel { border-radius: 18px; }
  .dashboard-bar-column .bar-track span, .bar-track > span { background: linear-gradient(180deg, #7e83ff 0%, #2b88dc 55%, #17a998 100%); }
  .dashboard-bars-six { border-radius: 14px; }
  .dashboard-bar-column > b { color: #36516d; }
  .chart-unit { color: #718397; }

  /* Search, filters and forms across checking, customers, periods and accounts. */
  .search-box {
    width: 100%;
    min-height: 46px;
    border-radius: 13px;
    border-color: #e2e9f4;
    background: #f8faff;
    padding: 10px 13px;
  }
  .search-box input { font-size: 14px; background: transparent; }
  .form-grid { grid-template-columns: minmax(0, 1fr); padding: 0 15px; gap: 15px; }
  .form-grid label { color: #405e73; font-size: 12px; gap: 8px; }
  .form-grid input, .form-grid select, .form-grid textarea,
  .login-form input, .report-filter select, .account-form input, .account-form select {
    max-width: 100%;
    min-height: 46px;
    border: 1px solid #dae5f1;
    border-radius: 12px;
    background: #f9fbff;
    color: #244254;
    font-size: 16px;
  }
  textarea { min-height: 95px; }
  input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid rgba(13,148,136,.34); outline-offset: 1px; }
  .form-panel .form-actions {
    bottom: calc(73px + env(safe-area-inset-bottom, 0px));
    margin: 14px 0 0;
    padding: 12px 14px;
    background: rgba(255,255,255,.97);
    border-top: 1px solid #e8edf5;
    box-shadow: 0 -5px 17px #173b3d0c;
    border-radius: 0 0 18px 18px;
  }
  .form-panel .form-actions .btn { min-height: 46px; flex: 1 1 auto; }
  .review-summary { border-radius: 14px; }
  .photo-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .photo-actions .btn, .photo-pick { min-height: 48px; border-radius: 12px; }
  .photo-preview-wrap { max-width: 100%; }

  /* Analytics, reporting, detail tables and long text. */
  .analytics-panel { padding: 16px; }
  .analytics-columns, .dashboard-chart-grid, .report-grid, .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .analytics-status-row { grid-template-columns: minmax(75px, 1fr) 36px minmax(55px, 1fr); gap: 7px; font-size: 11px; }
  .analytics-status-row > span { overflow-wrap: anywhere; }
  .analytics-trend-row { gap: 8px; }
  .analytics-bar-track { border-radius: 999px; overflow: hidden; }
  .analytics-bar { background: linear-gradient(90deg, #17b3a8, #4f86f7); }
  .report-filter { flex-wrap: wrap; padding: 14px; }
  .report-filter label, .report-filter select { width: 100%; max-width: 100%; }
  .report-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .report-actions .btn { min-width: 0; white-space: normal; line-height: 1.35; }
  .table-wrap, .dashboard-detail-table, .analytics-modal-table {
    max-width: 100%;
    overflow-x: auto;
    scrollbar-color: #b9ccdf #f4f7fc;
    -webkit-overflow-scrolling: touch;
  }
  th { background: #f4f8fd; color: #6d8294; }
  td { color: #445d70; }
  .modal, .dialog, [role="dialog"], .analytics-modal { border-radius: 18px; }

  /* Login screen also receives the mobile visual system. */
  .login-page { min-height: 100dvh; background: linear-gradient(160deg, #e5f7f4 0%, #eef2ff 44%, #fafbff 85%); }
  .login-form-wrap { padding: 28px 20px; min-height: 100dvh; }
  .login-form {
    max-width: 420px;
    padding: 28px 22px;
    border: 1px solid #e2eaf6;
    border-radius: 24px;
    background: rgba(255,255,255,.95);
    box-shadow: 0 18px 44px rgba(39,62,106,.12);
  }
  .login-form h2 { color: #173b53; }
  .login-form .btn.primary { min-height: 48px; }
}

@media (max-width: 360px) {
  .content { padding: 15px 10px 18px; }
  .mobile-bottom-nav { padding-left: 5px; padding-right: 5px; gap: 0; }
  .mobile-bottom-item { font-size: 9px; letter-spacing: -.25px; }
  .mobile-bottom-item > svg, .mobile-bottom-more-icon { width: 19px; height: 19px; }
  .stat-card { padding: 13px 11px; min-height: 126px; }
  .stats-grid, .dashboard-stats-grid, .report-stats, .analytics-stats, .account-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .photo-actions { grid-template-columns: minmax(0, 1fr); }
  .report-actions { grid-template-columns: minmax(0, 1fr); }
  .topbar .eyebrow { font-size: 8px !important; }
}

@media (max-width: 700px) and (orientation: landscape) and (max-height: 470px) {
  .mobile-bottom-nav { height: calc(60px + env(safe-area-inset-bottom, 0px)); padding-top: 3px; padding-bottom: calc(3px + env(safe-area-inset-bottom, 0px)); }
  .layout { padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px)) !important; }
  .form-panel .form-actions { position: static; }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-bottom-item { transition: none !important; }
}
