/* Invoice-only CSS (based on your invoice selectors)
   - Keeps .kvTable and #reportTable look
   - Adds "text-like" inputs for editing
   - Hides builder controls on print
*/

body {
  margin: 12px;
  background-color: #fff;
  background-image: none;
  font-family: Arial, Verdana, Helvetica, sans-serif;
  font-size: 12px;
  color: #666;
}

/* Builder top bar */
.builderRight { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.builderLeft { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.builderUser { color:#444; font-size:12px; padding-left:8px; border-left:1px solid #ddd; }
.logoutForm { margin-left:4px; }
.logoutBtn { border-color:#999; }
.saveStatus { min-height:18px; margin:-4px 0 8px; color:#2f6f3e; font-weight:bold; }
.saveStatus.isError { color:#b42318; }
.srOnly { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.builderTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  border: 1px solid #ccc;
  background: #fff;
  padding: 10px;
  border-radius: 10px;
  margin-bottom: 12px;
}
.builderForm { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin:0; }
.builderMeta { margin-left: 10px; color: #777; font-size: 12px; }
select { padding: 6px 8px; border: 1px solid #ccc; border-radius: 8px; background:#fff; }

.btn {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  text-decoration: none;
  color: #222;
  font-size: 12px;
}
.btn.primary { border-color: #0b79ea; }
.btn.danger { border-color: #d70b31; color: #d70b31; }
.rowBtns { margin: 10px 0 0 0; display:flex; gap:8px; flex-wrap:wrap; }

h2 { margin: 0 0 8px 0; font-size: 16px; color: #453e36; }

/* Text-like inputs */
.inv-input {
  width: 100%;
  box-sizing: border-box;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  padding: 0;
  margin: 0;
  outline: none;
}
.inv-input:focus {
  outline: 2px solid rgba(11, 121, 234, .25);
  border-radius: 3px;
}
.inv-title { font-size: 16px; font-weight: bold; color: #453e36; }
.companyBlock { line-height: 18px; }

/* --- Invoice tables --- */
.kvTable {
  width: 100%;
  border: 1px solid #222222;
  padding: 0px;
  border-collapse: collapse;
}

.kvTable .header {
  text-align: center;
  border-bottom: 1px solid #777777;
  background-color: #777777;
  font-size: 12px;
  font-weight: bold;
  color: #FFFFFF;
  padding: 6px;
}

.kvTable .left {
  border-right: 1px solid #777777;
  border-bottom: 1px solid #777777;
  padding: 6px;
  background-color: #DDDDDD;
  font-size: 12px;
  width: 150px;
  font-weight: bold;
}

.kvTable .right {
  border-right: 1px solid #777777;
  border-bottom: 1px solid #777777;
  padding: 6px;
  font-size: 12px;
  background-color: #FFFFFF;
}

/* Report table */
#reportTable {
  width: 99%;
  border-top: 1px solid #CCC;
  border-left: 1px solid #CCC;
  border-collapse: collapse;
}

#reportTable th {
  background: #f1f2f3;
  color: #333;
  font-size: 10px;
  text-transform: uppercase;
  height: 25px;
  padding: 0 6px;
  border-right: 1px solid #FFF;
  border-bottom: 1px solid #ccc;
}

#reportTable th.lastCol { border-right: 1px solid #ccc; }
#reportTable .qtyCell { text-align: center; }

#reportTable td {
  border-right: 1px solid #CCC;
  border-bottom: 1px solid #CCC;
  padding: 6px;
}

#reportTable .alt1 { background-color: #FFF; }
#reportTable .alt2 { background-color: #ECECEC; }

/* Sub-row like the original invoice template */
#reportTable small {
  font-size: 11px;
  color: #666;
}

/* Hide optional sublines + their <br> spacer when blank */
.item-subline.is-hidden { display: none; }
br.subbr.is-hidden { display: none; }



/* Inputs inside <small> should look like small text */
.small-input {
  font-size: 11px;
  color: inherit;
  font-weight: inherit;
}


.highlight { font-weight: bold; color: #ed622b; }

/* Make editable inputs inside .highlight keep the same bold/orange styling */
.highlight-input {
  font-weight: inherit;
  color: inherit;
}


/* Print */
@media print {
  .builderOnly { display: none !important; }
  body { margin: 0; }
  .kvTable .header {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

@media print {
  input::placeholder {
    color: transparent !important;
  }
  /* for some WebKit-based print engines */
  input::-webkit-input-placeholder {
    color: transparent !important;
  }
}



/* Print-safe item type text */
.print-type-text{
  display:none;
  white-space:pre-wrap;
  word-break:break-word;
  overflow-wrap:anywhere;
  line-height:1.25;
}

.type-textarea{
  width:100%;
  min-height:2.4em;
  resize:vertical;
  overflow:hidden;
  white-space:pre-wrap;
  word-break:break-word;
  overflow-wrap:anywhere;
  line-height:1.25;
  font-family:inherit;
}

textarea.inv-input{
  display:block;
  border:0;
  background:transparent;
  padding:0;
  margin:0;
}

@media print{
  .type-textarea{display:none !important;}
  .print-type-text{display:block !important;}
}

/* --- Row reordering controls (builder only) --- */
.rowReorderControls {
  display: flex;
  align-items: center;
  gap: 3px;
  margin: 0 0 5px 0;
}

.rowDragHandle,
.rowMoveBtn {
  min-width: 24px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid #bbb;
  border-radius: 5px;
  background: #fff;
  color: #555;
  font: inherit;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
}

.rowDragHandle {
  cursor: grab;
  font-size: 14px;
  font-weight: bold;
}

.rowDragHandle:active {
  cursor: grabbing;
}

.rowMoveBtn:disabled {
  opacity: .3;
  cursor: default;
}

.rowDragHandle:focus-visible,
.rowMoveBtn:focus-visible {
  outline: 2px solid rgba(11, 121, 234, .35);
  outline-offset: 1px;
}

tr.reorderableRow.is-dragging {
  opacity: .45;
}

.rowReorderHint {
  align-self: center;
  color: #777;
  font-size: 11px;
}

@media print {
  tr.reorderableRow.is-dragging {
    opacity: 1;
  }
}


/* Secure sign-in */
.loginBody {
  margin: 0;
  min-height: 100%;
  background: #f5f7fa;
  color: #28313b;
}

.loginShell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  box-sizing: border-box;
}

.loginCard {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid #d9dee5;
  border-radius: 14px;
  padding: 28px;
  box-sizing: border-box;
  box-shadow: 0 10px 30px rgba(30, 45, 60, .08);
}

.loginBrand {
  color: #ed622b;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.loginCard h1 {
  margin: 0 0 8px;
  color: #202833;
  font-size: 26px;
}

.loginIntro {
  margin: 0 0 20px;
  color: #687382;
  line-height: 1.5;
}

.loginForm {
  display: grid;
  gap: 8px;
}

.loginForm label {
  font-weight: 700;
  color: #333b45;
  margin-top: 6px;
}

.loginForm input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #bfc7d1;
  border-radius: 8px;
  padding: 10px 11px;
  font: inherit;
  font-size: 14px;
  color: #1f2933;
  background: #fff;
}

.loginForm input:focus {
  outline: 2px solid rgba(11, 121, 234, .25);
  border-color: #0b79ea;
}

.loginForm small {
  color: #6d7682;
  line-height: 1.4;
}

.loginSubmit {
  margin-top: 12px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  background: #0b79ea;
  color: #fff;
  border-color: #0b79ea;
}

.loginError,
.loginSetup {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 8px;
  line-height: 1.45;
}

.loginError {
  background: #fff1f0;
  border: 1px solid #f2b8b5;
  color: #9f1c16;
}

.loginSetup {
  background: #fff8e8;
  border: 1px solid #efd18a;
  color: #634d18;
}

.loginSetup code {
  word-break: break-word;
}

@media (max-width: 640px) {
  .builderTop { align-items: flex-start; }
  .builderRight { width: 100%; }
  .loginShell { align-items: flex-start; padding-top: 24px; }
  .loginCard { padding: 22px; }
}

@media print {
  .saveStatus { display: none !important; }
}
