/* Artist Gig Manager: next event, gig cards with their messages, financials, statement.
   Builds on GigManagerPage.css (.gig-workspace, .gig-panel, .gig-metric, .gig-tab). */

.agm-heading { margin: 0 0 14px !important; }
.agm-group { margin: 22px 0 10px; color: #c8c8c8; font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.agm-empty-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 16px; }
.agm-more { margin: 14px 0 0; }
.agm-linkbtn { padding: 0; border: 0; background: none; cursor: pointer; text-transform: none; letter-spacing: normal; }
.agm-past { margin-top: 22px; }
.agm-past > summary { cursor: pointer; color: #c8c8c8; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; font-size: .8rem; padding: 8px 0; }

/* Next event */
.agm-next { display: grid; grid-template-columns: 280px minmax(0, 1fr); overflow: hidden; border: 1px solid #4a5a10; border-radius: 14px; background: #1d2012; }
.agm-next__art { min-height: 260px; background: #111 center / cover no-repeat; }
.agm-next__body { min-width: 0; padding: 22px 24px; display: flex; flex-direction: column; gap: 10px; }
.agm-next__countdown { margin: 0; color: #C1FE01; font-size: .8rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.agm-next h3 { margin: 0; color: #fff; font-size: 1.6rem; line-height: 1.15; overflow-wrap: anywhere; }
.agm-next__meta { margin: 0; color: #c8c8c8; }
.agm-next__facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 6px 0 0; }
.agm-next__facts div { min-width: 0; padding: 10px 12px; border-radius: 8px; background: rgba(0, 0, 0, .25); }
.agm-next__facts dt { color: #9a9a9a; font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.agm-next__facts dd { margin: 4px 0 0; color: #fff; font-weight: 700; overflow-wrap: anywhere; }
.agm-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 4px 0 0; padding: 0; list-style: none; color: #c8c8c8; font-size: .9rem; }
.agm-checks li::before { content: "○ "; color: #888; }
.agm-checks li.done { color: #e8f5b0; }
.agm-checks li.done::before { content: "✓ "; color: #C1FE01; }
.agm-next__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.agm-next__actions button { margin: 0; }

.agm-thread { margin-top: 14px; padding: 16px 18px; border: 1px solid #3a3a3a; border-radius: 12px; background: #1d1d1d; }
.agm-thread__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.agm-thread__head h3 { margin: 0; color: #fff; font-size: 1rem; }
.agm-thread__empty { margin: 0; color: #9a9a9a; }
.agm-msg { max-width: 80%; margin: 8px 0; padding: 10px 12px; border-radius: 12px 12px 12px 4px; background: #2a2a2a; }
.agm-msg--mine { margin-left: auto; border-radius: 12px 12px 4px 12px; background: #2b3312; }
.agm-msg__who { color: #9a9a9a; font-size: .75rem; }
.agm-msg p { margin: 4px 0 0; color: #f2f2f2; white-space: pre-line; overflow-wrap: anywhere; }

/* Gig card */
.agc-list { display: grid; gap: 10px; }
.agc { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 16px; padding: 16px; border: 1px solid #3a3a3a; border-radius: 12px; background: #232323; }
.agc--needs { border-color: #C1FE01; }
.agc__date { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 76px; border-radius: 10px; background: #151515; border: 1px solid #333; }
.agc__date strong { color: #fff; font-size: 1.6rem; line-height: 1; }
.agc__dow, .agc__mon { color: #a8a8a8; font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.agc__main { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.agc__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.agc__title { min-width: 0; }
.agc__title h3 { margin: 0; color: #fff; font-size: 1.05rem; overflow-wrap: anywhere; }
.agc__title p { margin: 3px 0 0; color: #a8a8a8; font-size: .9rem; overflow-wrap: anywhere; }
.agc-status { flex-shrink: 0; padding: 4px 9px; border-radius: 999px; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.agc-status--needs { background: #C1FE01; color: #111; }
.agc-status--ok { background: #1e3d28; color: #8fdfa0; }
.agc-status--wait { background: #3a3a3a; color: #e0e0e0; }
.agc-status--closed { background: #3d1e1e; color: #f0a0a0; }
.agc__facts { display: flex; flex-wrap: wrap; gap: 4px 16px; color: #c8c8c8; font-size: .88rem; }
.agc__facts b { margin-right: 4px; color: #f2f2f2; }
.agc__msg { display: flex; align-items: center; gap: 8px; width: 100%; margin: 0; padding: 8px 10px; border: 1px solid #333; border-radius: 8px; background: #1b1b1b; color: #c8c8c8; font: inherit; font-size: .88rem; text-align: left; text-transform: none; letter-spacing: normal; cursor: pointer; }
.agc__msg:hover, .agc__msg:focus-visible { border-color: #C1FE01; outline: none; }
.agc__msg--unread { border-color: #4a5a10; background: #1d2012; color: #f2f2f2; }
.agc__msg-who { flex-shrink: 0; color: #f2f2f2; font-weight: 700; }
.agc__msg-text { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agc__msg-time { flex-shrink: 0; color: #8a8a8a; font-size: .78rem; }
.agc__msg-badge { flex-shrink: 0; padding: 2px 7px; border-radius: 999px; background: #C1FE01; color: #111; font-size: .72rem; font-weight: 800; }
.agc__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.agc__actions button { margin: 0; }

/* Financials */
.afp-totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.afp-total { min-width: 0; padding: 16px; border: 1px solid #3a3a3a; border-radius: 10px; background: #232323; }
.afp-total--main { border-color: #4a5a10; background: #1d2012; }
.afp-total span, .afp-total small { display: block; color: #a8a8a8; font-size: .85rem; }
.afp-total strong { display: block; margin: 6px 0; color: #fff; font-size: 1.5rem; line-height: 1.1; overflow-wrap: anywhere; }
.afp-table { border: 1px solid #3a3a3a; border-radius: 12px; overflow: hidden; }
.afp-row { display: grid; grid-template-columns: 110px minmax(0, 2fr) repeat(3, minmax(90px, 1fr)) minmax(140px, 1.3fr) 130px; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid #2e2e2e; background: #1d1d1d; color: #e8e8e8; font-size: .9rem; }
.afp-row--head { border-top: 0; background: #232323; color: #9a9a9a; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.afp-num { text-align: right; font-variant-numeric: tabular-nums; }
.afp-net { color: #fff; font-weight: 800; }
.afp-gig { min-width: 0; display: flex; flex-direction: column; }
.afp-gig strong { color: #fff; overflow-wrap: anywhere; }
.afp-gig small { color: #9a9a9a; }
.afp-date { color: #c8c8c8; }
.afp-links { text-align: right; }
.afp-state { display: inline-block; padding: 4px 9px; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.afp-state--ok { background: #1e3d28; color: #8fdfa0; }
.afp-state--held { background: #243056; color: #b8c7ff; }
.afp-state--warn { background: #3d3310; color: #f5e9a8; }
.afp-state--wait { background: #3a3a3a; color: #e0e0e0; }
.afp-state--closed { background: #3d1e1e; color: #f0a0a0; }
.afp-row--closed { opacity: .7; }
.afp-foot { margin: 12px 0 0; color: #9a9a9a; font-size: .85rem; max-width: 80ch; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Statement (paper look on screen, clean on print) */
.ast-page { max-width: 820px; margin: 0 auto; padding: 16px 0 48px; }
.ast-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.ast-doc { padding: 36px 40px; border-radius: 8px; background: #fff; color: #1a1a1a; }
.ast-doc__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 18px; border-bottom: 2px solid #1a1a1a; }
.ast-logo { height: 28px; margin-bottom: 14px; }
.ast-doc h1 { margin: 0; color: #1a1a1a; font-size: 1.8rem; }
.ast-doc__head p { margin: 4px 0 0; color: #555; }
.ast-parties { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 20px 0; }
.ast-parties span { display: block; color: #777; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.ast-parties strong { display: block; color: #1a1a1a; overflow-wrap: anywhere; }
.ast-parties small { color: #555; }
.ast-lines { width: 100%; border-collapse: collapse; margin: 8px 0; }
.ast-lines th, .ast-lines td { padding: 10px 0; border-bottom: 1px solid #e3e3e3; color: #1a1a1a; font-weight: 400; text-align: left; }
.ast-lines td { text-align: right; font-variant-numeric: tabular-nums; }
.ast-lines__total th, .ast-lines__total td { font-weight: 800; font-size: 1.1rem; border-bottom: 2px solid #1a1a1a; }
.ast-section { margin-top: 24px; }
.ast-section h2 { margin: 0 0 6px; color: #1a1a1a; font-size: 1.05rem; }
.ast-timeline { margin: 0; padding: 0; list-style: none; color: #777; }
.ast-timeline li { padding: 4px 0; }
.ast-timeline li::before { content: "○  "; }
.ast-timeline li.done { color: #1a1a1a; }
.ast-timeline li.done::before { content: "✓  "; color: #3a7a00; }
.ast-timeline__warn { color: #a03030 !important; }
.ast-note { margin: 8px 0 0; color: #555; font-size: .9rem; }
.ast-doc .afp-state--ok { background: #e3f5e6; color: #1e6b30; }
.ast-doc .afp-state--held { background: #e4e9fb; color: #2b3f8a; }
.ast-doc .afp-state--wait { background: #eee; color: #444; }

@media print {
    .no-print, .mud-appbar, .mud-drawer, nav, header.mud-appbar { display: none !important; }
    body, .mud-main-content { background: #fff !important; }
    .ast-page { max-width: none; padding: 0; }
    .ast-doc { padding: 0; }
}

@media (max-width: 900px) {
    .agm-next__facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .afp-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .afp-row--head { display: none; }
    .afp-row { grid-template-columns: 1fr 1fr; gap: 6px 12px; }
    .afp-gig { grid-column: 1 / -1; order: -1; }
    .afp-num { text-align: left; }
    .afp-num::before { content: attr(data-label); display: block; color: #9a9a9a; font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
    .afp-links { text-align: left; }
}
@media (max-width: 760px) {
    .agm-next { grid-template-columns: 1fr; }
    .agm-next__art { min-height: 150px; }
    .agm-next__body { padding: 16px; }
    .agm-msg { max-width: 92%; }
    .agc { grid-template-columns: 56px minmax(0, 1fr); gap: 12px; padding: 14px; }
    .agc__date { height: 64px; }
    .agc__top { flex-direction: column; gap: 6px; }
    .agc__actions { justify-content: stretch; }
    .agc__actions button { flex: 1 1 auto; }
    .ast-doc { padding: 22px 18px; }
    .ast-parties { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 420px) {
    .afp-totals { grid-template-columns: 1fr; }
}

.agc, .agc *, .agm-next, .agm-next *, .afp-table *, .agm-thread * { box-sizing: border-box; }
.gig-workspace__tabs .artist-gig__dot { margin-left: 6px; }

@media (max-width: 760px) {
    .artist-gig .gig-workspace__summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .artist-gig .gig-metric, .artist-gig button.gig-metric--link { min-height: 0; padding: 12px; }
    .artist-gig .gig-metric strong { font-size: 1.35rem; }
    /* Tabs: the Event Manager's phone grid (three per row, all visible) from GigManagerPage.css. */
}

/* Summary tiles are buttons; let their text wrap so they never push the page wider. */
.artist-gig .gig-workspace__summary > * { min-width: 0; }
.artist-gig button.gig-metric--link, .artist-gig button.gig-metric--link * { white-space: normal; overflow-wrap: anywhere; }
