
:root {
  --ink: #102a43;
  --ink-soft: #486581;
  --blue: #0d5ea6;
  --blue-dark: #073b68;
  --orange: #f28c28;
  --paper: #ffffff;
  --canvas: #f4f7fa;
  --line: #d9e2ec;
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(16, 42, 67, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 7% 2%, rgba(13, 94, 166, 0.09), transparent 28rem),
    var(--canvas);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

[hidden] {
  display: none !important;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(242, 140, 40, 0.42);
  outline-offset: 2px;
}

svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: currentColor;
}

.topbar {
  height: 82px;
  padding: 0 clamp(1rem, 4vw, 4rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.93);
  border-bottom: 1px solid rgba(217, 226, 236, 0.85);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  border: 0;
  background: none;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0;
  color: var(--ink);
  cursor: pointer;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--blue), var(--blue-dark));
  color: white;
  font-size: 1.35rem;
  font-weight: 900;
  box-shadow: 0 7px 16px rgba(13, 94, 166, 0.23);
}

.brand strong,
.brand small {
  display: block;
  text-align: left;
}

.brand strong {
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.brand small {
  color: var(--ink-soft);
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
}

.back-button {
  border: 0;
  background: #eaf2f8;
  color: var(--blue-dark);
  font-weight: 750;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  cursor: pointer;
}
.topbar-actions{display:flex;align-items:center;justify-content:flex-end;gap:.55rem}.connection-status{min-height:34px;padding:.45rem .7rem;display:inline-flex;align-items:center;gap:.4rem;border-radius:999px;background:#edf8f3;color:#087f5b;font-size:.75rem;font-weight:800;white-space:nowrap}.connection-status:before{width:8px;height:8px;border-radius:50%;background:currentColor;content:""}.connection-status.offline{background:#fff4e8;color:#a84f00}.connection-status.pending{background:#fff8db;color:#8a6100}.admin-button,.install-button{min-height:38px;border:1px solid var(--line);border-radius:999px;display:inline-flex;align-items:center;gap:.45rem;background:white;color:var(--blue-dark);font-size:.76rem;font-weight:800;cursor:pointer}.admin-button{padding:.45rem .75rem}.admin-button.is-admin{border-color:#e4b45b;background:#fff9ed;color:#8a5400}.admin-button svg{width:1.2rem;height:1.2rem}.install-button{padding:.45rem .85rem;border-color:var(--blue);background:var(--blue);color:white}

.app-shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 5rem) 0 5rem;
}

.hero {
  max-width: 760px;
  margin-bottom: 2.4rem;
}

.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.hero h1,
.page-title h1 {
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.045em;
  line-height: 1.04;
}

.hero h1 {
  font-size: clamp(2.35rem, 7vw, 4.6rem);
}

.hero > p:last-child,
.page-title > p:last-child,
.page-title > div > p:last-child {
  color: var(--ink-soft);
  font-size: 1.03rem;
  line-height: 1.7;
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.home-actions .action-card {
  min-height: 112px;
  padding: 1rem 1.15rem;
  border-radius: 18px;
}

.home-actions .action-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
}

.home-actions .action-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.home-actions .action-card strong {
  font-size: 1.35rem;
}

.home-actions .action-card em {
  margin-top: 0.2rem;
}

.home-tools + .recent-section {
  margin-top: 2rem;
}

.home-tools {
  margin-top: 0.75rem;
  display: flex;
  justify-content: flex-end;
}

.providers-button {
  min-height: 38px;
  padding: 0.45rem 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--blue-dark);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.providers-button svg {
  width: 1.1rem;
  height: 1.1rem;
}

.action-card {
  min-height: 176px;
  padding: 1.5rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 8px 30px rgba(16, 42, 67, 0.06);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.action-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: #b9ccdc;
}

.primary-card {
  color: white;
  border-color: transparent;
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
}

.action-icon {
  width: 58px;
  height: 58px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  background: #eaf2f8;
  color: var(--blue);
}

.primary-card .action-icon {
  color: white;
  background: rgba(255, 255, 255, 0.14);
}

.action-icon svg {
  width: 1.8rem;
  height: 1.8rem;
}

.action-card small,
.action-card strong,
.action-card em {
  display: block;
}

