/* ==========================================================================
   ShootInvoice — Custom Styles
   Brand: Shoot Invoice  |  Palette: #5CBF5A green / #1A2B1A dark
   Fonts: Poppins (headings) + Inter (body)
   All custom CSS lives here. Do NOT modify bootstrap.min.css.
   ========================================================================== */

/* ── Brand Variables ────────────────────────────────────────────────────── */
:root {
  --si-green:        #5CBF5A;
  --si-green-dark:   #3A9638;
  --si-green-light:  #8ED68C;
  --si-green-pale:   #EAF7EA;
  --si-green-xpale:  #F4FBF4;
  --si-dark:         #1A2B1A;
  --si-gray-mid:     #5A6B5A;
  --si-gray-light:   #D4E4D4;
  --si-gray-bg:      #F7FAF7;
  --si-page-bg:      #F0F4F0;
  --si-white:        #FFFFFF;

  --si-navbar-h:     60px;
  --si-paper-max:    860px;
  --si-radius:       8px;
  --si-radius-lg:    16px;
  --si-shadow:       0 4px 32px rgba(26,43,26,.10);
  --si-shadow-sm:    0 2px 12px rgba(26,43,26,.08);
}

/* ── Reset / Base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  color: var(--si-dark);
  background: var(--si-page-bg);
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6,
.si-heading {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  color: var(--si-dark);
}

/* ── Bootstrap overrides ────────────────────────────────────────────────── */
.btn-primary {
  background: var(--si-green);
  border-color: var(--si-green);
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  border-radius: var(--si-radius);
}
.btn-primary:hover,
.btn-primary:focus {
  background: var(--si-green-dark);
  border-color: var(--si-green-dark);
}
.btn-primary:focus { box-shadow: 0 0 0 .2rem rgba(92,191,90,.35); }

.btn-outline-secondary {
  color: var(--si-gray-mid);
  border-color: var(--si-gray-light);
  border-radius: var(--si-radius);
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
}
.btn-outline-secondary:hover { background: var(--si-green-pale); border-color: var(--si-green); color: var(--si-green-dark); }

.btn-outline-warning {
  color: var(--si-gray-mid);
  border-color: var(--si-gray-light);
  border-radius: var(--si-radius);
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
}
.btn-outline-warning:hover { background: var(--si-green-pale); color: var(--si-green-dark); border-color: var(--si-green); }

.btn-secondary {
  background: transparent;
  color: var(--si-gray-mid);
  border: 1.5px solid var(--si-gray-light);
  border-radius: var(--si-radius);
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
}
.btn-secondary:hover { background: var(--si-green-pale); color: var(--si-dark); border-color: var(--si-green-light); }

.form-control:focus {
  border-color: var(--si-green);
  box-shadow: 0 0 0 .2rem rgba(92,191,90,.2);
}

.dropdown-menu { border: 1px solid var(--si-gray-light); border-radius: var(--si-radius); box-shadow: var(--si-shadow); }
.dropdown-item:hover { background: var(--si-green-pale); color: var(--si-dark); }
.dropdown-item:active { background: var(--si-green); }

.badge-success    { background: var(--si-green-pale); color: var(--si-green-dark); }
.badge-secondary  { background: var(--si-gray-bg); color: var(--si-gray-mid); }
.badge-primary    { background: #e3f2fd; color: #1565c0; }
.badge-danger     { background: #fce4ec; color: #880e4f; }

/* ── Navbar ─────────────────────────────────────────────────────────────── */
.si-navbar {
  height: var(--si-navbar-h);
  background: var(--si-dark);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,.20);
}

.si-brand { display: flex; align-items: center; text-decoration: none; }
.si-nav-logo { height: 38px; width: auto; }

.si-nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
}

