@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap");

/* ===== Theme ===== */
:root {
  --bg0: #070b17;
  --bg1: #0b1226;

  --panel: rgba(10, 16, 35, 0.62);
  --panel2: rgba(9, 14, 30, 0.72);

  --stroke: rgba(255, 255, 255, 0.10);
  --stroke2: rgba(255, 255, 255, 0.16);

  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.65);

  --accent: #6d5efc;
  --accent2: #2f86ff;

  --shadow: 0 18px 55px rgba(0, 0, 0, 0.55);

  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
}

/* ===== Global ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 20% 10%, rgba(109, 94, 252, 0.22), transparent 55%),
    radial-gradient(900px 600px at 85% 15%, rgba(47, 134, 255, 0.14), transparent 55%),
    radial-gradient(1000px 700px at 50% 95%, rgba(109, 94, 252, 0.10), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  padding: 26px;
}

/* NAVBAR */
.app-header {
  position: sticky;
  margin-bottom: 18px;
  top: 0;
  z-index: 999;
  backdrop-filter: blur(10px);
  background: rgba(6, 10, 24, 0.55);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.app-nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-link,
.nav-link:visited {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: 0.15s ease;
  font-weight: 500;
}

.nav-link:hover {
  color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

.nav-active {
  color: #ffffff;
  background: rgba(120, 110, 255, 0.18);
  border-color: rgba(120, 110, 255, 0.35);
}

.nav-logout {
  appearance: none;
  border: 6px none;
  padding: 10px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;

  color: #fff;
  background: linear-gradient(135deg, #6f7bff 0%, #5865f2 55%, #4b5bff 100%);

  box-shadow:
    0 10px 22px rgba(88, 101, 242, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);

  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.nav-logout:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow:
    0 14px 28px rgba(88, 101, 242, 0.40),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.nav-logout:active {
  transform: translateY(0);
  filter: brightness(0.98);
  box-shadow:
    0 8px 16px rgba(88, 101, 242, 0.30),
    inset 0 2px 8px rgba(0, 0, 0, 0.18);
}

.nav-logout:focus-visible {
  outline: 3px solid rgba(111, 123, 255, 0.45);
  outline-offset: 3px;
}

/* gap below navbar */
.app-header {
  margin-bottom: 18px;
}


/* ===== Main container ===== */
.main-container {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 22px;
  margin-right: 6px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

/* Your existing inline flex rows inside main-container */
.main-container>div:not(.header) {
  white-space: nowrap;
  flex: 0 0 auto;
  /* don't shrink */
  display: inline-block;
  min-width: 120px;
  /* keeps labels aligned */
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-lg);
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Ensure the input takes remaining space cleanly */
.main-container>div:not(.header) .input-1 {
  flex: 1 1 auto;
  width: auto !important;
  /* overrides your width:100% */
  max-width: 420px;
  /* keep your pill size */
}

/* Labels (you used <b>Client :</b>) */
.main-container b {
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.2px;
}


/* Tighten the RA Bill / Date row spacing */
.main-container>div:last-child {
  padding-top: 6px;
  padding-bottom: 6px;
}

/* ===== Header ===== */
.header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding-bottom: 14px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header h3 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.78);
}

.header h4 {
  margin-top: 8px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  /* kill the <u> look; we’ll replace with neon lines */
  position: relative;
  padding: 8px 0;
}

/* Neon line effect around title (no HTML changes) */
.header h4::before,
.header h4::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 110px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  transform: translateY(-50%);
  opacity: 0.95;
}

.header h4::before {
  right: calc(100% + 14px);
}

.header h4::after {
  left: calc(100% + 14px);
}

/* ===== Inputs ===== */
.input-1,
input[type="text"].input-1,
input[type="date"].input-1 {
  width: 100% !important;
  max-width: 420px;
  padding: 8px 12px !important;

  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  outline: none;

  font-size: 13px !important;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.10);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

/* Only the date input needs extra right padding for the calendar icon */
input[type="date"].input-1 {
  color-scheme: dark;
}

.input-1:focus {
  border-color: rgba(109, 94, 252, 0.55) !important;
  box-shadow: 0 0 0 4px rgba(109, 94, 252, 0.18);
}

/* ===== Table shell ===== */
.abs-table {
  width: min(1240px, 100%);
  margin: 18px auto 0;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(0, 0, 0, 0.18);
  box-shadow: var(--shadow);
}

/* Cells */
.abs-table th,
.abs-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.06) !important;
  padding: 12px 10px;
  text-align: center;
  vertical-align: middle;
  color: rgba(255, 255, 255, 0.88);
}

