:root {
  /* Force native form controls (select dropdown list) to use dark UI */
  color-scheme: dark;
  --bg: #0b1020;
  --card: rgba(255,255,255,0.08);
  --card2: rgba(255,255,255,0.06);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.65);
  --line: rgba(255,255,255,0.12);
  --primary: #3b82f6;
  --danger: #ef4444;
}

/* Embed Noto Sans Lao (local) so Windows clients always see Lao font correctly */
@font-face {
  font-family: "Noto Sans Lao";
  src: url("/static/fonts/NotoSansLao-Medium.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
  font-family: "Noto Sans Lao", sans-serif !important;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(10,14,30,0.98), rgba(7,10,22,0.98)),
    radial-gradient(1000px 600px at 10% 10%, rgba(59,130,246,0.18), transparent 60%),
    radial-gradient(1000px 600px at 90% 30%, rgba(14,165,233,0.12), transparent 60%),
    var(--bg);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 14, 30, 0.82);
  backdrop-filter: blur(10px);
}

.brand { display:flex; align-items:center; gap:10px; }
.logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
}
.brand-text .site-name { font-weight: 700; }
.brand-text .sub { font-size: 12px; color: var(--muted); }

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 10px;
  justify-content: center;
}

.nav a {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 14px;
  border: 1px solid transparent;
  color: var(--muted);
}

.nav a.active {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255,255,255,0.06);
}

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

.container {
  max-width: 1250px;
  margin: 18px auto;
  padding: 0 14px 30px;
}

.page-title {
  display:flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.page-title h1 { margin: 0; font-size: 22px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 10px 35px rgba(0,0,0,0.35);
}

h2 { font-size: 18px; }

.muted { color: var(--muted); }

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

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

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 980px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
  .nav { justify-content: flex-start; }
}

.field { display:flex; flex-direction: column; gap:6px; }
label { font-size: 13px; color: var(--muted); }

input, select, textarea {
  width: 100%;
  padding: 10px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  outline: none;
}

/* Dropdown list background (Chrome/Windows will respect this better with color-scheme: dark) */
select {
  color-scheme: dark;
}

select option {
  background: rgba(10, 14, 30, 0.98);
  color: var(--text);
}

input::placeholder { color: rgba(255,255,255,0.35); }

input:disabled, select:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.08);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
}

.btn:hover { background: rgba(255,255,255,0.12); }

.btn-primary {
  border-color: rgba(59,130,246,0.5);
  background: rgba(59,130,246,0.25);
}

.btn-ghost {
  background: transparent;
}

.btn-small {
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 13px;
}

.alert {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(239,68,68,0.4);
  background: rgba(239,68,68,0.18);
  margin-bottom: 12px;
}

.table-wrap { overflow-x: auto; }

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

.table th, .table td {
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  vertical-align: middle;
}

.table th { color: var(--muted); font-weight: 600; text-align: left; }

.right { text-align: right; }

.table-wide input {
  min-width: 120px;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
}

.avatar.placeholder {
  display:flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.photo-preview {
  max-width: 180px;
  max-height: 120px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
}

.sep {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.12);
  margin: 16px 0;
}

.badge {
  display:inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
}

.badge-red {
  border-color: rgba(239,68,68,0.4);
  background: rgba(239,68,68,0.14);
}

.center {
  min-height: calc(100vh - 90px);
  display:flex;
  align-items: center;
  justify-content: center;
}

.people {
  display:flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.person {
  display:flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);
  min-width: 240px;
}

.doc-list { margin-top: 10px; display:flex; flex-direction: column; gap: 8px; }
.doc-item { display:flex; justify-content: space-between; gap: 10px; }

.footer-row {
  margin-top: 12px;
  display:flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
