/* =========================
   CraftD Membership UI
   ========================= */

:root{
  --bg: #0b0d12;
  --panel: #121624;
  --panel-2: #0f1320;
  --text: #e9ecf3;
  --muted: #aab2c5;

  --line: rgba(255,255,255,.08);

  --brand: #7c5cff;
  --brand-2: #28d7a2;

  --danger: #ff4d6d;
  --ok: #2be48b;

  --radius: 18px;
  --shadow: 0 18px 60px rgba(0,0,0,.45);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  min-height: 100vh;
  background-color: var(--bg);
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-image:
    radial-gradient(1200px 500px at 15% -10%, rgba(124,92,255,.22), transparent 55%),
    radial-gradient(900px 450px at 85% 0%, rgba(40,215,162,.12), transparent 55%),
    linear-gradient(180deg, var(--bg), #06070b);
}

a{ color: inherit; text-decoration: none; }
a:hover{ opacity:.92; }

.container{
  width:min(1100px, 92vw);
  margin: 0 auto;
  padding: 22px 0 60px;
}

/* ---------- Header ---------- */

.site-header{
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: linear-gradient(180deg, rgba(6,7,11,.75), rgba(6,7,11,.35));
  border-bottom: 1px solid var(--line);
}

.header-inner{
  width:min(1100px, 92vw);
  margin:0 auto;
  padding: 14px 0;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight: 800;
  letter-spacing: .2px;
}

.brand-badge{
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.35), transparent 55%),
    linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 12px 24px rgba(0,0,0,.35);
}

.nav{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(18,22,36,.7);
  color: var(--muted);
}
.pill strong{ color: var(--text); font-weight: 700; }

/* ---------- Buttons ---------- */

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(18,22,36,.8);
  color: var(--text);
  cursor:pointer;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
}
.btn:hover{
  background: rgba(18,22,36,.95);
  border-color: rgba(255,255,255,.14);
  transform: translateY(-1px);
}
.btn:active{ transform: translateY(0px); }

.btn-primary{
  background: linear-gradient(135deg, rgba(124,92,255,.9), rgba(40,215,162,.85));
  border-color: rgba(255,255,255,.14);
}
.btn-danger{
  background: rgba(255,77,109,.12);
  border-color: rgba(255,77,109,.25);
}

.btn.btn-row{
  padding: 8px 12px;
  border-radius: 12px;
}

/* ---------- Layout ---------- */

.card{
  background: linear-gradient(180deg, rgba(18,22,36,.92), rgba(15,19,32,.92));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
}
.span-12{ grid-column: span 12; }
.span-8{ grid-column: span 8; }
.span-6{ grid-column: span 6; }
.span-4{ grid-column: span 4; }

@media (max-width: 860px){
  .span-8,.span-6,.span-4{ grid-column: span 12; }
}

.h1{
  font-size: clamp(24px, 3vw, 34px);
  margin: 0 0 10px;
  letter-spacing: .2px;
}
.lead{
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.5;
}

hr.sep{
  border: 0;
  border-top: 1px solid var(--line);
  margin: 18px 0;
}

/* ---------- Notices ---------- */

.notice{
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255,255,255,.04);
  color: var(--muted);
}

.notice.ok,
.notice.success{
  background: rgba(43,228,139,.12);
  border-color: rgba(43,228,139,.22);
  color: rgba(233,236,243,.92);
}

.notice.err,
.notice.error{
  background: rgba(255,77,109,.12);
  border-color: rgba(255,77,109,.22);
  color: rgba(233,236,243,.92);
}

/* ---------- Forms (base helpers) ---------- */

.form{
  display:grid;
  gap: 12px;
}
.label{
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
  display:block;
}
.input{
  width:100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(6,7,11,.45);
  color: var(--text);
  outline: none;
}
.input:focus{
  border-color: rgba(124,92,255,.45);
  box-shadow: 0 0 0 4px rgba(124,92,255,.14);
}

