/* =========================================================
   ADMIN PAGE
   ========================================================= */

.admin-main-card {
  width: 100%;
  max-width: none;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.admin-sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 420px));
  gap: 18px;
}

.admin-section-link-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: 0.2s ease;
}

.admin-section-link-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
  border-color: rgba(255, 255, 255, 0.16);
}

.admin-section-link-icon {
  width: 58px;
  height: 58px;
  min-width: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.95), rgba(124, 58, 237, 0.95));
  color: #fff;
  box-shadow: 0 12px 28px rgba(79, 70, 229, 0.2);
}

.admin-section-link-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-section-link-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.admin-section-link-content strong {
  font-size: 20px;
  line-height: 1.2;
  color: var(--text);
}

.admin-section-link-content span {
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}

.admin-section-link-arrow {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--text);
}

.admin-section-link-arrow svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-back-row {
  display: flex;
  align-items: center;
}

.admin-back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.admin-back-link svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-section-head {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.admin-section-head h3 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
}

.admin-section-head p {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 220px));
  gap: 14px;
}

.admin-summary-card {
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.admin-summary-card span {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--muted);
}

.admin-summary-card strong {
  font-size: 28px;
  line-height: 1;
  color: var(--text);
}

.admin-summary-card.success {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.14), rgba(34, 197, 94, 0.05));
  border-color: rgba(34, 197, 94, 0.24);
}

.admin-summary-card.warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(245, 158, 11, 0.05));
  border-color: rgba(245, 158, 11, 0.24);
}

.admin-table-card {
  width: 100%;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  min-width: 1280px;
  border-collapse: collapse;
}

.admin-table thead th {
  padding: 16px 18px;
  text-align: left;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.admin-table tbody td {
  padding: 18px;
  vertical-align: middle;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 14px;
}

.admin-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-user-id {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(99, 102, 241, 0.28);
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.18);
  color: #ddd6fe;
  font-weight: 700;
}

.admin-user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.admin-user-avatar {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.95), rgba(124, 58, 237, 0.95));
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(79, 70, 229, 0.2);
}

.admin-user-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.admin-user-meta strong {
  font-size: 15px;
  color: var(--text);
}

.admin-user-meta span {
  font-size: 12px;
  color: var(--muted);
}

.admin-email-field {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: #f3f4f6;
  font-size: 13px;
  font-weight: 600;
}

.admin-email-field-empty {
  color: var(--muted);
}

.admin-password {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: #f3f4f6;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.admin-plan {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.24);
  color: #93c5fd;
  font-size: 13px;
  font-weight: 600;
}

.admin-max-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.admin-max-badge.connected {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.22);
  color: #34d399;
}

.admin-max-badge.disconnected {
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.22);
  color: #fbbf24;
}

.admin-max-icon {
  width: 22px;
  height: 22px;
  min-width: 22px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  color: currentColor;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.admin-mobile-list {
  display: none;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.admin-mobile-card {
  width: 100%;
  box-sizing: border-box;
  padding: 18px 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.admin-mobile-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-mobile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

.admin-mobile-item {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  box-sizing: border-box;
}

.admin-mobile-item span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}

.admin-mobile-item strong {
  font-size: 14px;
  color: var(--text);
  word-break: break-word;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1200px) {
  .admin-summary {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }
}

@media (max-width: 900px) {
  .admin-summary {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .admin-table {
    min-width: 1100px;
  }
}

@media (max-width: 760px) {
  .admin-section-head h3 {
    font-size: 24px;
  }

  .admin-table-card {
    display: none;
  }

  .admin-mobile-list {
    display: flex;
  }

  .admin-sections-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .admin-main-card {
    gap: 18px;
  }

  .admin-back-row {
    width: 100%;
  }

  .admin-back-link {
    min-height: 42px;
    padding: 0 16px;
    border-radius: 16px;
  }

  .admin-section {
    gap: 18px;
  }

  .admin-section-head {
    gap: 14px;
  }

  .admin-section-head h3 {
    font-size: 22px;
    line-height: 1.15;
  }

  .admin-section-head p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
  }

  .admin-summary {
    width: 100%;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .admin-summary-card {
    width: 100%;
    box-sizing: border-box;
    padding: 18px 20px;
    border-radius: 24px;
  }

  .admin-summary-card strong {
    font-size: 30px;
  }

  .admin-mobile-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
  }

  .admin-user-cell {
    width: 100%;
  }

  .admin-mobile-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .admin-mobile-item {
    width: 100%;
    padding: 14px 16px;
    border-radius: 18px;
  }

  .admin-mobile-item span {
    margin-bottom: 8px;
    font-size: 12px;
  }

  .admin-mobile-item strong {
    font-size: 15px;
    line-height: 1.35;
  }

  .admin-section-link-card {
    padding: 18px 16px;
    border-radius: 22px;
  }

  .admin-section-link-content strong {
    font-size: 18px;
  }

  .admin-section-link-content span {
    font-size: 13px;
  }
}