@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Space+Mono:wght@400;700&display=swap");

:root {
  --background: hsl(214 35% 96%);
  --foreground: hsl(218 55% 12%);
  --card: hsl(0 0% 100%);
  --border: hsl(214 22% 87%);
  --muted: hsl(214 22% 92%);
  --muted-foreground: hsl(215 18% 46%);
  --primary: hsl(213 90% 47%);
  --primary-soft: hsl(213 90% 95%);
  --accent: hsl(172 68% 40%);
  --destructive: hsl(0 82% 57%);
  --sidebar: hsl(218 68% 13%);
  --sidebar-accent: hsl(218 68% 21%);
  --sidebar-border: hsl(218 68% 19%);
  --sidebar-foreground: hsl(210 40% 95%);
  --warning: hsl(38 92% 50%);
  --radius: 8px;
  --shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--foreground);
  font-family: "Plus Jakarta Sans", Segoe UI, Arial, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

button:active:not(:disabled) {
  transform: scale(0.96);
}

button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(380px, 2fr) 3fr;
  background: var(--background);
}

.login-panel {
  display: contents;
}

.login-panel > div:first-child {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px;
  overflow: hidden;
  background: var(--sidebar);
  color: white;
  text-align: center;
}

.login-panel > div:first-child::before,
.login-panel > div:first-child::after {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.login-panel > div:first-child::before {
  top: -160px;
  left: -160px;
}

.login-panel > div:first-child::after {
  right: -140px;
  bottom: -140px;
}

.login-panel > div:first-child h1 {
  position: relative;
  margin: 0 0 10px;
  font-size: 28px;
  font-weight: 800;
}

.login-panel > div:first-child .muted {
  position: relative;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.7;
}

.login-panel > div:first-child .eyebrow {
  color: rgba(255, 255, 255, 0.65);
}

.login-form {
  width: min(390px, calc(100vw - 48px));
  align-self: center;
  justify-self: center;
  display: grid;
  gap: 16px;
  padding: 26px;
  border: 1px solid color-mix(in srgb, var(--border), transparent 25%);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sidebar .eyebrow {
  margin: 0;
}

.muted,
.field-help {
  color: var(--muted-foreground);
}

.field-help {
  font-size: 13px;
  font-weight: 600;
}

label {
  display: grid;
  gap: 7px;
  color: var(--foreground);
  font-size: 14px;
  font-weight: 600;
}

input,
select,
textarea {
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 12px;
  background: white;
  color: var(--foreground);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea {
  min-height: 86px;
  padding-block: 10px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary), transparent 84%);
}

input[readonly] {
  background: hsl(214 22% 95%);
  color: var(--muted-foreground);
}

button[type="submit"],
.primary {
  min-height: 40px;
  border-radius: var(--radius);
  padding: 0 14px;
  background: var(--primary);
  color: white;
  font-weight: 700;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08), 0 1px 3px rgba(37, 99, 235, 0.12);
}

button[type="submit"]:hover:not(:disabled),
.primary:hover:not(:disabled) {
  background: hsl(213 90% 40%);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.24);
}

button[type="submit"]:active:not(:disabled),
.primary:active:not(:disabled) {
  background: hsl(213 90% 34%);
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}

.error {
  min-height: 18px;
  margin: 0;
  color: var(--destructive);
  font-size: 14px;
}

.app {
  height: 100vh;
  display: grid;
  grid-template-columns: 256px 1fr;
  overflow: hidden;
}

.sidebar {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 18px;
  min-height: 0;
  padding: 20px 12px 16px;
  background: var(--sidebar);
  color: var(--sidebar-foreground);
  box-shadow: 8px 0 28px rgba(15, 23, 42, 0.12);
  overflow: hidden;
}

.sidebar > div:first-child {
  padding: 0 8px 4px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar {
  gap: 4px;
  padding: 12px 10px 10px;
}

.sidebar h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.sidebar .eyebrow {
  margin: 0;
  color: rgba(255, 255, 255, 0.55);
}

.sidebar nav {
  overflow-y: auto;
  min-height: 0;
}

nav {
  display: grid;
  gap: 2px;
  align-content: start;
}

.nav-item,
.ghost {
  width: 100%;
  min-height: 36px;
  border-radius: var(--radius);
  padding: 0 10px;
  text-align: left;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}

.nav-item.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.24);
}

