/* 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: simple centred card on a soft, faded light background ---- */
body.login {
  min-height: 100vh; min-height: 100dvh;
  background:
    radial-gradient(42rem 28rem at 12% 8%, rgba(0, 20, 224, .10), transparent 65%),
    radial-gradient(38rem 26rem at 92% 90%, rgba(18, 58, 87, .13), transparent 65%),
    radial-gradient(30rem 20rem at 85% 8%, rgba(31, 181, 196, .10), transparent 65%),
    #f6f8fc;
}
.login .wrap { max-width: none; margin: 0; padding: 0; min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; }
.login .flash { margin: 0 0 1rem; }
.lg { width: 100%; padding: 1.5rem 1rem; display: flex; justify-content: center; }
.lg__card { width: 100%; max-width: 24rem; background: rgba(255, 255, 255, .92); border: 1px solid var(--line); border-radius: 18px; padding: 2rem 2rem 1.5rem; box-shadow: 0 24px 60px -30px rgba(18, 58, 87, .35); animation: rise .6s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.lg__mobilelogo { display: block; font-weight: 800; font-size: 1.5rem; letter-spacing: .02em; margin-bottom: 1rem; }
.lg__card h1 { font-size: 1.3rem; margin-bottom: .2rem; }
.lg__lead { margin: 0 0 1.2rem; }
.lg__foot { text-align: center; color: var(--slate); font-size: .78rem; margin: 1.2rem 0 0; }
@media (prefers-reduced-motion: reduce) { .lg__card { animation: none; } }

/* ================= tablet / phone ================= */
@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; }
}
