/* =========================
   AREA CLIENTI — REWORK UI
   ========================= */

:root{
  --portal-card: rgba(255,255,255,.045);
  --portal-card-2: rgba(255,255,255,.028);
  --portal-line: rgba(255,255,255,.10);
  --portal-line-2: rgba(255,255,255,.07);
  --portal-soft: rgba(255,255,255,.72);
  --portal-shadow: 0 24px 60px rgba(0,0,0,.42);
}

body.portal-page,
body.page-portal{
  min-height:100vh;
  position:relative;
  background:
    radial-gradient(900px 420px at 12% -12%, rgba(255,106,0,.18), transparent 58%),
    radial-gradient(780px 360px at 100% 0%, rgba(255,140,66,.12), transparent 60%),
    linear-gradient(180deg, rgba(6,6,8,.98), rgba(8,8,10,.98));
}

body.portal-page::before,
body.portal-page::after,
body.page-portal::before,
body.page-portal::after{
  content:"";
  position:fixed;
  border-radius:999px;
  filter:blur(100px);
  pointer-events:none;
  z-index:0;
}

body.portal-page::before,
body.page-portal::before{
  width:240px;
  height:240px;
  left:-40px;
  top:180px;
  background:rgba(255,106,0,.12);
}

body.portal-page::after,
body.page-portal::after{
  width:280px;
  height:280px;
  right:-80px;
  bottom:40px;
  background:rgba(255,255,255,.04);
}

.wrap{
  width:100%;
  max-width:1280px;
  margin:0 auto;
  padding:0 20px;
  position:relative;
  z-index:1;
}

.topstrip{
  padding:32px 0 0;
}

.portal-hero{
  display:grid;
  grid-template-columns:minmax(0, 1.3fr) minmax(280px, .7fr);
  gap:18px;
  align-items:stretch;
  border:1px solid var(--portal-line);
  border-radius:30px;
  padding:24px;
  background:
    radial-gradient(circle at top right, rgba(255,106,0,.14), transparent 34%),
    linear-gradient(180deg, rgba(20,20,24,.88), rgba(12,12,14,.94));
  box-shadow:var(--portal-shadow);
  overflow:hidden;
  position:relative;
}

.portal-hero::before,
.panel::before,
.small-card::before,
.metric::before,
.sheet::before,
.drawer::before{
  content:"";
  position:absolute;
  inset:0 0 auto 0;
  height:1px;
  background:linear-gradient(90deg, transparent, rgba(255,255,255,.22), transparent);
  pointer-events:none;
}

.crumbs{
  display:inline-flex;
  align-items:center;
  gap:8px;
  width:max-content;
  max-width:100%;
  padding:.42rem .82rem;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.04);
  color:rgba(255,255,255,.76);
  font-size:12px;
  font-weight:800;
}

.eyebrow{
  margin-top:14px;
  color:rgba(255,255,255,.72);
  font-size:12px;
  font-weight:900;
  letter-spacing:.16em;
  text-transform:uppercase;
}

.title{
  margin-top:10px;
  font-size:clamp(2.2rem, 4vw, 3.2rem);
  line-height:1;
  font-weight:900;
  color:var(--white);
}

.title .grad{
  background:linear-gradient(90deg, var(--primary), var(--primary-light));
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}

.hero-note{
  margin-top:14px;
  max-width:720px;
  color:var(--portal-soft);
  line-height:1.65;
}

.hero-pills{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:18px;
}

.hero-pills span{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:.68rem .92rem;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.03);
  font-weight:800;
}

.userbox{
  display:grid;
  align-content:space-between;
  gap:14px;
  position:relative;
  padding:20px;
  border-radius:24px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.03);
  min-height:100%;
}

.userbox::after{
  content:"Account";
  position:absolute;
  top:18px;
  right:20px;
  font-size:11px;
  color:rgba(255,255,255,.52);
  letter-spacing:.14em;
  text-transform:uppercase;
  font-weight:900;
}

.avatar{
  width:58px;
  height:58px;
  border-radius:20px;
  display:grid;
  place-items:center;
  font-size:1.25rem;
  font-weight:900;
  color:#111;
  background:linear-gradient(135deg, var(--primary), var(--primary-light));
  box-shadow:0 18px 34px rgba(255,106,0,.24);
}

.userbtn{
  display:inline-flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  width:100%;
  padding:.88rem 1rem;
  border-radius:18px;
  border:1px solid var(--portal-line);
  background:rgba(255,255,255,.04);
  color:#fff;
  cursor:pointer;
  font-weight:900;
}

.userbtn:hover{ background:rgba(255,255,255,.08); }

