/* ============================================================
   JokesWebApp – Global Stylesheet
   ============================================================ */

:root {
  --bg:           #f8f4ec;
  --surface:      rgba(255, 255, 255, 0.84);
  --surface-solid:#ffffff;
  --surface-soft: rgba(255, 248, 241, 0.92);
  --text:         #1d2a38;
  --muted:        #66707a;
  --muted-soft:   #8b94a0;
  --accent:       #ff7a18;
  --accent-dark:  #d95f05;
  --accent-soft:  rgba(255, 122, 24, 0.12);
  --line:         rgba(29, 42, 56, 0.12);
  --line-strong:  rgba(29, 42, 56, 0.2);
  --shadow:       0 18px 40px rgba(29, 42, 56, 0.08);
  --shadow-soft:  0 12px 28px rgba(29, 42, 56, 0.06);
  --success-soft: #eaf8ee;
  --danger-soft:  #fff1f3;
  --radius:       20px;
}

/* ---------- Reset & base ---------- */
html { font-size: 16px; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 122, 24, 0.17), transparent 28%),
    linear-gradient(180deg, #fffaf2 0%, var(--bg) 100%);
  font-family: "Segoe UI", "Trebuchet MS", Arial, sans-serif;
  position: relative;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: -1;
  filter: blur(8px);
}

body::before {
  top: 9rem;
  right: -6rem;
  width: 16rem;
  height: 16rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 159, 67, 0.18), transparent 65%);
}

body::after {
  bottom: 4rem;
  left: -5rem;
  width: 14rem;
  height: 14rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(217, 95, 5, 0.12), transparent 68%);
}

/* ---------- Navbar ---------- */
.navbar {
  background: rgba(255, 255, 255, 0.82) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line) !important;
  box-shadow: 0 6px 24px rgba(29, 42, 56, 0.05);
  padding: 0.5rem 1rem;
}

.app-navbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  border: 1px solid #d7e5f3;
  border-radius: 16px;
  margin: 0.75rem auto 1rem;
  background: linear-gradient(135deg, #f8fbff 0%, #eef5fc 100%) !important;
  box-shadow: 0 10px 22px rgba(11, 59, 110, 0.12);
  backdrop-filter: blur(6px);
}

.app-nav-shell {
  max-width: 1120px;
  padding: 0.6rem 0.9rem;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-right: 1rem;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #0b3b6e;
}

.app-brand:hover,
.app-brand:focus {
  color: #0e57a0;
}

