/* STARLINK PAYMENT SYSTEM v1.8.4 — Complete Admin Workspace Premium Layer
   UI-only overrides for every authenticated page. No application behavior is changed. */

:root {
  --sp-ink: #17243a;
  --sp-muted: #7f8da3;
  --sp-line: #e5eaf2;
  --sp-canvas: #f3f6fb;
  --sp-navy: #101b2f;
  --sp-navy-2: #182b47;
  --sp-gold: #d9bd8c;
  --sp-gold-deep: #a88652;
  --sp-blue: #386de0;
  --sp-green: #15966f;
  --sp-red: #c94d5b;
  --sp-shadow: 0 10px 30px rgba(19, 35, 59, .055);
}

/* Authenticated application canvas */
#appView {
  color: var(--sp-ink);
  background:
    radial-gradient(ellipse at 84% 2%, rgba(211, 224, 244, .43), transparent 31%),
    linear-gradient(180deg, #f5f7fb 0%, #f1f4f9 100%);
}
#appView .sidebar {
  width: 266px;
  padding: 27px 16px 18px;
  background:
    radial-gradient(circle at 5% 0%, rgba(77, 112, 163, .22), transparent 31%),
    radial-gradient(circle at 100% 85%, rgba(193, 160, 107, .07), transparent 26%),
    linear-gradient(180deg, #111d32 0%, #0d1729 72%, #101d32 100%);
  border-right: 1px solid rgba(255,255,255,.065);
  box-shadow: 13px 0 36px rgba(10, 22, 40, .075);
}
#appView .side-brand {
  gap: 12px;
  padding: 0 9px 39px;
}
#appView .side-brand .brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  color: #17243a;
  background: linear-gradient(145deg, #e7d3ad, #b18c55);
  box-shadow: 0 8px 22px rgba(204, 174, 126, .19), inset 0 1px 0 rgba(255,255,255,.42);
}
#appView .side-brand strong {
  color: #f3f6fb;
  font-size: 13px;
  letter-spacing: 1.55px;
}
#appView .side-brand small {
  color: #8d9fb9;
  font-size: 9px;
  letter-spacing: 1.9px;
}
#appView .side-label {
  color: #7186a5;
  font-size: 9px;
  letter-spacing: 1.9px;
  padding-left: 12px;
  margin-bottom: 13px;
}
#appView .side-nav { gap: 7px; }
#appView .nav-link {
  position: relative;
  height: 47px;
  border-radius: 10px;
  padding: 0 13px;
  gap: 13px;
  color: #a7b5c9;
  font-size: 12px;
  font-weight: 650;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
#appView .nav-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: transparent;
}
#appView .nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,.075);
  transform: translateX(2px);
}
#appView .nav-link.active {
  color: #fff;
  background: linear-gradient(105deg, rgba(55, 96, 157, .45), rgba(37, 63, 103, .25));
  box-shadow: inset 0 0 0 1px rgba(161, 188, 226, .17);
}
#appView .nav-link.active::before { background: var(--sp-gold); }
#appView .nav-icon { color: #b8c6d9; }
#appView .nav-link.active .nav-icon { color: #e3c99e; }
#appView .nav-count {
  color: #d8e2f0;
  background: rgba(255,255,255,.13);
  border: 1px solid rgba(255,255,255,.055);
  padding: 3px 8px;
}
#appView .sidebar-help {
  border: 1px solid rgba(218, 191, 148, .19);
  border-radius: 12px;
  padding: 13px 11px;
  background: linear-gradient(135deg, rgba(211,184,139,.105), rgba(255,255,255,.035));
}
#appView .help-icon {
  color: #e2c99d;
  background: rgba(207,177,128,.16);
  border-radius: 8px;
}
#appView .sidebar-help strong { color: #eef2f8; font-size: 11px; }
#appView .sidebar-help small { color: #9aaac0; font-size: 10px; }
#appView .sidebar-help button { color: var(--sp-gold); }
#appView .side-profile { border-color: rgba(255,255,255,.1); }
#appView .avatar-admin {
  color: #182840;
  background: linear-gradient(145deg, #e0c99f, #ac8751);
}
#appView .profile-copy strong { color: #edf2f8; font-size: 11px; }
#appView .profile-copy small { color: #91a2bc; font-size: 10px; }
#appView .logout-button { color: #91a4bf; }
#appView .logout-button:hover { color: #fff; }

