/* ===================================================
   Qonaq Admin — общие стили
   =================================================== */

:root {
  --ink: #0f172a;
  --ink-2: #1e293b;
  --muted: #64748b;
  --accent: #1BB4B0;
  --accent-dark: #0d9e9a;
  --border: #e2e8f0;
  --bg: #f1f5f9;
  --white: #ffffff;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #22c55e;
  --sidebar-w: 240px;
  --header-h: 56px;
  --r: 12px;
}

*, *::before, *::after { box-sizing: border-box; }

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

a { color: inherit; text-decoration: none; }

/* ===== LAYOUT ===== */

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

/* ===== SIDEBAR ===== */

.sidebar {
  width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 800;
  font-size: 15px;
  color: var(--ink);
}

.sidebar-brand img { height: 28px; }

.sidebar-badge {
  font-size: 10px;
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
  font-weight: 700;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.nav-section {
  padding: 8px 16px 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--muted);
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  border-left: 3px solid transparent;
  font-size: 13.5px;
}

.nav-item:hover {
  color: var(--ink);
  background: var(--bg);
}

.nav-item.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: #f0fafa;
  font-weight: 700;
}

.nav-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}

.sidebar-user-info { flex: 1; overflow: hidden; }
.sidebar-user-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 11px; color: var(--muted); text-transform: capitalize; }

.btn-logout {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
}
.btn-logout:hover { color: var(--danger); }
.btn-logout svg { width: 16px; height: 16px; }

/* ===== MAIN CONTENT ===== */

.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-header {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.admin-header-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.admin-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-switcher {
  display: flex;
  gap: 4px;
}

.lang-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.lang-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.admin-content {
  padding: 24px;
  flex: 1;
}

/* ===== CARDS ===== */

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--ink);
}

/* ===== STAT CARDS ===== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px;
}

.stat-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
}

.stat-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* ===== TABLE ===== */

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }

/* ===== BADGES ===== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-green { background: #dcfce7; color: #15803d; }
.badge-red { background: #fee2e2; color: #dc2626; }
.badge-yellow { background: #fef9c3; color: #92400e; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-gray { background: #f1f5f9; color: var(--muted); }
.badge-teal { background: #ccfbf1; color: #0f766e; }

/* ===== BUTTONS ===== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--ink);
  transition: all .15s;
}
.btn:hover { background: var(--bg); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.btn-danger:hover { opacity: .85; }

.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }

/* ===== FORM ===== */

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.label { font-size: 12px; font-weight: 700; color: var(--muted); }
.input {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 13.5px;
  outline: none;
  background: var(--white);
  color: var(--ink);
  width: 100%;
}
.input:focus { border-color: var(--accent); }

/* ===== ROLE COLORS ===== */
.role-superadmin { color: #7c3aed; font-weight: 700; }
.role-support { color: #0891b2; font-weight: 700; }
.role-moderator { color: #d97706; font-weight: 700; }
.role-host { color: #15803d; font-weight: 700; }
.role-guest { color: var(--muted); }

/* ===== EMPTY STATE ===== */
.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}
.empty svg { width: 40px; height: 40px; margin-bottom: 12px; opacity: .4; }
.empty p { margin: 0; font-size: 14px; }
