:root{
  --argos-deep: #0A1F44;
  --argos-tech: #3D8BFF;
  --argos-gray: #B0B5BF;
  --argos-danger: #E9414E;
  --argos-white: #FFFFFF;

  --bg: var(--argos-deep);
  --surface: var(--argos-white);
  --text: var(--argos-deep);
  --muted: #5f6b83;
  --line: rgba(176,181,191,0.55);
  --brand: var(--argos-tech);
  --brand-ink: #062a6c;
  --danger: var(--argos-danger);
  --success: #1b7a55;

  --sidebar-width: 280px;
  --sidebar-mini-width: 84px;
}

*{ box-sizing: border-box; }

body{
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif !important;
  background:
    radial-gradient(1200px 700px at 10% 10%, rgba(61,139,255,0.18), transparent 60%),
    radial-gradient(900px 520px at 85% 25%, rgba(61,139,255,0.10), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,0.06), transparent 40%),
    var(--bg) !important;
  color: var(--text);
}

html, body{
  max-width: 100%;
  overflow-x: hidden;
}

/* Shell + Sidebar */
.shell{
  display: grid !important;
  grid-template-columns: var(--sidebar-width) 1fr !important;
  min-height: 100vh !important;
  align-items: stretch !important;
}

.sidebar{
  padding: 22px 18px !important;
  background: #1f2d3d !important;
  color: rgba(255,255,255,0.92) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 18px !important;
  border-right: 1px solid rgba(255,255,255,0.08) !important;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar.adminlte-menu{
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.06);
}

.sidebar .brand-link{
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #d6e4f5;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  padding: 4px 2px 12px;
  margin-bottom: 4px;
}
.sidebar .brand-image{
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.sidebar .brand-text{
  font-size: 0.9rem;
  font-weight: 600 !important;
  letter-spacing: 0.02em;
}

.sidebar-head{
  display: grid;
  gap: 8px;
  margin: 2px 0 8px;
}
.sidebar-tenant-top{
  font-size: 0.84rem;
  color: rgba(216, 228, 245, 0.95);
  font-weight: 600;
  line-height: 1.3;
  padding: 0 2px;
}
.sidebar-head-block{
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255,255,255,0.04);
}
.sidebar-head-title{
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(192,208,228,0.88);
  margin-bottom: 6px;
  font-weight: 700;
}
.sidebar-head-select{
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.14);
  color: #fff;
  font-size: 0.82rem;
}
.sidebar-head-select option{
  color: #0A1F44;
}

.sidebar-top{
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 4px;
  border-top: 1px solid rgba(255,255,255,0.10);
}

.sidebar-user{
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
  flex: 1;
}

.sidebar-avatar{
  width: 54px;
  height: 54px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 6px;
  flex-shrink: 0;
}