.app-nav-toggle {
  border: 1px solid #c8dbef;
  border-radius: 10px;
  padding: 0.42rem 0.52rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.app-nav-toggle:hover,
.app-nav-toggle:focus {
  border-color: #2c7bc4;
  background-color: #f4f9ff;
  box-shadow: 0 0 0 3px rgba(44, 123, 196, 0.16);
}

.app-nav-collapse {
  align-items: center;
  gap: 0.7rem;
}

.app-nav-links {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  list-style: none;
  margin: 0;
  padding-left: 0;
}

.app-nav-links .nav-link {
  border-radius: 8px;
  padding: 0.28rem 0.55rem !important;
  font-weight: 600;
  color: #20486f !important;
  transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.app-nav-links .nav-link:hover,
.app-nav-links .nav-link:focus {
  color: #0d4f8f !important;
  background-color: #e8f1fb;
  box-shadow: inset 0 0 0 1px #d0e3f6;
}

.app-nav-links .nav-link.active,
.app-nav-links .nav-link[aria-current="page"] {
  color: #0d4f8f !important;
  background-color: #dcecff;
  box-shadow: inset 0 0 0 1px #bbd6f6;
}

.app-nav-account {
  margin-left: auto;
}

.app-account-links {
  align-items: center;
  gap: 0.6rem;
  list-style: none;
  margin: 0;
  padding-left: 0;
}

.app-nav-links li,
.app-account-links li {
  list-style: none;
}

.app-account-links .nav-link {
  border-radius: 8px;
  padding: 0.28rem 0.55rem !important;
  font-weight: 600;
  color: #1f466b !important;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.app-account-links .nav-link:hover,
.app-account-links .nav-link:focus {
  color: #0e57a0 !important;
  background-color: #ebf4ff;
}

.app-account-links .btn-link {
  text-decoration: none;
  border: none;
  box-shadow: none;
}

.app-account-links .btn-link:hover,
.app-account-links .btn-link:focus {
  text-decoration: none;
}

@media (max-width: 991.98px) {
  .app-navbar {
    border-radius: 14px;
    margin-top: 0.5rem;
  }

  .app-nav-shell {
    padding: 0.5rem 0.6rem;
  }

  .app-nav-links {
    margin-top: 0.45rem;
    padding-top: 0.45rem;
    border-top: 1px solid #dbe9f7;
  }

  .app-nav-links .nav-link {
    padding: 0.52rem 0.65rem !important;
  }

  .app-nav-account {
    margin-left: 0;
    margin-top: 0.35rem;
    width: 100%;
  }

  .app-account-links {
    padding-top: 0.45rem;
    border-top: 1px dashed #dbe9f7;
  }

  .app-account-links .nav-link {
    display: block;
    width: 100%;
  }
}

.navbar-brand {
  display: inline-flex;
  flex-direction: column;
  gap: 0.05rem;
  color: var(--text) !important;
}

.navbar-brand:hover { color: var(--accent) !important; }

.brand-mark {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1.05;
}

.brand-meta {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.nav-link {
  font-weight: 600;
  border-radius: 999px;
  padding: 0.5rem 1rem !important;
  transition: background 0.2s, color 0.2s;
  color: var(--text) !important;
}

.nav-link:hover,
.nav-link:focus {
  background: rgba(255, 122, 24, 0.12);
  color: var(--accent-dark) !important;
}

/* ---------- Layout shell ---------- */
.container { max-width: 1120px; }

main { padding-top: 1.25rem; padding-bottom: 3rem; }

/* ---------- Hero (Home page) ---------- */
.hero {
  padding: 3.5rem 2rem;
  text-align: center;
  border-radius: 28px;
  background: linear-gradient(135deg, #ff7a18, #ff9f43);
  color: #fff;
  box-shadow: 0 24px 56px rgba(217, 95, 5, 0.22);
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 4.25rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.hero p  { font-size: 1.1rem; opacity: 0.95; max-width: 680px; margin: 0 auto; }
.hero a  { color: #fff; font-weight: 700; text-decoration: underline; }
.hero a:hover { opacity: 0.85; }

/* ---------- Page shell (content pages) ---------- */
.page-shell {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

/* ---------- Section title ---------- */
.section-title {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0;
}

.page-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 122, 24, 0.1);
  color: var(--accent-dark);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.65rem;
}

.section-subtitle {
  max-width: 64ch;
  margin: 0.45rem 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.panel-head {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 1rem;
}

.panel-kicker {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-dark);
}

.panel-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
}

.panel-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.form-section {
  padding: 1rem 1rem 1.1rem;
  border: 1px solid rgba(29, 42, 56, 0.08);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(255,247,240,0.75) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.form-section + .form-section {
  margin-top: 1rem;
}

.form-section-title {
  margin: 0 0 0.9rem;
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.02em;
}

.field-hint {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.search-shell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.9) 0%, rgba(255,246,237,0.95) 100%);
  border: 1px solid rgba(29, 42, 56, 0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72);
}

.search-shell .form-control,
.search-shell .form-select {
  background-color: #fff;
}

.search-shell .btn {
  white-space: nowrap;
}

.table-card-note {
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.dense-data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.dense-data-table td {
  font-size: 0.92rem;
}

.money-cell {
  font-weight: 700;
  color: var(--accent-dark);
  white-space: nowrap;
}

.compact-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge-soft {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.3rem;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 122, 24, 0.12);
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
}

.badge-soft.low {
  background: #fff3cd;
  color: #8a6d03;
}

.badge-soft.out {
  background: #f8d7da;
  color: #842029;
}

.results-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 0 0 1rem;
}

.inline-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  margin-left: 0.35rem;
  border-radius: 999px;
  background: rgba(255, 122, 24, 0.12);
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 900;
  cursor: help;
}

.summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1rem;
}

.summary-chip {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-width: 8rem;
  padding: 0.8rem 0.95rem;
  border-radius: 18px;
  border: 1px solid rgba(29, 42, 56, 0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(255,247,240,0.82) 100%);
  box-shadow: var(--shadow-soft);
}

.summary-chip-label {
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 800;
}

.summary-chip-value {
  margin-top: 0.25rem;
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1.1;
}

.summary-chip-subtle .summary-chip-value {
  color: var(--accent-dark);
}

/* ---------- Card panel (forms) ---------- */
.card-panel {
  background: linear-gradient(180deg, #fffdf9 0%, var(--surface-solid) 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow);
  max-width: 480px;
}

.card {
  border: 1px solid rgba(29, 42, 56, 0.08);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(255,250,244,0.96) 100%);
}

.card-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  font-weight: 800;
  letter-spacing: 0.03em;
}

