/* ===== JADI.PARTY dashboard — modern dark theme ===== */
:root {
  --bg: #0b0e14;
  --bg-2: #11151f;
  --panel: #161b27;
  --panel-2: #1c2230;
  --border: #252c3b;
  --text: #e6e9ef;
  --muted: #8b93a7;
  --primary: #7c5cff;
  --primary-2: #6446e6;
  --green: #2ecc71;
  --amber: #f1c40f;
  --red: #ff5d5d;
  --blue: #4aa8ff;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, #1a1430 0%, transparent 60%), var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
}
.hidden { display: none !important; }
a { color: inherit; text-decoration: none; cursor: pointer; }
code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }

/* ===== Login ===== */
.login-screen {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
}
.login-card {
  width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; padding: 32px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 8px;
}
.login-logo { font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.login-logo span { color: var(--primary); }
.login-sub { color: var(--muted); margin: 0 0 16px; }
.login-card label { font-size: 12px; color: var(--muted); margin-top: 10px; }

/* ===== App shell ===== */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--bg-2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 18px 14px; position: sticky; top: 0; height: 100vh;
}
.brand { font-size: 20px; font-weight: 800; padding: 6px 10px 18px; letter-spacing: -.5px; }
.brand span { color: var(--primary); }
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item.active { background: linear-gradient(90deg, rgba(124,92,255,.2), rgba(124,92,255,.05)); color: #fff; box-shadow: inset 2px 0 0 var(--primary); }
.sidebar-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--border); padding-top: 12px; }
.who { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px; border-bottom: 1px solid var(--border); position: sticky; top: 0;
  background: rgba(11,14,20,.8); backdrop-filter: blur(8px); z-index: 5;
}
.topbar h1 { font-size: 20px; margin: 0; }
.topbar-actions { display: flex; gap: 8px; }
.view { padding: 24px 28px; }

/* ===== Buttons / inputs ===== */
.btn {
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
  padding: 9px 14px; border-radius: 10px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; transition: filter .15s, background .15s;
}
.btn:hover { filter: brightness(1.15); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; margin-top: 14px; }

input, select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text);
  padding: 10px 12px; border-radius: 10px; font-size: 14px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
.form-error { color: var(--red); font-size: 13px; min-height: 18px; margin-top: 6px; }
.form-grid { display: grid; gap: 12px; }
.form-grid label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ===== Cards / stats ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.stat-card .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.stat-card .value { font-size: 30px; font-weight: 800; margin-top: 6px; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.panel h3 { margin: 0 0 14px; font-size: 15px; }
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
@media (max-width: 900px){ .app{grid-template-columns:1fr} .sidebar{display:none} .grid-2{grid-template-columns:1fr} .form-row{grid-template-columns:1fr} }

/* ===== Tables ===== */
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.toolbar .grow { flex: 1; min-width: 180px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; background: var(--bg-2); position: sticky; top: 0; }
tbody tr:hover { background: var(--panel-2); }
td code { background: var(--bg); padding: 2px 6px; border-radius: 6px; }
.row-actions { display: flex; gap: 6px; }

.badge { padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.badge.unused { background: rgba(74,168,255,.15); color: var(--blue); }
.badge.active { background: rgba(46,204,113,.15); color: var(--green); }
.badge.suspended { background: rgba(241,196,15,.15); color: var(--amber); }
.badge.revoked, .badge.expired { background: rgba(255,93,93,.15); color: var(--red); }
.badge.trial { background: rgba(74,168,255,.15); color: var(--blue); }
.badge.lifetime { background: rgba(124,92,255,.18); color: #b9a6ff; }
.badge.monthly, .badge.yearly { background: var(--panel-2); color: var(--muted); }

.pagination { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 14px; color: var(--muted); }
.muted { color: var(--muted); }
.empty { text-align: center; padding: 40px; color: var(--muted); }

/* ===== Modal ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { width: 100%; max-width: 520px; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); max-height: 90vh; overflow: auto; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-header h3 { margin: 0; }
.modal-close { background: none; border: none; color: var(--muted); font-size: 26px; cursor: pointer; line-height: 1; }
.modal-body { padding: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ===== Toasts ===== */
.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 100; }
.toast { background: var(--panel-2); border: 1px solid var(--border); border-left: 3px solid var(--primary); padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow); max-width: 360px; animation: slidein .2s ease; }
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }
@keyframes slidein { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

.key-reveal { background: var(--bg); border: 1px dashed var(--primary); border-radius: 10px; padding: 14px; font-family: ui-monospace, monospace; word-break: break-all; margin: 10px 0; }
.bulk-keys { max-height: 240px; overflow: auto; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px; font-family: ui-monospace, monospace; font-size: 12px; white-space: pre-wrap; }

/* simple canvas chart container */
.chart-wrap { height: 180px; }
canvas { width: 100%; height: 100%; display: block; }