#appView .main-area {
  margin-left: 266px;
  min-height: 100vh;
  background: transparent;
}
#appView .topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  height: 86px;
  padding: 0 clamp(23px, 3.15vw, 49px);
  background: rgba(255,255,255,.91);
  border-bottom: 1px solid rgba(225,231,240,.94);
  box-shadow: 0 4px 19px rgba(20,36,62,.027);
  backdrop-filter: blur(14px);
}
#appView .breadcrumbs { color: #9aa6b7; font-size: 10px; }
#appView .breadcrumbs b { color: #60718a; }
#appView .topbar-title h1 {
  color: #1a2940;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -.65px;
}
#appView .topbar-actions { gap: 16px; }
#appView .environment-pill {
  color: #697991;
  background: #f7f8fa;
  border: 1px solid #e7ebf1;
  border-radius: 24px;
  padding: 8px 12px;
  font-size: 9px;
  letter-spacing: .9px;
}
#appView .environment-pill span {
  background: #c5a16a;
  box-shadow: 0 0 0 3px rgba(197,161,106,.15);
}
#appView .top-date { color: #7c899d; font-size: 11px; }
#appView .avatar-top {
  color: #3e5e8c;
  background: #edf1f7;
  border: 1px solid #e1e7ef;
}
#appView .page-content {
  width: 100%;
  max-width: 1800px;
  padding: 31px clamp(22px, 3.15vw, 49px) 42px;
}
#appView .page-section.active { animation: spPageEnter .24s ease both; }
@keyframes spPageEnter {
  from { opacity: .55; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Dashboard hero — intentionally distinct from the inner page headers */
#page-dashboard .welcome-row {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  align-items: center;
  min-height: 154px;
  margin-bottom: 21px;
  padding: 25px 28px;
  border: 1px solid rgba(210, 222, 240, .45);
  border-radius: 18px;
  background:
    radial-gradient(circle at 85% 16%, rgba(211, 185, 139, .17), transparent 22%),
    radial-gradient(circle at 75% 130%, rgba(74, 123, 190, .26), transparent 36%),
    linear-gradient(115deg, #14223a 0%, #1a3150 64%, #233f62 100%);
  box-shadow: 0 14px 32px rgba(18, 35, 59, .12);
}
#page-dashboard .welcome-row::after {
  content: "✦";
  position: absolute;
  z-index: -1;
  right: 8%;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(224, 199, 158, .16);
  font-size: clamp(90px, 12vw, 170px);
  line-height: 1;
  pointer-events: none;
}
#page-dashboard .welcome-row .eyebrow { color: #d7bd91; margin-bottom: 10px; }
#page-dashboard .welcome-row h2 {
  color: #f6f8fc;
  font-size: clamp(25px, 2.15vw, 33px);
  font-weight: 800;
  letter-spacing: -1.2px;
  margin-bottom: 7px;
}
#page-dashboard .welcome-row .wave { color: #e1c89c; }
#page-dashboard .welcome-row p { color: #c0ccdc; font-size: 12px; }
#page-dashboard #dashboardCreateInvoice {
  position: relative;
  z-index: 1;
  min-height: 44px;
  padding: 11px 17px;
  color: #1c2a3d;
  background: linear-gradient(135deg, #ead7b3, #c6a36e);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 10px;
  box-shadow: 0 8px 19px rgba(5, 15, 29, .16), inset 0 1px 0 rgba(255,255,255,.42);
}
#page-dashboard #dashboardCreateInvoice:hover { box-shadow: 0 12px 24px rgba(5,15,29,.22); }