.action-card small {
  margin-bottom: 0.2rem;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.primary-card small,
.primary-card em {
  color: rgba(255, 255, 255, 0.84);
}

.action-card strong {
  font-size: 1.7rem;
}

.action-card em {
  margin-top: 0.4rem;
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-style: normal;
}

.action-card b {
  color: var(--orange);
  font-size: 1.6rem;
}

.recent-section {
  margin-top: 3.5rem;
}

.section-heading,
.list-title,
.detail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.section-heading h2,
.modal h2 {
  margin: 0;
  letter-spacing: -0.03em;
}

.section-heading button {
  border: 0;
  background: none;
  color: var(--blue);
  font-weight: 800;
  cursor: pointer;
}

.recent-list {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
}

.recent-row {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  padding: 1rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.recent-row span:nth-child(2) {
  min-width: 0;
}

.recent-row span:nth-child(2) strong,
.recent-row span:nth-child(2) small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-row span:nth-child(2) small {
  margin-top: 0.25rem;
  color: var(--ink-soft);
}

.recent-row > svg {
  color: var(--blue);
}

.date-badge {
  width: 47px;
  height: 52px;
  border-radius: 12px;
  display: grid;
  place-content: center;
  text-align: center;
  background: #fff4e8;
  color: #a84f00;
}

.date-badge strong,
.date-badge small {
  line-height: 1;
}

.date-badge small {
  margin-top: 0.3rem;
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
}

.page-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  padding: clamp(1.25rem, 4vw, 3rem);
}

.login-card {
  width: min(460px, 100%);
  margin: 0 auto;
}

.app-shell.login-shell {
  padding-top: 0.75rem;
}

.login-card .page-title {
  margin-bottom: 1.4rem;
}

.login-card form {
  display: grid;
  gap: 1rem;
}

.login-card .save-button {
  width: 100%;
}
.password-wrap{margin-top:.5rem;display:grid;grid-template-columns:1fr 48px}.password-wrap input{height:52px;margin-top:0;border-radius:12px 0 0 12px}.password-eye{border:1px solid #bcccdc;border-left:0;border-radius:0 12px 12px 0;display:grid;place-items:center;background:#f7fafc;color:var(--ink-soft);cursor:pointer}.password-eye.active{background:#eaf2f8;color:var(--blue)}.pending-badge{width:fit-content;margin-top:.35rem;padding:.2rem .45rem;display:block;border-radius:999px;background:#fff4e8;color:#a84f00;font-size:.63rem;font-weight:800;white-space:nowrap}.password-form{padding:1rem;border:1px solid var(--line);border-radius:15px;background:#f8fafc}.password-form h3{margin:0 0 1rem;display:flex;align-items:center;gap:.45rem;color:var(--blue-dark);font-size:1rem}.password-form label+label{margin-top:.85rem}.account-actions{display:grid;gap:.75rem}.account-choice{width:100%;min-height:58px;padding:.8rem 1rem;border:1px solid #b9d4e8;border-radius:14px;display:flex;align-items:center;gap:.75rem;background:#f2f8fc;color:var(--blue-dark);font-weight:800;text-align:left;cursor:pointer}.account-choice:hover{border-color:var(--blue);background:#e8f3fa}.account-choice svg{width:25px;height:25px;flex:0 0 auto}.permission-note{color:var(--ink-soft);font-size:.82rem}.logout-button{width:100%;min-height:46px;margin-top:1rem;border:1px solid #f2b8b5;border-radius:12px;background:#fff4f3;color:var(--danger);font-weight:800;cursor:pointer}

.page-title {
  margin-bottom: 2.2rem;
}

.page-title h1 {
  font-size: clamp(2rem, 5vw, 3.3rem);
}

.receipt-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

label,
.photo-field > span {
  display: block;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  height: 52px;
  margin-top: 0.5rem;
  padding: 0 0.9rem;
  border: 1px solid #bcccdc;
  border-radius: 12px;
  background: white;
  color: var(--ink);
}

input:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(13, 94, 166, 0.09);
}

.provider-field {
  display: grid;
  grid-template-columns: 1fr 52px;
  align-items: end;
  gap: 0.6rem;
}

.add-button {
  height: 52px;
  border: 0;
  border-radius: 12px;
  background: var(--orange);
  color: #3f2102;
  font-size: 1.7rem;
  font-weight: 700;
  cursor: pointer;
}

.photo-field {
  grid-column: 1 / -1;
}

.file-input {
  display: none;
}

.camera-button {
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid #9fb3c8;
  border-radius: 12px;
  background: #eaf2f8;
  color: var(--blue-dark);
  font-weight: 800;
  cursor: pointer;
}

.photo-preview {
  min-height: 300px;
  margin-top: 0.8rem;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px dashed #bcccdc;
  border-radius: 18px;
  background: #f7fafc;
  color: var(--ink-soft);
  text-align: center;
}

.photo-preview.has-photo {
  border-style: solid;
  background: #102a43;
}

.photo-preview img {
  width: 100%;
  height: 100%;
  max-height: 620px;
  object-fit: contain;
}

.photo-preview div {
  display: grid;
  justify-items: center;
  gap: 0.4rem;
}

.photo-preview div svg {
  width: 2.3rem;
  height: 2.3rem;
  margin-bottom: 0.3rem;
  color: #829ab1;
}

.photo-preview div small {
  font-size: 0.75rem;
}

.save-button,
.new-button,
.download-button {
  min-height: 50px;
  border: 0;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--blue);
  color: white;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.receipt-form > .save-button {
  grid-column: 1 / -1;
  width: 100%;
}

.save-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.new-button,
.download-button {
  padding: 0 1.1rem;
}

.table-wrap {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  background: #eaf2f8;
  color: var(--blue-dark);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #f8fafc;
}

.actions-cell {
  width: 120px;
  text-align: right;
}

.icon-button {
  width: 40px;
  height: 40px;
  margin-left: 0.35rem;
  border: 0;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}

.view-icon {
  background: #eaf2f8;
  color: var(--blue);
}

.delete-icon {
  background: #feeceb;
  color: var(--danger);
}

.empty-state {
  padding: 2.2rem;
  color: var(--ink-soft);
  text-align: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  padding: 1rem;
  display: grid;
  place-items: center;
  background: rgba(7, 24, 39, 0.72);
  backdrop-filter: blur(7px);
}

.modal {
  width: min(880px, 100%);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  position: relative;
  border-radius: 24px;
  background: white;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28);
  padding: clamp(1.25rem, 4vw, 2.2rem);
}