.nav-item:hover:not(.active):not(:disabled) {
  background: var(--sidebar-accent);
  color: white;
}

.nav-item:active:not(.active):not(:disabled) {
  transform: scale(0.97);
}

.ghost:hover:not(:disabled) {
  background: var(--sidebar-accent);
  color: white;
}

.ghost:active:not(:disabled) {
  transform: scale(0.96);
}

.workspace {
  min-width: 0;
  padding: 24px;
  overflow-y: auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  max-width: 1280px;
  margin: 0 auto 20px;
}

.topbar h1 {
  margin: 4px 0 0;
  font-size: 22px;
  font-weight: 800;
}

.user-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 8px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  line-height: 1.2;
}

.user-pill-info span {
  display: block;
  font-size: 13px;
}

.user-pill-info small {
  font-size: 11px;
  opacity: 0.7;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.online {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
  animation: pulse-dot 2s ease-in-out infinite;
}

.status-dot.offline {
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

.user-pill span,
.user-pill small {
  display: block;
}

.user-pill span {
  font-weight: 800;
  font-size: 14px;
}

.user-pill small {
  font-size: 12px;
  opacity: 0.7;
}

.view {
  max-width: 1280px;
  margin: 0 auto;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.card,
.reference-block,
.filters,
.table-shell {
  border: 1px solid color-mix(in srgb, var(--border), transparent 25%);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.card {
  padding: 20px;
}

.card p {
  min-height: 20px;
  margin: 0 0 8px;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.card strong {
  font-size: 24px;
  font-weight: 800;
}

.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.chart-list {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 190px) 1fr 42px;
  gap: 10px;
  align-items: center;
  font-size: 14px;
}

.bar {
  height: 9px;
  border-radius: 999px;
  background: var(--muted);
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: var(--primary);
}

.filters {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, minmax(160px, 1fr));
  gap: 12px;
  padding: 14px;
  margin-bottom: 14px;
}

.rekap-filters {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  font-size: 14px;
}

.pagination-actions {
  display: flex;
  gap: 8px;
}

.pagination button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.secondary,
.danger,
.small-action,
.icon-button {
  min-height: 36px;
  border-radius: var(--radius);
  padding: 0 12px;
  font-weight: 700;
}

.secondary,
.small-action,
.icon-button {
  border: 1px solid var(--border);
  background: white;
  color: var(--foreground);
}

.secondary:hover:not(:disabled),
.small-action:hover:not(:disabled),
.icon-button:hover:not(:disabled) {
  background: var(--muted);
  border-color: hsl(214 22% 76%);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.secondary:active:not(:disabled),
.small-action:active:not(:disabled),
.icon-button:active:not(:disabled) {
  background: hsl(214 22% 86%);
  border-color: hsl(214 22% 70%);
}

.danger {
  background: var(--destructive);
  color: white;
}

.danger:hover:not(:disabled) {
  background: hsl(0 82% 48%);
  box-shadow: 0 2px 10px rgba(220, 38, 38, 0.2);
}

.danger:active:not(:disabled) {
  background: hsl(0 82% 40%);
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.3);
}

.small-action {
  min-height: 30px;
  margin-right: 6px;
  font-size: 13px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

.table-shell {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

th,
td {
  max-width: 300px;
  padding: 10px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--border), transparent 35%);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: hsl(214 35% 98%);
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

td {
  white-space: pre-wrap;
}

th.action-col,
td.action-col {
  position: sticky;
  right: 0;
  z-index: 2;
  min-width: 180px;
  background: white;
}

th.action-col {
  background: hsl(214 35% 98%);
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 8px;
  background: hsl(142 68% 94%);
  color: hsl(142 68% 32%);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.status.warn {
  background: hsl(38 92% 93%);
  color: hsl(38 92% 32%);
}

.photo-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}

.photo-thumb:hover {
  transform: scale(4.5);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.2);
  z-index: 10;
  position: relative;
}

.btn-sm {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.8125rem;
  border-radius: var(--radius);
  text-decoration: none;
  background: var(--accent);
  color: #fff;
  white-space: nowrap;
}

.btn-sm:hover {
  filter: brightness(1.1);
}

.reference-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 16px;
}

.reference-block {
  padding: 16px;
  overflow: auto;
}

.reference-block h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.compact-table {
  min-width: 460px;
}

.modal {
  width: min(960px, calc(100vw - 32px));
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.26);
}

.modal::backdrop {
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(3px);
}

.modal form {
  padding: 22px;
}

.modal-head,
.modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.modal-head {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.modal-head h2 {
  margin: 0;
  font-size: 20px;
}

.modal-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-height: 62vh;
  overflow: auto;
  padding: 18px 4px;
}

.modal-fields .wide {
  grid-column: 1 / -1;
}

.modal-fields .wide input[type="file"] {
  padding: 8px 12px;
  box-sizing: border-box;
}

.modal-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.bb-nihil-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 400;
  margin: 4px 0;
  cursor: pointer;
}

