:root{
  --orange:#c96148;
  --orange-dark:#ad4f3b;
  --cream:#f1e9df;
  --paper:#fffdf9;
  --ink:#171313;
  --muted:#6a5f5c;
  --line:rgba(23,19,19,.09);
  --shadow:0 26px 70px rgba(17,17,17,.10);
  --success:#4e8b66;
  --warning:#d79b42;
  --danger:#b95353;
}
*{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{
  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:var(--ink);
  background:
    radial-gradient(circle at 10% 8%,rgba(201,97,72,.10),transparent 25%),
    linear-gradient(180deg,#fbf7f5 0%,#fff 100%);
  min-height:100vh;
}
a{text-decoration:none;color:inherit}
button,input,textarea,select{font:inherit}
button{cursor:pointer}
img,video{max-width:100%;display:block}
.portal-shell{min-height:100vh}
.portal-header{
  position:sticky;top:0;z-index:50;
  background:rgba(241,233,223,.92);
  backdrop-filter:blur(16px);
  border-bottom:1px solid var(--line);
}
.portal-nav{
  width:min(1180px,calc(100% - 32px));
  min-height:78px;margin:auto;
  display:flex;align-items:center;justify-content:space-between;gap:18px;
}
.portal-logo img{width:150px;height:auto}
.nav-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.portal-main{width:min(1180px,calc(100% - 32px));margin:0 auto;padding:42px 0 70px}
.portal-hero{
  display:grid;grid-template-columns:1fr auto;gap:24px;align-items:center;
  margin-bottom:30px
}
.eyebrow{
  color:var(--orange);font-size:12px;font-weight:800;letter-spacing:.12em;
  text-transform:lowercase;margin-bottom:10px
}
h1,h2,h3{font-family:"DM Serif Display",Georgia,serif;font-weight:400}
h1{font-size:clamp(42px,6vw,70px);line-height:.95;letter-spacing:-.035em}
h2{font-size:clamp(30px,4vw,46px);line-height:1}
h3{font-size:26px;line-height:1.05}
.lead{color:var(--muted);font-size:16px;line-height:1.7;max-width:690px;margin-top:14px}
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  min-height:44px;padding:11px 18px;border:none;border-radius:999px;
  background:linear-gradient(135deg,var(--orange),var(--orange-dark));
  color:white;font-weight:700;
  box-shadow:0 12px 28px rgba(201,97,72,.23);
  transition:.22s ease
}
.btn:hover{transform:translateY(-2px);box-shadow:0 18px 34px rgba(201,97,72,.28)}
.btn.secondary{
  background:white;color:var(--ink);border:1px solid var(--line);box-shadow:none
}
.btn.ghost{background:transparent;color:var(--orange);box-shadow:none;border:1px solid rgba(201,97,72,.22)}
.btn.success{background:linear-gradient(135deg,#5e9a74,#417c5b)}
.btn.danger{background:linear-gradient(135deg,#c96969,#aa4f4f)}
.btn.small{min-height:38px;padding:9px 14px;font-size:13px}
.grid{display:grid;gap:18px}
.stats-grid{grid-template-columns:repeat(4,1fr);margin-bottom:28px}
.stat-card,.panel,.content-card,.client-card{
  background:rgba(255,255,255,.86);
  border:1px solid var(--line);
  border-radius:26px;
  box-shadow:0 18px 46px rgba(17,17,17,.07);
}
.stat-card{padding:22px}
.stat-value{font-family:"DM Serif Display",Georgia,serif;font-size:42px;color:var(--orange)}
.stat-label{font-size:13px;color:var(--muted);font-weight:700;margin-top:2px}
.panel{padding:26px}
.panel-head{
  display:flex;align-items:center;justify-content:space-between;gap:14px;
  margin-bottom:20px
}
.panel-head p{color:var(--muted);font-size:14px;margin-top:6px}
.client-grid{grid-template-columns:repeat(3,1fr)}
.client-card{padding:20px;transition:.22s ease;cursor:pointer}
.client-card:hover{transform:translateY(-4px);box-shadow:0 24px 58px rgba(17,17,17,.1)}
.client-card-top{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.client-name{font-weight:800;font-size:17px}
.client-email{font-size:13px;color:var(--muted);margin-top:4px}
.client-meta{display:flex;gap:8px;flex-wrap:wrap;margin-top:18px}
.chip{
  display:inline-flex;align-items:center;justify-content:center;
  border-radius:999px;padding:7px 10px;font-size:11px;font-weight:800;
  background:var(--cream);color:var(--orange)
}
.chip.pending{background:#fff2dd;color:#9a671e}
.chip.approved{background:#e9f5ed;color:#39704d}
.chip.changes{background:#fbe7e7;color:#a14747}
.chip.scheduled{background:#e9eef9;color:#4d6190}
.toolbar{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.field{display:grid;gap:7px}
.field label{font-size:12px;font-weight:800;color:#433a38}
.input,textarea,select{
  width:100%;border:1px solid rgba(17,17,17,.12);border-radius:14px;
  padding:12px 13px;background:white;color:var(--ink);outline:none;
  transition:border-color .2s ease,box-shadow .2s ease
}
.input:focus,textarea:focus,select:focus{
  border-color:rgba(201,97,72,.55);
  box-shadow:0 0 0 4px rgba(201,97,72,.10)
}
textarea{resize:vertical;min-height:120px}
.form-grid{grid-template-columns:1fr 1fr}
.form-grid .full{grid-column:1/-1}
.upload-zone{
  border:1.5px dashed rgba(201,97,72,.36);
  border-radius:18px;padding:22px;text-align:center;background:rgba(241,233,223,.38)
}
.upload-zone input{margin-top:10px;max-width:100%}
.content-grid{grid-template-columns:repeat(3,1fr)}
.content-card{overflow:hidden;display:flex;flex-direction:column}
.content-media{
  aspect-ratio:4/3;background:#f5f0ec;display:grid;place-items:center;
  overflow:hidden;position:relative
}
.content-media img,.content-media video{width:100%;height:100%;object-fit:cover}
.content-placeholder{color:var(--muted);font-size:13px;text-align:center;padding:20px}
.content-body{padding:18px;display:grid;gap:13px;flex:1}
.content-top{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}
.content-title{font-weight:800;font-size:16px}
.content-sub{font-size:12px;color:var(--muted);margin-top:4px}
.caption{
  color:#443b39;font-size:13px;line-height:1.6;
  background:#fbf8f6;border-radius:14px;padding:12px;
  white-space:pre-wrap;overflow-wrap:anywhere
}
.feedback{
  background:#fff4e9;border:1px solid rgba(215,155,66,.22);
  border-radius:14px;padding:12px;font-size:13px;line-height:1.55
}
.card-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:auto}
.empty-state{
  text-align:center;padding:48px 20px;color:var(--muted);
  border:1px dashed rgba(17,17,17,.12);border-radius:22px
}
.auth-page{
  min-height:100vh;display:grid;grid-template-columns:1fr 1fr;background:var(--cream)
}
.auth-art{
  position:relative;padding:48px;display:flex;flex-direction:column;justify-content:space-between;
  background:
    radial-gradient(circle at 80% 20%,rgba(201,97,72,.14),transparent 24%),
    linear-gradient(145deg,#f1e9df,#f8f2eb)
}
.auth-art img{width:190px}
.auth-copy h1{max-width:540px}
.auth-card-wrap{display:grid;place-items:center;padding:26px;background:white}
.auth-card{
  width:min(470px,100%);padding:34px;border-radius:28px;background:#fff;
  border:1px solid var(--line);box-shadow:var(--shadow)
}
.auth-card h2{margin-bottom:8px}
.auth-card .lead{font-size:14px;margin:0 0 24px}
.auth-card form{display:grid;gap:14px}
.auth-help{font-size:12px;color:var(--muted);line-height:1.5;margin-top:14px}
.message{
  display:none;padding:11px 12px;border-radius:12px;font-size:13px;line-height:1.45
}
.message.show{display:block}
.message.error{background:#fbe8e8;color:#8f3f3f}
.message.success{background:#e9f5ed;color:#386b4a}
.modal{
  position:fixed;inset:0;z-index:100;display:grid;place-items:center;padding:18px;
  background:rgba(17,17,17,.42);backdrop-filter:blur(8px);
  opacity:0;visibility:hidden;transition:.22s ease
}
.modal.active{opacity:1;visibility:visible}
.modal-card{
  width:min(680px,100%);max-height:90vh;overflow:auto;
  background:var(--paper);border-radius:26px;padding:26px;
  box-shadow:0 34px 90px rgba(0,0,0,.2)
}
.modal-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;margin-bottom:18px}
.close-btn{
  width:36px;height:36px;border:none;border-radius:50%;background:white;color:var(--orange);
  box-shadow:0 8px 20px rgba(0,0,0,.08);font-size:22px
}
.loading{opacity:.55;pointer-events:none}
.notice{
  padding:12px 14px;border-radius:14px;background:#fff8ed;color:#7c5924;
  font-size:13px;line-height:1.5;margin-bottom:18px;border:1px solid rgba(215,155,66,.2)
}
.hidden{display:none!important}



.media-preview-trigger{
  position:relative;
  width:100%;
  height:100%;
  border:0;
  padding:0;
  background:transparent;
  display:block;
  cursor:zoom-in;
  overflow:hidden;
}
.media-preview-trigger img,
.media-preview-trigger video{
  width:100%;
  height:100%;
  object-fit:cover;
  transition:transform .28s ease, filter .28s ease;
}
.media-preview-trigger:hover img,
.media-preview-trigger:hover video{
  transform:scale(1.035);
  filter:brightness(.92);
}
.preview-badge{
  position:absolute;
  left:50%;
  bottom:12px;
  transform:translateX(-50%) translateY(5px);
  background:rgba(17,17,17,.78);
  color:#fff;
  border-radius:999px;
  padding:7px 11px;
  font-size:11px;
  font-weight:800;
  white-space:nowrap;
  opacity:0;
  transition:.2s ease;
  backdrop-filter:blur(8px);
}
.media-preview-trigger:hover .preview-badge{
  opacity:1;
  transform:translateX(-50%) translateY(0);
}

/* full-size client preview */
.media-preview-modal{
  position:fixed;
  inset:0;
  z-index:200;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
  overflow:hidden;
}
.media-preview-card{
  position:relative;
  width:min(1200px,94vw);
  height:90vh;
  max-height:900px;
  background:rgba(17,17,17,.97);
  border-radius:26px;
  box-shadow:0 34px 100px rgba(0,0,0,.40);
  overflow:hidden;
}
.media-preview-close{
  position:absolute;
  top:14px;
  right:14px;
  z-index:10;
  background:rgba(255,255,255,.94);
}
.media-preview-stage{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  overflow:hidden;
}
.media-preview-stage img,
.media-preview-stage video{
  display:block;
  width:100%;
  height:100%;
  max-width:100%;
  max-height:100%;
  object-fit:contain;
  object-position:center;
  border-radius:14px;
}

@media(max-width:600px){
  .media-preview-modal{
    padding:8px;
  }
  .media-preview-card{
    width:96vw;
    height:92vh;
    max-height:none;
    border-radius:18px;
  }
  .media-preview-stage{
    padding:12px;
  }
  .media-preview-stage img,
  .media-preview-stage video{
    width:100%;
    height:100%;
    object-fit:contain;
  }
  .preview-badge{
    opacity:1;
    transform:translateX(-50%);
    bottom:10px;
  }
}


.approved-record{
  width:100%;
  height:100%;
  min-height:180px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:6px;
  background:
    radial-gradient(circle at 50% 40%,rgba(78,139,102,.10),transparent 34%),
    linear-gradient(145deg,#f7fbf8,#eef6f0);
  color:#4e735b;
  font-size:13px;
  line-height:1.5;
}
.approved-record strong{
  font-family:"DM Serif Display",Georgia,serif;
  font-size:25px;
  font-weight:400;
  color:#39704d;
}


.admin-card-media{
  position:relative;
  width:100%;
  height:100%;
}
.admin-card-media img,
.admin-card-media video{
  width:100%;
  height:100%;
  object-fit:cover;
}
.media-count-badge{
  position:absolute;
  right:12px;
  bottom:12px;
  z-index:3;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:7px 11px;
  border-radius:999px;
  background:rgba(17,17,17,.80);
  color:#fff;
  font-size:11px;
  font-weight:800;
  backdrop-filter:blur(8px);
  box-shadow:0 8px 20px rgba(0,0,0,.18);
}
.carousel-preview-nav{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  z-index:12;
  width:44px;
  height:44px;
  border:0;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:rgba(255,255,255,.92);
  color:var(--orange);
  font-size:30px;
  line-height:1;
  box-shadow:0 10px 28px rgba(0,0,0,.18);
}
.carousel-preview-nav.prev{left:16px}
.carousel-preview-nav.next{right:16px}
.carousel-preview-count{
  position:absolute;
  left:50%;
  bottom:14px;
  transform:translateX(-50%);
  z-index:12;
  min-width:64px;
  text-align:center;
  padding:7px 11px;
  border-radius:999px;
  background:rgba(17,17,17,.76);
  color:#fff;
  font-size:11px;
  font-weight:800;
  backdrop-filter:blur(8px);
}
@media(max-width:600px){
  .carousel-preview-nav{
    width:38px;
    height:38px;
    font-size:26px;
  }
  .carousel-preview-nav.prev{left:8px}
  .carousel-preview-nav.next{right:8px}
  .carousel-preview-count{bottom:10px}
}

@media(max-width:900px){
  .stats-grid{grid-template-columns:repeat(2,1fr)}
  .client-grid,.content-grid{grid-template-columns:repeat(2,1fr)}
  .portal-hero{grid-template-columns:1fr}
  .auth-page{grid-template-columns:1fr}
  .auth-art{min-height:320px}
}
@media(max-width:600px){
  .portal-main{padding-top:28px}
  .portal-nav{min-height:68px}
  .portal-logo img{width:125px}
  .stats-grid,.client-grid,.content-grid,.form-grid{grid-template-columns:1fr}
  .panel{padding:20px}
  .auth-art{padding:28px;min-height:260px}
  .auth-art img{width:150px}
  .auth-card-wrap{padding:16px}
  .auth-card{padding:24px}
  .nav-actions .btn.secondary{display:none}
}


/* on-demand post previews */
.admin-preview-launch,.lazy-preview-trigger{
  width:100%;height:100%;min-height:180px;border:0;padding:22px;background:linear-gradient(145deg,#f7f1ec,#fff);
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;color:var(--orange);cursor:pointer;text-align:center
}
.admin-preview-launch:hover,.lazy-preview-trigger:hover{background:#fff8f4}
.admin-preview-launch strong,.lazy-preview-trigger strong{font-size:13px}
.admin-preview-launch small,.lazy-preview-trigger small{font-size:11px;color:var(--muted)}
.admin-preview-icon{font-size:30px;line-height:1;margin-bottom:4px}
.preview-loading{color:#fff;font-size:13px;font-weight:700;opacity:.8}
.client-card-actions{margin-top:14px;padding-top:12px;border-top:1px solid rgba(17,17,17,.07)}
.client-card-actions .btn{width:100%}


.preview-loading{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:12px;
  min-height:180px;
}
.preview-loading::before{
  content:"";
  width:28px;
  height:28px;
  border-radius:50%;
  border:3px solid rgba(255,255,255,.24);
  border-top-color:#fff;
  animation:previewSpin .8s linear infinite;
}
@keyframes previewSpin{
  to{transform:rotate(360deg)}
}


.edit-content-modal{padding:20px;overflow:auto}
.edit-content-card{
  position:relative;
  width:min(760px,96vw);
  max-height:92vh;
  overflow:auto;
  background:#fff;
  border-radius:26px;
  padding:30px;
  box-shadow:0 34px 90px rgba(17,17,17,.24)
}
.edit-content-card h2{margin:4px 0 8px}
.edit-content-intro{color:var(--muted);font-size:13px;line-height:1.6;margin-bottom:20px}
.edit-content-card .form-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.edit-content-card label{display:grid;gap:7px;font-size:12px;font-weight:800}
.edit-content-card input,
.edit-content-card select,
.edit-content-card textarea{width:100%}
.full-width{grid-column:1/-1}
.optional-label{color:var(--muted);font-weight:500}
.edit-form-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:4px}
.card-actions{display:flex;gap:8px;flex-wrap:wrap}
@media(max-width:650px){
  .edit-content-card{padding:24px 18px;border-radius:20px}
  .edit-content-card .form-grid{grid-template-columns:1fr}
  .full-width{grid-column:auto}
  .edit-form-actions{flex-direction:column-reverse}
  .edit-form-actions .btn{width:100%}
}


/* first-image card previews */
.thumbnail-shell{
  position:relative;
  width:100%;
  height:220px;
  min-height:220px;
  border:0;
  padding:0;
  background:linear-gradient(145deg,#f7f1ec,#fff);
  overflow:hidden;
  cursor:pointer;
}
.thumbnail-shell img,
.thumbnail-shell video{
  display:block;
  width:100%;
  height:100%;
  height:220px;
  min-height:220px;
  object-fit:cover;
  transition:transform .25s ease,filter .25s ease;
}
.thumbnail-shell:hover img,
.thumbnail-shell:hover video{
  transform:scale(1.025);
  filter:brightness(.94);
}
.thumbnail-loading{
  min-height:220px;
  height:220px;
  width:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:6px;
  color:var(--orange);
}
.thumbnail-loading strong{
  font-size:13px;
}
.thumbnail-loading small{
  color:var(--muted);
  font-size:11px;
}
.thumbnail-shell .preview-badge,
.thumbnail-shell .media-count-badge{
  opacity:1;
}


.change-workspace-modal{
  padding:20px;
  overflow:auto;
}
.change-workspace-card{
  position:relative;
  width:min(1180px,96vw);
  height:min(88vh,860px);
  display:grid;
  grid-template-columns:minmax(0,1.15fr) minmax(320px,.85fr);
  background:#fff;
  border-radius:28px;
  overflow:hidden;
  box-shadow:0 34px 100px rgba(17,17,17,.30);
}
.change-workspace-close{
  position:absolute;
  top:14px;
  right:14px;
  z-index:20;
}
.change-preview-pane{
  position:relative;
  min-width:0;
  background:rgba(17,17,17,.97);
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
.change-preview-stage{
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:26px;
}
.change-preview-stage img,
.change-preview-stage video{
  display:block;
  width:100%;
  height:100%;
  max-width:100%;
  max-height:100%;
  object-fit:contain;
}
.change-feedback-pane{
  padding:42px 34px 30px;
  overflow:auto;
}
.change-feedback-pane h2{
  margin:6px 0 10px;
}
.change-workspace-copy{
  color:var(--muted);
  font-size:13px;
  line-height:1.6;
  margin-bottom:22px;
}
.change-feedback-pane form{
  display:grid;
  gap:10px;
}
.change-feedback-pane label{
  font-size:12px;
  font-weight:800;
}
.change-feedback-pane textarea{
  min-height:250px;
  resize:vertical;
  white-space:pre-wrap;
}
.change-workspace-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:8px;
}
@media(max-width:820px){
  .change-workspace-modal{
    padding:8px;
  }
  .change-workspace-card{
    width:98vw;
    height:94vh;
    grid-template-columns:1fr;
    grid-template-rows:minmax(300px,48vh) 1fr;
    border-radius:20px;
    overflow:auto;
  }
  .change-preview-pane{
    min-height:300px;
  }
  .change-preview-stage{
    padding:12px;
  }
  .change-feedback-pane{
    padding:26px 18px 20px;
  }
  .change-feedback-pane textarea{
    min-height:180px;
  }
  .change-workspace-actions{
    flex-direction:column-reverse;
  }
  .change-workspace-actions .btn{
    width:100%;
  }
}


/* invoice studio */
.active-nav-btn{
  border-color:rgba(201,97,72,.35)!important;
  color:var(--orange)!important;
  background:#fff8f4!important;
}
.invoice-page{
  display:grid;
  gap:24px;
}
.invoice-hero{
  align-items:end;
}
.invoice-builder,
.invoice-history-panel{
  margin-top:0;
}
.invoice-form{
  display:grid;
  gap:24px;
}
.invoice-form-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:16px;
}
.invoice-form label{
  display:grid;
  gap:7px;
  font-size:12px;
  font-weight:800;
}
.invoice-form input,
.invoice-form select,
.invoice-form textarea,
.status-select{
  width:100%;
  border:1px solid rgba(17,17,17,.10);
  border-radius:13px;
  padding:12px 13px;
  background:#fff;
  color:var(--ink);
  font:inherit;
  font-size:13px;
  outline:none;
  transition:border-color .2s ease,box-shadow .2s ease;
}
.invoice-form input:focus,
.invoice-form select:focus,
.invoice-form textarea:focus,
.status-select:focus{
  border-color:rgba(201,97,72,.55);
  box-shadow:0 0 0 3px rgba(201,97,72,.09);
}
.invoice-form textarea{
  resize:vertical;
  white-space:pre-wrap;
}
.invoice-form small{
  color:var(--muted);
  font-size:10px;
  font-weight:500;
}
.invoice-line-items-head{
  display:flex;
  justify-content:space-between;
  gap:18px;
  align-items:end;
  padding-top:4px;
}
.invoice-line-items-head h3{
  margin:0 0 4px;
  font-size:17px;
}
.invoice-line-items-head p{
  color:var(--muted);
  font-size:12px;
}
.invoice-line-items{
  display:grid;
  gap:10px;
}
.invoice-line-item{
  display:grid;
  grid-template-columns:minmax(0,1fr) 90px 150px 38px;
  gap:10px;
  align-items:end;
  padding:14px;
  border:1px solid rgba(17,17,17,.07);
  border-radius:17px;
  background:#fcfaf9;
}
.money-input{
  display:flex;
  align-items:center;
  border:1px solid rgba(17,17,17,.10);
  border-radius:13px;
  background:#fff;
  overflow:hidden;
}
.money-input span{
  padding-left:12px;
  color:var(--muted);
}
.money-input input{
  border:0!important;
  box-shadow:none!important;
  padding-left:6px!important;
}
.line-remove{
  width:38px;
  height:42px;
  border:0;
  border-radius:12px;
  background:#fff1ee;
  color:#a74736;
  font-size:22px;
  cursor:pointer;
}
.line-remove:hover{
  background:#a74736;
  color:#fff;
}
.invoice-full{
  grid-column:1/-1;
}
.invoice-lower-fields{
  grid-template-columns:1fr 1fr;
}
.invoice-total-bar{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:18px;
  padding:18px 20px;
  border-radius:18px;
  background:linear-gradient(135deg,#f8f1ed,#fff);
  border:1px solid rgba(201,97,72,.14);
}
.invoice-total-bar span{
  color:var(--muted);
  font-size:12px;
  font-weight:800;
}
.invoice-total-bar strong{
  color:var(--orange);
  font-family:"DM Serif Display",serif;
  font-size:28px;
  font-weight:400;
}
.invoice-form-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  flex-wrap:wrap;
}
.invoice-history-head{
  align-items:end;
}
.status-select{
  width:auto;
  min-width:150px;
}
.invoice-list{
  display:grid;
  gap:12px;
}
.invoice-history-card{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto;
  gap:20px;
  align-items:center;
  padding:18px;
  border:1px solid rgba(17,17,17,.07);
  border-radius:19px;
  background:rgba(255,255,255,.82);
}
.invoice-history-topline{
  display:flex;
  gap:9px;
  align-items:center;
  margin-bottom:8px;
}
.invoice-number{
  color:var(--muted);
  font-size:11px;
  font-weight:800;
}
.invoice-history-main h3{
  margin:0 0 4px;
  font-size:16px;
}
.invoice-history-main p{
  color:var(--muted);
  font-size:12px;
  margin:0;
}
.invoice-history-total{
  font-family:"DM Serif Display",serif;
  color:var(--orange);
  font-size:25px;
  white-space:nowrap;
}
.invoice-history-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:7px;
  flex-wrap:wrap;
  max-width:380px;
}
.invoice-empty{
  padding:36px 20px;
  text-align:center;
  color:var(--muted);
  border:1px dashed rgba(17,17,17,.10);
  border-radius:18px;
}
@media(max-width:980px){
  .invoice-form-grid{
    grid-template-columns:1fr 1fr;
  }
  .invoice-history-card{
    grid-template-columns:1fr auto;
  }
  .invoice-history-actions{
    grid-column:1/-1;
    justify-content:flex-start;
    max-width:none;
  }
}
@media(max-width:680px){
  .invoice-form-grid,
  .invoice-lower-fields{
    grid-template-columns:1fr;
  }
  .invoice-full{
    grid-column:auto;
  }
  .invoice-line-item{
    grid-template-columns:1fr 80px 1fr 38px;
  }
  .line-description{
    grid-column:1/-1;
  }
  .invoice-form-actions{
    flex-direction:column;
  }
  .invoice-form-actions .btn{
    width:100%;
  }
  .invoice-history-card{
    grid-template-columns:1fr;
    gap:12px;
  }
  .invoice-history-total{
    font-size:22px;
  }
  .invoice-history-actions{
    grid-column:auto;
    display:grid;
    grid-template-columns:1fr 1fr;
  }
  .invoice-history-actions .btn{
    width:100%;
  }
  .invoice-history-head{
    align-items:flex-start;
  }
  .status-select{
    width:100%;
  }
}


/* invoice page form polish - scoped overrides */
.invoice-page .invoice-builder{
  padding:32px !important;
}

.invoice-page .invoice-builder .panel-head{
  margin-bottom:24px !important;
}

.invoice-page .invoice-form{
  display:grid !important;
  gap:26px !important;
}

.invoice-page .invoice-form-grid{
  display:grid !important;
  grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  gap:18px !important;
  align-items:start !important;
}

.invoice-page .invoice-form label{
  display:grid !important;
  gap:8px !important;
  margin:0 !important;
  color:var(--ink) !important;
  font-size:12px !important;
  font-weight:800 !important;
  line-height:1.3 !important;
}

.invoice-page .invoice-form input,
.invoice-page .invoice-form select,
.invoice-page .invoice-form textarea,
.invoice-page .status-select{
  display:block !important;
  width:100% !important;
  min-width:0 !important;
  height:auto !important;
  margin:0 !important;
  padding:13px 14px !important;
  border:1px solid rgba(17,17,17,.11) !important;
  border-radius:14px !important;
  background:#fff !important;
  color:var(--ink) !important;
  font-family:"Inter",sans-serif !important;
  font-size:13px !important;
  font-weight:500 !important;
  line-height:1.35 !important;
  box-shadow:none !important;
  outline:none !important;
  appearance:none !important;
  -webkit-appearance:none !important;
}

.invoice-page .invoice-form input[type="date"]{
  min-height:46px !important;
  appearance:auto !important;
  -webkit-appearance:auto !important;
}

.invoice-page .invoice-form select,
.invoice-page .status-select{
  min-height:46px !important;
  padding-right:42px !important;
  background-image:
    linear-gradient(45deg,transparent 50%,#8d7e79 50%),
    linear-gradient(135deg,#8d7e79 50%,transparent 50%) !important;
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50% !important;
  background-size:5px 5px,5px 5px !important;
  background-repeat:no-repeat !important;
}

.invoice-page .invoice-form textarea{
  min-height:110px !important;
  resize:vertical !important;
  white-space:pre-wrap !important;
}

.invoice-page .invoice-form input:focus,
.invoice-page .invoice-form select:focus,
.invoice-page .invoice-form textarea:focus,
.invoice-page .status-select:focus{
  border-color:rgba(201,97,72,.50) !important;
  box-shadow:0 0 0 3px rgba(201,97,72,.08) !important;
}

.invoice-page .invoice-line-items-head{
  display:flex !important;
  align-items:end !important;
  justify-content:space-between !important;
  gap:16px !important;
  margin-top:2px !important;
}

.invoice-page .invoice-line-items-head h3{
  margin:0 0 5px !important;
  font-family:"DM Serif Display",serif !important;
  font-size:24px !important;
  font-weight:400 !important;
}

.invoice-page .invoice-line-items-head p{
  margin:0 !important;
  color:var(--muted) !important;
  font-size:12px !important;
}

.invoice-page .invoice-line-items{
  display:grid !important;
  gap:12px !important;
}

.invoice-page .invoice-line-item{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) 92px 150px 42px !important;
  gap:12px !important;
  align-items:end !important;
  padding:16px !important;
  border:1px solid rgba(17,17,17,.07) !important;
  border-radius:18px !important;
  background:#fcfaf9 !important;
}

.invoice-page .invoice-line-item label{
  min-width:0 !important;
}

.invoice-page .invoice-line-item input{
  min-height:44px !important;
}

.invoice-page .money-input{
  display:flex !important;
  align-items:center !important;
  min-height:44px !important;
  border:1px solid rgba(17,17,17,.11) !important;
  border-radius:14px !important;
  background:#fff !important;
  overflow:hidden !important;
}

.invoice-page .money-input span{
  flex:0 0 auto !important;
  padding-left:13px !important;
  color:var(--muted) !important;
  font-size:13px !important;
}

.invoice-page .money-input input{
  border:0 !important;
  border-radius:0 !important;
  box-shadow:none !important;
  padding-left:7px !important;
  min-width:0 !important;
}

.invoice-page .line-remove{
  width:42px !important;
  height:44px !important;
  display:grid !important;
  place-items:center !important;
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  border-radius:13px !important;
  background:#fff1ee !important;
  color:#a74736 !important;
  font-size:22px !important;
  cursor:pointer !important;
}

.invoice-page .line-remove:hover{
  background:#a74736 !important;
  color:#fff !important;
}

.invoice-page .invoice-full{
  grid-column:1/-1 !important;
}

.invoice-page .invoice-lower-fields{
  grid-template-columns:1fr 1fr !important;
}

.invoice-page .invoice-total-bar{
  display:flex !important;
  align-items:center !important;
  justify-content:flex-end !important;
  gap:18px !important;
  padding:18px 20px !important;
  border:1px solid rgba(201,97,72,.14) !important;
  border-radius:18px !important;
  background:linear-gradient(135deg,#f8f1ed,#fff) !important;
}

.invoice-page .invoice-total-bar span{
  color:var(--muted) !important;
  font-size:12px !important;
  font-weight:800 !important;
}

.invoice-page .invoice-total-bar strong{
  color:var(--orange) !important;
  font-family:"DM Serif Display",serif !important;
  font-size:30px !important;
  font-weight:400 !important;
}

.invoice-page .invoice-form-actions{
  display:flex !important;
  justify-content:flex-end !important;
  gap:10px !important;
  flex-wrap:wrap !important;
}

@media(max-width:980px){
  .invoice-page .invoice-form-grid{
    grid-template-columns:1fr 1fr !important;
  }
}

@media(max-width:700px){
  .invoice-page .invoice-builder{
    padding:22px !important;
  }

  .invoice-page .invoice-form-grid,
  .invoice-page .invoice-lower-fields{
    grid-template-columns:1fr !important;
  }

  .invoice-page .invoice-full{
    grid-column:auto !important;
  }

  .invoice-page .invoice-line-items-head{
    align-items:flex-start !important;
    flex-direction:column !important;
  }

  .invoice-page .invoice-line-item{
    grid-template-columns:1fr 90px 1fr 42px !important;
  }

  .invoice-page .line-description{
    grid-column:1/-1 !important;
  }

  .invoice-page .invoice-form-actions{
    flex-direction:column !important;
  }

  .invoice-page .invoice-form-actions .btn{
    width:100% !important;
  }
}


/* socially sorted by amy website palette sync */
.invoice-page{
  background:
    radial-gradient(circle at 12% 10%, rgba(234,215,222,.70), transparent 26%),
    radial-gradient(circle at 88% 8%, rgba(244,235,229,.90), transparent 28%),
    linear-gradient(180deg,#fbf7f5 0%,#fffdfc 46%,#ffffff 100%) !important;
}

.portal-header{
  background:#f1e9df !important;
  border-bottom:1px solid rgba(17,17,17,.08) !important;
}

.portal-main,
.invoice-page{
  color:#111111 !important;
}

.invoice-page .portal-hero,
.invoice-page .panel,
.invoice-page .stat-card{
  background:rgba(255,255,255,.80) !important;
  border:1px solid rgba(17,17,17,.06) !important;
  box-shadow:0 20px 50px rgba(17,17,17,.08) !important;
  backdrop-filter:blur(14px) !important;
}

.invoice-page .portal-hero{
  background:linear-gradient(135deg,#ffffff,#f4ebe5) !important;
}

.invoice-page .eyebrow,
.invoice-page .stat-value,
.invoice-page .invoice-total-bar strong,
.invoice-page .invoice-history-total{
  color:#c96148 !important;
}

.invoice-page h1,
.invoice-page h2,
.invoice-page h3{
  color:#111111 !important;
}

.invoice-page .lead,
.invoice-page .panel-head p,
.invoice-page .section-copy,
.invoice-page .invoice-history-main p,
.invoice-page .invoice-number,
.invoice-page .invoice-form small{
  color:#5f565a !important;
}

.invoice-page .btn{
  background:linear-gradient(135deg,#c96148,#b6523d) !important;
  color:#ffffff !important;
  border:none !important;
  box-shadow:0 10px 25px rgba(201,97,72,.25) !important;
}

.invoice-page .btn:hover{
  box-shadow:0 16px 35px rgba(201,97,72,.30) !important;
}

.invoice-page .btn.secondary{
  background:#ffffff !important;
  color:#111111 !important;
  border:1.5px solid #dbc2cc !important;
  box-shadow:none !important;
}

.invoice-page .btn.secondary:hover{
  background:#fbf7f5 !important;
  color:#c96148 !important;
  border-color:rgba(201,97,72,.30) !important;
}

.invoice-page .btn.danger{
  background:#fff4f2 !important;
  color:#a74736 !important;
  border:1px solid rgba(167,71,54,.18) !important;
  box-shadow:none !important;
}

.invoice-page .btn.danger:hover{
  background:#a74736 !important;
  color:#ffffff !important;
}

.invoice-page .active-nav-btn{
  background:#ffffff !important;
  color:#c96148 !important;
  border-color:rgba(201,97,72,.35) !important;
}

.invoice-page .invoice-form input,
.invoice-page .invoice-form select,
.invoice-page .invoice-form textarea,
.invoice-page .status-select{
  background:#ffffff !important;
  border-color:#dbc2cc !important;
  color:#111111 !important;
}

.invoice-page .invoice-form input:focus,
.invoice-page .invoice-form select:focus,
.invoice-page .invoice-form textarea:focus,
.invoice-page .status-select:focus{
  border-color:#c96148 !important;
  box-shadow:0 0 0 3px rgba(201,97,72,.10) !important;
}

.invoice-page .invoice-line-item{
  background:#fbf7f5 !important;
  border-color:rgba(201,97,72,.10) !important;
}

.invoice-page .money-input{
  background:#ffffff !important;
  border-color:#dbc2cc !important;
}

.invoice-page .line-remove{
  background:#f8eef3 !important;
  color:#c96148 !important;
}

.invoice-page .line-remove:hover{
  background:#c96148 !important;
  color:#ffffff !important;
}

.invoice-page .invoice-total-bar{
  background:linear-gradient(135deg,#f4ebe5,#ffffff) !important;
  border-color:rgba(201,97,72,.18) !important;
}

.invoice-page .invoice-history-card{
  background:rgba(255,255,255,.86) !important;
  border-color:rgba(17,17,17,.06) !important;
  box-shadow:0 12px 30px rgba(17,17,17,.05) !important;
}

.invoice-page .invoice-history-card:hover{
  border-color:rgba(201,97,72,.20) !important;
  box-shadow:0 18px 40px rgba(17,17,17,.08) !important;
}

.invoice-page .chip.pending{
  background:#f4ebe5 !important;
  color:#b6523d !important;
}

.invoice-page .chip.approved{
  background:#eef6f0 !important;
  color:#39704d !important;
}

.invoice-page .invoice-empty{
  background:rgba(255,255,255,.60) !important;
  border-color:#dbc2cc !important;
  color:#5f565a !important;
}

.invoice-page .invoice-line-items-head h3{
  color:#111111 !important;
}

.invoice-page .invoice-line-items-head p{
  color:#5f565a !important;
}

.invoice-page .invoice-form label{
  color:#111111 !important;
}

.invoice-page .money-input span{
  color:#5f565a !important;
}




.previous-feedback-box{
  margin-top:14px;
  padding:13px 14px;
  border:1px solid rgba(17,17,17,.08);
  border-radius:14px;
  background:#f4f2f1;
  color:#7a7274;
}

.previous-feedback-label{
  margin-bottom:6px;
  font-size:10px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#9a9193;
}

.previous-feedback-text{
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  font-size:12px;
  line-height:1.6;
  color:#777073;
}


/* clean invoice page background */
body:has(.invoice-page){
  background:#f1e9df !important;
}

.invoice-page{
  background:#f1e9df !important;
  background-image:none !important;
}

.invoice-page .portal-hero{
  background:transparent !important;
  box-shadow:none !important;
  border:0 !important;
  backdrop-filter:none !important;
}

.invoice-page .invoice-stats,
.invoice-page .invoice-builder,
.invoice-page .invoice-history-panel{
  background:transparent !important;
}

.invoice-page .stat-card,
.invoice-page .panel{
  background:#fffdfb !important;
  border:1px solid rgba(17,17,17,.06) !important;
  box-shadow:0 14px 34px rgba(17,17,17,.06) !important;
  backdrop-filter:none !important;
}

.invoice-page .stat-card{
  border-radius:28px !important;
}

.invoice-page .invoice-builder,
.invoice-page .invoice-history-panel{
  border-radius:28px !important;
}

.invoice-page .invoice-total-bar{
  background:#f7efe9 !important;
}


/* truly compact client selector tiles */
#clientGrid.client-grid{
  display:grid !important;
  grid-template-columns:repeat(5,minmax(0,1fr)) !important;
  gap:10px !important;
}

#clientGrid .client-card-compact{
  min-height:72px !important;
  padding:12px 13px !important;
  border-radius:16px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:10px !important;
  position:relative !important;
  overflow:hidden !important;
}

#clientGrid .client-card-compact:hover{
  transform:translateY(-2px) !important;
}

#clientGrid .client-compact-main{
  min-width:0 !important;
  flex:1 1 auto !important;
}

#clientGrid .client-card-compact .client-name{
  margin:0 !important;
  font-size:13px !important;
  font-weight:800 !important;
  line-height:1.2 !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}

#clientGrid .client-compact-meta{
  display:flex !important;
  align-items:center !important;
  gap:5px !important;
  margin-top:5px !important;
  color:var(--muted) !important;
  font-size:9.5px !important;
  font-weight:700 !important;
  line-height:1.2 !important;
  white-space:nowrap !important;
}

#clientGrid .client-delete-mini{
  width:26px !important;
  height:26px !important;
  flex:0 0 26px !important;
  display:grid !important;
  place-items:center !important;
  padding:0 !important;
  border:0 !important;
  border-radius:9px !important;
  background:transparent !important;
  color:#a88e87 !important;
  font-size:17px !important;
  line-height:1 !important;
  cursor:pointer !important;
  opacity:.55 !important;
}

#clientGrid .client-delete-mini:hover{
  background:#fff0ed !important;
  color:#a74736 !important;
  opacity:1 !important;
}

@media(max-width:1150px){
  #clientGrid.client-grid{
    grid-template-columns:repeat(4,minmax(0,1fr)) !important;
  }
}

@media(max-width:900px){
  #clientGrid.client-grid{
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  }
}

@media(max-width:650px){
  #clientGrid.client-grid{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:8px !important;
  }

  #clientGrid .client-card-compact{
    min-height:64px !important;
    padding:10px 11px !important;
  }

  #clientGrid .client-card-compact .client-name{
    font-size:12px !important;
  }

  #clientGrid .client-compact-meta{
    font-size:8.5px !important;
  }
}


/* refined ultra-compact client selector */
.clients-section,
#clientsSection{
  padding:24px 28px !important;
}

#clientGrid.client-grid{
  display:grid !important;
  grid-template-columns:repeat(6,minmax(0,1fr)) !important;
  gap:8px !important;
}

#clientGrid .client-card-compact{
  min-height:54px !important;
  padding:9px 10px !important;
  border-radius:13px !important;
  gap:8px !important;
  box-shadow:0 7px 18px rgba(17,17,17,.035) !important;
}

#clientGrid .client-card-compact .client-name{
  font-size:11.5px !important;
  line-height:1.15 !important;
  font-weight:800 !important;
}

#clientGrid .client-compact-meta{
  margin-top:3px !important;
  gap:4px !important;
  font-size:8.5px !important;
  line-height:1.1 !important;
  color:var(--muted) !important;
}

#clientGrid .client-delete-mini{
  width:22px !important;
  height:22px !important;
  flex:0 0 22px !important;
  border-radius:7px !important;
  background:#fff5f2 !important;
  border:1px solid rgba(167,71,54,.10) !important;
  color:#a74736 !important;
  font-size:14px !important;
  opacity:.75 !important;
}

#clientGrid .client-delete-mini:hover{
  background:#a74736 !important;
  color:#fff !important;
  opacity:1 !important;
}

#clientGrid .client-card-compact:hover{
  border-color:rgba(201,97,72,.22) !important;
  box-shadow:0 10px 22px rgba(17,17,17,.055) !important;
}

@media(max-width:1250px){
  #clientGrid.client-grid{
    grid-template-columns:repeat(5,minmax(0,1fr)) !important;
  }
}

@media(max-width:1050px){
  #clientGrid.client-grid{
    grid-template-columns:repeat(4,minmax(0,1fr)) !important;
  }
}

@media(max-width:820px){
  #clientGrid.client-grid{
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  }
}

@media(max-width:620px){
  .clients-section,
  #clientsSection{
    padding:18px !important;
  }

  #clientGrid.client-grid{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:7px !important;
  }

  #clientGrid .client-card-compact{
    min-height:50px !important;
    padding:8px 9px !important;
  }

  #clientGrid .client-card-compact .client-name{
    font-size:10.5px !important;
  }

  #clientGrid .client-compact-meta{
    font-size:8px !important;
  }
}
