:root {
  --blue: #063c8d;
  --red: #ff0000;
  --ink: #172033;
  --muted: #667085;
  --line: #e5eaf1;
  --bg: #f5f7fb;
  --white: #fff;
  --shadow: 0 18px 50px rgba(23, 32, 51, 0.08);
}
* {
  box-sizing: border-box;
}
html {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--bg);
}
body {
  margin: 0;
}
.topbar {
  height: 82px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(22px, 5vw, 72px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
}
.brand img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}
.topbar nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.topbar nav a,
.linkbtn {
  border: 0;
  background: none;
  color: #5c6675;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}
.topbar nav a:hover,
.linkbtn:hover {
  color: var(--blue);
}
.app-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 46px 0 70px;
}
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 30px;
  background:
    radial-gradient(circle at 10% 20%, rgba(6, 60, 141, 0.12), transparent 32%),
    radial-gradient(circle at 90% 80%, rgba(255, 0, 0, 0.08), transparent 28%),
    #f7f9fc;
}
.login-card {
  width: min(460px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 38px;
  box-shadow: var(--shadow);
}
.login-logo {
  height: 130px;
  display: grid;
  place-items: center;
  margin-bottom: 6px;
}
.login-logo img {
  width: 190px;
  height: 130px;
  object-fit: contain;
}
.eyebrow {
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
  color: var(--blue);
  margin: 8px 0;
  display: flex;
  justify-content: center;
}
h1 {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.05;
  margin: 12px 0;
  letter-spacing: -0.035em;
}
h2 {
  margin: 0;
  font-size: 20px;
}
.muted,
.page-head p,
.hero p,
.action-card p,
.items-head p {
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}
.form-stack {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}
label {
  display: grid;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #344054;
}
input,
textarea {
  width: 100%;
  border: 1px solid #cfd7e3;
  background: #fff;
  border-radius: 12px;
  padding: 12px 13px;
  font: inherit;
  color: var(--ink);
  outline: none;
  transition: 0.2s;
}
input:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(6, 60, 141, 0.09);
}
.btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 17px;
  text-decoration: none;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn.primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 8px 22px rgba(6, 60, 141, 0.2);
}
.btn.primary:hover {
  background: #052f6e;
}
.btn.secondary {
  background: #edf3fb;
  color: var(--blue);
}
.btn.ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}
.login-note {
  text-align: center;
  color: #98a2b3;
  font-size: 12px;
  margin: 26px 0 0;
}
.flash {
  padding: 13px 16px;
  border-radius: 12px;
  margin-bottom: 22px;
  font-weight: 700;
  font-size: 14px;
}
.flash.success {
  background: #eaf7ef;
  color: #167443;
}
.flash.error {
  background: #fff0f0;
  color: #b42318;
}
.hero {
  background: linear-gradient(120deg, var(--blue), #0c4ca6);
  color: #fff;
  border-radius: 26px;
  padding: 38px 42px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  box-shadow: 0 24px 60px rgba(6, 60, 141, 0.18);
  overflow: hidden;
  position: relative;
}
.hero:after {
  content: "";
  position: absolute;
  width: 230px;
  height: 230px;
  border: 42px solid rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  right: -80px;
  top: -95px;
}
.hero .eyebrow,
.hero p {
  color: #dbe7f7;
}
.hero-stats {
  display: flex;
  gap: 12px;
  z-index: 1;
}
.hero-stats div {
  min-width: 106px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
}
.hero-stats strong {
  display: block;
  font-size: 27px;
}
.hero-stats span {
  font-size: 12px;
  color: #dbe7f7;
}
.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 26px;
}
.action-card {
  min-height: 210px;
  border-radius: 22px;
  padding: 28px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: 0 12px 35px rgba(23, 32, 51, 0.05);
  transition: 0.25s;
}
.action-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}
.action-card .icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 29px;
}
.action-card .arrow {
  font-size: 28px;
}
.action-card.blue {
  background: linear-gradient(135deg, #fff, #eff5fc);
}
.action-card.blue .icon,
.action-card.soft-blue .icon {
  background: var(--blue);
  color: #fff;
}
.action-card.red {
  background: linear-gradient(135deg, #fff, #fff2f2);
}
.action-card.red .icon,
.action-card.soft-red .icon {
  background: var(--red);
  color: #fff;
}
.action-card.soft-blue,
.action-card.soft-red {
  background: #fff;
}
.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 26px;
}
.page-head h1 {
  font-size: 38px;
}
.editor-card,
.list-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px;
  box-shadow: 0 10px 30px rgba(23, 32, 51, 0.04);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.items-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 34px 0 16px;
}
.item-table-wrap,
.table-scroll {
  overflow-x: auto;
}
.item-table,
.manage-table {
  width: 100%;
  border-collapse: collapse;
}
.item-table th,
.manage-table th {
  text-align: left;
  padding: 12px;
  color: #667085;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--line);
}
.item-table td,
.manage-table td {
  padding: 12px;
  border-bottom: 1px solid #eef1f5;
  vertical-align: middle;
}
.item-table th:nth-child(2) {
  width: 90px;
}
.item-table th:nth-child(3) {
  width: 150px;
}
.item-table th:nth-child(4) {
  width: 120px;
}
.item-table th:last-child {
  width: 50px;
}
.line-total {
  font-weight: 800;
  color: var(--blue);
  white-space: nowrap;
}
.remove-row {
  border: 0;
  background: #fff0f0;
  color: var(--red);
  width: 32px;
  height: 32px;
  border-radius: 9px;
  font-size: 20px;
  cursor: pointer;
}
.bottom-fields {
  grid-template-columns: 1fr 260px;
  margin-top: 25px;
  align-items: end;
}
.live-total {
  background: #f3f6fa;
  border-radius: 16px;
  padding: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.live-total span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
}
.live-total strong {
  font-size: 22px;
  color: var(--blue);
}
.form-actions {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
}
.manage-table {
  min-width: 960px;
}
.manage-table td {
  font-size: 14px;
}
.manage-table th:last-child,
.manage-table td:last-child {
  width: 330px;
}
.manage-table .tag {
  display: block;
  width: max-content;
  background: #eef4ff;
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
  border-radius: 999px;
  padding: 3px 7px;
  margin-top: 5px;
}
.actions {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-wrap: nowrap;
  padding: 4px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  white-space: nowrap;
}
.actions .inline {
  display: inline-flex;
  margin: 0;
}
.actions a,
.actions button {
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
  color: #475467;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0 10px;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease;
}
.actions a:hover,
.actions button:hover {
  background: #fff;
  border-color: #d8e0ea;
  color: #172033;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
}
.actions a:first-child {
  background: #063c8d;
  border-color: #063c8d;
  color: #fff;
}
.actions a:first-child:hover {
  background: #052f6e;
  border-color: #052f6e;
  color: #fff;
  box-shadow: 0 2px 6px rgba(6, 60, 141, 0.18);
}
.actions form button:not(.danger) {
  color: #063c8d;
}
.actions form button:not(.danger):hover {
  background: #eef4fb;
  border-color: #cbd9eb;
  color: #052f6e;
}
.actions .danger {
  color: #b42318;
}
.actions .danger:hover {
  background: #fff1f0;
  border-color: #fecdca;
  color: #912018;
  box-shadow: none;
}
.empty {
  text-align: center !important;
  color: #98a2b3;
  padding: 50px !important;
}
.empty-page {
  text-align: center;
  padding: 90px 20px;
}
.empty-page .btn {
  margin-top: 20px;
}
@media (max-width: 850px) {
  .topbar {
    height: auto;
    min-height: 74px;
    padding: 10px 20px;
  }
  .brand span {
    display: none;
  }
  .topbar nav {
    gap: 12px;
    font-size: 13px;
  }
  .action-grid {
    grid-template-columns: 1fr;
  }
  .hero,
  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .hero-stats {
    width: 100%;
  }
  .hero-stats div {
    flex: 1;
  }
  .form-grid,
  .bottom-fields {
    grid-template-columns: 1fr 1fr;
  }
  .app-shell {
    width: min(100% - 24px, 1180px);
    padding-top: 28px;
  }
}
@media (max-width: 560px) {
  .topbar nav a:nth-child(2),
  .topbar nav a:nth-child(3) {
    display: none;
  }
  .login-card {
    padding: 28px 22px;
  }
  .hero {
    padding: 30px 24px;
  }
  .action-card {
    grid-template-columns: auto 1fr;
    min-height: 170px;
    padding: 22px;
  }
  .action-card .arrow {
    display: none;
  }
  .form-grid,
  .bottom-fields {
    grid-template-columns: 1fr;
  }
  .editor-card,
  .list-card {
    padding: 18px;
  }
  .page-head h1 {
    font-size: 32px;
  }
  .items-head {
    align-items: flex-start;
    gap: 14px;
    flex-direction: column;
  }
}
