:root {
  --ink: #1a2b3c;
  --muted: #355066;
  --line: #9eb6c7;
  --accent: #0b6e4f;
  --accent-hover: #095c42;
  --head: #d7ebf6;
  --panel: #ffffff;
  --page-bg: #7ec8e3;
  --soft: #f3f8fb;
}

* { box-sizing: border-box; }

body.app-ui {
  margin: 0;
  min-height: 100vh;
  background: var(--page-bg);
  color: var(--ink);
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: 13px;
}

.app-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 16px 12px 28px;
}

.app-page.wide {
  max-width: 1100px;
}

.app-title {
  margin: 0 0 12px;
  color: #fff;
  text-align: center;
  font-size: 1.4rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.app-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
}

.app-toolbar input[type="text"],
.app-toolbar input[type="password"],
.app-toolbar input[type="email"],
.app-toolbar input[type="number"] {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 13px;
  min-width: min(220px, 70vw);
  background: #fff;
}

.app-btn {
  border: 0;
  background: var(--accent);
  color: #fff;
  padding: 7px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
  text-decoration: none;
  display: inline-block;
}

.app-btn:hover {
  background: var(--accent-hover);
  color: #fff;
}

.app-btn.secondary {
  background: #0b5a8a;
}

.app-btn.secondary:hover {
  background: #08486e;
}

.app-link {
  color: #033;
  font-weight: 600;
  text-decoration: none;
  font-size: 12px;
}

.app-flash {
  text-align: center;
  padding: 7px 10px;
  border-radius: 4px;
  margin: 0 auto 12px;
  max-width: 520px;
  font-weight: 600;
  font-size: 12px;
}

.app-flash.ok { background: #d1e7dd; color: #0f5132; }
.app-flash.err { background: #f8d7da; color: #842029; }
.app-flash.info { background: #fff3cd; color: #664d03; }

.app-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.app-panel-head {
  background: var(--head);
  padding: 10px 14px;
  font-weight: 700;
  font-size: 14px;
  border-bottom: 1px solid var(--line);
}

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 16px;
  padding: 14px;
  align-items: start;
}

@media (max-width: 640px) {
  .detail-layout {
    grid-template-columns: 1fr;
  }
  .detail-photo {
    justify-self: center;
  }
}

.detail-rows {
  display: grid;
  gap: 8px;
}

.detail-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px;
  align-items: start;
  padding: 8px 0;
  border-bottom: 1px solid #e4eef4;
}

.detail-row:last-child {
  border-bottom: 0;
}

.detail-row .label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.detail-row .value {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
}

.detail-photo {
  width: 160px;
  max-width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f0f4f7;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.login-card {
  max-width: 360px;
  margin: 40px auto 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.login-card label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 4px;
}

.login-card input {
  width: 100%;
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 13px;
}

.login-card .app-btn {
  width: 100%;
  margin-top: 4px;
}

.dash-menu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  max-width: 640px;
  margin: 0 auto;
}

.dash-menu a {
  display: block;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px 12px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.dash-menu a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

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

.form-table td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  vertical-align: top;
  width: 50%;
}

.form-table label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 3px;
}

.form-table input,
.form-table select {
  width: 100%;
  border: 1px solid #c9d7e2;
  padding: 6px 8px;
  font-size: 12px;
  background: #fafcfd;
  border-radius: 3px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px;
  background: var(--soft);
  border-top: 1px solid var(--line);
}

.form-actions .app-link {
  margin-right: auto;
  align-self: center;
}

.app-foot {
  text-align: center;
  margin-top: 14px;
}

.table-scroll {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  table-layout: fixed;
}

table.data-table th,
table.data-table td {
  border: 1px solid var(--line);
  padding: 6px 7px;
  vertical-align: middle;
  text-align: center;
  background: #fff;
  color: var(--ink);
}

table.data-table th {
  background: var(--head);
  font-size: 12px;
}

table.data-table th a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}

table.data-table th.sorted {
  background: #c5e2f3;
}

table.data-table .pic {
  width: 36px;
  height: 36px;
  object-fit: cover;
  display: block;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.btn-accept {
  background: #198754;
  color: #fff;
  border: 0;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.btn-reject {
  background: #dc3545;
  color: #fff;
  border: 0;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  margin-left: 4px;
}
