/* Minimal panel styles, visually matching the Starsor admin (colors, font, cards, tables) */
@font-face { font-family: IRANYekanX; font-weight: 400; font-display: swap; src: url("../fonts/IRANYekanX-Regular.woff2") format("woff2"); }
@font-face { font-family: IRANYekanX; font-weight: 500; font-display: swap; src: url("../fonts/IRANYekanX-Medium.woff2") format("woff2"); }
@font-face { font-family: IRANYekanX; font-weight: 700; font-display: swap; src: url("../fonts/IRANYekanX-Bold.woff2") format("woff2"); }

:root {
    --bg: #f6f7f9; --card: #fff; --text: #1c1c25; --muted: #8f9bad; --border: #efefef; --line: #f0f2f5;
    --primary: #0060ff; --primary-soft: #e3edf8; --danger: #fa4248; --danger-soft: #feecec;
    --success: #16a085; --success-soft: #e3f6f1; --soft: #f6f9fc; --code: #1c1c25;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1c1c25; --card: #262631; --text: #e9e9ef; --muted: #848491; --border: #353542; --line: #353542;
        --primary-soft: #26324d; --danger-soft: #4a2a2f; --success-soft: #1f3d37; --soft: #353542; --code: #14141b;
    }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 14px/1.7 IRANYekanX, Tahoma, sans-serif; }
a { color: var(--primary); text-decoration: none; }
h1 { font-size: 18px; font-weight: 700; margin: 0; }
.ltr { direction: ltr; text-align: left; unicode-bidi: plaintext; }
.muted { color: var(--muted); font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }

/* sidebar */
.sidebar { position: fixed; top: 0; bottom: 0; right: 0; width: 260px; background: var(--card); border-left: 1px dashed #bec8d0; padding: 0 18px 20px; overflow-y: auto; }
.brand { display: flex; align-items: center; height: 64px; font-weight: 700; font-size: 20px; color: var(--text); }
.brand::before { content: ""; width: 4px; height: 20px; background: var(--primary); margin-left: 8px; }
.nav-title { color: var(--muted); font-size: 12px; margin: 18px 4px 6px; }
.nav a { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-radius: 10px; color: var(--text); margin-bottom: 2px; }
.nav a:hover { background: var(--soft); }
.nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 500; }
.nav .pill { font-size: 11px; background: var(--soft); color: var(--muted); border-radius: 20px; padding: 0 8px; }
.sidebar form { margin-top: 18px; }

.main { margin-right: 260px; padding: 24px; min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }

@media (max-width: 900px) {
    .sidebar { position: static; width: auto; border-left: 0; border-bottom: 1px dashed #bec8d0; max-height: none; }
    .main { margin-right: 0; padding: 16px; }
}

/* cards, tables */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 18px; margin-bottom: 16px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: right; font-weight: 500; color: var(--muted); font-size: 13px; padding: 10px 12px; background: var(--soft); white-space: nowrap; }
th:first-child { border-radius: 0 10px 10px 0; }
th:last-child { border-radius: 10px 0 0 10px; }
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.truncate { overflow: hidden; max-width: 0; }
.clip { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 32px 0; }

.badge { display: inline-block; border-radius: 20px; padding: 2px 12px; font-size: 13px; font-weight: 500; background: var(--primary-soft); color: var(--primary); }
.badge.red { background: var(--danger-soft); color: var(--danger); }

/* forms, buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 8px; padding: 7px 16px; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; background: var(--primary); color: #fff; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); }
.btn.light { background: var(--soft); color: var(--text); }
.btn.danger { background: var(--danger); }
.btn.danger-soft { background: var(--danger-soft); color: var(--danger); }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.input { border: 1px solid var(--border); background: var(--card); color: var(--text); border-radius: 8px; padding: 7px 12px; font: inherit; min-width: 0; }
.input:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row .input { flex: 1; }
.inline { display: inline; }

.alert { border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; background: var(--success-soft); color: var(--success); }
.alert.error { background: var(--danger-soft); color: var(--danger); }

/* project key box */
.key { display: flex; gap: 6px; align-items: center; }
.key code { background: var(--soft); border-radius: 6px; padding: 4px 8px; direction: ltr; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }

/* fault details */
.details { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; word-break: break-all; }
pre.trace { background: var(--code); color: #e9e9ef; border-radius: 10px; padding: 16px; overflow-x: auto; direction: ltr; text-align: left; font-size: 12.5px; line-height: 1.8; margin: 0; white-space: pre; }
@media (max-width: 600px) { .details { grid-template-columns: 1fr; gap: 2px; } .details dd { margin-bottom: 8px; } }

/* pagination */
.pagination { display: flex; gap: 4px; justify-content: center; list-style: none; padding: 0; margin: 16px 0 0; flex-wrap: wrap; }
.pagination a, .pagination span { display: block; min-width: 34px; text-align: center; padding: 4px 10px; border-radius: 8px; background: var(--soft); color: var(--text); }
.pagination .active span { background: var(--primary); color: #fff; }
.pagination .disabled span { opacity: .5; }

/* login */
.login { max-width: 380px; margin: 12vh auto; padding: 0 16px; }
.login .input { width: 100%; margin-bottom: 12px; }
.login .btn { width: 100%; justify-content: center; padding: 9px; }
