/* PDF statement import + editable sales ledger.
   Kept separate from style.css so the import feature can be reasoned about
   (and reverted) on its own. Uses the same custom properties. */

.imp-main { display: grid; gap: 1rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 720px) { .imp-main { grid-template-columns: 1.3fr 1fr; } }

.imp-badge { display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem;
             font-size: .8rem; color: var(--muted); flex-wrap: wrap; }
.pill { font-size: .65rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
        background: var(--green); color: #fff; padding: .15rem .45rem; border-radius: 4px; }

#pdf-drop { border: 2px dashed #C3CBE6; border-radius: 10px; padding: 1.4rem 1rem; text-align: center;
            background: #FBFCFF; display: grid; gap: .25rem; justify-items: center; }
#pdf-drop.over { border-color: var(--navy); background: var(--green-bg); }
#pdf-drop b { font-size: .98rem; }
#pdf-drop small { color: var(--muted); font-size: .82rem; }
#pdf-drop button { margin-top: .7rem; }
/* Dragging needs a mouse; on touch the button is the whole story. */
@media (hover: none) and (pointer: coarse) {
  #pdf-drop { border-style: solid; border-color: #E1E6F5; padding: 1rem; }
  #pdf-drop small.drag-only { display: none; }
}

details.how { margin-top: .7rem; border: 1px solid #E1E6F5; border-radius: 10px; background: #fff; }
details.how summary { cursor: pointer; font-weight: 700; font-size: .88rem; padding: .7rem .85rem;
                      min-height: 44px; display: flex; align-items: center; color: var(--navy-3); }
details.how ol { margin: 0 .85rem .3rem 1.9rem; font-size: .88rem; }
details.how li { margin: .3rem 0; }
details.how .import-hint { padding: 0 .85rem .8rem; }

.imp-side h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em;
               color: var(--navy-3); margin-bottom: .5rem; }
.months { display: grid; grid-template-columns: repeat(6, 1fr); gap: .3rem; }
@media (min-width: 720px) { .months { grid-template-columns: repeat(12, 1fr); } }
.months .mon { text-align: center; padding: .4rem .1rem; border-radius: 6px; font-size: .7rem;
               font-weight: 700; border: 1px solid #E1E6F5; background: #fff; color: #A7AFC9; }
.months .mon.have { background: var(--green-bg); border-color: #BCE3CD; color: var(--green); }
.months .mon.gap { background: var(--amber-bg); border-color: #E7C79B; color: var(--amber); }

.note-warn, .note-good, .note-bad { padding: .55rem .7rem; border-radius: 8px; font-size: .82rem;
                                    margin-top: .5rem; }
.note-warn { background: var(--amber-bg); border-left: 3px solid var(--amber); }
.note-good { background: var(--green-bg); border-left: 3px solid var(--green); }
.note-bad  { background: var(--red-bg); border-left: 3px solid var(--red); }

.fillbar { display: flex; align-items: center; gap: .6rem; margin-bottom: .7rem; }
.fillbar .track { flex: 1; height: 7px; background: #E6EAF7; border-radius: 4px; overflow: hidden; }
.fillbar .track i { display: block; height: 100%; background: var(--green); border-radius: 4px;
                    transition: width .2s ease; }
.fillbar span { font-size: .78rem; color: var(--muted); white-space: nowrap; }

.filterbar { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .7rem; }
.fbtn, .bulk { min-height: 40px; padding: .4rem .8rem; border-radius: 8px; cursor: pointer;
               font-size: .8rem; font-weight: 700; font-family: inherit; }
.fbtn { border: 1px solid #D7DDF0; background: #fff; color: var(--muted); }
.fbtn[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.bulk { border: 1px dashed var(--green); background: var(--green-bg); color: var(--green); }

/* Grid rather than a table: the same rows restructure from columns to stacked
   cards without duplicate markup, and a 6-column table is unusable at 375px. */
.shead { display: none; }
.slist { display: grid; gap: .5rem; }
.srow { display: grid; gap: .45rem .6rem; grid-template-columns: 1fr auto auto;
        padding: .65rem .7rem; border: 1px solid #E1E6F5; border-radius: 10px; background: #fff;
        align-items: center; }
.srow.needs { border-color: #E7C79B; background: #FFFDF8; }
.s-item { font-size: .9rem; font-weight: 600; }
.s-meta { font-size: .74rem; color: var(--muted); margin-top: .1rem;
          display: flex; align-items: center; gap: .3rem; }
.s-price { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.s-edit { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr; gap: .5rem; align-items: end; }
.s-edit label { font-size: .7rem; color: var(--muted); display: block; }
.s-edit input { width: 100%; }
.costhint { display: block; font-size: .68rem; color: var(--muted); margin-top: .15rem; }
.costhint.on { color: var(--green); font-weight: 700; }

.srcico { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px;
          border-radius: 4px; background: #EDF1FB; color: var(--navy-3); flex: none; }
.srcico.man { background: var(--amber-bg); color: var(--amber); }
.srcico svg { width: 11px; height: 11px; }

.qbtns { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; }
.qbtn { min-height: 44px; border: 1px solid #D7DDF0; background: #fff; border-radius: 8px;
        font-size: .78rem; font-weight: 700; font-family: inherit; color: var(--navy-3);
        cursor: pointer; padding: .3rem .25rem; }
.qbtn[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.qbtn.alt[aria-pressed="true"] { background: var(--navy-3); border-color: var(--navy-3); }
.linkish { background: none; border: 0; padding: .3rem 0 0; font-size: .72rem; color: var(--navy-3);
           text-decoration: underline; cursor: pointer; font-family: inherit; min-height: 32px; }
.answered { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; font-size: .78rem; }

.chip { grid-column: 1 / -1; justify-self: start; font-size: .72rem; font-weight: 700;
        padding: .2rem .5rem; border-radius: 6px; }
.chip.ex { background: var(--green-bg); color: var(--green); }
.chip.tx { background: #EDF1FB; color: var(--navy-3); }
.chip.un { background: var(--amber-bg); color: var(--amber); }
.chip.dec { background: #E8EEFF; color: var(--navy-3); }

/* padding:0 is load-bearing. style.css sets a global
   `button { padding: .55rem 1.1rem }`, and with border-box that padding ate
   35px of this button's 40px width — the icon rendered 4.8px wide and looked
   like a stray pixel. */
.s-del { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
         padding: 0; border: 0; background: none; border-radius: 8px; color: #8891B0;
         cursor: pointer; flex: none; }
.s-del svg { width: 20px; height: 20px; flex: none; }
.s-del:hover, .s-del:focus-visible { background: var(--red-bg); color: var(--red); }

/* Undo beats a confirm dialog: no modal on every legitimate delete, and the
   mistake stays recoverable. Deleting changes the DAC7 count, so a silent
   mis-tap is not acceptable. */
.undobar { display: flex; align-items: center; justify-content: space-between; gap: .6rem;
           background: var(--navy); color: #fff; border-radius: 8px; padding: .55rem .8rem;
           font-size: .82rem; margin-bottom: .6rem; }
.undobar button { background: none; border: 0; color: #9FE3BE; font-weight: 800; font-size: .82rem;
                  text-decoration: underline; cursor: pointer; font-family: inherit; min-height: 36px; }

.allset { text-align: center; padding: 1.2rem .8rem; color: var(--muted); font-size: .88rem; }

@media (min-width: 720px) {
  .shead { display: grid; gap: .6rem; padding: 0 .7rem .4rem;
           grid-template-columns: minmax(0,1fr) 6rem 9rem 7rem 10rem 2.9rem;
           font-size: .68rem; text-transform: uppercase; letter-spacing: .05em;
           color: var(--muted); font-weight: 800; }
  .shead .num { text-align: right; }
  .srow { grid-template-columns: minmax(0,1fr) 6rem 9rem 7rem 10rem 2.9rem; }
  /* order puts delete last on wide screens while keeping it beside the price
     on a phone, where the thumb expects it top-right. */
  .s-del { order: 99; }
  .s-edit { grid-column: auto; display: contents; }
  .s-edit label span.lbl { display: none; }
  .chip { grid-column: auto; }
}
.muted-note { color: var(--muted); font-style: italic; }
