/* =============================================
   StudentMarket — Auth & Dashboard CSS
   ============================================= */

/* ---- AUTH PAGES ---- */
.auth-page {
  min-height: 100vh;
  display: flex; flex-direction: column;
  background: var(--bg-light);
}
.auth-main {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 100px 24px 60px;
}
.auth-card {
  background: #fff; border-radius: 24px;
  padding: 48px 44px; width: 100%; max-width: 440px;
  box-shadow: 0 8px 48px rgba(26,115,232,0.10);
}
.auth-card__icon {
  width: 64px; height: 64px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; margin: 0 auto 20px;
}
.auth-card__icon--blue   { background: var(--blue-lt); color: var(--blue); }
.auth-card__icon--green  { background: #d1fae5; color: var(--green); }
.auth-card__icon--purple { background: #ede9fe; color: #7c3aed; }

.auth-card__title {
  font-size: 24px; font-weight: 800; color: var(--text);
  text-align: center; margin-bottom: 6px;
}
.auth-card__sub {
  font-size: 14px; color: var(--text-2); text-align: center; margin-bottom: 32px;
}

.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text); margin-bottom: 7px;
}
.form-input {
  width: 100%; padding: 12px 16px;
  border: 1.5px solid var(--border); border-radius: 12px;
  font-family: var(--font); font-size: 15px; color: var(--text);
  background: var(--bg); transition: border-color .18s, box-shadow .18s;
  outline: none;
}
.form-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.12);
}
.form-input-wrap { position: relative; }
.form-input-wrap .form-input { padding-right: 44px; }
.form-input-wrap .form-eye {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--text-2); font-size: 16px; padding: 4px;
}
.form-eye:hover { color: var(--blue); }

.form-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; font-size: 13px;
}
.form-footer label { display: flex; align-items: center; gap: 7px; cursor: pointer; color: var(--text-2); }
.form-footer a { color: var(--blue); }
.form-footer a:hover { text-decoration: underline; }

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; color: var(--text-2); margin: 20px 0;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

.auth-switch {
  text-align: center; font-size: 14px; color: var(--text-2); margin-top: 20px;
}
.auth-switch a { color: var(--blue); font-weight: 600; }
.auth-switch a:hover { text-decoration: underline; }

.auth-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; color: var(--text-2); margin-bottom: 24px;
  transition: color .15s;
}
.auth-back:hover { color: var(--text); }

/* Auth tabs (login/register toggle) */
.auth-tabs {
  display: flex; gap: 4px; margin-bottom: 20px;
  background: var(--bg-light); border-radius: 10px; padding: 4px;
}
.auth-tabs a {
  flex: 1; text-align: center; padding: 8px;
  border-radius: 8px; font-size: 13px; font-weight: 600;
  color: var(--text-2); transition: all .15s;
}
.auth-tabs a.active {
  background: #fff; color: var(--blue);
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.auth-tabs a:hover:not(.active) { color: var(--text); }

/* Auth messages (error/success) */
.auth-err {
  background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5;
  border-radius: 10px; padding: 10px 14px; font-size: 13px;
  margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}
.auth-ok {
  background: #d1fae5; color: #065f46; border: 1px solid #86efac;
  border-radius: 10px; padding: 10px 14px; font-size: 13px;
  margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}

/* ---- DASHBOARD LAYOUT ---- */
.dash {
  display: flex; min-height: 100vh; background: var(--bg-light);
}

/* Sidebar */
.sidebar {
  width: 240px; flex-shrink: 0;
  background: #1e293b;
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
  transition: transform .25s;
}
.sidebar__logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid #334155;
}
.sidebar__logo img { height: 32px; }

.sidebar__nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.sidebar__nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  font-size: 14px; font-weight: 500; color: rgba(255,255,255,.6);
  transition: background .15s, color .15s; margin-bottom: 2px;
}
.sidebar__nav a i { font-size: 17px; flex-shrink: 0; }
.sidebar__nav a:hover { background: #334155; color: #e2e8f0; }
.sidebar__nav a.active { background: linear-gradient(135deg,#6366f1,#818cf8); color: #fff; box-shadow: 0 4px 12px rgba(99,102,241,.25); }
.sidebar__nav .nav-section {
  font-size: 11px; font-weight: 700; color: #475569;
  text-transform: uppercase; letter-spacing: .06em;
  padding: 16px 12px 6px; margin-top: 4px;
}

.sidebar__footer {
  padding: 16px 12px;
  border-top: 1px solid #334155;
}
.sidebar__user {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border-radius: 10px; cursor: pointer; transition: background .15s;
}
.sidebar__user:hover { background: rgba(255,255,255,.06); }
.sidebar__avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
}
.sidebar__user-info { flex: 1; min-width: 0; }
.sidebar__user-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__user-role { font-size: 11px; color: rgba(255,255,255,.4); }
.sidebar__logout { color: rgba(255,255,255,.4); font-size: 15px; transition: color .15s; }
.sidebar__logout:hover { color: #fff; }

/* Main content */
.dash__main {
  flex: 1; margin-left: 240px;
  display: flex; flex-direction: column; min-height: 100vh;
}
.dash__topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(245,247,255,.9); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 32px; height: 60px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.dash__topbar-left { display: flex; align-items: center; gap: 12px; }
.dash__page-title { font-size: 18px; font-weight: 700; color: var(--text); }
.dash__topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: #fff; border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--text-2); cursor: pointer;
  position: relative; transition: border-color .15s;
}
.topbar-btn:hover { border-color: var(--blue); color: var(--blue); }
.topbar-btn .badge-dot {
  position: absolute; top: 3px; right: 3px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); border: 2px solid var(--bg-light);
}
.dash__content { flex: 1; padding: 32px; }

/* Sidebar mobile toggle */
.sidebar-toggle {
  display: none; background: none; border: none; cursor: pointer;
  font-size: 20px; color: var(--text); padding: 4px;
}

/* ---- DASHBOARD WIDGETS ---- */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 20px; margin-bottom: 28px;
}
.stat-card {
  background: #fff; border-radius: 16px;
  padding: 22px 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}
