/* extra.css — nav menu, sign-in page, mobile layout. Loaded after style.css */
.burger { display: none; width: 44px; height: 44px; margin-left: auto; background: none; border: 0; cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 5px; border-radius: 10px; }
.burger i { display: block; width: 22px; height: 2px; background: var(--navy); border-radius: 2px; transition: transform .2s, opacity .2s; }
.bar.open .burger i:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.bar.open .burger i:nth-child(2) { opacity: 0; }
.bar.open .burger i:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-user { margin-left: auto; align-self: center; color: var(--slate); font-size: .85rem; padding: 0 .5rem; white-space: nowrap; max-width: 12rem; overflow: hidden; text-overflow: ellipsis; }
.bar nav a.nav-out { color: var(--slate); font-size: .85rem; }
.btn-lg { padding: .8rem 1rem; font-size: 1rem; border-radius: 11px; }
.pw { position: relative; display: block; }
.pw input { padding-right: 5.2rem; }
.pw__t { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--blue); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; padding: .45rem .55rem; border-radius: 6px; }
.pw__t:hover { background: var(--wash); }

/* ---- sign-in page ---- */
body.login { background: #fff; }
.login .wrap { max-width: none; padding: 0; margin: 0; }
.login .flash { margin: 0 0 1rem; }
.lg { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; min-height: 100dvh; }
.lg__brand { position: relative; overflow: hidden; color: #fff; padding: 3rem 3.5rem; display: flex; flex-direction: column; justify-content: space-between; gap: 2.5rem;
  background: linear-gradient(155deg, #0a1f30 0%, #123A57 55%, #0a2a8a 140%); }
.lg__brand > *:not(.orb) { position: relative; z-index: 1; }
.orb { position: absolute; border-radius: 50%; filter: blur(64px); animation: drift 18s ease-in-out infinite alternate; pointer-events: none; }
.orb1 { width: 28rem; height: 28rem; background: #0014E0; opacity: .55; top: -9rem; right: -7rem; }
.orb2 { width: 22rem; height: 22rem; background: #1fb5c4; opacity: .30; bottom: -7rem; left: -6rem; animation-duration: 23s; }
.orb3 { width: 15rem; height: 15rem; background: #7a86ff; opacity: .30; top: 42%; left: 48%; animation-duration: 27s; animation-direction: alternate-reverse; }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(-48px, 36px) scale(1.18); } }
.lg__logo { font-size: 1.6rem; font-weight: 800; letter-spacing: .02em; }
.lg__logo .b1 { color: #fff; }
.lg__logo .b2 { color: #9fb7cc; }
.lg__eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: .72rem; font-weight: 600; color: #9fb7cc; margin: 0 0 .9rem; }
.lg__copy h2 { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; font-size: clamp(2.3rem, 4.2vw, 3.7rem); line-height: 1.04; margin: 0 0 1.1rem; color: #fff; letter-spacing: -.01em; }
.lg__copy h2 em { color: #9aa8ff; }
.lg__sub { color: #c4d3e0; max-width: 30rem; font-size: 1.02rem; margin: 0; }
.lg__demo { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.16); border-radius: 18px; padding: 1.15rem 1.25rem 1.3rem; max-width: 29rem; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: floaty 7s ease-in-out infinite; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.demo__row { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.demo__label { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: #9fb7cc; font-weight: 600; }
.demo__chip { font-size: .72rem; background: rgba(154,168,255,.2); color: #d5dbff; padding: .15rem .65rem; border-radius: 99px; font-weight: 600; }
.demo__steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; padding: 0; margin: 0 0 1.2rem; }
.demo__steps li { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); border-radius: 10px; padding: .6rem .65rem; font-size: .8rem; color: #b9cbda; animation: lit 9s infinite; animation-delay: calc(var(--i) * 3s); }
.demo__steps .tick { color: #7ee2a8; font-weight: 800; }
@keyframes lit {
  0% { background: rgba(255,255,255,.07); color: #b9cbda; transform: none; }
  5%, 30% { background: #fff; color: #0c2538; border-color: #fff; transform: translateY(-3px); box-shadow: 0 10px 24px -8px rgba(0,0,0,.45); }
  36%, 100% { background: rgba(255,255,255,.07); color: #b9cbda; transform: none; }
}
.demo__bar { height: 8px; background: rgba(255,255,255,.14); border-radius: 99px; overflow: hidden; margin-bottom: .75rem; }
.demo__bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #8f9dff, #fff); animation: fill 6s ease-in-out infinite; }
@keyframes fill { 0% { width: 6%; } 75%, 100% { width: 100%; } }
.demo__dots { display: flex; gap: .4rem; }
.demo__dots s { width: 1.15rem; height: 1.15rem; border-radius: 5px; background: rgba(255,255,255,.14); animation: dot 6s infinite; text-decoration: none; }
.demo__dots s:nth-child(1) { animation-delay: 0s; }   .demo__dots s:nth-child(2) { animation-delay: .6s; }
.demo__dots s:nth-child(3) { animation-delay: 1.2s; } .demo__dots s:nth-child(4) { animation-delay: 1.8s; }
.demo__dots s:nth-child(5) { animation-delay: 2.4s; } .demo__dots s:nth-child(6) { animation-delay: 3s; }
.demo__dots s:nth-child(7) { animation-delay: 3.6s; } .demo__dots s:nth-child(8) { animation-delay: 4.2s; }
@keyframes dot { 0%, 4% { background: rgba(255,255,255,.14); } 12%, 90% { background: #8f9dff; } 100% { background: rgba(255,255,255,.14); } }

.lg__panel { display: flex; align-items: center; justify-content: center; padding: 2.5rem 2rem; background: radial-gradient(60rem 30rem at 100% 0%, var(--wash), transparent 60%), var(--bg); }
.lg__card { width: 100%; max-width: 25.5rem; background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 2.3rem 2.1rem 1.6rem; box-shadow: 0 30px 60px -28px rgba(18,58,87,.35); animation: rise .8s cubic-bezier(.2,.8,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.lg__card h1 { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; font-size: 2.15rem; line-height: 1.1; margin-bottom: .35rem; }
.lg__lead { margin: 0 0 1.4rem; }
.lg__mobilelogo { display: none; }
.lg__foot { text-align: center; color: var(--slate); font-size: .78rem; margin: 1.3rem 0 0; }

@media (prefers-reduced-motion: reduce) {
  .orb, .lg__demo, .demo__steps li, .demo__bar i, .demo__dots s, .lg__card { animation: none !important; }
  .demo__bar i { width: 100%; }
  .demo__dots s { background: #8f9dff; }
}

/* ================= tablet / phone ================= */
@media (max-width: 960px) {
  .lg { grid-template-columns: 1fr; min-height: 0; }
  .lg__brand { padding: 1.6rem 1.4rem 3rem; gap: 1.1rem; }
  .lg__demo, .lg__sub { display: none; }
  .lg__copy h2 { font-size: 2.1rem; margin-bottom: 0; }
  .lg__eyebrow { margin-bottom: .5rem; }
  .lg__panel { margin-top: -1.6rem; position: relative; z-index: 2; border-radius: 24px 24px 0 0; padding: 1.4rem 1.2rem 2rem; background: #fff; align-items: flex-start; min-height: calc(100dvh - 11rem); }
  .lg__card { border: 0; box-shadow: none; padding: .6rem .25rem; border-radius: 0; }
  .lg__card h1 { font-size: 1.9rem; }
}

@media (max-width: 860px) {
  html { scroll-padding-top: 4.5rem; }
  body { font-size: 16px; }
  input, select, textarea { font-size: 16px; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 38px; }
  h1 { font-size: 1.5rem; }
  .card { padding: 1rem; }
  .wrap { padding-bottom: 4rem; }

  /* header becomes a menu */
  .bar { flex-wrap: wrap; align-items: center; gap: 0 .5rem; padding: 0 .9rem; }
  .brand { padding: .75rem 0; }
  .burger { display: inline-flex; }
  .bar nav { display: none; flex: 1 1 100%; flex-direction: column; gap: 0; overflow: visible; padding: .35rem 0 .8rem; border-top: 1px solid var(--line); }
  .bar.open nav { display: flex; }
  .bar nav a { padding: .85rem .7rem; border: 0; border-radius: 9px; font-size: 1rem; }
  .bar nav a.on { background: var(--wash); }
  .nav-user { margin: .5rem 0 0; padding: .7rem .7rem .2rem; border-top: 1px solid var(--line); max-width: none; align-self: stretch; text-align: left; }
  .bar nav a.nav-out { font-size: .95rem; }

  .pagehead { flex-direction: column; align-items: stretch; }
  .pagehead > .btn { width: 100%; }
  .pagehead .actions { width: 100%; }
  .pagehead .actions .btn, .pagehead .actions form { flex: 1 1 auto; }
  .pagehead .actions form .btn { width: 100%; }
  .actions > .btn, .actions > form { flex: 1 1 auto; }
  .stats-5 .stat-main { grid-column: 1 / -1; }

  .inline-form { flex-direction: column; align-items: stretch; gap: .7rem; }
  .inline-form label { flex: 1 1 auto; min-width: 0; }
  .inline-form input { max-width: none !important; }
  .inline-form .btn { width: 100%; }
  .inline-form label.check { padding-bottom: 0; }
  .toolbar .tabs { overflow-x: auto; flex-wrap: nowrap; width: 100%; padding-bottom: 2px; }
  .tabs a { white-space: nowrap; min-height: 40px; display: inline-flex; align-items: center; }
  .contact .rm-contact { justify-self: end; }
  .wip { flex-wrap: wrap; }
  .wip .progress { flex: 1 1 100%; order: 3; }
  .chips { gap: .4rem; }
}

/* tables turn into stacked cards */
@media (max-width: 760px) {
  .tablewrap { overflow: visible; }
  .card.tablewrap { background: transparent; border: 0; border-radius: 0; padding: 0; }
  .t, .t tbody, .t tfoot { display: block; width: 100%; }
  .t thead { display: none; }
  .t tr { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: .55rem .95rem; margin-bottom: .7rem; }
  .t td { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .4rem 0; border: 0; text-align: right; }
  .t td::before { content: attr(data-label); color: var(--slate); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; text-align: left; flex: 0 0 auto; }
  .t td:first-child { display: block; text-align: left; font-size: 1.02rem; padding-top: .3rem; }
  .t td:first-child::before, .t td[data-label=""]::before { display: none; }
  .t td[data-label=""] { justify-content: flex-end; }
  .t td:empty { display: none; }
  .t tbody tr:hover { background: #fff; }
  .t tbody tr:last-child td { border-bottom: 0; }
  .t tfoot td { border: 0; }
  .t td > small { display: block; }
  .t td input:not([type=checkbox]) { flex: 1; min-width: 0; max-width: none !important; text-align: left; }
  .t td form { margin: 0; }
  td.prog { min-width: 0; }
  td.prog .progress { width: 100%; }
  /* tables that live inside a normal card: plain dividers, no nested boxes */
  .card:not(.tablewrap) .t tr { background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: .6rem 0; margin: 0; }
  .card:not(.tablewrap) .t tr:last-child { border-bottom: 0; }
}

/* invoice on a phone */
@media (max-width: 640px) {
  .invoice-body { padding: .5rem; }
  .inv-tools { flex-direction: column; align-items: stretch; }
  .inv-tools .inline-form { flex-direction: column; align-items: stretch; }
  .inv { padding: 1.1rem; min-height: 0; font-size: 13px; }
  .inv__head { flex-direction: column; gap: 1rem; }
  .inv__meta { text-align: left; }
  .inv__meta table { margin-left: 0; }
  .inv__meta th, .inv__meta td { text-align: left; }
  .inv__lines th, .inv__lines td { padding-left: .25rem; padding-right: .25rem; }
  .inv__lines td.r, .inv__lines th.r { white-space: nowrap; }
}
@media (max-width: 860px) {
  .stats, .stats-5 { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .stat { padding: .8rem .85rem; min-width: 0; }
  .stat strong { font-size: 1.15rem; word-break: break-word; }
  .stat span { font-size: .7rem; }
}
@media (max-width: 330px) {
  .stats, .stats-5 { grid-template-columns: 1fr; }
}