.bb-nihil-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: auto;
}

.bb-list {
  display: grid;
  gap: 8px;
}

.bb-row {
  display: grid;
  grid-template-columns: 1fr 110px auto;
  gap: 8px;
  align-items: center;
}

.batch-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: hsl(214 35% 98%);
}

.batch-head p {
  margin: 0;
}

.perkara-entries {
  display: grid;
  gap: 14px;
}

.perkara-entry {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
}

.perkara-entry header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.perkara-entry h3 {
  margin: 0;
  font-size: 15px;
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.entry-grid .wide {
  grid-column: 1 / -1;
}

.user-form,
.password-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin-top: 16px;
}

.password-form {
  max-width: 760px;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
}

.toast-viewport {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1000;
  display: grid;
  gap: 10px;
  width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}

.toast-viewport--dialog {
  right: 22px;
  bottom: 76px;
  z-index: 2147483647;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 14px;
  background: white;
  color: var(--foreground);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.18);
  animation: toast-in 180ms ease-out;
}

.toast.success {
  border-color: hsl(142 55% 82%);
  background: hsl(142 55% 96%);
  color: hsl(142 55% 22%);
}

.toast.destructive {
  border-color: hsl(0 82% 86%);
  background: hsl(0 82% 97%);
  color: hsl(0 72% 28%);
}

.toast.warning {
  border-color: hsl(38 92% 82%);
  background: hsl(38 92% 96%);
  color: hsl(38 92% 26%);
}

.toast.info {
  border-color: hsl(213 90% 86%);
  background: hsl(213 90% 97%);
  color: hsl(213 90% 28%);
}

.toast-content {
  display: flex;
  gap: 10px;
  min-width: 0;
}

.toast-icon {
  flex: 0 0 auto;
  font-size: 18px;
  line-height: 1.1;
}

.toast-title {
  font-size: 14px;
  font-weight: 800;
}

.toast-description {
  margin-top: 2px;
  font-size: 13px;
  opacity: 0.88;
  white-space: pre-line;
}

.toast-close {
  width: 26px;
  height: 26px;
  border-radius: var(--radius);
  background: transparent;
  color: currentColor;
  opacity: 0.55;
}

.toast-close:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.05);
  opacity: 1;
  transform: scale(1.1);
}

.toast-close:active:not(:disabled) {
  transform: scale(0.92);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 980px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-panel > div:first-child {
    padding: 20px 16px;
    flex-direction: row;
    gap: 12px;
    align-items: center;
    justify-content: center;
    text-align: left;
  }

  .login-panel > div:first-child::before,
  .login-panel > div:first-child::after {
    display: none;
  }

  .login-panel > div:first-child .logo {
    width: 48px;
    height: 48px;
  }

  .login-panel > div:first-child h1 {
    font-size: 18px;
  }

  .login-panel > div:first-child .eyebrow {
    font-size: 13px;
  }

  .app,
  .grid-two,
  .reference-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }

  .cards,
  .filters {
    grid-template-columns: 1fr 1fr;
  }

  .modal-fields,
  .entry-grid,
  .user-form,
  .password-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .workspace {
    padding: 18px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .cards,
  .filters {
    grid-template-columns: 1fr;
  }
}

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

.logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-logo {
  width: 40px;
  height: 40px;
}

