:root {
  --bg: radial-gradient(circle at top, #0f172a, #020617 55%, #000);
  --card: rgba(10, 16, 32, 0.6);
  --card-solid: rgba(15, 23, 42, 0.95);
  --accent: #38bdf8;
  --accent2: #f97316;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --radius: 1.25rem;
  --shadow-3d: 0 20px 40px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.app-shell {
  width: min(1300px, 100%);
  min-height: 700px;
  display: grid;
  grid-template-columns: 300px 1fr 280px;
  gap: 1rem;
}

.sidebar {
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.9), rgba(2, 6, 23, 0.4));
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 1.4rem;
  padding: 1rem;
  box-shadow: var(--shadow-3d);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  backdrop-filter: blur(16px);
}

.logo-3d {
  background: radial-gradient(circle at top, rgba(248, 250, 252, 0.1), rgba(2, 6, 23, 0));
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 1rem;
  padding: .6rem;
  display: flex;
  justify-content: center;
  transform: perspective(900px) rotateX(4deg);
  box-shadow: 0 25px 50px rgba(0,0,0,.25);
}
.logo-3d img {
  max-width: 180px;
}

.auth-card {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.06);
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.auth-card h2 {
  margin-top: 0;
}

label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.04em;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
input[type="file"] {
  width: 100%;
  background: rgba(15, 23, 42, 0.3);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 0.6rem;
  padding: 0.4rem 0.55rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}
input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.8);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.08);
}

.btn {
  background: linear-gradient(140deg, #0ea5e9, #38bdf8);
  border: none;
  border-radius: 0.6rem;
  padding: 0.45rem 0.7rem;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
  transition: transform 0.15s ease-out;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn.small {
  padding: 0.35rem 0.5rem;
  font-size: 0.7rem;
}

.ghost-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.7rem;
  cursor: pointer;
}

.main {
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.5), rgba(2, 6, 23, 0.15));
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 1.4rem;
  box-shadow: var(--shadow-3d);
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.04);
}

.user-pill {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 999px;
  display: flex;
  gap: .4rem;
  align-items: center;
  padding: 0.3rem 0.6rem;
}
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  display: grid;
  place-items: center;
  font-weight: bold;
}

.content {
  padding: 1rem 1.2rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100%;
}

.admin-panel {
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.05);
  border-radius: 1rem;
  padding: 1rem;
}
.admin-grid {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.auction-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
}

.auction-card {
  background: radial-gradient(circle at top, rgba(15,23,42,0.85), rgba(15,23,42,0.25));
  border: 1px solid rgba(148, 163, 184, 0.03);
  border-radius: 1rem;
  padding: .7rem;
  box-shadow: 0 15px 35px rgba(0,0,0,.18);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  gap: .5rem;
  transform: perspective(900px) rotateX(0deg);
  transition: transform 0.15s ease-out, border 0.15s;
}
.auction-card:hover {
  transform: perspective(900px) translateY(-3px) rotateX(2deg);
  border: 1px solid rgba(56,189,248,.25);
}

.auction-img {
  width: 100%;
  aspect-ratio: 4 / 2.3;
  border-radius: 0.6rem;
  object-fit: cover;
  background: rgba(15,23,42,.3);
  border: 1px solid rgba(148, 163, 184, .03);
}

.countdown {
  font-size: .7rem;
  font-weight: 600;
  color: #f97316;
}
.price {
  font-weight: 700;
}
.bid-area {
  display: flex;
  gap: .5rem;
}
.bid-area input {
  margin-bottom: 0;
}

.inbox {
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.9), rgba(2, 6, 23, 0.5));
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 1.4rem;
  box-shadow: var(--shadow-3d);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.inbox-header {
  padding: 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, .05);
}
.thread-list {
  max-height: 160px;
  overflow-y: auto;
}
.thread-item {
  padding: .5rem .9rem;
  border-bottom: 1px solid rgba(148, 163, 184, .04);
  cursor: pointer;
}
.thread-item.active {
  background: rgba(56,189,248,.09);
}
.thread-item h4 {
  margin: 0;
  font-size: .7rem;
}
.thread-item p {
  margin: 0;
  font-size: .6rem;
  color: var(--muted);
}
.thread-view {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.messages {
  flex: 1;
  overflow-y: auto;
  padding: .8rem .6rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.msg {
  max-width: 90%;
  padding: .35rem .5rem;
  border-radius: .6rem;
  font-size: .65rem;
}
.msg.me {
  background: rgba(56,189,248,.12);
  align-self: flex-end;
}
.msg.other {
  background: rgba(15,23,42,.4);
  border: 1px solid rgba(148,163,184,.02);
}
.reply-box {
  display: flex;
  gap: .3rem;
  padding: .5rem;
  border-top: 1px solid rgba(148, 163, 184, .05);
}
.reply-box input {
  flex: 1;
  margin-bottom: 0;
}

.muted { color: var(--muted); }
.tiny { font-size: .6rem; }
.hidden { display: none !important; }

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .inbox {
    order: 3;
    min-height: 240px;
  }
}