.si-nav-link {
  color: rgba(255,255,255,.75) !important;
  text-decoration: none !important;
  padding: 7px 13px;
  border-radius: var(--si-radius);
  font-size: 13px;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  transition: background .15s, color .15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.si-nav-link:hover { color: #fff !important; background: rgba(255,255,255,.10); }
.si-nav-link .fa { font-size: 14px; }

/* ── Alert bar ──────────────────────────────────────────────────────────── */
.si-alert-bar {
  display: flex;
  align-items: center;
  padding: 0 24px;
  height: 44px;
  font-size: 13px;
  font-weight: 500;
  font-family: 'Poppins', sans-serif;
}
.si-alert-bar .container-fluid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
}
.si-alert-success { background: var(--si-green-pale); color: var(--si-green-dark); }
.si-alert-error   { background: #fce4ec; color: #880e4f; }
.si-alert-info    { background: #e3f2fd; color: #0d47a1; }
.si-alert-warning { background: #fff8e1; color: #e65100; }
.si-alert-close {
  background: none; border: none; font-size: 20px; line-height: 1;
  cursor: pointer; padding: 0 4px; opacity: .5;
}
.si-alert-close:hover { opacity: 1; }

/* ── Main ───────────────────────────────────────────────────────────────── */
.si-main { min-height: calc(100vh - var(--si-navbar-h)); }

/* ── Action bar ─────────────────────────────────────────────────────────── */
.si-action-bar {
  background: var(--si-dark);
  padding: 10px 0;
  position: sticky;
  top: var(--si-navbar-h);
  z-index: 900;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.si-action-bar .container-fluid {
  display: flex;
  align-items: center;
  padding: 0 24px;
}

.si-type-select {
  background: rgba(255,255,255,.10);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,.20);
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 13px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--si-radius);
  cursor: pointer;
  transition: border-color .15s;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='rgba(255,255,255,.5)'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
.si-type-select:focus { outline: none; border-color: var(--si-green); }
.si-type-select option { background: var(--si-dark); color: #fff; }

/* ── Auto-save status indicator ─────────────────────────────────────────── */
.si-autosave-status {
  display: flex;
  align-items: center;
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  letter-spacing: .02em;
  min-width: 80px;
}
.si-autosave-pending { color: rgba(255,255,255,.45); animation: si-fade-in .2s ease; }
.si-autosave-saved   { color: var(--si-green-light); animation: si-fade-in .2s ease; }
.si-autosave-error   { color: #ff8a80; animation: si-fade-in .2s ease; }
.si-autosave-status .fa { margin-right: 5px; }

@keyframes si-fade-in {
  from { opacity: 0; transform: translateY(2px); }
  to   { opacity: 1; transform: none; }
}

/* ── Paper wrap ─────────────────────────────────────────────────────────── */
.si-paper-wrap {
  padding: 32px 16px 80px;
  display: flex;
  justify-content: center;
}

.si-paper {
  background: var(--si-white);
  width: 100%;
  max-width: var(--si-paper-max);
  border-radius: var(--si-radius-lg);
  box-shadow: 0 8px 48px rgba(26,43,26,.12);
  overflow: hidden;
}

/* ── Document type selector bar (top of document) ───────────────────────── */
.si-doc-type-bar {
  background: #f9f9f9;
  padding: 12px 24px;
  border-bottom: 1px solid #e8e8e8;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--si-gray-mid);
  font-family: 'Inter', sans-serif;
}

.si-type-select-inline {
  background: #fff;
  color: var(--si-dark);
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 13px;
  height: 32px;
  padding: 0 10px 0 10px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='rgba(0,0,0,.3)'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 28px;
}

.si-type-select-inline:hover { border-color: var(--si-green); }
.si-type-select-inline:focus { outline: none; border-color: var(--si-green); box-shadow: 0 0 0 3px rgba(46,173,97,.1); }
.si-type-select-inline option { background: #fff; color: var(--si-dark); }

.si-doc-type-hint {
  color: #ccc;
  font-size: 11px;
  font-weight: 500;
}

/* ── Invoice header (green band) ────────────────────────────────────────── */
.si-inv-header {
  background: var(--si-green);
  padding: 36px 48px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  overflow: hidden;
}
/* Decorative circles from brand guidelines */
.si-inv-header::before {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 50%;
  border: 50px solid rgba(255,255,255,.10);
  right: -70px; top: -110px;
  pointer-events: none;
}
.si-inv-header::after {
  content: '';
  position: absolute;
  width: 180px; height: 180px;
  border-radius: 50%;
  border: 30px solid rgba(255,255,255,.08);
  right: 150px; bottom: -90px;
  pointer-events: none;
}

/* Logo area in header */
.si-logo-area { position: relative; z-index: 1; flex-shrink: 0; }
.si-logo-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  width: 120px;
  height: 80px;
  border: 2px dashed rgba(255,255,255,.35);
  border-radius: var(--si-radius);
  transition: border-color .2s;
  overflow: hidden;
}
.si-logo-label:hover { border-color: rgba(255,255,255,.7); }
.si-logo-placeholder { text-align: center; color: rgba(255,255,255,.65); font-size: 12px; font-family: 'Poppins', sans-serif; }
.si-logo-placeholder .fa { font-size: 22px; margin-bottom: 4px; display: block; }
.si-logo-img { max-width: 120px; max-height: 80px; object-fit: contain; }
.si-file-input { display: none; }

/* From fields in header */
.si-from-fields { position: relative; z-index: 1; flex: 1; }
.si-from-fields .si-field { color: rgba(255,255,255,.95); }
.si-from-fields .si-field::placeholder { color: rgba(255,255,255,.45); }
.si-from-fields .si-field:hover { border-bottom-color: rgba(255,255,255,.35); }
.si-from-fields .si-field:focus { border-bottom-color: rgba(255,255,255,.85); }
.si-from-fields .si-field-lg { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 18px; }

/* Document title (right side of header) */
.si-doc-title-wrap { position: relative; z-index: 1; text-align: right; flex-shrink: 0; }
.si-doc-title {
  font-family: 'Poppins', sans-serif;
  font-size: 48px;
  font-weight: 900;
  color: white;
  letter-spacing: -2px;
  line-height: 1;
  margin: 0 0 8px;
  text-transform: uppercase;
}
.si-doc-number {
  font-size: 12px;
  color: rgba(255,255,255,.65);
  letter-spacing: 2px;
  font-family: 'Inter', sans-serif;
}

/* ── Status bar (dark strip below header) ───────────────────────────────── */
.si-status-bar {
  background: var(--si-dark);
  padding: 14px 48px;
  display: flex;
  gap: 28px;
  align-items: center;
  flex-wrap: wrap;
}
.si-status-item { display: flex; flex-direction: column; }
.si-status-label {
  font-size: 9px;
  color: rgba(255,255,255,.4);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 2px;
  font-family: 'Inter', sans-serif;
}
.si-status-val {
  font-size: 13px;
  color: white;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
}
.si-status-val input {
  background: transparent;
  border: none;
  color: white;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 13px;
  padding: 0;
  width: 130px;
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.si-status-val input:focus { outline: none; border-bottom-color: var(--si-green); }
.si-status-val input::-webkit-calendar-picker-indicator { filter: invert(1); opacity: .4; cursor: pointer; }

.si-status-badge {
  background: var(--si-green);
  color: white;
  border-radius: 100px;
  padding: 4px 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-family: 'Poppins', sans-serif;
  margin-left: auto;
}

/* ── Document body ──────────────────────────────────────────────────────── */
.si-doc-body { padding: 40px 48px; }

/* ── Generic editable field ─────────────────────────────────────────────── */
.si-field {
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  padding: 3px 0;
  width: 100%;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: var(--si-dark);
  transition: border-color .15s;
  border-radius: 0;
  resize: none;
  display: block;
}
.si-field:hover  { border-bottom-color: var(--si-gray-light); }
.si-field:focus  { outline: none; border-bottom-color: var(--si-green); }
.si-field::placeholder { color: #bfcfbf; }
.si-field-lg     { font-family: 'Poppins', sans-serif; font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.si-field-sm     { font-size: 13px; }
.si-field-address { font-size: 13px; line-height: 1.6; min-height: 54px; }

/* ── Section label ──────────────────────────────────────────────────────── */
.si-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--si-green);
  margin-bottom: 8px;
  font-family: 'Inter', sans-serif;
}

/* ── Bill To row ────────────────────────────────────────────────────────── */
.si-bill-to-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  margin-bottom: 32px;
}
.si-bill-to { flex: 1; }
.si-currency-wrap { min-width: 160px; }
.si-currency-wrap label { display: block; margin-bottom: 4px; }
.si-currency-wrap .form-control-sm { font-size: 13px; }

/* ── Shoot details band ─────────────────────────────────────────────────── */
.si-shoot-details {
  background: var(--si-green-pale);
  border-radius: var(--si-radius);
  padding: 16px 20px;
  margin-bottom: 28px;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}
.si-shoot-item {}
.si-shoot-label {
  font-size: 9px;
  color: var(--si-gray-mid);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 2px;
  font-family: 'Inter', sans-serif;
}
.si-shoot-val .si-field { font-size: 14px; font-weight: 600; color: var(--si-dark); font-family: 'Poppins', sans-serif; }

/* ── Items table ────────────────────────────────────────────────────────── */
.si-items-section { margin-bottom: 24px; }
.si-items-table { width: 100%; border-collapse: collapse; }

.si-items-table thead tr { border-bottom: 2px solid var(--si-gray-light); }
.si-items-table thead th {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--si-gray-mid);
  padding: 10px 14px;
  text-align: left;
  font-family: 'Inter', sans-serif;
}
.si-items-table thead th.text-right { text-align: right; }

.si-items-table tbody tr { border-bottom: 1px solid var(--si-green-pale); }
.si-items-table tbody tr:hover { background: var(--si-green-xpale); }
.si-items-table td { padding: 10px 10px; vertical-align: middle; }

.si-col-desc   { width: 50%; }
.si-col-qty    { width: 10%; text-align: right; }
.si-col-rate   { width: 18%; text-align: right; }
.si-col-amount { width: 18%; text-align: right; font-weight: 600; color: var(--si-dark); }
.si-col-del    { width: 4%; text-align: center; }

.si-item-desc { display: block; width: 100%; min-height: 28px; overflow: hidden; }
.si-item-num  { text-align: right; width: 100%; }

.si-del-btn {
  background: none; border: none; color: var(--si-gray-light);
  cursor: pointer; font-size: 14px; padding: 2px 6px; line-height: 1;
  transition: color .15s;
}
.si-del-btn:hover { color: #e74c3c; }

.si-add-item { padding: 8px 0; }
.si-add-item .btn-link { color: var(--si-green); padding: 0; font-size: 13px; font-family: 'Poppins', sans-serif; font-weight: 600; }
.si-add-item .btn-link:hover { color: var(--si-green-dark); text-decoration: none; }

/* ── Totals section ─────────────────────────────────────────────────────── */
/* ── Totals section layout ───────────────────────────────────────────────── */
.si-totals-section {
  display: flex;
  gap: 40px;
  margin-bottom: 28px;
  align-items: flex-start;
}
.si-notes-wrap { flex: 1; min-width: 0; }
.si-notes      { width: 100%; min-height: 80px; font-size: 13px; }

/* The totals block sits on the right half of the document */
.si-totals-wrap {
  width: 320px;
  flex-shrink: 0;
}

/* ── Totals table ────────────────────────────────────────────────────────────
   Fixed two-column layout.  Label column left-aligned, value column
   right-aligned.  No browser default padding anywhere.
   ─────────────────────────────────────────────────────────────────────────── */
.si-totals-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.si-totals-table td {
  padding: 0;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  line-height: 1;
  vertical-align: middle;
}

/* Label cell */
.si-tl {
  width: 170px;        /* fixed pixel width — labels never push the value column */
  padding: 11px 10px 11px 0;
  color: var(--si-gray-mid);
  text-align: left;
  white-space: nowrap;
}

/* Value cell — takes all remaining width, text right-aligned */
.si-tv {
  padding: 11px 0;
  text-align: right;
  color: var(--si-dark);
  font-weight: 500;
  white-space: nowrap;
}

/* ── Editable inputs inside the table ── */

/* Full-width right-aligned number input (discount, shipping, amount paid) */
.si-tval-input {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  text-align: right;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  color: var(--si-dark);
  transition: border-color .15s;
  -moz-appearance: textfield;
}
.si-tval-input::-webkit-inner-spin-button,
.si-tval-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.si-tval-input:hover  { border-bottom-color: var(--si-gray-light); }
.si-tval-input:focus  { outline: none; border-bottom-color: var(--si-green); }
.si-tval-input::placeholder { color: #bfcfbf; }

/* Inline editable label (e.g. "VAT", "Shipping") */
.si-tinline-input {
  display: inline-block;
  width: 68px;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  color: var(--si-gray-mid);
  transition: border-color .15s;
}
.si-tinline-input:hover  { border-bottom-color: var(--si-gray-light); }
.si-tinline-input:focus  { outline: none; border-bottom-color: var(--si-green); }

/* Percentage input (e.g. "20" in "VAT 20%") */
.si-tpct-input {
  display: inline-block;
  width: 32px;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  color: var(--si-gray-mid);
  text-align: center;
  transition: border-color .15s;
  -moz-appearance: textfield;
}
.si-tpct-input::-webkit-inner-spin-button,
.si-tpct-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.si-tpct-input:hover  { border-bottom-color: var(--si-gray-light); }
.si-tpct-input:focus  { outline: none; border-bottom-color: var(--si-green); }

/* Inline discount type dropdown */
.si-inline-select {
  display: inline-block;
  background: none;
  border: none;
  border-bottom: 1px solid var(--si-gray-light);
  font-size: 12px;
  color: var(--si-gray-mid);
  cursor: pointer;
  padding: 0 2px;
  font-family: 'Inter', sans-serif;
  margin-left: 4px;
  vertical-align: baseline;
}

/* Divider between rows and the balance */
td.si-total-divider {
  height: 1px;
  padding: 0 !important;
  line-height: 0;
  font-size: 0;
  border-bottom: 1.5px solid var(--si-gray-light);
}

/* Balance Due row */
.si-balance-row .si-tl,
.si-balance-row .si-tv {
  padding-top: 12px;
  padding-bottom: 4px;
}
.si-balance-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--si-gray-mid);
  font-family: 'Inter', sans-serif;
}
.si-balance {
  font-family: 'Poppins', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--si-green);
  letter-spacing: -1px;
  line-height: 1.1;
  text-align: right;
}

/* Toasts (bottom-right) */
.si-toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1200;
}
.si-toast {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  padding: 10px 14px;
  margin-top: 10px;
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.si-toast-msg { flex: 1; font-size: 13px; }
.si-toast-close { background: none; border: none; font-size: 16px; color: #666; cursor: pointer; }
.si-toast-success { border-left: 4px solid #2ecc71; }
.si-toast-error   { border-left: 4px solid #e74c3c; }
.si-toast-info    { border-left: 4px solid #3498db; }
/* .si-balance-label / .si-inline-select etc. — defined in totals block above */

/* ── Terms / Footer ─────────────────────────────────────────────────────── */
.si-terms-section  { margin-bottom: 24px; }
.si-terms          { width: 100%; font-size: 13px; }

.si-footer-section {
  border-top: 1px solid var(--si-gray-light);
  padding-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.si-footer-field {
  width: 100%;
  font-size: 12px;
  color: var(--si-gray-mid);
  text-align: center;
  font-family: 'Inter', sans-serif;
}
.si-powered-by { flex-shrink: 0; text-align: right; }
.si-powered-by img { width: 80px; opacity: .3; }
.si-powered-by p {
  font-size: 10px;
  color: var(--si-gray-light);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 4px 0 0;
  font-family: 'Inter', sans-serif;
}

/* ── Loading overlay ────────────────────────────────────────────────────── */
.si-loading-overlay { opacity: .5; pointer-events: none; }
.si-spinner-wrap { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); z-index: 9999; }
.si-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--si-gray-light);
  border-top-color: var(--si-green);
  border-radius: 50%;
  animation: si-spin .7s linear infinite;
  margin: auto;
}
@keyframes si-spin { to { transform: rotate(360deg); } }

/* ── Modals ─────────────────────────────────────────────────────────────── */
.si-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(26,43,26,.55);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.si-modal {
  background: #fff;
  border-radius: var(--si-radius-lg);
  box-shadow: 0 16px 64px rgba(26,43,26,.25);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  animation: si-modal-in .18s ease;
}
@keyframes si-modal-in {
  from { opacity: 0; transform: translateY(-12px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
.si-settings-modal { max-width: 560px; }

.si-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--si-gray-light);
}
.si-modal-header h5 { margin: 0; font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 16px; }
.si-modal-close {
  background: none; border: none; font-size: 24px; line-height: 1;
  cursor: pointer; color: var(--si-gray-mid); padding: 0;
  transition: color .15s;
}
.si-modal-close:hover { color: var(--si-dark); }

.si-modal-body   { padding: 24px; }
.si-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--si-gray-light);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Auth modal */
.si-auth-modal { max-width: 380px; }
.si-auth-modal .si-modal-header { justify-content: center; border-bottom: none; padding-bottom: 0; }
.si-auth-logo-img { height: 44px; }
.si-auth-title { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 20px; margin-bottom: 4px; text-align: center; }
.si-auth-sub   { color: var(--si-gray-mid); font-size: 13px; margin-bottom: 20px; text-align: center; }
.si-auth-input { height: 46px; font-size: 15px; border-color: var(--si-gray-light); border-radius: var(--si-radius); }
.si-auth-input:focus { border-color: var(--si-green); box-shadow: 0 0 0 .2rem rgba(92,191,90,.2); }

.si-go-btn {
  height: 50px;
  font-family: 'Poppins', sans-serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 3px;
  background: var(--si-green);
  border-color: var(--si-green);
  border-radius: var(--si-radius);
}
.si-go-btn:hover,
.si-go-btn:focus { background: var(--si-green-dark); border-color: var(--si-green-dark); }

.si-auth-links { text-align: center; margin-top: 16px; font-size: 13px; color: var(--si-gray-mid); }
.si-auth-links a { color: var(--si-green); font-weight: 600; }
.si-auth-links a:hover { color: var(--si-green-dark); }

/* Settings tabs */
.si-settings-tabs {
  display: flex;
  border-bottom: 2px solid var(--si-gray-light);
  padding: 0 24px;
}
.si-tab-btn {
  background: none; border: none; padding: 10px 16px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  color: var(--si-gray-mid);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s;
  font-family: 'Poppins', sans-serif;
}
.si-tab-btn.active { color: var(--si-green); border-bottom-color: var(--si-green); }
.si-tab-btn:hover  { color: var(--si-dark); }

.si-settings-logo    { max-width: 180px; max-height: 120px; object-fit: contain; }
.si-logo-placeholder-lg {
  padding: 28px;
  border: 2px dashed var(--si-gray-light);
  border-radius: var(--si-radius);
  display: inline-block;
  background: var(--si-gray-bg);
}

/* ── Dashboard ──────────────────────────────────────────────────────────── */
.si-dashboard { padding: 32px 0; }

.si-stat-card {
  background: #fff;
  border-radius: var(--si-radius-lg);
  box-shadow: var(--si-shadow-sm);
  padding: 22px 16px;
  text-align: center;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  border: 2px solid transparent;
}
.si-stat-card:hover { transform: translateY(-3px); box-shadow: var(--si-shadow); }
.si-stat-card.si-stat-active { border-color: var(--si-green); }
.si-stat-count {
  font-family: 'Poppins', sans-serif;
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--si-dark);
  line-height: 1;
}
.si-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--si-gray-mid);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-family: 'Inter', sans-serif;
}
.si-stat-all .si-stat-count { color: var(--si-green); }

.si-doc-table-wrap { background: #fff; border-radius: var(--si-radius-lg); box-shadow: var(--si-shadow-sm); overflow: hidden; }
.si-doc-table { margin: 0; font-size: 14px; }
.si-doc-table thead th {
  background: var(--si-dark);
  color: rgba(255,255,255,.75);
  border: none;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-family: 'Inter', sans-serif;
  padding: 12px 16px;
}
.si-doc-row { cursor: pointer; transition: background .1s; }
.si-doc-row:hover td { background: var(--si-green-xpale); }
.si-doc-table td { padding: 12px 16px; vertical-align: middle; border-color: var(--si-green-pale); }
.si-mono { font-family: 'SF Mono', 'Courier New', monospace; font-size: 13px; }

.si-type-badge {
  display: inline-block; padding: 3px 10px; border-radius: 100px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  font-family: 'Poppins', sans-serif;
}
.si-type-invoice        { background: var(--si-green-pale); color: var(--si-green-dark); }
.si-type-quotation      { background: #fff8e1; color: #e65100; }
.si-type-receipt        { background: #e3f2fd; color: #1565c0; }
.si-type-credit_note    { background: #fce4ec; color: #880e4f; }
.si-type-purchase_order { background: #ede7f6; color: #4527a0; }

.si-del-doc-btn { opacity: 0; transition: opacity .15s; }
.si-doc-row:hover .si-del-doc-btn { opacity: 1; }

.si-empty-state { text-align: center; padding: 64px 20px; color: var(--si-gray-mid); }
.si-empty-icon  { font-size: 52px; display: block; margin-bottom: 14px; opacity: .2; }

/* ── Print styles ───────────────────────────────────────────────────────── */
@media print {
  .no-print   { display: none !important; }
  .print-only { display: block !important; }

  body { background: #fff; }

  .si-paper-wrap { padding: 0; }
  .si-paper {
    box-shadow: none;
    border-radius: 0;
    max-width: 100%;
  }
  .si-inv-header { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .si-status-bar { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .si-field { border-bottom: none !important; }
  .si-items-table tbody tr:hover { background: none; }
  a { color: inherit !important; text-decoration: none !important; }
}

.print-only { display: none; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 680px) {
  .si-doc-body        { padding: 24px 20px; }
  .si-inv-header      { padding: 28px 20px; flex-direction: column; }
  .si-doc-title-wrap  { text-align: left; }
  .si-doc-title       { font-size: 32px; }
  .si-status-bar      { padding: 12px 20px; gap: 16px; }
  .si-bill-to-row     { flex-direction: column; }
  .si-totals-section  { flex-direction: column; }
  .si-totals-wrap     { width: 100%; }
}

/* ══════════════════════════════════════════════════════════════════════════
   NEW ADDITIONS — April 2026
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Action bar layout fix ───────────────────────────────────────────────── */
.si-action-bar .d-flex { width: 100%; }
.si-action-btns { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }

/* ── Auto-save status — always far right in action bar ───────────────────── */
.si-autosave-status {
  display: flex;
  align-items: center;
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  letter-spacing: .02em;
  white-space: nowrap;
  padding-left: 12px;
}

/* ── Document type selector — inside the green header top-right ──────────── */
.si-type-select-title {
  -webkit-appearance: none;
  appearance: none;
  background: rgba(0,0,0,.18);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='rgba(255,255,255,.6)'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  border: 1.5px solid rgba(255,255,255,.25);
  border-radius: var(--si-radius);
  color: #fff;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -1.5px;
  line-height: 1;
  margin-bottom: 8px;
  padding: 4px 40px 4px 10px;
  text-transform: uppercase;
  transition: border-color .15s, background .15s;
  width: 100%;
  max-width: 320px;
}
.si-type-select-title:focus { outline: none; border-color: rgba(255,255,255,.7); background-color: rgba(0,0,0,.25); }
.si-type-select-title option { background: var(--si-dark); color: #fff; font-size: 16px; font-weight: 600; letter-spacing: 0; text-transform: none; }

/* ── Currency select (status bar) ────────────────────────────────────────── */
.si-currency-select {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='rgba(255,255,255,.4)'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,.2);
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  padding: 0 20px 0 0;
  max-width: 130px;
}
.si-currency-select:focus { outline: none; border-bottom-color: var(--si-green); }
.si-currency-select option { background: var(--si-dark); color: #fff; }

/* Custom ISO code text input (appears when "Other" selected) */
.si-currency-custom-input {
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--si-green);
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 13px;
  padding: 0;
  width: 50px;
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.si-currency-custom-input::placeholder { color: rgba(255,255,255,.35); text-transform: none; letter-spacing: 0; }
.si-currency-custom-input:focus { outline: none; border-bottom-color: #fff; }

/* ── Toast notifications — bottom right ─────────────────────────────────── */
.si-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
  pointer-events: none;
}

.si-toast {
  pointer-events: all;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--si-radius);
  box-shadow: 0 8px 32px rgba(26,43,26,.22);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  line-height: 1.4;
  animation: si-toast-in .22s cubic-bezier(.22,1,.36,1);
  transition: opacity .3s ease, transform .3s ease;
}
.si-toast.ng-hide {
  opacity: 0;
  transform: translateX(20px);
}

@keyframes si-toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: none; }
}

.si-toast-success { background: var(--si-dark);    color: var(--si-green-light); border-left: 4px solid var(--si-green); }
.si-toast-error   { background: #2d0d0d;            color: #ff8a80;               border-left: 4px solid #e74c3c; }
.si-toast-info    { background: var(--si-dark);    color: #90caf9;               border-left: 4px solid #42a5f5; }
.si-toast-warning { background: var(--si-dark);    color: #ffe082;               border-left: 4px solid #ffa726; }

.si-toast-msg  { flex: 1; }
.si-toast-close {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,.4); font-size: 18px; line-height: 1;
  padding: 0; flex-shrink: 0; margin-top: -1px;
  transition: color .15s;
}
.si-toast-close:hover { color: rgba(255,255,255,.9); }

/* (totals table rules consolidated above — see .si-totals-table section) */

/* ── Print tweaks ─────────────────────────────────────────────────────────── */
@media print {
  .si-toast-container { display: none !important; }
  .si-type-select-title { display: none !important; }
}