.userdrop{
  position:absolute;
  right:0;
  top:calc(100% + 10px);
  width:min(300px, 92vw);
  background:rgba(14,14,17,.96);
  border:1px solid var(--portal-line);
  border-radius:20px;
  box-shadow:var(--portal-shadow);
  display:none;
  overflow:hidden;
  z-index:50;
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
}

.userdrop.show{ display:block; }
.userdrop a,
.userdrop button{
  width:100%;
  display:flex;
  align-items:center;
  gap:10px;
  padding:.82rem 1rem;
  background:transparent;
  border:0;
  color:#fff;
  text-decoration:none;
  cursor:pointer;
  font-weight:800;
}
.userdrop a:hover,
.userdrop button:hover{ background:rgba(255,255,255,.06); }

.portal-main{
  margin-top:18px;
  padding-bottom:60px;
}

.alert{
  margin-bottom:18px;
  border:1px solid var(--portal-line);
  border-left:4px solid var(--primary);
  border-radius:22px;
  background:linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.025));
  padding:16px 18px;
  display:flex;
  align-items:center;
  gap:14px;
  box-shadow:var(--portal-shadow);
}

.alert .go{
  margin-left:auto;
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:.82rem 1rem;
  border-radius:16px;
  background:linear-gradient(135deg, var(--primary), var(--primary-light));
  color:#111;
  font-weight:900;
  text-decoration:none;
}

.grid{ display:grid; gap:18px; }
.cols-2{ grid-template-columns:320px minmax(0, 1fr); align-items:start; }
.portal-side,
.portal-content{ display:grid; gap:18px; }

.small-card,
.panel,
.metric,
.sheet,
.drawer{
  position:relative;
  border:1px solid var(--portal-line);
  border-radius:26px;
  background:linear-gradient(180deg, rgba(20,20,24,.88), rgba(12,12,14,.94));
  box-shadow:var(--portal-shadow);
  overflow:hidden;
}

.small-card .cap,
.panel .head{
  padding:16px 18px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  border-bottom:1px solid var(--portal-line-2);
}

.small-card .cap{
  font-size:13px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:rgba(255,255,255,.78);
}

.small-card .body,
.panel .body{ padding:18px; }

.side-note{
  color:var(--portal-soft);
  line-height:1.6;
}

.pin{
  font-weight:900;
  font-size:clamp(2rem, 4vw, 3rem);
  line-height:1;
  background:linear-gradient(90deg, var(--primary), var(--primary-light));
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}

.metrics{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:14px;
}

.metric{
  padding:18px;
  display:grid;
  gap:8px;
}

.metric::after{
  content:"";
  position:absolute;
  right:18px;
  top:18px;
  width:42px;
  height:42px;
  border-radius:14px;
  background:linear-gradient(135deg, rgba(255,106,0,.16), rgba(255,255,255,.04));
  border:1px solid rgba(255,255,255,.08);
}

.metric .k{
  color:rgba(255,255,255,.68);
  font-weight:800;
}

.metric .v{
  font-weight:900;
  font-size:clamp(1.9rem, 4vw, 2.5rem);
  line-height:1;
}

.panel-copy{
  display:grid;
  gap:8px;
}

.panel-copy h3{
  margin:0;
  font-size:1.4rem;
}

.panel-copy p,
.muted,
.note{
  color:var(--portal-soft);
  line-height:1.6;
}

