/* src/dashboard/public/app.css */
:root{
  --bg0: #070612;
  --bg1: rgba(12, 8, 22, .72);
  --card: rgba(18,10,34,.42);
  --card2: rgba(18,10,34,.32);
  --stroke: rgba(180,140,255,.18);

  --text: #efe9ff;
  --muted: #b7aee6;

  /* brand gradient */
  --p: 160,120,255;   /* purple */
  --t: 0,220,200;     /* teal */
  --grad: linear-gradient(90deg, rgba(var(--p),1), rgba(var(--t),1));

  --shadow: 0 18px 60px rgba(0,0,0,.40);
  --r: 18px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  color:var(--text);
  background:
    radial-gradient(900px 480px at 12% 10%, rgba(var(--p),.20), transparent 55%),
    radial-gradient(900px 520px at 88% 0%, rgba(var(--t),.16), transparent 55%),
    radial-gradient(800px 520px at 60% 100%, rgba(var(--p),.12), transparent 60%),
    var(--bg0);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
}

a{ color:inherit; text-decoration:none; }
code{ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.container{ max-width: 1400px; margin: 0 auto; padding: 18px; }
.shell{ display:flex; gap:16px; align-items:stretch; }

.sidebar{
  width: 260px;
  flex:0 0 260px;
  padding: 14px;
  border-radius: var(--r);
  border:1px solid var(--stroke);
  background: rgba(10,6,18,.40);
  box-shadow: var(--shadow);
  position: sticky;
  top: 14px;
  height: calc(100vh - 28px);
  overflow:auto;
}

.main{ flex: 1; min-width: 0; }

.topbar{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  padding: 16px;
  border-radius: var(--r);
  border:1px solid var(--stroke);
  background: var(--card);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.title h2{ margin:0; font-size: 26px; letter-spacing:.2px; }
.title p{ margin:6px 0 0; color: var(--muted); }

.userbox{ display:flex; gap:10px; align-items:center; }
.userbox .avatar{
  width:40px;height:40px;border-radius:999px; overflow:hidden;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
}
.userbox img{ width:100%; height:100%; object-fit:cover; display:block; }
.userbox .meta{ display:flex; flex-direction:column; line-height:1.15; }
.userbox .name{ font-weight:800; }
.userbox .sub{ color: var(--muted); font-size: 12px; }

.card{
  padding:16px;
  border-radius: var(--r);
  border:1px solid var(--stroke);
  background: var(--card2);
  box-shadow: var(--shadow);
}

.btn{
  display:inline-flex;
  gap:10px;
  align-items:center;
  justify-content:center;
  padding:10px 14px;
  border-radius: 12px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: var(--text);
  font-weight: 700;
  cursor:pointer;
  user-select:none;
  transition: transform .08s ease, background .12s ease, border-color .12s ease;
}
.btn:hover{ transform: translateY(-1px); border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.09); }
.btn:active{ transform: translateY(0); }

.btn.primary{
  border: 1px solid rgba(255,255,255,.10);
  background: linear-gradient(90deg, rgba(var(--p),.90), rgba(var(--t),.85));
}
.btn.secondary{ background: rgba(0,0,0,.18); }
.btn.danger{
  background: rgba(220, 38, 38, .22);
  border-color: rgba(220, 38, 38, .22);
}

/* Labels + fields */
.field label{ font-size: 12px; color:#cfc7ff; display:flex; align-items:center; gap:8px; }
.field input, .field select, .field textarea{
  width:100%;
  padding:10px 10px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.10);
  background:
    radial-gradient(1200px 280px at 10% 0%, rgba(var(--p),.14), transparent 60%),
    radial-gradient(1200px 280px at 90% 0%, rgba(var(--t),.10), transparent 60%),
    rgba(10,6,18,.25);
  color: var(--text);
  outline:none;
  box-shadow: 0 10px 26px rgba(0,0,0,.16);
}
.field textarea{ min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus{
  border-color: rgba(var(--t),.35);
  box-shadow:
    0 0 0 4px rgba(var(--t),.14),
    0 14px 34px rgba(0,0,0,.22);
}

.row{ display:flex; gap:10px; flex-wrap:wrap; align-items:flex-end; }
.field{ display:flex; flex-direction:column; gap:6px; min-width: 220px; flex: 1 1 220px; }

.pill{
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 10px;
  border-radius: 999px;
  border:1px solid var(--stroke);
  background: rgba(10,6,18,.22);
  font-size: 12px;
  color:#e9d5ff;
}
.pill b{ color:#fff; }

.notice{
  margin: 0 0 12px;
  padding:10px 12px;
  border-radius: 12px;
  border:1px solid var(--stroke);
  background: rgba(10,6,18,.22);
}
.notice.ok{ border-color: rgba(34,197,94,.35); }
.notice.error{ border-color: rgba(239,68,68,.35); }

.mini{ font-size:12px; color: var(--muted); }
hr.sep{
  border: none;
  height: 1px;
  background: rgba(233,243,255,.10);
  margin: 12px 0;
}

/* =========================================================
   Sidebar (clean + categorized) + collapsible sections
   ========================================================= */
.sb-head{
  display:flex;
  gap:10px;
  align-items:center;
  margin-bottom:12px;
}
.sb-logo{
  width:38px;
  height:38px;
  border-radius:12px;
  background: linear-gradient(90deg, rgba(160,120,255,.9), rgba(0,220,200,.85));
  box-shadow:0 0 24px rgba(0,220,200,.18);
  flex:0 0 38px;
}
.sb-meta{ min-width:0; }
.sb-app{ font-weight:900; letter-spacing:.2px; }
.sb-guild{ font-size:12px; color: var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width: 170px; }

.sb-nav{ display:grid; gap:12px; }

.sb-sec{ display:grid; gap:8px; }
.sb-sec-title{
  font-size:11px;
  letter-spacing:.12em;
  text-transform:uppercase;
  color: rgba(233,213,255,.72);
  padding: 0 6px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  cursor:pointer;
  user-select:none;
}
.sb-sec-title .caret{
  opacity:.75;
  font-size: 12px;
  transform: rotate(90deg);
  transition: transform .12s ease, opacity .12s ease;
}
.sb-sec.collapsed .sb-sec-title .caret{
  transform: rotate(0deg);
  opacity:.55;
}
.sb-sec-items{ display:grid; gap:6px; }
.sb-sec.collapsed .sb-sec-items{ display:none; }

.nav-link{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.14);
  transition: transform .08s ease, background .12s ease, border-color .12s ease;
}
.nav-link:hover{
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
}
.nav-link.active{
  border-color: rgba(0,220,200,.25);
  background: linear-gradient(90deg, rgba(160,120,255,.18), rgba(0,220,200,.14));
}
.nav-text{ font-weight:800; }

.sb-foot{ margin-top:14px; }
.sb-foot-line{ height:1px; background:rgba(255,255,255,.08); margin:14px 0; }
.sb-foot-text{ font-size:12px; color:var(--muted); line-height:1.4; }

/* =========================================================
   Tabs
   ========================================================= */
.tabs{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  margin: 8px 0 14px;
}
.tabbtn{
  padding:10px 14px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: var(--text);
  font-weight: 800;
  cursor:pointer;
  transition: transform .08s ease, background .12s ease, border-color .12s ease;
}
.tabbtn:hover{ transform: translateY(-1px); border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.09); }
.tabbtn.active{
  border: 1px solid rgba(255,255,255,.10);
  background: linear-gradient(90deg, rgba(var(--p),.90), rgba(var(--t),.85));
}
.tabpane{ display:none; }
.tabpane.active{ display:block; }

/* =========================================================
   Lists (feedback)
   ========================================================= */
.list .item{
  padding: 12px;
  border: 1px solid rgba(64,208,208,.18);
  border-radius: 14px;
  background: rgba(14,22,40,.55);
  margin-bottom: 10px;
}
.item-row{
  display:flex;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
}
.item-actions{
  display:flex;
  flex-direction: column;
  gap: 10px;
  min-width: 280px;
}
.item-title{
  font-weight: 800;
  font-size: 15px;
}
.box{
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(7,7,11,.55);
  border: 1px solid rgba(176,112,224,.18);
  white-space: pre-wrap;
}

/* =========================================================
   Tooltip (tiny)
   ========================================================= */
.tip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:18px;
  height:18px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: rgba(233,241,255,.85);
  font-weight: 900;
  font-size: 12px;
  cursor: help;
  position: relative;
}
.tip:hover::after{
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(100% + 10px);
  white-space: nowrap;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(10,6,18,.92);
  box-shadow: 0 18px 60px rgba(0,0,0,.45);
  color: rgba(233,241,255,.92);
  font-weight: 700;
  font-size: 12px;
  z-index: 99;
}

