/* ===================================================================
   dashboard.css — sidebar layout, stat cards, tables, favorites
   =================================================================== */

.dash {
    display: grid;
    grid-template-columns: 264px 1fr;
    gap: 26px;
    padding-top: 30px;
    padding-bottom: 60px;
    align-items: start;
}

/* ------------------------------------------------ Sidebar */
.dash-sidebar {
    position: sticky; top: calc(var(--nav-h) + 20px);
    display: flex; flex-direction: column; gap: 18px;
    padding: 20px;
    background: linear-gradient(180deg, var(--bg-elevated), var(--surface));
    border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.dash-profile { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.dash-avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-family: var(--font-display); color: #fff; background: linear-gradient(135deg, var(--primary), var(--accent)); }
.dash-profile__meta { display: flex; flex-direction: column; overflow: hidden; }
.dash-profile__meta strong { font-size: .96rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dash-nav { display: flex; flex-direction: column; gap: 4px; }
.dash-nav__item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--radius); color: var(--text-muted); font-weight: 600; font-size: .94rem; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.dash-nav__item:hover { background: var(--surface-2); color: var(--text); }
.dash-nav__item.is-active { background: var(--accent-soft); color: var(--accent); }
.dash-nav__icon { width: 20px; text-align: center; }
.dash-nav__cta { margin-top: 8px; background: var(--primary); color: #fff; }
.dash-nav__cta:hover { background: var(--primary-600); color: #fff; }
.dash-nav__admin { color: var(--warning); }
.dash-nav__admin:hover { background: rgba(255, 204, 77, .12); color: var(--warning); }
.dash-logout { margin-top: auto; }

/* ------------------------------------------------ Content */
.dash-content { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.dash-head h1 { font-size: clamp(1.5rem, 3vw, 2rem); }

.panel-title { font-size: 1.05rem; margin-bottom: 16px; }
.panel-link { display: inline-block; margin-top: 14px; font-weight: 600; font-size: .9rem; }
.empty { padding: 10px 0; }

/* ---- Continue banner ---- */
.continue { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.continue h3 { margin: 12px 0 4px; font-size: 1.25rem; }

/* ---- Stat cards ---- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card { display: flex; flex-direction: column; gap: 6px; }
.stat-card__icon { font-size: 1.4rem; }
.stat-card__value { font-family: var(--font-display); font-size: 1.9rem; line-height: 1; }
.stat-card.tone-ok .stat-card__value { color: #7ee6a8; }
.stat-card.tone-accent .stat-card__value { color: var(--accent); }
.stat-card.tone-gold .stat-card__value { color: var(--warning); }

.dash-two-col { display: grid; grid-template-columns: 1fr 1.4fr; gap: 22px; align-items: start; }

/* ---- Progress ring ---- */
.progress-ring {
    --val: 0;
    width: 150px; height: 150px; margin: 6px auto 18px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: conic-gradient(var(--primary) calc(var(--val) * 1%), var(--surface-2) 0);
    position: relative;
}
.progress-ring::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--bg-elevated); }
.progress-ring span { position: relative; font-family: var(--font-display); font-size: 1.7rem; font-weight: 800; }
.mini-legend { list-style: none; display: grid; gap: 8px; }
.mini-legend li { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: .9rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-dim); display: inline-block; }
.dot-ok { background: var(--success); }
.dot-bad { background: var(--danger); }

/* ---- Exam list ---- */
.exam-list { list-style: none; display: flex; flex-direction: column; }
.exam-list li { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); }
.exam-list li:last-child { border-bottom: 0; }
.exam-list strong { display: block; }

/* ---- Bars (statistics) ---- */
.bar-list { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 54px; align-items: center; gap: 12px; }
.bar-row__label { font-size: .85rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 10px; background: var(--surface-2); border-radius: var(--radius-pill); overflow: hidden; }
.bar__fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .6s var(--ease); }
.bar-row__val { font-size: .82rem; color: var(--text-muted); text-align: right; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.data-table th, .data-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table th { color: var(--text-dim); font-weight: 700; font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; }
.data-table tbody tr:hover { background: var(--surface); }

/* ---- Settings ---- */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.save-hint { font-size: .85rem; color: #7ee6a8; }

/* ---- Favorites ---- */
.fav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.fav-card { position: relative; overflow: hidden; display: flex; flex-direction: column; }
.fav-card__img { aspect-ratio: 16/10; overflow: hidden; background: var(--bg); }
.fav-card__img img { width: 100%; height: 100%; object-fit: cover; }
.fav-card__body { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.fav-card__text { font-size: .92rem; color: var(--text); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.fav-remove { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer; background: rgba(5,15,27,.7); color: #fff; font-size: .85rem; backdrop-filter: blur(6px); transition: background var(--dur); }
.fav-remove:hover { background: var(--danger); }

/* ---- Empty state ---- */
.empty-state { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 50px 24px; }
.empty-state__icon { font-size: 3rem; }

/* ------------------------------------------------ Responsive */
@media (max-width: 980px) {
    .dash { grid-template-columns: 1fr; }
    .dash-sidebar { position: static; flex-direction: row; flex-wrap: wrap; align-items: center; }
    .dash-profile { border-bottom: 0; padding-bottom: 0; flex: 1 1 200px; }
    .dash-nav { flex-direction: row; flex-wrap: wrap; flex: 1 1 100%; }
    .dash-logout { margin-top: 0; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .dash-two-col { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .bar-row { grid-template-columns: 88px 1fr 46px; }
}