.abs-table th:last-child,
.abs-table td:last-child {
  border-right: none !important;
}

/* Override your inline thead background */
.abs-table thead,
.abs-table thead tr,
.abs-table thead th {
  background-color: rgba(0, 0, 0, 0.28) !important;
}

.abs-table thead th {
  font-weight: 800 !important;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.92) !important;
}

/* Slightly differentiate the subheader row */
.abs-table thead tr:nth-child(2) th {
  background-color: rgba(255, 255, 255, 0.05) !important;
  letter-spacing: 1px;
  text-transform: none;
  font-weight: 700 !important;
}

/* Group header */
.group-head {
  background-color: rgba(0, 0, 0, 0.28) !important;
}

/* Hover */
.abs-table tbody tr:hover td {
  background: rgba(109, 94, 252, 0.06);
}

/* Description column left aligned */
.abs-table td:nth-child(3) {
  text-align: left;
  padding-left: 12px;
}

/* Keep your existing column widths (same as your current CSS) */
.abs-table th:nth-child(1),
.abs-table td:nth-child(1) {
  width: 50px;
}

.abs-table th:nth-child(2),
.abs-table td:nth-child(2) {
  width: 70px;
}

.abs-table th:nth-child(3),
.abs-table td:nth-child(3) {
  width: 250px;
}

.abs-table th:nth-child(4),
.abs-table td:nth-child(4) {
  width: 90px;
}

.abs-table th:nth-child(5),
.abs-table td:nth-child(5) {
  width: 65px;
}

.abs-table th:nth-child(6),
.abs-table td:nth-child(6) {
  width: 85px;
}

.abs-table th:nth-child(n+7),
.abs-table td:nth-child(n+7) {
  width: 300px;
}

/* Inputs inside table */
.row-input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.10);
  outline: none;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 10px;
  text-align: start;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 14px;
  resize: none;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: break-word;
}

.row-input:focus {
  border-color: rgba(109, 94, 252, 0.55);
  box-shadow: 0 0 0 4px rgba(109, 94, 252, 0.18);
}

/* ===== Button ===== */
.add-btn {
  display: inline-flex;
  /* shrink to content */
  align-items: center;
  justify-content: center;

  width: auto;
  /* key fix */
  padding: 12px 22px;
  /* pill size */
  margin: 16px auto 0;
  /* center it */

  border: none;
  border-radius: 999px;
  /* full pill */
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.3px;

  background: linear-gradient(90deg,
      #6d5efc,
      #2f86ff);

  box-shadow: 0 12px 28px rgba(109, 94, 252, 0.35);
  cursor: pointer;

  transition: transform 120ms ease,
    box-shadow 140ms ease,
    filter 140ms ease;
}

.add-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 18px 38px rgba(109, 94, 252, 0.45);
}

.row-actions {
  width: min(1240px, 100%);
  margin: 16px auto 0;
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* Remove button */
.remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 12px 22px;
  border: none;
  border-radius: 999px;

  font-weight: 700;
  font-size: 14px;
  color: #fff;

  background: linear-gradient(90deg,
      #ff4d4d,
      #ff7a7a);

  box-shadow: 0 12px 28px rgba(255, 77, 77, 0.35);
  cursor: pointer;

  transition: transform 120ms ease,
    box-shadow 140ms ease,
    filter 140ms ease;
}

.remove-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 16px 36px rgba(255, 77, 77, 0.45);
}

