/* RPMsto admin — RPMexp look (sidebar, cards, badges, modals) in the RPMflex palette. */
:root { --brand: #007149; --brand-600: #00603e; --brand-050: #e8f5f0; --ink: #1a2b24; --text: #374151; --muted: #6b7280;
  --border: #e5e7eb; --surface: #fff; --bg: #f5f7f6; --danger: #dc2626; --warn: #c2410c; --radius: 12px; }
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Nunito', 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 14px; color: var(--text); background: var(--bg); }
a { color: var(--brand); }
[hidden] { display: none !important; }
.app { display: flex; min-height: 100vh; }
/* sidebar */
.sidebar { width: 250px; flex: none; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; border-bottom: 1px solid var(--border); }
.brand strong { display: block; color: var(--brand); font-size: 18px; }
.brand span { display: block; font-size: 12.5px; color: var(--ink); font-weight: 700; }
.sidebar ul { list-style: none; margin: 0; padding: 10px; flex: 1; overflow-y: auto; }
.sidebar li.sec { font-size: 11px; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase; color: var(--muted); padding: 14px 10px 6px; }
.sidebar li a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 600; }
.sidebar li a i { width: 20px; text-align: center; font-style: normal; color: var(--muted); }
.sidebar li a:hover { background: var(--bg); }
.sidebar li a.on { background: var(--brand-050); color: var(--brand); }
.sidebar li a.on i { color: var(--brand); }
.me { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--border); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; }
.who { flex: 1; min-width: 0; }
.who a { display: block; font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who span { font-size: 12px; color: var(--muted); }
.out { font-size: 18px; color: var(--muted); text-decoration: none; }
.out:hover { color: var(--danger); }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.inner { padding: 26px 32px; flex: 1; }
.foot { padding: 12px 32px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); }
.overlay { display: none; }
/* page */
.page-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-header h1 { margin: 0; font-size: 22px; color: var(--ink); }
.page-header p { margin: 4px 0 0; color: var(--muted); }
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-weight: 600; }
.flash.ok { background: #dcfce7; color: #15803d; } .flash.err { background: #fee2e2; color: var(--danger); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; border-top: 3px solid var(--brand); }
.stat b { display: block; font-size: 26px; color: var(--ink); }
.stat span { color: var(--muted); font-weight: 600; }
.table-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; }
.table-card h2 { font-size: 15px; margin: 0; padding: 14px 18px; border-bottom: 1px solid var(--border); color: var(--ink); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 700; padding: 10px 14px; background: #fafafa; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid #f1f2f3; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #fcfdfc; }
.td-muted { color: var(--muted); font-size: 12.5px; }
.num { text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.empty { text-align: center; padding: 30px; color: var(--muted); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.b-green { background: #dcfce7; color: #15803d; } .b-gray { background: #f1f5f9; color: #64748b; }
.b-orange { background: #ffedd5; color: var(--warn); } .b-red { background: #fee2e2; color: var(--danger); }
.b-blue { background: #dbeafe; color: #1d4ed8; } .b-brand { background: var(--brand-050); color: var(--brand); }
/* buttons + forms */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; border-radius: 8px; padding: 8px 14px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; } .btn-primary:hover { background: var(--brand-600); }
.btn-secondary { background: #fff; border-color: var(--border); color: var(--ink); } .btn-secondary:hover { border-color: var(--brand); color: var(--brand); }
.btn-danger { background: #fff; border-color: #fecaca; color: var(--danger); } .btn-danger:hover { background: #fee2e2; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: #fff; text-decoration: none; color: var(--text); font-weight: 600; font-size: 13px; }
.filters a.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.filters input, .filters select { width: auto; }
.form-group { margin-bottom: 13px; }
.form-group label { display: block; font-weight: 700; margin-bottom: 5px; color: var(--ink); font-size: 13px; }
.req { color: var(--danger); }
.hint { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
input, select, textarea { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; color: var(--ink); }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-050); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand); vertical-align: middle; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 6px 0 12px; cursor: pointer; }
.section-title { font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin: 10px 0; padding-top: 8px; border-top: 1px solid var(--border); }
/* modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1000; display: none; align-items: flex-start; justify-content: center; padding: 4vh 12px; overflow-y: auto; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--surface); border-radius: 12px; width: 640px; max-width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal.wide { width: 860px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.modal-header h3 { margin: 0; font-size: 16px; color: var(--ink); }
.modal-close { background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--muted); }
.modal-body { padding: 18px 22px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); background: #fafafa; border-radius: 0 0 12px 12px; }
pre.json { background: #0f172a; color: #e2e8f0; padding: 14px; border-radius: 8px; overflow: auto; max-height: 420px; font-size: 12px; }
/* auth pages */
body.auth { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #04231a, #0a4a35); padding: 16px; }
.auth-card { width: 400px; max-width: 100%; background: #fff; border-radius: 16px; padding: 30px 30px 24px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.auth-brand { text-align: center; margin-bottom: 18px; }
.auth-brand h1 { margin: 6px 0 0; color: var(--brand); font-size: 24px; }
.auth-brand p { margin: 2px 0 0; color: var(--muted); }
.auth-card .btn { width: 100%; justify-content: center; padding: 11px; margin-top: 6px; }
.auth-links { text-align: center; margin-top: 14px; font-size: 13px; }
.otp-input { text-align: center; font-size: 26px; letter-spacing: 10px; font-weight: 700; }
.cf-turnstile { margin: 6px 0 10px; }
@media (max-width: 860px) {
  .sidebar { position: fixed; left: -260px; z-index: 1001; transition: left .2s; }
  .sidebar.open { left: 0; }
  .overlay.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 1000; }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--border); font-weight: 700; position: sticky; top: 0; z-index: 10; }
  .menu { background: none; border: 0; font-size: 22px; cursor: pointer; }
  .inner { padding: 18px 14px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
}
.lang-switch { text-align: center; margin-top: 16px; font-size: 12.5px; }
.lang-switch a { color: var(--muted); text-decoration: none; }
.lang-switch a.on { color: var(--brand); font-weight: 700; }
.thumb { width: 44px; height: 32px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); vertical-align: middle; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.src-table td { padding: 6px 8px; }
.lines-grid td input { width: 110px; }
