/*
 * FJT Invoice MASTER Pro v1.6.4
 * Production UI cleanup: no sidebar, centered fluid layout, no item table lateral scroll.
 */

html,
body{
  max-width:100%;
  overflow-x:hidden;
}

#fjt-invoice-master-root,
#fjt-invoice-master-root *{
  box-sizing:border-box;
}

#fjt-invoice-master-root{
  width:100%;
  max-width:100%;
  margin:0 auto;
  padding:0;
  font-family:Inter,Arial,sans-serif;
  color:#0f172a;
}

/* Defensive cleanup: removes old/obsolete plugin sidebars if a cached or previous markup remains active. */
#fjt-invoice-master-root .fjt-side,
#fjt-invoice-master-root .fjt-sidebar,
#fjt-invoice-master-root .fjt-left,
#fjt-invoice-master-root .fjt-nav,
#fjt-invoice-master-root .fjt-menu,
#fjt-invoice-master-root .fjt-app-sidebar,
#fjt-invoice-master-root .fjt-dashboard-sidebar,
#fjt-invoice-master-root aside[class*="side"],
#fjt-invoice-master-root nav[class*="side"]{
  display:none!important;
  width:0!important;
  min-width:0!important;
  max-width:0!important;
  height:0!important;
  padding:0!important;
  margin:0!important;
  border:0!important;
  overflow:hidden!important;
}

#fjt-invoice-master-root .fjt-shell,
#fjt-invoice-master-root .fjt-layout,
#fjt-invoice-master-root .fjt-container,
#fjt-invoice-master-root .fjt-app,
#fjt-invoice-master-root .fjt-main{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  margin:0!important;
  padding:0!important;
  grid-template-columns:1fr!important;
}

/* v1.6.3 hard cleanup for the previous SaaS sidebar shell.
   This is intentionally defensive because some WordPress/browser caches can keep old markup alive. */
body .fjt-side,
body .fjt-sidebar,
body .fjt-left,
body .fjt-nav,
body .fjt-menu,
body .fjt-app-sidebar,
body .fjt-dashboard-sidebar,
body [class*="fjt"][class*="sidebar"],
body [class*="fjt"][class*="side-nav"]{
  display:none!important;
  width:0!important;
  min-width:0!important;
  max-width:0!important;
  height:0!important;
  min-height:0!important;
  padding:0!important;
  margin:0!important;
  border:0!important;
  overflow:hidden!important;
  opacity:0!important;
  pointer-events:none!important;
}

body .fjt-shell,
body .fjt-layout,
body .fjt-container,
body .fjt-app,
body .fjt-main{
  display:block!important;
  grid-template-columns:1fr!important;
  width:100%!important;
  max-width:100%!important;
  margin-left:0!important;
  margin-right:0!important;
  padding-left:0!important;
  padding-right:0!important;
}

.fjt-wrap{
  width:100%;
  max-width:1280px;
  margin:0 auto;
  padding:18px;
  background:#f5f8fc;
  border-radius:28px;
  overflow:hidden;
}

.fjt-hero{
  width:100%;
  background:linear-gradient(135deg,#14213d,#0e7490);
  color:#fff;
  border-radius:28px;
  padding:34px 38px;
  margin-bottom:24px;
  box-shadow:0 20px 50px rgba(15,23,42,.15);
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(260px,420px);
  gap:22px;
  align-items:end;
  overflow:hidden;
}

.fjt-eyebrow,
.fjt-subeyebrow{
  color:#8ce7ff;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.14em;
  font-size:13px;
}

.fjt-subeyebrow{
  margin-top:16px;
  letter-spacing:.1em;
}

.fjt-hero h1{
  margin:12px 0 8px;
  font-size:44px;
  line-height:1.05;
  letter-spacing:-.03em;
}

.fjt-hero p{
  color:#cbd5e1;
  font-size:17px;
  line-height:1.55;
  margin:0;
  max-width:720px;
}

.fjt-hero-cards{
  min-width:0;
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}

.fjt-hero-cards div{
  min-width:0;
  background:rgba(255,255,255,.12);
  border:1px solid rgba(255,255,255,.15);
  border-radius:18px;
  padding:18px;
  overflow:hidden;
}

.fjt-hero-cards span{
  display:block;
  color:#9ee7ff;
  text-transform:uppercase;
  font-size:12px;
  font-weight:900;
  letter-spacing:.06em;
  white-space:normal;
}

.fjt-hero-cards strong{
  display:block;
  font-size:24px;
  margin-top:8px;
  line-height:1.15;
  word-break:break-word;
}

.fjt-search-panel,
.fjt-inv-card{
  width:100%;
  background:#fff;
  border:1px solid #dbe5f3;
  border-radius:24px;
  padding:28px;
  margin-bottom:24px;
  box-shadow:0 16px 40px rgba(15,23,42,.06);
  overflow:hidden;
}

.fjt-panel-title h2,
.fjt-card-top h2,
.fjt-inv-section-title h2{
  margin:0 0 8px;
  font-size:24px;
  line-height:1.2;
}

.fjt-panel-title p,
.fjt-muted,
.fjt-inv-help{
  margin:0 0 18px;
  color:#64748b;
  line-height:1.55;
}

.fjt-search-grid{
  display:grid;
  grid-template-columns:minmax(170px,1fr) minmax(220px,1.3fr) auto;
  gap:14px;
  align-items:end;
}

.fjt-card-top{
  display:flex;
  justify-content:space-between;
  gap:20px;
  align-items:flex-start;
  margin-bottom:18px;
}

.fjt-auto-id-badge{
  background:#dcfce7;
  color:#166534;
  font-weight:900;
  border-radius:999px;
  padding:12px 18px;
  white-space:nowrap;
}

.fjt-loaded-banner{
  background:#dcfce7;
  color:#166534;
  border:1px solid #bbf7d0;
  border-radius:18px;
  padding:16px 18px;
  margin-bottom:22px;
  line-height:1.5;
}

.fjt-inv-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:18px 22px;
}

