body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    max-width: 420px;
    width: 100%;
}

.brand-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0d6efd;
    color: #fff;
}

.card-hover {
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.card-hover:hover {
    box-shadow: 0 0.75rem 1.5rem rgba(15, 23, 42, 0.08);
    transform: translateY(-2px);
}

.sidebar .nav-link.active,
.nav-pills .nav-link.active {
    background-color: #0d6efd;
}

.invoice-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
}


/* === Items & Totals responsive tweaks (auto-added) === */

/* Bigger controls */
.items-table .form-control{min-height:42px;font-size:15px;}
.items-table textarea.form-control{min-height:72px;}
/* Keep note delete aligned */
.items-table .note-row .delete-note-btn{min-width:44px;}

/* Mobile layout: make Service full width, then 4 fields row, then totals */
@media (max-width: 768px){
  .items-table thead{display:none;}
  .items-table tbody tr.item-row{
    display:block;
    border:1px solid #e5e7eb;
    border-radius:12px;
    padding:10px;
    margin-bottom:12px;
    background:#fff;
  }
  .items-table tbody tr.item-row td{
    border:0;
    padding:6px 4px;
  }

  /* # */
  .items-table tbody tr.item-row td:nth-child(1){
    display:inline-block;
    width:10%;
    padding-top:12px;
  }
  /* Service full width */
  .items-table tbody tr.item-row td:nth-child(2){
    display:inline-block;
    width:90%;
  }
  /* Qty/Price/Discount/Total as 4-up grid */
  .items-table tbody tr.item-row td:nth-child(3),
  .items-table tbody tr.item-row td:nth-child(4),
  .items-table tbody tr.item-row td:nth-child(5),
  .items-table tbody tr.item-row td:nth-child(6){
    display:inline-block;
    width:25%;
  }
  /* Remove item button */
  .items-table tbody tr.item-row td:nth-child(7){
    display:block;
    width:100%;
    text-align:right;
    padding-top:4px;
  }

  /* Notes row below as full width */
  .items-table tbody tr.note-row{
    display:block;
    border:1px dashed #e5e7eb;
    border-radius:12px;
    padding:10px;
    margin-top:-6px;
    margin-bottom:14px;
    background:#fff;
  }
  .items-table tbody tr.note-row td{
    border:0;
    padding:0;
  }
  .items-table tbody tr.note-row td.note-cell{
    display:block;
    width:100%;
  }
  .items-table tbody tr.note-row .d-flex{
    gap:10px !important;
  }

  .items-table .form-control{min-height:52px;font-size:16px;}
  .items-table textarea.form-control{min-height:90px;}
  .items-table .btn{min-height:46px;}
}

/* Stack Items + Totals: totals full width bottom */
.items-totals-stack .items-col,
.items-totals-stack .totals-col{flex:0 0 100%;max-width:100%;}

/* ===== MOBILE STACKED ITEMS TABLE (Invoice/Quote) ===== */
/* Makes Item/Service full width, fields bigger, notes below (like provided mobile mock) */
@media (max-width: 768px) {
  table.items-table input.form-control,
  table.items-table textarea.form-control {
    min-height: 48px;
    font-size: 16px;
  }

  table.items-table { width: 100%; }
  table.items-table thead { display: none; }
  table.items-table tbody,
  table.items-table tr,
  table.items-table td {
    display: block;
    width: 100%;
  }

  table.items-table tr.item-row {
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    background: #fff;
  }

  table.items-table tr.item-row td {
    border: none !important;
    padding: 8px 0 !important;
  }

  /* hide row number on mobile */
  table.items-table tr.item-row td:first-child {
    display: none;
  }

  /* Item/Service full width */
  table.items-table tr.item-row td:nth-child(2) {
    width: 100%;
  }

  /* Qty/Unit/Discount/Total as 2-column grid */
  table.items-table tr.item-row td:nth-child(3),
  table.items-table tr.item-row td:nth-child(4),
  table.items-table tr.item-row td:nth-child(5),
  table.items-table tr.item-row td:nth-child(6) {
    width: 48%;
    display: inline-block;
    vertical-align: top;
    margin-right: 4%;
  }
  table.items-table tr.item-row td:nth-child(4),
  table.items-table tr.item-row td:nth-child(6) {
    margin-right: 0;
  }

  /* remove button full width and aligned right */
  table.items-table tr.item-row td:last-child {
    width: 100%;
    text-align: right;
    padding-top: 6px !important;
  }

  /* Notes row: card-style */
  table.items-table tr.note-row {
    border: 1px dashed #e9ecef;
    border-radius: 12px;
    padding: 10px 12px;
    margin: -6px 0 16px 0;
    background: #fafafa;
  }
  table.items-table tr.note-row td { border: none !important; padding: 0 !important; }
  table.items-table tr.note-row .note-cell { width: 100%; }
  table.items-table tr.note-row textarea {
    width: 100%;
    min-height: 70px;
  }
  table.items-table tr.note-row .delete-note-btn {
    min-width: 44px;
    min-height: 44px;
  }
}