/* KPI cards and dashboard panels */
#appView .metric-grid { gap: 15px; margin-bottom: 19px; }
#appView .metric-card {
  position: relative;
  overflow: hidden;
  min-height: 143px;
  padding: 19px 20px 17px;
  border: 1px solid #e6ebf3;
  border-radius: 16px;
  background: linear-gradient(155deg, #fff 0%, #fbfcff 100%);
  box-shadow: 0 6px 20px rgba(25, 43, 70, .04);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
#appView .metric-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #4c7de0, #abc1ed);
}
#appView .metric-card:nth-child(2)::after { background: linear-gradient(90deg, #239b78, #a4d9c8); }
#appView .metric-card:nth-child(3)::after { background: linear-gradient(90deg, #bf8a49, #ebd6b6); }
#appView .metric-card:nth-child(4)::after { background: linear-gradient(90deg, #7867bd, #c7bfeb); }
#appView .metric-card:hover {
  transform: translateY(-3px);
  border-color: #dbe4f1;
  box-shadow: 0 13px 28px rgba(25,43,70,.075);
}
#appView .metric-label { color: #78869b; font-size: 11px; font-weight: 650; }
#appView .metric-icon { width: 35px; height: 35px; border-radius: 11px; }
#appView .metric-value {
  margin: 12px 0 7px;
  color: #1b2b43;
  font-size: clamp(22px, 2.05vw, 29px);
  font-weight: 800;
  letter-spacing: -1px;
}
#appView .metric-foot, #appView .metric-note { color: #8996a9; font-size: 10px; }
#appView .metric-note.positive { color: #23896a; }
#appView .panel {
  border: 1px solid #e6ebf3;
  border-radius: 16px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 6px 20px rgba(25,43,70,.04);
}
#appView .panel-heading h3 { color: #1f3049; font-size: 14px; font-weight: 800; letter-spacing: -.25px; }
#appView .panel-heading p { color: #8794a7; font-size: 10px; }
#appView .small-chip {
  color: #9a805b;
  background: #f8f5ef;
  border: 1px solid #eee6d8;
  border-radius: 18px;
  padding: 6px 10px;
}
#appView .dashboard-network-panel { padding: 20px 22px; margin-bottom: 18px; }
#appView .dashboard-network-metrics > div {
  border: 1px solid #e7edf5;
  border-radius: 11px;
  background: linear-gradient(145deg, #fafbfd, #f3f6fb);
  padding: 14px 16px;
}
#appView .dashboard-network-metrics b { color: #263d5b; font-size: 24px; }
#appView .dashboard-network-metrics span { color: #7d8ba0; font-size: 10px; }
#appView .dashboard-network-devices {
  border-color: #edf1f6;
  padding-top: 11px;
  gap: 7px 20px;
}
#appView .dashboard-network-device { color: #40536e; font-size: 11px; }
#appView .dashboard-network-device b { color: #30445f; font-size: 11px; }
#appView .dashboard-grid { gap: 17px; margin-bottom: 19px; }
#appView .revenue-panel, #appView .quick-panel { min-width: 0; }
#appView .chart-wrap { margin-top: 18px; }
#appView .quick-action {
  min-height: 60px;
  border-radius: 11px;
  padding: 12px 11px;
  transition: background .16s ease, transform .16s ease;
}
#appView .quick-action:hover { background: #f7f9fd; transform: translateX(2px); }
#appView .quick-icon { width: 35px; height: 35px; border-radius: 11px; }
#appView .quick-action b { color: #30435f; font-size: 11px; }
#appView .quick-action small { color: #8996a9; font-size: 10px; }
#appView .text-button { color: #3c70d0; font-size: 10px; font-weight: 700; }

