:root {
  --primary: #1b3a6b;
  --primary-dark: #12274a;
  --accent: #c1541f;
  --surface: #ffffff;
  --bg: #f2f1ec;
  --ink: #1a1c1e;
  --steel: #6b7280;
  --line: #e4e2dc;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    "Roboto",
    -apple-system,
    sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}

/* Top App Bar (Material) */
.topbar {
  background: var(--primary);
  color: #fff;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-title {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.topbar-action {
  all: unset;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  transition: background 0.15s ease;
}

.topbar-action:hover,
.topbar-action:active {
  background: rgba(255, 255, 255, 0.14);
}

.app-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px 32px;
}

/* Generic Material card, reused across pages */
.m-card {
  background: var(--surface);
  border-radius: 12px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.08),
    0 1px 3px rgba(0, 0, 0, 0.08);
  padding: 16px;
}

/* Basic form elements, Material-ish */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
select {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  margin: 6px 0 16px;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27, 58, 107, 0.12);
}

label {
  font-size: 13px;
  font-weight: 500;
  color: var(--steel);
}

button,
.m-button {
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  transition:
    background 0.15s ease,
    transform 0.05s ease;
}

button:active {
  transform: scale(0.98);
}
button:hover {
  background: var(--primary-dark);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

table th,
table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
}

table th {
  font-weight: 500;
  color: var(--steel);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

a {
  color: var(--primary);
}

h1 {
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 4px;
}

/* Dashboard app-launcher grid */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 420px) {
  .menu-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.menu-tile {
  all: unset;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.08),
    0 1px 3px rgba(0, 0, 0, 0.08);
  padding: 20px 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition:
    transform 0.08s ease,
    box-shadow 0.15s ease;
}

.menu-tile:active {
  transform: scale(0.96);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06);
}

.menu-tile .material-icons {
  font-size: 28px;
  color: var(--primary);
  background: #eaf0fb;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Floating Action Button (Material) */
.fab {
  all: unset;
  box-sizing: border-box;
  position: fixed;
  right: 20px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  z-index: 15;
  transition:
    transform 0.1s ease,
    box-shadow 0.15s ease;
}

.fab .material-icons {
  font-size: 26px;
}

.fab:active {
  transform: scale(0.94);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
}

.page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

/* Responsive table: normal table on desktop, stacked cards on mobile */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.table-wrap {
  background: transparent;
}

@media (min-width: 700px) {
  .data-table {
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  }
  .data-table th,
  .data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    font-size: 14px;
  }
  .data-table th {
    font-weight: 500;
    color: var(--steel);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
}

@media (max-width: 699px) {
  .data-table thead {
    display: none;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table tr {
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    margin-bottom: 10px;
    overflow: hidden;
  }

  .data-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    font-size: 13.5px;
    text-align: right;
  }

  .data-table td:last-child {
    border-bottom: none;
  }

  .data-table td::before {
    content: attr(data-label);
    font-weight: 500;
    color: var(--steel);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-align: left;
  }

  .data-table td.cell-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }

  .data-table td.cell-actions::before {
    display: none;
  }

  .data-table td.cell-actions button {
    font-size: 12.5px;
    padding: 8px 12px;
  }
}

.data-table .btn-delete,
.data-table .btn-set-status {
  background: var(--steel);
}

.data-table .btn-delete {
  background: #b23a34;
}

/* Maintenance module - armada cards with color-coded document chips */
.maint-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 90px;
}

.maint-item-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}

.maint-plat {
  font-weight: 700;
  font-size: 15px;
}

.maint-servis {
  font-size: 12px;
  color: var(--steel);
}

.maint-docs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.doc-chip {
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.doc-ok {
  background: #e5f1e9;
  color: #3f6b4f;
}

.doc-warning {
  background: #fcefdc;
  color: #9a6a17;
}

.doc-expired {
  background: #f7e1df;
  color: #a6382e;
}

.doc-none {
  background: var(--bg);
  color: var(--steel);
  font-style: italic;
}

/* Report module */
.report-section-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--steel);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 24px 0 10px;
}

/* Register - paket selection cards */
.paket-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 6px 0 16px;
}

.paket-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  position: relative;
}

.paket-card input[type="radio"] {
  position: absolute;
  top: 12px;
  right: 14px;
  width: auto;
  margin: 0;
}

.paket-selected {
  border-color: var(--primary);
  background: #eaf0fb;
}

.paket-label {
  font-weight: 700;
  font-size: 15px;
}

.paket-batas {
  font-size: 12.5px;
  color: var(--steel);
}

.paket-harga {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--primary);
  margin-top: 2px;
}

/* WhatsApp confirmation button */
.m-button-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #25d366;
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  font-size: 14.5px;
  padding: 14px 20px;
  border-radius: 10px;
}

/* Topbar left group (back button + title) */
.topbar-left {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Highlight the button matching current status */
.btn-current-status {
  background: var(--primary-dark) !important;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5);
}
