:root{
  --sidebar:#020817;
  --sidebar2:#071123;
  --bg:#f4f6fb;
  --panel:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --line:#e5e7eb;
  --purple:#7c3aed;
  --purple2:#4f46e5;
  --green:#16a34a;
  --red:#dc2626;
  --orange:#f59e0b;
}

*{
  box-sizing:border-box;
}

html,body{
  margin:0;
  min-height:100%;
}

body{
  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  background:var(--bg);
  color:var(--text);
  overflow-x:hidden;
}

.shell{
  display:block !important;
  width:100vw !important;
  min-height:100vh !important;
  padding:0 !important;
  margin:0 !important;
}

.hero,
.hero-compact{
  display:none !important;
}

.app{
  display:grid !important;
  grid-template-columns:240px minmax(0,1fr) !important;
  width:100vw !important;
  max-width:100vw !important;
  min-height:100vh !important;
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  border-radius:0 !important;
  overflow:visible !important;
  background:var(--bg) !important;
  box-shadow:none !important;
}

.sidebar{
  background:linear-gradient(180deg,var(--sidebar2),var(--sidebar));
  min-height:100vh;
  padding:20px 14px;
  color:white;
  overflow-y:auto;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  color:white;
  font-size:16px;
  letter-spacing:.2px;
  margin:0 0 22px;
  padding:0 8px;
}

.brand strong{
  font-weight:950;
}

.sidebar a{
  display:flex;
  align-items:center;
  gap:12px;
  width:100%;
  color:#dbeafe;
  text-decoration:none;
  padding:13px 14px;
  border-radius:13px;
  margin:6px 0;
  font-size:15px;
  font-weight:850;
  line-height:1.2;
}

.sidebar a span{
  width:20px;
  flex:0 0 20px;
  text-align:center;
}

.sidebar a b{
  display:block;
  font-weight:850;
}

.sidebar a.active{
  color:white;
  background:linear-gradient(135deg,var(--purple),var(--purple2));
  box-shadow:0 14px 30px rgba(124,58,237,.35);
}

.sidebar a.logout{
  color:#fecaca;
  margin-top:24px;
}

.content{
  width:100% !important;
  min-width:0 !important;
  color:var(--text);
  background:var(--bg);
}

.topbar{
  min-height:82px;
  width:100%;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
  padding:18px 28px;
  border-bottom:1px solid var(--line);
  background:white;
}

.topbar h2{
  margin:0;
  font-size:28px;
  line-height:1.1;
  white-space:normal;
}

.topbar p{
  margin:6px 0 0;
  color:var(--muted);
  line-height:1.35;
}

.user{
  font-weight:900;
  white-space:nowrap;
}

.cards{
  display:grid;
  grid-template-columns:repeat(4,minmax(180px,1fr));
  gap:16px;
  padding:24px 28px 14px;
  width:100%;
}

.card,
.panel{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:16px;
  box-shadow:0 10px 30px rgba(15,23,42,.06);
}

.card{
  padding:18px;
  min-width:0;
}

.card span{
  display:block;
  color:var(--muted);
  font-size:13px;
  font-weight:850;
}

.card strong{
  display:block;
  margin:8px 0;
  font-size:34px;
  line-height:1;
}

.card em{
  color:var(--green);
  font-style:normal;
  font-weight:900;
}

.grid{
  display:grid;
  grid-template-columns:minmax(0,2fr) minmax(320px,1fr);
  gap:16px;
  padding:10px 28px 28px;
  width:100%;
}

.page-pad{
  padding:24px 28px;
  width:100%;
}

.panel{
  padding:20px;
  min-height:160px;
  min-width:0;
}

.panel h3{
  margin:0 0 14px;
  font-size:19px;
}

.panel-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-bottom:12px;
}

.panel-head h3{
  margin:0;
}

.table-wrap{
  width:100%;
  overflow:auto;
}

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

th,td{
  padding:12px 10px;
  border-bottom:1px solid #eef2f7;
  text-align:left;
  white-space:nowrap;
}

th{
  color:#64748b;
  font-size:12px;
  text-transform:uppercase;
}

.pill{
  display:inline-flex;
  align-items:center;
  border-radius:999px;
  padding:5px 10px;
  font-size:12px;
  font-weight:900;
  background:#e5e7eb;
  color:#374151;
}

.pill.active{
  background:#dcfce7;
  color:#166534;
}

.pill.disabled{
  background:#fef3c7;
  color:#92400e;
}

.pill.error,
.pill.token_expired{
  background:#fee2e2;
  color:#991b1b;
}

.user-line{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:12px 0;
  border-bottom:1px solid #eef2f7;
}

.steps{
  display:grid;
  gap:10px;
}

.steps div{
  padding:12px 14px;
  border-radius:12px;
  background:#f8fafc;
  border:1px solid #eef2f7;
  font-weight:750;
}

