/* Find Lost · PHP Admin — light find-console look */
:root {
  --bg: #eef2f6;
  --bg-soft: #f7f9fc;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #ffffff;
  --ink: #0f1724;
  --muted: #5b6b7c;
  --line: rgba(15, 23, 36, 0.08);
  --accent: #0a84ff;
  --accent-deep: #0060df;
  --danger: #e5484d;
  --warn: #e5a000;
  --ok: #1f8a4c;
  --lost: #d94a4a;
  --shadow: 0 18px 50px rgba(15, 35, 60, 0.08);
  --radius: 20px;
  --font-display: "Instrument Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "DM Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  --rail: 248px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--font-body);
  background: var(--bg);
}

body.theme-find { overflow-x: hidden; }

a { color: inherit; }

.hidden { display: none !important; }

/* —— Login hero —— */
.login-hero {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(1200px 700px at 18% 12%, rgba(10, 132, 255, 0.18), transparent 55%),
    radial-gradient(900px 600px at 88% 80%, rgba(15, 23, 36, 0.08), transparent 50%),
    linear-gradient(165deg, #dbe7f5 0%, #eef2f6 42%, #f8fafc 100%);
  animation: heroIn 0.9s ease both;
}

.login-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(15, 23, 36, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 36, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 40% 30%, #000 20%, transparent 70%);
  animation: gridDrift 18s linear infinite;
}

.login-stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
}

.login-panel {
  width: min(440px, 100%);
  padding: 40px 36px 32px;
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: rise 0.65s cubic-bezier(.2,.8,.2,1) both;
}

.login-logo {
  width: 96px;
  height: 96px;
  border-radius: 26px;
  object-fit: cover;
  margin: 0 auto 4px;
  box-shadow: 0 16px 40px rgba(10, 132, 255, 0.22);
  animation: logoPop 0.7s cubic-bezier(.2,.8,.2,1) both;
}

.brand-mark {
  margin: 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.05;
  color: var(--ink);
}

.login-kicker,
.login-title {
  margin: 0 0 8px;
  text-align: center;
}

.login-kicker {
  color: var(--muted);
  font-size: 15px;
}

.login-title {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 650;
}

.lead {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  text-align: center;
}

.lead code, .banner code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: rgba(10, 132, 255, 0.08);
  padding: 1px 6px;
  border-radius: 6px;
}

label {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--ink);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}

input:focus {
  border-color: rgba(10, 132, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.12);
  background: #fff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 14px;
  padding: 11px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s ease, background .2s, box-shadow .2s, opacity .2s;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn.primary {
  background: linear-gradient(180deg, #2b95ff, var(--accent-deep));
  color: #fff;
  box-shadow: 0 10px 24px rgba(10, 132, 255, 0.28);
}

.btn.soft {
  background: #e8eef6;
  color: var(--ink);
}

.btn.warn { background: #fff4d6; color: #8a6200; }
.btn.danger { background: #ffe5e5; color: #b42318; }
.btn.block { width: 100%; margin-top: 10px; padding: 13px 16px; }

.hint-line {
  margin: 8px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.banner {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
}

.banner.error { background: #ffe8e8; color: #9b1c1c; }
.banner.ok { background: #e5f7ec; color: #146c2e; }

/* —— App shell —— */
.shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--rail) 1fr;
}

.shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 520px at 0% 0%, rgba(10, 132, 255, 0.10), transparent 55%),
    radial-gradient(700px 480px at 100% 0%, rgba(15, 23, 36, 0.05), transparent 50%),
    linear-gradient(180deg, #e9eef5 0%, #f4f7fb 100%);
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: slideRail 0.55s ease both;
}

.rail-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 4px;
}

.mark-img {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  object-fit: cover;
  box-shadow: 0 10px 22px rgba(10, 132, 255, 0.2);
}

.rail-brand strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.rail-brand small {
  color: var(--muted);
  font-size: 12px;
}

.rail nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

a.nav-item {
  text-decoration: none;
  color: var(--muted);
  display: block;
  padding: 11px 14px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  transition: background .18s, color .18s, transform .15s;
}

a.nav-item:hover {
  background: rgba(10, 132, 255, 0.08);
  color: var(--ink);
}

a.nav-item.active {
  background: linear-gradient(180deg, rgba(10, 132, 255, 0.16), rgba(10, 132, 255, 0.08));
  color: var(--accent-deep);
  box-shadow: inset 0 0 0 1px rgba(10, 132, 255, 0.12);
}

a.nav-item.ghost {
  margin-top: auto;
  color: var(--muted);
  background: transparent;
}

.workspace {
  padding: 28px 32px 48px;
  animation: rise 0.5s ease both;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.topbar h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.75rem;
  letter-spacing: -0.02em;
}

.muted { color: var(--muted); margin: 6px 0 0; font-size: 14px; }

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

.panel {
  animation: rise 0.45s ease both;
}

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

.stat-card {
  border-radius: var(--radius);
  padding: 20px 18px;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(15, 35, 60, 0.04);
  transition: transform .2s ease, box-shadow .2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(15, 35, 60, 0.08);
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

.stat-card strong {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.db-pill {
  display: inline-flex;
  margin-top: 16px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #e8f1ff;
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 600;
}

.flash-bar {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
}

.flash-bar.ok { background: #e5f7ec; color: #146c2e; }
.flash-bar.error { background: #ffe8e8; color: #9b1c1c; }

.table-wrap {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(15, 35, 60, 0.04);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  padding: 13px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  background: #f3f6fa;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: none;
}

tr:last-child td { border-bottom: 0; }
tr:hover td { background: #fafcff; }

.device-id {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge.on { background: #e5f7ec; color: var(--ok); }
.badge.off { background: #eef1f5; color: #6b7785; }
.badge.lost { background: #ffe5e5; color: var(--lost); }

.actions, .inline-forms {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inline-forms form { display: inline; margin: 0; }

a.linkish {
  background: none;
  border: 0;
  color: var(--accent-deep);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0;
  text-decoration: none;
}

a.linkish:hover { text-decoration: underline; }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 28px 12px !important;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 14px;
}

.detail-card {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 10px 30px rgba(15, 35, 60, 0.04);
}

.detail-card h3 {
  margin: 0 0 14px;
  font-family: var(--font-display);
}

.kv {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 8px 12px;
  margin-bottom: 16px;
  font-size: 14px;
}

.kv span { color: var(--muted); }
.kv b { font-weight: 650; word-break: break-all; }

.mini-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mini-list li {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-soft);
  font-size: 13px;
  color: var(--muted);
}

.mini-list strong {
  display: block;
  color: var(--ink);
  margin-bottom: 2px;
}

.config-form {
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}

.config-form .btn { align-self: flex-start; margin-top: 8px; }

@keyframes heroIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes gridDrift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-24px, -24px, 0); }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes logoPop {
  from { opacity: 0; transform: scale(0.88); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideRail {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .rail {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .rail nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  a.nav-item.ghost { margin-top: 0; margin-left: auto; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .workspace { padding: 20px 16px 40px; }
  .table-wrap { overflow-x: auto; }
  table { min-width: 760px; }
  .topbar { flex-direction: column; }
}
