@font-face {
  font-family: "Khmer OS Siemreap";
  src: local("Khmer OS Siemreap"), url("../fonts/khmer-os-siemreap.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Khmer Mool1";
  src: local("Khmer Mool1"), url("../fonts/khmer-mool1-regular.ttf") format("truetype");
  font-display: swap;
}

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

body {
  font-family: "Khmer OS Siemreap", "Khmer UI", system-ui, sans-serif;
  background: #f6f8fa;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Sidebar shell: a fixed column on large screens; Bootstrap's offcanvas-lg turns it into a slide-in menu below. */
.app-shell {
  min-height: 100vh;
}

@media (min-width: 992px) {
  .app-shell {
    display: grid;
    grid-template-columns: 15.5rem minmax(0, 1fr);
  }

  .app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid #dde3ea;
  }
}

.app-sidebar {
  background: #fff;
}

.app-sidebar .offcanvas-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 0 .75rem 1rem;
  overflow-y: auto;
}

.app-sidebar .offcanvas-header {
  padding: 1.25rem 1.25rem 1rem;
}

.app-brand {
  color: #182c40;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: .02em;
  text-decoration: none;
}

.app-nav {
  gap: .15rem;
}

.app-nav .nav-link {
  color: #2d3e50;
  border-radius: .375rem;
  padding: .55rem .75rem;
}

.app-nav .nav-link:hover {
  background: #eef3f8;
  color: #145494;
}

.app-nav .nav-link.active {
  background: #e3eefa;
  color: #145494;
  font-weight: 600;
}

.app-nav .nav-heading {
  margin: 1rem .75rem .25rem;
  color: #66788a;
  font-size: .78rem;
}

.app-user {
  margin-top: auto;
  padding: .75rem;
  border-top: 1px solid #dde3ea;
}

.app-topbar {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem 1rem;
  background: #fff;
  border-bottom: 1px solid #dde3ea;
}

.app-main {
  min-width: 0;
  padding: 1.5rem clamp(1rem, 3vw, 2.5rem) 3rem;
}

.page-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-heading h1 {
  font-family: "Khmer Mool1", "Khmer OS Muol Light", "Khmer UI", sans-serif;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  line-height: 1.9;
  margin: 0;
}

.page-heading p {
  color: #526476;
  margin: 0;
}

.officer-search {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  max-width: 40rem;
  margin-bottom: 1.25rem;
}

.officer-search .form-control {
  flex: 1 1 16rem;
}

.officer-table {
  background: #fff;
}

.officer-table th {
  font-size: .85rem;
  color: #526476;
  font-weight: 600;
  white-space: nowrap;
}

.empty-state {
  padding: 2rem;
  text-align: center;
  color: #526476;
  background: #fff;
  border: 1px dashed #c8d2dc;
  border-radius: .5rem;
}

.user-form {
  max-width: 52rem;
}

.user-form fieldset {
  background: #fff;
  border: 1px solid #dde3ea;
  border-radius: .5rem;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.user-form legend {
  float: none;
  width: auto;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .75rem;
}

.lookup-add {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: .75rem;
  max-width: 40rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #fff;
  border: 1px solid #dde3ea;
  border-radius: .5rem;
}

.lookup-add .lookup-name {
  flex: 1 1 14rem;
}

.lookup-add .lookup-order, .lookup-table .lookup-order {
  width: 6.5rem;
}

.lookup-table {
  max-width: 48rem;
}

.lookup-table td:nth-child(2) {
  min-width: 12rem;
}
