* {
  box-sizing: border-box;
}

:root {
  --app-ink: #17202a;
  --app-muted: #5d6d7e;
  --app-line: #d8dee9;
  --app-bg: #eef3f8;
  --app-panel: #ffffff;
  --app-primary: #135e75;
  --app-primary-dark: #0d3f52;
  --app-accent: #f5b942;
  --app-success: #198754;
  --app-danger: #b42318;
  --app-radius: 8px;
  --app-shadow: 0 18px 45px rgba(23, 32, 42, .10);
}

body {
  margin: 0;
  color: var(--app-ink);
  background:
    radial-gradient(circle at top left, rgba(19, 94, 117, .10), transparent 30rem),
    linear-gradient(180deg, #f8fbfd 0%, var(--app-bg) 100%);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 17px;
  line-height: 1.58;
}

a {
  color: var(--app-primary);
  text-decoration: none;
}

a:hover {
  color: var(--app-primary-dark);
}

.topbar {
  background: linear-gradient(90deg, #0d3f52 0%, #135e75 58%, #227c6d 100%);
  box-shadow: 0 8px 24px rgba(13, 63, 82, .22);
}

.app-brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  max-width: 70vw;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.2;
  white-space: normal;
}

.app-brand span:last-child {
  display: grid;
  gap: 2px;
}

.app-brand small {
  color: rgba(255, 255, 255, .82);
  font-size: 13px;
  font-weight: 700;
}

.brand-mark {
  display: inline-grid;
  width: 46px;
  height: 46px;
  place-items: center;
  flex: 0 0 auto;
  aspect-ratio: 1;
  border-radius: var(--app-radius);
  border: 1px solid rgba(255, 255, 255, .55);
  background:
    linear-gradient(145deg, #ffd76d 0%, var(--app-accent) 54%, #e9a62a 100%);
  color: #2b2111;
  font-size: 24px;
  line-height: 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .55),
    inset 0 -2px 0 rgba(0, 0, 0, .12),
    0 10px 22px rgba(0, 0, 0, .14);
}

.brand-mark i {
  display: block;
  line-height: 1;
}

.app-toggler {
  min-height: 46px;
}

.mobile-menu-button {
  display: none;
  min-height: 46px;
  gap: 6px;
  align-items: center;
  border: 0;
  border-radius: var(--app-radius);
  font-weight: 850;
}

.table-tools-toggle i {
  margin-right: 6px;
}

.topbar-user {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
}

.user-chip {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 46px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: var(--app-radius);
  color: #fff;
  font-weight: 700;
}

.connection-chip {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: var(--app-radius);
  background: rgba(255, 255, 255, .10);
  color: #fff;
  font-size: 14px;
  font-weight: 850;
}

.connection-chip i {
  color: #f8d56e;
  font-size: 18px;
}

.desaku-online .connection-chip i {
  color: #9df0c2;
}

.desaku-offline .connection-chip,
.desaku-server-down .connection-chip {
  background: #fff1f0;
  color: var(--app-danger);
}

.desaku-offline .connection-chip i,
.desaku-server-down .connection-chip i {
  color: var(--app-danger);
}

.logout-button {
  min-height: 46px;
  border-radius: var(--app-radius);
  font-weight: 800;
}

.app-shell {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  min-height: calc(100vh - 70px);
}

.sidebar {
  background: #122b3a;
  color: #e9f2f7;
  border-right: 1px solid rgba(255, 255, 255, .10);
}

.mobile-menu {
  width: min(360px, 92vw);
  color: #e9f2f7;
  background: #122b3a;
}

.mobile-menu .offcanvas-header {
  align-items: flex-start;
  background: linear-gradient(90deg, #0d3f52 0%, #135e75 100%);
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.mobile-menu .offcanvas-title {
  margin: 0;
  color: #fff;
  font-size: 24px;
  font-weight: 850;
}

.mobile-menu .offcanvas-header p {
  margin: 3px 0 0;
  color: #d7eef5;
  font-size: 14px;
  font-weight: 700;
}

.mobile-menu .offcanvas-body {
  padding: 0;
}

.mobile-sidebar-inner {
  position: static;
  height: auto;
  max-height: calc(100vh - 86px);
  overflow-y: auto;
  padding: 14px;
}

.sidebar-inner {
  position: sticky;
  top: 70px;
  height: calc(100vh - 70px);
  overflow-y: auto;
  padding: 18px 14px 24px;
}

.quick-card {
  margin-bottom: 18px;
  padding: 16px;
  border-radius: var(--app-radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .05));
  border: 1px solid rgba(255, 255, 255, .14);
}

.quick-card span {
  display: block;
  color: #b8d4e2;
  font-size: 14px;
}

.quick-card strong {
  display: block;
  color: #fff;
  font-size: 21px;
}

.quick-card small {
  display: block;
  margin-top: 3px;
  color: #d7eef5;
  font-size: 13px;
  line-height: 1.35;
}

.sidebar-title {
  margin: 22px 12px 8px;
  color: #a8c7d8;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.nav-item-link {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 50px;
  padding: 10px 12px;
  border-radius: var(--app-radius);
  color: #f8fbfd;
  font-size: 16px;
  font-weight: 700;
}

.nav-item-link i {
  width: 26px;
  color: #f3c85c;
  font-size: 21px;
  text-align: center;
}

.nav-item-link:hover,
.nav-item-link.active {
  color: #fff;
  background: rgba(255, 255, 255, .13);
  text-decoration: none;
}

.content-area {
  min-width: 0;
  width: 100%;
  max-width: 1260px;
  margin: 0 auto;
  padding: 28px 28px 40px;
}

.offline-banner {
  display: none;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #efb1a9;
  border-radius: var(--app-radius);
  background: #fff1f0;
  color: #7a271a;
  box-shadow: 0 10px 24px rgba(180, 35, 24, .12);
}

.offline-banner div {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.offline-banner i {
  font-size: 22px;
}

.offline-banner button {
  min-height: 40px;
  border: 0;
  background: var(--app-danger);
  color: #fff;
}

.desaku-offline .offline-banner,
.desaku-server-down .offline-banner {
  display: flex;
}

.login-offline-banner {
  position: fixed;
  top: 14px;
  right: 14px;
  left: 14px;
  z-index: 5;
  width: min(760px, calc(100% - 28px));
  margin: 0 auto;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  margin-bottom: 22px;
  padding: 28px;
  border-radius: var(--app-radius);
  color: #fff;
  background:
    linear-gradient(135deg, rgba(13, 63, 82, .96), rgba(19, 94, 117, .90)),
    linear-gradient(90deg, #0d3f52, #227c6d);
  box-shadow: var(--app-shadow);
}

.hero-panel h1 {
  max-width: 820px;
  margin: 6px 0 10px;
  font-size: clamp(28px, 3.3vw, 44px);
  font-weight: 850;
  line-height: 1.12;
}

.hero-panel p {
  max-width: 760px;
  margin: 0;
  color: #d7eef5;
  font-size: 19px;
}

.eyebrow {
  color: #f8d56e;
  font-size: 14px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hero-actions,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.panel,
.stat,
.grid-view,
.detail-view {
  min-width: 0;
  background: var(--app-panel);
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  box-shadow: 0 10px 30px rgba(23, 32, 42, .06);
}

.panel {
  padding: 24px;
  margin-bottom: 22px;
}

.panel h2,
.panel h3 {
  margin: 0 0 16px;
  color: var(--app-ink);
  font-weight: 850;
}

.panel h2 {
  font-size: 26px;
}

.panel h3 {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--app-line);
  font-size: 21px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.stat {
  position: relative;
  padding: 22px;
  overflow: hidden;
}

.stat i {
  display: inline-grid;
  width: 48px;
  height: 48px;
  place-items: center;
  margin-bottom: 10px;
  border-radius: var(--app-radius);
  background: #e8f4f7;
  color: var(--app-primary);
  font-size: 25px;
}

.stat span {
  display: block;
  color: var(--app-muted);
  font-size: 16px;
  font-weight: 800;
}

.stat strong {
  display: block;
  margin-top: 4px;
  color: var(--app-primary-dark);
  font-size: 38px;
  line-height: 1;
}

.module-grid,
.report-grid,
.grid-form {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 22px;
  align-items: center;
  margin-bottom: 22px;
  padding: 26px;
  border-radius: var(--app-radius);
  color: #fff;
  background:
    linear-gradient(135deg, rgba(13, 63, 82, .96), rgba(34, 124, 109, .92)),
    #0d3f52;
  box-shadow: var(--app-shadow);
}

.report-hero h1 {
  margin: 6px 0 8px;
  font-size: 36px;
  font-weight: 850;
  line-height: 1.12;
}

.report-hero p {
  max-width: 760px;
  margin: 0;
  color: #d7eef5;
  font-size: 18px;
}

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

.report-hero-metrics div {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .20);
  border-radius: var(--app-radius);
  background: rgba(255, 255, 255, .10);
}

.report-hero-metrics span {
  display: block;
  color: #d7eef5;
  font-size: 14px;
  font-weight: 800;
}

.report-hero-metrics strong {
  display: block;
  margin-top: 4px;
  color: #fff;
  font-size: 34px;
  line-height: 1;
}

.report-card h2 {
  margin-bottom: 14px;
}

.chart-bars {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.chart-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 2fr) 56px;
  gap: 10px;
  align-items: center;
}

.chart-label {
  min-width: 0;
  overflow: hidden;
  color: #334155;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-track {
  height: 15px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf3;
}

.chart-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--app-primary);
}

.chart-row strong {
  color: var(--app-primary-dark);
  text-align: right;
}

.chart-gold .chart-track span {
  background: #d4941e;
}

.chart-green .chart-track span {
  background: #198754;
}

.chart-blue .chart-track span {
  background: #3867c8;
}

.empty-chart {
  padding: 14px;
  border-radius: var(--app-radius);
  background: #f8fbfd;
  color: var(--app-muted);
  font-weight: 800;
}

.module-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.module-tile {
  display: flex;
  min-height: 150px;
  flex-direction: column;
  gap: 7px;
  padding: 18px;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: #f9fbfd;
  color: var(--app-ink);
}

.module-tile:hover {
  border-color: #89bfd0;
  background: #eef8fb;
  color: var(--app-ink);
  text-decoration: none;
}

.module-tile i {
  color: var(--app-primary);
  font-size: 30px;
}

.module-tile strong {
  font-size: 19px;
}

.module-tile span {
  color: var(--app-muted);
  font-size: 15px;
}

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

.toolbar h2 {
  margin: 0;
}

.button,
button,
input[type="submit"],
.btn {
  min-height: 46px;
  border-radius: var(--app-radius);
  padding: 10px 18px;
  font-weight: 800;
}

.button,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  background: var(--app-primary);
  color: #fff;
  cursor: pointer;
}