.small-modal {
  width: min(480px, 100%);
}

.detail-modal {
  width: min(1100px, calc(100vw - 2rem));
  height: calc(100dvh - 2rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.small-modal h2 {
  margin-bottom: 1.4rem;
}

.small-modal .save-button {
  width: 100%;
  margin-top: 1.1rem;
}

.provider-list {
  margin-top: 1rem;
  display: grid;
  gap: 0.6rem;
}

.provider-row {
  min-width: 0;
  padding: 0.65rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.provider-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.provider-row > span {
  flex: 0 0 auto;
}

.provider-row .icon-button {
  width: 36px;
  height: 36px;
}

.close-button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: #eaf2f8;
  color: var(--ink);
  font-size: 1.5rem;
  cursor: pointer;
}

.detail-heading {
  padding-right: 3rem;
  margin-bottom: 1.2rem;
}

.detail-heading p {
  margin-bottom: 0;
}

.detail-photo {
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 16px;
  background: #102a43;
}

.detail-photo img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
}

.toast {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 80;
  max-width: min(420px, calc(100% - 2.4rem));
  padding: 0.95rem 1.15rem;
  border-radius: 12px;
  color: white;
  font-weight: 750;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.2);
}

.toast.success {
  background: #087f5b;
}

.toast.error {
  background: var(--danger);
}

@media (max-width: 760px) {
  .topbar {
    height: 70px;
    padding-inline:.75rem;
  }
  .connection-status{position:fixed;right:.7rem;bottom:.7rem;z-index:40;box-shadow:0 6px 22px rgba(16,42,67,.18)}.admin-button span,.install-button{display:none}.admin-button{width:40px;padding:0;justify-content:center}

  .app-shell {
    width: min(100% - 1rem, 1120px);
    padding-top: 1.8rem;
  }

  .action-grid,
  .recent-list,
  .receipt-form {
    grid-template-columns: 1fr;
  }

  .action-card {
    min-height: 138px;
  }

  .recent-section {
    margin-top: 2.3rem;
  }

  .page-card {
    border-radius: 20px;
  }

  .list-title,
  .detail-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .new-button,
  .download-button {
    width: 100%;
  }

  .table-wrap {
    border: 0;
    overflow: visible;
  }

  table,
  tbody {
    display: block;
  }

  thead {
    display: none;
  }

  tr {
    margin-bottom: 0.8rem;
    padding: 0.8rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: white;
  }

  td {
    padding: 0.45rem;
    display: block;
    border: 0;
  }

  td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.2rem;
    color: var(--ink-soft);
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
  }

  .actions-cell {
    width: auto;
    grid-column: 1 / -1;
    text-align: left;
  }

  .actions-cell .icon-button {
    width: calc(50% - 0.4rem);
    margin: 0.3rem 0.35rem 0 0;
  }

  .photo-preview {
    min-height: 230px;
  }

  .detail-heading {
    padding-right: 0;
  }

  .detail-modal {
    width: calc(100vw - 1rem);
    height: calc(100dvh - 1rem);
    padding: 1rem;
  }
}

@media (max-width: 430px) {
  .action-card {
    grid-template-columns: auto 1fr;
  }

  .action-card b {
    display: none;
  }

  .brand strong {
    font-size: 1rem;
  }

  .back-button {
    font-size: 0.85rem;
  }
  .brand small{display:none}
}
