:root {
  --gold: #D9B96A;
  --gold-bright: #F0D89A;
  --gold-deep: #B8934A;
  --cream: #FFF7DE;
  --ink: #241A06;
  --red: #E4342F;
  --pet: #6FD8C8;
  --pet-bright: #A6ECE0;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0; min-height: 100%;
  background:
    radial-gradient(60% 45% at 12% 0%, rgba(111, 216, 200, .08), transparent 60%),
    radial-gradient(120% 90% at 50% -10%, rgba(217, 185, 106, .1), transparent 55%),
    linear-gradient(180deg, #04150C, #071C11);
  background-attachment: fixed;
  color: var(--cream);
  font-family: 'Space Grotesk', sans-serif;
}

h1, h2 { font-family: 'Outfit', sans-serif; margin: 0; }

.admin-wrap { min-height: 100vh; padding: clamp(20px, 4vw, 56px); }

.field-label {
  display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold); font-weight: 600; margin: 16px 0 8px;
}
.field-label:first-child { margin-top: 0; }

input[type="text"], input[type="password"], input[type="number"], input[type="email"], textarea {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  border: 1px solid rgba(217, 185, 106, .3); background: rgba(4, 21, 12, .6);
  color: var(--cream); font-family: 'Space Grotesk', sans-serif; font-size: 14px;
  outline: none; transition: border-color .3s;
}
input::placeholder, textarea::placeholder { color: rgba(255, 247, 222, .35); }
input:focus, textarea:focus { border-color: var(--gold); }
textarea { resize: vertical; }

input[type="color"].colour-input {
  width: 100%; height: 42px; padding: 4px; border-radius: 10px;
  border: 1px solid rgba(217, 185, 106, .3); background: rgba(4, 21, 12, .6); cursor: pointer;
}

input[type="file"] {
  width: 100%; color: rgba(255, 247, 222, .7); font-size: 13px;
}

.btn-gold {
  margin-top: 18px; padding: 13px 22px; border-radius: 12px; border: none; cursor: pointer;
  font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 14.5px; color: var(--ink);
  background: linear-gradient(150deg, var(--gold-bright), var(--gold) 60%, var(--gold-deep));
  box-shadow: 0 10px 26px -10px rgba(217, 185, 106, .55);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 16px 32px -10px rgba(217, 185, 106, .75); }
.btn-gold:disabled { opacity: .55; cursor: default; transform: none; }

.btn-outline {
  padding: 10px 18px; border-radius: 10px; cursor: pointer;
  font-family: 'Outfit', sans-serif; font-weight: 600; font-size: 13.5px; color: var(--cream);
  background: transparent; border: 1px solid rgba(255, 247, 222, .3);
  transition: border-color .3s, color .3s;
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

.btn-small {
  padding: 7px 14px; border-radius: 8px; cursor: pointer; font-size: 12.5px; font-weight: 600;
  font-family: 'Outfit', sans-serif; border: 1px solid rgba(217, 185, 106, .45); color: var(--gold);
  background: rgba(217, 185, 106, .08); transition: background .25s, color .25s;
}
.btn-small:hover { background: rgba(217, 185, 106, .18); }
.btn-small.danger { border-color: rgba(228, 52, 47, .5); color: #FF8783; background: rgba(228, 52, 47, .08); }
.btn-small.danger:hover { background: rgba(228, 52, 47, .18); }
.btn-small:disabled { opacity: .5; cursor: default; }

.field-error {
  color: #FF8783; font-size: 12.5px; margin: 10px 0 0;
}

.hint { margin: 18px 0 0; font-size: 12px; color: rgba(255, 247, 222, .45); }
.hint code { background: rgba(255, 255, 255, .06); padding: 2px 6px; border-radius: 5px; font-size: 11.5px; }

/* ------------------------------------------------------------ LOGIN */
.login-screen { min-height: 80vh; display: grid; place-items: center; position: relative; }
.login-card {
  width: min(460px, 100%);
  border-radius: 22px; border: 1px solid rgba(217, 185, 106, .28);
  background: linear-gradient(165deg, rgba(217, 185, 106, .09), rgba(217, 185, 106, .02));
  padding: clamp(28px, 4vw, 44px);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .6), 0 0 0 1px rgba(217, 185, 106, .05) inset;
  position: relative; overflow: hidden;
  animation: loginIn .6s var(--ease);
}
.login-card::before {
  content: ''; position: absolute; inset: -40% -40% auto auto; width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(217, 185, 106, .22), transparent 70%);
  pointer-events: none;
}
@keyframes loginIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.login-card h1 { font-size: clamp(24px, 3vw, 30px); color: var(--gold); font-weight: 800; margin-bottom: 4px; position: relative; }
.login-card > p.login-sub { margin: 0 0 22px; font-size: 13px; color: rgba(255, 247, 222, .5); position: relative; }
.dot { opacity: .6; }

/* -------------------------------------------------------- DASHBOARD */
.dashboard { max-width: 1180px; margin: 0 auto; }
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.dash-head h1 { font-size: clamp(20px, 2.6vw, 26px); color: var(--gold); font-weight: 800; display: flex; align-items: center; gap: 10px; }
.badge {
  font-family: 'Space Grotesk', sans-serif; font-size: 12px; font-weight: 600; color: var(--ink);
  background: var(--gold); padding: 4px 12px; border-radius: 999px;
}

