/* kafeLayehe admin panel. Bootstrap RTL + site tokens. Loaded globally but every rule is scoped to .adm-* classes. */
.adm-shell { display: flex; min-height: 100vh; background: #f4f1ea; }
.adm-side { width: 16.5rem; flex: 0 0 16.5rem; background: var(--kl-navy-900); color: #dfe4f2; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 1050; }
.adm-brand { display: flex; align-items: center; gap: .6rem; padding: 1rem 1.1rem; color: #fff; text-decoration: none; font-weight: 800; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.adm-brand:hover { color: var(--kl-amber); }
.adm-group { padding: 1rem 1.1rem .3rem; font-size: .78rem; color: #9aa6c6; font-weight: 700; letter-spacing: .02em; }
.adm-link { display: flex; align-items: center; gap: .65rem; padding: .55rem 1.1rem; color: #dfe4f2; text-decoration: none; border-inline-start: 3px solid transparent; font-weight: 500; }
.adm-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.adm-link.active { background: rgba(232, 172, 85, .14); color: #fff; border-inline-start-color: var(--kl-amber); font-weight: 700; }
.adm-link i { font-size: 1.05rem; width: 1.3rem; text-align: center; }
.adm-soon { margin-inline-start: auto; font-size: .68rem; background: rgba(255, 255, 255, .12); border-radius: 999px; padding: .05rem .5rem; color: #cbd3ea; }
.adm-side-foot { margin-top: auto; padding: .9rem 1.1rem; border-top: 1px solid rgba(255, 255, 255, .08); }
.adm-side-foot a { color: #b8c2e0; text-decoration: none; font-size: .9rem; }
.adm-side-foot a:hover { color: var(--kl-amber); }
.adm-backdrop { display: none; }

.adm-main-col { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.adm-top { position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; gap: .75rem; padding: .6rem 1.25rem; background: #fff; border-bottom: 1px solid var(--kl-line); }
.adm-burger { display: none; background: none; border: 1.5px solid var(--kl-line); border-radius: var(--kl-radius-sm); width: 2.5rem; height: 2.5rem; font-size: 1.4rem; line-height: 1; color: var(--kl-navy); }
.adm-crumb { display: flex; align-items: center; gap: .5rem; flex: 1; min-width: 0; font-size: .92rem; color: var(--kl-muted); }
.adm-crumb a { color: var(--kl-muted); text-decoration: none; }
.adm-crumb a:hover { color: var(--kl-navy); }
.adm-crumb span { color: var(--kl-navy); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-user { display: flex; align-items: center; gap: .6rem; }
.adm-user-chip { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; color: var(--kl-navy); }
.adm-content { padding: 1.25rem; flex: 1; }
.adm-content:focus { outline: none; }

@media (max-width: 991.98px) {
  .adm-side { position: fixed; inset-block: 0; inset-inline-start: 0; transform: translateX(100%); transition: transform .25s var(--kl-ease); box-shadow: var(--kl-shadow-lg); }
  .adm-side.open { transform: none; }
  .adm-backdrop { display: block; position: fixed; inset: 0; background: rgba(18, 26, 51, .5); border: 0; z-index: 1040; }
  .adm-burger { display: inline-grid; place-items: center; }
  .adm-content { padding: .85rem; }
  .adm-top { padding: .5rem .75rem; }
}

/* Page head */
.adm-page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.adm-page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Cards on the dashboard */
.adm-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .9rem; }
.adm-card { display: flex; align-items: center; gap: .7rem; padding: 1rem; background: #fff; border: 1px solid var(--kl-line); border-radius: var(--kl-radius); color: var(--kl-navy); text-decoration: none; font-weight: 700; transition: transform .18s var(--kl-ease), box-shadow .18s; }
.adm-card:hover { transform: translateY(-2px); box-shadow: var(--kl-shadow); color: var(--kl-navy); }
.adm-card i { font-size: 1.4rem; color: var(--kl-caramel); }
.adm-card .adm-soon { background: #efe7d6; color: var(--kl-muted); }

/* Panels / filters */
.adm-panel { background: #fff; border: 1px solid var(--kl-line); border-radius: var(--kl-radius); padding: 1rem; margin-bottom: 1rem; }
.adm-filters { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: flex-end; }
.adm-filters .form-control, .adm-filters .form-select { min-width: 10rem; }
.adm-range { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; border: 0; margin: 0; padding: 0; min-width: 0; }
.adm-range-field { min-width: 13rem; }
.adm-range-clear { margin-bottom: .2rem; }

/* Tabs */
.adm-tabs { display: flex; gap: .25rem; flex-wrap: wrap; border-bottom: 2px solid var(--kl-line); margin-bottom: 1rem; }
.adm-tab { background: none; border: 0; padding: .6rem 1.1rem; font-weight: 700; color: var(--kl-muted); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.adm-tab:hover { color: var(--kl-navy); }
.adm-tab.active { color: var(--kl-navy); border-bottom-color: var(--kl-amber); }

/* Table */
.adm-table-wrap { background: #fff; border: 1px solid var(--kl-line); border-radius: var(--kl-radius); overflow: hidden; }
.adm-table { font-size: .93rem; --bs-table-bg: transparent; }
.adm-table thead th { background: #faf6ec; color: var(--kl-navy); font-weight: 800; white-space: nowrap; border-bottom: 1px solid var(--kl-line); }
.adm-table tbody tr:hover { background: #fcf9f2; }
.adm-table td { vertical-align: middle; }
.adm-sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; display: inline-flex; gap: .35rem; align-items: center; }
.adm-sort i { font-size: .8rem; opacity: .55; }
.adm-actions-col { text-align: end; white-space: nowrap; }
.adm-empty { text-align: center; color: var(--kl-muted); padding: 2rem 1rem !important; }
.adm-pager { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; padding: .6rem .9rem; border-top: 1px solid var(--kl-line); background: #fffdf9; }
.adm-pager-nav { display: flex; align-items: center; gap: .35rem; }
.adm-pager-nav .btn { padding: .2rem .55rem; }
.adm-page-ind { padding: 0 .5rem; font-size: .9rem; }
.adm-size { width: 5rem; }

/* Badges & money */
.adm-badge { font-weight: 700; padding: .35em .7em; border-radius: 999px; font-size: .78rem; }
.adm-badge-ok { background: #dff3e8; color: #17603c; }
.adm-badge-bad { background: #fbe3e1; color: #98201a; }
.adm-badge-warn { background: #fdf0d2; color: #7a4d00; }
.adm-badge-info { background: #dfe9f7; color: #1d3f78; }
.adm-badge-neutral { background: #ece8de; color: #4a4f60; }
.adm-money { font-variant-numeric: tabular-nums; cursor: help; }
.adm-money-input { position: relative; }
.adm-money-input .form-control { padding-inline-end: 4.2rem; }
.adm-money-unit { position: absolute; inset-inline-end: .9rem; top: 50%; transform: translateY(-50%); color: var(--kl-muted); font-size: .85rem; pointer-events: none; }

/* 403 */
.adm-forbidden { text-align: center; padding: 3rem 1rem; }
.adm-forbidden .code { font-size: 4.5rem; font-weight: 900; color: var(--kl-caramel); line-height: 1.2; }

/* Info / notice boxes */
.adm-note { background: #fff7e6; border: 1px solid #f0d9a8; color: #6b4a00; border-radius: var(--kl-radius-sm); padding: .6rem .9rem; font-size: .92rem; }
.adm-note i { margin-inline-end: .35rem; }
.adm-kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
.adm-kv dt { color: var(--kl-muted); font-weight: 600; }
.adm-kv dd { margin: 0; word-break: break-word; }

/* Charts */
.adm-chart { margin: 0; }
.adm-chart svg { width: 100%; height: auto; display: block; direction: ltr; }
.adm-chart .grid { stroke: #e6dcc9; stroke-width: 1; }
.adm-chart .tick { fill: var(--kl-muted); font-size: 11px; font-family: var(--kl-font); }
.adm-chart .line { stroke-width: 2.5; stroke-linejoin: round; }
.adm-chart .c1 { stroke: var(--kl-navy); fill: var(--kl-navy); }
.adm-chart .c2 { stroke: var(--kl-caramel); fill: var(--kl-caramel); }
.adm-chart .c3 { stroke: var(--kl-teal); fill: var(--kl-teal); }
.adm-chart .c4 { stroke: #8a6fbf; fill: #8a6fbf; }
.adm-chart polyline.line { fill: none; }
.adm-legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .88rem; margin-top: .4rem; }
.adm-legend .swatch { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; margin-inline-end: .3rem; vertical-align: middle; }
.adm-legend .c1 { background: var(--kl-navy); } .adm-legend .c2 { background: var(--kl-caramel); } .adm-legend .c3 { background: var(--kl-teal); } .adm-legend .c4 { background: #8a6fbf; }
.adm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.adm-stat { background: #fff; border: 1px solid var(--kl-line); border-radius: var(--kl-radius); padding: .8rem 1rem; }
.adm-stat .v { font-size: 1.3rem; font-weight: 800; color: var(--kl-navy); }
.adm-stat .l { font-size: .82rem; color: var(--kl-muted); }

/* Chat viewer */
.adm-thread { display: flex; flex-direction: column; gap: .6rem; max-height: 60vh; overflow: auto; padding: .5rem; background: #faf6ec; border-radius: var(--kl-radius-sm); }
.adm-msg { max-width: 85%; padding: .55rem .85rem; border-radius: var(--kl-radius); white-space: pre-wrap; word-break: break-word; }
.adm-msg.user { align-self: flex-start; background: #fff; border: 1px solid var(--kl-line); }
.adm-msg.assistant { align-self: flex-end; background: var(--kl-navy); color: #fff; }
.adm-msg small { display: block; opacity: .7; font-size: .75rem; }

/* Ads */
.adm-listing { display: grid; gap: 1rem; }
.adm-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: .6rem; }
.adm-gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--kl-radius-sm); border: 1px solid var(--kl-line); background: #fff; }
.adm-img-missing { display: grid; place-items: center; aspect-ratio: 4/3; background: #efe7d6; color: var(--kl-muted); border-radius: var(--kl-radius-sm); }
.adm-logo { width: 4.5rem; height: 4.5rem; object-fit: contain; background: #fff; border: 1px solid var(--kl-line); border-radius: var(--kl-radius-sm); }

/* Audit diff */
.adm-diff td, .adm-diff th { font-size: .85rem; vertical-align: top; }
.adm-diff .changed { background: #fff6dd; }
.adm-diff .old { color: #98201a; text-decoration: line-through; text-decoration-color: rgba(152, 32, 26, .4); }
.adm-diff .new { color: #17603c; font-weight: 700; }
.adm-diff .val { font-family: ui-monospace, Consolas, monospace; direction: ltr; text-align: left; white-space: pre-wrap; word-break: break-all; }

/* SMS preview */
.adm-sms-preview { background: #e8f4ef; border-radius: 1rem 1rem 1rem .25rem; padding: .8rem 1rem; white-space: pre-wrap; border: 1px solid #cfe6dc; min-height: 4rem; }
.adm-chip { display: inline-block; background: #efe7d6; border-radius: 999px; padding: .1rem .6rem; font-family: ui-monospace, Consolas, monospace; font-size: .82rem; margin: .1rem; border: 0; direction: ltr; }
.adm-chip:hover { background: var(--kl-amber); }

.adm-modal-wide .kl-modal { width: min(52rem, 100%); }