.tabs{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.tab{
  padding:.7rem 1rem;
  border-radius:999px;
  border:1px solid var(--portal-line);
  background:rgba(255,255,255,.04);
  cursor:pointer;
  color:#fff;
  font-weight:900;
  transition:transform .18s ease, background .18s ease;
}

.tab:hover{ transform:translateY(-1px); background:rgba(255,255,255,.07); }
.tab.active{
  background:linear-gradient(135deg, var(--primary), var(--primary-light));
  color:#111;
  border-color:rgba(255,255,255,.10);
}

.table{
  border:1px solid var(--portal-line-2);
  border-radius:22px;
  overflow:auto;
  background:linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
}

table{ width:100%; border-collapse:separate; border-spacing:0; }
th, td{
  padding:14px 16px;
  border-bottom:1px solid rgba(255,255,255,.06);
  text-align:left;
  vertical-align:top;
}
th{
  background:rgba(255,255,255,.045);
  font-size:12px;
  font-weight:900;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:rgba(255,255,255,.78);
}
tr:hover td{ background:rgba(255,255,255,.03); }
tr:last-child td{ border-bottom:0; }
.mono{ font-family:ui-monospace, Menlo, Consolas, monospace; }

.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:.34rem .72rem;
  border-radius:999px;
  border:1px solid var(--portal-line);
  background:rgba(255,255,255,.04);
  font-weight:900;
  font-size:12px;
}
.badge.paid{ border-color:rgba(155,235,117,.30); background:rgba(155,235,117,.10); color:#b6f593; }
.badge.pending{ border-color:rgba(255,194,0,.32); background:rgba(255,194,0,.10); color:#ffd47c; }
.badge.failed{ border-color:rgba(255,90,90,.30); background:rgba(255,90,90,.10); color:#ffaaaa; }

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:.82rem 1rem;
  border-radius:17px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.045);
  color:#fff;
  text-decoration:none;
  cursor:pointer;
  font-weight:900;
  transition:transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.btn:hover{ transform:translateY(-1px); background:rgba(255,255,255,.08); }
.btn.primary{
  background:linear-gradient(135deg, var(--primary), var(--primary-light));
  color:#111;
  border-color:rgba(255,255,255,.12);
  box-shadow:0 16px 34px rgba(255,106,0,.22);
}
.btn.blue{
  background:linear-gradient(135deg, rgba(87,129,255,.95), rgba(114,165,255,.95));
  color:#07101d;
}
.btn.ghost{ background:transparent; }

.input,
.select,
.textarea,
input.input,
select.input,
textarea.input{
  width:100%;
  min-height:54px;
  padding:.9rem 1rem;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.10);
  background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.025));
  color:#fff;
  outline:none;
}

.input::placeholder,
.textarea::placeholder{ color:rgba(255,255,255,.5); }
.input:focus,
.select:focus,
.textarea:focus,
input.input:focus,
select.input:focus,
textarea.input:focus{
  border-color:rgba(255,140,66,.35);
  box-shadow:0 0 0 4px rgba(255,106,0,.10);
}

.row{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }

.backdrop{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.62);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  display:none;
  z-index:80;
}

.modal{
  position:fixed;
  inset:0;
  display:none;
  place-items:center;
  z-index:90;
  padding:20px;
}

.sheet{
  width:min(760px, 96vw);
}
.sheet.sheet-wide{ max-width:960px; }
.sheet .head,
.drawer .head{
  padding:18px 20px;
  border-bottom:1px solid rgba(255,255,255,.08);
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.sheet .head h3,
.drawer .head h3{ margin:0; }
.sheet .body,
.drawer .body{ padding:20px; }
.drawer{
  position:fixed;
  top:0;
  right:0;
  height:100vh;
  width:min(480px, 92vw);
  transform:translateX(110%);
  transition:transform .22s ease-out;
  z-index:95;
  border-radius:0;
  overflow:auto;
}
.drawer.open{ transform:translateX(0); }

.form{ display:grid; gap:12px; }
.form .row{ display:flex; gap:10px; justify-content:flex-end; flex-wrap:wrap; }

.thread{ display:grid; gap:14px; }
.chat{
  display:flex;
  flex-direction:column;
  gap:12px;
  max-height:56vh;
  overflow:auto;
  padding:14px;
  border-radius:22px;
  border:1px solid var(--portal-line-2);
  background:linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
}

.bubble{
  max-width:min(760px, 82%);
  padding:12px 14px;
  border-radius:18px;
  border:1px solid var(--portal-line-2);
  background:rgba(255,255,255,.03);
  box-shadow:0 10px 24px rgba(0,0,0,.18);
  margin:8px 0;
}
.bubble .meta{
  display:flex;
  justify-content:space-between;
  gap:10px;
  font-size:12px;
  opacity:.8;
  margin-bottom:6px;
}
.bubble.user,
.bubble.me{
  margin-left:auto;
  border-color:rgba(255,140,66,.28);
  background:rgba(255,106,0,.10);
}
.bubble.staff{ margin-right:auto; }

.sd-actions{ display:flex; align-items:center; gap:10px; }

@media (max-width: 1080px){
  .portal-hero{ grid-template-columns:1fr; }
  .cols-2{ grid-template-columns:1fr; }
}

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

@media (max-width: 640px){
  .wrap{ padding:0 14px; }
  .portal-hero,
  .small-card,
  .panel,
  .metric,
  .sheet,
  .drawer{ border-radius:22px; }
  .portal-hero,
  .small-card .body,
  .panel .body,
  .sheet .body,
  .drawer .body{ padding:16px; }
  .small-card .cap,
  .panel .head,
  .sheet .head,
  .drawer .head{ padding:16px; }
  .metrics{ grid-template-columns:1fr; }
  .row{ grid-template-columns:1fr; }
}