.wa-actions {
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.wa-send {
  width: 100%;
  min-height: 40px;
  border-radius: var(--radius);
  padding: 0 14px;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid #25D366;
  color: #075E54;
  background: #DCF8C6;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.wa-send:hover:not(:disabled) {
  background: #c8e6b0;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.24);
}

.wa-send:active:not(:disabled) {
  transform: scale(0.96);
}

/* ── Sidebar Overlay ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(15, 23, 42, 0.5);
}

/* ── Hamburger ── */
.hamburger {
  display: none;
  font-size: 22px;
  min-height: 40px;
  min-width: 44px;
  padding: 0 8px;
  background: transparent;
  border: 0;
  cursor: pointer;
}

/* ── Topbar left group ── */
.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Mobile & Tablet ── */
@media (max-width: 900px) {
  .app {
    grid-template-columns: 260px 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.open {
    display: block;
  }

  .hamburger {
    display: inline-flex;
  }

  .topbar-left > div:last-child {
    min-width: 0;
  }

  .topbar-left h1 {
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 640px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    width: 80vw;
    max-width: 300px;
  }

  .workspace {
    padding: 14px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin: -14px -14px 16px;
    padding: 14px;
    background: var(--sidebar);
    color: var(--sidebar-foreground);
    border-radius: 0 0 var(--radius) var(--radius);
  }

  .topbar h1 {
    font-size: 18px;
  }

  .topbar .muted {
    color: rgba(255, 255, 255, 0.65);
  }

  .hamburger {
    color: inherit;
  }

  .topbar-left {
    justify-content: flex-start;
  }

  .topbar-left > div:last-child {
    flex: 1;
    text-align: center;
  }

  .topbar-left h1 {
    text-align: center;
  }

  .card p {
    font-size: 12px;
  }

  .card strong {
    font-size: 20px;
  }

  .modal {
    width: calc(100vw - 16px);
    margin: 0 auto;
  }

  .modal form {
    padding: 14px;
  }

  .modal-fields {
    max-height: 70vh;
    padding: 12px 2px;
  }

  .modal-actions {
    flex-wrap: wrap;
    gap: 8px;
  }

  .modal-actions button {
    flex: 1;
    min-width: 0;
    font-size: 13px;
  }

  .pagination {
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
  }



  .perkara-entry {
    padding: 10px;
  }

  .perkara-entry header h3 {
    font-size: 14px;
  }

  .perkara-entry header button {
    font-size: 12px;
    min-height: 36px;
    padding: 0 10px;
  }

  .photo-thumb {
    min-width: 40px;
    min-height: 40px;
  }

  .bar-row {
    grid-template-columns: 1fr 42px;
    gap: 6px;
  }

  .bar-row .bar-label {
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .toast-viewport,
  .toast-viewport--dialog {
    right: 8px;
    bottom: 8px;
    width: calc(100vw - 16px);
  }
}

@media (max-width: 480px) {
  .cards {
    gap: 10px;
  }

  .filters {
    gap: 8px;
    padding: 10px;
  }

  .bb-row {
    grid-template-columns: 1fr 80px auto;
  }

  .compact-table {
    min-width: 0;
  }

  .entry-grid {
    gap: 8px;
  }

  .modal-actions .wa-send {
    width: 100%;
  }

  .reference-grid {
    gap: 10px;
  }

  .reference-block {
    padding: 10px;
    overflow-x: auto;
  }

  .laporan-form textarea {
    font-size: 13px;
  }
}

.laporan-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.laporan-form .wide {
  grid-column: 1 / -1;
}

.laporan-form textarea {
  min-height: 50px;
  font-family: inherit;
  resize: vertical;
  padding: 8px 10px;
}

.laporan-form textarea#laporPreview {
  font-family: monospace;
  font-size: 13px;
  line-height: 1.5;
  min-height: 300px;
  background: #f8f9fa;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  white-space: pre;
}

.lapor-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 16px 0;
}

.lapor-chart-img {
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
}

@media (max-width: 640px) {
  .lapor-charts {
    grid-template-columns: 1fr;
  }
}

.lapor-list {
  display: grid;
  gap: 6px;
}

.lapor-list-item {
  display: flex;
  gap: 6px;
  align-items: center;
}

.lapor-list-item input {
  flex: 1;
  min-height: 36px;
  font-size: 13px;
}

.lapor-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.laporan-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .laporan-form {
    grid-template-columns: 1fr;
  }
}
