/* admin-pro.css — shared design system for the owner + admin dashboards.
   App-shell layout (sidebar + main), cards, badges, tables, toasts, modals.
   Matches the site brand (--brand=#0b57d0); inherits CSS vars from styles.css. */

:root {
  --pro-bg:        #f6f7f9;
  --pro-surface:   #ffffff;
  --pro-line:      #e6e8ec;
  --pro-line-2:    #eef0f3;
  --pro-text:      #111827;
  --pro-muted:     #6b7280;
  --pro-subtle:    #9ca3af;
  --pro-brand:     #0b57d0;
  --pro-brand-2:   #0944a1;
  --pro-brand-on:  #eaf1ff;
  --pro-success:   #137333;
  --pro-success-bg:#dcf2e2;
  --pro-warning:   #8a6d00;
  --pro-warning-bg:#fff4d6;
  --pro-danger:    #b00020;
  --pro-danger-bg: #fde6e8;
  --pro-info:      #054666;
  --pro-info-bg:   #def0fa;
  --pro-radius:    10px;
  --pro-radius-sm: 6px;
  --pro-shadow:    0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --pro-shadow-md: 0 4px 14px rgba(0,0,0,.08);
  --pro-sidebar-w: 240px;
}

/* ── Shell ───────────────────────────────────────────────────────────── */
body.pro { background: var(--pro-bg); color: var(--pro-text); margin: 0; -webkit-font-smoothing: antialiased; }
.pro-shell { display: grid; grid-template-columns: var(--pro-sidebar-w) 1fr; min-height: 100vh; }
.pro-sidebar {
  background: #fff; border-right: 1px solid var(--pro-line); padding: 18px 14px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex !important; flex-direction: column !important;
}
.pro-sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; border-bottom: 1px solid var(--pro-line-2); margin: 0 -6px 8px; padding-left: 14px; padding-right: 14px; text-decoration: none; color: var(--pro-text); }
.pro-sidebar .brand img { width: 28px; height: 28px; }
.pro-sidebar .brand b { font-size: 1.05rem; letter-spacing: -0.01em; }

.pro-nav-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--pro-subtle); margin: 12px 12px 6px; font-weight: 700; }
.pro-sidebar .pro-nav-section:first-of-type { margin-top: 8px; }

.pro-nav { display: flex !important; flex-direction: column !important; gap: 1px; margin: 0 0 6px; padding: 0; list-style: none; }
.pro-nav a {
  display: flex !important; align-items: center; gap: 10px; padding: 10px 12px 10px 14px;
  color: var(--pro-text); text-decoration: none; border-radius: var(--pro-radius-sm);
  font-size: .92rem; font-weight: 500; line-height: 1.2;
  position: relative; transition: background .12s, color .12s;
}
.pro-nav a::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
  background: transparent; border-radius: 0 3px 3px 0; transition: background .12s;
}
.pro-nav a:hover { background: var(--pro-line-2); }
.pro-nav a.active { background: var(--pro-brand-on); color: var(--pro-brand); font-weight: 600; }
.pro-nav a.active::before { background: var(--pro-brand); }
.pro-nav a .nav-icon { width: 18px; display: inline-flex; justify-content: center; flex: 0 0 auto; opacity: .75; }
.pro-nav a.active .nav-icon { opacity: 1; }
.pro-nav a .count { margin-left: auto; background: var(--pro-line-2); color: var(--pro-muted);
  font-size: .7rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; min-width: 18px; text-align: center; }