.card-body {
  padding: 1.4rem 1.5rem;
}

/* ---------- Typography ---------- */
a { color: var(--accent-dark); text-decoration: none; }
a:hover { color: var(--accent); }

/* ---------- Buttons ---------- */
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 0.6rem 1.35rem;
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(255, 122, 24, 0.22);
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  box-shadow: 0 14px 28px rgba(217, 95, 5, 0.28);
}

.btn-secondary {
  background: rgba(29, 42, 56, 0.08);
  border-color: rgba(29, 42, 56, 0.1);
  color: var(--text);
  border-radius: 999px;
  padding: 0.6rem 1.35rem;
  font-weight: 600;
}

.btn-secondary:hover,
.btn-secondary:focus {
  background: rgba(29, 42, 56, 0.14);
  border-color: rgba(29, 42, 56, 0.14);
  color: var(--text);
}

.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-danger,
.btn-success,
.btn-dark {
  border-radius: 999px;
  font-weight: 700;
}

.btn-danger {
  border-radius: 999px;
  padding: 0.6rem 1.35rem;
  font-weight: 700;
}

button:disabled,
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed !important;
  pointer-events: none;
}

/* ---------- Forms ---------- */
.form-group { margin-bottom: 1.1rem; }


.form-label,
label.control-label {
  font-weight: 600;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.form-control,
.form-select {
  min-height: 3rem;
  border-radius: 14px;
  border: 1.5px solid rgba(29, 42, 56, 0.14);
  background-color: rgba(255, 255, 255, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
  padding: 0.72rem 1rem;
  font-size: 1rem;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s, background-color 0.2s;
}

.form-control:hover,
.form-select:hover {
  border-color: var(--line-strong);
  background-color: #fff;
}

.form-control::placeholder {
  color: var(--muted-soft);
}

.form-select {
  cursor: pointer;
  padding-right: 3rem;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--accent) 50%),
    linear-gradient(135deg, var(--accent) 50%, transparent 50%),
    linear-gradient(to right, rgba(29, 42, 56, 0.08), rgba(29, 42, 56, 0.08));
  background-position:
    calc(100% - 1.25rem) calc(1.2rem),
    calc(100% - 0.95rem) calc(1.2rem),
    calc(100% - 2.5rem) 0.7rem;
  background-size: 0.42rem 0.42rem, 0.42rem 0.42rem, 1px 1.6rem;
  background-repeat: no-repeat;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--accent);
  background-color: #fff;
  box-shadow: 0 0 0 0.25rem rgba(255, 122, 24, 0.14), 0 10px 24px rgba(255, 122, 24, 0.08);
  transform: translateY(-1px);
  outline: none;
}

.form-control[readonly] {
  background-color: #f7f7f8;
  color: var(--muted);
}

.form-control-sm,
.form-select-sm {
  min-height: 2.55rem;
  border-radius: 12px;
  font-size: 0.92rem;
}

.form-text {
  color: var(--muted);
  font-size: 0.82rem;
}

.text-danger.small,
.invalid-feedback,
.field-validation-error {
  font-size: 0.78rem;
  font-weight: 600;
}

.input-validation-error,
.form-control.is-invalid,
.form-select.is-invalid {
  border-color: #dc3545;
  background-color: var(--danger-soft);
}

.input-validation-error:focus,
.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
  box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.12);
}

.form-control.is-valid,
.form-select.is-valid {
  border-color: #198754;
  background-color: var(--success-soft);
}

.dropdown-with-new + div .form-control {
  margin-top: 0.2rem;
  background: linear-gradient(180deg, #fff7f1 0%, #ffffff 100%);
}

.table-responsive {
  border-radius: 18px;
}

.grid-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-gutter: stable both-edges;
  padding-bottom: 0.35rem;
}

.grid-scroll .table {
  min-width: 980px;
}

.sticky-col-1,
.sticky-col-2,
.sticky-col-right {
  position: sticky;
  z-index: 2;
  background: #fff;
}

.sticky-col-1 {
  left: 0;
  min-width: 80px;
}

.sticky-col-2 {
  left: 80px;
  min-width: 150px;
}

.sticky-col-right {
  right: 0;
  min-width: 110px;
  box-shadow: -10px 0 18px rgba(29, 42, 56, 0.06);
}

.table thead .sticky-col-1,
.table thead .sticky-col-2,
.table thead .sticky-col-right {
  z-index: 3;
  background: #fff2e6;
}

