/* PriyoMeet admin panel. Plain CSS, no build step. */

:root {
    --brand: #e0245e;
    --brand-dark: #b81d4d;
    --brand-soft: #fde8ef;
    --ink: #1d1b26;
    --ink-2: #4b4858;
    --muted: #807c8f;
    --line: #e7e5ee;
    --bg: #f5f4f9;
    --card: #ffffff;
    --side: #1b1826;
    --side-2: #26222f;
    --side-ink: #bdb8cc;
    --ok: #16865a;
    --ok-soft: #e1f5ec;
    --warn: #a86400;
    --warn-soft: #fff1d9;
    --bad: #c42b2b;
    --bad-soft: #fde6e6;
    --info: #2d5fc7;
    --info-soft: #e5edfd;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(20, 16, 40, .06), 0 2px 8px rgba(20, 16, 40, .04);
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
    font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Bengali", sans-serif;
    color: var(--ink);
    background: var(--bg);
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }

code, .mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; }

/* ---------- Shell ---------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 236px;
    flex-shrink: 0;
    background: var(--side);
    color: var(--side-ink);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 18px 12px 24px;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; color: #fff; font-weight: 700; font-size: 17px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--brand); display: grid; place-items: center; font-size: 15px; color: #fff; }
.brand img { max-height: 30px; max-width: 30px; border-radius: 8px; }

.nav-group { margin-top: 14px; }
.nav-label { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: #736d85; padding: 0 10px 6px; }
.nav a {
    display: flex; align-items: center; justify-content: space-between;
    padding: 7px 10px; border-radius: 7px;
    color: var(--side-ink); text-decoration: none; font-size: 13.5px;
}
.nav a:hover { background: var(--side-2); color: #fff; }
.nav a.active { background: var(--brand); color: #fff; }
.nav-count { font-size: 11px; background: rgba(255, 255, 255, .14); border-radius: 20px; padding: 0 7px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 28px; background: var(--card); border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 5;
}
.topbar .who { display: flex; align-items: center; gap: 12px; color: var(--ink-2); }
.menu-toggle { display: none; }

.content { padding: 24px 28px 48px; max-width: 1400px; width: 100%; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

/* ---------- Cards & grids ---------- */

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-body { padding: 16px 18px; }
.card + .card, .card + .grid, .grid + .card, .grid + .grid { margin-top: 18px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-side { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.stat-value { font-size: 22px; font-weight: 700; margin-top: 4px; }
.stat-note { font-size: 12px; color: var(--muted); margin-top: 2px; }
a.stat { color: inherit; text-decoration: none; }
a.stat:hover { border-color: var(--brand); }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: #faf9fc; white-space: nowrap; }
tbody tr:hover { background: #fcfbfe; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
.empty { padding: 36px 18px; text-align: center; color: var(--muted); }

dl.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; word-break: break-word; }

/* ---------- Badges ---------- */

.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; background: #eeedf3; color: var(--ink-2); white-space: nowrap; }
.badge-ok, .badge-active, .badge-approved, .badge-verified, .badge-paid, .badge-completed, .badge-resolved, .badge-connected, .badge-online, .badge-sent, .badge-published { background: var(--ok-soft); color: var(--ok); }
.badge-warn, .badge-pending, .badge-processing, .badge-reviewing, .badge-suspended, .badge-ringing, .badge-calling, .badge-connecting, .badge-accepted, .badge-created, .badge-away, .badge-busy, .badge-in_call, .badge-high, .badge-draft, .badge-flagged { background: var(--warn-soft); color: var(--warn); }
.badge-bad, .badge-rejected, .badge-banned, .badge-failed, .badge-removed, .badge-critical, .badge-missed, .badge-refunded, .badge-blocked, .badge-unmatched, .badge-open { background: var(--bad-soft); color: var(--bad); }
.badge-info, .badge-premium, .badge-vip, .badge-ended, .badge-normal { background: var(--info-soft); color: var(--info); }
.badge-brand { background: var(--brand-soft); color: var(--brand-dark); }

/* ---------- Forms & buttons ---------- */

label { display: block; font-weight: 600; font-size: 12.5px; margin-bottom: 5px; color: var(--ink-2); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], input[type=file], select, textarea {
    width: 100%; padding: 8px 10px; border: 1px solid #d9d6e3; border-radius: 8px;
    font: inherit; color: var(--ink); background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
textarea { min-height: 90px; resize: vertical; }
.field { margin-bottom: 14px; }
.field-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.field-error { font-size: 12px; color: var(--bad); margin-top: 4px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: auto; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 7px 14px; border-radius: 8px; border: 1px solid #d9d6e3;
    background: #fff; color: var(--ink); font: inherit; font-weight: 600; font-size: 13px;
    cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: #f7f6fb; text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: #106a47; }
.btn-danger { background: #fff; border-color: #f0b8b8; color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
form.inline { display: inline; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; padding: 12px 18px; border-bottom: 1px solid var(--line); background: #fcfbfe; }
.filters .field { margin: 0; min-width: 140px; }
.filters input[type=search] { min-width: 220px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 12px; overflow-x: auto; }
.tabs a { padding: 11px 12px; color: var(--ink-2); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.active { border-color: var(--brand); color: var(--brand); font-weight: 600; }

details.action { position: relative; display: inline-block; }
details.action > summary { list-style: none; }
details.action > summary::-webkit-details-marker { display: none; }
details.action[open] > .popover {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 300px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(20, 16, 40, .16); padding: 14px; text-align: left;
}

/* ---------- Alerts ---------- */

.alert { padding: 11px 14px; border-radius: 8px; margin-bottom: 16px; border: 1px solid transparent; }
.alert-ok { background: var(--ok-soft); color: #0e5c3d; border-color: #bfe6d3; }
.alert-bad { background: var(--bad-soft); color: #8e1f1f; border-color: #f4c2c2; }
.alert-info { background: var(--info-soft); color: #1f4596; border-color: #c7d6f7; }
.alert ul { margin: 0; padding-left: 18px; }

/* ---------- Media ---------- */

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.photo-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.photo-card .thumb { aspect-ratio: 1 / 1; background: #ece9f3; display: grid; place-items: center; overflow: hidden; }
.photo-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-card .meta { padding: 10px; font-size: 12.5px; }
.photo-card .actions { padding: 0 10px 10px; }

.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.who-cell { display: flex; align-items: center; gap: 10px; }
.who-cell small { display: block; color: var(--muted); font-size: 12px; }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: #c9c5d4; margin-right: 6px; }
.dot-online { background: #20b26b; }

/* ---------- Charts ---------- */

.chart { display: flex; align-items: flex-end; gap: 4px; height: 150px; padding-top: 10px; }
.chart .bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.chart .bar span { display: block; width: 100%; max-width: 28px; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; opacity: .85; }
.chart .bar:hover span { opacity: 1; }
.chart-labels { display: flex; gap: 4px; margin-top: 6px; }
.chart-labels span { flex: 1; text-align: center; font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; min-width: 0; }
.chart-total { font-size: 20px; font-weight: 700; }

/* ---------- Conversation ---------- */

.thread { display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 70%; padding: 9px 12px; border-radius: 12px; background: #f1eff6; }
.bubble.right { align-self: flex-end; background: var(--brand-soft); }
.bubble .by { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.bubble.spam { outline: 2px solid var(--warn); }
.bubble.deleted { opacity: .55; font-style: italic; }

/* ---------- Pagination ---------- */

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pagination .pages { display: flex; gap: 4px; flex-wrap: wrap; }
.pagination a, .pagination span.page { min-width: 32px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 7px; text-align: center; color: var(--ink-2); background: #fff; }
.pagination a:hover { border-color: var(--brand); text-decoration: none; }
.pagination .current { background: var(--brand); border-color: var(--brand); color: #fff; }
.pagination .disabled { color: #c3bfcf; }
.pagination .summary { color: var(--muted); font-size: 12.5px; }

/* ---------- Login ---------- */

.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 10%, #fde8ef 0, transparent 40%), var(--bg); }
.auth-card { width: 100%; max-width: 380px; }
.auth-card .brand { color: var(--ink); justify-content: center; padding-bottom: 8px; }
.auth-card .card-body { padding: 26px; }

/* ---------- Utilities ---------- */

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }
.text-ok { color: var(--ok); }
.text-bad { color: var(--bad); }
.truncate { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-side { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
    .sidebar { position: fixed; left: 0; top: 0; z-index: 30; transform: translateX(-100%); transition: transform .2s; }
    body.nav-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
    .menu-toggle { display: inline-flex; }
    .topbar, .content { padding-left: 16px; padding-right: 16px; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    dl.kv { grid-template-columns: 1fr; gap: 2px; }
    dl.kv dd { margin-bottom: 8px; }
}