.stat-card__top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.stat-card__icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.stat-card__trend {
  font-size: 12px; font-weight: 600; padding: 3px 8px;
  border-radius: 50px;
}
.stat-card__trend--up   { background: #d1fae5; color: #065f46; }
.stat-card__trend--down { background: #fee2e2; color: #991b1b; }
.stat-card__trend--neu  { background: var(--bg-light); color: var(--text-2); }
.stat-card__val { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1; margin-bottom: 4px; }
.stat-card__label { font-size: 13px; color: var(--text-2); }

.section-card {
  background: #fff; border-radius: 16px;
  padding: 24px; margin-bottom: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}
.section-card__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.section-card__title { font-size: 16px; font-weight: 700; color: var(--text); }
.section-card__action { font-size: 13px; font-weight: 600; color: var(--blue); }
.section-card__action:hover { text-decoration: underline; }

/* Table */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  font-size: 12px; font-weight: 600; color: var(--text-2);
  text-transform: uppercase; letter-spacing: .05em;
  padding: 0 16px 12px; text-align: left; border-bottom: 1px solid var(--border);
}
.data-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--text); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-light); }

/* Status badges */
.status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 50px;
}
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.status--new      { background: #dbeafe; color: #1d4ed8; }
.status--progress { background: #fef3c7; color: #b45309; }
.status--review   { background: #ede9fe; color: #6d28d9; }
.status--done     { background: #d1fae5; color: #065f46; }
.status--canceled { background: #fee2e2; color: #991b1b; }

/* Order card (mobile-friendly) */
.order-meta { display: flex; align-items: center; gap: 8px; }
.order-meta__title { font-weight: 600; font-size: 14px; color: var(--text); }
.order-meta__type { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* Two-col grid */
.dash-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.dash-grid-3-1 { display: grid; grid-template-columns: 1fr 340px; gap: 24px; margin-bottom: 24px; }

/* Action buttons in topbar */
.btn--sm-dash {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 10px; font-size: 13px; font-weight: 600;
  border: none; cursor: pointer; font-family: var(--font);
}
.btn--sm-dash--blue { background: var(--blue); color: #fff; }
.btn--sm-dash--blue:hover { background: var(--blue-dk); }
.btn--sm-dash--outline { background: #fff; color: var(--text); border: 1.5px solid var(--border); }
.btn--sm-dash--outline:hover { border-color: var(--blue); color: var(--blue); }

/* Mini profile card */
.profile-mini {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px; border-radius: 50px;
  border: 1.5px solid var(--border); cursor: pointer;
  transition: border-color .15s;
}
.profile-mini:hover { border-color: var(--blue); }
.profile-mini__avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.profile-mini__name { font-size: 13px; font-weight: 600; color: var(--text); }

/* Empty state */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-state i { font-size: 40px; color: var(--border); margin-bottom: 12px; display: block; }
.empty-state p { color: var(--text-2); font-size: 14px; }

/* Responsive dashboard */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid-3-1 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .sidebar-overlay {
    display: none; position: fixed; inset: 0; z-index: 49;
    background: rgba(0,0,0,.4); backdrop-filter: blur(2px);
  }
  .sidebar.open + .sidebar-overlay { display: block; }
  .dash__main { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .dash__content { padding: 20px 16px; }
  .dash__topbar { padding: 0 16px; }
  .dash-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-card { padding: 16px; }
  .stat-card__val { font-size: 22px; }
  .auth-card { padding: 32px 24px; }
}

/* Auth page footer wave — прозрачный фон, SVG рисует тёмный цвет снизу */
.auth-footer-wave {
  background: transparent;
  line-height: 0; overflow: hidden;
  margin-bottom: -1px;
}
.auth-footer-wave svg { display: block; width: 100%; height: 80px; }