/* =========================================================
   Pickers (channels / roles)
   ========================================================= */
.pick{ position: relative; width: 100%; }
.pick input{ width: 100%; }
.pick-menu{
  position:absolute; left:0; right:0; top: calc(100% + 6px);
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(10,6,18,.92);
  box-shadow: 0 18px 60px rgba(0,0,0,.45);
  overflow:hidden;
  max-height: 280px;
  overflow-y:auto;
  z-index: 50;
  display:none;
}
.pick.open .pick-menu{ display:block; }
.pick-item{
  padding:10px 12px;
  cursor:pointer;
  border-bottom:1px solid rgba(255,255,255,.06);
  display:flex; justify-content:space-between; gap:10px;
}
.pick-item:hover{ background: rgba(255,255,255,.06); }
.pick-item small{ color: rgba(233,233,255,.70); }
.chips{ display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.chip{
  display:inline-flex; gap:8px; align-items:center;
  padding:6px 10px; border-radius: 999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  font-size:12px;
}
.chip button{
  border:none; background:transparent; color:rgba(255,255,255,.75);
  cursor:pointer; font-weight:900; padding:0;
}

/* =========================================================
   Feedback question builder (collapsible)
   ========================================================= */
.qcard{
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.14);
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 10px;
}
.qhead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
}
.qhead-left{
  display:flex;
  align-items:center;
  gap:10px;
}
.qtoggle{
  width:26px;height:26px;border-radius:10px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center;
  font-weight: 900;
}
.qtitle{
  display:flex;
  flex-direction: column;
  line-height:1.15;
}
.qtitle b{ font-size: 13px; }
.qtitle small{ color: var(--muted); font-size: 12px; }

.qrow{ display:flex; gap:10px; flex-wrap:wrap; margin-top: 10px; }
.qhint{
  margin-top: 8px;
  color: rgba(233,213,255,.78);
  font-size: 12px;
}
.qcard.collapsed .qrow,
.qcard.collapsed .qhint{ display:none; }

/* Responsive */
@media (max-width: 980px){
  .shell{ flex-direction:column; }
  .sidebar{ width:100%; position:static; height:auto; }
}