/* All authenticated page headings */
#appView .section-toolbar {
  align-items: center;
  margin-bottom: 20px;
  padding: 19px 22px;
  border: 1px solid #e7ecf3;
  border-left: 3px solid #c9a878;
  border-radius: 15px;
  background: linear-gradient(110deg, rgba(255,255,255,.98), rgba(249,251,254,.96));
  box-shadow: 0 5px 18px rgba(25,43,70,.035);
}
#appView .section-toolbar .eyebrow { color: #9b825d; font-size: 9px; margin-bottom: 7px; }
#appView .section-toolbar h2 {
  color: #192a42;
  font-size: clamp(22px, 1.8vw, 27px);
  font-weight: 800;
  letter-spacing: -.85px;
  margin-bottom: 5px;
}
#appView .section-toolbar p { color: #7e8da2; font-size: 11px; line-height: 1.6; }
#appView .section-toolbar .btn { min-height: 42px; white-space: nowrap; }
#appView .btn {
  min-height: 42px;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .08px;
}
#appView .btn-primary {
  color: #fff;
  background: linear-gradient(115deg, #2d5fc8, #477ce3);
  box-shadow: 0 7px 17px rgba(50,100,205,.17);
}
#appView .btn-primary:hover { box-shadow: 0 11px 23px rgba(50,100,205,.24); }
#appView .btn-light {
  color: #51627b;
  background: #f6f8fb;
  border: 1px solid #e4eaf2;
}
#appView .btn-light:hover { background: #edf2f8; border-color: #d7e1ee; }

/* Summary strips and all data tables */
#appView .invoice-summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 17px;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}
#appView .invoice-summary-strip > div {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 58px;
  padding: 13px 15px;
  border: 1px solid #e6ebf3;
  border-radius: 12px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 4px 13px rgba(25,43,70,.03);
  color: #718097;
  font-size: 11px;
}
#appView .invoice-summary-strip b {
  margin-left: auto;
  color: #263b58;
  font-size: 18px;
}
#appView .table-panel {
  overflow: hidden;
  border: 1px solid #e5ebf3;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 7px 22px rgba(25,43,70,.045);
}
#appView .table-panel > .panel-heading { padding: 19px 21px 15px; }
#appView .table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 17px;
  border-bottom: 1px solid #edf1f6;
  background: linear-gradient(180deg, #fff, #fbfcfe);
}
#appView .search-box {
  height: 42px;
  min-height: 42px;
  width: min(440px, 70%);
  border: 1px solid #e3e9f1;
  border-radius: 10px;
  background: #fbfcfe;
}
#appView .search-box:focus-within {
  border-color: #9ab2e2;
  box-shadow: 0 0 0 3px rgba(56,110,232,.075);
  background: #fff;
}
#appView .search-box input { color: #344760; font-size: 12px; }
#appView .filter-select {
  height: 42px;
  border: 1px solid #e3e9f1;
  border-radius: 10px;
  background: #fbfcfe;
  color: #53647c;
  font-size: 11px;
}
#appView .table-total { color: #8b98aa; font-size: 10px; }
#appView .table-scroll { width: 100%; overflow: auto; }
#appView .table-panel table { width: 100%; border-collapse: separate; border-spacing: 0; }
#appView .table-panel thead th {
  padding: 14px 15px;
  color: #8290a4;
  background: #f7f9fc;
  border-top: 0;
  border-bottom: 1px solid #e8edf4;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .8px;
  white-space: nowrap;
}
#appView .table-panel tbody td {
  padding: 14px 15px;
  color: #596a82;
  border-bottom: 1px solid #edf1f6;
  font-size: 11px;
  vertical-align: middle;
}
#appView .table-panel tbody tr { transition: background .14s ease; }
#appView .table-panel tbody tr:hover { background: #f9fbfe; }
#appView .table-panel tbody tr:last-child td { border-bottom: 0; }
#appView .customer-cell b { color: #30445f; font-size: 12px; }
#appView .customer-cell small, #appView .table-panel tbody td small { color: #8c99aa; font-size: 10px; }
#appView .invoice-no { color: #416fc1; font-size: 10px; font-weight: 700; }
#appView .amount-cell { color: #263b58; font-size: 12px; font-weight: 800; }
#appView .status-pill { border-radius: 20px; padding: 5px 9px; font-size: 9px; font-weight: 800; }
#appView .mini-btn {
  min-height: 32px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 7px 10px;
  color: #52647d;
  background: #fff;
  font-size: 10px;
}
#appView .mini-btn:hover { border-color: #b9ccec; color: #2d61bc; background: #f6f9ff; }
#appView .row-actions { gap: 6px; }
#appView .empty-cell { padding: 28px 16px !important; color: #94a0b1 !important; text-align: center; }

