* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #eef3f8;
  color: #1f2933;
}

.app-shell {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px;
}

.topbar {
  background: linear-gradient(135deg, #0f4c81, #1b75bc);
  color: white;
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar h1 {
  margin: 0;
  font-size: 30px;
}

.topbar p {
  margin: 4px 0 0;
  opacity: 0.9;
}

.version-text {
  font-size: 13px;
  opacity: 0.9;
}

.card {
  background: white;
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: bold;
}

input {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  font-size: 16px;
  margin-bottom: 12px;
}

button {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 14px;
  background: #0f4c81;
  color: white;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
}

button.secondary {
  background: #64748b;
  margin-top: 16px;
}

.msg {
  margin-top: 12px;
  font-weight: bold;
}

.msg.error {
  color: #b91c1c;
}

.msg.ok {
  color: #15803d;
}

.user-box {
  background: #f1f5f9;
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 16px;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.menu-btn {
  background: #e0f2fe;
  color: #0f172a;
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  font-weight: bold;
  border: 1px solid #bae6fd;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #0f172a;
  color: #d1fae5;
  padding: 12px;
  border-radius: 12px;
  font-size: 13px;
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.form-box {
  background: #f8fafc;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 16px;
}

select {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  font-size: 16px;
  margin-bottom: 12px;
  background: white;
}

.location-list {
  display: grid;
  gap: 12px;
}

.location-item {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
  background: #ffffff;
}

.location-title {
  font-weight: bold;
  font-size: 16px;
}

.location-meta {
  margin-top: 6px;
  font-size: 13px;
  color: #475569;
}

.location-actions {
  margin-top: 10px;
}

.location-actions button {
  padding: 10px;
}

.gps-btn {
  background: #15803d;
  margin-bottom: 8px;
}

.gps-msg {
  font-size: 13px;
  color: #475569;
  margin-bottom: 12px;
}

textarea {
  width: 100%;
  min-height: 90px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  font-size: 16px;
  margin-bottom: 12px;
  font-family: Arial, sans-serif;
  resize: vertical;
}

.filter-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 16px;
}

.work-order-list {
  display: grid;
  gap: 12px;
}

.work-order-item {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
  background: #ffffff;
}

.work-order-title {
  font-weight: bold;
  font-size: 16px;
}

.work-order-meta {
  margin-top: 6px;
  font-size: 13px;
  color: #475569;
}

.work-order-desc {
  margin-top: 10px;
  padding: 10px;
  background: #f8fafc;
  border-radius: 10px;
  font-size: 14px;
}

.work-order-actions {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.work-order-actions select {
  margin-bottom: 0;
}

.work-order-actions button {
  padding: 10px 14px;
}

.asset-list {
  display: grid;
  gap: 12px;
}

.asset-item {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
  background: #ffffff;
}

.asset-title {
  font-weight: bold;
  font-size: 16px;
}

.asset-meta {
  margin-top: 6px;
  font-size: 13px;
  color: #475569;
}

.asset-notes {
  margin-top: 10px;
  padding: 10px;
  background: #f8fafc;
  border-radius: 10px;
  font-size: 14px;
}

.asset-actions {
  margin-top: 10px;
}

.asset-actions button {
  padding: 10px;
}

.dashboard-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.dash-box {
  background: #f8fafc;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  padding: 14px;
  text-align: center;
}

.dash-label {
  font-size: 12px;
  color: #475569;
  font-weight: bold;
}

.dash-value {
  margin-top: 8px;
  font-size: 28px;
  font-weight: bold;
  color: #0f4c81;
}


.upload-btn {
  background: #7c3aed;
  margin-bottom: 8px;
}

.work-order-detail {
  margin-top: 12px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #dbeafe;
  border-radius: 12px;
}

.work-order-note-box {
  margin-top: 10px;
}

.work-order-log-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.work-order-log-item {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px;
  font-size: 13px;
}

.work-order-log-title {
  font-weight: bold;
  color: #0f4c81;
}

.work-order-log-meta {
  color: #64748b;
  margin-top: 4px;
}

.work-order-log-remarks {
  margin-top: 6px;
  white-space: pre-wrap;
}

.pm-list {
  display: grid;
  gap: 12px;
}

.pm-item {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
  background: #ffffff;
}

.pm-title {
  font-weight: bold;
  font-size: 16px;
}

.pm-meta {
  margin-top: 6px;
  font-size: 13px;
  color: #475569;
}

.pm-desc {
  margin-top: 10px;
  padding: 10px;
  background: #f8fafc;
  border-radius: 10px;
  font-size: 14px;
  white-space: pre-wrap;
}

.pm-actions {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.pm-actions button {
  padding: 10px;
}

.admin-status-box {
  background: #f8fafc;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  padding: 14px;
  margin-top: 12px;
}

.admin-section {
  margin-bottom: 18px;
}

.admin-section h3 {
  margin: 0 0 8px;
  color: #0f4c81;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: white;
}

.admin-table th,
.admin-table td {
  border: 1px solid #e2e8f0;
  padding: 8px;
  text-align: left;
}

.admin-table th {
  background: #e0f2fe;
}

.status-ok {
  color: #15803d;
  font-weight: bold;
}

.status-bad {
  color: #b91c1c;
  font-weight: bold;
}

.user-list {
  display: grid;
  gap: 12px;
}

.user-item {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
  background: #ffffff;
}

.user-title {
  font-weight: bold;
  font-size: 16px;
}

.user-meta {
  margin-top: 6px;
  font-size: 13px;
  color: #475569;
}

.user-actions {
  margin-top: 10px;
}

.user-actions button {
  padding: 10px;
}

.role-permission-list {
  display: grid;
  gap: 12px;
}

.role-permission-item {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
  background: #ffffff;
}

.role-permission-title {
  font-weight: bold;
  font-size: 16px;
}

.role-permission-meta {
  margin-top: 8px;
  font-size: 13px;
  color: #475569;
  line-height: 1.6;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.permission-pill {
  padding: 8px;
  border-radius: 10px;
  text-align: center;
  font-size: 12px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.permission-yes {
  color: #15803d;
  font-weight: bold;
}

.permission-no {
  color: #b91c1c;
  font-weight: bold;
}

.role-permission-actions {
  margin-top: 10px;
}

.role-permission-actions button {
  padding: 10px;
}

.audit-log-list {
  display: grid;
  gap: 12px;
}

.audit-log-item {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
  background: #ffffff;
}

.audit-log-title {
  font-weight: bold;
  font-size: 15px;
  color: #0f4c81;
}

.audit-log-meta {
  margin-top: 6px;
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
}

.audit-log-values {
  margin-top: 10px;
  padding: 10px;
  background: #f8fafc;
  border-radius: 10px;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 180px;
  overflow: auto;
}

.closeout-box {
  margin-top: 12px;
  padding: 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 12px;
}

.closeout-box h4 {
  margin: 0 0 10px;
  color: #9a3412;
}

.closeout-actions {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.closeout-completed {
  margin-top: 12px;
  padding: 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  font-size: 13px;
}

.approval-box {
  margin-top: 12px;
  padding: 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
}

.approval-box h4 {
  margin: 0 0 10px;
  color: #1d4ed8;
}

.approval-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.approval-approved {
  margin-top: 12px;
  padding: 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  font-size: 13px;
}

.approval-rejected {
  margin-top: 12px;
  padding: 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
  font-size: 13px;
}

.approval-pending {
  margin-top: 12px;
  padding: 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
  font-size: 13px;
}

.report-summary {
  margin: 12px 0;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  font-weight: bold;
}

.report-list {
  display: grid;
  gap: 12px;
}

.report-item {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
  background: #ffffff;
}

.report-title {
  font-weight: bold;
  font-size: 15px;
  color: #0f4c81;
}

.report-meta {
  margin-top: 6px;
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
}

.report-desc {
  margin-top: 10px;
  padding: 10px;
  background: #f8fafc;
  border-radius: 10px;
  font-size: 12px;
  white-space: pre-wrap;
}

.due-toolbar {
  margin-top: 8px;
}

.due-summary {
  margin: 12px 0;
  padding: 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  font-weight: bold;
  color: #9a3412;
}

.due-list {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.due-item {
  border: 1px solid #fed7aa;
  border-radius: 14px;
  padding: 14px;
  background: #fffbeb;
}

.due-title {
  font-weight: bold;
  color: #9a3412;
}

.due-meta {
  margin-top: 6px;
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
}

.due-desc {
  margin-top: 10px;
  padding: 10px;
  background: #ffffff;
  border-radius: 10px;
  font-size: 13px;
  white-space: pre-wrap;
}

.kpi-summary {
  margin: 12px 0;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #dbeafe;
  border-radius: 12px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.kpi-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
  text-align: center;
}

.kpi-label {
  font-size: 12px;
  color: #64748b;
}

.kpi-value {
  margin-top: 6px;
  font-size: 22px;
  font-weight: bold;
  color: #0f4c81;
}

.kpi-details {
  display: grid;
  gap: 12px;
}

.kpi-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
}

.kpi-section h4 {
  margin: 0 0 10px;
  color: #0f4c81;
}

.kpi-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #f1f5f9;
  padding: 6px 0;
  font-size: 13px;
}

.kpi-row:last-child {
  border-bottom: none;
}

.kpi-row-name {
  color: #334155;
}

.kpi-row-count {
  font-weight: bold;
  color: #0f172a;
}

.setting-list {
  display: grid;
  gap: 12px;
}

.setting-item {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
  background: #ffffff;
}

.setting-title {
  font-weight: bold;
  font-size: 15px;
  color: #0f4c81;
}

.setting-meta {
  margin-top: 6px;
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
}

.setting-actions {
  margin-top: 10px;
}

.setting-actions button {
  padding: 10px;
}

.alert-center {
  margin: 16px 0;
  padding: 14px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 16px;
}

.alert-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.alert-header h3 {
  margin: 0;
  color: #9a3412;
}

.alert-summary {
  margin-top: 12px;
  padding: 12px;
  background: #ffffff;
  border-radius: 12px;
  font-weight: bold;
  color: #9a3412;
}

.alert-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.alert-section {
  background: #ffffff;
  border: 1px solid #fed7aa;
  border-radius: 14px;
  padding: 12px;
}

.alert-section h4 {
  margin: 0 0 8px;
  color: #9a3412;
}

.alert-item {
  border-top: 1px solid #ffedd5;
  padding: 8px 0;
  font-size: 13px;
  color: #475569;
}

.alert-item:first-of-type {
  border-top: none;
}

.alert-item-title {
  font-weight: bold;
  color: #0f172a;
}

.alert-empty {
  color: #64748b;
  font-size: 13px;
}

.admin-collapse {
  margin: 14px 0;
  border: 1px solid #dbeafe;
  border-radius: 16px;
  background: #ffffff;
  overflow: hidden;
}

.admin-collapse summary {
  cursor: pointer;
  padding: 14px;
  font-weight: bold;
  color: #0f4c81;
  background: #e0f2fe;
  list-style: none;
}

.admin-collapse summary::-webkit-details-marker {
  display: none;
}

.admin-collapse summary::after {
  content: "▼";
  float: right;
  font-size: 13px;
}

.admin-collapse[open] summary::after {
  content: "▲";
}

.admin-collapse-body {
  padding: 14px;
}

.admin-collapse-body > h3 {
  display: none;
}

.quick-actions {
  margin: 16px 0;
  padding: 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 16px;
}

.quick-actions h3 {
  margin: 0 0 12px;
  color: #0f4c81;
}

.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.quick-action-grid button {
  min-height: 44px;
}

.clickable-dash {
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.clickable-dash:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 76, 129, 0.18);
}

.clickable-dash:active {
  transform: translateY(0);
}

.alert-action-btn {
  margin-top: 8px;
  padding: 10px;
  font-size: 13px;
}

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

.busy-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.busy-box {
  background: #ffffff;
  border-radius: 18px;
  padding: 22px 26px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.28);
  min-width: 220px;
  max-width: 320px;
  text-align: center;
  font-weight: 700;
  color: #0f172a;
}

.busy-spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 12px auto;
  border: 4px solid #dbeafe;
  border-top-color: #0f4c81;
  border-radius: 50%;
  animation: busySpin 0.8s linear infinite;
}

@keyframes busySpin {
  to {
    transform: rotate(360deg);
  }
}

.hidden {
  display: none !important;
}

.toast-box {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 10000;
  min-width: 220px;
  max-width: 90%;
  padding: 14px 18px;
  border-radius: 14px;
  background: #0f172a;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.28);
}

.toast-box.ok {
  background: #15803d;
}

.toast-box.error {
  background: #b91c1c;
}

.toast-box.info {
  background: #0f4c81;
}

.toast-box.hidden {
  display: none;
}

.password-row {
  display: grid;
  grid-template-columns: 1fr 90px;
  gap: 8px;
  align-items: start;
}

.password-row input {
  margin-bottom: 12px;
}

.password-toggle-btn {
  margin-top: 0 !important;
  padding: 14px 10px;
  font-size: 14px;
}

.busy-overlay.hidden {
  display: none;
}

.toast-box.hidden {
  display: none;
}

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

.maintenance-box {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 16px;
  padding: 16px;
  color: #9a3412;
  font-weight: 700;
  line-height: 1.5;
}

.admin-section table td:first-child {
  font-weight: 700;
  color: #334155;
}

.admin-health-banner {
  border-radius: 14px;
  padding: 14px 16px;
  margin: 12px 0 16px;
  font-size: 14px;
  line-height: 1.45;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.admin-health-banner ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.admin-health-ok {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.admin-health-warning {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.setting-help {
  margin-top: -6px;
  margin-bottom: 10px;
  font-size: 12px;
  color: #475569;
  line-height: 1.35;
}

.setting-help.warning {
  color: #92400e;
  font-weight: 700;
}

#settingGroupInput:disabled,
#settingKeyInput:disabled {
  background: #e5e7eb;
  color: #64748b;
  cursor: not-allowed;
}

.import-box {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #dbeafe;
  background: #eff6ff;
  border-radius: 14px;
}

.import-box h4 {
  margin: 0 0 10px;
}

.import-summary {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #1e3a8a;
}

.import-preview {
  margin-top: 10px;
  overflow-x: auto;
}

.import-preview table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.import-preview th,
.import-preview td {
  border: 1px solid #cbd5e1;
  padding: 6px;
  text-align: left;
  vertical-align: top;
}

.import-preview th {
  background: #dbeafe;
}

.import-error {
  color: #991b1b;
  font-weight: 700;
}

.import-ok {
  color: #166534;
  font-weight: 700;
}