/* =========================================================
   My Workspace + Company Profile + Invoice
   ========================================================= */
.ws { display: grid; grid-template-columns: 264px 1fr; gap: 1.6rem; max-width: var(--maxw); margin: clamp(1.5rem,3vw,2.5rem) auto clamp(4rem,8vw,6rem); padding: 0 1.5rem; align-items: start; }

/* ---- Sidebar ---- */
.ws__side { position: sticky; top: 90px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 1rem; box-shadow: var(--shadow-sm); }
.ws__me { display: flex; align-items: center; gap: .8rem; padding: .4rem .4rem 1rem; border-bottom: 1px solid var(--line); margin-bottom: .8rem; }
.ws__avatar { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-head); font-weight: 500; font-size: 1.2rem; color: #fff; background: linear-gradient(135deg, var(--indigo), #6a4bff); }
.ws__me-txt { min-width: 0; }
.ws__me-txt strong { display: block; font-weight: 500; font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws__me-txt span { display: block; font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws__nav { display: flex; flex-direction: column; gap: .2rem; }
.ws__navi { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .7rem .8rem; border: none; background: none; border-radius: 10px; cursor: pointer; font-family: inherit; font-size: .95rem; color: var(--ink-soft); text-align: left; transition: background .15s var(--ease), color .15s var(--ease); }
.ws__navi:hover { background: #f5f5fb; color: var(--ink); }
.ws__navi.is-active { background: rgba(58,54,224,.08); color: var(--indigo); font-weight: 500; }
.ws__navi svg { flex: none; }
.ws__navi--out { color: #c0392b; margin-top: .4rem; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; padding-top: .9rem; }
.ws__navi--out:hover { background: #fdecea; color: #c0392b; }

/* ---- Main ---- */
.ws__main { min-width: 0; }
.ws-panel[hidden] { display: none; }
.ws-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }
.ws-head h1 { font-family: var(--font-head); font-weight: 500; font-size: clamp(1.5rem,3.4vw,2.1rem); letter-spacing: -.02em; }
.ws-lead { color: var(--ink-soft); margin-bottom: 1.2rem; max-width: 60ch; }
.ws-empty { text-align: center; padding: clamp(2.5rem,7vw,5rem) 1rem; color: var(--ink-soft); display: grid; gap: 1.2rem; justify-items: center; background: #fff; border: 1px dashed var(--line); border-radius: 16px; }

/* My Reports cards */
.ws-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 1.1rem; }
.ws-rcard { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 1.3rem; box-shadow: var(--shadow-sm); transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s; }
.ws-rcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #d6d4f5; }
.ws-rcard__badge { align-self: flex-start; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; padding: .25rem .6rem; border-radius: 999px; margin-bottom: .8rem; }
.ws-rcard__badge.is-paid { background: #eafaf2; color: #138a55; }
.ws-rcard__badge.is-free { background: #fff1e9; color: #d2691b; }
.ws-rcard__badge.is-draft { background: #eef0ff; color: #3a36e0; }
.ws-rcard--draft { border-style: dashed; border-color: #cfcdf3; }
.ws-rcard h3 { font-family: var(--font-head); font-weight: 500; font-size: 1.15rem; line-height: 1.25; color: var(--ink); }
.ws-rcard__meta { font-size: .82rem; color: var(--muted); margin-top: .5rem; }
.ws-rcard__ref { font-family: var(--font-mono); font-size: .76rem; color: var(--ink-soft); margin-top: .3rem; }
.ws-rcard__open { margin-top: 1rem; color: var(--indigo); font-weight: 500; font-size: .9rem; }

/* Companies */
.ws-list { display: flex; flex-direction: column; gap: .6rem; }
.ws-co { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: .9rem 1.1rem; }
.ws-co__main { display: flex; align-items: center; gap: .9rem; min-width: 0; }
.ws-co__logo { width: 40px; height: 40px; flex: none; border-radius: 10px; display: grid; place-items: center; background: #eef0ff; color: var(--indigo); font-weight: 500; }
.ws-co__main strong { display: block; font-weight: 500; }
.ws-co__main span { display: block; font-size: .82rem; color: var(--muted); }
.ws-co__act { display: flex; align-items: center; gap: .8rem; flex: none; }
.ws-co__ref { font-family: var(--font-mono, monospace); font-size: .72rem; color: var(--muted); }
.ws-co__badge { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; padding: .25rem .6rem; border-radius: 999px; }
.ws-co__badge.is-ok { background: #eafaf2; color: #138a55; }
.ws-co__badge.is-wait { background: #f1f1f8; color: var(--muted); }
.btn--sm { padding: .45rem 1rem; font-size: .85rem; }

/* Tables (orders) */
.ws-table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.ws-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.ws-table th { text-align: left; font-weight: 500; color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
.ws-table td { padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
.ws-table tr:last-child td { border-bottom: none; }
.ws-mono { font-family: var(--font-mono); font-size: .85rem; }
.ws-status { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; padding: .22rem .6rem; border-radius: 999px; }
.ws-status.is-paid { background: #eafaf2; color: #138a55; }
.ws-status.is-pending { background: #fff5e6; color: #b8791c; }
.ws-link { color: var(--indigo); font-weight: 500; }

/* Team */
.ws-invite { display: flex; gap: .6rem; max-width: 520px; }
.ws-invite input { flex: 1; border: 1.5px solid var(--line); border-radius: 12px; padding: .75rem 1rem; outline: none; font: inherit; }
.ws-invite input:focus { border-color: var(--indigo); }
.ws-err { color: #d6334b; font-size: .85rem; margin-top: .5rem; }
.ws-members { margin-top: 1.6rem; max-width: 600px; display: flex; flex-direction: column; gap: .5rem; }
.ws-member { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1.1rem; }
.ws-member strong { display: block; font-weight: 500; }
.ws-member span { font-size: .8rem; color: var(--muted); }
.ws-member--owner { background: #f7f7ff; }
.ws-revoke { background: none; border: none; color: #c0392b; cursor: pointer; font-size: .85rem; }

/* Settings */
.ws-form { max-width: 680px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: clamp(1.3rem,3vw,2rem); }
.ws-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.ws-form label { display: block; font-size: .85rem; color: var(--ink-soft); margin-bottom: 1rem; }
.ws-form input, .ws-form textarea { width: 100%; margin-top: .35rem; border: 1.5px solid var(--line); border-radius: 10px; padding: .7rem .9rem; font: inherit; outline: none; }
.ws-form input:focus, .ws-form textarea:focus { border-color: var(--indigo); }
.ws-form input:disabled { background: #f6f6fa; color: var(--muted); }
.ws-hr { border: none; border-top: 1px solid var(--line); margin: .4rem 0 1.2rem; }
.ws-sub { font-weight: 500; margin-bottom: 1rem; }
.ws-form__foot { display: flex; align-items: center; gap: 1rem; }
.ws-saved { color: #138a55; font-size: .9rem; }

/* Support */
.ws-support { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 1rem; max-width: 640px; }
.ws-supcard { display: flex; align-items: center; gap: 1rem; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 1.3rem; box-shadow: var(--shadow-sm); transition: transform .2s var(--ease), box-shadow .2s; }
.ws-supcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.ws-supcard__ic { width: 46px; height: 46px; flex: none; border-radius: 12px; display: grid; place-items: center; background: #eef0ff; color: var(--indigo); font-size: 1.3rem; }
.ws-supcard strong { display: block; font-weight: 500; }
.ws-supcard span { font-size: .9rem; color: var(--ink-soft); }
.ws-note { color: var(--muted); font-size: .88rem; margin-top: 1.2rem; }

/* ---- Company profile + invoice pages ---- */
.cp, .inv { max-width: 920px; margin: clamp(1.5rem,3vw,2.5rem) auto clamp(4rem,8vw,6rem); padding: 0 1.5rem; }
.cp__bar, .inv__bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.4rem; }
.cp__doc { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: clamp(1.6rem,4vw,3rem); box-shadow: var(--shadow-sm); }
.cp__title { font-family: var(--font-head); font-weight: 500; letter-spacing: -.02em; font-size: clamp(1.6rem,3.6vw,2.4rem); margin: .4rem 0 1.4rem; }

.inv__doc { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: clamp(1.6rem,4vw,3rem); box-shadow: var(--shadow-sm); }
.inv__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding-bottom: 1.6rem; border-bottom: 1px solid var(--line); }
.inv__org { color: var(--muted); font-size: .85rem; margin-top: .3rem; }
.inv__title { text-align: right; }
.inv__title h1 { font-family: var(--font-head); font-weight: 500; font-size: 1.8rem; }
.inv__rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 1rem; padding: 1.6rem 0; }
.inv__rows span { display: block; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .25rem; }
.inv__paid { color: #138a55; }
.inv__table { width: 100%; border-collapse: collapse; margin-top: .5rem; }
.inv__table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: .7rem 0; border-bottom: 1px solid var(--line); }
.inv__table td { padding: 1rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.inv__desc { color: var(--muted); font-size: .85rem; }
.inv__amt { text-align: right; white-space: nowrap; }
.inv__total-l { font-weight: 500; }
.inv__total { font-family: var(--font-head); font-size: 1.2rem; color: var(--ink); }
.inv__foot { color: var(--muted); font-size: .85rem; margin-top: 1.6rem; }

@media (max-width: 860px) {
  .ws { grid-template-columns: 1fr; }
  .ws__side { position: static; }
  .ws__nav { flex-direction: row; flex-wrap: wrap; }
  .ws__navi { width: auto; }
  .ws__navi--out { border-top: none; padding-top: .7rem; }
}
@media (max-width: 560px) {
  .ws-grid2 { grid-template-columns: 1fr; }
  .ws-invite { flex-direction: column; }
}

/* ---- Company view (purchased CP) ---- */
.cv { max-width: 920px; margin: clamp(1.5rem,3vw,2.5rem) auto clamp(4rem,8vw,6rem); padding: 0 1.5rem; }
.cv__bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.4rem; }
.cv__doc { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: clamp(1.6rem,4vw,3rem); box-shadow: var(--shadow-sm); }
.cv__title { font-family: var(--font-head); font-weight: 500; letter-spacing: -.02em; font-size: clamp(1.6rem,3.6vw,2.4rem); margin: .4rem 0 1.4rem; }
.cv__lock { max-width: 480px; margin: clamp(3rem,8vw,6rem) auto; text-align: center; }
.cv__lock-ic { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 1.2rem; background: rgba(58,54,224,.1); color: var(--indigo); }
.cv__lock h1 { font-family: var(--font-head); font-weight: 500; font-size: 1.6rem; margin-bottom: .6rem; }
.cv__lock p { color: var(--ink-soft); line-height: 1.6; margin-bottom: 1.4rem; }

/* Print (invoice + company profile) */
@media print {
  .nav, .foot, .announce, .ws-print-actions, .rvdesk__fab, .rvdesk { display: none !important; }
  .cp__doc, .inv__doc, .cv__doc { border: none; box-shadow: none; padding: 0; }
  body { background: #fff; }
}

/* =========================================================
   TEAM TAB — redesigned invite + members (wt-*)
   ========================================================= */
.wt-card {
  max-width: 620px; background: #fff; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 10px 34px rgba(16,18,60,.06); padding: 20px 22px 18px; margin-top: .4rem;
  position: relative; overflow: hidden;
}
.wt-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--indigo), #7a5cff 55%, #b44de0); }
.wt-card__head { display: flex; align-items: center; gap: .85rem; }
.wt-card__icon { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 12px;
  color: #fff; background: linear-gradient(135deg, var(--indigo), #7a5cff); box-shadow: 0 8px 18px rgba(58,54,224,.28); }
.wt-card__t { flex: 1; min-width: 0; }
.wt-card__t b { display: block; font-weight: 500; font-size: 1.02rem; color: var(--ink); }
.wt-card__t span { display: block; font-size: .82rem; color: var(--muted); margin-top: .1rem; }
.wt-quota { flex: none; font-size: .82rem; color: var(--muted); background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 999px; padding: .3rem .7rem; }
.wt-quota b { color: var(--indigo); font-weight: 500; }

.wt-form { display: flex; gap: .6rem; margin-top: 1.1rem; }
.wt-field { flex: 1; display: flex; align-items: center; gap: .55rem;
  border: 1.5px solid var(--line); border-radius: 12px; padding: 0 .9rem; background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease; }
.wt-field svg { color: #9499b0; flex: none; }
.wt-field:focus-within { border-color: var(--indigo); box-shadow: 0 0 0 4px rgba(58,54,224,.1); }
.wt-field input { flex: 1; border: 0; outline: none; font: inherit; padding: .75rem 0; background: none; color: var(--ink); }
.wt-form .btn { flex: none; }
.wt-form .btn:disabled { opacity: .55; cursor: not-allowed; }

.wt-bar { height: 6px; border-radius: 99px; background: #edeef6; margin-top: 1rem; overflow: hidden; }
.wt-bar i { display: block; height: 100%; border-radius: 99px; width: 0;
  background: linear-gradient(90deg, var(--indigo), #7a5cff); transition: width .4s var(--ease, ease); }

.wt-msg { margin-top: .8rem; font-size: .86rem; padding: .5rem .8rem; border-radius: 9px; }
.wt-msg--ok  { color: #0e7a4f; background: rgba(18,183,106,.09); border: 1px solid rgba(18,183,106,.22); }
.wt-msg--err { color: #c0392b; background: rgba(214,51,75,.08); border: 1px solid rgba(214,51,75,.2); }

.wt-listhead { margin: 1.8rem 0 .8rem; font-size: .78rem; font-weight: 500; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); }
.wt-list { max-width: 620px; display: flex; flex-direction: column; gap: .55rem; }
.wt-member { display: flex; align-items: center; gap: .85rem; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: .7rem .9rem; transition: border-color .15s ease, box-shadow .15s ease; }
.wt-member:hover { border-color: #d7d9ea; box-shadow: 0 6px 18px rgba(16,18,60,.05); }
.wt-member--owner { background: linear-gradient(180deg, #f7f7ff, #fbfbff); border-color: rgba(58,54,224,.18); }
.wt-ava { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%;
  font-size: .95rem; font-weight: 500; color: #fff; background: linear-gradient(135deg, #7a5cff, #b44de0); }
.wt-ava--owner { background: linear-gradient(135deg, var(--navy), var(--indigo)); }
.wt-member__id { flex: 1; min-width: 0; }
.wt-member__id b { display: block; font-weight: 500; font-size: .94rem; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wt-member__id span { display: block; font-size: .78rem; color: var(--muted); margin-top: .1rem; }
.wt-badge { flex: none; font-size: .7rem; font-weight: 500; letter-spacing: .04em; text-transform: uppercase;
  border-radius: 999px; padding: .28rem .6rem; }
.wt-badge--owner  { color: var(--indigo); background: rgba(58,54,224,.1); }
.wt-badge--invited{ color: #a15c00; background: rgba(245,166,35,.14); }
.wt-badge--active { color: #0e7a4f; background: rgba(18,183,106,.12); }
.wt-revoke { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  border: 1px solid transparent; background: none; color: #b0b3c6; cursor: pointer;
  transition: color .15s ease, background .15s ease, border-color .15s ease; }
.wt-revoke:hover { color: #c0392b; background: rgba(214,51,75,.08); border-color: rgba(214,51,75,.2); }

@media (max-width: 560px) {
  .wt-form { flex-direction: column; }
  .wt-form .btn { width: 100%; }
}