/* Payment register */
#appView .payment-metrics { gap: 13px; margin: 0 0 17px; }
#appView .payment-metric {
  position: relative;
  overflow: hidden;
  padding: 17px 18px;
  border: 1px solid #e5ebf3;
  border-radius: 15px;
  background: linear-gradient(150deg, #fff, #fafcff);
  box-shadow: 0 6px 18px rgba(25,43,70,.04);
}
#appView .payment-metric::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: #91afe8;
}
#appView .payment-metric:nth-child(2)::before { background: #7ac4a9; }
#appView .payment-metric:nth-child(3)::before { background: #d9b67e; }
#appView .payment-metric.highlight {
  background: linear-gradient(135deg, #f0f5ff, #fff);
  border-color: #dce7fa;
}
#appView .payment-metric span { color: #75849a; font-size: 11px; font-weight: 650; }
#appView .payment-metric b { color: #253a57; font-size: clamp(19px, 1.8vw, 25px); }
#appView .payment-metric.highlight b { color: #3569cf; }
#appView .payment-metric small { color: #8996a9; font-size: 10px; }
#appView .payments-table-panel { margin-top: 0; }

/* Settings and integration cards */
#appView .settings-grid { gap: 15px; }
#appView .settings-card {
  padding: 20px;
  border: 1px solid #e5ebf3;
  border-radius: 15px;
  background: linear-gradient(155deg, #fff, #fbfcfe);
  box-shadow: 0 6px 19px rgba(25,43,70,.04);
}
#appView .settings-card-head { gap: 12px; margin-bottom: 13px; }
#appView .integration-logo {
  width: 41px; height: 41px;
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
}
#appView .settings-card-head h3 { color: #2c405b; font-size: 13px; }
#appView .settings-card-head p, #appView .settings-card > p { color: #7e8ca0; font-size: 11px; line-height: 1.7; }
#appView .settings-card > p { min-height: 58px; }
#appView .settings-detail { padding: 11px 0; border-color: #edf1f6; color: #8190a4; font-size: 10px; }
#appView .settings-detail b { color: #40536d; font-size: 11px; }
#appView .settings-note {
  border: 1px solid #e9eef5;
  border-radius: 10px;
  padding: 11px 12px;
  color: #7e8da2;
  background: #f8fafd;
  font-size: 10px;
  line-height: 1.65;
}
#appView .setup-panel { margin-top: 16px; }
#appView .payment-settings-panel { padding: 21px; }
#appView .settings-form-actions { gap: 13px; }
#appView .settings-warning {
  border: 1px solid #eee0c9;
  border-radius: 12px;
  background: linear-gradient(110deg, #fff9f0, #fffdf9);
  padding: 14px 16px;
}
#appView .settings-warning > span { color: #a77a3a; background: #f5e8d3; }
#appView .settings-warning b { color: #896738; font-size: 11px; }
#appView .settings-warning p { color: #9a835f; font-size: 10px; line-height: 1.65; }