.table tbody tr:hover .sticky-col-1,
.table tbody tr:hover .sticky-col-2,
.table tbody tr:hover .sticky-col-right {
  background: #fff9f4;
}

.grid-scroll::-webkit-scrollbar {
  height: 12px;
}

.grid-scroll::-webkit-scrollbar-track {
  background: rgba(29, 42, 56, 0.08);
  border-radius: 999px;
}

.grid-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 122, 24, 0.55);
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.65);
}

.grid-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(217, 95, 5, 0.75);
}

.power-entry-table {
  box-shadow: none;
  border-radius: 14px;
  overflow: hidden;
}

.power-entry-table th,
.power-entry-table td {
  padding: 0.55rem;
  font-size: 0.85rem;
}

.power-entry-table thead th {
  background: #fff7ef;
  text-align: center;
  letter-spacing: 0.05em;
}

.power-entry-table tbody th {
  background: #fff;
  font-weight: 700;
  white-space: nowrap;
}

.power-input {
  min-height: 2.25rem;
  border-radius: 10px;
  padding: 0.35rem 0.55rem;
  text-align: center;
}

.lens-type-options {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding-left: 1.2rem;
}

.lens-type-options li {
  list-style-type: disc;
}

.lens-type-options .form-check-input {
  margin-top: 0;
}

/* ---------- Table ---------- */
.table {
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-top: 1rem;
  background: #fff;
}

.table thead th {
  background: #fff2e6;
  color: var(--text);
  font-weight: 800;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: none;
  padding: 1rem 1.25rem;
}

.table td, .table th {
  padding: 1rem 1.25rem;
  vertical-align: middle;
  border-color: rgba(29, 42, 56, 0.07);
}

.table tbody tr:hover { background: #fff9f4; }

.table-sm td,
.table-sm th {
  padding: 0.75rem 0.85rem;
}

.table input.form-control,
.table select.form-select {
  min-height: 2.6rem;
}

.col-id {
  width: 80px;
  min-width: 80px;
  white-space: nowrap;
}

.col-phone {
  width: 150px;
  min-width: 150px;
  white-space: nowrap;
}

.col-compact {
  width: 110px;
  min-width: 110px;
  white-space: nowrap;
}

.col-narrow {
  width: 90px;
  min-width: 90px;
  white-space: nowrap;
}

.col-status {
  width: 96px;
  min-width: 96px;
  white-space: nowrap;
}

.col-price {
  width: 120px;
  min-width: 120px;
  white-space: nowrap;
}

.col-actions {
  width: 110px;
  min-width: 110px;
  white-space: nowrap;
}

.cell-wrap {
  white-space: normal;
  word-break: break-word;
}

.col-address {
  width: 280px;
  min-width: 280px;
}

.customer-contact-grid .form-control {
  min-height: 2.45rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.customer-contact-grid .form-label {
  margin-bottom: 0.28rem;
}

.customer-prescription-wrap {
  max-width: 560px;
}

.customer-prescription-wrap .power-entry-table {
  margin-top: 0.55rem;
  width: 100%;
  table-layout: fixed;
}

.customer-prescription-wrap .power-entry-table th,
.customer-prescription-wrap .power-entry-table td {
  padding: 0.42rem;
}

.customer-prescription-wrap .power-input {
  min-height: 1.95rem;
  padding: 0.22rem 0.45rem;
  font-size: 0.82rem;
}

.customer-prescription-wrap .power-input-tight,
.lens-power-wrap .power-input-tight {
  width: 4.8rem;
  min-width: 4.8rem;
  margin-left: auto;
  margin-right: auto;
}

.lens-power-wrap .power-entry-table {
  margin-top: 0.55rem;
  width: 100%;
  table-layout: fixed;
}

.lens-power-wrap .power-entry-table th,
.lens-power-wrap .power-entry-table td {
  padding: 0.42rem;
}

.lens-power-wrap .power-input {
  min-height: 1.95rem;
  padding: 0.22rem 0.45rem;
  font-size: 0.82rem;
}

/* ---------- Definition list (Details / Delete) ---------- */
.detail-card {
  background: var(--surface-solid);
  border-radius: 18px;
  padding: 1.5rem 2rem;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  max-width: 600px;
}

.detail-card dt {
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding-top: 0.6rem;
}

.detail-card dd {
  color: var(--text);
  font-size: 1.05rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
}

.detail-card dd:last-child { border-bottom: none; }

/* ---------- Footer ---------- */
.footer {
  position: static;
  padding: 1.25rem 0 2rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer .container {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(29, 42, 56, 0.06);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow-soft);
}

/* ---------- Invoice ---------- */
.invoice-sheet {
  background: #fff;
  border: 1.5px solid #1f1f1f;
  border-radius: 16px;
  padding: 1.2rem;
  box-shadow: 0 24px 48px rgba(17, 24, 39, 0.08);
}

.invoice-header h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.3rem;
  font-weight: 700;
}

.invoice-header {
  padding-bottom: 1rem;
  border-bottom: 2px solid #1f1f1f;
  margin-bottom: 0.8rem;
}

.invoice-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0 0 0.65rem;
}

