/* ============================================================
   CC Panel — Main Stylesheet
   Dark industrial aesthetic with sharp accents
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Syne:wght@400;600;700;800&display=swap');

:root {
  --bg:         #0b0d11;
  --bg2:        #111418;
  --bg3:        #181d24;
  --border:     #1f2733;
  --border2:    #2a3444;
  --accent:     #00e5a0;
  --accent2:    #00b87a;
  --accent-dim: rgba(0,229,160,.12);
  --red:        #ff4757;
  --red-dim:    rgba(255,71,87,.12);
  --yellow:     #ffd32a;
  --yellow-dim: rgba(255,211,42,.1);
  --blue:       #3d84ff;
  --blue-dim:   rgba(61,132,255,.12);
  --text:       #e4eaf3;
  --text2:      #8a9ab5;
  --text3:      #4a5568;
  --mono:       'Space Mono', monospace;
  --sans:       'Syne', sans-serif;
  --radius:     6px;
  --sidebar-w:  240px;
  --header-h:   56px;
  --shadow:     0 4px 24px rgba(0,0,0,.5);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ---- Scrollbar ------------------------------------------ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ---- Login Page ----------------------------------------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 60% 60% at 10% 90%, rgba(0,229,160,.06) 0%, transparent 70%),
    radial-gradient(ellipse 50% 50% at 90% 10%, rgba(61,132,255,.05) 0%, transparent 70%);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 48px 40px;
  box-shadow: var(--shadow), 0 0 0 1px rgba(0,229,160,.04);
}

.login-logo {
  text-align: center;
  margin-bottom: 36px;
}
.login-logo .logo-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -1px;
}
.login-logo .logo-mark span { color: var(--text2); font-size: .75rem; letter-spacing: 3px; display: block; margin-top: 4px; font-family: var(--sans); }

/* ---- Forms ---------------------------------------------- */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text2);
  margin-bottom: 8px;
}
.form-control {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--mono);
  font-size: .9rem;
  padding: 12px 14px;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.form-control::placeholder { color: var(--text3); }

select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a9ab5' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

textarea.form-control { resize: vertical; min-height: 100px; }

/* ---- Buttons -------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all .2s;
  letter-spacing: .4px;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { background: var(--accent2); transform: translateY(-1px); }
.btn-secondary { background: var(--bg3); color: var(--text2); border: 1px solid var(--border2); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: var(--red-dim); color: var(--red); border: 1px solid rgba(255,71,87,.2); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-warning { background: var(--yellow-dim); color: var(--yellow); border: 1px solid rgba(255,211,42,.2); }
.btn-sm { padding: 6px 14px; font-size: .78rem; }
.btn-icon { padding: 8px; }
.btn-full { width: 100%; }

/* ---- Layout --------------------------------------------- */
.layout { display: flex; min-height: 100vh; }

/* ---- Sidebar -------------------------------------------- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform .3s;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo .logo-icon {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 900; color: #000; font-family: var(--mono);
}
.sidebar-logo .logo-text { font-size: 1rem; font-weight: 800; color: var(--text); }
.sidebar-logo .logo-version { font-size: .65rem; color: var(--text3); font-family: var(--mono); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }

.nav-section {
  padding: 16px 16px 6px;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text3);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--text2);
  text-decoration: none;
  font-size: .85rem;
  font-weight: 600;
  border-radius: var(--radius);
  margin: 2px 8px;
  transition: all .15s;
  position: relative;
}
.nav-item:hover { background: var(--bg3); color: var(--text); }
.nav-item.active { background: var(--accent-dim); color: var(--accent); }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -8px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.nav-item .nav-icon { font-size: 1rem; width: 18px; text-align: center; flex-shrink: 0; }
.nav-badge { margin-left: auto; background: var(--accent); color: #000; font-size: .65rem; font-weight: 700; padding: 2px 6px; border-radius: 10px; font-family: var(--mono); }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}
.admin-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--bg3);
  border-radius: var(--radius);
  margin-bottom: 10px;
}
.admin-avatar {
  width: 30px; height: 30px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; color: var(--accent);
  flex-shrink: 0;
}
.admin-info .name { font-size: .82rem; font-weight: 700; color: var(--text); }
.admin-info .role { font-size: .68rem; color: var(--text3); letter-spacing: .5px; }

/* ---- Main content --------------------------------------- */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--header-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 50;
  gap: 16px;
}
.topbar-title { font-size: 1rem; font-weight: 700; color: var(--text); flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-time { font-family: var(--mono); font-size: .78rem; color: var(--text3); }

.content { padding: 28px; flex: 1; }

/* ---- Page header ---------------------------------------- */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 28px; flex-wrap: wrap; gap: 12px; }
.page-title { font-size: 1.4rem; font-weight: 800; color: var(--text); }
.page-subtitle { font-size: .82rem; color: var(--text3); margin-top: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- Stats cards ---------------------------------------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 16px; margin-bottom: 28px; }

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color .2s;
}
.stat-card:hover { border-color: var(--border2); }
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: var(--accent);
  opacity: .6;
}
.stat-card.red::before   { background: var(--red); }
.stat-card.yellow::before { background: var(--yellow); }
.stat-card.blue::before  { background: var(--blue); }