/* Monitoring metrics, folds, analytics and device table */
#appView .monitor-metrics { gap: 12px; margin-bottom: 17px; }
#appView .monitor-metric {
  padding: 16px 17px;
  border: 1px solid #e5ebf3;
  border-radius: 14px;
  background: linear-gradient(150deg, #fff, #fafcff);
  box-shadow: 0 6px 17px rgba(25,43,70,.04);
}
#appView .monitor-metric span { color: #75849a; font-size: 10px; }
#appView .monitor-metric b { color: #263c5a; font-size: 24px; }
#appView .monitor-metric small { color: #8c99aa; font-size: 9px; }
#appView .monitor-metric.online b { color: #158a67; }
#appView .monitor-metric.offline b { color: #c44c5b; }
#appView .monitor-metric.suspended b { color: #ad792f; }
#appView .monitor-fold-panel {
  overflow: hidden;
  border: 1px solid #e5ebf3;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 5px 17px rgba(25,43,70,.035);
}
#appView .monitor-fold-summary {
  min-height: 64px;
  padding: 13px 17px;
  gap: 13px;
  transition: background .15s ease;
}
#appView .monitor-fold-summary:hover { background: #f9fbfe; }
#appView .monitor-fold-summary-main b { color: #2b405c; font-size: 12px; }
#appView .monitor-fold-summary-main small { color: #8996a9; font-size: 10px; }
#appView .monitor-fold-summary-value { color: #9a8059; font-size: 9px; letter-spacing: .7px; }
#appView .monitor-fold-chevron { color: #637690; background: #f1f4f8; border-radius: 8px; }
#appView .monitor-fold-panel[open] > .monitor-fold-summary { background: #fafbfd; border-color: #edf1f6; }
#appView .monitor-analytics-kpis > div {
  border: 1px solid #e7edf5;
  border-radius: 11px;
  background: linear-gradient(145deg, #fafbfd, #f3f6fb);
}
#appView .monitor-analytics-kpis span { color: #718198; font-size: 10px; }
#appView .monitor-analytics-kpis b { color: #263c5a; font-size: 23px; }
#appView .monitor-analytics-kpis small { color: #8b98a9; font-size: 9px; }
#appView .monitor-chart-card {
  border: 1px solid #e7edf4;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 3px 11px rgba(25,43,70,.025);
}
#appView .monitor-chart-card h4 { color: #334965; font-size: 11px; }
#appView .monitor-chart-card small { color: #8b98a9; font-size: 9px; }
#appView .monitor-traffic-chart,
#appView .monitor-lifetime-chart-wrap {
  border-color: #e7edf4;
  border-radius: 11px;
}
#appView .monitor-lifetime-total {
  border: 1px solid #e5ebf3;
  border-radius: 12px;
  background: linear-gradient(150deg, #fff, #f9fbfe);
  box-shadow: 0 4px 13px rgba(25,43,70,.025);
}
#appView .monitor-lifetime-total span { color: #74839a; font-size: 10px; }
#appView .monitor-lifetime-total b { font-size: 21px; }
#appView .monitor-lifetime-card { border-radius: 10px; background: #f8fafd; }
#appView .monitor-availability-fold { border-color: #e8edf4; border-radius: 11px; }
#appView .monitor-availability-fold > summary:hover { background: #f8fafd; }
#appView .monitor-availability-fold > summary b { color: #344963; font-size: 11px; }
#appView .monitor-availability-fold > summary small { color: #8996a9; font-size: 9px; }
#appView .monitor-events-panel { margin-top: 12px; }
#appView .monitor-table { min-width: 1240px; }
#appView .monitor-table thead th { font-size: 9px; }
#appView .monitor-table tbody td { font-size: 10px; }
#appView .monitor-row-actions .mini-btn { font-size: 9px; }
#appView .monitor-policy-panel, #appView .monitor-alert-panel { margin-bottom: 11px; }
#appView .monitor-traffic-row td { background: #f8fafd; }

