/* RNJ Admin System */
body.admin { background: var(--rnj-bg); font-size: .925rem; }
.admin-shell { display: flex; min-height: 100vh; }
.sidebar { width: 262px; flex-shrink: 0; background: var(--rnj-green); color: #CFE0D4; position: fixed; inset: 0 auto 0 0; overflow-y: auto; z-index: 1040; transition: transform .25s; }
.sidebar .brand { display: flex; align-items: center; justify-content: center; padding: 18px 18px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .brand img { height: 58px; }
.sidebar .nav-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: #7FA18A; padding: 18px 22px 6px; font-weight: 700; }
.sidebar .nav-link { color: #D9E7DD; padding: 8px 22px; display: flex; align-items: center; gap: 11px; font-weight: 500; border-left: 3px solid transparent; font-size: .9rem; }
.sidebar .nav-link i { font-size: 1.05rem; width: 20px; text-align: center; opacity: .85; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar .nav-link.active { background: rgba(233,122,46,.14); color: #fff; border-left-color: var(--rnj-orange); }
.sidebar .nav-link.active i { color: var(--rnj-orange); opacity: 1; }
.sidebar .nav-link .badge { margin-left: auto; background: var(--rnj-orange); font-size: .68rem; }
.sidebar .side-foot { padding: 16px 22px 26px; font-size: .75rem; color: #7FA18A; }

.main { flex: 1; margin-left: 262px; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 1030; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rnj-line); height: 62px; display: flex; align-items: center; gap: 14px; padding: 0 24px; }
.topbar .search { max-width: 360px; flex: 1; }
.topbar .search .form-control { background: var(--rnj-bg); border-color: transparent; padding-left: 36px; }
.topbar .search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--rnj-muted); }
.topbar .user-chip { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--rnj-green); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; }
.content { padding: 24px; max-width: 1480px; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; }
.page-head h1 { font-size: 1.45rem; font-weight: 800; margin: 0; color: var(--rnj-green); }
.page-head .crumbs { font-size: .8rem; color: var(--rnj-muted); margin-bottom: 2px; }
.page-head .crumbs a { color: var(--rnj-muted); text-decoration: none; }

.stat { background: #fff; border: 1px solid var(--rnj-line); border-radius: var(--rnj-radius); padding: 16px 18px; box-shadow: var(--rnj-shadow); height: 100%; }
.stat .k { font-size: .78rem; color: var(--rnj-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat .v { font-family: 'Manrope', sans-serif; font-size: 1.65rem; font-weight: 800; color: var(--rnj-green); line-height: 1.2; margin-top: 4px; }
.stat .ic { width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--rnj-green-50); color: var(--rnj-green); font-size: 1.1rem; float: right; }
.stat.accent .ic { background: var(--rnj-orange-100); color: var(--rnj-orange-600); }

.table { --bs-table-hover-bg: #F4F8F5; margin-bottom: 0; }
.table > thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--rnj-muted); font-weight: 700; background: #FAFCFA; border-bottom-width: 1px; white-space: nowrap; }
.table td { vertical-align: middle; }
.table-card { overflow: hidden; }
.table-card .table-responsive { border-radius: 0 0 var(--rnj-radius) var(--rnj-radius); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--rnj-line); background: #fff; }
.filters .form-control, .filters .form-select { max-width: 220px; }
.pagination { --bs-pagination-active-bg: var(--rnj-green); --bs-pagination-active-border-color: var(--rnj-green); --bs-pagination-color: var(--rnj-green); margin: 0; }

.nav-tabs.rnj-tabs { border-bottom: 1px solid var(--rnj-line); gap: 2px; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; }
.nav-tabs.rnj-tabs .nav-link { border: 0; border-bottom: 3px solid transparent; color: var(--rnj-muted); font-weight: 600; padding: 10px 14px; white-space: nowrap; }
.nav-tabs.rnj-tabs .nav-link.active { color: var(--rnj-green); border-bottom-color: var(--rnj-orange); background: transparent; }
.nav-tabs.rnj-tabs .nav-link .badge { font-size: .65rem; vertical-align: middle; }

.txn-head { background: #fff; border: 1px solid var(--rnj-line); border-radius: var(--rnj-radius); padding: 18px 20px; box-shadow: var(--rnj-shadow); margin-bottom: 18px; }
.txn-head .ref { font-size: 1.15rem; }
.limit-box { border: 1px dashed var(--rnj-orange); background: #FFFBF7; border-radius: 12px; padding: 12px 14px; }
.limit-box .lv { font-family: 'Manrope', sans-serif; font-weight: 800; color: var(--rnj-green); }
.guard { border-left: 4px solid var(--rnj-orange); background: #FFF8F1; padding: 10px 14px; border-radius: 8px; font-size: .86rem; }
.option-card { border: 1px solid var(--rnj-line); border-radius: 12px; padding: 14px; background: #fff; height: 100%; }
.option-card.approved, .option-card.purchased { border-color: var(--rnj-green-600); box-shadow: 0 0 0 2px rgba(22,112,58,.15); }
.option-card.rejected, .option-card.withdrawn, .option-card.outbid { opacity: .6; }
.msg { max-width: 78%; padding: 10px 13px; border-radius: 14px; margin-bottom: 8px; font-size: .9rem; }
.msg.me { margin-left: auto; background: var(--rnj-green); color: #fff; border-bottom-right-radius: 4px; }
.msg.them { background: #fff; border: 1px solid var(--rnj-line); border-bottom-left-radius: 4px; }
.msg .meta { font-size: .7rem; opacity: .75; margin-top: 3px; }
.msg-wrap { max-height: 480px; overflow-y: auto; padding: 14px; background: var(--rnj-bg); border-radius: 12px; }

.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: #fff; }
.auth-page .auth-side { background: radial-gradient(circle at 20% 20%, rgba(233,122,46,.22), transparent 45%), linear-gradient(160deg, var(--rnj-green) 0%, #04290F 100%); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-page .auth-form { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-page .auth-card { width: 100%; max-width: 400px; }
@media (max-width: 991px) { .auth-page { grid-template-columns: 1fr; } .auth-page .auth-side { display: none; } }

@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
    .main { margin-left: 0; }
    .content { padding: 16px; }
    .topbar { padding: 0 16px; }
}
@media print { .sidebar, .topbar, .no-print { display: none !important; } .main { margin: 0; } }

/* Row action buttons (list pages) */
.row-actions { display: inline-flex; gap: .3rem; align-items: center; }
.row-actions form { margin: 0; }
.row-actions .btn-sm { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.insights-table .col-title { min-width: 210px; max-width: 340px; }
.insights-table td.small { max-width: 110px; }
.insights-table td.small { max-width: 130px; }
/* keep Actions pinned in view even when the table scrolls sideways */
.table .col-actions { position: sticky; right: 0; background: var(--bs-body-bg, #fff); box-shadow: -8px 0 12px -10px rgba(0,0,0,.25); z-index: 1; }
.table > thead th.col-actions { background: #FAFCFA; }
.table-hover > tbody > tr:hover > .col-actions { background: #f3f6f4; }

/* ---- Proof Library media manager ---- */
.consent-card.attention { box-shadow: 0 0 0 3px rgba(233,122,46,.35); }
.mm-label { font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--rnj-muted, #5b6b61); margin-bottom: .5rem; }
.mm-cover { aspect-ratio: 16/10; border-radius: 12px; overflow: hidden; background: #EEF2EF; border: 1px solid #E2E8E4; }
.mm-cover img { width: 100%; height: 100%; object-fit: cover; }
.mm-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; color: #7C8A81; text-align: center; padding: 1rem; font-size: .85rem; }
.mm-empty i { font-size: 2rem; }
.mm-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem; text-align: center; padding: 1.4rem 1rem; border: 2px dashed #C9D6CD; border-radius: 12px; background: #F7FAF8; cursor: pointer; transition: .15s; position: relative; margin: 0; }
.mm-drop:hover, .mm-drop.over { border-color: #E97A2E; background: #FFF6EF; }
.mm-drop i { font-size: 1.8rem; color: #063B18; }
.mm-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.mm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.mm-tile { border: 1px solid #E2E8E4; border-radius: 12px; overflow: hidden; background: #fff; display: flex; flex-direction: column; transition: box-shadow .15s; }
.mm-tile:hover { box-shadow: 0 6px 20px rgba(6,59,24,.10); }
.mm-tile.is-cover { border-color: #E97A2E; box-shadow: 0 0 0 2px rgba(233,122,46,.35); }
.mm-media { position: relative; display: block; aspect-ratio: 4/3; background: #0f1a13; overflow: hidden; }
.mm-media img, .mm-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.mm-linkph { height: 100%; display: flex; align-items: center; justify-content: center; font-size: 2.6rem; color: #fff; background: linear-gradient(135deg,#063B18,#0d5a2a); }
.mm-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 46px; height: 46px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; pointer-events: none; }
.mm-num { position: absolute; top: 6px; left: 6px; background: rgba(255,255,255,.92); color: #063B18; font-weight: 800; font-size: .72rem; border-radius: 6px; padding: 1px 7px; }
.mm-badges { position: absolute; left: 6px; bottom: 6px; right: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.mm-caption { padding: .45rem .6rem 0; font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-actions { display: flex; align-items: center; gap: 3px; padding: .45rem .5rem .5rem; }
.mm-actions form { margin: 0; display: inline; }
.mm-actions .btn { width: 30px; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #E2E8E4; }
.mm-actions .btn:hover:not(:disabled) { border-color: #063B18; }
.proof-thumb { display: flex; align-items: center; justify-content: center; width: 60px; height: 44px; border-radius: 8px; overflow: hidden; background: #EEF2EF; color: #7C8A81; font-size: 1.3rem; }
.proof-thumb img { width: 100%; height: 100%; object-fit: cover; }