.invoice-meta-card {
  border: 1px solid rgba(31, 31, 31, 0.18);
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  background: #fffdfa;
}

.invoice-meta-label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5c5c5c;
  font-weight: 700;
}

.invoice-meta-value {
  font-size: 1rem;
  font-weight: 700;
  color: #111;
}

.invoice-total-row td {
  background: #fff6ea;
}

.invoice-amount-words {
  font-size: 0.95rem;
  line-height: 1.7;
}

.invoice-bank-block,
.invoice-signature-block {
  min-height: 12rem;
}

.invoice-table {
  margin-top: 0 !important;
  border-radius: 0;
  box-shadow: none;
}

.invoice-table-scroll {
  width: 100%;
  overflow-x: auto;
}

.invoice-items-table {
  width: 100%;
  table-layout: fixed;
}

.invoice-items-table th {
  white-space: nowrap;
  font-size: 0.78rem;
  padding: 0.4rem 0.6rem;
  text-align: center;
  letter-spacing: 0.02em;
}

.invoice-items-table td {
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 0.82rem;
  padding: 0.35rem 0.4rem;
}

.invoice-items-table th:nth-child(1),
.invoice-items-table td:nth-child(1) { width: 4%; }

.invoice-items-table th:nth-child(2),
.invoice-items-table td:nth-child(2) { width: 30%; }

.invoice-items-table th:nth-child(3),
.invoice-items-table td:nth-child(3) { width: 9%; }

.invoice-items-table th:nth-child(4),
.invoice-items-table td:nth-child(4) { width: 6%; }

.invoice-items-table th:nth-child(5),
.invoice-items-table td:nth-child(5) { width: 7%; }

.invoice-items-table th:nth-child(6),
.invoice-items-table td:nth-child(6),
.invoice-items-table th:nth-child(7),
.invoice-items-table td:nth-child(7),
.invoice-items-table th:nth-child(8),
.invoice-items-table td:nth-child(8),
.invoice-items-table th:nth-child(9),
.invoice-items-table td:nth-child(9) { width: 11%; }

.invoice-table td,
.invoice-table th {
  border-color: #1f1f1f;
  font-size: 0.88rem;
  padding: 0.45rem;
}

.invoice-table thead th {
  background: #fff;
  color: #000;
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.86rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .page-shell  { padding: 1.25rem; }
  .card-panel  { padding: 1.25rem 1rem; }
  .hero        { padding: 2.25rem 1.25rem; }
  .table       { display: block; overflow-x: auto; }
  .power-entry-table th,
  .power-entry-table td { min-width: 92px; }
  .brand-meta { letter-spacing: 0.12em; }
  .page-intro { flex-direction: column; }
  .summary-chip { min-width: 7rem; }
  .invoice-meta-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.35rem; }
  .invoice-items-table { min-width: 760px; }
}

@media print {
  header,
  footer,
  .card,
  .btn,
  .alert,
  .navbar,
  .text-danger,
  .validation-summary-errors,
  .page-intro,
  .summary-strip,
  .col-lg-5 {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .container,
  main,
  .col-lg-8,
  .row {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .col-lg-7 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
  }

  .page-shell {
    padding: 0 !important;
    background: #fff !important;
    border: none !important;
    box-shadow: none !important;
  }

  .invoice-sheet {
    border: 2px solid #000;
    page-break-inside: avoid;
    padding: 0.8rem;
    box-shadow: none;
    border-radius: 0;
  }

  .invoice-table-scroll {
    overflow: visible;
  }

  .invoice-items-table {
    min-width: 0 !important;
    table-layout: fixed;
  }

  .invoice-items-table th,
  .invoice-items-table td {
    font-size: 0.78rem;
    padding: 0.28rem 0.3rem;
    line-height: 1.25;
  }

  .invoice-items-table thead th {
    font-size: 0.76rem;
  }

  .invoice-header {
    margin-bottom: 0.5rem;
  }

  .invoice-meta-card {
    border-color: #1f1f1f;
    border-radius: 0;
    background: #fff;
  }
}
