:root {
  --bg: #eef3f9;
  --surface: #ffffff;
  --soft: #f5f8fc;
  --line: #dbe5f0;
  --ink: #0c1b34;
  --muted: #667892;
  --blue: #10377f;
  --blue-deep: #071b42;
  --sky: #087fbc;
  --red: #c92136;
  --green: #138a54;
  --amber: #b7791f;
  --shadow: 0 14px 38px rgba(12, 39, 78, .075);
  --shadow-hover: 0 18px 42px rgba(12, 51, 115, .14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 8% 0%, rgba(8, 127, 188, .08), transparent 23rem),
    radial-gradient(circle at 94% 18%, rgba(16, 55, 127, .055), transparent 28rem),
    var(--bg);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", Inter, Arial, sans-serif;
}
img, svg, video, canvas { max-width: 100%; }
.app, .content, .page-section, .panel, .metrics > *, .settings-grid > * { min-width: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(15, 130, 189, .65);
  box-shadow: 0 0 0 4px rgba(15, 130, 189, .10);
}
button:focus-visible, a:focus-visible {
  outline: 3px solid rgba(15, 130, 189, .3);
  outline-offset: 2px;
}
input, select { min-height: 42px; padding: 0 12px; }
textarea { min-height: 96px; padding: 12px; resize: vertical; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }

.is-hidden { display: none !important; }
.muted { margin: 0; color: var(--muted); line-height: 1.6; }
.hero-copy { max-width: 560px; margin: 8px 0 0; color: rgba(255,255,255,.72); line-height: 1.65; }
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 7px 11px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.88);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.live-badge span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #47e6a0;
  box-shadow: 0 0 0 5px rgba(71,230,160,.12);
}
.eyebrow {
  margin: 0 0 6px;
  color: var(--sky);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(28px, 3.2vw, 38px); letter-spacing: -.04em; }
h2 { margin-bottom: 6px; font-size: 21px; letter-spacing: -.02em; }
h3 { margin-bottom: 8px; font-size: 16px; }

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 15%, rgba(57, 180, 233, .28), transparent 24rem),
    linear-gradient(145deg, #061632, #0c3272 60%, #087fbc);
}
.login-card {
  display: grid;
  gap: 14px;
  width: min(420px, 100%);
  padding: 30px;
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 28px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 28px 80px rgba(2, 15, 42, .28);
  text-align: center;
}
.login-card img {
  justify-self: center;
  width: 260px;
  max-width: 100%;
  margin-bottom: 8px;
}
.login-card label { text-align: left; }
.demo-access {
  padding: 12px;
  border-radius: 12px;
  background: #eef7ff;
  color: var(--blue);
  font-size: 13px;
}
.form-error { min-height: 18px; color: var(--red); font-weight: 800; }

.topnav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px max(24px, calc((100vw - 1380px) / 2));
  border-bottom: 1px solid rgba(219,229,240,.86);
  background: rgba(255,255,255,.86);
  box-shadow: 0 8px 30px rgba(7, 27, 66, .045);
  backdrop-filter: blur(20px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 154px;
  color: var(--ink);
  text-decoration: none;
}
.brand img {
  width: 132px;
  height: 42px;
  object-fit: contain;
}
.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  padding: 4px;
  overflow-x: auto;
  border: 1px solid rgba(219,229,240,.9);
  border-radius: 16px;
  background: rgba(245,248,252,.85);
}
.nav-menu a {
  padding: 9px 13px;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}
.nav-menu a.active,
.nav-menu a:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #1753a6);
  box-shadow: 0 7px 16px rgba(16,55,127,.18);
}
.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.content { width: min(1380px, calc(100% - 40px)); margin: 0 auto; padding: 28px 0 50px; }
.page-section {
  display: none;
  scroll-margin-top: 86px;
  margin-bottom: 30px;
}