.pro-nav a.active .count { background: var(--pro-brand); color: #fff; }

.pro-sidebar .sb-foot { margin-top: auto !important; padding: 14px 12px 4px; border-top: 1px solid var(--pro-line-2);
  font-size: .82rem; color: var(--pro-muted); }
.pro-sidebar .sb-foot a { color: var(--pro-muted); text-decoration: none; }
.pro-sidebar .sb-foot a:hover { color: var(--pro-brand); }

.pro-main { padding: 22px 26px 80px; min-width: 0; }
.pro-topbar { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; }
.pro-topbar h1 { font-size: 1.5rem; margin: 0; font-weight: 700; }
.pro-topbar .sub { color: var(--pro-muted); font-size: .92rem; }
.pro-topbar .spacer { flex: 1; }
.pro-topbar .meta-pill { display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 1px solid var(--pro-line); padding: 5px 10px;
  border-radius: 999px; font-size: .82rem; color: var(--pro-muted); }

/* ── Cards / sections ────────────────────────────────────────────────── */
.pro-card { background: var(--pro-surface); border: 1px solid var(--pro-line);
  border-radius: var(--pro-radius); padding: 18px 20px; box-shadow: var(--pro-shadow); }
.pro-card + .pro-card { margin-top: 14px; }
.pro-card-head { display: flex; align-items: center; gap: 10px; margin: -2px 0 12px; }
.pro-card-head h2, .pro-card-head h3 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.pro-card-head .sub { color: var(--pro-muted); font-size: .85rem; }
.pro-card-head .spacer { flex: 1; }

/* ── Stat grid (overview) ────────────────────────────────────────────── */
.pro-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 0 0 18px; }
.pro-stat { background: #fff; border: 1px solid var(--pro-line); border-radius: var(--pro-radius); padding: 14px 16px; }
.pro-stat .lbl { color: var(--pro-muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; font-weight: 600; }
.pro-stat .val { font-size: 1.7rem; font-weight: 800; line-height: 1.1; margin: 6px 0 2px; }
.pro-stat .hint { color: var(--pro-subtle); font-size: .8rem; }
.pro-stat.accent { border-left: 3px solid var(--pro-brand); }

/* ── Badges / pills ──────────────────────────────────────────────────── */
.pro-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px;
  border-radius: 999px; font-size: .72rem; font-weight: 700; line-height: 1.5; border: 1px solid transparent; }
.pro-pill.muted    { background: #f1f3f5; color: #5e6573; border-color: #e6e8ec; }
.pro-pill.brand    { background: var(--pro-brand-on); color: var(--pro-brand); border-color: #c9dcff; }
.pro-pill.success  { background: var(--pro-success-bg); color: var(--pro-success); border-color: #b8e3c4; }
.pro-pill.warning  { background: var(--pro-warning-bg); color: var(--pro-warning); border-color: #f0d98a; }
.pro-pill.danger   { background: var(--pro-danger-bg); color: var(--pro-danger); border-color: #f5b6bd; }
.pro-pill.info     { background: var(--pro-info-bg); color: var(--pro-info); border-color: #bfdef0; }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.pro-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px;
  border: 1px solid var(--pro-line); background: #fff; color: var(--pro-text);
  border-radius: var(--pro-radius-sm); font: inherit; font-weight: 600; font-size: .87rem;
  cursor: pointer; line-height: 1.2; text-decoration: none; transition: background .12s; }
.pro-btn:hover { background: var(--pro-line-2); }
.pro-btn.primary { background: var(--pro-brand); color: #fff; border-color: var(--pro-brand); }
.pro-btn.primary:hover { background: var(--pro-brand-2); }
.pro-btn.ghost { background: transparent; border-color: transparent; color: var(--pro-brand); }
.pro-btn.ghost:hover { background: var(--pro-brand-on); }
.pro-btn.danger { color: var(--pro-danger); border-color: #f5b6bd; }
.pro-btn.danger:hover { background: var(--pro-danger-bg); }
.pro-btn.sm { padding: 4px 10px; font-size: .8rem; }
.pro-btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ── Tables ──────────────────────────────────────────────────────────── */
.pro-table { width: 100%; border-collapse: collapse; font-size: .9rem; background: #fff;
  border: 1px solid var(--pro-line); border-radius: var(--pro-radius); overflow: hidden; }
.pro-table th, .pro-table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--pro-line-2); vertical-align: middle; }
.pro-table th { background: #fafbfc; font-weight: 600; font-size: .8rem; color: var(--pro-muted); text-transform: uppercase; letter-spacing: .03em; }
.pro-table tr:last-child td { border-bottom: 0; }
.pro-table tr:hover td { background: #fafbfc; }
.pro-table a { color: var(--pro-brand); text-decoration: none; font-weight: 500; }
.pro-table a:hover { text-decoration: underline; }

/* ── Forms ───────────────────────────────────────────────────────────── */
.pro-field { display: block; margin-bottom: 12px; }
.pro-field label { display: block; font-weight: 600; font-size: .82rem; margin-bottom: 4px; color: var(--pro-text); }
.pro-field input, .pro-field textarea, .pro-field select { width: 100%; padding: 9px 12px;
  border: 1px solid var(--pro-line); border-radius: var(--pro-radius-sm); font-size: .93rem;
  font-family: inherit; background: #fff; }
.pro-field input:focus, .pro-field textarea:focus, .pro-field select:focus {
  outline: none; border-color: var(--pro-brand); box-shadow: 0 0 0 3px var(--pro-brand-on); }
.pro-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Tabs (within a card) ────────────────────────────────────────────── */
.pro-tabs { display: flex; border-bottom: 1px solid var(--pro-line); margin: -4px 0 16px;
  gap: 4px; overflow-x: auto; }
.pro-tabs button { background: transparent; border: 0; padding: 10px 14px; font: inherit;
  font-weight: 600; font-size: .9rem; color: var(--pro-muted); cursor: pointer;
  border-bottom: 2px solid transparent; white-space: nowrap; }
.pro-tabs button:hover { color: var(--pro-text); }
.pro-tabs button.active { color: var(--pro-brand); border-bottom-color: var(--pro-brand); }

/* ── Empty / loading states ──────────────────────────────────────────── */
.pro-empty { text-align: center; padding: 40px 20px; color: var(--pro-muted); }
.pro-empty h3 { margin: 0 0 6px; color: var(--pro-text); font-size: 1.05rem; }
.pro-empty p { margin: 0 0 16px; font-size: .9rem; }
.pro-loading { color: var(--pro-muted); font-size: .9rem; padding: 20px; text-align: center; }
.pro-skel { display: block; background: linear-gradient(90deg, #eef0f3 25%, #f6f7f9 50%, #eef0f3 75%);
  background-size: 200% 100%; animation: pro-shimmer 1.4s infinite; height: 14px; border-radius: 4px; }
@keyframes pro-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Toast (snackbar) ────────────────────────────────────────────────── */
.pro-toast-host { position: fixed; bottom: 22px; right: 22px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
.pro-toast { background: #1f2937; color: #fff; padding: 11px 16px; border-radius: var(--pro-radius);
  font-size: .9rem; box-shadow: var(--pro-shadow-md); display: flex; align-items: center; gap: 10px;
  animation: pro-slide .25s ease-out; }
.pro-toast.success { background: #137333; }
.pro-toast.err { background: var(--pro-danger); }
@keyframes pro-slide { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── Paywall card ────────────────────────────────────────────────────── */
.pro-paywall { border: 2px dashed var(--pro-brand); background: var(--pro-brand-on);
  padding: 22px; border-radius: var(--pro-radius); text-align: center; }
.pro-paywall h3 { margin: 0 0 6px; color: var(--pro-brand-2); }
.pro-paywall p { margin: 0 0 14px; color: var(--pro-text); }

/* ── Mobile ──────────────────────────────────────────────────────────── */
.pro-menu-btn { display: none; background: #fff; border: 1px solid var(--pro-line);
  border-radius: var(--pro-radius-sm); width: 36px; height: 36px; cursor: pointer;
  align-items: center; justify-content: center; padding: 0; }
.pro-menu-btn span, .pro-menu-btn span::before, .pro-menu-btn span::after {
  content: ""; display: block; width: 18px; height: 2px; background: var(--pro-text); position: relative; }
.pro-menu-btn span::before { position: absolute; top: -6px; }
.pro-menu-btn span::after  { position: absolute; top:  6px; }

@media (max-width: 880px) {
  .pro-shell { grid-template-columns: 1fr; }
  .pro-sidebar { position: fixed; top: 0; left: 0; height: 100vh; width: 250px;
    transform: translateX(-100%); transition: transform .2s; z-index: 100;
    box-shadow: var(--pro-shadow-md); }
  body.pro.sb-open .pro-sidebar { transform: translateX(0); }
  body.pro.sb-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 99; }
  .pro-menu-btn { display: inline-flex; }
  .pro-main { padding: 14px 16px 80px; }
  .pro-form-row { grid-template-columns: 1fr; }
}