.button.secondary {
  background: #516173;
}

.button.danger {
  background: var(--app-danger);
}

.button:hover,
input[type="submit"]:hover {
  color: #fff;
  background: var(--app-primary-dark);
  text-decoration: none;
}

input[type="submit"]:disabled,
button[type="submit"]:disabled,
input.desaku-disabled,
button.desaku-disabled {
  cursor: not-allowed;
  opacity: .68;
}

label {
  display: block;
  margin-bottom: 7px;
  color: #243447;
  font-size: 16px;
  font-weight: 800;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="file"],
select,
textarea {
  width: 100%;
  max-width: 100%;
  min-height: 48px;
  border: 1px solid #b8c4d2;
  border-radius: var(--app-radius);
  padding: 10px 12px;
  background: #fff;
  color: var(--app-ink);
  font-size: 17px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--app-primary);
  box-shadow: 0 0 0 .22rem rgba(19, 94, 117, .18);
  outline: none;
}

textarea {
  min-height: 118px;
}

.form-row {
  margin-bottom: 16px;
}

.grid-form .full {
  grid-column: 1 / -1;
}

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

.checkbox-row label {
  margin: 0;
}

.checkbox-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.hint,
.login-hint {
  color: var(--app-muted);
}

.offline-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 15%, rgba(245, 185, 66, .24), transparent 26rem),
    linear-gradient(135deg, #071d2a 0%, #135e75 62%, #227c6d 100%);
}

