:root {
  --teal: #0d9488;
  --teal-dark: #0f766e;
  --teal-soft: #ccfbf1;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --surface: #ffffff;
  --danger: #dc2626;
  --success: #059669;
  --radius: 14px;
  --wrap: 1080px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Source Sans 3", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
}

.skip:focus {
  left: 12px;
}

.header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}

.header-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.logo {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--teal-dark);
  margin-right: auto;
}

.account {
  text-align: right;
  font-size: 0.85rem;
}

.account span {
  display: block;
  color: var(--muted);
}

.account strong {
  color: var(--ink);
}

.menu-btn {
  display: none;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 0.4rem 0.65rem;
  cursor: pointer;
  font-weight: 600;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 0.5rem 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.88rem;
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn.primary {
  background: var(--teal);
  color: #fff;
}

.btn.primary:hover {
  background: var(--teal-dark);
}

.layout {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 1.25rem;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.portal-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  position: sticky;
  top: 72px;
}

.portal-nav a {
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--muted);
}

.portal-nav a:hover {
  background: var(--surface);
  color: var(--ink);
}

.portal-nav a.is-active {
  background: var(--surface);
  color: var(--teal-dark);
  box-shadow: inset 3px 0 0 var(--teal);
}

.content-main h1 {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
  letter-spacing: -0.02em;
}

.lead {
  margin: 0 0 1.25rem;
  color: var(--muted);
  max-width: 40rem;
}

.hero-banner {
  background: linear-gradient(135deg, var(--teal-soft), #fff);
  border: 1px solid #99f6e4;
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1.25rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
}

.hero-banner p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.quick-stats article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
}

.quick-stats span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.quick-stats strong {
  font-size: 1.35rem;
}

.cards {
  display: grid;
  gap: 0.85rem;
}

.inv {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem 1rem;
  align-items: center;
}

.inv.open {
  border-color: #fecaca;
  background: #fffafa;
}

.inv div span {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.inv div strong {
  font-size: 1.25rem;
}

.inv p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.inv .pay,
.inv .paid,
.inv .link-detail {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
}

.pay {
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.5rem 1rem;
  font-weight: 700;
  cursor: pointer;
}

.paid {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--success);
}

.link-detail {
  color: var(--teal-dark);
  font-weight: 700;
  font-size: 0.88rem;
}

.link-detail:hover {
  text-decoration: underline;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.9rem;
}

table.data th,
table.data td {
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #f1f5f9;
}

table.data th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: #fafafa;
}

table.data a {
  color: var(--teal-dark);
  font-weight: 600;
}

.status {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.status.open {
  background: #fef3c7;
  color: #92400e;
}

.status.done {
  background: #d1fae5;
  color: #065f46;
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

.file-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  min-height: 140px;
  display: flex;
  flex-direction: column;
}

.file-tile .icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  margin-bottom: 0.65rem;
}

.file-tile strong {
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
}

.file-tile span {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: auto;
}

.file-tile a {
  margin-top: 0.75rem;
  color: var(--teal-dark);
  font-weight: 700;
  font-size: 0.85rem;
}

.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.file-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #f1f5f9;
}

.file-list .icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #f1f5f9;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--muted);
}

.file-list strong {
  display: block;
  font-size: 0.9rem;
}

.file-list li > div span {
  font-size: 0.78rem;
  color: var(--muted);
}

.file-list a {
  color: var(--teal-dark);
  font-weight: 700;
  font-size: 0.85rem;
}

.new-ticket {
  margin-bottom: 1rem;
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.55rem 1rem;
  font-weight: 700;
  cursor: pointer;
}

.invoice-detail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
}

.invoice-detail header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.line-items {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.line-items th,
.line-items td {
  padding: 0.65rem 0;
  border-bottom: 1px solid #f1f5f9;
  text-align: left;
}

.line-items th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.totals {
  margin-left: auto;
  max-width: 280px;
  font-size: 0.92rem;
}

.totals div {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
}

.totals .grand {
  font-weight: 800;
  font-size: 1.1rem;
  border-top: 2px solid var(--ink);
  margin-top: 0.35rem;
  padding-top: 0.5rem;
}

.profile-form {
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
}

.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.field input,
.field select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.breadcrumb a {
  color: var(--teal-dark);
  font-weight: 600;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .portal-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    display: none;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.5rem;
  }

  .portal-nav.is-open {
    display: flex;
  }

  .menu-btn {
    display: inline-flex;
  }

  .file-grid,
  .quick-stats {
    grid-template-columns: 1fr;
  }

  .hero-banner {
    grid-template-columns: 1fr;
  }
}