.remove-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

/* ===== Modal ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  /* hidden by default */
  place-items: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  z-index: 9999;
  padding: 18px;
}

.modal-backdrop.is-open {
  display: grid;
}

.modal {
  width: min(520px, 100%);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
  overflow: hidden;
  transform: translateY(6px);
  animation: modalIn 140ms ease-out forwards;
}

@keyframes modalIn {
  to {
    transform: translateY(0);
  }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-title {
  font-weight: 800;
  letter-spacing: 0.4px;
  font-size: 16px;
}

.modal-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.modal-x {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.modal-x:hover {
  background: rgba(255, 255, 255, 0.10);
}

.modal-body {
  padding: 16px 18px 8px;
}

.modal-label {
  display: block;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 8px;
}

.modal-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  outline: none;
  font-size: 14px;
}

.modal-input:focus {
  border-color: rgba(109, 94, 252, 0.55);
  box-shadow: 0 0 0 4px rgba(109, 94, 252, 0.18);
}

.modal-error {
  min-height: 18px;
  margin-top: 10px;
  font-size: 13px;
  color: rgba(255, 120, 120, 0.95);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-secondary,
.btn-danger {
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 800;
  cursor: pointer;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-danger {
  color: #fff;
  background: linear-gradient(90deg, #ff4d4d, #ff7a7a);
  box-shadow: 0 12px 28px rgba(255, 77, 77, 0.28);
}

.btn-danger:hover {
  filter: brightness(1.05);
  box-shadow: 0 16px 36px rgba(255, 77, 77, 0.34);
}


/* ===== Responsive ===== */
@media (max-width: 980px) {
  .input-1 {
    max-width: 100% !important;
  }

  .header h4::before,
  .header h4::after {
    width: 70px;
  }
}


/* =========================
   PRINT / PDF (Landscape)
   ========================= */

/* Force landscape in print/PDF */
@page {
  size: A4 landscape;
  margin: 10mm;
}

@media print {

  .app-header,
  .app-nav,
  .nav-left,
  .nav-logout {
    display: none !important;
  }

  header.app-header,
  header.app-header * {
    display: none !important;
  }

  /* Remove the website look */
  body {
    padding: 0 !important;
    padding-top: 0 !important;
    background: #fff !important;
    color: #000 !important;
  }

  /* Hide UI-only elements */
  .add-btn,
  .remove-btn,
  .pdf-btn,
  .modal-backdrop {
    display: none !important;
  }

  /* Ensure everything fits on page width */
  .main-container,
  .abs-table {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    box-shadow: none !important;
    border: 1px solid #000 !important;
    background: #fff !important;
    color: #000 !important;
  }

  .main-container {
    border-radius: 0 !important;
    backdrop-filter: none !important;
  }

  /* Header text black */
  .header h3,
  .header h4,
  .main-container b {
    color: #000 !important;
  }

  /* Inputs should print like form fields */
  .input-1,
  .row-input {
    background: #fff !important;
    color: #000 !important;
    border: 1px solid #000 !important;
    box-shadow: none !important;
  }

  /* Table: crisp borders like your scanned format */
  .abs-table {
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    table-layout: fixed !important;
  }

  .abs-table th,
  .abs-table td {
    border: 1px solid #000 !important;
    color: #000 !important;
    background: #fff !important;
    padding: 6px 6px !important;
    /* tighter for PDF */
  }

  .abs-table thead th {
    font-size: 11px !important;
    font-weight: 700 !important;
  }

  /* Keep header rows from splitting across pages */
  thead {
    display: table-header-group;
  }

  tfoot {
    display: table-footer-group;
  }

  tr {
    page-break-inside: avoid;
  }

  /* Remove neon title decoration in print */
  .header h4::before,
  .header h4::after {
    display: none !important;
  }
}

/* Optional: style the PDF button in normal view */
.pdf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border: none;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(90deg, #17a34a, #22c55e);
  box-shadow: 0 12px 28px rgba(34, 197, 94, 0.25);
  margin-left: 10px;
}