/* Consistent forms and dialogs across every section */
#appView .form-field label { color: #40536c; font-size: 11px; font-weight: 750; }
#appView .form-field input,
#appView .form-field select,
#appView .form-field textarea,
#appView .monitor-alert-phone input,
#appView .monitor-provision-traffic-edit input {
  min-height: 44px;
  border: 1px solid #e1e8f0;
  border-radius: 10px;
  color: #30435f;
  background: #fbfcfe;
  font-size: 12px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
#appView .form-field input:focus,
#appView .form-field select:focus,
#appView .form-field textarea:focus,
#appView .monitor-alert-phone input:focus,
#appView .monitor-provision-traffic-edit input:focus {
  border-color: #91abe0;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(56,110,232,.08);
  outline: none;
}
#appView input[type="checkbox"], #appView input[type="radio"] { accent-color: #3d70d4; }
#appView .modal-backdrop {
  padding: 20px;
  background: rgba(9,19,35,.66);
  backdrop-filter: blur(8px);
}
#appView .modal-card {
  width: min(100%, 680px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 26px 28px;
  border: 1px solid rgba(232,237,244,.94);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(4,14,29,.3);
}
#appView .modal-heading { border-color: #edf1f6; padding-bottom: 17px; }
#appView .modal-heading .eyebrow { color: #a08761; font-size: 9px; }
#appView .modal-heading h3 { color: #20334e; font-size: 20px; letter-spacing: -.55px; }
#appView .modal-heading p { color: #8693a5; font-size: 11px; }
#appView .modal-close {
  width: 35px; height: 35px;
  border-radius: 10px;
  color: #687b94;
  background: #f2f5f9;
  transition: background .15s ease, color .15s ease;
}
#appView .modal-close:hover { color: #334963; background: #e8eef6; }
#appView .modal-actions { border-color: #edf1f6; padding-top: 16px; margin-top: 14px; }
#appView .modal-actions .btn { min-width: 112px; }
#appView .invoice-link-info {
  border: 1px solid #e3ebf7;
  border-radius: 11px;
  background: #f4f7fc;
}
#appView .invoice-link-info p { color: #607895; font-size: 10px; }
#appView .toast-container { right: 22px; bottom: 22px; gap: 9px; }
#appView .toast { border-radius: 11px; box-shadow: 0 15px 32px rgba(10,24,44,.2); font-size: 12px; }
#appView .app-footer {
  border-top: 1px solid #e6ebf2;
  background: rgba(255,255,255,.6);
  padding: 15px clamp(22px, 3.15vw, 49px);
  color: #98a4b4;
  font-size: 8px;
  letter-spacing: .9px;
}