.fjt-inv-full{
  grid-column:1/-1;
}

.fjt-inv-field label{
  display:block;
  font-weight:900;
  color:#64748b;
  font-size:13px;
  text-transform:uppercase;
  letter-spacing:.04em;
  margin-bottom:8px;
}

.fjt-inv-field input,
.fjt-inv-field textarea,
.fjt-inv-field select,
.fjt-inv-cell input,
.fjt-inv-cell select{
  width:100%;
  max-width:100%;
  border:1px solid #d7e4f5;
  border-radius:16px;
  padding:14px 16px;
  background:#f8fbff;
  color:#0f172a;
  font-size:15px;
  outline:none;
}

.fjt-inv-field input:focus,
.fjt-inv-field textarea:focus,
.fjt-inv-field select:focus,
.fjt-inv-cell input:focus,
.fjt-inv-cell select:focus{
  border-color:#38bdf8;
  box-shadow:0 0 0 4px rgba(56,189,248,.14);
}

.fjt-inv-field textarea{
  min-height:96px;
  resize:vertical;
}

.fjt-inv-section-title{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:18px;
  margin-top:28px;
  background:#f8fbff;
  border:1px solid #dbe5f3;
  border-radius:22px;
  padding:22px;
}

.fjt-inv-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.fjt-inv-btn{
  border:0;
  border-radius:16px;
  padding:14px 20px;
  font-weight:900;
  cursor:pointer;
  line-height:1.1;
}

.fjt-inv-btn.primary{
  background:linear-gradient(135deg,#16b8d8,#0787d2);
  color:#fff;
  box-shadow:0 10px 22px rgba(14,165,233,.22);
}

.fjt-inv-btn.soft{
  background:#e8f8ff;
  color:#075985;
}

.fjt-inv-btn.danger{
  background:#fee2e2;
  color:#b91c1c;
}

.fjt-inv-table{
  width:100%;
  max-width:100%;
  margin-top:18px;
  border:1px solid #dbe5f3;
  border-radius:20px;
  overflow:hidden;
}

.fjt-inv-table-head,
.fjt-inv-row{
  display:grid;
  grid-template-columns:minmax(260px,1.55fr) minmax(170px,.72fr) minmax(105px,.42fr) minmax(145px,.58fr) 178px;
  gap:12px;
  align-items:center;
  width:100%;
  min-width:0;
}

.fjt-inv-table-head{
  background:#f6f9fd;
  padding:14px 16px;
  font-weight:900;
  color:#334155;
  text-transform:uppercase;
  letter-spacing:.04em;
  font-size:13px;
}

.fjt-inv-row{
  padding:12px 16px;
  border-top:1px solid #dbe5f3;
}

.fjt-inv-cell[data-label='Price USD'] input{
  text-align:right;
  font-weight:700;
}

.fjt-inv-mini-actions{
  display:flex;
  gap:6px;
  justify-content:flex-end;
}

.fjt-inv-mini{
  border:0;
  border-radius:10px;
  padding:8px 9px;
  background:#e8f0fb;
  cursor:pointer;
  font-weight:900;
}

.fjt-inv-mini.danger{
  background:#fee2e2;
  color:#b91c1c;
}

.fjt-inv-summary{
  display:flex;
  justify-content:flex-end;
  margin-top:20px;
}

.fjt-inv-total-box{
  width:100%;
  max-width:330px;
  background:#f8fbff;
  border:1px solid #dbe5f3;
  border-radius:20px;
  padding:18px;
}

.fjt-inv-total-line{
  display:flex;
  justify-content:space-between;
  gap:16px;
  padding:8px 0;
  color:#64748b;
}

.fjt-inv-total-line.grand{
  background:#132b45;
  color:#fff;
  font-size:25px;
  font-weight:900;
  margin:12px -4px -4px;
  padding:18px 20px;
  border-radius:16px;
}

.fjt-inv-footer{
  border-top:1px solid #dbe5f3;
  margin-top:28px;
  padding-top:22px;
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:center;
}

.fjt-inv-status{
  color:#64748b;
  font-weight:800;
}

.fjt-search-results{
  margin-top:18px;
}

.fjt-result-card,
.fjt-result-success,
.fjt-result-empty,
.fjt-result-error{
  border-radius:18px;
  padding:18px;
  margin-top:12px;
}

.fjt-result-card{
  display:flex;
  justify-content:space-between;
  gap:18px;
  align-items:center;
  background:#f8fbff;
  border:1px solid #dbe5f3;
}

.fjt-result-card strong,
.fjt-result-card span,
.fjt-result-card small{
  display:block;
}

.fjt-result-card strong{
  font-size:18px;
}

.fjt-result-card span{
  margin-top:5px;
  color:#334155;
  font-size:17px;
}

.fjt-result-card small{
  margin-top:6px;
  color:#64748b;
  line-height:1.4;
}

.fjt-result-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-shrink:0;
}