/* ---------------------------------------------------------- STATS ROW */
.stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px;
}
@media (max-width: 720px) { .stats-row { grid-template-columns: repeat(2, 1fr); } }
.stat-card {
  border-radius: 16px; border: 1px solid rgba(217, 185, 106, .18);
  background: rgba(255, 255, 255, .025); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden;
  transition: transform .3s var(--ease), border-color .3s;
}
.stat-card:hover { transform: translateY(-3px); border-color: rgba(217, 185, 106, .4); }
.stat-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--gold);
}
.stat-card--pet::before { background: var(--pet); }
.stat-card--live::before { background: #7CD98A; }
.stat-card--query::before { background: #FF8783; }
.stat-card__num { font-family: 'Outfit', sans-serif; font-size: 26px; font-weight: 800; color: var(--gold-bright); line-height: 1; }
.stat-card--pet .stat-card__num { color: var(--pet-bright); }
.stat-card--live .stat-card__num { color: #9BE8A5; }
.stat-card--query .stat-card__num { color: #FFA7A3; }
.stat-card__label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 247, 222, .5); font-weight: 600; }

.tabs { display: flex; gap: 10px; margin-bottom: 22px; flex-wrap: wrap; }
.tab {
  padding: 11px 22px; border-radius: 999px; cursor: pointer; border: 1px solid rgba(255, 247, 222, .22);
  background: transparent; color: var(--cream); font-family: 'Outfit', sans-serif; font-weight: 600; font-size: 13.5px;
  transition: background .3s, color .3s, border-color .3s, transform .2s;
}
.tab.active { background: linear-gradient(150deg, var(--gold-bright), var(--gold)); color: var(--ink); border-color: transparent; box-shadow: 0 8px 20px -8px rgba(217, 185, 106, .6); }
.tab:not(.active):hover { border-color: var(--gold); color: var(--gold); transform: translateY(-1px); }

.card {
  border-radius: 20px; border: 1px solid rgba(217, 185, 106, .2);
  background: rgba(255, 255, 255, .025); padding: clamp(20px, 3vw, 30px);
  margin-bottom: 22px; position: relative; overflow: hidden;
  box-shadow: 0 24px 50px -34px rgba(0, 0, 0, .7);
  transition: border-color .3s;
}
.card::before {
  content: ''; position: absolute; left: 0; top: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--gold), transparent 85%);
}
.card--pet::before { background: linear-gradient(90deg, var(--pet), transparent 85%); }
.card--add::before { background: linear-gradient(90deg, var(--gold-bright), var(--pet) 120%); }
.card h2 { font-size: 18px; color: var(--gold-bright); margin-bottom: 4px; display: flex; align-items: center; gap: 10px; }
.card-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; box-shadow: 0 0 0 4px rgba(217, 185, 106, .12); }
.card-dot--glass { background: var(--gold); }
.card-dot--pet { background: var(--pet); box-shadow: 0 0 0 4px rgba(111, 216, 200, .15); }
.card-sub { font-size: 11px; text-transform: none; letter-spacing: 0; font-weight: 500; color: rgba(255, 247, 222, .45); }
.card-sub--block { display: block; margin: 0 0 6px; font-size: 13px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 620px) { .grid-2 { grid-template-columns: 1fr; } }

/* ------------------------------------------------- forgot / reset */
.hint--action { margin-top: 12px; }
.linkish {
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: inherit; font-size: 12.5px; color: var(--gold);
  text-decoration: underline; text-underline-offset: 3px;
}
.linkish:hover { color: var(--gold-bright); }
#resetCode { letter-spacing: .38em; font-weight: 600; }
#resetNote { color: rgba(255, 247, 222, .62); }


.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
thead th {
  text-align: left; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold); padding: 0 10px 12px; font-weight: 600; white-space: nowrap;
}
tbody tr { border-top: 1px solid rgba(255, 247, 222, .1); transition: background .25s; }
tbody tr:hover { background: rgba(217, 185, 106, .045); }
tbody td { padding: 12px 10px; vertical-align: middle; }
tbody input[type="text"], tbody input[type="number"] { min-width: 90px; }
.row-name-cell input { min-width: 130px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.thumb {
  display: block;
  width: 46px; height: 46px; border-radius: 10px; overflow: hidden; position: relative;
  background: rgba(255, 255, 255, .06); flex: none; cursor: pointer; border: 1px solid rgba(217, 185, 106, .3);
  transition: border-color .25s, transform .25s;
}
.thumb:hover { border-color: var(--gold); transform: scale(1.06); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.thumb .dot-fallback { width: 100%; height: 100%; display: grid; place-items: center; }
.thumb .dot-fallback span { width: 16px; height: 16px; border-radius: 50%; display: block; }

.active-checkbox { width: 18px; height: 18px; accent-color: var(--gold); cursor: pointer; }

.empty-note { color: rgba(255, 247, 222, .45); font-size: 13.5px; padding: 18px 4px 4px; }

/* -------------------------------------------------------- QUERY TABLE */
.query-table td { font-size: 13px; max-width: 220px; }
.query-table .msg-cell { max-width: 260px; white-space: normal; line-height: 1.5; color: rgba(255, 247, 222, .78); }
.query-table .contact-cell div { line-height: 1.5; }
.query-table .unread-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); margin-right: 6px; }
.query-table tr.is-read .name-cell { color: rgba(255, 247, 222, .55); }

@media (max-width: 720px) {
  .dash-head { flex-direction: column; align-items: flex-start; }
}