.ai-status{
  display:grid;
  gap:8px;
  padding:18px;
  border-radius:16px;
  background:linear-gradient(135deg,rgba(124,58,237,.12),rgba(37,99,235,.08));
  border:1px solid #e9d5ff;
}

.ai-status strong{
  font-size:26px;
  color:#7c3aed;
}

.account-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(280px,1fr));
  gap:18px;
}

.account-card{
  border:1px solid #e5e7eb;
  border-radius:18px;
  padding:18px;
  background:#f8fafc;
}

.ebay-logo{
  font-size:24px;
  font-weight:950;
  color:#2563eb;
}

.account-actions{
  display:flex;
  gap:10px;
  margin-top:14px;
}

button,
.mini-btn{
  border:0;
  border-radius:12px;
  padding:12px 16px;
  color:white;
  background:linear-gradient(135deg,var(--purple),var(--purple2));
  font-weight:900;
  cursor:pointer;
  text-decoration:none;
  display:inline-block;
}

button:disabled{
  opacity:.6;
  cursor:not-allowed;
}

.login-body{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  background:
    radial-gradient(circle at 10% 20%, rgba(124,58,237,.35), transparent 28%),
    radial-gradient(circle at 90% 80%, rgba(29,78,216,.3), transparent 28%),
    linear-gradient(135deg,#020617,#071426 55%,#11071d);
}

.login-card{
  width:min(430px,100%);
  background:white;
  color:#0f172a;
  border-radius:28px;
  padding:34px;
  box-shadow:0 30px 100px rgba(0,0,0,.35);
}

.login-logo{
  width:74px;
  height:74px;
  border-radius:24px;
  background:linear-gradient(135deg,#2563eb,#a855f7);
  display:flex;
  align-items:center;
  justify-content:center;
  color:white;
  font-size:28px;
  font-weight:900;
  margin-bottom:18px;
}

.login-card h1{
  margin:0;
  font-size:30px;
}

.login-card p{
  color:#64748b;
  margin:8px 0 24px;
}

.login-card label{
  display:block;
  font-weight:800;
  margin:14px 0 8px;
}

.login-card input{
  width:100%;
  border:1px solid #e5e7eb;
  border-radius:14px;
  padding:14px 15px;
  font-size:16px;
  outline:none;
}

.login-card input:focus{
  border-color:#7c3aed;
  box-shadow:0 0 0 4px rgba(124,58,237,.12);
}

.login-card button{
  width:100%;
  margin-top:22px;
  font-size:16px;
}

.login-error,
.login-notice{
  border-radius:14px;
  padding:12px 14px;
  margin:16px 0;
  font-weight:900;
}

.login-error{
  background:#fee2e2;
  color:#991b1b;
  border:1px solid #fecaca;
}

.login-notice{
  background:#dbeafe;
  color:#1e3a8a;
  border:1px solid #bfdbfe;
}

@media(max-width:1100px){
  .app{
    grid-template-columns:1fr !important;
  }

  .sidebar{
    min-height:auto;
  }

  .cards{
    grid-template-columns:1fr 1fr;
  }

  .grid{
    grid-template-columns:1fr;
  }
}

@media(max-width:680px){
  .cards{
    grid-template-columns:1fr;
  }

  .topbar{
    align-items:flex-start;
    flex-direction:column;
  }
}

.warn-box{
  background:#fef3c7;
  color:#92400e;
  border:1px solid #fde68a;
  padding:14px 16px;
  border-radius:14px;
  margin:12px 0 20px;
  font-weight:850;
}

.notice-ok{
  background:#dcfce7;
  color:#166534;
  border:1px solid #bbf7d0;
  padding:12px 14px;
  border-radius:14px;
  font-weight:900;
}

.settings-form{
  display:grid;
  gap:12px;
  max-width:850px;
}

.settings-form label{
  font-weight:900;
  color:#334155;
}

.settings-form input,
.settings-form textarea{
  width:100%;
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:12px 14px;
  font-size:15px;
}

.api-box{
  display:block;
  max-height:460px;
  overflow:auto;
  background:#020617;
  color:#d1fae5;
  padding:18px;
  border-radius:14px;
  font-size:13px;
  line-height:1.45;
  white-space:pre-wrap;
}

.submit-grid{
  grid-template-columns:minmax(0,2fr) minmax(300px,1fr);
}

.settings-form select,
.settings-form input,
.settings-form textarea{
  width:100%;
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:12px 14px;
  font-size:15px;
  background:white;
}

.form-row{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:14px;
}

.notice-ok{
  background:#dcfce7;
  color:#166534;
  border:1px solid #bbf7d0;
  padding:12px 14px;
  border-radius:14px;
  font-weight:900;
  margin-bottom:18px;
}