.offline-shell {
  width: min(620px, 100%);
  padding: 34px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 28px 80px rgba(7, 29, 42, .34);
  text-align: center;
}

.offline-logo {
  width: 86px;
  height: 86px;
  object-fit: contain;
  margin-bottom: 14px;
}

.offline-eyebrow {
  display: inline-block;
  color: var(--app-primary);
  font-weight: 900;
  letter-spacing: .08em;
}

.offline-shell h1 {
  margin: 8px 0 10px;
  color: var(--app-primary-dark);
  font-size: 34px;
  font-weight: 900;
}

.offline-shell p {
  color: var(--app-muted);
}

.offline-steps {
  display: grid;
  gap: 10px;
  margin: 24px 0;
  text-align: left;
}

.offline-steps div {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: #f8fbfd;
}

.offline-steps strong {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 999px;
  background: var(--app-accent);
}

.offline-shell button {
  border: 0;
  background: var(--app-primary);
  color: #fff;
}

.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  display: grid;
  place-items: center;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 26px;
  background:
    radial-gradient(circle at 20% 15%, rgba(245, 185, 66, .26), transparent 26rem),
    radial-gradient(circle at 85% 20%, rgba(66, 211, 194, .20), transparent 22rem),
    linear-gradient(135deg, #071d2a 0%, #0d3f52 44%, #165f63 100%);
}