.page-section.active-page {
  display: block;
  animation: page-enter .28s cubic-bezier(.22,.75,.28,1) both;
}
@keyframes page-enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes item-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}
#dashboard .page-heading {
  position: relative;
  isolation: isolate;
  align-items: center;
  min-height: 244px;
  padding: 32px 34px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 28px;
  background:
    radial-gradient(circle at 88% 20%, rgba(67, 190, 239, .34), transparent 20rem),
    linear-gradient(135deg, var(--blue-deep), var(--blue) 58%, #0b79b6);
  color: #fff;
  box-shadow: 0 24px 56px rgba(7,27,66,.20);
}
#dashboard .page-heading::after {
  position: absolute;
  right: -80px;
  bottom: -170px;
  z-index: -1;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
  box-shadow: 0 0 0 44px rgba(255,255,255,.035), 0 0 0 92px rgba(255,255,255,.025);
  content: "";
}
#dashboard .eyebrow { color: #6dd4ff; }
#dashboard h1 { max-width: 690px; margin-bottom: 0; font-size: clamp(32px,4vw,48px); }
#dashboard .primary-button {
  min-height: 48px;
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: 0 14px 28px rgba(4, 34, 91, .28);
}
.primary-button, .soft-button, .ghost-button, .icon-button, .danger-button, .danger-outline-button, .text-button {
  min-height: 40px;
  border: 0;
  border-radius: 12px;
  font-weight: 800;
}
.primary-button {
  padding: 0 17px;
  color: #fff;
  background: linear-gradient(135deg, #1767c7, #10377f);
  box-shadow: 0 7px 16px rgba(16, 55, 127, .20);
}
.soft-button { padding: 0 14px; color: var(--blue); background: #edf4ff; }
.ghost-button { padding: 0 12px; color: var(--blue); background: #eef4ff; }
.icon-button { width: 40px; color: var(--blue); background: #eef4ff; font-size: 22px; }
.danger-button { min-height: 44px; padding: 0 17px; color: #fff; background: var(--red); }
.danger-outline-button {
  padding: 0 14px;
  border: 1px solid rgba(201, 33, 54, .28);
  color: var(--red);
  background: #fff4f6;
}
.text-button { padding: 0; color: var(--blue); background: transparent; }
.soft-button:disabled, .danger-button:disabled, .danger-outline-button:disabled { cursor: not-allowed; opacity: .45; transform: none; box-shadow: none; }
.primary-button:hover, .soft-button:hover, .ghost-button:hover, .danger-outline-button:hover, .mini-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.metrics article, .panel, .modal-card {
  border: 1px solid rgba(219,229,240,.92);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.metrics article {
  position: relative;
  min-height: 130px;
  padding: 22px;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.metrics article::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--blue), var(--sky));
  content: "";
}
.metrics article:nth-child(2)::before { background: linear-gradient(90deg, #0b8cbd, #45c7da); }
.metrics article:nth-child(3)::before { background: linear-gradient(90deg, #c92136, #ef6a78); }
.metrics article:nth-child(4)::before { background: linear-gradient(90deg, #6c4bc4, #a987ee); }
.metrics article:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.metrics span { display: block; color: var(--muted); font-size: 13px; font-weight: 700; }
.metrics strong { display: block; margin-top: 12px; color: var(--blue); font-size: 34px; letter-spacing: -.04em; }
.dashboard-metric-icon {
  display: grid !important;
  position: relative;
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 17px;
  color: #fff !important;
  background: linear-gradient(145deg, #1b59ad, #10377f);
  box-shadow: 0 10px 22px rgba(16, 55, 127, .22), inset 0 1px 0 rgba(255, 255, 255, .25);
  font-family: "Material Symbols Rounded" !important;
  font-size: 27px !important;
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 32;
  font-weight: normal !important;
  letter-spacing: 0;
  transition: transform .2s ease, box-shadow .2s ease;
}
.metrics article:hover .dashboard-metric-icon {
  transform: translateY(-2px) rotate(-3deg);
  box-shadow: 0 13px 26px rgba(16, 55, 127, .28), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.metric-card-tickets .dashboard-metric-icon {
  color: #fff !important;
  background: linear-gradient(145deg, #16a3c0, #087fbc);
  box-shadow: 0 10px 22px rgba(8, 127, 188, .22), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.metric-card-urgent .dashboard-metric-icon {
  color: #fff !important;
  background: linear-gradient(145deg, #ef5a6c, #c92136);
  box-shadow: 0 10px 22px rgba(201, 33, 54, .22), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.metric-card-users .dashboard-metric-icon {
  color: #fff !important;
  background: linear-gradient(145deg, #9876e5, #6c4bc4);
  box-shadow: 0 10px 22px rgba(108, 75, 196, .22), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.metric-card-customers strong { color: var(--blue); }
.metric-card-tickets strong { color: #087fbc; }
.metric-card-urgent strong { color: var(--red); }
.metric-card-users strong { color: #6c4bc4; }
#dashboard .metrics { margin-top: 20px; }
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
  gap: 16px;
  margin-top: 18px;
  align-items: stretch;
}
.ticket-progress-panel, .dashboard-activity-card {
  min-height: 384px;
  padding: 0;
  overflow: hidden;
}
.ticket-progress-panel .panel-heading-row,
.dashboard-activity-card .panel-heading-row {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: #f5f8fc;
}
.ticket-progress-summary {
  display: flex;
  align-items: end;
  gap: 10px;
  padding: 18px 20px 8px;
}
.ticket-progress-summary strong {
  color: var(--blue);
  font-size: 42px;
  line-height: 1;
  letter-spacing: -.04em;
}
.ticket-progress-summary span {
  padding-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.ticket-progress-list {
  display: grid;
  gap: 13px;
  padding: 10px 20px 20px;
}
.ticket-progress-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 38px;
  gap: 12px;
  align-items: center;
  animation: item-enter .3s ease both;
  animation-delay: calc(var(--row-index, 0) * 38ms);
}
.ticket-progress-row span {
  color: #40526c;
  font-size: 12px;
  font-weight: 800;
}
.ticket-progress-row strong {
  color: var(--ink);
  text-align: right;
  font-size: 13px;
}
.ticket-progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f8;
}
.ticket-progress-fill {
  width: var(--progress-width, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--progress-color, var(--blue)), #46c4d9);
  box-shadow: 0 6px 16px rgba(16,55,127,.18);
  transition: width .35s ease;
}
.dashboard-activity-card .activity-list {
  max-height: 304px;
  overflow: auto;
}
.dashboard-activity-card .activity-item {
  grid-template-columns: 38px minmax(0,1fr);
  padding: 13px 18px;
}
.dashboard-activity-card .activity-item small {
  grid-column: 2;
  text-align: left;
}
.dashboard-note {
  margin-top: 16px;
  padding: 18px 2px 2px;
  color: var(--muted);
}
.dashboard-note h2 {
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 18px;
}
.dashboard-note p {
  max-width: 760px;
  margin: 0;
  line-height: 1.6;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 220px 220px;
  gap: 10px;
  margin-bottom: 12px;
}
.customer-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.customer-metric {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 108px;
  padding: 17px;
  border: 1px solid rgba(219,229,240,.92);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}
.customer-metric .metric-icon {
  display: grid;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--sky));
  box-shadow: 0 10px 20px rgba(16,55,127,.2), inset 0 1px 0 rgba(255,255,255,.25);
  font-family: "Material Symbols Rounded";
  font-feature-settings: "liga";
  font-size: 25px;
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 32;
  font-weight: normal;
  transition: transform .2s ease;
}
.customer-metric:hover .metric-icon { transform: translateY(-2px) rotate(-3deg); }
.customer-metric > div > span, .customer-metric small { display: block; color: var(--muted); font-size: 11px; font-weight: 700; }
.customer-metric strong { display: block; margin: 3px 0; color: var(--blue); font-size: 27px; line-height: 1.1; }
.metric-inactive .metric-icon { background: linear-gradient(135deg, #a94855, var(--red)); }
.metric-new .metric-icon { background: linear-gradient(135deg, #118653, #2abd78); }
.ticket-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.ticket-metric {
  display: flex;
  min-height: 126px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(219,229,240,.92);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}
.ticket-metric:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.ticket-metric div > span, .ticket-metric small { display: block; color: var(--muted); font-size: 11px; font-weight: 700; }
.ticket-metric strong { display: block; margin: 5px 0; color: #ef4b55; font-size: 29px; line-height: 1; }
.ticket-metric-icon {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  color: #ef4b55;
  background: #fff0f2;
  font-size: 24px;
  font-weight: 900;
}
.ticket-open strong, .ticket-open .ticket-metric-icon { color: #1d6ee8; }
.ticket-open .ticket-metric-icon { background: #edf5ff; }
.ticket-progress strong, .ticket-progress .ticket-metric-icon { color: #0d9db7; }
.ticket-progress .ticket-metric-icon { background: #e9f9fb; }
.ticket-pending strong, .ticket-pending .ticket-metric-icon { color: #e7a329; }
.ticket-pending .ticket-metric-icon { background: #fff7e7; }
.ticket-done strong, .ticket-done .ticket-metric-icon { color: #1c9a52; }
.ticket-done .ticket-metric-icon { background: #eaf8ef; }
.ticket-tools { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.ticket-archive-filter { display: grid; grid-template-columns: auto minmax(170px, 220px); align-items: center; gap: 9px; color: var(--muted); font-size: 12px; font-weight: 800; }
.ticket-archive-filter select { min-height: 42px; }
.ticket-id-with-check { display: flex; align-items: flex-start; gap: 10px; }
.ticket-id-with-check strong { overflow-wrap: anywhere; }
.ticket-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.ticket-status-new { color: #c23243; background: #fff0f2; }
.ticket-status-open { color: #145fc9; background: #edf5ff; }
.ticket-status-progress { color: #087f96; background: #e9f9fb; }
.ticket-status-pending { color: #a76a0a; background: #fff7e7; }
.ticket-status-done { color: #107744; background: #eaf8ef; }
.ticket-process-summary { display: grid; gap: 4px; min-width: 180px; }
.ticket-process-summary strong { font-size: 12px; }
.ticket-process-summary span { color: var(--muted); font-size: 10px; line-height: 1.5; }
.success-mini { color: #0d7d46; border-color: #b9e3cd; background: #effaf4; }
.role-lock {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 9px;
  border-radius: 10px;
  color: var(--muted);
  background: #f0f3f7;
  font-size: 10px;
  font-weight: 800;
}
.archived-row { opacity: .72; }
.customer-toolbar {
  display: grid;
  grid-template-columns: auto auto auto minmax(200px, 320px) auto;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
}
.compact-search {
  position: relative;
  width: min(320px, 100%);
}
.compact-search > span {
  position: absolute;
  top: 50%;
  left: 13px;
  z-index: 1;
  color: var(--muted);
  font-size: 20px;
  transform: translateY(-52%);
  pointer-events: none;
}
.compact-search input { padding-left: 40px; }
.export-button {
  border: 1px solid #c9d9ee;
  background: #fff;
}
.bulk-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid #c9d9ee;
  border-radius: 15px;
  background: #edf5ff;
  animation: item-enter .22s ease both;
}
.bulk-action-bar strong, .bulk-action-bar span { display: block; }
.bulk-action-bar strong { color: var(--blue); font-size: 13px; }
.bulk-action-bar span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.bulk-action-buttons { display: flex; align-items: center; gap: 8px; }
.bulk-action-buttons .danger-button { min-height: 40px; }
.filter-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: -2px 0 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.82);
  box-shadow: var(--shadow);
}
.mass-event-panel {
  margin-bottom: 16px;
  background: linear-gradient(145deg, #fff, #f7fbff);
}
.mass-event-panel .panel-heading-row { margin-bottom: 14px; }
.mass-event-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.mass-event-heading-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}
.mass-event-filter {
  display: grid;
  grid-template-columns: auto minmax(160px, 210px);
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}
.mass-event-filter select { min-height: 38px; }
.mass-event-select-row {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 10px;
  padding: 0 2px;
}
.mass-event-select-row span { color: var(--muted); font-size: 11px; font-weight: 700; }
.mass-event-summary span {
  padding: 8px 11px;
  border: 1px solid #cfe0f3;
  border-radius: 11px;
  color: var(--muted);
  background: #fff;
  font-size: 11px;
  font-weight: 700;
}
.mass-event-summary strong { color: var(--blue); font-size: 15px; }
.mass-event-list { display: grid; gap: 9px; }
.mass-event-empty {
  padding: 15px;
  border: 1px dashed #c7d6e7;
  border-radius: 13px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}
.mass-event-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--sky);
  border-radius: 13px;
  background: #fff;
}
.mass-event-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 11px;
}
.mass-event-card.is-urgent { border-left-color: var(--red); }
.mass-event-card.is-done { border-left-color: var(--green); opacity: .82; }
.mass-event-card h3 { margin: 4px 0; font-size: 14px; }
.mass-event-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.mass-event-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mass-event-meta span {
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--blue);
  background: #edf5ff;
  font-size: 10px;
  font-weight: 800;
}
.detail-section {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #f9fbfd;
}
.detail-section .panel-heading-row { margin-bottom: 10px; }
.vendor-link-list, .attachment-list { display: grid; gap: 8px; }
.vendor-link-card, .attachment-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}
.vendor-link-card strong, .attachment-item strong { display: block; margin-bottom: 3px; }
.vendor-link-card span, .attachment-item span { display: block; color: var(--muted); font-size: 10px; line-height: 1.5; }
.customer-picker-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.customer-picker-heading strong, .customer-picker-heading span { display: block; }
.customer-picker-heading span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.customer-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding: 4px;
}
.customer-picker label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  cursor: pointer;
}
.customer-picker label:hover { border-color: #9fbbe0; background: #f6faff; }
.customer-picker label div { min-width: 0; }
.customer-picker label strong, .customer-picker label span { display: block; }
.customer-picker label strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.customer-picker label span { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.panel { padding: 20px; }
.panel.ticket-progress-panel,
.panel.dashboard-activity-card {
  padding: 0;
}
.table-panel { overflow-x: auto; padding: 0; }
table { width: 100%; min-width: 920px; border-collapse: collapse; }
#customers table { min-width: 900px; }
.pop-site-table { min-width: 860px; }
th, td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}
th {
  background: #f3f7fb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
tbody tr { animation: item-enter .3s ease both; animation-delay: calc(var(--row-index, 0) * 32ms); transition: background .18s ease; }
tbody tr:hover { background: #f8fbff; }
td strong { display: block; margin-bottom: 3px; }
.nowrap { white-space: nowrap; }
.address-cell { max-width: 260px; color: var(--muted); line-height: 1.5; }
.status-pill, .priority-pill, .tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}
.status-pill { color: var(--green); background: #e8f7ef; }
.status-archived { color: #65758b; background: #edf1f5; }
.status-inactive { color: #a15b12; background: #fff1dc; }
.priority-normal { color: var(--green); background: #e8f7ef; }
.priority-tinggi { color: var(--amber); background: #fff4dc; }
.priority-urgent { color: var(--red); background: #ffe9ec; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.mini-button {
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--blue);
  background: #f9fbfd;
  font-size: 12px;
  font-weight: 800;
}
.primary-mini { color: #fff; border-color: var(--blue); background: var(--blue); }
.customer-primary span, .service-summary span, .pop-summary span, .table-subtext {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}
.pop-summary { min-width: 150px; }
.pop-summary strong { color: var(--blue); }
.address-compact { display: block; max-width: 280px; color: var(--muted); line-height: 1.5; }
.coordinate-text { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty-table-row td { padding: 34px 18px; color: var(--muted); text-align: center; }
.customer-name-with-check { display: flex; align-items: flex-start; gap: 12px; }
.table-check-label { display: flex; align-items: center; gap: 10px; color: inherit; }
.table-checkbox {
  flex: 0 0 17px;
  width: 17px;
  min-height: 17px;
  margin: 1px 0 0;
  padding: 0;
  border-radius: 5px;
  accent-color: var(--blue);
  cursor: pointer;
}
.table-checkbox:disabled { cursor: not-allowed; opacity: .35; }
.action-menu { position: relative; }
.action-menu summary {
  display: grid;
  width: 38px;
  min-height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--blue);
  background: #f9fbfd;
  font-weight: 800;
  list-style: none;
  cursor: pointer;
}
.action-menu summary::-webkit-details-marker { display: none; }
.action-menu-popover {
  display: grid;
  min-width: 120px;
  gap: 4px;
  margin-top: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  box-shadow: var(--shadow);
}
.action-menu-popover button {
  min-height: 34px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
}
.action-menu-popover button:hover { background: var(--soft); }
.action-menu-popover .danger-text { color: var(--red); }
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.pagination-bar > div { display: flex; gap: 8px; }
.pagination-summary { align-items: center; gap: 14px !important; }
.page-size-control {
  display: flex;
  grid-auto-flow: column;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.page-size-control select {
  width: 72px;
  min-height: 38px;
  padding: 0 9px;
}
.pagination-buttons { display: flex; gap: 8px; }

.panel-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.panel-heading-row h2 { margin-bottom: 0; }
.activity-panel { margin-top: 20px; padding: 0; overflow: hidden; }
.dashboard-activity-card.activity-panel { margin-top: 0; }
.activity-panel .panel-heading-row { padding: 18px 20px; border-bottom: 1px solid var(--line); background: #f5f8fc; }
.activity-list { display: grid; }
.activity-item {
  display: grid;
  grid-template-columns: 42px minmax(0,1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #e8eef5;
  animation: item-enter .3s ease both;
  animation-delay: calc(var(--row-index, 0) * 32ms);
}
.activity-item:last-child { border-bottom: 0; }
.activity-item strong { display: block; font-size: 13px; }
.activity-item p { margin: 3px 0 0; color: #465b76; font-size: 13px; line-height: 1.5; }
.activity-item small { color: #8a9bb1; text-align: right; font-size: 11px; line-height: 1.5; font-weight: 700; }
.activity-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; color: #fff; font-weight: 800; }
.activity-login { background: #1cab5b; }
.activity-ticket { background: #1487c3; }
.activity-change { background: #7455c7; }
.report-log-panel { margin-top: 18px; }

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.settings-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  padding: 5px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.74);
}
.settings-tabs button {
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 11px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
  white-space: nowrap;
}
.settings-tabs button.active { color: #fff; background: var(--blue); box-shadow: 0 7px 16px rgba(16,55,127,.18); }
.settings-pane { display: none; }
.settings-pane.active { display: block; animation: page-enter .24s ease both; }
.settings-grid.settings-pane.active { display: grid; }
.settings-pane-heading { margin-bottom: 12px; }
.user-table { min-width: 700px; }
.settings-grid .panel { display: grid; gap: 12px; align-content: start; }
.inline-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.tag-list { display: grid; gap: 8px; }
.tag { color: var(--blue); background: #eef4ff; }
.master-data-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f8fbff;
}
.master-data-row > span {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.master-data-actions { display: flex; flex: 0 0 auto; gap: 6px; }
.master-data-actions .mini-button { min-height: 34px; }
.master-data-actions .danger-outline-button { min-height: 34px; padding: 0 10px; font-size: 11px; }
.optional-label { color: #92a0b2; font-size: 10px; font-weight: 600; }
.notification-heading { margin-bottom: 14px; }
.notification-heading h2 { margin: 0 0 5px; }
.notification-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: 16px;
  align-items: start;
}
.notification-card {
  display: grid;
  gap: 14px;
  align-content: start;
}
.notification-card-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}
.notification-card-heading h2 { margin: 0 0 3px; }
.notification-channel-icon {
  display: grid;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(145deg, #2aa8e8, #1767c7);
  font-feature-settings: "liga";
  font-variation-settings: "FILL" 1, "wght" 550, "GRAD" 0, "opsz" 28;
  box-shadow: 0 10px 22px rgba(23, 103, 199, .18);
}
.whatsapp-channel-icon { background: linear-gradient(145deg, #37c879, #12844f); }
.method-selector {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 0;
  padding: 0;
  border: 0;
}
.method-selector legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.method-selector label {
  position: relative;
  display: block;
  min-width: 0;
  cursor: pointer;
}
.method-selector input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.method-selector label > span {
  display: grid;
  gap: 4px;
  min-height: 78px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.method-selector label > span small { color: var(--muted); line-height: 1.45; }
.method-selector input:checked + span {
  border-color: rgba(23, 103, 199, .55);
  background: #f0f6ff;
  box-shadow: 0 0 0 3px rgba(23, 103, 199, .09);
}
.method-selector input:focus-visible + span {
  outline: 3px solid rgba(15, 130, 189, .25);
  outline-offset: 2px;
}
.method-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft);
}
.compact-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.security-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #49617f;
}
.security-note span {
  flex: 0 0 auto;
  color: var(--blue);
  font-feature-settings: "liga";
}
.security-note p { margin: 0; font-size: 12px; line-height: 1.55; }
.connection-status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.connection-status-card > div {
  display: flex;
  align-items: center;
  gap: 10px;
}
.connection-status-card strong, .connection-status-card small { display: block; }
.connection-status-card small { margin-top: 2px; color: var(--muted); }
.connection-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #9aa9ba;
  box-shadow: 0 0 0 5px rgba(154, 169, 186, .14);
}
.compact-warning { margin: 0; font-size: 12px; line-height: 1.55; }
.qr-modal-card { width: min(560px, 100%); }
.qr-preview {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
  align-items: center;
}
.qr-preview strong { display: block; margin-bottom: 7px; }
.qr-placeholder {
  display: grid;
  width: 150px;
  aspect-ratio: 1;
  place-items: center;
  border: 10px solid #fff;
  border-radius: 16px;
  background:
    linear-gradient(90deg, rgba(12,27,52,.12) 50%, transparent 50%) 0 0 / 14px 14px,
    linear-gradient(rgba(12,27,52,.12) 50%, transparent 50%) 0 0 / 14px 14px,
    #f1f5fa;
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow);
}
.whatsapp-qr-image {
  display: block;
  width: 150px;
  aspect-ratio: 1;
  object-fit: contain;
  border: 8px solid #fff;
  border-radius: 16px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow);
}
.qr-placeholder span {
  color: var(--ink);
  font-size: 82px;
  font-feature-settings: "liga";
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 48;
}
.note-box {
  padding: 13px;
  border: 1px dashed #b8c7db;
  border-radius: 14px;
  background: linear-gradient(145deg, #fbfdff, #f5f9fd);
  color: var(--muted);
  line-height: 1.6;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 19, 42, .55);
}
.modal-card {
  display: grid;
  gap: 14px;
  width: min(760px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: 22px;
}
.modal-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.detail-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
}
.detail-item span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; }
.detail-item strong { display: block; margin-top: 4px; }
.action-row { display: flex; flex-wrap: wrap; gap: 8px; }
.action-row > *, .panel-heading-row > *, .notification-card-heading > div { min-width: 0; }
.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
}
.switch-row input { width: 18px; min-height: 18px; margin: 0; }
.switch-row span { color: var(--ink); }
.rfo-heading {
  padding: 12px 14px;
  border-left: 4px solid var(--sky);
  border-radius: 0 12px 12px 0;
  background: #f0f7ff;
}
.rfo-heading .eyebrow { margin-bottom: 3px; }
.session-warning {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  display: grid;
  gap: 4px;
  width: min(380px, calc(100vw - 32px));
  padding: 15px 17px;
  border: 1px solid #f0cf91;
  border-radius: 16px;
  background: #fff8e9;
  color: #80530c;
  box-shadow: 0 18px 48px rgba(71, 47, 8, .18);
  animation: item-enter .22s ease both;
}
.session-warning strong, .session-warning span { display: block; }
.session-warning span { font-size: 12px; line-height: 1.5; }
.compact-modal { width: min(520px, 100%); }
.warning-box {
  padding: 14px;
  border: 1px solid #f1c7cd;
  border-radius: 14px;
  background: #fff3f5;
  color: #7c2632;
  line-height: 1.6;
}
.warning-box span { color: var(--muted); }

@media (max-width: 980px) {
  .topnav { align-items: flex-start; flex-wrap: wrap; }
  .brand { min-width: auto; }
  .nav-menu { order: 3; width: 100%; }
  .metrics, .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ticket-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .toolbar { grid-template-columns: 1fr; }
  .customer-toolbar { grid-template-columns: repeat(3, auto) minmax(200px, 1fr) auto; }
}
@media (max-width: 700px) {
  html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
  body { background: #f6f8fc; }
  h1 { font-size: 25px; line-height: 1.2; }
  h2 { font-size: 19px; }
  input, select { min-height: 48px; }
  input[type="file"] { width: 100%; min-width: 0; padding: 10px; }
  button, .mini-button, .status-pill, .ticket-status { overflow-wrap: anywhere; }

  .app { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
  .topnav {
    align-items: center;
    flex-wrap: nowrap;
    gap: 10px;
    padding: 9px 14px;
    backdrop-filter: none;
  }
  .brand { flex: 1; gap: 9px; min-width: 0; }
  .brand img { width: 145px; height: 42px; }
  .user-menu span { display: none; }
  .user-menu { gap: 0; }
  .ghost-button { min-height: 38px; }

  .nav-menu {
    position: fixed;
    right: 10px;
    bottom: 10px;
    left: 10px;
    z-index: 40;
    order: initial;
    width: auto;
    gap: 4px;
    padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
    overflow-x: auto;
    border: 1px solid rgba(210,222,235,.9);
    border-radius: 21px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 16px 44px rgba(7,27,66,.20);
    backdrop-filter: blur(18px);
    scrollbar-width: none;
  }
  .nav-menu::-webkit-scrollbar { display: none; }
  .nav-menu a {
    flex: 1 1 0;
    min-width: 0;
    min-height: 50px;
    padding: 8px 7px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    font-size: 11px;
    line-height: 1.15;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    scroll-snap-align: center;
  }

  .content { width: min(100% - 24px, 1380px); padding: 20px 0 24px; }
  .page-heading, .modal-heading { flex-direction: column; align-items: stretch; }
  .page-heading { gap: 14px; margin-bottom: 18px; }
  .page-heading > .primary-button { width: 100%; min-height: 48px; }
  .page-heading > .action-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
  .page-heading > .action-row button { min-width: 0; padding: 0 9px; }
  #dashboard .page-heading {
    align-items: stretch;
    min-height: 0;
    padding: 24px 20px;
    border-radius: 24px;
  }
  #dashboard .page-heading::after { right: -170px; bottom: -210px; }
  #dashboard h1 { font-size: 30px; }
  .live-badge { margin-bottom: 16px; }
  .hero-copy { font-size: 13px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metrics article {
    min-width: 0;
    gap: 8px;
  }
  .metrics article > div { min-width: 0; }
  .metrics span { overflow-wrap: anywhere; }
  .dashboard-metric-icon {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 23px !important;
  }
  .dashboard-grid { grid-template-columns: 1fr; gap: 12px; }
  .ticket-progress-panel, .dashboard-activity-card { min-height: 0; }
  .ticket-progress-summary { padding: 16px 16px 6px; }
  .ticket-progress-list { padding: 8px 16px 16px; }
  .ticket-progress-row { grid-template-columns: 94px minmax(0, 1fr) 32px; gap: 9px; }
  .dashboard-activity-card .activity-list { max-height: 286px; }
  .customer-metrics { grid-template-columns: 1fr; gap: 9px; }
  .ticket-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-right: 0;
    padding-right: 0;
    overflow: visible;
  }
  .ticket-metric { min-width: 0; min-height: 106px; padding: 14px; }
  .ticket-metric:last-child { grid-column: 1 / -1; }
  .ticket-process-summary { min-width: 0; }
  .ticket-tools { justify-content: stretch; }
  .ticket-archive-filter { width: 100%; grid-template-columns: 1fr; }
  .customer-metric { min-height: 88px; padding: 14px; }
  .customer-metric > div,
  .ticket-metric > div,
  .mass-event-main > div { min-width: 0; }
  .customer-metric span,
  .customer-metric small,
  .ticket-metric span,
  .ticket-metric small { overflow-wrap: anywhere; }
  .customer-toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch;
  }
  .customer-toolbar > .primary-button,
  .customer-toolbar > .export-button,
  .customer-toolbar > .danger-button { width: 100%; min-height: 46px; padding: 0 10px; }
  #delete-selected-customers-button,
  #toggle-customer-filters { grid-column: 1 / -1; }
  .customer-toolbar .compact-search { grid-column: 1 / -1; }
  .mass-event-card { grid-template-columns: 1fr; }
  .mass-event-main { min-width: 0; }
  .mass-event-card .row-actions { padding-left: 28px; }
  .mass-event-summary { justify-content: flex-start; }
  .mass-event-heading-actions { justify-items: stretch; }
  .mass-event-filter { grid-template-columns: 1fr; }
  .mass-event-panel .panel-heading-row { align-items: stretch; flex-direction: column; }
  .mass-event-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mass-event-summary span { min-width: 0; }
  .customer-picker { grid-template-columns: 1fr; }
  .compact-search { width: 100%; }
  .bulk-action-bar { align-items: stretch; flex-direction: column; }
  .bulk-action-buttons { display: grid; grid-template-columns: 1fr 1fr; }
  .bulk-action-buttons .text-button { grid-column: 1 / -1; }
  .metrics article { min-height: 112px; padding: 15px; }
  .metrics strong { font-size: 27px; }
  .settings-grid, .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .notification-settings-grid { grid-template-columns: 1fr; }
  .settings-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }
  .settings-tabs button {
    min-width: 0;
    padding: 8px;
    line-height: 1.3;
    white-space: normal;
  }
  .panel { padding: 16px; border-radius: 16px; }
  .method-selector, .compact-form-grid { grid-template-columns: 1fr; }
  .method-selector label > span { min-height: 68px; }
  .method-panel .action-row { display: grid; grid-template-columns: 1fr; }
  .method-panel .action-row button { width: 100%; }
  .master-data-row { align-items: stretch; flex-direction: column; }
  .master-data-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .master-data-actions button { width: 100%; }
  .connection-status-card { align-items: flex-start; flex-direction: column; }
  .qr-preview { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .qr-placeholder { width: min(180px, 70vw); }
  .whatsapp-qr-image { width: min(240px, 76vw); }
  .toolbar { gap: 9px; }
  .filter-panel { grid-template-columns: 1fr; }

  .table-panel {
    width: 100%;
    overflow: visible;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  table,
  #customers table,
  #tickets table,
  .user-table,
  .pop-site-table { width: 100%; min-width: 0; }
  thead { display: none; }
  tbody { display: grid; gap: 12px; }
  tbody tr {
    display: grid;
    padding: 9px 0;
    border: 1px solid var(--line);
    border-radius: 19px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(18, 33, 58, .07);
  }
  td {
    display: grid;
    grid-template-columns: minmax(92px, 32%) 1fr;
    gap: 10px;
    align-items: start;
    padding: 8px 14px;
    border: 0;
    font-size: 12px;
    overflow-wrap: anywhere;
  }
  td > * { min-width: 0; }
  td > .priority-pill,
  td > .status-pill { justify-self: start; }
  td::before {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
  }
  .address-cell { max-width: none; }
  .row-actions { gap: 8px; }
  .row-actions > * { min-width: 0; max-width: 100%; }
  .action-menu-popover { min-width: 0; width: min(210px, 100%); }
  .mini-button { min-height: 38px; padding: 0 11px; }

  #customer-table td:nth-child(1)::before { content: "Pelanggan"; }
  #customer-table td:nth-child(2)::before { content: "POP"; }
  #customer-table td:nth-child(3)::before { content: "Layanan"; }
  #customer-table td:nth-child(4)::before { content: "Lokasi"; }
  #customer-table td:nth-child(5)::before { content: "Status"; }
  #customer-table td:nth-child(6)::before { content: "Aksi"; }
  #ticket-table td:nth-child(1)::before { content: "No tiket"; }
  #ticket-table td:nth-child(2)::before { content: "Pelanggan"; }
  #ticket-table td:nth-child(3)::before { content: "Kategori"; }
  #ticket-table td:nth-child(4)::before { content: "Prioritas"; }
  #ticket-table td:nth-child(5)::before { content: "Status"; }
  #ticket-table td:nth-child(6)::before { content: "NOC/Teknisi"; }
  #ticket-table td:nth-child(7)::before { content: "Aksi"; }
  #user-table td:nth-child(1)::before { content: "Nama"; }
  #user-table td:nth-child(2)::before { content: "Username"; }
  #user-table td:nth-child(3)::before { content: "WhatsApp"; }
  #user-table td:nth-child(4)::before { content: "Role"; }
  #user-table td:nth-child(5)::before { content: "Status"; }
  #user-table td:nth-child(6)::before { content: "Aksi"; }
  #pop-site-list td:nth-child(1)::before { content: "Nama / Kode"; }
  #pop-site-list td:nth-child(2)::before { content: "Area"; }
  #pop-site-list td:nth-child(3)::before { content: "Alamat"; }
  #pop-site-list td:nth-child(4)::before { content: "Koordinat"; }
  #pop-site-list td:nth-child(5)::before { content: "Status"; }
  #pop-site-list td:nth-child(6)::before { content: "Aksi"; }

  .pagination-bar { align-items: stretch; flex-direction: column; }
  .pagination-summary { display: flex !important; justify-content: space-between; }
  .pagination-buttons { display: grid !important; grid-template-columns: 1fr 1fr; }
  .activity-item { grid-template-columns: 38px 1fr; padding: 14px; }
  .activity-item small { grid-column: 2; text-align: left; }
  .activity-panel .panel-heading-row { align-items: flex-start; padding: 16px; }
  .settings-pane-heading { align-items: stretch; flex-direction: column; }

  .modal-backdrop { place-items: end center; padding: 0; }
  .modal-card {
    width: 100%;
    min-width: 0;
    max-height: 92vh;
    overflow-x: hidden;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0;
  }
  .modal-card input,
  .modal-card select,
  .modal-card textarea { min-width: 0; max-width: 100%; }
  .modal-card .action-row > button { flex: 1 1 140px; }
  .modal-heading { flex-direction: row; }
  .login-screen { padding: 18px; }
  .login-card { padding: 24px 20px; border-radius: 20px; }
  .login-card img { width: 232px; }
}

@media (max-width: 390px) {
  .topnav { gap: 7px; padding-inline: 10px; }
  .brand img { width: 128px; height: 38px; }
  .user-menu .ghost-button { padding-inline: 10px; font-size: 12px; }
  .content { width: calc(100% - 20px); }
  .nav-menu { right: 7px; bottom: 7px; left: 7px; }
  .nav-menu a { padding-inline: 4px; font-size: 10px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metrics article { min-height: 102px; padding: 12px; }
  .metrics strong { font-size: 24px; }
  .dashboard-metric-icon {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
    font-size: 21px !important;
  }
  .ticket-metric {
    min-height: 100px;
    gap: 7px;
    padding: 12px;
  }
  .ticket-metric-icon {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
    font-size: 20px;
  }
  .ticket-metric strong { font-size: 25px; }
  .ticket-progress-row { grid-template-columns: 78px minmax(0, 1fr) 28px; gap: 7px; }
  .customer-toolbar,
  .page-heading > .action-row,
  .bulk-action-buttons,
  .master-data-actions { grid-template-columns: 1fr; }
  .customer-toolbar > *,
  #delete-selected-customers-button,
  #toggle-customer-filters,
  .customer-toolbar .compact-search { grid-column: 1; }
  .inline-form { grid-template-columns: 1fr; }
  .inline-form button { width: 100%; }
  .mass-event-summary { grid-template-columns: 1fr; }
  td { grid-template-columns: minmax(82px, 31%) minmax(0, 1fr); padding-inline: 12px; }
  .pagination-summary { align-items: stretch; flex-direction: column; gap: 8px !important; }
  .page-size-control { justify-content: space-between; }
  .login-screen { padding: 12px; }
  .login-card { padding-inline: 16px; }
  .login-card img { width: 210px; }
  .session-warning { right: 10px; bottom: calc(90px + env(safe-area-inset-bottom)); left: 10px; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
