:root {
  --blue: #07569c;
  --blue-dark: #073b68;
  --green: #4c8b2b;
  --orange: #f58216;
  --ink: #17202a;
  --muted: #667085;
  --line: #dfe6ec;
  --surface: #fff;
  --bg: #f3f7fa;
  --danger: #a64700;
  --shadow: 0 12px 30px rgba(15, 56, 88, 0.09);
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: auto;
}
body {
  margin: 0;
  background: linear-gradient(180deg, #edf5fb 0, #f8fafb 420px);
  color: var(--ink);
  font:
    15px/1.55 Inter,
    Segoe UI,
    system-ui,
    sans-serif;
}
.admin-login-card {
  max-width: 560px;
  margin: 22px auto;
  padding: 34px;
  border-top: 5px solid var(--blue);
  text-align: center;
}
.admin-login-card input {
  width: min(100%, 430px);
  display: block;
  margin: 10px auto;
}
.admin-login-card button {
  width: min(100%, 430px);
  margin: 12px auto 0;
}
.admin-workspace {
  border-top: 5px solid var(--green);
}
.admin-workspace > .row:first-of-type {
  padding: 8px 4px 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.management-panel,
.records-panel {
  background: linear-gradient(145deg, #ffffff, #f8fbfd);
  border-left: 4px solid var(--blue);
}
.records-panel {
  border-left-color: var(--orange);
}
.record-filters {
  display: grid;
  grid-template-columns:
    minmax(220px, 2fr) minmax(160px, 1fr) minmax(180px, 1fr)
    auto;
  gap: 8px;
  align-items: center;
}
.record-filters > * {
  width: 100%;
  margin: 0;
}
main {
  max-width: 1180px;
  margin: auto;
  padding: 24px;
}
.brand-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  background: #fff;
  padding: 30px 38px;
  border-radius: 24px;
  border-top: 5px solid var(--orange);
  box-shadow: var(--shadow);
}
.brand-header img {
  display: block;
  width: min(100%, 820px);
  max-height: 260px;
  object-fit: contain;
}
.brand-copy {
  width: 100%;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.brand-header h1 {
  font-size: clamp(25px, 4.2vw, 48px);
  line-height: 1.08;
  margin: 0 0 10px;
  color: var(--blue-dark);
  letter-spacing: 0.04em;
}
.brand-header p {
  font-size: 17px;
  color: var(--muted);
  margin: 0;
}
.eyebrow,
.section-tag {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.13em;
  color: var(--green);
}
.quick-nav {
  position: static;
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 16px auto;
  padding: 8px;
  width: max-content;
  max-width: 100%;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 24px #16466e18;
  backdrop-filter: blur(10px);
}
.quick-nav a {
  color: var(--blue-dark);
  text-decoration: none;
  font-weight: 750;
  padding: 9px 16px;
  border-radius: 10px;
}
.quick-nav a:hover,
.quick-nav a:focus {
  background: #e7f2fb;
  color: var(--blue);
}
section {
  background: var(--surface);
  padding: 24px;
  border-radius: 18px;
  margin: 16px 0;
  box-shadow: var(--shadow);
  border: 1px solid #e8eef2;
  content-visibility: auto;
  contain-intrinsic-size: 420px;
}
section h2,
section h3 {
  color: var(--blue-dark);
  margin-top: 6px;
}
.muted {
  color: var(--muted);
  margin-top: -8px;
}
input,
select,
button {
  font: inherit;
  min-height: 44px;
  padding: 10px 13px;
  margin: 5px;
  border: 1px solid #b8c7d3;
  border-radius: 10px;
}
input,
select {
  background: #fff;
  min-width: 190px;
}
input:focus,
select:focus {
  outline: 3px solid #1683d52b;
  border-color: var(--blue);
}
button {
  background: var(--blue);
  color: #fff;
  border: 0;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 4px 10px #07569c24;
}
button:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
}
button:active {
  transform: none;
}
.secondary {
  background: #667085;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 12px;
}
.card {
  padding: 17px;
  background: linear-gradient(145deg, #edf7ff, #f6fbf3);
  border: 1px solid #d8e8f2;
  border-radius: 14px;
  min-width: 145px;
}
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.tablewrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-top: 12px;
}
.page-info {
  margin: 10px 5px 4px;
  color: var(--muted);
  font-weight: 700;
}
.pagination {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}
.pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}
table {
  border-collapse: collapse;
  width: 100%;
  background: #fff;
}
th,
td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid #e7edf1;
  vertical-align: middle;
}
th {
  position: sticky;
  top: 0;
  background: #eef5fa;
  color: var(--blue-dark);
  font-size: 13px;
  white-space: nowrap;
}
tr:hover td {
  background: #f8fbfd;
}
.paid {
  color: #167245;
  font-weight: 750;
}
.due {
  color: var(--danger);
  font-weight: 750;
}
#bill,
#frameLoginResult {
  margin-top: 12px;
}
#editCustomer,
#editFrameCustomer,
#customerInvoices,
#frameInvoices {
  border: 2px solid #8bc0e5;
  background: #f5fbff;
}
pre {
  white-space: pre-wrap;
  background: #10293b;
  color: #dceef9;
  padding: 14px;
  border-radius: 12px;
}
@media (min-width: 800px) {
  #login,
  #customer,
  #frameLogin,
  #registration {
    display: inline-block;
    width: calc(50% - 11px);
    vertical-align: top;
    min-height: 245px;
  }
  #customer,
  #registration {
    margin-left: 17px;
  }
}
.balance-summary {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.balance-summary span {
  flex: 1;
  min-width: 170px;
  padding: 14px;
  background: #eef6fb;
  border-radius: 12px;
  color: var(--blue-dark);
}
.invoice-card {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(280px, 2fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  margin: 10px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.invoice-card small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}
.invoice-amounts {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.invoice-amounts span {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: var(--muted);
}
.invoice-amounts b {
  font-size: 15px;
  color: var(--ink);
}
.paid-badge {
  padding: 8px 12px;
  border-radius: 999px;
  background: #e6f6ed;
  color: #167245;
  font-weight: 800;
}
.account-card {
  padding: 4px 0 12px;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 700px) {
  main {
    padding: 10px;
  }
  .brand-header {
    grid-template-columns: 1fr;
    padding: 20px;
    text-align: center;
    gap: 10px;
  }
  .brand-header img {
    max-height: 105px;
  }
  .brand-header p {
    font-size: 15px;
  }
  .quick-nav {
    width: 100%;
    overflow: auto;
    justify-content: flex-start;
  }
  .quick-nav a {
    white-space: nowrap;
  }
  section {
    padding: 17px;
    border-radius: 14px;
  }
  .row {
    align-items: flex-start;
    flex-direction: column;
  }
  input,
  select,
  button {
    width: 100%;
    margin: 5px 0;
  }
  .cards {
    grid-template-columns: 1fr 1fr;
  }
  .invoice-card {
    grid-template-columns: 1fr;
  }
  .record-filters {
    grid-template-columns: 1fr;
  }
  .invoice-amounts {
    justify-content: space-between;
  }
  .invoice-card button {
    width: 100%;
  }
  th,
  td {
    padding: 9px;
    font-size: 13px;
  }
}