.fjt-result-actions a,
.fjt-result-success a{
  color:#0ea5e9;
  font-weight:900;
  text-decoration:none;
}

.fjt-result-success{
  background:#dcfce7;
  color:#166534;
}

.fjt-result-empty{
  background:#f1f5f9;
  color:#475569;
}

.fjt-result-error{
  background:#fee2e2;
  color:#b91c1c;
}

@media(max-width:1100px){
  .fjt-wrap{
    max-width:100%;
    border-radius:0;
  }

  .fjt-hero{
    grid-template-columns:1fr;
  }

  .fjt-hero-cards{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}

@media(max-width:960px){
  #fjt-invoice-master-root{
    padding:0;
  }

  .fjt-wrap{
    padding:12px;
  }

  .fjt-hero{
    padding:26px 22px;
    border-radius:24px;
  }

  .fjt-hero h1{
    font-size:34px;
  }

  .fjt-hero-cards,
  .fjt-inv-grid,
  .fjt-search-grid{
    grid-template-columns:1fr;
  }

  .fjt-search-panel,
  .fjt-inv-card{
    padding:22px;
    border-radius:22px;
  }

  .fjt-inv-section-title,
  .fjt-inv-footer,
  .fjt-result-card,
  .fjt-card-top{
    flex-direction:column;
    align-items:stretch;
  }

  .fjt-auto-id-badge{
    white-space:normal;
    text-align:center;
  }

  .fjt-result-actions{
    flex-wrap:wrap;
  }
}

@media(max-width:640px){
  .fjt-wrap{
    padding:8px;
  }

  .fjt-hero{
    padding:24px 18px;
    margin-bottom:16px;
  }

  .fjt-hero h1{
    font-size:30px;
  }

  .fjt-hero p{
    font-size:15px;
  }

  .fjt-search-panel,
  .fjt-inv-card{
    padding:18px;
    margin-bottom:16px;
  }

  .fjt-inv-btn{
    width:100%;
  }

  .fjt-inv-actions{
    width:100%;
  }

  .fjt-inv-actions .fjt-inv-btn{
    flex:1 1 100%;
  }

  .fjt-inv-table-head{
    display:none;
  }

  .fjt-inv-table{
    overflow:visible;
    border:0;
  }

  .fjt-inv-row{
    min-width:0;
    display:grid;
    grid-template-columns:1fr;
    gap:10px;
    border:1px solid #dbe5f3;
    border-radius:18px;
    margin-bottom:12px;
    padding:14px;
    background:#fff;
  }

  .fjt-inv-cell::before{
    content:attr(data-label);
    display:block;
    margin-bottom:6px;
    color:#64748b;
    font-size:12px;
    font-weight:900;
    text-transform:uppercase;
    letter-spacing:.04em;
  }

  .fjt-inv-mini-actions{
    justify-content:stretch;
  }

  .fjt-inv-mini{
    flex:1;
  }

  .fjt-inv-summary{
    justify-content:stretch;
  }

  .fjt-inv-total-box{
    max-width:none;
  }
}


/* v1.6.4 action column fix: prevents PRICE USD and action buttons from overlapping. */
.fjt-inv-table-head > div:last-child{
  text-align:center;
}

.fjt-inv-cell,
.fjt-inv-mini-actions{
  min-width:0;
}

.fjt-inv-cell[data-label='Price USD'] input{
  min-width:0;
  padding-left:12px;
  padding-right:12px;
}

.fjt-inv-mini-actions{
  width:178px;
  display:grid;
  grid-template-columns:repeat(3,48px);
  gap:8px;
  justify-content:end;
}

.fjt-inv-mini{
  width:48px;
  height:48px;
  padding:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid #fb7185;
  background:#fff1f2;
  color:#e11d48;
  font-size:16px;
}

@media(max-width:1180px) and (min-width:641px){
  .fjt-inv-table-head,
  .fjt-inv-row{
    grid-template-columns:minmax(220px,1.35fr) minmax(150px,.72fr) minmax(95px,.42fr) minmax(130px,.58fr) 166px;
    gap:10px;
  }

  .fjt-inv-mini-actions{
    width:166px;
    grid-template-columns:repeat(3,46px);
    gap:7px;
  }

  .fjt-inv-mini{
    width:46px;
    height:46px;
  }
}

@media(max-width:640px){
  .fjt-inv-mini-actions{
    width:100%;
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:8px;
  }

  .fjt-inv-mini{
    width:100%;
    height:46px;
  }
}