.login-page::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .20;
  background-image:
    linear-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .08) 1px, transparent 1px);
  background-size: 46px 46px;
  animation: loginGridMove 18s linear infinite;
}

.login-orb {
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  filter: blur(18px);
  opacity: .45;
  pointer-events: none;
  animation: loginFloat 9s ease-in-out infinite alternate;
}

.orb-one {
  left: -70px;
  bottom: 10%;
  background: #f5b942;
}

.orb-two {
  top: -60px;
  right: -40px;
  background: #42d3c2;
  animation-delay: -3s;
}

.login-shell {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(1060px, 100%);
  min-height: 640px;
  grid-template-columns: minmax(0, 1fr) 500px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 18px;
  background: rgba(255, 255, 255, .12);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .36);
  backdrop-filter: blur(18px);
}

.login-showcase {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: center;
  padding: 42px;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .03));
}

.login-showcase-mark {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  margin-bottom: 22px;
  font-size: 32px;
  animation: loginPulse 2.8s ease-in-out infinite;
}

.login-showcase > span {
  color: #f8d56e;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .12em;
}

.login-showcase h1 {
  max-width: 520px;
  margin: 10px 0 14px;
  font-size: 48px;
  font-weight: 900;
  line-height: 1.05;
}

.login-showcase p {
  max-width: 520px;
  margin: 0;
  color: #d7eef5;
  font-size: 18px;
}

.login-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 34px;
}

.login-feature-grid div {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: var(--app-radius);
  background: rgba(255, 255, 255, .10);
}

.login-feature-grid i {
  color: #f8d56e;
  font-size: 24px;
}

.login-feature-grid strong,
.login-feature-grid small {
  display: block;
}

.login-feature-grid strong {
  margin-top: 8px;
  color: #fff;
}

.login-feature-grid small {
  color: #c9e4ed;
  font-size: 13px;
}

.login-box {
  display: grid;
  align-items: center;
  padding: 34px;
}

.login-card {
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, .68);
  border-radius: 16px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 24px 70px rgba(7, 29, 42, .28);
}

.login-brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 22px;
}

.login-brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  font-size: 27px;
}

.login-brand-copy {
  min-width: 0;
}

.login-input-row {
  position: relative;
}

.login-input-row i {
  position: absolute;
  left: 14px;
  bottom: 13px;
  color: var(--app-primary);
  font-size: 20px;
}

.login-input-row input {
  padding-left: 46px;
}

.login-submit {
  border: 0;
  background: linear-gradient(90deg, var(--app-primary), #227c6d);
  box-shadow: 0 12px 24px rgba(19, 94, 117, .24);
}

.login-submit:hover {
  background: linear-gradient(90deg, var(--app-primary-dark), #1c6f62);
}

.login-brand h1 {
  margin: 0;
  font-size: 27px;
  font-weight: 850;
  line-height: 1.15;
}

.login-brand-copy p {
  margin: 5px 0 0;
  color: var(--app-muted);
}

.login-brand-copy span {
  display: inline-block;
  margin-top: 6px;
  color: var(--app-primary);
  font-weight: 850;
}

.login-hint {
  display: flex;
  gap: 8px;
  margin: 18px 0 0;
  padding: 12px;
  border-radius: var(--app-radius);
  background: #fff7df;
}

@keyframes loginGridMove {
  from { background-position: 0 0; }
  to { background-position: 46px 46px; }
}

@keyframes loginFloat {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(28px, -24px, 0) scale(1.08); }
}

@keyframes loginPulse {
  0%, 100% { transform: translateY(0); box-shadow: 0 0 0 rgba(245, 185, 66, .0); }
  50% { transform: translateY(-4px); box-shadow: 0 0 34px rgba(245, 185, 66, .42); }
}

.flash-success,
.alert-lg {
  padding: 14px 16px;
  border-radius: var(--app-radius);
  font-size: 17px;
}

.errorSummary {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid #efb1a9;
  border-radius: var(--app-radius);
  background: #fff5f5;
  color: #7a271a;
}

.errorSummary ul {
  margin-bottom: 0;
}

.image-preview img {
  max-width: 100%;
  max-height: 150px;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: #fff;
}

.signer-order-box {
  padding: 16px;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: #f8fbfd;
}

.signer-order-table {
  display: grid;
  grid-template-columns: 70px minmax(220px, 1fr) minmax(170px, 240px) 110px;
  gap: 10px;
  align-items: center;
}

.signer-order-head {
  color: #334155;
  font-size: 14px;
  font-weight: 850;
  text-transform: uppercase;
}

.signer-order-table label {
  margin: 0;
  font-weight: 800;
}

.signer-order-table input[type="checkbox"] {
  width: 24px;
  height: 24px;
}

.table-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

.filter-card,
.sort-card {
  padding: 18px;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: #f8fbfd;
}

.sort-card {
  position: sticky;
  top: 88px;
}

.tool-card-title {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  color: var(--app-primary-dark);
  font-size: 18px;
  font-weight: 850;
}

.tool-card-title i {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: var(--app-radius);
  background: #e8f4f7;
  color: var(--app-primary);
  font-size: 20px;
}

.filter-grid-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 14px;
}