/* Responsive treatment for tablet and phone */
@media (max-width: 1150px) {
  #appView .sidebar { width: 244px; }
  #appView .main-area { margin-left: 244px; }
  #appView .page-content { padding: 27px 24px 35px; }
  #appView .topbar { padding: 0 24px; }
  #appView .metric-grid { gap: 12px; }
  #appView .dashboard-grid { grid-template-columns: minmax(0,1.4fr) minmax(245px,.9fr); }
}
@media (max-width: 900px) {
  #appView .sidebar { width: 278px; transform: translateX(-100%); }
  #appView .sidebar.open { transform: translateX(0); }
  #appView .main-area { margin-left: 0; }
  #appView .topbar { height: 80px; padding: 0 21px; }
  #appView .page-content { padding: 24px 21px 32px; }
  #appView .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  #appView .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  #appView .topbar { min-height: 75px; height: auto; padding: 10px 14px; gap: 8px; }
  #appView .topbar-title h1 { font-size: 16px; }
  #appView .topbar-actions { gap: 7px; }
  #appView .environment-pill { padding: 7px 8px; font-size: 8px; }
  #appView .avatar-top { display: none; }
  #appView .page-content { padding: 18px 13px 27px; }
  #page-dashboard .welcome-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
    min-height: 0;
    padding: 20px 18px;
    border-radius: 15px;
  }
  #page-dashboard .welcome-row::after { right: 1%; font-size: 100px; }
  #page-dashboard .welcome-row h2 { font-size: 23px; }
  #page-dashboard #dashboardCreateInvoice { width: 100%; }
  #appView .section-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 13px;
    padding: 17px 16px;
    margin-bottom: 15px;
  }
  #appView .section-toolbar h2 { font-size: 22px; }
  #appView .section-toolbar .btn { width: 100%; }
  #appView .metric-grid { gap: 9px; margin-bottom: 14px; }
  #appView .metric-card { min-height: 124px; padding: 14px 12px; border-radius: 13px; }
  #appView .metric-label { font-size: 10px; }
  #appView .metric-icon { width: 30px; height: 30px; border-radius: 9px; }
  #appView .metric-value { font-size: clamp(18px, 5vw, 23px); margin: 10px 0 5px; }
  #appView .panel { padding: 15px 13px; border-radius: 13px; }
  #appView .panel-heading h3 { font-size: 13px; }
  #appView .panel-heading p { font-size: 9px; }
  #appView .dashboard-network-panel { padding: 15px 13px; }
  #appView .dashboard-network-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
  #appView .dashboard-network-metrics > div { padding: 10px; }
  #appView .dashboard-network-metrics b { font-size: 19px; }
  #appView .dashboard-network-devices { grid-template-columns: 1fr; }
  #appView .table-panel { padding-top: 0; }
  #appView .table-panel > .panel-heading { padding: 15px 13px 12px; }
  #appView .table-toolbar { align-items: stretch; flex-wrap: wrap; padding: 10px; }
  #appView .search-box { width: 100%; }
  #appView .filter-select { max-width: 100%; flex: 1; }
  #appView .table-panel thead th { padding: 11px 10px; font-size: 8px; }
  #appView .table-panel tbody td { padding: 12px 10px; font-size: 10px; }
  #appView .invoice-summary-strip { grid-template-columns: 1fr; gap: 7px; }
  #appView .invoice-summary-strip > div { min-height: 48px; }
  #appView .payment-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  #appView .payment-metric { padding: 13px 12px; }
  #appView .payment-metric b { font-size: 17px; }
  #appView .settings-grid { grid-template-columns: 1fr; gap: 10px; }
  #appView .settings-card { padding: 16px; }
  #appView .settings-card > p { min-height: 0; }
  #appView .monitor-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  #appView .monitor-metric { padding: 12px; }
  #appView .monitor-metric b { font-size: 20px; }
  #appView .monitor-chart-grid { grid-template-columns: 1fr; }
  #appView .monitor-chart-card:first-child { grid-column: auto; }
  #appView .monitor-lifetime-summary { grid-template-columns: 1fr; }
  #appView .monitor-analytics-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #appView .modal-backdrop { padding: 9px; }
  #appView .modal-card { max-height: calc(100vh - 18px); padding: 19px 16px; border-radius: 15px; }
  #appView .modal-heading h3 { font-size: 18px; }
  #appView .form-grid { grid-template-columns: 1fr; }
  #appView .form-grid .span-2 { grid-column: auto; }
  #appView .modal-actions { gap: 7px; flex-wrap: wrap; }
  #appView .modal-actions .btn { flex: 1 1 120px; min-width: 0; }
  #appView .settings-form-actions { align-items: stretch; flex-direction: column; }
  #appView .settings-form-actions .btn { width: 100%; }
  #appView .monitor-toolbar-actions { width: 100%; }
  #appView .monitor-toolbar-actions .btn { flex: 1; }
  #appView .app-footer { padding: 12px 13px; gap: 5px; flex-direction: column; font-size: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  #appView *, #appView *::before, #appView *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