.help{
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

/* ---------- Footer ---------- */

.site-footer{
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 18px 0 24px;
  margin-top: 34px;
}
.footer-inner{
  width:min(1100px, 92vw);
  margin:0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.small{ font-size: 12px; }

/* ---------- Tables ---------- */

.table-wrap{ overflow:auto; margin-top:14px; }
.table{
  width:100%;
  border-collapse: separate;
  border-spacing: 0 10px;
}

.table thead th{
  text-align:left;
  font-size:13px;
  color: var(--muted);
  font-weight:700;
  padding: 6px 10px;
}
.table tbody td{
  padding: 10px;
  background: rgba(6,7,11,.35);
  border: 1px solid rgba(255,255,255,.06);
}
.table tbody tr td:first-child{
  border-top-left-radius: 14px;
  border-bottom-left-radius: 14px;
}
.table tbody tr td:last-child{
  border-top-right-radius: 14px;
  border-bottom-right-radius: 14px;
}

/* Actions: default horizontal */
.table-actions{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:8px;
  flex-wrap: nowrap;
}
@media (max-width: 700px){
  .table-actions{ flex-wrap: wrap; justify-content:flex-start; }
}

.pager{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  margin-top:14px;
}
.pager a{
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(18,22,36,.65);
  color: var(--text);
}
.pager .muted{ color: var(--muted); }

/* --- Slots row layout --- */

.slot-cell{
  display:flex;
  align-items:center;
  gap:12px;
}
.slot-cell .input{
  flex: 1 1 auto;
  min-width: 220px;
}

.slot-stats{
  flex: 0 0 auto;
  min-width: 150px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(18,22,36,.55);
  color: rgba(233,236,243,.92);
}
.slot-stats .row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  font-size: 12px;
  line-height: 1.2;
  margin: 2px 0;
}
.slot-stats .k{ color: var(--muted); font-weight: 700; }
.slot-stats .v{ font-weight: 700; }

@media (max-width: 700px){
  .slot-cell{ flex-direction: column; align-items: stretch; }
  .slot-stats{ min-width: 0; width: 100%; }
}

/* ---------- Slots top / stats (clean) ---------- */
/* (kept the GRID version; removed the old FLEX duplicate) */

.slots-top{
  display:grid;
  grid-template-columns: 1.35fr .65fr;
  gap: 18px;
  align-items:start;
}
@media (max-width: 900px){
  .slots-top{ grid-template-columns: 1fr; }
}

.slots-panel{
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(18,22,36,.55);
  border-radius: 18px;
  padding: 16px;
}

.stats-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom: 12px;
}
.stats-title{
  font-weight: 800;
  letter-spacing: .2px;
}
.stats-chip{
  font-size: 12px;
  color: var(--muted);
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(6,7,11,.35);
  padding: 6px 10px;
  border-radius: 999px;
}
.stats-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
}
.stat{
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(6,7,11,.28);
  border-radius: 14px;
  padding: 12px;
}
.stat .k{
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.stat .v{
  margin-top: 6px;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .2px;
}
.stat .sub{
  margin-top: 4px;
  font-size: 12px;
  color: rgba(233,236,243,.75);
}
.stats-foot{
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

/* ===============================
   Unified form controls (dark UI)
   =============================== */

.form-control,
select,
input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea{
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);

  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(0,0,0,.25)),
    rgba(0,0,0,.35);

  color: #fff;
  font-size: 14px;
  line-height: 1.2;

  transition:
    border-color .15s ease,
    background .15s ease,
    box-shadow .15s ease;
}

input::placeholder,
textarea::placeholder{
  color: rgba(255,255,255,.45);
}

select:hover,
input:hover,
textarea:hover{
  border-color: rgba(255,255,255,.22);
}

select:focus,
input:focus,
textarea:focus{
  outline: none;
  border-color: rgba(122,92,255,.75);
  box-shadow: 0 0 0 3px rgba(122,92,255,.25);
  background:
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(0,0,0,.30)),
    rgba(0,0,0,.45);
}

select:disabled,
input:disabled,
textarea:disabled{
  opacity: .6;
  cursor: not-allowed;
}

/* Select arrow */
select{
  background-image:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(0,0,0,.25)),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat, no-repeat;
  background-position: center right 14px, center right 14px;
  padding-right: 42px;
}

/* Date picker icon */
input[type="date"]::-webkit-calendar-picker-indicator{
  filter: invert(1);
  opacity: .7;
  cursor: pointer;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover{
  opacity: 1;
}

/* ===============================
   OBS Embed Links (clean + one-line)
   =============================== */

.obs-link-row{
  display:grid;
  grid-template-columns: 92px 4fr auto; /* label | wider url | buttons */
  gap:10px;
  align-items:center;
  margin-bottom:10px;
}

.obs-link-row strong{
  min-width:92px;
}

/* Key: allow the grid cell to shrink properly */
.obs-link-row input{
  width:100%;
  min-width:0;
}

/* Buttons container (wrap buttons in HTML) */
.obs-link-actions{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  white-space:nowrap;
}

/* independent button style (kept as-is) */
.obs-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 14px;
  border-radius:12px;
  font-size:13px;
  font-weight:800;
  cursor:pointer;
  user-select:none;
  text-decoration:none;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(0,0,0,.22);
  color:#fff;
}
.obs-btn:hover{
  border-color:rgba(255,255,255,.26);
  background:rgba(0,0,0,.30);
}
.obs-btn:disabled{
  opacity:.65;
  cursor:not-allowed;
}
.obs-btn-secondary{
  opacity:.9;
}

/* Mobile: stack */
@media (max-width: 720px){
  .obs-link-row{ grid-template-columns: 1fr; }
  .obs-link-actions{ justify-content:flex-start; }
}