/* ===== Invoice / Quote item editor refresh ===== */
.items-table {
  table-layout: fixed;
}

.items-table .item-desc,
.items-table .item-notes {
  line-height: 1.45;
  resize: vertical;
  white-space: pre-wrap;
}

.items-table .item-desc {
  min-height: 84px;
}

.items-table .item-notes {
  min-height: 76px;
}

.items-table .item-total[readonly] {
  background: #f8fafc;
}

.items-table tbody tr.item-row td:nth-child(2) textarea,
.items-table tbody tr.note-row .item-notes {
  box-shadow: none;
}

@media (max-width: 768px) {
  .items-table {
    border-collapse: separate;
    border-spacing: 0 14px;
  }

  .items-table thead {
    display: none !important;
  }

  .items-table tbody,
  .items-table tr,
  .items-table td {
    display: block;
    width: 100%;
  }

  .items-table tbody tr.item-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 0;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
  }

  .items-table tbody tr.item-row td,
  .items-table tbody tr.note-row td {
    border: 0 !important;
    padding: 0 !important;
  }

  .items-table tbody tr.item-row td::before,
  .items-table tbody tr.note-row .note-cell::before {
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
  }

  .items-table tbody tr.item-row td:nth-child(1) {
    grid-column: 1 / -1;
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    max-width: 42px;
    padding: 0 10px !important;
    border-radius: 999px;
    background: #eff6ff;
    color: #2563eb !important;
    font-weight: 700;
  }

  .items-table tbody tr.item-row td:nth-child(1)::before {
    content: none;
  }

  .items-table tbody tr.item-row td:nth-child(2) {
    grid-column: 1 / -1;
  }

  .items-table tbody tr.item-row td:nth-child(2)::before {
    content: 'Item / Service';
  }

  .items-table tbody tr.item-row td:nth-child(3)::before {
    content: 'Qty';
  }

  .items-table tbody tr.item-row td:nth-child(4)::before {
    content: 'Unit Price';
  }

  .items-table tbody tr.item-row td:nth-child(5)::before {
    content: 'Discount %';
  }

  .items-table tbody tr.item-row td:nth-child(6)::before {
    content: 'Line Total';
  }

  .items-table tbody tr.item-row td:nth-child(7) {
    grid-column: 1 / -1;
    text-align: right;
  }

  .items-table tbody tr.item-row td:nth-child(7)::before {
    content: none;
  }

  .items-table tbody tr.note-row {
    display: block;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    padding: 14px;
    margin: 10px 0 18px;
    background: #f8fafc;
  }

  .items-table tbody tr.note-row .note-cell::before {
    content: 'Notes';
  }

  .items-table tbody tr.note-row .d-flex {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px !important;
    align-items: start !important;
  }

  .items-table .form-control,
  .items-table .btn {
    min-height: 52px;
    font-size: 16px;
  }

  .items-table .item-desc {
    min-height: 128px;
  }

  .items-table .item-notes {
    min-height: 108px;
  }

  .items-table .remove-row-btn,
  .items-table .delete-note-btn {
    min-width: 48px;
  }
}