.stat-label { font-size: .7rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text3); margin-bottom: 10px; }
.stat-value { font-family: var(--mono); font-size: 1.8rem; font-weight: 700; color: var(--text); line-height: 1; }
.stat-sub   { font-size: .75rem; color: var(--text3); margin-top: 6px; }
.stat-icon  { position: absolute; right: 16px; top: 16px; font-size: 1.6rem; opacity: .1; }

/* ---- Card / Panel --------------------------------------- */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 24px;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.card-title { font-size: .9rem; font-weight: 700; color: var(--text); }
.card-body { padding: 20px; }

/* ---- Table ---------------------------------------------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 10px 14px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text3);
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid rgba(255,255,255,.03); transition: background .1s; }
tbody tr:hover { background: rgba(255,255,255,.02); }
tbody tr:last-child { border-bottom: none; }
td { padding: 11px 14px; font-size: .85rem; color: var(--text2); vertical-align: middle; }
td .mono { font-family: var(--mono); font-size: .82rem; color: var(--text); }
.td-actions { display: flex; gap: 6px; }

/* ---- Badges --------------------------------------------- */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  font-family: var(--mono);
}
.badge-available { background: rgba(0,229,160,.12); color: var(--accent); }
.badge-sold      { background: rgba(255,71,87,.12); color: var(--red); }
.badge-swapped   { background: rgba(255,211,42,.1); color: var(--yellow); }
.badge-user      { background: var(--blue-dim); color: var(--blue); }
.badge-seller    { background: var(--accent-dim); color: var(--accent); }
.badge-banned    { background: var(--red-dim); color: var(--red); }
.badge-active    { background: var(--accent-dim); color: var(--accent); }

/* ---- Alert ---------------------------------------------- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: .85rem;
  font-weight: 600;
  display: flex; align-items: center; gap: 10px;
}
.alert-success { background: var(--accent-dim); border: 1px solid rgba(0,229,160,.2); color: var(--accent); }
.alert-error   { background: var(--red-dim);    border: 1px solid rgba(255,71,87,.2); color: var(--red); }
.alert-warning { background: var(--yellow-dim); border: 1px solid rgba(255,211,42,.2); color: var(--yellow); }
.alert-info    { background: var(--blue-dim);   border: 1px solid rgba(61,132,255,.2); color: var(--blue); }

/* ---- Pagination ----------------------------------------- */
.pagination { display: flex; align-items: center; gap: 6px; padding: 16px 20px; border-top: 1px solid var(--border); }
.pagination .page-info { flex: 1; font-size: .78rem; color: var(--text3); }
.page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--radius);
  font-size: .8rem; font-family: var(--mono);
  background: var(--bg3); color: var(--text2);
  border: 1px solid var(--border2);
  cursor: pointer; text-decoration: none; transition: all .15s;
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); color: #000; border-color: var(--accent); }
.page-btn:disabled { opacity: .3; cursor: not-allowed; }

/* ---- Filter bar ----------------------------------------- */
.filter-bar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,.1);
}
.filter-bar .form-control { max-width: 200px; padding: 8px 12px; font-size: .82rem; }
.filter-bar .btn { padding: 8px 16px; }

/* ---- Modal ---------------------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 12px;
  width: 100%; max-width: 480px;
  box-shadow: var(--shadow);
  animation: modal-in .2s ease;
}
@keyframes modal-in { from { opacity:0; transform: translateY(12px) scale(.97); } }
.modal-header {
  padding: 18px 22px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 1rem; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text3); cursor: pointer; font-size: 1.2rem; padding: 4px; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 22px; }
.modal-footer { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ---- Search input --------------------------------------- */
.search-wrap { position: relative; }
.search-wrap .form-control { padding-left: 36px; }
.search-wrap::before { content: '🔍'; position: absolute; left: 11px; top: 50%; transform: translateY(-50%); font-size: .9rem; pointer-events: none; }

/* ---- Toggle switch -------------------------------------- */
.toggle { position: relative; display: inline-block; width: 40px; height: 22px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--bg3); border: 1px solid var(--border2); border-radius: 22px;
  transition: .2s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 16px; height: 16px;
  left: 2px; top: 2px;
  background: var(--text3); border-radius: 50%;
  transition: .2s;
}
.toggle input:checked + .toggle-slider { background: var(--accent-dim); border-color: var(--accent); }
.toggle input:checked + .toggle-slider::before { background: var(--accent); transform: translateX(18px); }

/* ---- Miscellaneous -------------------------------------- */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.text-accent { color: var(--accent); }
.text-red    { color: var(--red); }
.text-muted  { color: var(--text3); }
.mono        { font-family: var(--mono); }
.flex        { display: flex; }
.gap-2       { gap: 8px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.fw-700 { font-weight: 700; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2.messages-grid { grid-template-columns: 35% 65%; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }

/* ---- Responsive ----------------------------------------- */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
