:root{
  --brand: #0d6efd; /* primary blue */
  --brand-dark: #084298;
  --muted: #6c757d;
  --card-bg: #ffffff;
}

body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  color: #222;
}

.navbar.bg-primary {
  background: linear-gradient(90deg, var(--brand), var(--brand-dark));
}

.card {
  background: var(--card-bg);
  border-radius: .5rem;
  box-shadow: 0 6px 18px rgba(20,30,50,0.06);
}

.form-control:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 .15rem rgba(13,110,253,0.12);
}

.btn-primary {
  background-color: var(--brand);
  border-color: var(--brand);
}

.table thead {
  background: rgba(13,110,253,0.06);
}

.small-muted {
  color: var(--muted);
  font-size: .9rem;
}
/* Info icon */
.info-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 50%;
    background-color: #b2c3d4;
    color: #ffffff;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    margin-left: 6px;
    position: relative;
}

/* Tooltip text */
.info-icon::after {
    content: attr(data-info);
    position: absolute;
    left: 22px;
    top: -4px;
    background-color: #333333;
    color: #ffffff;
    padding: 6px 8px;
    border-radius: 4px;
    white-space: nowrap;
    font-size: 12px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
    z-index: 100;
}

/* Show tooltip on hover */
.info-icon:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Table spacing */
table {
    border-collapse: collapse;
}

td {
    padding: 6px 0;
}

/* Input fields */
input[type="text"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 6px;
}

/* Submit button */
button {
    padding: 6px 14px;
    cursor: pointer;
}
.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
    border: 1px solid #c3e6cb;
}
.spinner {
    display: none;
    margin-left: 8px;
    font-size: 12px;
}

.spinner::after {
    content: '⏳';
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.username-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.username-icon {
    font-size: 16px;
    display: none;
}

.username-icon.success {
    color: rgb(124, 209, 124);
}

.username-icon.error {
    color: rgb(239, 113, 113);
}

.username-status {
    font-size: 12px;
    white-space: nowrap;
}

.username-status.success {
    color: rgb(124, 209, 124);
}

.username-status.error {
    color: rgb(239, 113, 113);
}

.spinner {
    font-size: 12px;
    display: none;
}

/* for create invoice block */
/* Import friendly free fonts */
  @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&family=Merriweather:wght@300;400;700&display=swap');

  /* page-level gentle background */

  body {
    background: #e9ecef;
    color: #4b586c;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  }

  /* spacing and smaller section headings */
  .invoice-title { margin-bottom: 2rem; font-family: 'Merriweather', serif; color: #4b586c; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }

  /* card containing the form */
  .card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid #6c757d;
  }

  /* each section has its own border and a very light background */
  .section {
    border: 1px solid #adb5bd;
    padding: 1rem;
    border-radius: .35rem;
    margin-bottom: 1rem;
    background-color: #f8f9fa;
  }

  .section-title { font-size: 1.05rem; font-weight: 700; margin-bottom: .75rem; color: #4b586c; font-family: 'Merriweather', serif; border-bottom: 2px solid #6c757d; padding-bottom: 0.5rem; }
  .small-label { font-size: 0.9rem; font-weight: 600; color: #4b586c; }

  /* Input/Select/Textarea - easy-on-eyes background and smooth focus */
  .form-control,
  textarea.form-control,
  select.form-control {
    background-color: #ffffff;
    border: 1px solid #6c757d;
    color: #4b586c;
        font-weight: bold;
  }

  .form-control:hover { background-color: #fff; border-color: #495057; }

  /* Clear, accessible focus styling */
  .form-control:focus,
  textarea.form-control:focus,
  select.form-control:focus,
  .form-control:focus-visible {
    background-color: #a6b4c1;
    border-color: #495057;
    box-shadow: 0 0 0 0.25rem rgba(73, 80, 87, 0.25);
    outline: 0;
  }

  /* smaller inputs spacing preserved */
  .form-control-sm { padding: 0.25rem 0.5rem; }

  /* keep headings smaller and spaced */
  h5.section-title { margin: 0 0 1rem 0; font-size: 1.05rem; }

  /* subtle table header styling */
  table.table thead th { background: #4f789f; color: #ffffff; font-weight: 600; border-bottom: 2px solid #495057; }
  table.table-bordered td, table.table-bordered th { border: 1px solid #dee2e6; color: #4b586c; }
  #itemsTable { table-layout: fixed; width: 100%; }
  #itemsTable input, #itemsTable select { width: 100%; }

  /* Checkbox contrast */
  .form-check-input { border: 1px solid #6c757d; }
  .form-check-input:checked { background-color: #0d6efd; border-color: #0d6efd; }
  .form-check-input:focus { border-color: #495057; box-shadow: 0 0 0 0.25rem rgba(73, 80, 87, 0.25); }

  /* Hide delete button on the first row */
  #itemsTable tbody tr:first-child .delete-row-btn { display: none; }

  /* Polished HSN Suggestions Dropdown */
  .hsn-suggestions {
    position: absolute;
    z-index: 2000;
    background: #fff;
    border: 0 !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12) !important;
    max-height: 250px;
    overflow-y: auto;
    padding: 5px !important;
    font-family: 'Inter', sans-serif;
  }
  .hsn-suggestion-item {
    padding: 10px 16px;
    border: 1px solid #dee2e6;
    margin-bottom: 5px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .hsn-suggestion-item:last-child { margin-bottom: 0; }
  .hsn-suggestion-item:hover { background-color: #f8f9fa; padding-left: 20px; }
  
  .hsn-suggestion-item .item-content { display: flex; align-items: center; flex: 1; min-width: 0; margin-right: 12px; }
  .hsn-suggestion-item strong { color: #3b82f6; font-weight: 600; margin-right: 6px; font-size: 0.95rem; }
  .hsn-suggestion-item .desc-text { color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.9rem; }
  
  .hsn-suggestion-item .rate-badge {
    background: #eff6ff; color: #2563eb; padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; white-space: nowrap; letter-spacing: 0.5px;
  }

  /* Placeholder styling */
  ::placeholder {
    color: #aab2bd !important;
    opacity: 1;
  }