.filter-grid-form .form-row {
  margin-bottom: 0;
}

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

.filter-actions {
  display: flex;
  gap: 10px;
  align-items: end;
  grid-column: 1 / -1;
}

.sort-select {
  width: 100%;
}

.grid-view {
  max-width: 100%;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0;
  border: 1px solid var(--app-line);
  border-radius: var(--app-radius);
  background: #fff;
  box-shadow: 0 10px 30px rgba(23, 32, 42, .06);
  scrollbar-color: #9bb3c0 #edf4f8;
  scrollbar-width: thin;
}

.grid-view::-webkit-scrollbar {
  height: 11px;
}

.grid-view::-webkit-scrollbar-track {
  background: #edf4f8;
  border-radius: 999px;
}

.grid-view::-webkit-scrollbar-thumb {
  border: 2px solid #edf4f8;
  border-radius: 999px;
  background: #8eabb8;
}

.grid-view table,
.detail-view table,
table.items,
table.detail-view {
  width: 100%;
  min-width: 760px;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
}

.grid-view .summary {
  padding: 14px 16px 8px;
  color: var(--app-muted);
  font-weight: 750;
}

.detail-view table,
table.detail-view {
  min-width: 0;
}

.grid-view th,
.grid-view td,
.detail-view th,
.detail-view td,
th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid #e8edf3;
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.grid-view th,
th {
  background: linear-gradient(180deg, #f8fbfd, #edf4f8);
  color: #243447;
  font-weight: 850;
}

.modern-table th:first-child {
  border-top-left-radius: var(--app-radius);
}

.modern-table th:last-child {
  border-top-right-radius: var(--app-radius);
}

.modern-table tbody tr:nth-child(even) td {
  background: #fbfdff;
}

.grid-view tr:hover td {
  background: #eef8fb;
}

.grid-view .filters input,
.grid-view .filters select {
  min-height: 42px;
  padding: 8px 10px;
  font-size: 16px;
}

.grid-view .button-column {
  min-width: 190px;
  white-space: normal;
}

.grid-view .button-column a {
  display: inline-flex;
  gap: 5px;
  min-height: 36px;
  align-items: center;
  margin: 2px;
  padding: 6px 9px;
  border-radius: 6px;
  background: #e8f4f7;
  color: var(--app-primary-dark);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.grid-view .button-column a.primary-link {
  background: #e6f6ee;
  color: #146c43;
}

.grid-view .button-column a.action-link i {
  font-size: 15px;
}

.grid-view .button-column a:hover {
  background: #d5eef5;
  text-decoration: none;
}

.grid-view .button-column a.danger-link {
  background: #fff1f0;
  color: var(--app-danger);
}

.grid-view .button-column a.danger-link:hover {
  background: #ffe0dc;
}

.number-cell {
  width: 70px;
  text-align: center;
}

.modern-table td.number-cell {
  color: var(--app-primary-dark);
  font-weight: 850;
}

.pager,
.yiiPager {
  margin: 18px 0 6px;
  padding: 0;
}

.yiiPager li a,
.yiiPager li span {
  min-width: 42px;
  min-height: 42px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 16px;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 252px minmax(0, 1fr);
  }

  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-view table,
  table.items {
    min-width: 720px;
  }
}

@media (max-width: 920px) {
  body {
    font-size: 16px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .mobile-menu-button {
    display: inline-flex;
  }

  .app-toggler {
    display: inline-flex;
    align-items: center;
  }

  .content-area {
    padding: 22px 16px 34px;
  }

  .hero-panel {
    grid-template-columns: 1fr;
  }

  .report-hero {
    grid-template-columns: 1fr;
  }

  .login-shell {
    width: min(560px, 100%);
    min-height: auto;
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .login-page {
    place-items: start center;
    padding: 18px;
  }

  .login-box {
    order: 1;
    padding: 18px;
  }

  .login-showcase {
    order: 2;
    min-height: auto;
    padding: 22px;
  }

  .login-showcase h1 {
    font-size: 34px;
  }

  .login-feature-grid {
    grid-template-columns: 1fr;
  }

  .table-tools {
    grid-template-columns: 1fr;
  }

  .sort-card {
    position: static;
  }

  .filter-grid-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats,
  .report-grid,
  .grid-form,
  .signer-order-table {
    grid-template-columns: 1fr;
  }

  .signer-order-head {
    display: none;
  }

  .grid-view {
    position: relative;
    margin-right: -2px;
    margin-left: -2px;
    border-radius: 7px;
  }

  .grid-view::before {
    content: "Geser tabel ke samping untuk melihat semua kolom";
    display: block;
    position: sticky;
    left: 0;
    z-index: 2;
    padding: 10px 14px;
    border-bottom: 1px solid #dce7ee;
    background: #f8fbfd;
    color: var(--app-muted);
    font-size: 14px;
    font-weight: 800;
  }

  .grid-view table,
  table.items {
    min-width: 680px;
  }

  #penduduk-grid table,
  #arsip-surat-grid table {
    min-width: 840px;
  }

  #pejabat-grid table {
    min-width: 780px;
  }

  .grid-view th,
  .grid-view td {
    padding: 11px 12px;
    font-size: 15px;
  }

  .grid-view .button-column {
    min-width: 150px;
  }

  .grid-view .button-column a {
    min-height: 34px;
    padding: 6px 8px;
    font-size: 13px;
  }
}

@media (max-width: 640px) {
  .login-page {
    display: block;
    padding: 12px;
  }

  .login-shell {
    display: block;
    width: 100%;
    border-radius: 14px;
  }

  .app-brand {
    font-size: 16px;
    max-width: calc(100vw - 190px);
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    font-size: 22px;
  }

  .login-brand-mark {
    width: 48px;
    height: 48px;
    font-size: 24px;
  }

  .topbar-user,
  .toolbar,
  .hero-actions,
  .actions,
  .offline-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-user > *,
  .toolbar .actions,
  .actions > *,
  .hero-actions > *,
  .offline-banner > * {
    width: 100%;
  }

  .sidebar-inner,
  .module-grid {
    grid-template-columns: 1fr;
  }

  .panel,
  .hero-panel,
  .login-card {
    padding: 18px;
  }

  .login-showcase {
    display: none;
  }

  .login-box {
    padding: 12px;
  }

  .offline-shell {
    padding: 22px;
  }

  .offline-shell h1 {
    font-size: 28px;
  }

  .login-brand {
    align-items: flex-start;
  }

  .login-brand h1 {
    font-size: 24px;
  }

  .login-brand-copy p,
  .login-brand-copy span {
    font-size: 14px;
    line-height: 1.35;
  }

  .hero-panel h1 {
    font-size: 28px;
  }

  .report-hero h1 {
    font-size: 28px;
  }

  .report-hero-metrics,
  .chart-row,
  .filter-grid-form,
  .compact-pair {
    grid-template-columns: 1fr;
  }

  .panel {
    overflow: hidden;
  }

  .grid-view {
    margin-right: -10px;
    margin-left: -10px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .grid-view::before {
    padding: 9px 12px;
    font-size: 13px;
  }

  .grid-view table,
  table.items {
    min-width: 640px;
  }

  #penduduk-grid table,
  #arsip-surat-grid table {
    min-width: 800px;
  }

  .grid-view th,
  .grid-view td {
    padding: 10px;
    font-size: 14px;
  }

  .number-cell {
    width: 52px;
    min-width: 52px;
  }

  .grid-view .button-column {
    min-width: 132px;
  }

  .grid-view .button-column a {
    margin: 2px 1px;
    padding: 6px 7px;
  }

  .chart-row strong {
    text-align: left;
  }

  .stat strong {
    font-size: 34px;
  }
}