.sidebar-avatar img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.sidebar-user-meta{
  min-width: 0;
}
.sidebar-user-kicker{
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(176,181,191,0.92);
}
.sidebar-user-name{
  font-weight: 650;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-actions{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}
.sidebar-logout{
  color: rgba(255,255,255,0.82) !important;
  text-decoration: none;
  font-weight: 600;
}
.sidebar-logout:hover{ color: #ffffff !important; }

.sidebar-toggle{
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: #ffffff;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.sidebar-toggle:hover{ background: rgba(255,255,255,0.10); }
.shell.is-mini .sidebar-toggle svg{ transform: rotate(180deg); }
.sidebar-mobile-close{
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.08);
  color: #ffffff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.sidebar-mobile-close:hover{ background: rgba(255,255,255,0.14); }

.sidebar-peek-tab{
  position: absolute;
  top: 92px;
  right: -13px;
  width: 26px;
  height: 54px;
  border-radius: 0 12px 12px 0;
  border: 1px solid rgba(255,255,255,0.18);
  border-left: 0;
  background: rgba(6,16,35,0.98);
  color: #ffffff;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 8px 14px 18px rgba(0,0,0,0.28);
  z-index: 6;
}
.sidebar-peek-tab:hover{
  background: rgba(61,139,255,0.3);
}

.sidebar-brand{
  padding-top: 6px;
}
.sidebar-kicker{
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(176,181,191,0.92) !important;
}
.sidebar-app{
  margin: 6px 0 0;
  font-family: Montserrat, Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 1.08rem;
  letter-spacing: 0.01em;
}
.sidebar-tenant{
  margin: 6px 0 0;
  color: rgba(255,255,255,0.72);
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav{
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
}
.sidebar-group{
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}
.sidebar-group-toggle{
  width: 100%;
  background: rgba(255,255,255,0.02) !important;
  border: 1px solid rgba(255,255,255,0.09) !important;
  color: rgba(229,238,250,0.95);
  padding: 7px 9px !important;
  border-radius: 8px !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  min-height: 36px;
}
.sidebar-group-title{
  font-size: 0.68rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  color: rgba(192,208,228,0.82) !important;
  font-weight: 700;
}
.sidebar-group-arrow{
  width: 14px;
  height: 14px;
  color: rgba(207,223,244,0.92);
  transform: rotate(0deg);
  transition: transform 150ms ease;
}
.sidebar-group-toggle:hover{
  background: rgba(255,255,255,0.08) !important;
}
.sidebar-group-toggle[aria-expanded="false"] .sidebar-group-arrow{
  transform: rotate(-90deg);
}
.sidebar-group.menu-open .sidebar-group-toggle{
  background: rgba(61,139,255,0.24) !important;
  border-color: rgba(61,139,255,0.45) !important;
}
.sidebar-group-links{
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-left: 8px;
  padding-left: 10px;
  border-left: 1px dashed rgba(255,255,255,0.14);
}
.sidebar-group-links.is-collapsed{
  display: none !important;
}
.sidebar-link{
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  color: rgba(255,255,255,0.90) !important;
  text-decoration: none !important;
  padding: 10px 12px !important;
  border-radius: 14px !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  border-radius: 8px !important;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.sidebar-link-row{
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-link-row .sidebar-link{
  flex: 1;
  min-width: 0;
}

.sidebar-star-form{
  flex-shrink: 0;
}

.sidebar-star{
  width: 30px;
  height: 30px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.80);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  position: relative;
}
.sidebar-star svg{ width: 16px; height: 16px; }
.sidebar-star:hover{
  background: rgba(61,139,255,0.16);
  border-color: rgba(61,139,255,0.22);
  color: #ffffff;
}
.sidebar-star.is-on{
  color: #ffd84d !important;
  background: rgba(255,216,77,0.18) !important;
  border-color: rgba(255,216,77,0.45) !important;
}
.sidebar-star.is-on svg{
  color: #ffd84d !important;
}
.sidebar-star.is-on svg path{
  fill: #ffd84d !important;
  stroke: #ffd84d !important;
}

.shell.is-mini .sidebar-link-row{
  justify-content: center;
}
.shell.is-mini .sidebar-star{
  display: none;
}
.sidebar-link:hover{
  background: rgba(255,255,255,0.08) !important;
  border-color: rgba(255,255,255,0.12) !important;
}
.sidebar-link.active{
  background: #3D8BFF !important;
  border-color: rgba(61,139,255,0.75) !important;
  box-shadow: none;
}
.sidebar-icon{
  width: 16px;
  height: 16px;
  color: #ffffff;
  opacity: 0.88;
  flex-shrink: 0;
}
.sidebar-label{
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.sidebar-footer{
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid rgba(255,255,255,0.10);
  padding-top: 10px;
}
.sidebar-install-btn{
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(61,139,255,0.36);
  background: rgba(61,139,255,0.22) !important;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 600;
}
.sidebar-install-btn:hover{
  background: rgba(61,139,255,0.30) !important;
}
.sidebar-install-label{
  white-space: nowrap;
}
.sidebar-footer-logo{
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.10);
}
.sidebar-footer-logo img{
  width: 160px;
  max-width: 100%;
  height: auto;
  opacity: 0.92;
}
.sidebar-footer-logo-full{ display: block; }
.sidebar-footer-logo-mark{ display: none; width: 44px; }

/* Page + cards */
.page{
  padding: 20px !important;
  color: var(--argos-white);
}

/* Desktop: keep independent scrollbars for sidebar and main content */
@media (min-width: 981px){
  html, body{
    height: 100%;
  }

  body{
    overflow: hidden;
  }

  .shell{
    grid-template-rows: 1fr;
    height: 100vh !important;
    min-height: 100vh !important;
    overflow: hidden;
  }

  .sidebar{
    height: 100vh;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .page{
    height: 100vh;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
  }
}

.topbar{
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
}

.topbar-left{
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-menu{
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.08);
  color: #ffffff;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.topbar-menu:hover{ background: rgba(255,255,255,0.12); }

.card{
  background: rgba(255,255,255,0.96) !important;
  border: 1px solid rgba(176,181,191,0.38) !important;
  color: var(--text) !important;
  box-shadow: 0 14px 32px rgba(0,0,0,0.18) !important;
}

button{
  background: var(--brand);
  color: #fff;
}
button:hover{
  filter: brightness(0.95);
}

button.ghost{
  background: #fff !important;
  color: var(--brand) !important;
  border: 1px solid rgba(176,181,191,0.55) !important;
}
button.ghost:hover{
  background: rgba(61,139,255,0.08) !important;
}

.form-actions-inline{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.form-actions-inline a{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(176,181,191,0.55);
  background: #fff;
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}
.form-actions-inline a:hover{
  background: rgba(61,139,255,0.08);
}

.tab-link, .subtab-link{
  color: var(--brand) !important;
  border-color: rgba(176,181,191,0.45) !important;
  background: rgba(255,255,255,0.88) !important;
}
.tab-link.active, .subtab-link.active{
  background: var(--brand) !important;
  color: #ffffff !important;
  border-color: rgba(61,139,255,0.65) !important;
}

input, select, textarea{
  border-color: rgba(176,181,191,0.55) !important;
}
input:focus, select:focus, textarea:focus{
  outline: none;
  border-color: rgba(61,139,255,0.70) !important;
  box-shadow: 0 0 0 3px rgba(61,139,255,0.18);
}

input.argos-invalid,
select.argos-invalid,
textarea.argos-invalid,
.form-control.argos-invalid{
  border-color: rgba(233,65,78,0.9) !important;
  background: rgba(233,65,78,0.08) !important;
  color: #8f1f2a !important;
  box-shadow: 0 0 0 2px rgba(233,65,78,0.16) !important;
}

input.argos-invalid:focus,
select.argos-invalid:focus,
textarea.argos-invalid:focus,
.form-control.argos-invalid:focus{
  border-color: rgba(233,65,78,1) !important;
  box-shadow: 0 0 0 3px rgba(233,65,78,0.22) !important;
}

.flash.success{
  border-left-color: rgba(27,122,85,0.95) !important;
}
.flash.error{
  border-left-color: var(--danger) !important;
}
.actions a{
  color: var(--brand) !important;
}

/* Action icons (tables/lists) */
.action-icons{
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  white-space: nowrap !important;
}

.icon-action{
  width: 29px !important;
  height: 29px !important;
  border-radius: 8px !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  color: var(--brand) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  text-decoration: none !important;
  cursor: pointer !important;
}
.icon-action svg{
  width: 17px !important;
  height: 17px !important;
}
.icon-action:hover{
  background: rgba(61,139,255,0.08) !important;
  border-color: rgba(61,139,255,0.28) !important;
}

/* keep "danger" style aligned with brand (requested) */
.icon-action.danger{ color: var(--brand) !important; }
.icon-action.danger:hover{
  background: rgba(61,139,255,0.08) !important;
  border-color: rgba(61,139,255,0.28) !important;
}

/* Tooltip */
.icon-action[data-tooltip]{
  position: relative !important;
}
.icon-action[data-tooltip]::after{
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(2px);
  background: rgba(6, 16, 35, 0.96);
  color: rgba(255,255,255,0.92);
  font-size: 12px;
  line-height: 1;
  padding: 7px 9px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
  z-index: 10;
}
.icon-action[data-tooltip]::before{
  content: '';
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid rgba(6, 16, 35, 0.96);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
  z-index: 10;
}
.icon-action[data-tooltip]:hover::after{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.icon-action[data-tooltip]:hover::before{
  opacity: 1;
}

.row-inactive{
  background: rgba(233,65,78,0.06) !important;
}
.row-inactive .inactive-key{
  color: var(--danger) !important;
  font-weight: 700 !important;
}

.pagination-bar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.pagination-meta{
  color: var(--muted);
  font-size: 0.86rem;
}
.pagination-per-page{
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.pagination-per-page label{
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.pagination-per-page .pagination-select,
.pagination-per-page select{
  margin: 0 !important;
  width: auto;
  min-width: 92px;
  height: 34px;
  padding: 4px 34px 4px 10px !important;
  border: 1px solid var(--line);
  border-radius: 10px;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--brand-dark) 50%),
    linear-gradient(135deg, var(--brand-dark) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  box-shadow: 0 1px 2px rgba(10,31,68,0.06);
}
.pagination-nav{
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.pagination-link{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(176,181,191,0.55);
  color: var(--brand);
  text-decoration: none;
  background: rgba(255,255,255,0.9);
  font-weight: 600;
  font-size: 0.86rem;
}
.pagination-link.active{
  background: var(--brand);
  color: #fff;
  border-color: rgba(61,139,255,0.65);
}

/* Compact mode for smaller screens: prioritize density over large typography */
@media (max-width: 1280px){
  body{
    font-size: 13px !important;
  }

  h1{
    font-size: 1.2rem !important;
  }

  h2{
    font-size: 1rem !important;
  }

  .page{
    padding: 14px !important;
  }

  .card{
    padding: 12px !important;
    border-radius: 14px !important;
  }

  label{
    font-size: 0.72rem !important;
    margin-bottom: 4px !important;
  }

  input,
  select,
  textarea{
    font-size: 12px !important;
    padding: 7px 8px !important;
    margin-bottom: 8px !important;
  }

  button{
    font-size: 12px !important;
    padding: 8px 10px !important;
  }

  .tab-link,
  .subtab-link{
    font-size: 0.72rem !important;
    padding: 7px 9px !important;
  }

  .summary{
    gap: 5px !important;
    overflow-x: visible !important;
  }

  .summary-card{
    min-width: 0 !important;
    flex: 1 1 0 !important;
    padding: 7px 6px !important;
  }

  .summary-label{
    font-size: 0.56rem !important;
  }

  .summary-value{
    font-size: 0.68rem !important;
  }

  .form-grid,
  .filters,
  .item-row,
  .expense-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .field.span-2,
  .field.span-4,
  .filters .full{
    grid-column: auto !important;
  }

  th,
  td{
    padding: 8px 6px !important;
    font-size: 0.78rem !important;
  }
}

@media (max-width: 760px){
  body{
    font-size: 12px !important;
  }

  .form-grid,
  .filters,
  .item-row,
  .expense-grid{
    grid-template-columns: 1fr !important;
  }
}

/* Mini sidebar mode */
.shell.is-mini{
  grid-template-columns: var(--sidebar-mini-width) 1fr !important;
}
.shell.is-mini .sidebar-avatar{ width: 46px; height: 46px; border-radius: 14px; }
.shell.is-mini .sidebar-user-meta,
.shell.is-mini .sidebar-brand,
.shell.is-mini .sidebar-head,
.shell.is-mini .sidebar-group-toggle,
.shell.is-mini .sidebar-label{
  display: none !important;
}
.shell.is-mini .sidebar .brand-text{
  display: none !important;
}
.shell.is-mini .sidebar .brand-link{
  justify-content: center;
}
.shell.is-mini .sidebar-link{
  justify-content: center !important;
  padding: 12px !important;
}
.shell.is-mini .sidebar-footer-logo img{
  width: 42px;
}
.shell.is-mini .sidebar-footer-logo-full{ display: none; }
.shell.is-mini .sidebar-footer-logo-mark{ display: block; }
.shell.is-mini .sidebar-footer-logo{
  justify-content: center;
}
.shell.is-mini .sidebar-install-btn{
  width: 44px;
  padding: 10px 0;
}
.shell.is-mini .sidebar-install-label{
  display: none;
}
.shell.is-mini .sidebar-group-links{
  display: flex !important;
}
.shell.is-mini .sidebar-group-links.is-collapsed{
  display: flex !important;
}
.shell.is-mini .sidebar-peek-tab{
  display: inline-flex;
}
.shell.is-mini .sidebar-peek-tab svg{
  transform: rotate(180deg);
}

.mobile-bottom-nav{
  display: none;
}

.pwa-guide{
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}
.pwa-guide.is-open{
  opacity: 1;
  pointer-events: auto;
}
.pwa-guide-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.52);
}
.pwa-guide-card{
  position: relative;
  width: min(92vw, 420px);
  background: #ffffff;
  border: 1px solid rgba(176,181,191,0.55);
  border-radius: 16px;
  box-shadow: 0 20px 38px rgba(0,0,0,0.30);
  padding: 14px;
  color: #0A1F44;
}
.pwa-guide-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.pwa-guide-close{
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid rgba(176,181,191,0.55);
  background: #fff;
  color: #0A1F44;
  cursor: pointer;
  font-weight: 700;
  line-height: 1;
}
.pwa-guide-subtitle{
  margin: 10px 0 8px;
  color: #445170;
  font-size: 0.88rem;
}
.pwa-guide-steps{
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  font-size: 0.88rem;
}
.pwa-guide-actions{
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}
.pwa-guide-primary{
  border: 1px solid rgba(61,139,255,0.35);
  background: #3D8BFF;
  color: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 600;
}
.pwa-guide-secondary{
  border: 1px solid rgba(176,181,191,0.55);
  background: #fff;
  color: #0A1F44;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 600;
}

.pwa-standalone-badge{
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  right: 10px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(61,139,255,0.35);
  background: rgba(6,16,35,0.92);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 600;
  box-shadow: 0 8px 18px rgba(0,0,0,0.26);
  pointer-events: none;
}
.pwa-standalone-badge .dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #3D8BFF;
  box-shadow: 0 0 0 4px rgba(61,139,255,0.20);
}
.argos-processing-overlay{
  position: fixed;
  inset: 0;
  z-index: 140;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6,16,35,0.48);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}
.argos-processing-overlay.is-visible{
  opacity: 1;
  pointer-events: auto;
}
.argos-processing-card{
  min-width: min(88vw, 340px);
  max-width: 92vw;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  color: #0A1F44;
  border: 1px solid rgba(176,181,191,0.55);
  border-radius: 14px;
  box-shadow: 0 20px 38px rgba(0,0,0,0.30);
  padding: 12px 14px;
  font-size: 0.9rem;
}
.argos-processing-spinner{
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(61,139,255,0.24);
  border-top-color: #3D8BFF;
  animation: argos-spin 800ms linear infinite;
}
@keyframes argos-spin{
  to { transform: rotate(360deg); }
}
@media (min-width: 981px){
  .pwa-standalone-badge{
    font-size: 0.78rem;
  }
}

/* Mobile sidebar overlay */
@media (max-width: 980px){
  body.argos-no-scroll{
    overflow: hidden;
  }
  .shell{
    grid-template-columns: 1fr !important;
  }
  .shell::after{
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
    z-index: 45;
  }
  .shell.is-open::after{
    opacity: 1;
    pointer-events: auto;
  }
  .sidebar{
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: min(320px, 84vw);
    transform: translateX(-102%);
    transition: transform 200ms ease;
    z-index: 50;
    padding: 16px 12px !important;
    gap: 12px !important;
    overflow-y: auto;
    padding-bottom: 24px !important;
  }
  .sidebar-top{
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 2px 0 8px;
    background: rgba(6, 16, 35, 0.96);
    border-top: 0;
  }
  .sidebar-head{
    gap: 6px;
    margin: 2px 0 6px;
  }
  .shell.is-open .sidebar{ transform: translateX(0); }
  .sidebar-toggle{
    display: none;
  }
  .sidebar-mobile-close{
    display: inline-flex;
  }
  .sidebar-peek-tab{
    display: none !important;
  }
  .page{
    padding: 12px !important;
    padding-bottom: 76px !important;
  }

  .sidebar-group{
    gap: 6px !important;
    margin-bottom: 4px;
  }
  .sidebar-link{
    padding: 10px 11px !important;
    border-radius: 10px !important;
  }
  .sidebar-label{
    font-size: 0.85rem;
  }
  .sidebar-group-title{
    font-size: 0.7rem !important;
  }
  .sidebar-star{
    display: none;
  }
  .sidebar-link-row .sidebar-link{
    flex: 1 1 100%;
  }

  .mobile-bottom-nav{
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: 8px;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
    background: rgba(6,16,35,0.96);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    padding: 6px;
    box-shadow: 0 14px 28px rgba(0,0,0,0.32);
  }

  .mobile-bottom-link{
    min-height: 42px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.90);
    text-decoration: none;
    padding: 3px 2px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.56rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
  }

  .mobile-bottom-link .sidebar-icon{
    width: 14px;
    height: 14px;
    opacity: 1;
    flex-shrink: 0;
  }

  .mobile-bottom-link span{
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }

  .mobile-bottom-link.active{
    background: rgba(61,139,255,0.20);
    border-color: rgba(61,139,255,0.45);
    color: #ffffff;
  }

  button.mobile-bottom-link{
    cursor: pointer;
  }
}

/* Unified mobile UX (quote-like) across all pages */
@media (max-width: 900px){
  body{
    background: radial-gradient(1200px 650px at 0% 0%, rgba(61,139,255,0.16), transparent 58%), var(--argos-deep) !important;
    color: #ffffff !important;
    font-size: 12.5px !important;
  }

  .page{
    padding: 14px !important;
    padding-bottom: 70px !important;
  }

  .topbar{
    margin-bottom: 12px !important;
  }

  h1{
    font-size: 1.12rem !important;
    color: #ffffff !important;
    margin: 0 !important;
  }

  h2{
    font-size: 0.98rem !important;
    margin: 0 0 8px !important;
  }

  .tabs,
  .subtabs{
    gap: 8px !important;
    margin-bottom: 12px !important;
  }

  .tab-link,
  .subtab-link{
    flex: 1 1 calc(50% - 8px) !important;
    text-align: center !important;
    padding: 8px 10px !important;
    border-radius: 12px !important;
    font-size: 0.78rem !important;
    background: rgba(255,255,255,0.09) !important;
    color: #ffffff !important;
    border-color: rgba(255,255,255,0.18) !important;
  }

  .tab-link.active,
  .subtab-link.active{
    background: var(--brand) !important;
    border-color: var(--brand) !important;
    color: #ffffff !important;
  }

  .card{
    border-radius: 16px !important;
    padding: 12px !important;
    margin-bottom: 10px !important;
    background: rgba(255,255,255,0.96) !important;
  }

  label{
    font-size: 0.74rem !important;
    margin-bottom: 4px !important;
  }

  input,
  select,
  textarea{
    padding: 8px 9px !important;
    margin-bottom: 10px !important;
    font-size: 12.5px !important;
    border-radius: 10px !important;
  }

  button{
    border-radius: 10px !important;
    padding: 8px 11px !important;
    font-size: 0.78rem !important;
  }

  .form-grid,
  .item-row,
  .expense-grid{
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .summary{
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }

  .field.span-2,
  .field.span-4{
    grid-column: auto !important;
  }

  .filters{
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    margin-bottom: 10px !important;
  }

  .filters .full{
    grid-column: 1 / -1 !important;
  }

  .table-wrap{
    border: 1px solid rgba(176,181,191,0.45) !important;
    border-radius: 12px !important;
    background: #ffffff !important;
  }

  [class*="mobile-card"]{
    background: #ffffff !important;
    border: 1px solid rgba(176,181,191,0.55) !important;
    border-radius: 14px !important;
    padding: 12px !important;
    margin-bottom: 10px !important;
  }

  [class*="mobile-grid"]{
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px 10px !important;
  }

  [class*="mobile-grid"] small{
    display: block !important;
    font-size: 0.64rem !important;
    color: var(--muted) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    margin-bottom: 2px !important;
  }

  [class*="mobile-actions"]{
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 7px !important;
  }

  [class*="mobile-actions"] .mobile-btn{
    width: 100% !important;
    justify-content: center !important;
    border-radius: 9px !important;
    padding: 7px 8px !important;
    font-size: 0.74rem !important;
  }
}
