/* oaf ai — UI polish layer (loaded last). Console, payments, people, plans, settings, sheets and studio. */
:root { --pz-r: 16px; --pz-line: rgba(153,144,221,.16); --pz-line-2: rgba(153,144,221,.26); --pz-card: rgba(255,255,255,.035); --pz-ease: cubic-bezier(.2,.8,.2,1); }

/* ---------- buttons: never squeeze, consistent heights ---------- */
.btn-gold, .btn-ghost, .btn-danger { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; flex-shrink: 0; line-height: 1.1; }
.btn-danger { border-radius: 999px; padding: 9px 16px; background: rgba(232,144,127,.08); border: 1px solid rgba(232,144,127,.35); color: #F2A898; font-weight: 500; }
.btn-danger:hover { background: rgba(232,144,127,.16); }
.icon-btn { flex-shrink: 0; }
.tab, .c-tabs button, .plans-tabs button { flex: none !important; white-space: nowrap; }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar, .c-tabs::-webkit-scrollbar { display: none; }

/* ---------- console shell ---------- */
dialog.console[open] { display: flex; flex-direction: column; background: linear-gradient(180deg, #121027, #0B0A18 240px) !important; border: 1px solid var(--pz-line-2) !important; box-shadow: 0 40px 120px -40px rgba(0,0,0,.9); }
dialog.console::backdrop { background: rgba(5,4,14,.72); backdrop-filter: blur(8px); }
.console .c-head { flex: none; padding: 16px 20px; gap: 12px; }
.console .c-head h2 { font-size: 26px; letter-spacing: -0.02em; }
.console .c-head .status { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.console .c-kpis { flex: none; padding: 14px 20px 0; gap: 10px; }
.console .c-kpis > * { padding: 12px 14px !important; border-radius: 14px !important; min-width: 0; }
/* the overview already shows these numbers */
.console:has(#c-tabs [data-tab="overview"].is-on) .c-kpis { display: none; }
.console .c-tabs {
  flex: none; display: flex; gap: 6px; padding: 14px 20px 12px; overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--pz-line); scroll-padding: 20px;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
}
.console .c-tabs button { flex: none !important; padding: 9px 15px; font-size: 13.5px; font-weight: 500; overflow: visible !important; border-color: var(--pz-line-2); color: rgba(255,255,255,.72); }
.console .c-tabs button:hover { color: #fff; border-color: rgba(255,122,89,.45); }
.console .c-tabs button b { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px; font-size: 11px; background: #fff; color: #0B0919; }
.console .c-tabs button b:empty, .console .c-tabs button b:is([data-n="0"]) { display: none; }
.console .c-body { flex: 1 1 auto; min-height: 0; padding: 18px 20px 28px; overscroll-behavior: contain; }

/* overview cards */
.ov-grid { gap: 12px !important; }
.ov-grid > * { border-radius: 16px !important; padding: 14px 16px !important; background: var(--pz-card) !important; border: 1px solid var(--pz-line) !important; min-width: 0; }
.ov-actions { gap: 8px !important; margin-top: 18px !important; }

/* filters */
.c-filter { gap: 10px !important; margin-bottom: 14px !important; align-items: center; }
.c-filter .c-search, .c-search { min-height: 44px; border-radius: 999px !important; padding: 0 18px !important; font-size: 14.5px; }
.c-filter .tabs { flex: none; max-width: 100%; }

/* ---------- rows (payments, people, ledger, plans) ---------- */
.console .c-list { gap: 12px; max-height: none; }
.console .c-row {
  grid-template-columns: minmax(0, 1fr) auto; gap: 14px 18px; padding: 16px 18px; border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.02)) !important; border: 1px solid var(--pz-line) !important;
  transition: border-color .2s, transform .25s var(--pz-ease);
}
.console .c-row:hover { border-color: var(--pz-line-2) !important; }
.console .c-row .who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 15.5px; letter-spacing: -0.01em; }
.console .c-row .who .status { margin: 0; }
.console .c-row .meta { gap: 4px 14px; font-size: 13px; margin-top: 6px; }
.console .c-row .meta > span { white-space: nowrap; }
.console .c-row .meta > span:first-child { white-space: normal; overflow-wrap: anywhere; color: rgba(255,255,255,.78); }
.console .c-actions { gap: 8px; align-items: center; }
.console .c-actions .btn-gold, .console .c-actions .btn-ghost, .console .c-actions .btn-danger { min-height: 38px; padding: 8px 14px; font-size: 13px; }
.console .c-actions input, .console .c-actions select {
  min-height: 38px; height: 38px; padding: 0 12px; border-radius: 999px; font-size: 13px; color: #fff;
  background-color: rgba(10,8,24,.6); border: 1px solid var(--pz-line-2);
}
.console .c-actions select { appearance: none; -webkit-appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b9b3e6' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 14px; }
.console .c-actions input[type=number] { width: 112px; }
.status { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 1; white-space: nowrap; }

/* payment proof / screenshot thumbnails inside rows */
.console .c-actions .proof, .console img.proof { width: 84px !important; height: 112px !important; max-width: none; object-fit: cover; object-position: top; border-radius: 12px; border: 1px solid var(--pz-line-2); cursor: zoom-in; flex: none; transition: transform .25s var(--pz-ease); }
.console img.proof:hover { transform: scale(1.04); }

/* settings */
.c-settings { gap: 16px !important; }
.c-settings label { font-size: 13px; }
.c-settings input, .c-settings select { min-height: 46px; }
.c-settings .btn-gold { min-height: 46px; padding: 0 26px; }
.warn-bar { flex-wrap: wrap; border-radius: 16px; }

/* plans editor */
.plan-admin .c-row { align-items: start; }

/* ---------- media (customer images) ---------- */
.md-bar { position: sticky; top: -18px; z-index: 2; margin: -18px -20px 14px; padding: 14px 20px 12px; background: linear-gradient(180deg, #0f0d22 75%, rgba(15,13,34,0)); }

/* ---------- studio tabs: fade the overflow so it reads as scrollable ---------- */
.stage nav.tabs { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); padding-right: 24px; }

/* ---------- sheets / dialogs in general ---------- */
dialog { overscroll-behavior: contain; }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  .console .c-head { padding: 12px 14px; }
  .console .c-head h2 { font-size: 22px; }
  .console .c-head .cmdk-btn { padding: 8px 12px; font-size: 13px; }
  .console .c-kpis { display: flex; overflow-x: auto; scrollbar-width: none; padding: 10px 14px 0; gap: 8px; }
  .console .c-kpis::-webkit-scrollbar { display: none; }
  .console .c-kpis > * { flex: 0 0 auto; min-width: 128px; padding: 10px 12px !important; }
  .console .c-tabs { padding: 10px 14px; gap: 6px; }
  .console .c-tabs button { padding: 8px 13px; font-size: 13px; }
  .console .c-body { padding: 14px 14px 32px; }
  .ov-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; }
  .ov-grid > * { padding: 12px !important; }
  .ov-actions > * { flex: 1 1 calc(50% - 8px); }
  .console .c-row { grid-template-columns: minmax(0, 1fr); padding: 14px; gap: 12px; }
  .console .c-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); justify-content: stretch; gap: 8px; }
  .console .c-actions > *, .console .c-actions .super-only > * { width: 100% !important; min-width: 0; }
  .console .c-actions .super-only[style*="contents"] > * { width: 100% !important; }
  .console .c-actions input[type=number] { width: 100%; }
  .console .c-actions .btn-danger { grid-column: 1 / -1; }
  .console .c-actions .proof { grid-column: 1 / -1; width: 96px !important; height: 128px !important; }
  .console .c-actions:empty { display: none; }
  .c-filter { flex-direction: column; align-items: stretch !important; }
  .c-filter .c-search { min-width: 0 !important; width: 100%; }
  .md-bar { margin: -14px -14px 12px; padding: 12px 14px 10px; top: -14px; }
  .c-settings { grid-template-columns: 1fr !important; }
}
